add "Autogen To Fill Width" to editor
This commit is contained in:
@@ -334,6 +334,8 @@ void NoteDataUtil::LoadTransformedSlidingWindow( const NoteData &in, NoteData &o
|
||||
|
||||
out.SetNumTracks( iNewNumTracks );
|
||||
|
||||
if( in.GetNumTracks() == 0 )
|
||||
return; // nothing to do and don't AV below
|
||||
|
||||
int iCurTrackOffset = 0;
|
||||
int iTrackOffsetMin = 0;
|
||||
@@ -1842,6 +1844,22 @@ void NoteDataUtil::RemoveAllTapsExceptForType( NoteData& ndInOut, TapNote::Type
|
||||
}
|
||||
}
|
||||
|
||||
int NoteDataUtil::GetNumUsedTracks( const NoteData& in )
|
||||
{
|
||||
for( int t=0; t<in.GetNumTracks(); t++ )
|
||||
{
|
||||
bool bHasAnyTapsInTrack = false;
|
||||
FOREACH_NONEMPTY_ROW_IN_TRACK( in, t, row )
|
||||
{
|
||||
bHasAnyTapsInTrack = true;
|
||||
break;
|
||||
}
|
||||
if( !bHasAnyTapsInTrack )
|
||||
return t;
|
||||
}
|
||||
return in.GetNumTracks();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* (c) 2001-2004 Chris Danford, Glenn Maynard
|
||||
|
||||
@@ -104,6 +104,8 @@ namespace NoteDataUtil
|
||||
|
||||
void RemoveAllTapsOfType( NoteData& ndInOut, TapNote::Type typeToRemove );
|
||||
void RemoveAllTapsExceptForType( NoteData& ndInOut, TapNote::Type typeToKeep );
|
||||
|
||||
int GetNumUsedTracks( const NoteData& in );
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -386,7 +386,7 @@ static Menu g_AreaMenu(
|
||||
MenuRow( ScreenEdit::quantize, "Quantize", true, true, 0, "4th","8th","12th","16th","24th","32nd","48th","64th","192nd"),
|
||||
MenuRow( ScreenEdit::turn, "Turn", true, true, 0, "Left","Right","Mirror","Shuffle","SuperShuffle" ),
|
||||
MenuRow( ScreenEdit::transform, "Transform", true, true, 0, "NoHolds","NoMines","Little","Wide","Big","Quick","Skippy","Mines","Echo","Stomp","Planted","Floored","Twister","NoJumps","NoHands","NoQuads" ),
|
||||
MenuRow( ScreenEdit::alter, "Alter", true, true, 0, "Backwards","Swap Sides","Copy Left To Right","Copy Right To Left","Clear Left","Clear Right","Collapse To One","Collapse Left","Shift Left","Shift Right" ),
|
||||
MenuRow( ScreenEdit::alter, "Alter", true, true, 0, "Autogen To Fill Width","Backwards","Swap Sides","Copy Left To Right","Copy Right To Left","Clear Left","Clear Right","Collapse To One","Collapse Left","Shift Left","Shift Right" ),
|
||||
MenuRow( ScreenEdit::tempo, "Tempo", true, false, 0, "Compress 2x","Compress 3->2","Compress 4->3","Expand 3->4","Expand 2->3","Expand 2x" ),
|
||||
MenuRow( ScreenEdit::play, "Play selection", true, true, 0, NULL ),
|
||||
MenuRow( ScreenEdit::record, "Record in selection", true, true, 0, NULL ),
|
||||
@@ -2132,6 +2132,15 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, const vector<int> &iAns
|
||||
AlterType at = (AlterType)iAnswers[c];
|
||||
switch( at )
|
||||
{
|
||||
case autogen_to_fill_width:
|
||||
{
|
||||
NoteData temp( m_Clipboard );
|
||||
int iNumUsedTracks = NoteDataUtil::GetNumUsedTracks( temp );
|
||||
temp.SetNumTracks( iNumUsedTracks );
|
||||
NoteDataUtil::LoadTransformedSlidingWindow( temp, m_Clipboard, m_Clipboard.GetNumTracks() );
|
||||
NoteDataUtil::FixImpossibleRows( m_Clipboard, GAMESTATE->m_pCurSteps[0]->m_StepsType );
|
||||
}
|
||||
break;
|
||||
case backwards: NoteDataUtil::Backwards( m_Clipboard ); break;
|
||||
case swap_sides: NoteDataUtil::SwapSides( m_Clipboard ); break;
|
||||
case copy_left_to_right: NoteDataUtil::CopyLeftToRight( m_Clipboard ); break;
|
||||
|
||||
@@ -293,7 +293,8 @@ public:
|
||||
NUM_TRANSFORM_TYPES
|
||||
};
|
||||
enum AlterType
|
||||
{
|
||||
{
|
||||
autogen_to_fill_width,
|
||||
backwards,
|
||||
swap_sides,
|
||||
copy_left_to_right,
|
||||
|
||||
Reference in New Issue
Block a user