diff --git a/stepmania/src/Game.cpp b/stepmania/src/Game.cpp index 6a8d5eb95a..c460d3d450 100644 --- a/stepmania/src/Game.cpp +++ b/stepmania/src/Game.cpp @@ -96,8 +96,7 @@ RString Game::ColToButtonName( int col ) const if( pzColumnName != NULL ) return pzColumnName; - StyleInput SI( PLAYER_1, col ); - GameInput GI = pStyle->StyleInputToGameInput( SI, PLAYER_1 ); + GameInput GI = pStyle->StyleInputToGameInput( col, PLAYER_1 ); return m_szButtonNames[GI.button]; } diff --git a/stepmania/src/LightsManager.cpp b/stepmania/src/LightsManager.cpp index df433fe6af..53c8cc9175 100644 --- a/stepmania/src/LightsManager.cpp +++ b/stepmania/src/LightsManager.cpp @@ -65,8 +65,7 @@ static void GetUsedGameInputs( vector &vGameInputsOut ) { for( int i=0; i<(*style)->m_iColsPerPlayer; i++ ) { - StyleInput si( pn, i ); - GameInput gi = (*style)->StyleInputToGameInput( si, pn ); + GameInput gi = (*style)->StyleInputToGameInput( i, pn ); if( gi.IsValid() ) { vGIs.insert( gi ); diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 8fe0bec2e0..9e3e266ee3 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -543,8 +543,7 @@ void Player::Update( float fDeltaTime ) // TODO: Remove use of PlayerNumber. PlayerNumber pn = m_pPlayerState->m_PlayerNumber; - const StyleInput StyleI( pn, col ); - bool bIsHoldingButton = INPUTMAPPER->IsBeingPressed( StyleI, pn ); + bool bIsHoldingButton = INPUTMAPPER->IsBeingPressed( col, pn ); // TODO: Make this work for non-human-controlled players if( bIsHoldingButton && !GAMESTATE->m_bDemonstrationOrJukebox && m_pPlayerState->m_PlayerController==PC_HUMAN ) if( m_pNoteField ) @@ -621,8 +620,7 @@ void Player::Update( float fDeltaTime ) } else { - const StyleInput StyleI( pn, iTrack ); - bIsHoldingButton = INPUTMAPPER->IsBeingPressed( StyleI, pn, m_pPlayerState->m_mp ); + bIsHoldingButton = INPUTMAPPER->IsBeingPressed( iTrack, pn, m_pPlayerState->m_mp ); } int iEndRow = iRow + tn.iDuration; @@ -1008,8 +1006,7 @@ void Player::Step( int col, int row, const RageTimer &tm, bool bHeld, bool bRele int iNumTracksHeld = 0; for( int t=0; tGetCurrentStyle()->StyleInputToGameInput( StyleI ); + const GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( t, pn ); const float fSecsHeld = INPUTMAPPER->GetSecsHeld( GameI ); if( fSecsHeld > 0 && fSecsHeld < JUMP_WINDOW_SECONDS ) iNumTracksHeld++; @@ -1489,16 +1486,15 @@ void Player::CrossedMineRow( int iNoteRow, const RageTimer &now ) // TODO: Remove use of PlayerNumber. PlayerNumber pn = m_pPlayerState->m_PlayerNumber; - const StyleInput StyleI( pn, t ); if( PREFSMAN->m_fPadStickSeconds > 0 ) { - float fSecsHeld = INPUTMAPPER->GetSecsHeld( StyleI, pn, m_pPlayerState->m_mp ); + float fSecsHeld = INPUTMAPPER->GetSecsHeld( t, pn, m_pPlayerState->m_mp ); if( fSecsHeld >= PREFSMAN->m_fPadStickSeconds ) Step( t, -1, now+(-PREFSMAN->m_fPadStickSeconds), true, false ); } else { - bool bIsDown = INPUTMAPPER->IsBeingPressed( StyleI, pn, m_pPlayerState->m_mp ); + bool bIsDown = INPUTMAPPER->IsBeingPressed( t, pn, m_pPlayerState->m_mp ); if( bIsDown ) Step( t, iNoteRow, now, true, false ); } diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index be8f45d688..69e4f58eb8 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -886,8 +886,7 @@ void ScreenEdit::Update( float fDeltaTime ) { for( int t=0; tGetCurrentStyle()->m_iColsPerPlayer; t++ ) // for each track { - StyleInput StyleI( PLAYER_1, t ); - float fSecsHeld = INPUTMAPPER->GetSecsHeld( StyleI, PLAYER_1 ); + float fSecsHeld = INPUTMAPPER->GetSecsHeld( t, PLAYER_1 ); fSecsHeld = min( fSecsHeld, m_RemoveNoteButtonLastChanged.Ago() ); if( fSecsHeld == 0 ) continue; @@ -934,8 +933,7 @@ void ScreenEdit::Update( float fDeltaTime ) bool bButtonIsBeingPressed = false; for( int t=0; tGetCurrentStyle()->m_iColsPerPlayer; t++ ) // for each track { - StyleInput StyleI( PLAYER_1, t ); - if( INPUTMAPPER->IsBeingPressed(StyleI, PLAYER_1) ) + if( INPUTMAPPER->IsBeingPressed(t, PLAYER_1) ) bButtonIsBeingPressed = true; } diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 7dbfd48f25..6a866a6451 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -1895,8 +1895,7 @@ void ScreenGameplay::UpdateLights() if( bBlink ) { - StyleInput si( pi->m_pn, t ); - GameInput gi = pStyle->StyleInputToGameInput( si, pi->m_pn ); + GameInput gi = pStyle->StyleInputToGameInput( t, pi->m_pn ); bBlinkGameButton[gi.controller][gi.button] = true; } } diff --git a/stepmania/src/ScreenNameEntry.cpp b/stepmania/src/ScreenNameEntry.cpp index 394d832025..45894bdc70 100644 --- a/stepmania/src/ScreenNameEntry.cpp +++ b/stepmania/src/ScreenNameEntry.cpp @@ -194,8 +194,7 @@ void ScreenNameEntry::Init() continue; /* We have enough columns. */ /* Find out if this column is associated with the START menu button. */ - StyleInput si(p, t); - GameInput gi=GAMESTATE->GetCurrentStyle()->StyleInputToGameInput(si, p); + GameInput gi=GAMESTATE->GetCurrentStyle()->StyleInputToGameInput(t, p); MenuInput m=GAMESTATE->GetCurrentGame()->GameInputToMenuInput(gi); if(m.button == MENU_BUTTON_START) continue; diff --git a/stepmania/src/Style.cpp b/stepmania/src/Style.cpp index 1c04f296cd..6fa1d8138d 100644 --- a/stepmania/src/Style.cpp +++ b/stepmania/src/Style.cpp @@ -68,7 +68,7 @@ StyleInput Style::GameInputToStyleInput( const GameInput &GameI ) const if( m_iInputColumn[GameI.controller][i] == END_MAPPING ) return SI; // Return invalid. - SI = StyleInput( ControllerToPlayerNumber(GameI.controller), m_iInputColumn[GameI.controller][GameI.button] ); + SI = StyleInput( m_iInputColumn[GameI.controller][GameI.button] ); return SI; } diff --git a/stepmania/src/StyleInput.h b/stepmania/src/StyleInput.h index 2eb95fa1f5..2ca632258e 100644 --- a/stepmania/src/StyleInput.h +++ b/stepmania/src/StyleInput.h @@ -1,22 +1,18 @@ -/* StyleInput - An input event specific to a style that is defined by a player number and the player's note column. */ +/* StyleInput - An input event specific to a style that is defined by the note column. */ #ifndef STYLE_INPUT_H #define STYLE_INPUT_H -#include "PlayerNumber.h" - - struct StyleInput { - PlayerNumber player; int col; StyleInput() { MakeInvalid(); }; - StyleInput( PlayerNumber pn, int c ) { player = pn; col = c; }; - bool operator==( const StyleInput &other ) { return player == other.player && col == other.col; }; + StyleInput( int c ) { col = c; } + bool operator==( const StyleInput &other ) { return col == other.col; } - inline bool IsValid() const { return player != PLAYER_INVALID; }; - inline void MakeInvalid() { player = PLAYER_INVALID; col = -1; }; + bool IsValid() const { return col != -1; } + void MakeInvalid() { col = -1; } }; #endif