don't copy the same data hundreds of times for no particular reason

This commit is contained in:
Glenn Maynard
2002-10-11 20:47:28 +00:00
parent 314c3ecc39
commit ca652a6486
+3 -7
View File
@@ -186,21 +186,18 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, Notes &out )
if( out.m_NotesType == NOTES_TYPE_DANCE_SINGLE || if( out.m_NotesType == NOTES_TYPE_DANCE_SINGLE ||
out.m_NotesType == NOTES_TYPE_DANCE_DOUBLE || out.m_NotesType == NOTES_TYPE_DANCE_DOUBLE ||
out.m_NotesType == NOTES_TYPE_DANCE_COUPLE) // if there are 4 panels, then the Up+Right track really contains the notes for Up out.m_NotesType == NOTES_TYPE_DANCE_COUPLE) // if there are 4 panels, then the Up+Right track really contains the notes for Up
{
for( int i=0; i<MAX_TAP_NOTE_ROWS; i++ ) // for each TapNote
{ {
memcpy( memcpy(
pNoteData->m_TapNotes[DANCE_NOTE_PAD1_UP], pNoteData->m_TapNotes[DANCE_NOTE_PAD1_UP],
pNoteData->m_TapNotes[DANCE_NOTE_PAD1_UPRIGHT], pNoteData->m_TapNotes[DANCE_NOTE_PAD1_UPRIGHT],
MAX_TAP_NOTE_ROWS*sizeof(pNoteData->m_TapNotes[0][0]) MAX_TAP_NOTE_ROWS*sizeof(pNoteData->m_TapNotes[0][0])
); );
memcpy( memset(
pNoteData->m_TapNotes[DANCE_NOTE_PAD2_UP],
pNoteData->m_TapNotes[DANCE_NOTE_PAD2_UPRIGHT], pNoteData->m_TapNotes[DANCE_NOTE_PAD2_UPRIGHT],
'0',
MAX_TAP_NOTE_ROWS*sizeof(pNoteData->m_TapNotes[0][0]) MAX_TAP_NOTE_ROWS*sizeof(pNoteData->m_TapNotes[0][0])
); );
} }
}
// we're done reading in all of the BMS values // we're done reading in all of the BMS values
int iNumNewTracks = GameManager::NotesTypeToNumTracks( out.m_NotesType ); int iNumNewTracks = GameManager::NotesTypeToNumTracks( out.m_NotesType );
@@ -562,7 +559,6 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out )
out.m_BPMSegments[i].m_fStartBeat, out.m_BPMSegments[i].m_fBPM, i ); out.m_BPMSegments[i].m_fStartBeat, out.m_BPMSegments[i].m_fBPM, i );
file.Close(); file.Close();
return true;
return TRUE;
} }