More KiU simplifications.

This commit is contained in:
Glenn Maynard
2002-08-21 04:11:53 +00:00
parent 755e1e44c3
commit 118f97fd1b
+15 -9
View File
@@ -763,7 +763,7 @@ bool Notes::LoadFromKSFFile( const CString &sPath )
if( iTickCount == -1 ) if( iTickCount == -1 )
{ {
iTickCount = 2; iTickCount = 2;
LOG->Warn( "TICKCOUNT not found; defaulting to %i", sPath, iTickCount ); LOG->Warn( "%s:\nTICKCOUNT not found; defaulting to %i", sPath, iTickCount );
} }
NoteData notedata; // read it into here NoteData notedata; // read it into here
@@ -780,30 +780,36 @@ bool Notes::LoadFromKSFFile( const CString &sPath )
{ {
CString& sRowString = asRows[r]; CString& sRowString = asRows[r];
ASSERT( sRowString.GetLength() == 13 ); // why 13 notes per row. Beats me! ASSERT( sRowString.GetLength() == 13 ); // why 13 notes per row. Beats me!
/* All 2s indicates the end of the song. */
if( sRowString == "2222222222222" ) if( sRowString == "2222222222222" )
break; break;
float fBeatThisRow = r/(float)iTickCount; // the length of a note in a row depends on TICKCOUNT
// the length of a note in a row depends on TICKCOUNT
float fBeatThisRow = r/(float)iTickCount;
int row = BeatToNoteRow(fBeatThisRow); int row = BeatToNoteRow(fBeatThisRow);
for( int t=0; t<13; t++ ) for( int t=0; t<13; t++ )
{ {
if( sRowString[t] == '4' ) if( sRowString[t] == '4' )
{ {
/* Remember when each hold starts; ignore the middle. */
if( iHoldStartRow[t] == -1 ) if( iHoldStartRow[t] == -1 )
iHoldStartRow[t] = r; iHoldStartRow[t] = r;
else
; // ignore middle of hold continue;
} }
else // sRowString[t] != '4'
{
if( iHoldStartRow[t] != -1 ) // this ends the hold if( iHoldStartRow[t] != -1 ) // this ends the hold
{ {
HoldNote hn = { t, iHoldStartRow[t]/(float)iTickCount, (r-1)/(float)iTickCount }; HoldNote hn = {
t, /* button */
iHoldStartRow[t]/(float)iTickCount, /* start */
(r-1)/(float)iTickCount /* end */
};
notedata.AddHoldNote( hn ); notedata.AddHoldNote( hn );
iHoldStartRow[t] = -1; iHoldStartRow[t] = -1;
} }
}
if( sRowString[t] != '4' )
notedata.m_TapNotes[t][row] = sRowString[t]; notedata.m_TapNotes[t][row] = sRowString[t];
} }
} }