Autogen fixes, stage 1 - tracks are combined semi-correctly (double->single will combine both pads to one)

This commit is contained in:
Matt Denham
2003-10-29 23:17:00 +00:00
parent 0024b33020
commit acec32cc8b
3 changed files with 68 additions and 9 deletions
+30
View File
@@ -570,3 +570,33 @@ void NoteData::EliminateAllButOneTap(int row)
}
}
// MD 10/29/03 - This is necessary, for whatever reason.
void NoteData::CombineTracks( int iTrackTo, int iTrackFrom )
{
LOG->Trace("NoteData::CombineTracks( %i , %i )", iTrackTo, iTrackFrom);
if(iTrackFrom < 0 || iTrackTo < 0) return;
int iLastRow = GetMaxRow();
LOG->Trace("NoteData::CombineTracks - %i rows", iLastRow);
for (int row = 0; row < iLastRow; ++row)
{
LOG->Trace("NoteData::CombineTracks - row %i", row);
int iStepFrom = m_TapNotes[iTrackFrom][row];
int iStepTo = m_TapNotes[iTrackTo][row];
if( iStepFrom == iStepTo )
{
// no reason to combine same steps
continue;
}
if( iStepTo != TAP_EMPTY )
{
// Mines from "from" track will not knock out any steps in
// the "to" track, but this behavior is fine, I think...
continue;
}
m_TapNotes[iTrackTo][row] = iStepFrom;
}
return;
}
+3
View File
@@ -139,6 +139,9 @@ public:
void From4s( const NoteData &out );
void EliminateAllButOneTap( int row );
// MD 10/29/03 - Join two tracks together.
void CombineTracks( int iTrackTo, int iTrackFrom );
};
+35 -9
View File
@@ -159,16 +159,42 @@ void Steps::Decompress() const
parent->GetNoteData(&pdata);
notes = new NoteData;
// MD 10/29/03 - add track-combining logic
int iNewTracks = GameManager::NotesTypeToNumTracks(m_StepsType);
// ...if we don't set it to SOMETHING, we get no steps.
// This breaks autogen dead. :->
notes->SetNumTracks( pdata.GetNumTracks() );
notes->CopyRange( &pdata, 0, pdata.GetLastRow(), 0 );
if( pdata.GetNumTracks() > iNewTracks)
{
int iOriginalTracks = pdata.GetNumTracks();
int iUnevenTracks = iOriginalTracks % iNewTracks;
int iTracksToOverlap = iOriginalTracks / iNewTracks;
if( iTracksToOverlap ) {
// if we have at least as many tracks in the old mode
// as we do in the mode we're going to
for (int ix = 0; ix < iNewTracks; ix++)
{
for (int iy = 0; iy < iTracksToOverlap; iy++)
{
notes->CombineTracks(ix, (ix + iy * iNewTracks));
}
}
if( iUnevenTracks ) {
for (int ix = iOriginalTracks - iUnevenTracks;
ix < iOriginalTracks;
ix++)
{
// spread out the remaining tracks evenly
notes->CombineTracks((ix * iOriginalTracks) % iNewTracks, ix);
}
}
}
} else
notes->LoadTransformedSlidingWindow( &pdata, iNewTracks );
notes->SetNumTracks( GameManager::NotesTypeToNumTracks(m_StepsType) );
if(pdata.GetNumTracks() == notes->GetNumTracks())
{
notes->CopyRange( &pdata, 0, pdata.GetLastRow(), 0 );
}
else
{
notes->LoadTransformedSlidingWindow( &pdata, notes->GetNumTracks() );
NoteDataUtil::FixImpossibleRows( *notes, m_StepsType );
}
// end MD 10/29/03
NoteDataUtil::FixImpossibleRows( *notes, m_StepsType );
}
else if(!notes_comp)
{