From 5774a0a70d03bcf94508f880f2dda07cd39f0cab Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Sat, 8 Jul 2006 06:00:37 +0000 Subject: [PATCH] Cleanup. --- stepmania/src/NotesLoaderKSF.cpp | 74 +++++++++++++++++--------------- 1 file changed, 39 insertions(+), 35 deletions(-) diff --git a/stepmania/src/NotesLoaderKSF.cpp b/stepmania/src/NotesLoaderKSF.cpp index da895b7edd..ae5dbc39a4 100644 --- a/stepmania/src/NotesLoaderKSF.cpp +++ b/stepmania/src/NotesLoaderKSF.cpp @@ -72,13 +72,14 @@ bool KSFLoader::LoadFromKSFFile( const RString &sPath, Steps &out, const Song &s for( unsigned i=0; iWarn("File %s had a RowString with an improper length (\"%s\"); corrupt notes ignored", - sPath.c_str(), sRowString.c_str()); + sPath.c_str(), sRowString.c_str()); return false; } @@ -198,7 +201,7 @@ bool KSFLoader::LoadFromKSFFile( const RString &sPath, Steps &out, const Song &s } TapNote tap; - switch(sRowString[t]) + switch( sRowString[t] ) { case '0': tap = TAP_EMPTY; break; case '1': tap = TAP_ORIGINAL_TAP; break; @@ -236,13 +239,13 @@ void KSFLoader::LoadTags( const RString &str, Song &out ) split( str, " - ", asBits, false ); /* Ignore the difficulty, since we get that elsewhere. */ if( asBits.size() == 3 && - (!stricmp(asBits[2], "double") || - !stricmp(asBits[2], "easy") || - !stricmp(asBits[2], "normal") || - !stricmp(asBits[2], "hard") || - !stricmp(asBits[2], "crazy")) ) + (!stricmp(asBits[2], "double") || + !stricmp(asBits[2], "easy") || + !stricmp(asBits[2], "normal") || + !stricmp(asBits[2], "hard") || + !stricmp(asBits[2], "crazy")) ) { - asBits.erase(asBits.begin()+2, asBits.begin()+3); + asBits.erase( asBits.begin()+2, asBits.begin()+3 ); } RString title, artist; @@ -297,12 +300,13 @@ bool KSFLoader::LoadGlobalData( const RString &sPath, Song &out ) else if( 0==stricmp(sValueName,"STARTTIME") ) out.m_Timing.m_fBeat0OffsetInSeconds = -StringToFloat( sParams[1] )/100; else if( 0==stricmp(sValueName,"TICKCOUNT") || - 0==stricmp(sValueName,"STEP") || - 0==stricmp(sValueName,"DIFFICULTY")) - ; /* Handled in LoadFromKSFFile; don't warn. */ - else if( 0==stricmp(sValueName,"STARTTIME2") || - 0==stricmp(sValueName,"STARTTIME3")) - continue; /* Expected value for other Pump Simulators: don't worry about it here. */ + 0==stricmp(sValueName,"STEP") || + 0==stricmp(sValueName,"DIFFICULTY") || + 0==stricmp(sValueName,"STARTTIME2") || + 0==stricmp(sValueName,"STARTTIME3") ) + { + continue; + } else LOG->Trace( "Unexpected value named '%s'", sValueName.c_str() ); } @@ -313,8 +317,8 @@ bool KSFLoader::LoadGlobalData( const RString &sPath, Song &out ) { const float BeatsPerSecond = out.GetBPMAtBeat(0) / 60.0f; const float beat = BPMPos2 * BeatsPerSecond; - LOG->Trace("BPM %f, BPS %f, BPMPos2 %f, beat %f", - out.GetBPMAtBeat(0), BeatsPerSecond, BPMPos2, beat); + LOG->Trace( "BPM %f, BPS %f, BPMPos2 %f, beat %f", + out.GetBPMAtBeat(0), BeatsPerSecond, BPMPos2, beat ); out.AddBPMSegment( BPMSegment(BeatToNoteRow(beat), BPM2) ); } @@ -322,8 +326,8 @@ bool KSFLoader::LoadGlobalData( const RString &sPath, Song &out ) { const float BeatsPerSecond = out.GetBPMAtBeat(0) / 60.0f; const float beat = BPMPos3 * BeatsPerSecond; - LOG->Trace("BPM %f, BPS %f, BPMPos3 %f, beat %f", - out.GetBPMAtBeat(0), BeatsPerSecond, BPMPos3, beat); + LOG->Trace( "BPM %f, BPS %f, BPMPos3 %f, beat %f", + out.GetBPMAtBeat(0), BeatsPerSecond, BPMPos3, beat ); out.AddBPMSegment( BPMSegment(BeatToNoteRow(beat), BPM3) ); } @@ -332,8 +336,8 @@ bool KSFLoader::LoadGlobalData( const RString &sPath, Song &out ) vector asBits; split( sPath, "/", asBits, true); - ASSERT(asBits.size() > 1); - LoadTags(asBits[asBits.size()-2], out); + ASSERT( asBits.size() > 1 ); + LoadTags( asBits[asBits.size()-2], out ); } // search for music with song in the file name @@ -359,14 +363,14 @@ bool KSFLoader::LoadFromDir( const RString &sDir, Song &out ) if( arrayKSFFileNames.empty() ) RageException::Throw( "Couldn't find any KSF files in '%s'", sDir.c_str() ); - if(!LoadGlobalData(out.GetSongDir() + arrayKSFFileNames[0], out)) + if( !LoadGlobalData(out.GetSongDir() + arrayKSFFileNames[0], out) ) return false; // load the Steps from the rest of the KSF files for( unsigned i=0; i