diff --git a/stepmania/src/ActorUtil.cpp b/stepmania/src/ActorUtil.cpp index 43106175a1..1f408d9a4f 100644 --- a/stepmania/src/ActorUtil.cpp +++ b/stepmania/src/ActorUtil.cpp @@ -51,12 +51,12 @@ Actor* MakeActor( CString sPath ) Actor* pActor = MakeActor( sNewPath ); float f; - if( ini.GetValueF( "Actor", "BaseRotationXDegrees", f ) ) pActor->SetBaseRotationX( f ); - if( ini.GetValueF( "Actor", "BaseRotationYDegrees", f ) ) pActor->SetBaseRotationY( f ); - if( ini.GetValueF( "Actor", "BaseRotationZDegrees", f ) ) pActor->SetBaseRotationZ( f ); - if( ini.GetValueF( "Actor", "BaseZoomX", f ) ) pActor->SetBaseZoomX( f ); - if( ini.GetValueF( "Actor", "BaseZoomY", f ) ) pActor->SetBaseZoomY( f ); - if( ini.GetValueF( "Actor", "BaseZoomZ", f ) ) pActor->SetBaseZoomZ( f ); + if( ini.GetValue ( "Actor", "BaseRotationXDegrees", f ) ) pActor->SetBaseRotationX( f ); + if( ini.GetValue ( "Actor", "BaseRotationYDegrees", f ) ) pActor->SetBaseRotationY( f ); + if( ini.GetValue ( "Actor", "BaseRotationZDegrees", f ) ) pActor->SetBaseRotationZ( f ); + if( ini.GetValue ( "Actor", "BaseZoomX", f ) ) pActor->SetBaseZoomX( f ); + if( ini.GetValue ( "Actor", "BaseZoomY", f ) ) pActor->SetBaseZoomY( f ); + if( ini.GetValue ( "Actor", "BaseZoomZ", f ) ) pActor->SetBaseZoomZ( f ); return pActor; } diff --git a/stepmania/src/BGAnimation.cpp b/stepmania/src/BGAnimation.cpp index b1a768040c..633cc954e8 100644 --- a/stepmania/src/BGAnimation.cpp +++ b/stepmania/src/BGAnimation.cpp @@ -77,7 +77,7 @@ void BGAnimation::LoadFromAniDir( CString sAniDir ) m_Layers.push_back( pLayer ); } - if( !ini.GetValueF( "BGAnimation", "LengthSeconds", m_fLengthSeconds ) ) + if( !ini.GetValue( "BGAnimation", "LengthSeconds", m_fLengthSeconds ) ) { m_fLengthSeconds = 0; for( i=0; (unsigned)i < m_Layers.size(); i++ ) diff --git a/stepmania/src/BGAnimationLayer.cpp b/stepmania/src/BGAnimationLayer.cpp index 3d52d30b89..e3e2a2e821 100644 --- a/stepmania/src/BGAnimationLayer.cpp +++ b/stepmania/src/BGAnimationLayer.cpp @@ -413,20 +413,20 @@ void BGAnimationLayer::LoadFromAniLayerFile( CString sPath ) ini.SetPath( sIniPath ); if( ini.ReadFile() ) { - ini.GetValueF( "BGAnimationLayer", "SetXpos", m_PosX ); - ini.GetValueF( "BGAnimationLayer", "SetYpos", m_PosY ); - ini.GetValueF( "BGAnimationLayer", "SetZoom", m_Zoom ); - ini.GetValueF( "BGAnimationLayer", "SetRot", m_Rot ); - ini.GetValueF( "BGAnimationLayer", "TweenStartTime", m_TweenStartTime ); - ini.GetValueF( "BGAnimationLayer", "TweenX", m_TweenX ); - ini.GetValueF( "BGAnimationLayer", "TweenY", m_TweenY ); - ini.GetValueF( "BGAnimationLayer", "TweenSpeed", m_TweenSpeed ); - ini.GetValueF( "BGAnimationLayer", "ShowTime", m_ShowTime ); - ini.GetValueF( "BGAnimationLayer", "HideTime", m_HideTime ); - ini.GetValueF( "BGAnimationLayer", "TexCoordVelocityX", m_vTexCoordVelocity.x ); - ini.GetValueF( "BGAnimationLayer", "TexCoordVelocityY", m_vTexCoordVelocity.y ); - ini.GetValueF( "BGAnimationLayer", "RotationalVelocity", m_fRotationalVelocity ); - ini.GetValueF( "BGAnimationLayer", "SetY", m_fStretchScrollH_Y ); + ini.GetValue( "BGAnimationLayer", "SetXpos", m_PosX ); + ini.GetValue( "BGAnimationLayer", "SetYpos", m_PosY ); + ini.GetValue( "BGAnimationLayer", "SetZoom", m_Zoom ); + ini.GetValue( "BGAnimationLayer", "SetRot", m_Rot ); + ini.GetValue( "BGAnimationLayer", "TweenStartTime", m_TweenStartTime ); + ini.GetValue( "BGAnimationLayer", "TweenX", m_TweenX ); + ini.GetValue( "BGAnimationLayer", "TweenY", m_TweenY ); + ini.GetValue( "BGAnimationLayer", "TweenSpeed", m_TweenSpeed ); + ini.GetValue( "BGAnimationLayer", "ShowTime", m_ShowTime ); + ini.GetValue( "BGAnimationLayer", "HideTime", m_HideTime ); + ini.GetValue( "BGAnimationLayer", "TexCoordVelocityX", m_vTexCoordVelocity.x ); + ini.GetValue( "BGAnimationLayer", "TexCoordVelocityY", m_vTexCoordVelocity.y ); + ini.GetValue( "BGAnimationLayer", "RotationalVelocity", m_fRotationalVelocity ); + ini.GetValue( "BGAnimationLayer", "SetY", m_fStretchScrollH_Y ); } if(m_ShowTime != 0) // they don't want to show until a certain point... hide it all @@ -527,31 +527,31 @@ void BGAnimationLayer::LoadFromIni( CString sAniDir, CString sLayer ) sPath = asElementPaths[0]; } - ini.GetValueI( sLayer, "Type", (int&)m_Type ); + ini.GetValue( sLayer, "Type", (int&)m_Type ); CLAMP( m_Type, (Type)0, TYPE_INVALID ); - ini.GetValue ( sLayer, "Command", m_sOnCommand ); - ini.GetValue ( sLayer, "OffCommand", m_sOffCommand ); - ini.GetValueF( sLayer, "FOV", m_fFOV ); - ini.GetValueB( sLayer, "Lighting", m_bLighting ); - ini.GetValueF( sLayer, "StretchTexCoordVelocityX", m_fStretchTexCoordVelocityX ); - ini.GetValueF( sLayer, "StretchTexCoordVelocityY", m_fStretchTexCoordVelocityY ); - ini.GetValueF( sLayer, "ZoomMin", m_fZoomMin ); - ini.GetValueF( sLayer, "ZoomMax", m_fZoomMax ); - ini.GetValueF( sLayer, "VelocityXMin", m_fVelocityXMin ); - ini.GetValueF( sLayer, "VelocityXMax", m_fVelocityXMax ); - ini.GetValueF( sLayer, "VelocityYMin", m_fVelocityYMin ); - ini.GetValueF( sLayer, "VelocityYMax", m_fVelocityYMax ); - ini.GetValueF( sLayer, "VelocityZMin", m_fVelocityZMin ); - ini.GetValueF( sLayer, "VelocityZMax", m_fVelocityZMax ); - ini.GetValueF( sLayer, "OverrideSpeed", m_fOverrideSpeed ); - ini.GetValueI( sLayer, "NumParticles", m_iNumParticles ); - ini.GetValueB( sLayer, "ParticlesBounce", m_bParticlesBounce ); - ini.GetValueF( sLayer, "TilesStartX", m_fTilesStartX ); - ini.GetValueF( sLayer, "TilesStartY", m_fTilesStartY ); - ini.GetValueF( sLayer, "TilesSpacingX", m_fTilesSpacingX ); - ini.GetValueF( sLayer, "TilesSpacingY", m_fTilesSpacingY ); - ini.GetValueF( sLayer, "TileVelocityX", m_fTileVelocityX ); - ini.GetValueF( sLayer, "TileVelocityY", m_fTileVelocityY ); + ini.GetValue( sLayer, "Command", m_sOnCommand ); + ini.GetValue( sLayer, "OffCommand", m_sOffCommand ); + ini.GetValue( sLayer, "FOV", m_fFOV ); + ini.GetValue( sLayer, "Lighting", m_bLighting ); + ini.GetValue( sLayer, "StretchTexCoordVelocityX", m_fStretchTexCoordVelocityX ); + ini.GetValue( sLayer, "StretchTexCoordVelocityY", m_fStretchTexCoordVelocityY ); + ini.GetValue( sLayer, "ZoomMin", m_fZoomMin ); + ini.GetValue( sLayer, "ZoomMax", m_fZoomMax ); + ini.GetValue( sLayer, "VelocityXMin", m_fVelocityXMin ); + ini.GetValue( sLayer, "VelocityXMax", m_fVelocityXMax ); + ini.GetValue( sLayer, "VelocityYMin", m_fVelocityYMin ); + ini.GetValue( sLayer, "VelocityYMax", m_fVelocityYMax ); + ini.GetValue( sLayer, "VelocityZMin", m_fVelocityZMin ); + ini.GetValue( sLayer, "VelocityZMax", m_fVelocityZMax ); + ini.GetValue( sLayer, "OverrideSpeed", m_fOverrideSpeed ); + ini.GetValue( sLayer, "NumParticles", m_iNumParticles ); + ini.GetValue( sLayer, "ParticlesBounce", m_bParticlesBounce ); + ini.GetValue( sLayer, "TilesStartX", m_fTilesStartX ); + ini.GetValue( sLayer, "TilesStartY", m_fTilesStartY ); + ini.GetValue( sLayer, "TilesSpacingX", m_fTilesSpacingX ); + ini.GetValue( sLayer, "TilesSpacingY", m_fTilesSpacingY ); + ini.GetValue( sLayer, "TileVelocityX", m_fTileVelocityX ); + ini.GetValue( sLayer, "TileVelocityY", m_fTileVelocityY ); if( IsBanner ) TEXTUREMAN->DisableOddDimensionWarning(); @@ -628,7 +628,7 @@ void BGAnimationLayer::LoadFromIni( CString sAniDir, CString sLayer ) TEXTUREMAN->EnableOddDimensionWarning(); bool bStartOnRandomFrame = false; - ini.GetValueB( sLayer, "StartOnRandomFrame", bStartOnRandomFrame ); + ini.GetValue( sLayer, "StartOnRandomFrame", bStartOnRandomFrame ); if( bStartOnRandomFrame ) { for( unsigned i=0; iWarn("Couldn't load '%s'", BannerPath.c_str() ); @@ -292,7 +292,7 @@ void BannerCache::CacheBanner( CString BannerPath ) { unsigned CurFullHash; const unsigned FullHash = GetHashForFile( BannerPath ); - if( BannerData.GetValueU( BannerPath, "FullHash", CurFullHash ) && + if( BannerData.GetValue( BannerPath, "FullHash", CurFullHash ) && CurFullHash == FullHash ) { /* It's identical. Just load it. */ diff --git a/stepmania/src/Font.cpp b/stepmania/src/Font.cpp index d4c8fb8f0e..b55f6b6645 100644 --- a/stepmania/src/Font.cpp +++ b/stepmania/src/Font.cpp @@ -475,15 +475,15 @@ void Font::LoadFontPageSettings(FontPageSettings &cfg, IniFile &ini, const CStri // LOG->Trace("Loading font page '%s' settings from page name '%s'", // TexturePath.c_str(), PageName.c_str()); - ini.GetValueI( PageName, "DrawExtraPixelsLeft", cfg.DrawExtraPixelsLeft ); - ini.GetValueI( PageName, "DrawExtraPixelsRight", cfg.DrawExtraPixelsRight ); - ini.GetValueI( PageName, "AddToAllWidths", cfg.AddToAllWidths ); - ini.GetValueF( PageName, "ScaleAllWidthsBy", cfg.ScaleAllWidthsBy ); - ini.GetValueI( PageName, "LineSpacing", cfg.LineSpacing ); - ini.GetValueI( PageName, "Top", cfg.Top ); - ini.GetValueI( PageName, "Baseline", cfg.Baseline ); - ini.GetValueI( PageName, "DefaultWidth", cfg.DefaultWidth ); - ini.GetValueI( PageName, "AdvanceExtraPixels", cfg.AdvanceExtraPixels ); + ini.GetValue( PageName, "DrawExtraPixelsLeft", cfg.DrawExtraPixelsLeft ); + ini.GetValue( PageName, "DrawExtraPixelsRight", cfg.DrawExtraPixelsRight ); + ini.GetValue( PageName, "AddToAllWidths", cfg.AddToAllWidths ); + ini.GetValue( PageName, "ScaleAllWidthsBy", cfg.ScaleAllWidthsBy ); + ini.GetValue( PageName, "LineSpacing", cfg.LineSpacing ); + ini.GetValue( PageName, "Top", cfg.Top ); + ini.GetValue( PageName, "Baseline", cfg.Baseline ); + ini.GetValue( PageName, "DefaultWidth", cfg.DefaultWidth ); + ini.GetValue( PageName, "AdvanceExtraPixels", cfg.AdvanceExtraPixels ); /* Iterate over all keys. */ const IniFile::key *k = ini.GetKey(PageName); @@ -778,7 +778,7 @@ void Font::Load(const CString &sFontOrTextureFilePath, CString sChars) ini.SetPath( IniPath ); ini.ReadFile(); ini.RenameKey("Char Widths", "main"); - ini.GetValueB( "main", "CapitalsOnly", CapitalsOnly ); + ini.GetValue( "main", "CapitalsOnly", CapitalsOnly ); } { diff --git a/stepmania/src/IniFile.cpp b/stepmania/src/IniFile.cpp index 3bc25a166f..9364f6c7bc 100644 --- a/stepmania/src/IniFile.cpp +++ b/stepmania/src/IniFile.cpp @@ -14,24 +14,20 @@ #include "IniFile.h" #include "RageUtil.h" #include "RageLog.h" +#include "RageFile.h" #include #include -using namespace std; -#include "RageFile.h" -//constructor, can specify pathname here instead of using SetPath later IniFile::IniFile(CString inipath) { path = inipath; } -//default destructor IniFile::~IniFile() { } -// sets path of ini file to read and write from void IniFile::SetPath(CString newpath) { path = newpath; @@ -41,7 +37,7 @@ void IniFile::SetPath(CString newpath) // returns true if successful, false otherwise bool IniFile::ReadFile() { -LOG->Trace("INI: Reading '%s'",path.c_str() ); + LOG->Trace("INI: Reading '%s'",path.c_str() ); FILE *f = fopen(path, "r"); if (f == NULL) @@ -166,7 +162,7 @@ bool IniFile::GetValue(const CString &keyname, const CString &valuename, CString } // gets value of [keyname] valuename = -bool IniFile::GetValueI(const CString &keyname, const CString &valuename, int& value) const +bool IniFile::GetValue(const CString &keyname, const CString &valuename, int& value) const { CString sValue; if( !GetValue(keyname,valuename,sValue) ) @@ -175,7 +171,7 @@ bool IniFile::GetValueI(const CString &keyname, const CString &valuename, int& v return true; } -bool IniFile::GetValueU(const CString &keyname, const CString &valuename, unsigned &value) const +bool IniFile::GetValue(const CString &keyname, const CString &valuename, unsigned &value) const { CString sValue; if( !GetValue(keyname,valuename,sValue) ) @@ -185,7 +181,7 @@ bool IniFile::GetValueU(const CString &keyname, const CString &valuename, unsign } // gets value of [keyname] valuename = -bool IniFile::GetValueF(const CString &keyname, const CString &valuename, float& value) const +bool IniFile::GetValue(const CString &keyname, const CString &valuename, float& value) const { CString sValue; if( !GetValue(keyname,valuename,sValue) ) @@ -195,7 +191,7 @@ bool IniFile::GetValueF(const CString &keyname, const CString &valuename, float& } // gets value of [keyname] valuename = -bool IniFile::GetValueB(const CString &keyname, const CString &valuename, bool& value) const +bool IniFile::GetValue(const CString &keyname, const CString &valuename, bool& value) const { CString sValue; if( !GetValue(keyname,valuename,sValue) ) diff --git a/stepmania/src/IniFile.h b/stepmania/src/IniFile.h index 7c7a1c6db2..0e813ca568 100644 --- a/stepmania/src/IniFile.h +++ b/stepmania/src/IniFile.h @@ -70,13 +70,10 @@ public: //gets value of [keyname] valuename = //returns "", or 0 if key/value not found. Sets error member to show problem bool GetValue(const CString &key, const CString &valuename, CString& value) const; - bool GetValueI(const CString &key, const CString &valuename, int& value) const; - bool GetValueU(const CString &key, const CString &valuename, unsigned& value) const; - bool GetValueF(const CString &key, const CString &valuename, float& value) const; - bool GetValueB(const CString &key, const CString &valuename, bool& value) const; - bool GetValue(const CString &key, const CString &valuename, int& value) const { return GetValueI(key, valuename, value); } - bool GetValue(const CString &key, const CString &valuename, float& value) const { return GetValueF(key, valuename, value); } - bool GetValue(const CString &key, const CString &valuename, bool& value) const { return GetValueB(key, valuename, value); } + bool GetValue(const CString &key, const CString &valuename, int& value) const; + bool GetValue(const CString &key, const CString &valuename, unsigned& value) const; + bool GetValue(const CString &key, const CString &valuename, float& value) const; + bool GetValue(const CString &key, const CString &valuename, bool& value) const; //sets value of [keyname] valuename =. //specify the optional paramter as false (0) if you do not want it to create diff --git a/stepmania/src/InputFilter.cpp b/stepmania/src/InputFilter.cpp index 2b8e8a2447..303f3dedb3 100644 --- a/stepmania/src/InputFilter.cpp +++ b/stepmania/src/InputFilter.cpp @@ -55,12 +55,44 @@ void InputFilter::ButtonPressed( DeviceInput di, bool Down ) m_BeingHeld[di.device][di.button] = Down; m_fSecsHeld[di.device][di.button] = 0; - +#if 0 + if( 1 ) // PREFSMAN->m_bJoytechInput && di.IsJoystick() ) + { + /* If this is a release of the right button, force it down for a little while, so + * the axis motion has a chance to come in before we register the right arrow release. */ + const int RightButton = 'd';//JOY_13; +// const int LeftButton = 'a';//JOY_15; + if( !Down && di.button == RightButton ) + { + LOG->Trace("temp force d"); + ForceKey( DeviceInput(di.device, RightButton), 1 ); + } + } +#endif if( WasBeingPressed != IsBeingPressed(di) ) { InputEventType iet = IsBeingPressed(di)? IET_FIRST_PRESS:IET_RELEASE; queue.push_back( InputEvent(di,iet) ); } +#if 0 + if( 1 ) // PREFSMAN->m_bJoytechInput && di.IsJoystick() ) + { + const int RightButton = 'd';//JOY_13; + const int LeftButton = 'a';//JOY_15; + bool NeedToForceBothButtons = + IsBeingPressed( DeviceInput(di.device, 'e'/*JOY_RIGHT*/) ) && + !IsBeingPressed( DeviceInput(di.device, RightButton) ); + LOG->Trace("--- %i", NeedToForceBothButtons ); + if( NeedToForceBothButtons ) + { + ForceKey( DeviceInput(di.device, RightButton), 0 ); + ForceKey( DeviceInput(di.device, LeftButton), 0 ); + } else { + StopForcingKey( DeviceInput(di.device, RightButton) ); + StopForcingKey( DeviceInput(di.device, LeftButton) ); + } + } +#endif } /* Force a key down. Duration is the amount of time to force the key, or 0 to force @@ -116,6 +148,14 @@ void InputFilter::ResetDevice( InputDevice dev ) void InputFilter::Update(float fDeltaTime) { +// static float AutoStartTime=0; +// AutoStartTime -= fDeltaTime; +// if( AutoStartTime <= 0 ) +// { +// AutoStartTime = 0.5f; +// ButtonPressed( DeviceInput(DEVICE_KEYBOARD, 'a'), true ); +// ButtonPressed( DeviceInput(DEVICE_KEYBOARD, 'a'), false ); +// } RageTimer now; // Constructing the DeviceInput inside the nested loops caues terrible diff --git a/stepmania/src/ModelTypes.cpp b/stepmania/src/ModelTypes.cpp index c45d63ca7e..cae13e4679 100644 --- a/stepmania/src/ModelTypes.cpp +++ b/stepmania/src/ModelTypes.cpp @@ -53,7 +53,7 @@ void AnimatedTexture::Load( CString sTexOrIniPath ) CString sFileName; float fDelay = 0; if( ini.GetValue( "AnimatedTexture", sFileKey, sFileName ) && - ini.GetValueF( "AnimatedTexture", sDelayKey, fDelay ) ) + ini.GetValue( "AnimatedTexture", sDelayKey, fDelay ) ) { RageTextureID ID; ID.filename = sDir+sFileName; diff --git a/stepmania/src/PlayerAI.cpp b/stepmania/src/PlayerAI.cpp index 36283086cd..074ee4b683 100644 --- a/stepmania/src/PlayerAI.cpp +++ b/stepmania/src/PlayerAI.cpp @@ -57,12 +57,12 @@ void PlayerAI::InitFromDisk() TapScoreDistribution& dist = g_Distributions[i]; dist.fPercent[TNS_NONE] = 0; - ini.GetValueF( sKey, "MissWeight", dist.fPercent[TNS_MISS] ); - ini.GetValueF( sKey, "BooWeight", dist.fPercent[TNS_BOO] ); - ini.GetValueF( sKey, "GoodWeight", dist.fPercent[TNS_GOOD] ); - ini.GetValueF( sKey, "GreatWeight", dist.fPercent[TNS_GREAT] ); - ini.GetValueF( sKey, "PerfectWeight", dist.fPercent[TNS_PERFECT] ); - ini.GetValueF( sKey, "MarvelousWeight", dist.fPercent[TNS_MARVELOUS] ); + ini.GetValue ( sKey, "MissWeight", dist.fPercent[TNS_MISS] ); + ini.GetValue ( sKey, "BooWeight", dist.fPercent[TNS_BOO] ); + ini.GetValue ( sKey, "GoodWeight", dist.fPercent[TNS_GOOD] ); + ini.GetValue ( sKey, "GreatWeight", dist.fPercent[TNS_GREAT] ); + ini.GetValue ( sKey, "PerfectWeight", dist.fPercent[TNS_PERFECT] ); + ini.GetValue ( sKey, "MarvelousWeight", dist.fPercent[TNS_MARVELOUS] ); float fSum = 0; int j; diff --git a/stepmania/src/PrefsManager.cpp b/stepmania/src/PrefsManager.cpp index c2779765de..c5ae00e811 100644 --- a/stepmania/src/PrefsManager.cpp +++ b/stepmania/src/PrefsManager.cpp @@ -176,112 +176,112 @@ void PrefsManager::ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame ) if( !ini.ReadFile() ) return; // could not read config file, load nothing - ini.GetValueB( "Options", "Windowed", m_bWindowed ); - ini.GetValueB( "Options", "Interlaced", m_bInterlaced ); + ini.GetValue( "Options", "Windowed", m_bWindowed ); + ini.GetValue( "Options", "Interlaced", m_bInterlaced ); #ifdef _XBOX - ini.GetValueB( "Options", "PAL", m_bPAL ); + ini.GetValue( "Options", "PAL", m_bPAL ); #endif - ini.GetValueI( "Options", "DisplayWidth", m_iDisplayWidth ); - ini.GetValueI( "Options", "DisplayHeight", m_iDisplayHeight ); - ini.GetValueI( "Options", "DisplayColorDepth", m_iDisplayColorDepth ); - ini.GetValueI( "Options", "TextureColorDepth", m_iTextureColorDepth ); - ini.GetValueI( "Options", "MovieColorDepth", m_iMovieColorDepth ); - ini.GetValueI( "Options", "MaxTextureResolution", m_iMaxTextureResolution ); - ini.GetValueI( "Options", "RefreshRate", m_iRefreshRate ); - ini.GetValueB( "Options", "UseDedicatedMenuButtons", m_bOnlyDedicatedMenuButtons ); - ini.GetValueB( "Options", "ShowStats", m_bShowStats ); - ini.GetValueI( "Options", "BackgroundMode", (int&)m_BackgroundMode ); - ini.GetValueI( "Options", "NumBackgrounds", m_iNumBackgrounds); - ini.GetValueB( "Options", "ShowDanger", m_bShowDanger ); - ini.GetValueF( "Options", "BGBrightness", m_fBGBrightness ); - ini.GetValueB( "Options", "MenuTimer", m_bMenuTimer ); - ini.GetValueI( "Options", "NumArcadeStages", m_iNumArcadeStages ); - ini.GetValueB( "Options", "EventMode", m_bEventMode ); - ini.GetValueB( "Options", "AutoPlay", m_bAutoPlay ); - ini.GetValueF( "Options", "JudgeWindowScale", m_fJudgeWindowScale ); - ini.GetValueF( "Options", "JudgeWindowMarvelousSeconds", m_fJudgeWindowMarvelousSeconds ); - ini.GetValueF( "Options", "JudgeWindowPerfectSeconds", m_fJudgeWindowPerfectSeconds ); - ini.GetValueF( "Options", "JudgeWindowGreatSeconds", m_fJudgeWindowGreatSeconds ); - ini.GetValueF( "Options", "JudgeWindowGoodSeconds", m_fJudgeWindowGoodSeconds ); - ini.GetValueF( "Options", "JudgeWindowBooSeconds", m_fJudgeWindowBooSeconds ); - ini.GetValueF( "Options", "JudgeWindowOKSeconds", m_fJudgeWindowOKSeconds ); - ini.GetValueF( "Options", "LifeDifficultyScale", m_fLifeDifficultyScale ); - ini.GetValueI( "Options", "MovieDecodeMS", m_iMovieDecodeMS ); - ini.GetValueB( "Options", "DelayedEscape", m_bDelayedEscape ); - ini.GetValueB( "Options", "HiddenSongs", m_bHiddenSongs ); - ini.GetValueB( "Options", "Vsync", m_bVsync ); - ini.GetValueB( "Options", "HowToPlay", m_bInstructions ); - ini.GetValueB( "Options", "Caution", m_bShowDontDie ); - ini.GetValueB( "Options", "ShowSelectGroup", m_bShowSelectGroup ); - ini.GetValueB( "Options", "ShowNative", m_bShowNative ); - ini.GetValueB( "Options", "ArcadeOptionsNavigation", m_bArcadeOptionsNavigation ); - ini.GetValue ( "Options", "DWIPath", m_DWIPath ); - ini.GetValueB( "Options", "DelayedTextureDelete", m_bDelayedTextureDelete ); - ini.GetValueB( "Options", "DelayedScreenLoad", m_bDelayedScreenLoad ); - ini.GetValueB( "Options", "BannerCache", m_bBannerCache ); - ini.GetValueI( "Options", "MusicWheelUsesSections", (int&)m_MusicWheelUsesSections ); - ini.GetValueI( "Options", "MusicWheelSwitchSpeed", m_iMusicWheelSwitchSpeed ); - ini.GetValue ( "Options", "SoundDrivers", m_sSoundDrivers ); - ini.GetValue ( "Options", "MovieDrivers", m_sMovieDrivers ); - ini.GetValueB( "Options", "EasterEggs", m_bEasterEggs ); - ini.GetValueI( "Options", "MarvelousTiming", (int&)m_iMarvelousTiming ); - ini.GetValueF( "Options", "SoundVolume", m_fSoundVolume ); - ini.GetValueB( "Options", "SoundPreloadAll", m_bSoundPreloadAll ); - ini.GetValueI( "Options", "SoundResampleQuality", m_iSoundResampleQuality ); - ini.GetValueI( "Options", "CoinMode", m_iCoinMode ); - ini.GetValueI( "Options", "CoinsPerCredit", m_iCoinsPerCredit ); - ini.GetValueB( "Options", "JointPremium", m_bJointPremium ); - ini.GetValueI( "Options", "BoostAppPriority", m_iBoostAppPriority ); - ini.GetValueB( "Options", "PickExtraStage", m_bPickExtraStage ); - ini.GetValueB( "Options", "ComboContinuesBetweenSongs", m_bComboContinuesBetweenSongs ); - ini.GetValueF( "Options", "LongVerSeconds", m_fLongVerSongSeconds ); - ini.GetValueF( "Options", "MarathonVerSeconds", m_fMarathonVerSongSeconds ); - ini.GetValueI( "Options", "ShowSongOptions", (int&)m_ShowSongOptions ); - ini.GetValueB( "Options", "AllowUnacceleratedRenderer", m_bAllowUnacceleratedRenderer ); - ini.GetValueB( "Options", "ThreadedInput", m_bThreadedInput ); - ini.GetValue ( "Options", "IgnoredMessageWindows", m_sIgnoredMessageWindows ); - ini.GetValueB( "Options", "SoloSingle", m_bSoloSingle ); - ini.GetValueB( "Options", "DancePointsForOni", m_bDancePointsForOni ); - ini.GetValueB( "Options", "ShowLyrics", m_bShowLyrics ); - ini.GetValueB( "Options", "AutogenMissingTypes", m_bAutogenMissingTypes ); - ini.GetValueB( "Options", "AutogenGroupCourses", m_bAutogenGroupCourses ); - ini.GetValueB( "Options", "Timestamping", m_bTimestamping ); - ini.GetValueB( "Options", "BreakComboToGetItem", m_bBreakComboToGetItem ); - ini.GetValueI( "Options", "ShowDancingCharacters", (int&)m_ShowDancingCharacters ); - ini.GetValueB( "Options", "TenFooterInRed", m_bTenFooterInRed ); + ini.GetValue( "Options", "DisplayWidth", m_iDisplayWidth ); + ini.GetValue( "Options", "DisplayHeight", m_iDisplayHeight ); + ini.GetValue( "Options", "DisplayColorDepth", m_iDisplayColorDepth ); + ini.GetValue( "Options", "TextureColorDepth", m_iTextureColorDepth ); + ini.GetValue( "Options", "MovieColorDepth", m_iMovieColorDepth ); + ini.GetValue( "Options", "MaxTextureResolution", m_iMaxTextureResolution ); + ini.GetValue( "Options", "RefreshRate", m_iRefreshRate ); + ini.GetValue( "Options", "UseDedicatedMenuButtons", m_bOnlyDedicatedMenuButtons ); + ini.GetValue( "Options", "ShowStats", m_bShowStats ); + ini.GetValue( "Options", "BackgroundMode", (int&)m_BackgroundMode ); + ini.GetValue( "Options", "NumBackgrounds", m_iNumBackgrounds); + ini.GetValue( "Options", "ShowDanger", m_bShowDanger ); + ini.GetValue( "Options", "BGBrightness", m_fBGBrightness ); + ini.GetValue( "Options", "MenuTimer", m_bMenuTimer ); + ini.GetValue( "Options", "NumArcadeStages", m_iNumArcadeStages ); + ini.GetValue( "Options", "EventMode", m_bEventMode ); + ini.GetValue( "Options", "AutoPlay", m_bAutoPlay ); + ini.GetValue( "Options", "JudgeWindowScale", m_fJudgeWindowScale ); + ini.GetValue( "Options", "JudgeWindowMarvelousSeconds", m_fJudgeWindowMarvelousSeconds ); + ini.GetValue( "Options", "JudgeWindowPerfectSeconds", m_fJudgeWindowPerfectSeconds ); + ini.GetValue( "Options", "JudgeWindowGreatSeconds", m_fJudgeWindowGreatSeconds ); + ini.GetValue( "Options", "JudgeWindowGoodSeconds", m_fJudgeWindowGoodSeconds ); + ini.GetValue( "Options", "JudgeWindowBooSeconds", m_fJudgeWindowBooSeconds ); + ini.GetValue( "Options", "JudgeWindowOKSeconds", m_fJudgeWindowOKSeconds ); + ini.GetValue( "Options", "LifeDifficultyScale", m_fLifeDifficultyScale ); + ini.GetValue( "Options", "MovieDecodeMS", m_iMovieDecodeMS ); + ini.GetValue( "Options", "DelayedEscape", m_bDelayedEscape ); + ini.GetValue( "Options", "HiddenSongs", m_bHiddenSongs ); + ini.GetValue( "Options", "Vsync", m_bVsync ); + ini.GetValue( "Options", "HowToPlay", m_bInstructions ); + ini.GetValue( "Options", "Caution", m_bShowDontDie ); + ini.GetValue( "Options", "ShowSelectGroup", m_bShowSelectGroup ); + ini.GetValue( "Options", "ShowNative", m_bShowNative ); + ini.GetValue( "Options", "ArcadeOptionsNavigation", m_bArcadeOptionsNavigation ); + ini.GetValue( "Options", "DWIPath", m_DWIPath ); + ini.GetValue( "Options", "DelayedTextureDelete", m_bDelayedTextureDelete ); + ini.GetValue( "Options", "DelayedScreenLoad", m_bDelayedScreenLoad ); + ini.GetValue( "Options", "BannerCache", m_bBannerCache ); + ini.GetValue( "Options", "MusicWheelUsesSections", (int&)m_MusicWheelUsesSections ); + ini.GetValue( "Options", "MusicWheelSwitchSpeed", m_iMusicWheelSwitchSpeed ); + ini.GetValue( "Options", "SoundDrivers", m_sSoundDrivers ); + ini.GetValue( "Options", "MovieDrivers", m_sMovieDrivers ); + ini.GetValue( "Options", "EasterEggs", m_bEasterEggs ); + ini.GetValue( "Options", "MarvelousTiming", (int&)m_iMarvelousTiming ); + ini.GetValue( "Options", "SoundVolume", m_fSoundVolume ); + ini.GetValue( "Options", "SoundPreloadAll", m_bSoundPreloadAll ); + ini.GetValue( "Options", "SoundResampleQuality", m_iSoundResampleQuality ); + ini.GetValue( "Options", "CoinMode", m_iCoinMode ); + ini.GetValue( "Options", "CoinsPerCredit", m_iCoinsPerCredit ); + ini.GetValue( "Options", "JointPremium", m_bJointPremium ); + ini.GetValue( "Options", "BoostAppPriority", m_iBoostAppPriority ); + ini.GetValue( "Options", "PickExtraStage", m_bPickExtraStage ); + ini.GetValue( "Options", "ComboContinuesBetweenSongs", m_bComboContinuesBetweenSongs ); + ini.GetValue( "Options", "LongVerSeconds", m_fLongVerSongSeconds ); + ini.GetValue( "Options", "MarathonVerSeconds", m_fMarathonVerSongSeconds ); + ini.GetValue( "Options", "ShowSongOptions", (int&)m_ShowSongOptions ); + ini.GetValue( "Options", "AllowUnacceleratedRenderer", m_bAllowUnacceleratedRenderer ); + ini.GetValue( "Options", "ThreadedInput", m_bThreadedInput ); + ini.GetValue( "Options", "IgnoredMessageWindows", m_sIgnoredMessageWindows ); + ini.GetValue( "Options", "SoloSingle", m_bSoloSingle ); + ini.GetValue( "Options", "DancePointsForOni", m_bDancePointsForOni ); + ini.GetValue( "Options", "ShowLyrics", m_bShowLyrics ); + ini.GetValue( "Options", "AutogenMissingTypes", m_bAutogenMissingTypes ); + ini.GetValue( "Options", "AutogenGroupCourses", m_bAutogenGroupCourses ); + ini.GetValue( "Options", "Timestamping", m_bTimestamping ); + ini.GetValue( "Options", "BreakComboToGetItem", m_bBreakComboToGetItem ); + ini.GetValue( "Options", "ShowDancingCharacters", (int&)m_ShowDancingCharacters ); + ini.GetValue( "Options", "TenFooterInRed", m_bTenFooterInRed ); - ini.GetValueI( "Options", "CourseSortOrder", (int&)m_iCourseSortOrder ); - ini.GetValueB( "Options", "MoveRandomToEnd", m_bMoveRandomToEnd ); + ini.GetValue( "Options", "CourseSortOrder", (int&)m_iCourseSortOrder ); + ini.GetValue( "Options", "MoveRandomToEnd", m_bMoveRandomToEnd ); - ini.GetValueI( "Options", "ScoringType", (int&)m_iScoringType ); + ini.GetValue( "Options", "ScoringType", (int&)m_iScoringType ); - ini.GetValueI( "Options", "ProgressiveLifebar", (int&)m_iProgressiveLifebar ); - ini.GetValueI( "Options", "ProgressiveNonstopLifebar", (int&)m_iProgressiveNonstopLifebar ); - ini.GetValueI( "Options", "ProgressiveStageLifebar", (int&)m_iProgressiveStageLifebar ); + ini.GetValue( "Options", "ProgressiveLifebar", m_iProgressiveLifebar ); + ini.GetValue( "Options", "ProgressiveNonstopLifebar", m_iProgressiveNonstopLifebar ); + ini.GetValue( "Options", "ProgressiveStageLifebar", m_iProgressiveStageLifebar ); - ini.GetValueB( "Options", "UseUnlockSystem", m_bUseUnlockSystem ); + ini.GetValue( "Options", "UseUnlockSystem", m_bUseUnlockSystem ); - ini.GetValueB( "Options", "FirstRun", m_bFirstRun ); - ini.GetValueB( "Options", "AutoMapJoysticks", m_bAutoMapJoysticks ); - ini.GetValue ( "Options", "VideoRenderers", m_sVideoRenderers ); - ini.GetValue ( "Options", "LastSeenVideoDriver", m_sLastSeenVideoDriver ); + ini.GetValue( "Options", "FirstRun", m_bFirstRun ); + ini.GetValue( "Options", "AutoMapJoysticks", m_bAutoMapJoysticks ); + ini.GetValue( "Options", "VideoRenderers", m_sVideoRenderers ); + ini.GetValue( "Options", "LastSeenVideoDriver", m_sLastSeenVideoDriver ); #if defined(WIN32) - ini.GetValue ( "Options", "LastSeenMemory", m_iLastSeenMemory ); + ini.GetValue( "Options", "LastSeenMemory", m_iLastSeenMemory ); #endif - ini.GetValue ( "Options", "CoursesToShowRanking", m_sCoursesToShowRanking ); - ini.GetValueB( "Options", "AntiAliasing", m_bAntiAliasing ); - ini.GetValueF( "Options", "GlobalOffsetSeconds", m_fGlobalOffsetSeconds ); - ini.GetValueB( "Options", "ForceLogFlush", m_bForceLogFlush ); - ini.GetValueB( "Options", "Logging", m_bLogging ); - ini.GetValueB( "Options", "ShowLogWindow", m_bShowLogWindow ); - ini.GetValueB( "Options", "ShowBeginnerHelper", m_bShowBeginnerHelper ); - ini.GetValue ( "Options", "Language", m_sLanguage ); - ini.GetValueB( "Options", "EndlessBreakEnabled", m_bEndlessBreakEnabled ); - ini.GetValueI( "Options", "EndlessStagesUntilBreak", m_iEndlessNumStagesUntilBreak ); - ini.GetValueI( "Options", "EndlessBreakLength", m_iEndlessBreakLength ); + ini.GetValue( "Options", "CoursesToShowRanking", m_sCoursesToShowRanking ); + ini.GetValue( "Options", "AntiAliasing", m_bAntiAliasing ); + ini.GetValue( "Options", "GlobalOffsetSeconds", m_fGlobalOffsetSeconds ); + ini.GetValue( "Options", "ForceLogFlush", m_bForceLogFlush ); + ini.GetValue( "Options", "Logging", m_bLogging ); + ini.GetValue( "Options", "ShowLogWindow", m_bShowLogWindow ); + ini.GetValue( "Options", "ShowBeginnerHelper", m_bShowBeginnerHelper ); + ini.GetValue( "Options", "Language", m_sLanguage ); + ini.GetValue( "Options", "EndlessBreakEnabled", m_bEndlessBreakEnabled ); + ini.GetValue( "Options", "EndlessStagesUntilBreak", m_iEndlessNumStagesUntilBreak ); + ini.GetValue( "Options", "EndlessBreakLength", m_iEndlessBreakLength ); for( int p=0; pm_CurGame = game; } } diff --git a/stepmania/src/SongCacheIndex.cpp b/stepmania/src/SongCacheIndex.cpp index 978aa20d09..b189cf1b46 100644 --- a/stepmania/src/SongCacheIndex.cpp +++ b/stepmania/src/SongCacheIndex.cpp @@ -40,7 +40,7 @@ void SongCacheIndex::ReadCacheIndex() CacheIndex.ReadFile(); // don't care if this fails int iCacheVersion; - CacheIndex.GetValueI( "Cache", "CacheVersion", iCacheVersion ); + CacheIndex.GetValue( "Cache", "CacheVersion", iCacheVersion ); if( iCacheVersion == FILE_CACHE_VERSION ) return; /* OK */ @@ -62,7 +62,7 @@ void SongCacheIndex::AddCacheIndex(const CString &path, unsigned hash) unsigned SongCacheIndex::GetCacheHash( const CString &path ) const { unsigned iDirHash; - CacheIndex.GetValueU( "Cache", MangleName(path), iDirHash ); + CacheIndex.GetValue( "Cache", MangleName(path), iDirHash ); return iDirHash; } diff --git a/stepmania/src/Sprite.cpp b/stepmania/src/Sprite.cpp index 54a02e76aa..2b4f5ef6ce 100644 --- a/stepmania/src/Sprite.cpp +++ b/stepmania/src/Sprite.cpp @@ -132,13 +132,13 @@ bool Sprite::LoadFromSpriteFile( RageTextureID ID ) CString sDelayKey = ssprintf( "Delay%04d", i ); State newState; - if( !ini.GetValueI( "Sprite", sFrameKey, newState.iFrameIndex ) ) + if( !ini.GetValue( "Sprite", sFrameKey, newState.iFrameIndex ) ) break; if( newState.iFrameIndex >= m_pTexture->GetNumFrames() ) RageException::Throw( "In '%s', %s is %d, but the texture %s only has %d frames.", m_sSpritePath.c_str(), sFrameKey.c_str(), newState.iFrameIndex, ID.filename.c_str(), m_pTexture->GetNumFrames() ); - if( !ini.GetValueF( "Sprite", sDelayKey, newState.fDelay ) ) + if( !ini.GetValue( "Sprite", sDelayKey, newState.fDelay ) ) break; if( i == 0 ) // the ini file defines at least one frame @@ -148,12 +148,12 @@ bool Sprite::LoadFromSpriteFile( RageTextureID ID ) } float f; - if( ini.GetValueF( "Sprite", "BaseRotationXDegrees", f ) ) Actor::SetBaseRotationX( f ); - if( ini.GetValueF( "Sprite", "BaseRotationYDegrees", f ) ) Actor::SetBaseRotationY( f ); - if( ini.GetValueF( "Sprite", "BaseRotationZDegrees", f ) ) Actor::SetBaseRotationZ( f ); - if( ini.GetValueF( "Sprite", "BaseZoomX", f ) ) Actor::SetBaseZoomX( f ); - if( ini.GetValueF( "Sprite", "BaseZoomY", f ) ) Actor::SetBaseZoomY( f ); - if( ini.GetValueF( "Sprite", "BaseZoomZ", f ) ) Actor::SetBaseZoomZ( f ); + if( ini.GetValue( "Sprite", "BaseRotationXDegrees", f ) ) Actor::SetBaseRotationX( f ); + if( ini.GetValue( "Sprite", "BaseRotationYDegrees", f ) ) Actor::SetBaseRotationY( f ); + if( ini.GetValue( "Sprite", "BaseRotationZDegrees", f ) ) Actor::SetBaseRotationZ( f ); + if( ini.GetValue( "Sprite", "BaseZoomX", f ) ) Actor::SetBaseZoomX( f ); + if( ini.GetValue( "Sprite", "BaseZoomY", f ) ) Actor::SetBaseZoomY( f ); + if( ini.GetValue( "Sprite", "BaseZoomZ", f ) ) Actor::SetBaseZoomZ( f ); return true; diff --git a/stepmania/src/StageStats.cpp b/stepmania/src/StageStats.cpp index 79d7d31a3a..a4a0a79f86 100644 --- a/stepmania/src/StageStats.cpp +++ b/stepmania/src/StageStats.cpp @@ -68,7 +68,9 @@ Grade StageStats::GetGrade( PlayerNumber pn ) return GRADE_E; /* XXX: This entire calculation should be in ScoreKeeper, but final evaluation - * is tricky since at that point the ScoreKeepers no longer exist. */ + * is tricky since at that point the ScoreKeepers no longer exist. + * + * See http://www.aaroninjapan.com/ddr2.html ("Regular play scoring") */ const float TapScoreValues[NUM_TAP_NOTE_SCORES] = { 0, -8, -4, 0, +1, +2, +2 }; const float HoldScoreValues[NUM_HOLD_NOTE_SCORES] = { 0, 0, +6 }; diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 8e7e7bb0b9..73db53b248 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -395,12 +395,12 @@ static void CheckVideoDefaultSettings() if( SetDefaultVideoParams ) { ini.GetValue( sKey, "Renderers", PREFSMAN->m_sVideoRenderers ); - ini.GetValueI( sKey, "Width", PREFSMAN->m_iDisplayWidth ); - ini.GetValueI( sKey, "Height", PREFSMAN->m_iDisplayHeight ); - ini.GetValueI( sKey, "DisplayColor", PREFSMAN->m_iDisplayColorDepth ); - ini.GetValueI( sKey, "TextureColor", PREFSMAN->m_iTextureColorDepth ); - ini.GetValueI( sKey, "MovieColor", PREFSMAN->m_iMovieColorDepth ); - ini.GetValueB( sKey, "AntiAliasing", PREFSMAN->m_bAntiAliasing ); + ini.GetValue( sKey, "Width", PREFSMAN->m_iDisplayWidth ); + ini.GetValue( sKey, "Height", PREFSMAN->m_iDisplayHeight ); + ini.GetValue( sKey, "DisplayColor", PREFSMAN->m_iDisplayColorDepth ); + ini.GetValue( sKey, "TextureColor", PREFSMAN->m_iTextureColorDepth ); + ini.GetValue( sKey, "MovieColor", PREFSMAN->m_iMovieColorDepth ); + ini.GetValue( sKey, "AntiAliasing", PREFSMAN->m_bAntiAliasing ); // Update last seen video card PREFSMAN->m_sLastSeenVideoDriver = GetVideoDriverName(); diff --git a/stepmania/src/UnlockSystem.cpp b/stepmania/src/UnlockSystem.cpp index 572db03a56..16a654ee78 100644 --- a/stepmania/src/UnlockSystem.cpp +++ b/stepmania/src/UnlockSystem.cpp @@ -387,13 +387,13 @@ bool UnlockSystem::ReadValues( CString filename) if (!data.ReadFile()) return false; - data.GetValueF( "Unlock", "ArcadePointsAccumulated", ArcadePoints ); - data.GetValueF( "Unlock", "DancePointsAccumulated", DancePoints ); - data.GetValueF( "Unlock", "SongPointsAccumulated", SongPoints ); - data.GetValueF( "Unlock", "ExtraStagesCleared", ExtraClearPoints ); - data.GetValueF( "Unlock", "ExtraStagesFailed", ExtraFailPoints ); - data.GetValueF( "Unlock", "TotalStagesCleared", StagesCleared ); - data.GetValueF( "Unlock", "TotalToastysSeen", ToastyPoints ); + data.GetValue ( "Unlock", "ArcadePointsAccumulated", ArcadePoints ); + data.GetValue ( "Unlock", "DancePointsAccumulated", DancePoints ); + data.GetValue ( "Unlock", "SongPointsAccumulated", SongPoints ); + data.GetValue ( "Unlock", "ExtraStagesCleared", ExtraClearPoints ); + data.GetValue ( "Unlock", "ExtraStagesFailed", ExtraFailPoints ); + data.GetValue ( "Unlock", "TotalStagesCleared", StagesCleared ); + data.GetValue ( "Unlock", "TotalToastysSeen", ToastyPoints ); data.GetValue ( "Unlock", "RouletteSeeds", RouletteSeeds ); return true;