move prefs out of prefsman

This commit is contained in:
Glenn Maynard
2007-01-22 22:46:25 +00:00
parent 6e20d9d52d
commit fa9120108e
3 changed files with 12 additions and 16 deletions
+12 -8
View File
@@ -33,6 +33,10 @@ static ThemeMetric<bool> DANGER_ALL_IS_OPAQUE ("Background","DangerAllIsOpaque
static ThemeMetric<float> CLAMP_OUTPUT_PERCENT ("Background","ClampOutputPercent"); static ThemeMetric<float> CLAMP_OUTPUT_PERCENT ("Background","ClampOutputPercent");
static Preference<bool> g_bShowDanger( "ShowDanger", true ); static Preference<bool> g_bShowDanger( "ShowDanger", true );
static Preference<float> g_fBGBrightness( "BGBrightness", 0.7f );
static Preference<RandomBackgroundMode> g_RandomBackgroundMode( "RandomBackgroundMode", BGMODE_ANIMATIONS );
static Preference<int> g_iNumBackgrounds( "NumBackgrounds", 8 );
static Preference<bool> g_bSongBackgrounds( "SongBackgrounds", true );
// Width of the region separating the left and right brightness areas: // Width of the region separating the left and right brightness areas:
static float g_fBackgroundCenterWidth = 40; 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<BackgroundDef> &RandomBGAnimations, Actor *pParent ) BackgroundDef BackgroundImpl::Layer::CreateRandomBGA( const Song *pSong, const RString &sEffect, deque<BackgroundDef> &RandomBGAnimations, Actor *pParent )
{ {
if( PREFSMAN->m_RandomBackgroundMode == BGMODE_OFF ) if( g_RandomBackgroundMode == BGMODE_OFF )
return BackgroundDef(); return BackgroundDef();
if( RandomBGAnimations.empty() ) if( RandomBGAnimations.empty() )
@@ -485,7 +489,7 @@ void BackgroundImpl::LoadFromSong( const Song* pSong )
m_pSong = pSong; m_pSong = pSong;
m_StaticBackgroundDef.m_sFile1 = SONG_BACKGROUND_FILE; m_StaticBackgroundDef.m_sFile1 = SONG_BACKGROUND_FILE;
if( PREFSMAN->m_fBGBrightness == 0.0f ) if( g_fBGBrightness == 0.0f )
return; return;
// //
@@ -493,10 +497,10 @@ void BackgroundImpl::LoadFromSong( const Song* pSong )
// //
{ {
vector<RString> vsThrowAway, vsNames; vector<RString> vsThrowAway, vsNames;
switch( PREFSMAN->m_RandomBackgroundMode ) switch( g_RandomBackgroundMode )
{ {
default: default:
ASSERT_M( 0, ssprintf("Invalid RandomBackgroundMode: %i", int(PREFSMAN->m_RandomBackgroundMode)) ); ASSERT_M( 0, ssprintf("Invalid RandomBackgroundMode: %i", int(g_RandomBackgroundMode)) );
break; break;
case BGMODE_OFF: case BGMODE_OFF:
break; break;
@@ -511,7 +515,7 @@ void BackgroundImpl::LoadFromSong( const Song* pSong )
// Pick the same random items every time the song is played. // Pick the same random items every time the song is played.
RandomGen rnd( GetHashForString(pSong->GetSongDir()) ); RandomGen rnd( GetHashForString(pSong->GetSongDir()) );
random_shuffle( vsNames.begin(), vsNames.end(), rnd ); 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 ); vsNames.resize( iSize );
FOREACH_CONST( RString, vsNames, s ) 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. */ /* Backgrounds are disabled; just display the song background. */
BackgroundChange change; BackgroundChange change;
@@ -851,7 +855,7 @@ void BackgroundImpl::Update( float fDeltaTime )
void BackgroundImpl::DrawPrimitives() void BackgroundImpl::DrawPrimitives()
{ {
if( PREFSMAN->m_fBGBrightness == 0.0f ) if( g_fBGBrightness == 0.0f )
return; return;
if( IsDangerAllVisible() ) if( IsDangerAllVisible() )
@@ -955,7 +959,7 @@ void BrightnessOverlay::SetActualBrightness()
float fLeftBrightness = 1-GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.GetCurrent().m_fCover; 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 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 // HACK: Always show training in full brightness
if( GAMESTATE->m_pCurSong && GAMESTATE->m_pCurSong->IsTutorial() ) if( GAMESTATE->m_pCurSong && GAMESTATE->m_pCurSong->IsTutorial() )
-4
View File
@@ -152,10 +152,6 @@ PrefsManager::PrefsManager() :
m_bShowStats ( "ShowStats", TRUE_IF_DEBUG), m_bShowStats ( "ShowStats", TRUE_IF_DEBUG),
m_bShowBanners ( "ShowBanners", true ), 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_bHiddenSongs ( "HiddenSongs", false ),
m_bVsync ( "Vsync", true ), m_bVsync ( "Vsync", true ),
m_bInterlaced ( "Interlaced", false ), m_bInterlaced ( "Interlaced", false ),
-4
View File
@@ -114,10 +114,6 @@ public:
Preference<bool> m_bShowStats; Preference<bool> m_bShowStats;
Preference<bool> m_bShowBanners; Preference<bool> m_bShowBanners;
Preference<bool> m_bSongBackgrounds;
Preference<RandomBackgroundMode> m_RandomBackgroundMode;
Preference<int> m_iNumBackgrounds;
Preference<float> m_fBGBrightness;
Preference<bool> m_bHiddenSongs; Preference<bool> m_bHiddenSongs;
Preference<bool> m_bVsync; Preference<bool> m_bVsync;
Preference<bool> m_bInterlaced; Preference<bool> m_bInterlaced;