From 9fc58443570ade5f1c81b2d1ecdb417cddf5cad1 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 12 Jan 2006 19:24:13 +0000 Subject: [PATCH] hack in SGameplay to allow simplifications elsewhere only cache the current note skin --- stepmania/src/NoteField.cpp | 8 ++------ stepmania/src/ScreenGameplay.cpp | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/stepmania/src/NoteField.cpp b/stepmania/src/NoteField.cpp index 342c750d8a..58cd689e17 100644 --- a/stepmania/src/NoteField.cpp +++ b/stepmania/src/NoteField.cpp @@ -77,12 +77,8 @@ void NoteField::CacheNoteSkin( const CString &sNoteSkin_ ) void NoteField::CacheAllUsedNoteSkins() { - /* Cache all note skins that we might need for the whole song, course or battle - * play, so we don't have to load them later (such as between course songs). */ - vector skins; - GAMESTATE->GetAllUsedNoteSkins( skins ); - for( unsigned i=0; i < skins.size(); ++i ) - CacheNoteSkin( skins[i] ); + CString sNoteSkin = m_pPlayerState->m_PlayerOptions.m_sNoteSkin; + CacheNoteSkin( sNoteSkin ); } void NoteField::Init( const PlayerState* pPlayerState, float fYReverseOffsetPixels ) diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index bac528e8c9..c4086324b3 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -981,6 +981,27 @@ void ScreenGameplay::SetupSong( int iSongIndex ) NoteData ndTransformed; pStyle->GetTransformedNoteDataForStyle( pi->GetStepsAndTrailIndex(), originalNoteData, ndTransformed ); + // HACK: Apply NoteSkins from global course options. Do this before Player::Load, + // since it needs to know which note skin to load. + pi->GetPlayerState()->m_ModsToApply.clear(); + for( unsigned i=0; im_asModifiersQueue[iSongIndex].size(); ++i ) + { + Attack a = pi->m_asModifiersQueue[iSongIndex][i]; + if( a.fStartSecond != 0 ) + continue; + a.fStartSecond = -1; // now + + PlayerOptions po; + po.FromString( a.sModifiers ); + if( po.m_sNoteSkin.empty() ) + continue; + a.sModifiers = po.m_sNoteSkin; + + GAMESTATE->LaunchAttack( pi->GetPlayerStateAndStageStatsIndex(), a ); + GAMESTATE->m_SongOptions.FromString( a.sModifiers ); + } + + // load player { NoteData nd = ndTransformed;