From e792d3e4df75df1998416765c42690bfc39f5e23 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 25 Oct 2003 07:50:30 +0000 Subject: [PATCH] add CacheAllUsedNoteSkins --- stepmania/src/NoteField.cpp | 16 ++++++++++------ stepmania/src/NoteField.h | 1 + 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/stepmania/src/NoteField.cpp b/stepmania/src/NoteField.cpp index 16fe75a5f0..ec2c0b5e4d 100644 --- a/stepmania/src/NoteField.cpp +++ b/stepmania/src/NoteField.cpp @@ -68,6 +68,15 @@ void NoteField::CacheNoteSkin( CString skin ) m_NoteDisplays[ skin ] = nd; } +void NoteField::CacheAllUsedNoteSkins() +{ + /* Cache note skins. */ + vector skins; + GAMESTATE->GetAllUsedNoteSkins( skins ); + for( unsigned i=0; i < skins.size(); ++i ) + CacheNoteSkin( skins[i] ); +} + void NoteField::Load( const NoteData* pNoteData, PlayerNumber pn, int iFirstPixelToDraw, int iLastPixelToDraw, float fYReverseOffsetPixels ) { Unload(); @@ -88,12 +97,7 @@ void NoteField::Load( const NoteData* pNoteData, PlayerNumber pn, int iFirstPixe this->CopyAll( pNoteData ); ASSERT( GetNumTracks() == GAMESTATE->GetCurrentStyleDef()->m_iColsPerPlayer ); - /* Cache note skins. */ - vector skins; - GAMESTATE->GetAllUsedNoteSkins( skins ); - for( unsigned i=0; i < skins.size(); ++i ) - CacheNoteSkin( skins[i] ); - + CacheAllUsedNoteSkins(); RefreshBeatToNoteSkin(); } diff --git a/stepmania/src/NoteField.h b/stepmania/src/NoteField.h index 7157246b76..f287da51e1 100644 --- a/stepmania/src/NoteField.h +++ b/stepmania/src/NoteField.h @@ -42,6 +42,7 @@ public: float m_fBeginMarker, m_fEndMarker; // only used with MODE_EDIT void FadeToFail(); + void CacheAllUsedNoteSkins(); void CacheNoteSkin( CString skin );