diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index 25d0c5cddc..af03e56a29 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -110,7 +110,7 @@ void Background::LoadFromAniDir( CString sAniDir ) { Unload(); - if( PREFSMAN->m_fBGBrightness == 0 ) + if( PREFSMAN->m_fBGBrightness == 0.0f ) return; BGAnimation* pTempBGA; @@ -184,11 +184,11 @@ BGAnimation *Background::CreateSongBGA( CString sBGName ) const CString Background::CreateRandomBGA() { - if( PREFSMAN->m_BackgroundMode == PrefsManager::BGMODE_OFF ) + if( PREFSMAN->m_iBackgroundMode == PrefsManager::BGMODE_OFF ) return ""; /* If we already have enough random BGAs loaded, use them round-robin. */ - if( (int) m_RandomBGAnimations.size() >= PREFSMAN->m_iNumBackgrounds ) + if( (int)m_RandomBGAnimations.size() >= PREFSMAN->m_iNumBackgrounds ) { /* XXX: every time we fully loop, shuffle, so we don't play the same sequence * over and over; and nudge the shuffle so the next one won't be a repeat */ @@ -199,10 +199,10 @@ CString Background::CreateRandomBGA() } CStringArray arrayPaths; - switch( PREFSMAN->m_BackgroundMode ) + switch( PREFSMAN->m_iBackgroundMode ) { default: - FAIL_M( ssprintf("Invalid BackgroundMode: %i", PREFSMAN->m_BackgroundMode) ); + FAIL_M( ssprintf("Invalid BackgroundMode: %i", PREFSMAN->m_iBackgroundMode) ); break; case PrefsManager::BGMODE_ANIMATIONS: @@ -250,7 +250,7 @@ CString Background::CreateRandomBGA() } BGAnimation *ret = new BGAnimation; - switch( PREFSMAN->m_BackgroundMode ) + switch( PREFSMAN->m_iBackgroundMode ) { case PrefsManager::BGMODE_ANIMATIONS: ret->LoadFromAniDir( file ); break; case PrefsManager::BGMODE_MOVIEVIS: ret->LoadFromVisualization( file ); break; @@ -301,7 +301,7 @@ void Background::LoadFromSong( const Song* pSong ) m_pSong = pSong; - if( PREFSMAN->m_fBGBrightness == 0 ) + if( PREFSMAN->m_fBGBrightness == 0.0f ) return; /* Song backgrounds (even just background stills) can get very big; never keep them @@ -570,7 +570,7 @@ void Background::Update( float fDeltaTime ) void Background::DrawPrimitives() { - if( PREFSMAN->m_fBGBrightness == 0 ) + if( PREFSMAN->m_fBGBrightness == 0.0f ) return; if( IsDangerAllVisible() ) diff --git a/stepmania/src/Banner.cpp b/stepmania/src/Banner.cpp index dda4acc7cc..ae7927f1c2 100644 --- a/stepmania/src/Banner.cpp +++ b/stepmania/src/Banner.cpp @@ -17,7 +17,7 @@ Banner::Banner() m_bScrolling = false; m_fPercentScrolling = 0; - if( PREFSMAN->m_BannerCache != PrefsManager::BNCACHE_OFF ) + if( PREFSMAN->m_iBannerCache != PrefsManager::BNCACHE_OFF ) { TEXTUREMAN->CacheTexture( SongBannerTexture(THEME->GetPathG("Banner","all music")) ); TEXTUREMAN->CacheTexture( SongBannerTexture(THEME->GetPathG("Common","fallback banner")) ); diff --git a/stepmania/src/BannerCache.cpp b/stepmania/src/BannerCache.cpp index a5ab848a4d..3aaa32e8b3 100644 --- a/stepmania/src/BannerCache.cpp +++ b/stepmania/src/BannerCache.cpp @@ -56,7 +56,7 @@ CString BannerCache::GetBannerCachePath( CString BannerPath ) void BannerCache::LoadBanner( CString BannerPath ) { - if( PREFSMAN->m_BannerCache != PrefsManager::BNCACHE_LOW_RES || BannerPath == "" ) + if( PREFSMAN->m_iBannerCache != PrefsManager::BNCACHE_LOW_RES || BannerPath == "" ) return; /* Load it. */ @@ -276,7 +276,7 @@ static inline int closest( int num, int n1, int n2 ) * if the memory or settings change. */ void BannerCache::CacheBanner( CString BannerPath ) { - if( PREFSMAN->m_BannerCache != PrefsManager::BNCACHE_LOW_RES ) + if( PREFSMAN->m_iBannerCache != PrefsManager::BNCACHE_LOW_RES ) return; CHECKPOINT_M( BannerPath ); @@ -413,7 +413,7 @@ void BannerCache::CacheBannerInternal( CString BannerPath ) const CString CachePath = GetBannerCachePath(BannerPath); RageSurfaceUtils::SaveSurface( img, CachePath ); - if( PREFSMAN->m_BannerCache == PrefsManager::BNCACHE_LOW_RES ) + if( PREFSMAN->m_iBannerCache == PrefsManager::BNCACHE_LOW_RES ) { /* If an old image is loaded, free it. */ if( g_BannerPathToImage.find(BannerPath) != g_BannerPathToImage.end() ) diff --git a/stepmania/src/FadingBanner.cpp b/stepmania/src/FadingBanner.cpp index 0bb932dc7f..2c7c4403bb 100644 --- a/stepmania/src/FadingBanner.cpp +++ b/stepmania/src/FadingBanner.cpp @@ -107,12 +107,16 @@ bool FadingBanner::LoadFromCachedBanner( const CString &path ) * which will cause the fade-in to be further delayed. */ RageTextureID ID; - bool bLowRes = (PREFSMAN->m_BannerCache != PrefsManager::BNCACHE_FULL); + bool bLowRes = (PREFSMAN->m_iBannerCache != PrefsManager::BNCACHE_FULL); if( !bLowRes ) + { ID = Sprite::SongBannerTexture( path ); + } else + { /* Try to load the low quality version. */ ID = BANNERCACHE->LoadCachedBanner( path ); + } if( !TEXTUREMAN->IsTextureRegistered(ID) ) { diff --git a/stepmania/src/Preference.h b/stepmania/src/Preference.h index 332832c85d..5806299be4 100644 --- a/stepmania/src/Preference.h +++ b/stepmania/src/Preference.h @@ -32,20 +32,22 @@ template class Preference : public IPreference { private: + // Make currentValue first in the list so that we can pass this object + // as an argument in a var_arg function as in printf. + T m_currentValue; PrefsGroup m_PrefsGroup; CString m_sName; T m_defaultValue; - T m_currentValue; CString ToString(); void FromString( const CString &s ); public: Preference( PrefsGroup PrefsGroup, const CString& sName, const T& defaultValue ): + m_currentValue( defaultValue ), m_PrefsGroup( PrefsGroup ), m_sName( sName ), - m_defaultValue( defaultValue ), - m_currentValue( defaultValue ) + m_defaultValue( defaultValue ) { SubscribePreference( this ); LoadDefault(); @@ -64,26 +66,15 @@ public: void ReadFrom( const IniFile &ini ); void WriteTo( IniFile &ini ) const; - operator T& () + operator T () const { return m_currentValue; } - operator const T& () const + void operator=( const T& other ) { - return m_currentValue; + m_currentValue = other; } - - T& operator=( const T& other ) - { - return m_currentValue = other; - } - - T operator!() - { - return !m_currentValue; - } - }; #endif diff --git a/stepmania/src/PrefsManager.cpp b/stepmania/src/PrefsManager.cpp index 89f397fe9b..5e9e4bc466 100644 --- a/stepmania/src/PrefsManager.cpp +++ b/stepmania/src/PrefsManager.cpp @@ -72,7 +72,49 @@ PrefsManager::PrefsManager() : false #endif ), - m_bShowBanners ( Options, "ShowBanners", true ) + m_bShowBanners ( Options, "ShowBanners", true ), + + m_iBackgroundMode ( Options, "m_iBackgroundMode", BGMODE_ANIMATIONS ), + m_iNumBackgrounds ( Options, "m_iNumBackgrounds", 8 ), + m_fBGBrightness ( Options, "m_fBGBrightness", 0.8f ), + m_bHiddenSongs ( Options, "m_bHiddenSongs", false ), /* I'd rather get occasional people asking for support for this even though it's already here than lots of people asking why songs aren't being displayed. */ + m_bVsync ( Options, "m_bVsync", true ), + m_bInterlaced ( Options, "m_bInterlaced", false ), + /* XXX: Set these defaults for individual consoles using VideoCardDefaults.ini. */ + m_bPAL ( Options, "m_bPAL", false ), + m_bDelayedTextureDelete ( Options, "m_bDelayedTextureDelete", true ), + m_bTexturePreload ( Options, "m_bTexturePreload", false ), + m_bDelayedScreenLoad ( Options, "m_bDelayedScreenLoad", false ), + m_bDelayedModelDelete ( Options, "m_bDelayedModelDelete", false ), + m_iBannerCache ( Options, "m_iBannerCache", BNCACHE_LOW_RES ), + m_bPalettedBannerCache ( Options, "m_bPalettedBannerCache", false ), + m_bFastLoad ( Options, "m_bFastLoad", true ), + + m_bOnlyDedicatedMenuButtons ( Options, "m_bOnlyDedicatedMenuButtons", false ), + m_bMenuTimer ( Options, "m_bMenuTimer", true ), + m_bShowDanger ( Options, "m_bShowDanger", true ), + + m_fJudgeWindowScale ( Options, "m_fJudgeWindowScale", 1.0f ), + m_fJudgeWindowAdd ( Options, "m_fJudgeWindowAdd", 0 ), + m_fJudgeWindowSecondsMarvelous ( Options, "m_fJudgeWindowSecondsMarvelous", 0.0225f ), + m_fJudgeWindowSecondsPerfect ( Options, "m_fJudgeWindowSecondsPerfect", 0.045f ), + m_fJudgeWindowSecondsGreat ( Options, "m_fJudgeWindowSecondsGreat", 0.090f ), + m_fJudgeWindowSecondsGood ( Options, "m_fJudgeWindowSecondsGood", 0.135f ), + m_fJudgeWindowSecondsBoo ( Options, "m_fJudgeWindowSecondsBoo", 0.180f ), + m_fJudgeWindowSecondsOK ( Options, "m_fJudgeWindowSecondsOK", 0.250f ), // allow enough time to take foot off and put back on + m_fJudgeWindowSecondsMine ( Options, "m_fJudgeWindowSecondsMine", 0.090f ), // same as great + m_fJudgeWindowSecondsAttack ( Options, "m_fJudgeWindowSecondsAttack", 0.135f ), + + m_fLifeDifficultyScale ( Options, "m_fLifeDifficultyScale", 1.0f ), + m_fLifeDeltaPercentChangeMarvelous ( Options, "m_fLifeDeltaPercentChangeMarvelous", +0.008f ), + m_fLifeDeltaPercentChangePerfect ( Options, "m_fLifeDeltaPercentChangePerfect", +0.008f ), + m_fLifeDeltaPercentChangeGreat ( Options, "m_fLifeDeltaPercentChangeGreat", +0.004f ), + m_fLifeDeltaPercentChangeGood ( Options, "m_fLifeDeltaPercentChangeGood", +0.000f ), + m_fLifeDeltaPercentChangeBoo ( Options, "m_fLifeDeltaPercentChangeBoo", -0.040f ), + m_fLifeDeltaPercentChangeMiss ( Options, "m_fLifeDeltaPercentChangeMiss", -0.080f ), + m_fLifeDeltaPercentChangeHitMine ( Options, "m_fLifeDeltaPercentChangeHitMine", -0.160f ), + m_fLifeDeltaPercentChangeOK ( Options, "m_fLifeDeltaPercentChangeOK", +0.008f ), + m_fLifeDeltaPercentChangeNG ( Options, "m_fLifeDeltaPercentChangeNG", -0.080f ) { Init(); ReadGlobalPrefsFromDisk(); @@ -80,37 +122,13 @@ PrefsManager::PrefsManager() : void PrefsManager::Init() { - m_bOnlyDedicatedMenuButtons = false; m_bCelShadeModels = false; // Work-In-Progress.. disable by default. m_fConstantUpdateDeltaSeconds = 0; - m_BackgroundMode = BGMODE_ANIMATIONS; - m_iNumBackgrounds = 8; m_bShowDanger = true; - m_fBGBrightness = 0.8f; m_bMenuTimer = true; m_iNumArcadeStages = 3; m_bEventMode = false; m_bAutoPlay = false; - m_fJudgeWindowScale = 1.0f; - m_fJudgeWindowAdd = 0; - m_fLifeDifficultyScale = 1.0f; - m_fJudgeWindowSecondsMarvelous = 0.0225f; - m_fJudgeWindowSecondsPerfect = 0.045f; - m_fJudgeWindowSecondsGreat = 0.090f; - m_fJudgeWindowSecondsGood = 0.135f; - m_fJudgeWindowSecondsBoo = 0.180f; - m_fJudgeWindowSecondsOK = 0.250f; // allow enough time to take foot off and put back on - m_fJudgeWindowSecondsMine = 0.090f; // same as great - m_fJudgeWindowSecondsAttack = 0.135f; - m_fLifeDeltaPercentChangeMarvelous = +0.008f; - m_fLifeDeltaPercentChangePerfect = +0.008f; - m_fLifeDeltaPercentChangeGreat = +0.004f; - m_fLifeDeltaPercentChangeGood = +0.000f; - m_fLifeDeltaPercentChangeBoo = -0.040f; - m_fLifeDeltaPercentChangeMiss = -0.080f; - m_fLifeDeltaPercentChangeHitMine = -0.160f; - m_fLifeDeltaPercentChangeOK = +0.008f; - m_fLifeDeltaPercentChangeNG = -0.080f; m_fTugMeterPercentChangeMarvelous = +0.010f; m_fTugMeterPercentChangePerfect = +0.008f; @@ -178,13 +196,6 @@ void PrefsManager::Init() m_bShowNativeLanguage = true; m_bArcadeOptionsNavigation = false; m_bSoloSingle = false; - m_bDelayedTextureDelete = true; - m_bTexturePreload = false; - m_bDelayedScreenLoad = false; - m_bDelayedModelDelete = false; - m_BannerCache = BNCACHE_LOW_RES; - m_bPalettedBannerCache = false; - m_bFastLoad = true; m_MusicWheelUsesSections = ALWAYS; m_iMusicWheelSwitchSpeed = 10; m_bEasterEggs = true; @@ -240,10 +251,7 @@ void PrefsManager::Init() m_fLongVerSongSeconds = 60*2.5f; // Dynamite Rave is 2:55 m_fMarathonVerSongSeconds = 60*5.f; - /* I'd rather get occasional people asking for support for this even though it's - * already here than lots of people asking why songs aren't being displayed. */ - m_bHiddenSongs = false; - m_bVsync = true; + m_sLanguage = ""; // ThemeManager will deal with this invalid language m_iCenterImageTranslateX = 0; @@ -265,12 +273,6 @@ void PrefsManager::Init() m_bEditorShowBGChangesPlay = false; - /* XXX: Set these defaults for individual consoles using VideoCardDefaults.ini. */ - m_bPAL = false; -#ifndef _XBOX - m_bInterlaced = false; -#endif - m_sSoundDrivers = DEFAULT_SOUND_DRIVER_LIST; /* Number of frames to write ahead; usually 44100 frames per second. * (Number of millisec would be more flexible, but it's more useful to @@ -369,39 +371,11 @@ void PrefsManager::ReadPrefsFromFile( CString sIni ) if( !ini.ReadFile(sIni) ) return; - ini.GetValue( "Options", "Interlaced", m_bInterlaced ); - ini.GetValue( "Options", "PAL", m_bPAL ); ini.GetValue( "Options", "CelShadeModels", m_bCelShadeModels ); ini.GetValue( "Options", "ConstantUpdateDeltaSeconds", m_fConstantUpdateDeltaSeconds ); - ini.GetValue( "Options", "UseDedicatedMenuButtons", m_bOnlyDedicatedMenuButtons ); - 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", "JudgeWindowAdd", m_fJudgeWindowAdd ); - ini.GetValue( "Options", "JudgeWindowSecondsMarvelous", m_fJudgeWindowSecondsMarvelous ); - ini.GetValue( "Options", "JudgeWindowSecondsPerfect", m_fJudgeWindowSecondsPerfect ); - ini.GetValue( "Options", "JudgeWindowSecondsGreat", m_fJudgeWindowSecondsGreat ); - ini.GetValue( "Options", "JudgeWindowSecondsGood", m_fJudgeWindowSecondsGood ); - ini.GetValue( "Options", "JudgeWindowSecondsBoo", m_fJudgeWindowSecondsBoo ); - ini.GetValue( "Options", "JudgeWindowSecondsOK", m_fJudgeWindowSecondsOK ); - ini.GetValue( "Options", "JudgeWindowSecondsMine", m_fJudgeWindowSecondsMine ); - ini.GetValue( "Options", "JudgeWindowSecondsAttack", m_fJudgeWindowSecondsAttack ); - ini.GetValue( "Options", "LifeDifficultyScale", m_fLifeDifficultyScale ); - ini.GetValue( "Options", "LifeDeltaPercentChangeMarvelous", m_fLifeDeltaPercentChangeMarvelous ); - ini.GetValue( "Options", "LifeDeltaPercentChangePerfect", m_fLifeDeltaPercentChangePerfect ); - ini.GetValue( "Options", "LifeDeltaPercentChangeGreat", m_fLifeDeltaPercentChangeGreat ); - ini.GetValue( "Options", "LifeDeltaPercentChangeGood", m_fLifeDeltaPercentChangeGood ); - ini.GetValue( "Options", "LifeDeltaPercentChangeBoo", m_fLifeDeltaPercentChangeBoo ); - ini.GetValue( "Options", "LifeDeltaPercentChangeMiss", m_fLifeDeltaPercentChangeMiss ); - ini.GetValue( "Options", "LifeDeltaPercentChangeHitMine", m_fLifeDeltaPercentChangeHitMine ); - ini.GetValue( "Options", "LifeDeltaPercentChangeOK", m_fLifeDeltaPercentChangeOK ); - ini.GetValue( "Options", "LifeDeltaPercentChangeNG", m_fLifeDeltaPercentChangeNG ); ini.GetValue( "Options", "TugMeterPercentChangeMarvelous", m_fTugMeterPercentChangeMarvelous ); ini.GetValue( "Options", "TugMeterPercentChangePerfect", m_fTugMeterPercentChangePerfect ); ini.GetValue( "Options", "TugMeterPercentChangeGreat", m_fTugMeterPercentChangeGreat ); @@ -459,20 +433,11 @@ void PrefsManager::ReadPrefsFromFile( CString sIni ) ini.GetValue( "Options", "MercifulSuperMeter", m_bMercifulSuperMeter ); ini.GetValue( "Options", "DelayedEscape", m_bDelayedBack ); - ini.GetValue( "Options", "HiddenSongs", m_bHiddenSongs ); - ini.GetValue( "Options", "Vsync", m_bVsync ); ini.GetValue( "Options", "ShowInstructions", m_bShowInstructions ); ini.GetValue( "Options", "ShowCaution", m_bShowCaution ); ini.GetValue( "Options", "ShowSelectGroup", m_bShowSelectGroup ); ini.GetValue( "Options", "ShowNativeLanguage", m_bShowNativeLanguage ); ini.GetValue( "Options", "ArcadeOptionsNavigation", m_bArcadeOptionsNavigation ); - ini.GetValue( "Options", "DelayedTextureDelete", m_bDelayedTextureDelete ); - ini.GetValue( "Options", "TexturePreload", m_bTexturePreload ); - ini.GetValue( "Options", "DelayedScreenLoad", m_bDelayedScreenLoad ); - ini.GetValue( "Options", "DelayedModelDelete", m_bDelayedModelDelete ); - ini.GetValue( "Options", "BannerCache", (int&)m_BannerCache ); - ini.GetValue( "Options", "PalettedBannerCache", m_bPalettedBannerCache ); - ini.GetValue( "Options", "FastLoad", m_bFastLoad ); ini.GetValue( "Options", "MusicWheelUsesSections", (int&)m_MusicWheelUsesSections ); ini.GetValue( "Options", "MusicWheelSwitchSpeed", m_iMusicWheelSwitchSpeed ); ini.GetValue( "Options", "SoundDrivers", m_sSoundDrivers ); @@ -621,7 +586,7 @@ void PrefsManager::SaveGlobalPrefsToDisk() const ini.SetValue( "Options", "CelShadeModels", m_bCelShadeModels ); ini.SetValue( "Options", "ConstantUpdateDeltaSeconds", m_fConstantUpdateDeltaSeconds ); ini.SetValue( "Options", "UseDedicatedMenuButtons", m_bOnlyDedicatedMenuButtons ); - ini.SetValue( "Options", "BackgroundMode", m_BackgroundMode); + ini.SetValue( "Options", "BackgroundMode", m_iBackgroundMode); ini.SetValue( "Options", "NumBackgrounds", m_iNumBackgrounds); ini.SetValue( "Options", "ShowDanger", m_bShowDanger ); ini.SetValue( "Options", "BGBrightness", m_fBGBrightness ); @@ -719,7 +684,7 @@ void PrefsManager::SaveGlobalPrefsToDisk() const ini.SetValue( "Options", "TexturePreload", m_bTexturePreload ); ini.SetValue( "Options", "DelayedScreenLoad", m_bDelayedScreenLoad ); ini.SetValue( "Options", "DelayedModelDelete", m_bDelayedModelDelete ); - ini.SetValue( "Options", "BannerCache", m_BannerCache ); + ini.SetValue( "Options", "BannerCache", m_iBannerCache ); ini.SetValue( "Options", "PalettedBannerCache", m_bPalettedBannerCache ); ini.SetValue( "Options", "FastLoad", m_bFastLoad ); ini.SetValue( "Options", "MusicWheelUsesSections", m_MusicWheelUsesSections ); diff --git a/stepmania/src/PrefsManager.h b/stepmania/src/PrefsManager.h index d5b8a69477..4141280c9a 100644 --- a/stepmania/src/PrefsManager.h +++ b/stepmania/src/PrefsManager.h @@ -27,47 +27,49 @@ public: Preference m_iRefreshRate; Preference m_bShowStats; Preference m_bShowBanners; - enum BackgroundModes { BGMODE_OFF, BGMODE_ANIMATIONS, BGMODE_MOVIEVIS, BGMODE_RANDOMMOVIES } m_BackgroundMode; - int m_iNumBackgrounds; - float m_fBGBrightness; - bool m_bHiddenSongs; - bool m_bVsync; - bool m_bInterlaced; - bool m_bPAL; - bool m_bDelayedTextureDelete; - bool m_bTexturePreload; - bool m_bDelayedScreenLoad; - bool m_bDelayedModelDelete; - enum BannerCacheMode { BNCACHE_OFF, BNCACHE_LOW_RES, BNCACHE_FULL }; - BannerCacheMode m_BannerCache; - bool m_bPalettedBannerCache; - bool m_bFastLoad; - bool m_bOnlyDedicatedMenuButtons; - bool m_bMenuTimer; - bool m_bShowDanger; + enum { BGMODE_OFF, BGMODE_ANIMATIONS, BGMODE_MOVIEVIS, BGMODE_RANDOMMOVIES }; + Preference m_iBackgroundMode; + Preference m_iNumBackgrounds; + Preference m_fBGBrightness; + Preference m_bHiddenSongs; + Preference m_bVsync; + Preference m_bInterlaced; + Preference m_bPAL; + Preference m_bDelayedTextureDelete; + Preference m_bTexturePreload; + Preference m_bDelayedScreenLoad; + Preference m_bDelayedModelDelete; + enum { BNCACHE_OFF, BNCACHE_LOW_RES, BNCACHE_FULL }; + Preference m_iBannerCache; + Preference m_bPalettedBannerCache; + Preference m_bFastLoad; - float m_fJudgeWindowScale; - float m_fJudgeWindowAdd; // this is useful for compensating for changes in sampling rate between devices - float m_fJudgeWindowSecondsMarvelous; - float m_fJudgeWindowSecondsPerfect; - float m_fJudgeWindowSecondsGreat; - float m_fJudgeWindowSecondsGood; - float m_fJudgeWindowSecondsBoo; - float m_fJudgeWindowSecondsOK; - float m_fJudgeWindowSecondsMine; - float m_fJudgeWindowSecondsAttack; + Preference m_bOnlyDedicatedMenuButtons; + Preference m_bMenuTimer; + Preference m_bShowDanger; - float m_fLifeDifficultyScale; - float m_fLifeDeltaPercentChangeMarvelous; - float m_fLifeDeltaPercentChangePerfect; - float m_fLifeDeltaPercentChangeGreat; - float m_fLifeDeltaPercentChangeGood; - float m_fLifeDeltaPercentChangeBoo; - float m_fLifeDeltaPercentChangeMiss; - float m_fLifeDeltaPercentChangeHitMine; - float m_fLifeDeltaPercentChangeOK; - float m_fLifeDeltaPercentChangeNG; + Preference m_fJudgeWindowScale; + Preference m_fJudgeWindowAdd; // this is useful for compensating for changes in sampling rate between devices + Preference m_fJudgeWindowSecondsMarvelous; + Preference m_fJudgeWindowSecondsPerfect; + Preference m_fJudgeWindowSecondsGreat; + Preference m_fJudgeWindowSecondsGood; + Preference m_fJudgeWindowSecondsBoo; + Preference m_fJudgeWindowSecondsOK; + Preference m_fJudgeWindowSecondsMine; + Preference m_fJudgeWindowSecondsAttack; + + Preference m_fLifeDifficultyScale; + Preference m_fLifeDeltaPercentChangeMarvelous; + Preference m_fLifeDeltaPercentChangePerfect; + Preference m_fLifeDeltaPercentChangeGreat; + Preference m_fLifeDeltaPercentChangeGood; + Preference m_fLifeDeltaPercentChangeBoo; + Preference m_fLifeDeltaPercentChangeMiss; + Preference m_fLifeDeltaPercentChangeHitMine; + Preference m_fLifeDeltaPercentChangeOK; + Preference m_fLifeDeltaPercentChangeNG; // tug meter used in rave float m_fTugMeterPercentChangeMarvelous; diff --git a/stepmania/src/ScreenOptionsMasterPrefs.cpp b/stepmania/src/ScreenOptionsMasterPrefs.cpp index ced50c35e6..172a6bb531 100644 --- a/stepmania/src/ScreenOptionsMasterPrefs.cpp +++ b/stepmania/src/ScreenOptionsMasterPrefs.cpp @@ -215,7 +215,7 @@ MOVE( AutogenGroupCourses, (bool&)PREFSMAN->m_bAutogenGroupCourses ); MOVE( FastLoad, (bool&)PREFSMAN->m_bFastLoad ); /* Background options */ -MOVE( BackgroundMode, , PREFSMAN->m_BackgroundMode ); +MOVE( BackgroundMode, (int&)PREFSMAN->m_iBackgroundMode ); MOVE( ShowDanger, (bool&)PREFSMAN->m_bShowDanger ); MOVE( DancingCharacters, PREFSMAN->m_ShowDancingCharacters ); MOVE( BeginnerHelper, (bool&)PREFSMAN->m_bShowBeginnerHelper ); diff --git a/stepmania/src/ScreenWithMenuElements.cpp b/stepmania/src/ScreenWithMenuElements.cpp index 0a7f85db4c..4db9f9f3dd 100644 --- a/stepmania/src/ScreenWithMenuElements.cpp +++ b/stepmania/src/ScreenWithMenuElements.cpp @@ -110,13 +110,15 @@ ScreenWithMenuElements::~ScreenWithMenuElements() void ScreenWithMenuElements::ResetTimer() { - if( TIMER_SECONDS > 0 && PREFSMAN->m_bMenuTimer && !GAMESTATE->m_bEditing ) + if( TIMER_SECONDS > 0.0f && PREFSMAN->m_bMenuTimer && !GAMESTATE->m_bEditing ) { m_MenuTimer->SetSeconds( TIMER_SECONDS ); m_MenuTimer->Start(); } else + { m_MenuTimer->Disable(); + } } void ScreenWithMenuElements::StartTransitioning( ScreenMessage smSendWhenDone ) diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index 2f5ee70abb..9c8d277579 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -284,7 +284,7 @@ void SongManager::LoadGroupSymLinks(CString sDir, CString sGroupFolder) void SongManager::PreloadSongImages() { ASSERT( TEXTUREMAN ); - if( PREFSMAN->m_BannerCache != PrefsManager::BNCACHE_FULL ) + if( PREFSMAN->m_iBannerCache != PrefsManager::BNCACHE_FULL ) return; const vector &songs = SONGMAN->GetAllSongs(); diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 5d3b851220..932c871710 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -377,7 +377,7 @@ static void CheckSettings() /* Preloaded banners takes about 9k per song. Although it's smaller than the * actual song data, it still adds up with a lot of songs. Disable it for 64-meg * systems. */ - PREFSMAN->m_BannerCache = LowMemory? PrefsManager::BNCACHE_OFF:PrefsManager::BNCACHE_LOW_RES; + PREFSMAN->m_iBannerCache = LowMemory ? PrefsManager::BNCACHE_OFF:PrefsManager::BNCACHE_LOW_RES; PREFSMAN->SaveGlobalPrefsToDisk(); #endif