[backwards -> default] Bring in backwards.

This commit is contained in:
Jason Felds
2011-10-16 16:49:56 -04:00
12 changed files with 101 additions and 58 deletions
+7
View File
@@ -8,6 +8,13 @@ ________________________________________________________________________________
StepMania 5.0 $next | 2011xxxx
--------------------------------------------------------------------------------
2011/10/16
----------
* [NoteDataUtil] Add the Backwards mod for games where the intended
definition of Mirror is different. Regarding Pump gameplay, what was
called Mirror in Preview 4 is considered Backwards now, and the original
Mirror is back in its old position. [Wolfman2000]
2011/10/12
----------
* [Steps] Fix a bug where e.g. ".SM" ".DWI" ".Sm" ".sM" files
+1
View File
@@ -939,6 +939,7 @@
<Class name='PlayerOptions'>
<Function name='GetAlternate'/>
<Function name='GetAttackMines'/>
<Function name='GetBackwards'/>
<Function name='GetBMRize'/>
<Function name='GetBeat'/>
<Function name='GetBig'/>
+3
View File
@@ -2484,6 +2484,9 @@
</Function>
<Function name='GetAttackMines' return='bool' arguments=''>
</Function>
<Function name='GetBackwards' return='bool' arguments=''>
Returns <code>true</code> if the backwards mod is applied, <code>false</code> otherwise.
</Function>
<Function name='GetBeat' return='float' arguments=''>
+9 -6
View File
@@ -323,6 +323,8 @@ SaveScreenshot1=GetCodeForGame("SaveScreenshot1")
SaveScreenshot2=GetCodeForGame("SaveScreenshot2")
# on the player options menu.
CancelAllPlayerOptions=GetCodeForGame("CancelAllPlayerOptions")
# unused codes:
Backwards=""
# deprecated codes:
NextTheme=""
NextTheme2=""
@@ -2199,14 +2201,15 @@ Appearance,4="mod,blink;name,Blink"
# Appearance,5="mod,blink;name,Blink"
# Appearance,6="mod,randomvanish;name,R.Vanish"
Turn="6;selectmultiple"
Turn="7;selectmultiple"
TurnDefault="mod,no turn"
Turn,1="mod,mirror;name,Mirror"
Turn,2="mod,left;name,Left"
Turn,3="mod,right;name,Right"
Turn,4="mod,shuffle;name,Shuffle"
Turn,5="mod,supershuffle;name,SuperShuffle"
Turn,6="mod,softshuffle;name,SoftShuffle"
Turn,2="mod,backwards;name,Backwards"
Turn,3="mod,left;name,Left"
Turn,4="mod,right;name,Right"
Turn,5="mod,shuffle;name,Shuffle"
Turn,6="mod,supershuffle;name,SuperShuffle"
Turn,7="mod,softshuffle;name,SoftShuffle"
# Turn="6"
# TurnDefault="mod,no turn"
+2
View File
@@ -23,6 +23,7 @@ const char *CodeNames[] = {
"ModeMenu1",
"ModeMenu2",
"Mirror",
"Backwards",
"Left",
"Right",
"Shuffle",
@@ -200,6 +201,7 @@ bool CodeDetector::DetectAndAdjustMusicOptions( GameController controller )
switch( code )
{
case CODE_MIRROR: po.ToggleOneTurn( PlayerOptions::TURN_MIRROR ); break;
case CODE_BACKWARDS: po.ToggleOneTurn( PlayerOptions::TURN_BACKWARDS ); break;
case CODE_LEFT: po.ToggleOneTurn( PlayerOptions::TURN_LEFT ); break;
case CODE_RIGHT: po.ToggleOneTurn( PlayerOptions::TURN_RIGHT ); break;
case CODE_SHUFFLE: po.ToggleOneTurn( PlayerOptions::TURN_SHUFFLE ); break;
+1
View File
@@ -17,6 +17,7 @@ enum Code {
CODE_MODE_MENU1,
CODE_MODE_MENU2,
CODE_MIRROR,
CODE_BACKWARDS,
CODE_LEFT,
CODE_RIGHT,
CODE_SHUFFLE,
+55 -49
View File
@@ -1125,6 +1125,7 @@ void NoteDataUtil::RemoveAllButPlayer( NoteData &inout, PlayerNumber pn )
}
}
// TODO: Perform appropriate matrix calculations for everything instead.
static void GetTrackMapping( StepsType st, NoteDataUtil::TrackMapping tt, int NumTracks, int *iTakeFromTrack )
{
// Identity transform for cases not handled below.
@@ -1208,57 +1209,61 @@ static void GetTrackMapping( StepsType st, NoteDataUtil::TrackMapping tt, int Nu
}
break;
case NoteDataUtil::backwards:
{
// If a Pump game type, treat differently. Otherwise, send to mirror.
bool needsBackwards = true;
switch (st)
{
case StepsType_pump_single:
case StepsType_pump_couple:
{
iTakeFromTrack[0] = 3;
iTakeFromTrack[1] = 4;
iTakeFromTrack[2] = 2;
iTakeFromTrack[3] = 0;
iTakeFromTrack[4] = 1;
iTakeFromTrack[5] = 8;
iTakeFromTrack[6] = 9;
iTakeFromTrack[7] = 2;
iTakeFromTrack[8] = 5;
iTakeFromTrack[9] = 6;
break;
}
case StepsType_pump_double:
case StepsType_pump_routine:
{
iTakeFromTrack[0] = 8;
iTakeFromTrack[1] = 9;
iTakeFromTrack[2] = 7;
iTakeFromTrack[3] = 5;
iTakeFromTrack[4] = 6;
iTakeFromTrack[5] = 3;
iTakeFromTrack[6] = 4;
iTakeFromTrack[7] = 2;
iTakeFromTrack[8] = 0;
iTakeFromTrack[9] = 1;
break;
}
case StepsType_pump_halfdouble:
{
iTakeFromTrack[0] = 5;
iTakeFromTrack[1] = 3;
iTakeFromTrack[2] = 4;
iTakeFromTrack[3] = 1;
iTakeFromTrack[4] = 2;
iTakeFromTrack[5] = 0;
break;
}
default:
needsBackwards = false;
}
if (needsBackwards) break;
}
case NoteDataUtil::mirror:
{
switch (st)
{
case StepsType_pump_single:
case StepsType_pump_couple:
{
iTakeFromTrack[0] = 3;
iTakeFromTrack[1] = 4;
iTakeFromTrack[2] = 2;
iTakeFromTrack[3] = 0;
iTakeFromTrack[4] = 1;
iTakeFromTrack[5] = 8;
iTakeFromTrack[6] = 9;
iTakeFromTrack[7] = 2;
iTakeFromTrack[8] = 5;
iTakeFromTrack[9] = 6;
break;
}
case StepsType_pump_double:
case StepsType_pump_routine:
{
iTakeFromTrack[0] = 8;
iTakeFromTrack[1] = 9;
iTakeFromTrack[2] = 7;
iTakeFromTrack[3] = 5;
iTakeFromTrack[4] = 6;
iTakeFromTrack[5] = 3;
iTakeFromTrack[6] = 4;
iTakeFromTrack[7] = 2;
iTakeFromTrack[8] = 0;
iTakeFromTrack[9] = 1;
break;
}
case StepsType_pump_halfdouble:
{
iTakeFromTrack[0] = 5;
iTakeFromTrack[1] = 3;
iTakeFromTrack[2] = 4;
iTakeFromTrack[3] = 1;
iTakeFromTrack[4] = 2;
iTakeFromTrack[5] = 0;
break;
}
default:
{
for( int t=0; t<NumTracks; t++ )
iTakeFromTrack[t] = NumTracks-t-1;
break;
}
}
for( int t=0; t<NumTracks; t++ )
iTakeFromTrack[t] = NumTracks-t-1;
break;
}
case NoteDataUtil::shuffle:
@@ -2332,6 +2337,7 @@ void NoteDataUtil::TransformNoteData( NoteData &nd, const PlayerOptions &po, Ste
// Apply turns and shuffles last so that they affect inserts.
if( po.m_bTurns[PlayerOptions::TURN_MIRROR] ) NoteDataUtil::Turn( nd, st, NoteDataUtil::mirror, iStartIndex, iEndIndex );
if( po.m_bTurns[PlayerOptions::TURN_BACKWARDS] ) NoteDataUtil::Turn( nd, st, NoteDataUtil::backwards, iStartIndex, iEndIndex );
if( po.m_bTurns[PlayerOptions::TURN_LEFT] ) NoteDataUtil::Turn( nd, st, NoteDataUtil::left, iStartIndex, iEndIndex );
if( po.m_bTurns[PlayerOptions::TURN_RIGHT] ) NoteDataUtil::Turn( nd, st, NoteDataUtil::right, iStartIndex, iEndIndex );
if( po.m_bTurns[PlayerOptions::TURN_SHUFFLE] ) NoteDataUtil::Turn( nd, st, NoteDataUtil::shuffle, iStartIndex, iEndIndex );
+14 -1
View File
@@ -111,7 +111,20 @@ namespace NoteDataUtil
void RemoveStretch( NoteData &inout, StepsType st, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW );
void RemoveAllButOneTap( NoteData &inout, int row );
void RemoveAllButPlayer( NoteData &inout, PlayerNumber pn );
enum TrackMapping { left, right, mirror, shuffle, soft_shuffle, super_shuffle, stomp, NUM_TRACK_MAPPINGS };
/** @brief The types of transformations available for the NoteData. */
enum TrackMapping
{
left, /**< The NoteData is arranged as if the player was facing to the left. */
right, /**< The NoteData is arranged as if the player was facing to the right. */
mirror, /**< The NoteData is arranged as if facing a straight mirror. */
backwards, /**< The NoteData is arranged as if the player was facing backwards.
This is NOT always the same as mirror. */
shuffle,
soft_shuffle,
super_shuffle,
stomp,
NUM_TRACK_MAPPINGS
};
void Turn( NoteData &inout, StepsType st, TrackMapping tt, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW );
void Little( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW );
void Wide( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW );
+4
View File
@@ -195,6 +195,7 @@ void PlayerOptions::GetMods( vector<RString> &AddTo, bool bForceNoteSkin ) const
AddPart( AddTo, m_fRandomSpeed, "RandomSpeed" );
if( m_bTurns[TURN_MIRROR] ) AddTo.push_back( "Mirror" );
if( m_bTurns[TURN_BACKWARDS] ) AddTo.push_back( "Backwards" );
if( m_bTurns[TURN_LEFT] ) AddTo.push_back( "Left" );
if( m_bTurns[TURN_RIGHT] ) AddTo.push_back( "Right" );
if( m_bTurns[TURN_SHUFFLE] ) AddTo.push_back( "Shuffle" );
@@ -389,6 +390,7 @@ bool PlayerOptions::FromOneModString( const RString &sOneMod, RString &sErrorOut
else if( sBit == "randomvanish" ) SET_FLOAT( fAppearances[APPEARANCE_RANDOMVANISH] )
else if( sBit == "turn" && !on ) ZERO( m_bTurns ); /* "no turn" */
else if( sBit == "mirror" ) m_bTurns[TURN_MIRROR] = on;
else if( sBit == "backwards" ) m_bTurns[TURN_BACKWARDS] = on;
else if( sBit == "left" ) m_bTurns[TURN_LEFT] = on;
else if( sBit == "right" ) m_bTurns[TURN_RIGHT] = on;
else if( sBit == "shuffle" ) m_bTurns[TURN_SHUFFLE] = on;
@@ -963,6 +965,7 @@ public:
// Turns
DEFINE_METHOD( GetMirror, m_bTurns[PlayerOptions::TURN_MIRROR] )
DEFINE_METHOD( GetBackwards, m_bTurns[PlayerOptions::TURN_BACKWARDS] )
DEFINE_METHOD( GetLeft, m_bTurns[PlayerOptions::TURN_LEFT] )
DEFINE_METHOD( GetRight, m_bTurns[PlayerOptions::TURN_RIGHT] )
DEFINE_METHOD( GetShuffle, m_bTurns[PlayerOptions::TURN_SHUFFLE] )
@@ -1088,6 +1091,7 @@ public:
// Turns
ADD_METHOD( GetMirror );
ADD_METHOD( GetBackwards );
ADD_METHOD( GetLeft );
ADD_METHOD( GetRight );
ADD_METHOD( GetShuffle );
+1
View File
@@ -109,6 +109,7 @@ public:
enum Turn {
TURN_NONE=0, /**< No turning of the arrows is performed. */
TURN_MIRROR, /**< The arrows are mirrored from their normal position. */
TURN_BACKWARDS, /**< The arrows are turned 180 degrees. This does NOT always equal mirror. */
TURN_LEFT, /**< The arrows are turned 90 degrees to the left. */
TURN_RIGHT, /**< The arrows are turned 90 degress to the right. */
TURN_SHUFFLE, /**< Some of the arrow columns are changed throughout the whole song. */
+2 -1
View File
@@ -549,7 +549,7 @@ static MenuDef g_AlterMenu(
EditMode_Practice, true, true, 0,
"4th","8th","12th","16th","24th","32nd","48th","64th","192nd"),
MenuRowDef(ScreenEdit::turn, "Turn", true,
EditMode_Practice, true, true, 0, "Left","Right","Mirror","Shuffle","SuperShuffle" ),
EditMode_Practice, true, true, 0, "Left","Right","Mirror","Backwards","Shuffle","SuperShuffle" ),
MenuRowDef(ScreenEdit::transform, "Transform", true,
EditMode_Practice, true, true, 0, "NoHolds","NoMines","Little","Wide",
"Big","Quick","Skippy","Mines","Echo","Stomp","Planted","Floored",
@@ -3986,6 +3986,7 @@ void ScreenEdit::HandleAlterMenuChoice(AlterMenuChoice c, const vector<int> &iAn
case left: NoteDataUtil::Turn( m_Clipboard, st, NoteDataUtil::left ); break;
case right: NoteDataUtil::Turn( m_Clipboard, st, NoteDataUtil::right ); break;
case mirror: NoteDataUtil::Turn( m_Clipboard, st, NoteDataUtil::mirror ); break;
case turn_backwards: NoteDataUtil::Turn( m_Clipboard, st, NoteDataUtil::backwards ); break;
case shuffle: NoteDataUtil::Turn( m_Clipboard, st, NoteDataUtil::shuffle ); break;
case super_shuffle: NoteDataUtil::Turn( m_Clipboard, st, NoteDataUtil::super_shuffle ); break;
}
+2 -1
View File
@@ -456,7 +456,8 @@ public:
{
left, /**< Turn the notes as if you were facing to the left. */
right, /**< Turn the notes as if you were facing to the right. */
mirror, /**< Turn the notes as if you were facing away from the machine. */
mirror, /**< Flip the notes vertically. */
turn_backwards, /**< Turn the notes as if you were facing away from the machine. */
shuffle, /**< Replace one column with another column. */
super_shuffle, /**< Replace each note individually. */
NUM_TURN_TYPES