From f7b856f3c2e8cc25c3a968a263cd02799c668c40 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 20 Apr 2003 00:53:15 +0000 Subject: [PATCH] Add an option to preload all banners. This adds to the screen load time, but makes the actual screen much cleaner. Add an option to disable banner preloading completely, to remove all long waits completely. Don't ChangeBannersWhenFast if we're set to this. --- stepmania/src/MusicWheel.cpp | 12 +++++++++++- stepmania/src/PrefsManager.cpp | 8 ++++---- stepmania/src/PrefsManager.h | 4 +++- stepmania/src/ScreenSelectMusic.cpp | 18 +++++------------- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index 8f4d37f309..93900adf74 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -475,6 +475,16 @@ void MusicWheel::BuildWheelItemDatas( vector &arrayWheelItemDatas ASSERT(0); // invalid PlayMode } + if(PREFSMAN->m_BannerCacheType == PREFSMAN->preload_all) + { + for( i=0; iCacheTexture( Banner::BannerTex(WID.GetBanner()) ); + } + } + // init music status icons for( i=0; im_BannerCacheType == PREFSMAN->preload_group) TEXTUREMAN->CacheTexture( Banner::BannerTex(from[i].GetBanner()) ); } diff --git a/stepmania/src/PrefsManager.cpp b/stepmania/src/PrefsManager.cpp index e8b8e67f1e..afc541fcef 100644 --- a/stepmania/src/PrefsManager.cpp +++ b/stepmania/src/PrefsManager.cpp @@ -76,7 +76,6 @@ PrefsManager::PrefsManager() m_bDelayedTextureDelete = true; m_MusicWheelUsesSections = ALWAYS; m_iMusicWheelSwitchSpeed = 10; - m_bChangeBannersWhenFast = false; m_bEasterEggs = true; m_bMarvelousTiming = true; m_iCoinMode = COIN_HOME; @@ -91,7 +90,8 @@ PrefsManager::PrefsManager() m_bAutogenMissingTypes = true; m_bAutogenGroupCourses = true; m_bBreakComboToGetItem = false; - + m_BannerCacheType = preload_group; + /* DDR Extreme-style extra stage support. * Default off so people used to the current behavior (or those with extra * stage CRS files) don't get it changed around on them. */ @@ -168,7 +168,6 @@ void PrefsManager::ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame ) ini.GetValueB( "Options", "DelayedTextureDelete", m_bDelayedTextureDelete ); ini.GetValueI( "Options", "MusicWheelUsesSections", (int&)m_MusicWheelUsesSections ); ini.GetValueI( "Options", "MusicWheelSwitchSpeed", m_iMusicWheelSwitchSpeed ); - ini.GetValueB( "Options", "ChangeBannersWhenFast", m_bChangeBannersWhenFast ); ini.GetValue ( "Options", "SoundDrivers", m_sSoundDrivers ); ini.GetValueB( "Options", "EasterEggs", m_bEasterEggs ); ini.GetValueB( "Options", "MarvelousTiming", m_bMarvelousTiming ); @@ -192,6 +191,7 @@ void PrefsManager::ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame ) ini.GetValueB( "Options", "Timestamping", m_bTimestamping ); ini.GetValue ( "Options", "DefaultModifiers", m_sDefaultModifiers ); ini.GetValueB( "Options", "BreakComboToGetItem", m_bBreakComboToGetItem ); + ini.GetValueI( "Options", "BannerCacheType", (int&)m_BannerCacheType ); m_asAdditionalSongFolders.clear(); CString sAdditionalSongFolders; @@ -251,7 +251,6 @@ void PrefsManager::SaveGlobalPrefsToDisk() ini.SetValueB( "Options", "DelayedTextureDelete", m_bDelayedTextureDelete ); ini.SetValueI( "Options", "MusicWheelUsesSections", m_MusicWheelUsesSections ); ini.SetValueI( "Options", "MusicWheelSwitchSpeed", m_iMusicWheelSwitchSpeed ); - ini.SetValueB( "Options", "ChangeBannersWhenFast", m_bChangeBannersWhenFast ); ini.SetValueB( "Options", "EasterEggs", m_bEasterEggs ); ini.SetValueB( "Options", "MarvelousTiming", m_bMarvelousTiming ); ini.SetValueB( "Options", "SoundPreloadAll", m_bSoundPreloadAll ); @@ -273,6 +272,7 @@ void PrefsManager::SaveGlobalPrefsToDisk() ini.SetValueB( "Options", "Timestamping", m_bTimestamping ); ini.SetValue ( "Options", "DefaultModifiers", m_sDefaultModifiers ); ini.SetValueB( "Options", "BreakComboToGetItem", m_bBreakComboToGetItem ); + ini.SetValueI( "Options", "BannerCacheType", m_BannerCacheType ); /* Only write these if they aren't the default. This ensures that we can change diff --git a/stepmania/src/PrefsManager.h b/stepmania/src/PrefsManager.h index 67fd90d1db..ff180c5bb7 100644 --- a/stepmania/src/PrefsManager.h +++ b/stepmania/src/PrefsManager.h @@ -56,7 +56,6 @@ public: bool m_bArcadeOptionsNavigation; enum { NEVER, ALWAYS, ABC_ONLY } m_MusicWheelUsesSections; int m_iMusicWheelSwitchSpeed; - bool m_bChangeBannersWhenFast; bool m_bEasterEggs; bool m_bMarvelousTiming; int m_iCoinMode; @@ -89,6 +88,9 @@ public: bool m_bSoundPreloadAll; bool m_bAllowSoftwareRenderer; + enum BannerCacheType { preload_none, preload_all, preload_group }; + BannerCacheType m_BannerCacheType; + /* Game-specific prefs: */ CString m_sDefaultNoteSkin; diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index 1708516afb..956b75e2cc 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -732,20 +732,12 @@ void ScreenSelectMusic::AfterMusicChange() for( pn = 0; pn < NUM_PLAYERS; ++pn) m_arrayNotes[pn].clear(); - /* If we're rouletting, and we're moving fast, don't touch the banner. */ bool no_banner_change = false; -// if(m_MusicWheel.IsMoving()) -// { -// /* We're moving fast. Don't change banners if we're rouletting, or if -// * we've been told to never change banners when moving fast. -// * -// * XXX: When we're not changing banners and not rouletting, show some -// * kind of "moving fast" fallback banner. (When rouletting, just keep -// * showing the roulette banner.) */ -// if(m_MusicWheel.IsRouletting() || -// (m_MusicWheel.IsMoving() && !PREFSMAN->m_bChangeBannersWhenFast)) -// no_banner_change = true; -// } + if(PREFSMAN->m_BannerCacheType == PREFSMAN->preload_none && m_MusicWheel.IsMoving()) + { + /* If we're moving fast and we didn't preload banners, don't touch it. */ + no_banner_change = true; + } m_sprMarathonBalloon.StopTweening(); OFF_COMMAND( m_sprMarathonBalloon );