diff --git a/stepmania/src/AttackDisplay.cpp b/stepmania/src/AttackDisplay.cpp index d5073902a7..26add2356e 100644 --- a/stepmania/src/AttackDisplay.cpp +++ b/stepmania/src/AttackDisplay.cpp @@ -5,7 +5,6 @@ #include "ActorUtil.h" #include "Character.h" #include "RageLog.h" -#include "RageTextureManager.h" #include #include "PlayerState.h" @@ -62,7 +61,7 @@ void AttackDisplay::Init( const PlayerState* pPlayerState ) continue; } - TEXTUREMAN->CacheTexture( path ); + m_TexturePreload.Load( path ); } } diff --git a/stepmania/src/AttackDisplay.h b/stepmania/src/AttackDisplay.h index a8baa091f4..a83e89b7f9 100644 --- a/stepmania/src/AttackDisplay.h +++ b/stepmania/src/AttackDisplay.h @@ -4,6 +4,7 @@ #include "ActorFrame.h" #include "Sprite.h" #include "GameConstantsAndTypes.h" // for TapNoteScore +#include "RageTexturePreloader.h" struct PlayerState; @@ -21,6 +22,8 @@ protected: const PlayerState* m_pPlayerState; Sprite m_sprAttack; + + RageTexturePreloader m_TexturePreload; }; #endif diff --git a/stepmania/src/Banner.cpp b/stepmania/src/Banner.cpp index 5c533714b0..2a763d491e 100644 --- a/stepmania/src/Banner.cpp +++ b/stepmania/src/Banner.cpp @@ -16,18 +16,15 @@ Banner::Banner() { m_bScrolling = false; m_fPercentScrolling = 0; -} -void Banner::CacheGlobalBanners() -{ - if( PREFSMAN->m_BannerCache == PrefsManager::BNCACHE_OFF ) - return; - - TEXTUREMAN->CacheTexture( SongBannerTexture(THEME->GetPathG("Banner","all music")) ); - TEXTUREMAN->CacheTexture( SongBannerTexture(THEME->GetPathG("Common","fallback banner")) ); - TEXTUREMAN->CacheTexture( SongBannerTexture(THEME->GetPathG("Banner","roulette")) ); - TEXTUREMAN->CacheTexture( SongBannerTexture(THEME->GetPathG("Banner","random")) ); - TEXTUREMAN->CacheTexture( SongBannerTexture(THEME->GetPathG("Banner","Mode")) ); + if( PREFSMAN->m_BannerCache != PrefsManager::BNCACHE_OFF ) + { + m_TexturePreload.Load( SongBannerTexture(THEME->GetPathG("Banner","all music")) ); + m_TexturePreload.Load( SongBannerTexture(THEME->GetPathG("Common","fallback banner")) ); + m_TexturePreload.Load( SongBannerTexture(THEME->GetPathG("Banner","roulette")) ); + m_TexturePreload.Load( SongBannerTexture(THEME->GetPathG("Banner","random")) ); + m_TexturePreload.Load( SongBannerTexture(THEME->GetPathG("Banner","Mode")) ); + } } bool Banner::Load( RageTextureID ID ) diff --git a/stepmania/src/Banner.h b/stepmania/src/Banner.h index 168aeff4b0..a0eb1fb4e5 100644 --- a/stepmania/src/Banner.h +++ b/stepmania/src/Banner.h @@ -5,6 +5,7 @@ #include "Sprite.h" #include "RageTextureID.h" +#include "RageTexturePreloader.h" class Song; class Course; class Character; @@ -31,16 +32,14 @@ public: void LoadRandom(); void LoadFallback(); - static void CacheGlobalBanners(); - void SetScrolling( bool bScroll, float Percent = 0); bool IsScrolling() const { return m_bScrolling; } float ScrollingPercent() const { return m_fPercentScrolling; } protected: - bool m_bScrolling; float m_fPercentScrolling; + RageTexturePreloader m_TexturePreload; }; #endif diff --git a/stepmania/src/FadingBanner.cpp b/stepmania/src/FadingBanner.cpp index e4e3eba59e..0a2dff0635 100644 --- a/stepmania/src/FadingBanner.cpp +++ b/stepmania/src/FadingBanner.cpp @@ -32,8 +32,6 @@ FadingBanner::FadingBanner() ActorUtil::OnCommand( m_Banner[i], "FadingBanner" ); this->AddChild( &m_Banner[i] ); } - - Banner::CacheGlobalBanners(); } void FadingBanner::ScaleToClipped( float fWidth, float fHeight ) diff --git a/stepmania/src/ScoreDisplayBattle.cpp b/stepmania/src/ScoreDisplayBattle.cpp index 9f8d823458..08c72fd166 100644 --- a/stepmania/src/ScoreDisplayBattle.cpp +++ b/stepmania/src/ScoreDisplayBattle.cpp @@ -6,7 +6,6 @@ #include "RageLog.h" #include "GameState.h" #include "ThemeManager.h" -#include "RageTextureManager.h" #include "PlayerState.h" #include "Command.h" @@ -30,7 +29,7 @@ ScoreDisplayBattle::ScoreDisplayBattle() CStringArray asIconPaths; GetDirListing( THEME->GetCurThemeDir()+"Graphic/ScoreDisplayBattle icon*.*", asIconPaths ); for( unsigned j=0; jCacheTexture( asIconPaths[j] ); + m_TexturePreload.Load( asIconPaths[j] ); } void ScoreDisplayBattle::Init( const PlayerState* pPlayerState ) diff --git a/stepmania/src/ScoreDisplayBattle.h b/stepmania/src/ScoreDisplayBattle.h index 2b0a04f40c..ea146d4e4c 100644 --- a/stepmania/src/ScoreDisplayBattle.h +++ b/stepmania/src/ScoreDisplayBattle.h @@ -6,6 +6,7 @@ #include "ScoreDisplay.h" #include "GameConstantsAndTypes.h" #include "Sprite.h" +#include "RageTexturePreloader.h" class ScoreDisplayBattle : public ScoreDisplay @@ -21,6 +22,7 @@ protected: Sprite m_ItemIcon[NUM_INVENTORY_SLOTS]; CString m_iLastSeenInventory[NUM_INVENTORY_SLOTS]; + RageTexturePreloader m_TexturePreload; }; #endif diff --git a/stepmania/src/ScreenEz2SelectMusic.cpp b/stepmania/src/ScreenEz2SelectMusic.cpp index 23e5f98e8b..5ec0f01741 100644 --- a/stepmania/src/ScreenEz2SelectMusic.cpp +++ b/stepmania/src/ScreenEz2SelectMusic.cpp @@ -12,7 +12,6 @@ #include "Steps.h" #include "RageTimer.h" #include "ActorUtil.h" -#include "RageTextureManager.h" #include "AnnouncerManager.h" #include "MenuTimer.h" #include "StepsUtil.h" @@ -216,8 +215,8 @@ void ScreenEz2SelectMusic::Init() } m_sprBalloon.SetName( "Balloon" ); - TEXTUREMAN->CacheTexture( THEME->GetPathG("ScreenSelectMusic","balloon long") ); - TEXTUREMAN->CacheTexture( THEME->GetPathG("ScreenSelectMusic","balloon marathon") ); + m_TexturePreload.Load( THEME->GetPathG("ScreenSelectMusic","balloon long") ); + m_TexturePreload.Load( THEME->GetPathG("ScreenSelectMusic","balloon marathon") ); this->AddChild( &m_sprBalloon ); m_soundOptionsChange.Load( THEME->GetPathS("ScreenEz2SelectMusic","options") ); diff --git a/stepmania/src/ScreenEz2SelectMusic.h b/stepmania/src/ScreenEz2SelectMusic.h index 00afd9a52a..13a82c4bab 100644 --- a/stepmania/src/ScreenEz2SelectMusic.h +++ b/stepmania/src/ScreenEz2SelectMusic.h @@ -9,6 +9,7 @@ #include "MusicBannerWheel.h" #include "DifficultyRating.h" #include "ModeSwitcher.h" +#include "RageTexturePreloader.h" class ScreenEz2SelectMusic : public ScreenWithMenuElements { @@ -83,6 +84,8 @@ protected: int i_ErrorDetected; int iConfirmSelection; + + RageTexturePreloader m_TexturePreload; }; #endif diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index 5f957ab47b..8b132889ac 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -110,7 +110,7 @@ void ScreenSelectMusic::Init() m_sFallbackCDTitlePath = THEME->GetPathG(m_sName,"fallback cdtitle"); - TEXTUREMAN->CacheTexture( m_sFallbackCDTitlePath ); + m_TexturePreload.Load( m_sFallbackCDTitlePath ); if( GAMESTATE->m_pCurStyle == NULL ) RageException::Throw( "The Style has not been set. A theme must set the Style before loading ScreenSelectMusic." ); diff --git a/stepmania/src/ScreenSelectMusic.h b/stepmania/src/ScreenSelectMusic.h index e319ce1ac6..ea818d5ca5 100644 --- a/stepmania/src/ScreenSelectMusic.h +++ b/stepmania/src/ScreenSelectMusic.h @@ -24,6 +24,7 @@ #include "RageUtil_BackgroundLoader.h" #include "ThemeMetric.h" #include "ActorCommands.h" +#include "RageTexturePreloader.h" class ScreenSelectMusic : public ScreenWithMenuElements { @@ -146,6 +147,7 @@ protected: RageSound m_soundSelectPressed; BackgroundLoader m_BackgroundLoader; + RageTexturePreloader m_TexturePreload; }; #endif