From 60beca458d2b702e95dfa5e9e9f144ef680ace0d Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 3 Dec 2003 01:47:03 +0000 Subject: [PATCH] cleanup, const fix --- stepmania/src/NotesLoaderDWI.cpp | 11 +++-------- stepmania/src/NotesLoaderDWI.h | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/stepmania/src/NotesLoaderDWI.cpp b/stepmania/src/NotesLoaderDWI.cpp index ca69e869f0..d01db13914 100644 --- a/stepmania/src/NotesLoaderDWI.cpp +++ b/stepmania/src/NotesLoaderDWI.cpp @@ -82,7 +82,7 @@ void DWILoader::DWIcharToNoteCol( char c, GameController i, int &col1Out, int &c * 1/192nds. So, we have to do a check to figure out what it really * means. If it contains 0s, it's most likely 192nds; otherwise, * it's most likely a jump. Search for a 0 before the next >: */ -bool DWILoader::Is192( CString &sStepData, int pos ) +bool DWILoader::Is192( const CString &sStepData, int pos ) { while( pos < (int) sStepData.size() ) { @@ -108,13 +108,6 @@ bool DWILoader::LoadFromDWITokens( out.m_StepsType = STEPS_TYPE_INVALID; - sStepData1.Replace( "\n", "" ); - sStepData1.Replace( "\r", "" ); - sStepData1.Replace( " ", "" ); - sStepData2.Replace( "\n", "" ); - sStepData2.Replace( "\r", "" ); - sStepData2.Replace( " ", "" ); - if( sMode == "SINGLE" ) out.m_StepsType = STEPS_TYPE_DANCE_SINGLE; else if( sMode == "DOUBLE" ) out.m_StepsType = STEPS_TYPE_DANCE_DOUBLE; else if( sMode == "COUPLE" ) out.m_StepsType = STEPS_TYPE_DANCE_COUPLE; @@ -186,6 +179,8 @@ bool DWILoader::LoadFromDWITokens( ASSERT( false ); } + sStepData.Replace("\n", ""); + sStepData.Replace("\r", ""); sStepData.Replace("\t", ""); sStepData.Replace(" ", ""); diff --git a/stepmania/src/NotesLoaderDWI.h b/stepmania/src/NotesLoaderDWI.h index 9ad1857ed1..732008299f 100644 --- a/stepmania/src/NotesLoaderDWI.h +++ b/stepmania/src/NotesLoaderDWI.h @@ -26,7 +26,7 @@ class DWILoader: public NotesLoader { bool LoadFromDWIFile( CString sPath, Song &out ); static float ParseBrokenDWITimestamp(const CString &arg1, const CString &arg2, const CString &arg3); - static bool Is192( CString &str, int pos ); + static bool Is192( const CString &str, int pos ); CString m_sLoadingFile; public: