diff --git a/Docs/Changelog_sm-ssc.txt b/Docs/Changelog_sm-ssc.txt index adaf7fd918..9bc40e0a53 100644 --- a/Docs/Changelog_sm-ssc.txt +++ b/Docs/Changelog_sm-ssc.txt @@ -9,6 +9,11 @@ Not all changes are documented, for various reasons. supported but exist anyways.) _____________________________________________________________________________ +20100627 +-------- +* [NotesLoaderKSF] Support reading of #PLAYER and #MUSICINTRO/#INTRO tags in + KSF files. [based on code by Aldo_MX] + 20100626 -------- * Fixed a bug with urlnoexit GameCommand always returning the "Could not diff --git a/src/NotesLoaderKSF.cpp b/src/NotesLoaderKSF.cpp index adfa1242e1..7cb9d671ba 100644 --- a/src/NotesLoaderKSF.cpp +++ b/src/NotesLoaderKSF.cpp @@ -12,7 +12,7 @@ #if 0 static void RemoveHoles( NoteData &out, const Song &song ) { - /* Start at the second BPM segment; the first one is already aligned. */ + // Start at the second BPM segment; the first one is already aligned. for( unsigned seg = 1; seg < song.m_Timing.m_BPMSegments.size(); ++seg ) { // const float FromBeat = song.m_Timing.m_BPMSegments[seg].m_fStartBeat; @@ -72,6 +72,9 @@ static bool LoadFromKSFFile( const RString &sPath, Steps &out, const Song &song, int iTickCount = -1; // this is the value we read for TICKCOUNT vector vNoteRows; + // According to Aldo_MX, there is a default BPM and it's 60. -aj + bool bDoublesChart = false; + for( unsigned i=0; i 1 ) // RemoveHoles( notedata, song ); @@ -290,7 +302,7 @@ static void LoadTags( const RString &str, Song &out ) * str is either "title", "artist - title", or "artist - title - difficulty". */ vector asBits; split( str, " - ", asBits, false ); - /* Ignore the difficulty, since we get that elsewhere. */ + // Ignore the difficulty, since we get that elsewhere. if( asBits.size() == 3 && ( !stricmp(asBits[2], "double") || !stricmp(asBits[2], "easy") || @@ -314,7 +326,7 @@ static void LoadTags( const RString &str, Song &out ) title = asBits[0]; } - /* Convert, if possible. Most KSFs are in Korean encodings (CP942/EUC-KR). */ + // Convert, if possible. Most KSFs are in Korean encodings (CP942/EUC-KR). if( !ConvertString( title, "korean" ) ) title = ""; if( !ConvertString( artist, "korean" ) ) @@ -413,11 +425,17 @@ static bool LoadGlobalData( const RString &sPath, Song &out, bool &bKIUCompliant split( theSteps, "\n", vNoteRows, true ); } - else if( 0==stricmp(sValueName,"DIFFICULTY")) + else if( 0==stricmp(sValueName,"DIFFICULTY") ) { /* DIFFICULTY is handled only in LoadFromKSFFile. Ignore it here. */ continue; } + // New cases noted in Aldo_MX's code: + else if( 0==stricmp(sValueName,"MUSICINTRO") || 0==stricmp(sValueName,"INTRO") ) + { + out.m_fMusicSampleStartSeconds = HHMMSSToSeconds( sParams[1] ); + } + // end new cases else { LOG->UserLog( "Song file", sPath, "has an unexpected value named \"%s\".", @@ -439,7 +457,7 @@ static bool LoadGlobalData( const RString &sPath, Song &out, bool &bKIUCompliant BPM1, BeatsPerSecond, BPMPos2, beat ); out.AddBPMSegment( BPMSegment(BeatToNoteRow(beat), BPM2) ); } - + if( BPM3 > 0 && BPMPos3 > 0 ) { const float BeatsPerSecond = BPM2 / 60.0f;