diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index 2b575e8a80..d19ad439c7 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -33,6 +33,10 @@ static ThemeMetric DANGER_ALL_IS_OPAQUE ("Background","DangerAllIsOpaque static ThemeMetric CLAMP_OUTPUT_PERCENT ("Background","ClampOutputPercent"); static Preference g_bShowDanger( "ShowDanger", true ); +static Preference g_fBGBrightness( "BGBrightness", 0.7f ); +static Preference g_RandomBackgroundMode( "RandomBackgroundMode", BGMODE_ANIMATIONS ); +static Preference g_iNumBackgrounds( "NumBackgrounds", 8 ); +static Preference g_bSongBackgrounds( "SongBackgrounds", true ); // Width of the region separating the left and right brightness areas: static float g_fBackgroundCenterWidth = 40; @@ -407,7 +411,7 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun BackgroundDef BackgroundImpl::Layer::CreateRandomBGA( const Song *pSong, const RString &sEffect, deque &RandomBGAnimations, Actor *pParent ) { - if( PREFSMAN->m_RandomBackgroundMode == BGMODE_OFF ) + if( g_RandomBackgroundMode == BGMODE_OFF ) return BackgroundDef(); if( RandomBGAnimations.empty() ) @@ -485,7 +489,7 @@ void BackgroundImpl::LoadFromSong( const Song* pSong ) m_pSong = pSong; m_StaticBackgroundDef.m_sFile1 = SONG_BACKGROUND_FILE; - if( PREFSMAN->m_fBGBrightness == 0.0f ) + if( g_fBGBrightness == 0.0f ) return; // @@ -493,10 +497,10 @@ void BackgroundImpl::LoadFromSong( const Song* pSong ) // { vector vsThrowAway, vsNames; - switch( PREFSMAN->m_RandomBackgroundMode ) + switch( g_RandomBackgroundMode ) { default: - ASSERT_M( 0, ssprintf("Invalid RandomBackgroundMode: %i", int(PREFSMAN->m_RandomBackgroundMode)) ); + ASSERT_M( 0, ssprintf("Invalid RandomBackgroundMode: %i", int(g_RandomBackgroundMode)) ); break; case BGMODE_OFF: break; @@ -511,7 +515,7 @@ void BackgroundImpl::LoadFromSong( const Song* pSong ) // Pick the same random items every time the song is played. RandomGen rnd( GetHashForString(pSong->GetSongDir()) ); random_shuffle( vsNames.begin(), vsNames.end(), rnd ); - int iSize = min( (int)PREFSMAN->m_iNumBackgrounds, (int)vsNames.size() ); + int iSize = min( (int)g_iNumBackgrounds, (int)vsNames.size() ); vsNames.resize( iSize ); FOREACH_CONST( RString, vsNames, s ) @@ -536,7 +540,7 @@ void BackgroundImpl::LoadFromSong( const Song* pSong ) - if( !PREFSMAN->m_bSongBackgrounds ) + if( !g_bSongBackgrounds ) { /* Backgrounds are disabled; just display the song background. */ BackgroundChange change; @@ -851,7 +855,7 @@ void BackgroundImpl::Update( float fDeltaTime ) void BackgroundImpl::DrawPrimitives() { - if( PREFSMAN->m_fBGBrightness == 0.0f ) + if( g_fBGBrightness == 0.0f ) return; if( IsDangerAllVisible() ) @@ -955,7 +959,7 @@ void BrightnessOverlay::SetActualBrightness() float fLeftBrightness = 1-GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.GetCurrent().m_fCover; float fRightBrightness = 1-GAMESTATE->m_pPlayerState[PLAYER_2]->m_PlayerOptions.GetCurrent().m_fCover; - float fBaseBGBrightness = PREFSMAN->m_fBGBrightness; + float fBaseBGBrightness = g_fBGBrightness; // HACK: Always show training in full brightness if( GAMESTATE->m_pCurSong && GAMESTATE->m_pCurSong->IsTutorial() ) diff --git a/stepmania/src/PrefsManager.cpp b/stepmania/src/PrefsManager.cpp index f6b35419f8..e32d9ab206 100644 --- a/stepmania/src/PrefsManager.cpp +++ b/stepmania/src/PrefsManager.cpp @@ -152,10 +152,6 @@ PrefsManager::PrefsManager() : m_bShowStats ( "ShowStats", TRUE_IF_DEBUG), m_bShowBanners ( "ShowBanners", true ), - m_bSongBackgrounds ( "SongBackgrounds", true ), - m_RandomBackgroundMode ( "RandomBackgroundMode", BGMODE_ANIMATIONS ), - m_iNumBackgrounds ( "NumBackgrounds", 8 ), - m_fBGBrightness ( "BGBrightness", 0.7f ), m_bHiddenSongs ( "HiddenSongs", false ), m_bVsync ( "Vsync", true ), m_bInterlaced ( "Interlaced", false ), diff --git a/stepmania/src/PrefsManager.h b/stepmania/src/PrefsManager.h index e6d5aa9d72..f83961b322 100644 --- a/stepmania/src/PrefsManager.h +++ b/stepmania/src/PrefsManager.h @@ -114,10 +114,6 @@ public: Preference m_bShowStats; Preference m_bShowBanners; - Preference m_bSongBackgrounds; - Preference m_RandomBackgroundMode; - Preference m_iNumBackgrounds; - Preference m_fBGBrightness; Preference m_bHiddenSongs; Preference m_bVsync; Preference m_bInterlaced;