rename FixImposibleRows -> RemoveStretch and turn it into a mod

This commit is contained in:
Chris Danford
2005-05-01 04:35:29 +00:00
parent 8ebed4eb1d
commit b81c304eb6
7 changed files with 16 additions and 7 deletions
+3 -2
View File
@@ -1631,7 +1631,7 @@ const ValidRow g_ValidRows[] =
{ STEPS_TYPE_DANCE_DOUBLE, { f,f,f,f,T,T,T,T } },
};
void NoteDataUtil::FixImpossibleRows( NoteData &inout, StepsType st )
void NoteDataUtil::RemoveStretch( NoteData &inout, StepsType st, int iStartIndex, int iEndIndex )
{
vector<const ValidRow*> vpValidRowsToCheck;
for( unsigned i=0; i<ARRAYSIZE(g_ValidRows); i++ )
@@ -1645,7 +1645,7 @@ void NoteDataUtil::FixImpossibleRows( NoteData &inout, StepsType st )
return;
// each row must pass at least one valid mask
FOREACH_NONEMPTY_ROW_ALL_TRACKS( inout, r )
FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( inout, r, iStartIndex, iEndIndex )
{
// only check rows with jumps
if( inout.GetNumTapNonEmptyTracks(r) < 2 )
@@ -1718,6 +1718,7 @@ void NoteDataUtil::TransformNoteData( NoteData &nd, const PlayerOptions &po, Ste
if( po.m_bTransforms[PlayerOptions::TRANSFORM_NOJUMPS] ) NoteDataUtil::RemoveJumps( nd, iStartIndex, iEndIndex );
if( po.m_bTransforms[PlayerOptions::TRANSFORM_NOHANDS] ) NoteDataUtil::RemoveHands( nd, iStartIndex, iEndIndex );
if( po.m_bTransforms[PlayerOptions::TRANSFORM_NOQUADS] ) NoteDataUtil::RemoveQuads( nd, iStartIndex, iEndIndex );
if( po.m_bTransforms[PlayerOptions::TRANSFORM_NOSTRETCH] ) NoteDataUtil::RemoveStretch( nd, st, iStartIndex, iEndIndex );
// Apply inserts.
if( po.m_bTransforms[PlayerOptions::TRANSFORM_BIG] ) NoteDataUtil::Big( nd, iStartIndex, iEndIndex );
+1 -2
View File
@@ -40,6 +40,7 @@ namespace NoteDataUtil
void RemoveHands( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW );
void RemoveQuads( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW );
void RemoveMines( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW );
void RemoveStretch( NoteData &inout, StepsType st, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW );
void RemoveAllButOneTap( NoteData &inout, int row );
enum TrackMapping { left, right, mirror, shuffle, super_shuffle, stomp, NUM_TRACK_MAPPINGS };
void Turn( NoteData &inout, StepsType st, TrackMapping tt, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW );
@@ -87,8 +88,6 @@ namespace NoteDataUtil
SnapToNearestNoteType( inout, nt, NOTE_TYPE_INVALID, iStartIndex, iEndIndex );
}
void FixImpossibleRows( NoteData &inout, StepsType st );
// True if no notes in row that aren't true in the mask
bool RowPassesValidMask( NoteData &inout, int row, const bool bValidMask[] );
+6
View File
@@ -170,6 +170,7 @@ void PlayerOptions::GetMods( vector<CString> &AddTo ) const
if( m_bTransforms[TRANSFORM_NOJUMPS] ) AddTo.push_back( "NoJumps" );
if( m_bTransforms[TRANSFORM_NOHANDS] ) AddTo.push_back( "NoHands" );
if( m_bTransforms[TRANSFORM_NOQUADS] ) AddTo.push_back( "NoQuads" );
if( m_bTransforms[TRANSFORM_NOSTRETCH] )AddTo.push_back( "NoStretch" );
if( m_fSkew==0 && m_fPerspectiveTilt==0 ) { if( m_bSetTiltOrSkew ) AddTo.push_back( "Overhead" ); }
else if( m_fSkew==1 && m_fPerspectiveTilt==-1 ) AddTo.push_back( "Incoming" );
@@ -301,6 +302,7 @@ void PlayerOptions::FromString( CString sOptions, bool bWarnOnInvalid )
else if( sBit == "noholds" || sBit == "nofreeze" ) m_bTransforms[TRANSFORM_NOHOLDS] = on;
else if( sBit == "norolls" ) m_bTransforms[TRANSFORM_NOROLLS] = on;
else if( sBit == "nomines" ) m_bTransforms[TRANSFORM_NOMINES] = on;
else if( sBit == "nostretch" ) m_bTransforms[TRANSFORM_NOSTRETCH] = on;
else if( sBit == "dark" ) SET_FLOAT( fDark )
else if( sBit == "blind" ) SET_FLOAT( fBlind )
else if( sBit == "cover" ) SET_FLOAT( fCover )
@@ -566,6 +568,8 @@ bool PlayerOptions::IsEasierForSongAndSteps( Song* pSong, Steps* pSteps )
return true;
if( m_bTransforms[TRANSFORM_NOJUMPS] && pSteps->GetRadarValues()[RADAR_NUM_JUMPS]>0 )
return true;
if( m_bTransforms[TRANSFORM_NOSTRETCH] )
return true;
// Inserted holds can be really easy on some songs, and scores will be
// highly hold-weighted, and very little tap score weighted.
@@ -656,6 +660,7 @@ CString PlayerOptions::GetSavedPrefsString() const
SAVE( m_bTransforms[TRANSFORM_NOJUMPS] );
SAVE( m_bTransforms[TRANSFORM_NOHANDS] );
SAVE( m_bTransforms[TRANSFORM_NOQUADS] );
SAVE( m_bTransforms[TRANSFORM_NOSTRETCH] );
SAVE( m_ScoreDisplay );
SAVE( m_sNoteSkin );
#undef SAVE
@@ -677,6 +682,7 @@ void PlayerOptions::ResetSavedPrefs()
CPY( m_bTransforms[TRANSFORM_NOJUMPS] );
CPY( m_bTransforms[TRANSFORM_NOHANDS] );
CPY( m_bTransforms[TRANSFORM_NOQUADS] );
CPY( m_bTransforms[TRANSFORM_NOSTRETCH] );
CPY( m_sNoteSkin );
#undef CPY
}
+1
View File
@@ -85,6 +85,7 @@ struct PlayerOptions
TRANSFORM_NOJUMPS,
TRANSFORM_NOHANDS,
TRANSFORM_NOQUADS,
TRANSFORM_NOSTRETCH,
NUM_TRANSFORMS
};
enum Scroll {
+3 -2
View File
@@ -390,7 +390,7 @@ static Menu g_AreaMenu(
MenuRow( ScreenEdit::clear, "Clear area", true, EDIT_MODE_PRACTICE, 0, NULL ),
MenuRow( ScreenEdit::quantize, "Quantize", true, EDIT_MODE_PRACTICE, 0, "4th","8th","12th","16th","24th","32nd","48th","64th","192nd"),
MenuRow( ScreenEdit::turn, "Turn", true, EDIT_MODE_PRACTICE, 0, "Left","Right","Mirror","Shuffle","SuperShuffle" ),
MenuRow( ScreenEdit::transform, "Transform", true, EDIT_MODE_PRACTICE, 0, "NoHolds","NoMines","Little","Wide","Big","Quick","Skippy","Mines","Echo","Stomp","Planted","Floored","Twister","NoJumps","NoHands","NoQuads" ),
MenuRow( ScreenEdit::transform, "Transform", true, EDIT_MODE_PRACTICE, 0, "NoHolds","NoMines","Little","Wide","Big","Quick","Skippy","Mines","Echo","Stomp","Planted","Floored","Twister","NoJumps","NoHands","NoQuads","NoStretch" ),
MenuRow( ScreenEdit::alter, "Alter", true, EDIT_MODE_PRACTICE, 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, EDIT_MODE_FULL, 0, "Compress 2x","Compress 3->2","Compress 4->3","Expand 3->4","Expand 2->3","Expand 2x" ),
MenuRow( ScreenEdit::play, "Play selection", true, EDIT_MODE_PRACTICE, 0, NULL ),
@@ -2246,6 +2246,7 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, const vector<int> &iAns
case nojumps: NoteDataUtil::RemoveJumps( m_NoteDataEdit, iBeginRow, iEndRow ); break;
case nohands: NoteDataUtil::RemoveHands( m_NoteDataEdit, iBeginRow, iEndRow ); break;
case noquads: NoteDataUtil::RemoveQuads( m_NoteDataEdit, iBeginRow, iEndRow ); break;
case nostretch: NoteDataUtil::RemoveStretch( m_NoteDataEdit, st, iBeginRow, iBeginRow ); break;
default: ASSERT(0);
}
@@ -2269,7 +2270,7 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, const vector<int> &iAns
break;
temp.SetNumTracks( iNumUsedTracks );
NoteDataUtil::LoadTransformedSlidingWindow( temp, m_Clipboard, m_Clipboard.GetNumTracks() );
NoteDataUtil::FixImpossibleRows( m_Clipboard, GAMESTATE->m_pCurSteps[0]->m_StepsType );
NoteDataUtil::RemoveStretch( m_Clipboard, GAMESTATE->m_pCurSteps[0]->m_StepsType );
}
break;
case backwards: NoteDataUtil::Backwards( m_Clipboard ); break;
+1
View File
@@ -298,6 +298,7 @@ public:
nojumps,
nohands,
noquads,
nostretch,
NUM_TRANSFORM_TYPES
};
enum AlterType
+1 -1
View File
@@ -191,7 +191,7 @@ void Steps::Decompress() const
{
NoteDataUtil::LoadTransformedSlidingWindow( notedata, m_NoteData, iNewTracks );
NoteDataUtil::FixImpossibleRows( m_NoteData, m_StepsType );
NoteDataUtil::RemoveStretch( m_NoteData, m_StepsType );
}
return;
}