phase out StyleInput; it's just a column number now

StyleInput_INVALID -> Column_INVALID.  (This notation is mostly
used for enums, but makes sense for plain ints, too.)
This commit is contained in:
Glenn Maynard
2006-09-13 09:12:51 +00:00
parent 44b1066888
commit 1c92617072
2 changed files with 12 additions and 12 deletions
+9 -10
View File
@@ -38,10 +38,10 @@ void Style::GetTransformedNoteDataForStyle( PlayerNumber pn, const NoteData& ori
noteDataOut.LoadTransformed( original, m_iColsPerPlayer, iNewToOriginalTrack );
}
GameInput Style::StyleInputToGameInput( const StyleInput& StyleI, PlayerNumber pn ) const
GameInput Style::StyleInputToGameInput( int iCol, PlayerNumber pn ) const
{
ASSERT_M( pn < NUM_PLAYERS && StyleI < MAX_COLS_PER_PLAYER,
ssprintf("P%i C%i", pn, StyleI) );
ASSERT_M( pn < NUM_PLAYERS && iCol < MAX_COLS_PER_PLAYER,
ssprintf("P%i C%i", pn, iCol) );
bool bUsingOneSide = m_StyleType != ONE_PLAYER_TWO_SIDES && m_StyleType != TWO_PLAYERS_SHARED_SIDES;
FOREACH_GameController(gc)
@@ -50,24 +50,23 @@ GameInput Style::StyleInputToGameInput( const StyleInput& StyleI, PlayerNumber p
continue;
for( int i = 0; i < m_pGame->m_iButtonsPerController && m_iInputColumn[gc][i] != END_MAPPING; ++i )
if( m_iInputColumn[gc][i] == StyleI )
if( m_iInputColumn[gc][i] == iCol )
return GameInput( gc, i );
}
FAIL_M( ssprintf("Unknown StyleInput %i,%i", pn, StyleI) );
FAIL_M( ssprintf("Invalid column %i,%i", pn, iCol) );
};
StyleInput Style::GameInputToStyleInput( const GameInput &GameI ) const
int Style::GameInputToStyleInput( const GameInput &GameI ) const
{
if( m_iInputColumn[GameI.controller][GameI.button] == NO_MAPPING )
return StyleInput_INVALID;
return Column_INVALID;
for( int i = 0; i <= GameI.button; ++i )
if( m_iInputColumn[GameI.controller][i] == END_MAPPING )
return StyleInput_INVALID;
return Column_INVALID;
StyleInput SI = (StyleInput) m_iInputColumn[GameI.controller][GameI.button];
return SI;
return m_iInputColumn[GameI.controller][GameI.button];
}
+3 -2
View File
@@ -11,6 +11,7 @@
const int MAX_COLS_PER_PLAYER = MAX_NOTE_TRACKS;
static const int Column_INVALID = -1;
class NoteData;
class Game;
@@ -53,8 +54,8 @@ public:
bool m_bCanUseBeginnerHelper;
bool m_bLockDifficulties; // used in couple Styles
GameInput StyleInputToGameInput( const StyleInput& StyleI, PlayerNumber pn ) const;
StyleInput GameInputToStyleInput( const GameInput &GameI ) const;
GameInput StyleInputToGameInput( int iCol, PlayerNumber pn ) const;
int GameInputToStyleInput( const GameInput &GameI ) const;
PlayerNumber ControllerToPlayerNumber( GameController controller ) const;