Autokeysound transformation!

This commit is contained in:
Thai Pangsakulyanont
2011-02-25 20:42:50 +07:00
parent 69ff65b9a7
commit 1aa51dca15
2 changed files with 42 additions and 4 deletions
+38 -1
View File
@@ -662,7 +662,14 @@ void NoteData::LoadTransformed( const NoteData& in, int iNewNumTracks, const int
Init();
SetNumTracks( iNewNumTracks );
// an array to keep transformed tracks
bool bTransformedTracks[in.GetNumTracks()];
for( int t=0; t<in.GetNumTracks(); t++ )
{
bTransformedTracks[t] = false;
}
// copy tracks
for( int t=0; t<GetNumTracks(); t++ )
{
@@ -673,6 +680,36 @@ void NoteData::LoadTransformed( const NoteData& in, int iNewNumTracks, const int
if( iOriginalTrack == -1 )
continue;
m_TapNotes[t] = in.m_TapNotes[iOriginalTrack];
bTransformedTracks[iOriginalTrack] = true;
}
// move uncopied keysound tracks and put them as autokeysound.
// someone please fix this pile of code pyramid
for( int t=0; t<in.GetNumTracks(); t++ )
{
if( !bTransformedTracks[t] )
{
FOREACH_NONEMPTY_ROW_IN_TRACK( in, t, row )
{
TapNote tn = in.GetTapNote( t, row );
if( tn.type == TapNote::autoKeysound || tn.type == TapNote::hold_head || tn.type == TapNote::tap )
{
if( tn.iKeysoundIndex >= 0 )
{
for( int i=0; i<GetNumTracks(); i++ )
{
if ( GetTapNote(i, row) == TAP_EMPTY )
{
tn.type = TapNote::autoKeysound;
tn.subType = TapNote::SubType_Invalid;
SetTapNote( i, row, tn );
break;
}
}
}
}
}
}
}
}
+4 -3
View File
@@ -572,7 +572,6 @@ static bool LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNameTo
}
}
out.m_StepsType = DetermineStepsType( iPlayer, ndNotes, sPath );
if( out.m_StepsType == StepsType_beat_single5 && GetTagFromMap( mapNameToData, "#title", sData ) )
{
@@ -700,8 +699,10 @@ static bool LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNameTo
{
TapNote tn = ndNotes.GetTapNote( t, row );
int iEmptyTrack = -1;
for ( int i=0; i<iNumNewTracks; i++ ) {
if ( ndNotes.GetTapNote(iTransformNewToOld[i], row) == TAP_EMPTY ) {
for( int i=0; i<iNumNewTracks; i++ )
{
if ( ndNotes.GetTapNote(iTransformNewToOld[i], row) == TAP_EMPTY )
{
iEmptyTrack = iTransformNewToOld[i];
}
}