cache Noteskins from scripted course mods at song load time, not in first update after load

This commit is contained in:
Chris Danford
2005-03-12 05:04:24 +00:00
parent 20ea0bece9
commit 1d2a5be213
3 changed files with 8 additions and 2 deletions
+1 -2
View File
@@ -41,6 +41,7 @@ public:
void DidTapNote( int iCol, TapNoteScore score, bool bBright );
void DidHoldNote( int iCol );
void RefreshBeatToNoteSkin();
protected:
void DrawBeatBar( const float fBeat );
@@ -51,8 +52,6 @@ protected:
void DrawBGChangeText( const float fBeat, const CString sNewBGName );
float GetWidth();
void RefreshBeatToNoteSkin();
const NoteData *m_pNoteData;
float m_fPercentFadeToFail; // -1 of not fading to fail
+3
View File
@@ -526,6 +526,9 @@ void Player::ApplyWaitingTransforms()
NoteDataUtil::TransformNoteData( m_NoteData, po, GAMESTATE->GetCurrentStyle()->m_StepsType, BeatToNoteRow(fStartBeat), BeatToNoteRow(fEndBeat) );
}
m_pPlayerState->m_ModsToApply.clear();
// Cache used NoteSkins now, not on the next update.
m_pNoteField->RefreshBeatToNoteSkin();
}
void Player::DrawPrimitives()
+4
View File
@@ -861,6 +861,10 @@ void ScreenGameplay::SetupSong( PlayerNumber p, int iSongIndex )
GAMESTATE->m_SongOptions.FromString( a.sModifier );
}
// UGLY: Force updating the BeatToNoteSkin mapping and cache NoteSkins now, or else
// we'll do it on the first update and skip.
m_Player[p].ApplyWaitingTransforms();
/* Now that course options are applied, load any needed note skins and unload old ones. */
m_Player[p].CacheAllUsedNoteSkins( true );