diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index ea4ec4867f..a9a1343dea 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -35,7 +35,6 @@ const float FADE_SECONDS = 1.0f; const CString STATIC_BACKGROUND = "static background"; -const int MAX_RANDOM_BACKGROUNDS = 4; CString RandomBackground(int num) { return ssprintf("__random%i", num); } @@ -234,7 +233,7 @@ void Background::LoadFromSong( Song* pSong ) // Load random backgrounds bool bLoadedAnyRandomBackgrounds = false; { - for( int i=0; im_iNumBackgrounds; i++ ) { CString sBGName = RandomBackground(i); BGAnimation *pTempBGA = CreateRandomBGA(); @@ -267,7 +266,7 @@ void Background::LoadFromSong( Song* pSong ) m_BGAnimations[sBGName] = pTempBGA; else // the background was not found. Use a random one instead if( bLoadedAnyRandomBackgrounds ) - sBGName = RandomBackground( rand()%MAX_RANDOM_BACKGROUNDS ); + sBGName = RandomBackground( rand()%PREFSMAN->m_iNumBackgrounds ); else sBGName = STATIC_BACKGROUND; } @@ -293,7 +292,7 @@ void Background::LoadFromSong( Song* pSong ) bool bFade = PREFSMAN->m_BackgroundMode==PrefsManager::BGMODE_RANDOMMOVIES || PREFSMAN->m_BackgroundMode==PrefsManager::BGMODE_MOVIEVIS; m_aBGChanges.push_back( BackgroundChange(f,sBGName,1.f,bFade) ); - ctr = (ctr+1)%MAX_RANDOM_BACKGROUNDS; + ctr = (ctr+1)%PREFSMAN->m_iNumBackgrounds; } } @@ -310,7 +309,7 @@ void Background::LoadFromSong( Song* pSong ) if( bLoadedAnyRandomBackgrounds ) { - CString sBGName = RandomBackground( rand()%MAX_RANDOM_BACKGROUNDS ); + CString sBGName = RandomBackground( rand()%PREFSMAN->m_iNumBackgrounds ); m_aBGChanges.push_back( BackgroundChange(bpmseg.m_fStartBeat,sBGName) ); } } diff --git a/stepmania/src/PrefsManager.cpp b/stepmania/src/PrefsManager.cpp index be991c2bfb..27ad34bb18 100644 --- a/stepmania/src/PrefsManager.cpp +++ b/stepmania/src/PrefsManager.cpp @@ -50,6 +50,7 @@ PrefsManager::PrefsManager() m_bShowStats = false; #endif m_BackgroundMode = BGMODE_ANIMATIONS; + m_iNumBackgrounds = 8; m_bShowDanger = true; m_fBGBrightness = 0.8f; m_bMenuTimer = true; @@ -147,6 +148,7 @@ void PrefsManager::ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame ) 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 ); @@ -238,6 +240,7 @@ void PrefsManager::SaveGlobalPrefsToDisk() ini.SetValueB( "Options", "UseDedicatedMenuButtons", m_bOnlyDedicatedMenuButtons ); ini.SetValueB( "Options", "ShowStats", m_bShowStats ); ini.SetValueI( "Options", "BackgroundMode", m_BackgroundMode); + ini.SetValueI( "Options", "NumBackgrounds", m_iNumBackgrounds); ini.SetValueB( "Options", "ShowDanger", m_bShowDanger ); ini.SetValueF( "Options", "BGBrightness", m_fBGBrightness ); ini.SetValueB( "Options", "MenuTimer", m_bMenuTimer ); diff --git a/stepmania/src/PrefsManager.h b/stepmania/src/PrefsManager.h index 4985cddbdd..0ae188f6a0 100644 --- a/stepmania/src/PrefsManager.h +++ b/stepmania/src/PrefsManager.h @@ -28,6 +28,7 @@ public: int m_iRefreshRate; bool m_bShowStats; enum { BGMODE_OFF, BGMODE_ANIMATIONS, BGMODE_MOVIEVIS, BGMODE_RANDOMMOVIES } m_BackgroundMode; + int m_iNumBackgrounds; float m_fBGBrightness; int m_iMovieDecodeMS; bool m_bUseBGIfNoBanner;