Reverse the column<->GameInput mapping; instead of allowing a button
to map to more than one column (useless), allow more than one button to map to a column. This allows handling both UP and DOWN inputs for a single SCRATCH column. (more work still needed for correct scratch handling; also, due to the massive number of styles we have, some of these entries may be incorrect)
This commit is contained in:
+687
-525
File diff suppressed because it is too large
Load Diff
+18
-15
@@ -36,28 +36,35 @@ void Style::GetTransformedNoteDataForStyle( PlayerNumber pn, const NoteData& ori
|
|||||||
noteDataOut.LoadTransformed( original, m_iColsPerPlayer, iNewToOriginalTrack );
|
noteDataOut.LoadTransformed( original, m_iColsPerPlayer, iNewToOriginalTrack );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
GameInput Style::StyleInputToGameInput( const StyleInput& StyleI ) const
|
GameInput Style::StyleInputToGameInput( const StyleInput& StyleI ) const
|
||||||
{
|
{
|
||||||
ASSERT_M( StyleI.player < NUM_PLAYERS, ssprintf("P%i", StyleI.player) );
|
ASSERT_M( StyleI.player < NUM_PLAYERS, ssprintf("P%i", StyleI.player) );
|
||||||
ASSERT_M( StyleI.col < MAX_COLS_PER_PLAYER, ssprintf("C%i", StyleI.col) );
|
ASSERT_M( StyleI.col < MAX_COLS_PER_PLAYER, ssprintf("C%i", StyleI.col) );
|
||||||
GameController c = m_ColumnInfo[StyleI.player][StyleI.col].controller;
|
|
||||||
GameButton b = m_ColumnInfo[StyleI.player][StyleI.col].button;
|
FOREACH_GameController(gc)
|
||||||
return GameInput( c, b );
|
{
|
||||||
|
for( int i = 0; i < m_pGame->m_iButtonsPerController && m_iInputColumn[gc][i] != END_MAPPING; ++i )
|
||||||
|
if( m_iInputColumn[gc][i] == StyleI.col )
|
||||||
|
return GameInput( gc, i );
|
||||||
|
}
|
||||||
|
|
||||||
|
FAIL_M( ssprintf("Unknown StyleInput %i,%i", StyleI.player, StyleI.col) );
|
||||||
};
|
};
|
||||||
|
|
||||||
StyleInput Style::GameInputToStyleInput( const GameInput &GameI ) const
|
StyleInput Style::GameInputToStyleInput( const GameInput &GameI ) const
|
||||||
{
|
{
|
||||||
StyleInput SI;
|
StyleInput SI;
|
||||||
|
|
||||||
FOREACH_PlayerNumber( p )
|
if( m_iInputColumn[0][0] == NO_MAPPING )
|
||||||
|
return SI; // Return invalid.
|
||||||
|
|
||||||
|
for( int i = 0; i < GameI.button; ++i )
|
||||||
{
|
{
|
||||||
for( int t=0; t<m_iColsPerPlayer; t++ )
|
if( m_iInputColumn[GameI.controller][i] == END_MAPPING )
|
||||||
{
|
return SI; // Return invalid.
|
||||||
if( m_ColumnInfo[p][t].controller == GameI.controller &&
|
}
|
||||||
m_ColumnInfo[p][t].button == GameI.button )
|
|
||||||
{
|
SI = StyleInput( (PlayerNumber) GameI.controller, m_iInputColumn[GameI.controller][i] );
|
||||||
SI = StyleInput( (PlayerNumber)p, t );
|
|
||||||
|
|
||||||
// HACK: Looking up the player number using m_ColumnInfo
|
// HACK: Looking up the player number using m_ColumnInfo
|
||||||
// returns the wrong answer for ONE_PLAYER_TWO_SIDES styles
|
// returns the wrong answer for ONE_PLAYER_TWO_SIDES styles
|
||||||
@@ -66,10 +73,6 @@ StyleInput Style::GameInputToStyleInput( const GameInput &GameI ) const
|
|||||||
|
|
||||||
return SI;
|
return SI;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
return SI; // Didn't find a match. Return invalid.
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
PlayerNumber Style::ControllerToPlayerNumber( GameController controller ) const
|
PlayerNumber Style::ControllerToPlayerNumber( GameController controller ) const
|
||||||
|
|||||||
@@ -37,11 +37,15 @@ public:
|
|||||||
struct ColumnInfo
|
struct ColumnInfo
|
||||||
{
|
{
|
||||||
int track; // take note data from this track
|
int track; // take note data from this track
|
||||||
GameController controller; // use this instrument to hit a note on this track
|
|
||||||
GameButton button; // use this button to hit a note on this track
|
|
||||||
float fXOffset; // x position of the column relative to player center
|
float fXOffset; // x position of the column relative to player center
|
||||||
};
|
};
|
||||||
|
|
||||||
ColumnInfo m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER]; // maps each players' column to a track in the NoteData
|
ColumnInfo m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER]; // maps each players' column to a track in the NoteData
|
||||||
|
|
||||||
|
/* This maps from game inputs to columns. More than one button may map to a
|
||||||
|
* single column. */
|
||||||
|
enum { NO_MAPPING = -1, END_MAPPING = -2 };
|
||||||
|
int m_iInputColumn[MAX_GAME_CONTROLLERS][MAX_GAME_BUTTONS]; // maps each input to a column, or GAME_BUTTON_INVALID
|
||||||
int m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
int m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||||
bool m_bNeedsZoomOutWith2Players;
|
bool m_bNeedsZoomOutWith2Players;
|
||||||
bool m_bCanUseBeginnerHelper;
|
bool m_bCanUseBeginnerHelper;
|
||||||
|
|||||||
Reference in New Issue
Block a user