From d4cd093daf160751e1c9faa59e75045c1a0034eb Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Wed, 14 Feb 2007 10:50:13 +0000 Subject: [PATCH] These are also not member variables. If you only need a value in a function, just make it a local variable. --- stepmania/src/NotesLoaderKSF.cpp | 62 ++++++++++++++++---------------- stepmania/src/NotesLoaderKSF.h | 4 --- 2 files changed, 31 insertions(+), 35 deletions(-) diff --git a/stepmania/src/NotesLoaderKSF.cpp b/stepmania/src/NotesLoaderKSF.cpp index 18047bb056..781e2609c4 100644 --- a/stepmania/src/NotesLoaderKSF.cpp +++ b/stepmania/src/NotesLoaderKSF.cpp @@ -69,8 +69,8 @@ bool KSFLoader::LoadFromKSFFile( const RString &sPath, Steps &out, const Song &s return false; } - m_iTickCount = -1; // this is the value we read for TICKCOUNT - m_vNoteRows.clear(); //Start from a clean slate. + int iTickCount = -1; // this is the value we read for TICKCOUNT + vector vNoteRows; for( unsigned i=0; iUserLog( "Song file", sPath, "has an invalid tick count: %d.", m_iTickCount ); + LOG->UserLog( "Song file", sPath, "has an invalid tick count: %d.", iTickCount ); return false; } } @@ -91,7 +91,7 @@ bool KSFLoader::LoadFromKSFFile( const RString &sPath, Steps &out, const Song &s { RString theSteps = sParams[1]; TrimLeft( theSteps ); - split( theSteps, "\n", m_vNoteRows, true ); + split( theSteps, "\n", vNoteRows, true ); } else if( 0==stricmp(sValueName,"DIFFICULTY") ) { @@ -99,10 +99,10 @@ bool KSFLoader::LoadFromKSFFile( const RString &sPath, Steps &out, const Song &s } } - if( m_iTickCount == -1 ) + if( iTickCount == -1 ) { - m_iTickCount = 2; - LOG->UserLog( "Song file", sPath, "doesn't have a TICKCOUNT. Defaulting to %i.", m_iTickCount ); + iTickCount = 2; + LOG->UserLog( "Song file", sPath, "doesn't have a TICKCOUNT. Defaulting to %i.", iTickCount ); } NoteData notedata; // read it into here @@ -163,13 +163,13 @@ bool KSFLoader::LoadFromKSFFile( const RString &sPath, Steps &out, const Song &s for( t=0; t<13; t++ ) iHoldStartRow[t] = -1; - m_bTickChangeNeeded = false; + bool bTickChangeNeeded = false; int newTick = -1; float fCurBeat = 0.0f; float prevBeat = 0.0f; // Used for hold tails. - for( unsigned r=0; r vNoteRows; for( unsigned i=0; i < msd.GetNumValues(); i++ ) { @@ -398,8 +398,8 @@ bool KSFLoader::LoadGlobalData( const RString &sPath, Song &out ) { /* TICKCOUNT is will be used below if there are DM complient BPM changes and stops. * It will be called again in LoadFromKSFFile for the actual steps. */ - m_iTickCount = atoi( sParams[1] ); - m_iTickCount = m_iTickCount > 0 ? m_iTickCount : 2; + iTickCount = atoi( sParams[1] ); + iTickCount = iTickCount > 0 ? iTickCount : 2; } else if ( 0==stricmp(sValueName,"STEP") ) { @@ -407,7 +407,7 @@ bool KSFLoader::LoadGlobalData( const RString &sPath, Song &out ) * the Direct Move syntax, it is best to get the rows of notes here. */ RString theSteps = sParams[1]; TrimLeft( theSteps ); - split( theSteps, "\n", m_vNoteRows, true ); + split( theSteps, "\n", vNoteRows, true ); } else if( 0==stricmp(sValueName,"DIFFICULTY")) @@ -450,17 +450,17 @@ bool KSFLoader::LoadGlobalData( const RString &sPath, Song &out ) else { - int tickToChange = m_iTickCount; + int tickToChange = iTickCount; float fCurBeat = 0.0f; float speedToChange = 0.0f, timeToStop = 0.0f; bool bDMRequired = false; bool bBPMChangeNeeded = false; bool bBPMStopNeeded = false; - m_bTickChangeNeeded = false; + bool bTickChangeNeeded = false; - for (unsigned i=0; i < m_vNoteRows.size(); i++) + for (unsigned i=0; i < vNoteRows.size(); i++) { - RString& NoteRowString = m_vNoteRows[i]; + RString& NoteRowString = vNoteRows[i]; StripCrnl( NoteRowString ); if( NoteRowString == "" ) @@ -484,7 +484,7 @@ bool KSFLoader::LoadGlobalData( const RString &sPath, Song &out ) float numTemp = StringToFloat(temp); if (BeginsWith(NoteRowString, "|T")) { - m_bTickChangeNeeded = true; + bTickChangeNeeded = true; tickToChange = (int)numTemp; continue; } @@ -510,10 +510,10 @@ bool KSFLoader::LoadGlobalData( const RString &sPath, Song &out ) } } - if( m_bTickChangeNeeded ) + if( bTickChangeNeeded ) { - m_iTickCount = tickToChange; - m_bTickChangeNeeded = false; + iTickCount = tickToChange; + bTickChangeNeeded = false; } if( bBPMChangeNeeded ) { @@ -527,7 +527,7 @@ bool KSFLoader::LoadGlobalData( const RString &sPath, Song &out ) out.AddStopSegment( StopSegment(BeatToNoteRow(fCurBeat),timeToStop) ); bBPMStopNeeded = false; } - fCurBeat += 1.0f / m_iTickCount; + fCurBeat += 1.0f / iTickCount; } } diff --git a/stepmania/src/NotesLoaderKSF.h b/stepmania/src/NotesLoaderKSF.h index ff2a2a7b7c..8c163b9cc8 100644 --- a/stepmania/src/NotesLoaderKSF.h +++ b/stepmania/src/NotesLoaderKSF.h @@ -22,10 +22,6 @@ public: private: bool m_bKIUCompliant; - bool m_bTickChangeNeeded; - int m_iTickCount; - vector m_vNoteRows; - }; #endif