From c5a683b03c2c94945a7450ce3a8ac2e90f881b48 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 1 Jan 2005 22:39:08 +0000 Subject: [PATCH] optimize battle mode: don't call NoteField::CacheAllUsedNoteSkins every frame --- stepmania/src/Player.cpp | 6 ------ stepmania/src/Player.h | 2 ++ stepmania/src/ScreenGameplay.cpp | 3 +++ 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index c736766dd7..db48181ec3 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -508,12 +508,6 @@ void PlayerMinus::Update( float fDeltaTime ) // process transforms that are waiting to be applied ApplyWaitingTransforms(); - /* Cache any newly-used note skins. Normally, the only new skins cached now are - * when we're adding course modifiers at the start of a song. If this is spending - * time loading skins in the middle of a song, something is wrong. */ - if( m_pNoteField ) - m_pNoteField->CacheAllUsedNoteSkins(); - ActorFrame::Update( fDeltaTime ); } diff --git a/stepmania/src/Player.h b/stepmania/src/Player.h index 67dc719cf1..4f8eebcb9e 100644 --- a/stepmania/src/Player.h +++ b/stepmania/src/Player.h @@ -123,6 +123,8 @@ public: ScoreKeeper* pPrimaryScoreKeeper, ScoreKeeper* pSecondaryScoreKeeper ); + void CacheAllUsedNoteSkins() { m_NoteField.CacheAllUsedNoteSkins(); } + protected: NoteField m_NoteField; diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 9f8a67ebc7..9739605e95 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -858,6 +858,9 @@ void ScreenGameplay::SetupSong( PlayerNumber p, int iSongIndex ) GAMESTATE->m_SongOptions.FromString( a.sModifier ); } + /* Now that course options are applied, load any needed note skins. */ + m_Player[p].CacheAllUsedNoteSkins(); + /* Update attack bOn flags. */ GAMESTATE->Update(0); GAMESTATE->RebuildPlayerOptionsFromActiveAttacks( p );