Switch to separate note patterns for couples. Add loader support.

This will break saving couples to DWI and probably the editor, too.
Getting to that.
This commit is contained in:
Glenn Maynard
2002-09-07 05:04:04 +00:00
parent a0cba0afa4
commit 33a0e450e4
10 changed files with 111 additions and 42 deletions
+43 -10
View File
@@ -27,7 +27,7 @@
// While reading in, use the 6 panel mapping. After reading in, detect if only 4 notes
// are used. If so, shift the Up+Right column back to the Up column
//
void mapBMSTrackToDanceNote( int iBMSTrack, int &iDanceColOut, char &cNoteCharOut )
void BMSLoader::mapBMSTrackToDanceNote( int iBMSTrack, int &iDanceColOut, char &cNoteCharOut )
{
if( iBMSTrack > 40 )
{
@@ -58,10 +58,13 @@ void mapBMSTrackToDanceNote( int iBMSTrack, int &iDanceColOut, char &cNoteCharOu
}
bool BMSLoader::LoadFromBMSFile( const CString &sPath, Notes &out )
bool BMSLoader::LoadFromBMSFile( const CString &sPath, Notes &out, Notes &out2 )
{
LOG->Trace( "Notes::LoadFromBMSFile( '%s' )", sPath );
out.m_NotesType = NOTES_TYPE_INVALID;
out2.m_NotesType = NOTES_TYPE_INVALID;
NoteData* pNoteData = new NoteData;
pNoteData->m_iNumTracks = MAX_NOTE_TRACKS;
@@ -111,7 +114,7 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, Notes &out )
// if the mode should be solo, then we'll update m_DanceStyle below when we read in step data
break;
case 2: // couple/battle
out.m_NotesType = NOTES_TYPE_DANCE_COUPLE;
out.m_NotesType = NOTES_TYPE_DANCE_COUPLE_1;
break;
case 3: // double
out.m_NotesType = NOTES_TYPE_DANCE_DOUBLE;
@@ -184,9 +187,7 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, Notes &out )
if( out.m_NotesType == NOTES_TYPE_DANCE_SINGLE ||
out.m_NotesType == NOTES_TYPE_DANCE_DOUBLE ||
out.m_NotesType == NOTES_TYPE_DANCE_COUPLE// ||
//out.m_NotesType == NOTES_TYPE_DANCE_COUPLE_2
) // if there are 4 panels, then the Up+Right track really contains the notes for Up
out.m_NotesType == NOTES_TYPE_DANCE_COUPLE_1) // 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
{
@@ -207,11 +208,14 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, Notes &out )
int iNumNewTracks = GameManager::NotesTypeToNumTracks( out.m_NotesType );
int iTransformNewToOld[MAX_NOTE_TRACKS];
int i;
for( i = 0; i < MAX_NOTE_TRACKS; ++i)
iTransformNewToOld[i] = -1;
switch( out.m_NotesType )
{
case NOTES_TYPE_DANCE_SINGLE:
case NOTES_TYPE_DANCE_COUPLE:
// case NOTES_TYPE_DANCE_COUPLE_2:
case NOTES_TYPE_DANCE_COUPLE_1:
iTransformNewToOld[0] = DANCE_NOTE_PAD1_LEFT;
iTransformNewToOld[1] = DANCE_NOTE_PAD1_DOWN;
iTransformNewToOld[2] = DANCE_NOTE_PAD1_UP;
@@ -245,6 +249,24 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, Notes &out )
out.SetNoteData(pNoteData2);
if(out.m_NotesType == NOTES_TYPE_DANCE_COUPLE_1) {
/* Couples. Set up a second note pattern for the 2p side. */
out2 = out;
out2.m_NotesType = NOTES_TYPE_DANCE_COUPLE_2;
for( i = 0; i < MAX_NOTE_TRACKS; ++i)
iTransformNewToOld[i] = -1;
iTransformNewToOld[0] = DANCE_NOTE_PAD2_LEFT;
iTransformNewToOld[1] = DANCE_NOTE_PAD2_DOWN;
iTransformNewToOld[2] = DANCE_NOTE_PAD2_UP;
iTransformNewToOld[3] = DANCE_NOTE_PAD2_RIGHT;
pNoteData2->LoadTransformed( pNoteData, iNumNewTracks, iTransformNewToOld );
out2.SetNoteData(pNoteData2);
out2.TidyUpData();
}
delete pNoteData;
delete pNoteData2;
@@ -267,8 +289,19 @@ bool BMSLoader::LoadFromBMSDir( CString sDir, Song &out )
for( int i=0; i<arrayBMSFileNames.GetSize(); i++ )
{
Notes* pNewNotes = new Notes;
LoadFromBMSFile( out.m_sSongDir + arrayBMSFileNames[i], *pNewNotes );
out.m_apNotes.Add( pNewNotes );
Notes* pNewNotes2 = new Notes;
LoadFromBMSFile( out.m_sSongDir + arrayBMSFileNames[i],
*pNewNotes, *pNewNotes2 );
/* Add either note pattern that actually loaded. */
if(pNewNotes->m_NotesType != NOTES_TYPE_INVALID)
out.m_apNotes.Add( pNewNotes );
else
delete pNewNotes;
if(pNewNotes2->m_NotesType != NOTES_TYPE_INVALID)
out.m_apNotes.Add( pNewNotes2 );
else
delete pNewNotes2;
}
CString sPath = out.m_sSongDir + arrayBMSFileNames[0];