phase out StyleI.player
This commit is contained in:
@@ -96,8 +96,7 @@ RString Game::ColToButtonName( int col ) const
|
|||||||
if( pzColumnName != NULL )
|
if( pzColumnName != NULL )
|
||||||
return pzColumnName;
|
return pzColumnName;
|
||||||
|
|
||||||
StyleInput SI( PLAYER_1, col );
|
GameInput GI = pStyle->StyleInputToGameInput( col, PLAYER_1 );
|
||||||
GameInput GI = pStyle->StyleInputToGameInput( SI, PLAYER_1 );
|
|
||||||
|
|
||||||
return m_szButtonNames[GI.button];
|
return m_szButtonNames[GI.button];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,8 +65,7 @@ static void GetUsedGameInputs( vector<GameInput> &vGameInputsOut )
|
|||||||
{
|
{
|
||||||
for( int i=0; i<(*style)->m_iColsPerPlayer; i++ )
|
for( int i=0; i<(*style)->m_iColsPerPlayer; i++ )
|
||||||
{
|
{
|
||||||
StyleInput si( pn, i );
|
GameInput gi = (*style)->StyleInputToGameInput( i, pn );
|
||||||
GameInput gi = (*style)->StyleInputToGameInput( si, pn );
|
|
||||||
if( gi.IsValid() )
|
if( gi.IsValid() )
|
||||||
{
|
{
|
||||||
vGIs.insert( gi );
|
vGIs.insert( gi );
|
||||||
|
|||||||
@@ -543,8 +543,7 @@ void Player::Update( float fDeltaTime )
|
|||||||
// TODO: Remove use of PlayerNumber.
|
// TODO: Remove use of PlayerNumber.
|
||||||
PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
|
PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
|
||||||
|
|
||||||
const StyleInput StyleI( pn, col );
|
bool bIsHoldingButton = INPUTMAPPER->IsBeingPressed( col, pn );
|
||||||
bool bIsHoldingButton = INPUTMAPPER->IsBeingPressed( StyleI, pn );
|
|
||||||
// TODO: Make this work for non-human-controlled players
|
// TODO: Make this work for non-human-controlled players
|
||||||
if( bIsHoldingButton && !GAMESTATE->m_bDemonstrationOrJukebox && m_pPlayerState->m_PlayerController==PC_HUMAN )
|
if( bIsHoldingButton && !GAMESTATE->m_bDemonstrationOrJukebox && m_pPlayerState->m_PlayerController==PC_HUMAN )
|
||||||
if( m_pNoteField )
|
if( m_pNoteField )
|
||||||
@@ -621,8 +620,7 @@ void Player::Update( float fDeltaTime )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const StyleInput StyleI( pn, iTrack );
|
bIsHoldingButton = INPUTMAPPER->IsBeingPressed( iTrack, pn, m_pPlayerState->m_mp );
|
||||||
bIsHoldingButton = INPUTMAPPER->IsBeingPressed( StyleI, pn, m_pPlayerState->m_mp );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int iEndRow = iRow + tn.iDuration;
|
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;
|
int iNumTracksHeld = 0;
|
||||||
for( int t=0; t<m_NoteData.GetNumTracks(); t++ )
|
for( int t=0; t<m_NoteData.GetNumTracks(); t++ )
|
||||||
{
|
{
|
||||||
const StyleInput StyleI( pn, t );
|
const GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( t, pn );
|
||||||
const GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( StyleI );
|
|
||||||
const float fSecsHeld = INPUTMAPPER->GetSecsHeld( GameI );
|
const float fSecsHeld = INPUTMAPPER->GetSecsHeld( GameI );
|
||||||
if( fSecsHeld > 0 && fSecsHeld < JUMP_WINDOW_SECONDS )
|
if( fSecsHeld > 0 && fSecsHeld < JUMP_WINDOW_SECONDS )
|
||||||
iNumTracksHeld++;
|
iNumTracksHeld++;
|
||||||
@@ -1489,16 +1486,15 @@ void Player::CrossedMineRow( int iNoteRow, const RageTimer &now )
|
|||||||
// TODO: Remove use of PlayerNumber.
|
// TODO: Remove use of PlayerNumber.
|
||||||
PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
|
PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
|
||||||
|
|
||||||
const StyleInput StyleI( pn, t );
|
|
||||||
if( PREFSMAN->m_fPadStickSeconds > 0 )
|
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 )
|
if( fSecsHeld >= PREFSMAN->m_fPadStickSeconds )
|
||||||
Step( t, -1, now+(-PREFSMAN->m_fPadStickSeconds), true, false );
|
Step( t, -1, now+(-PREFSMAN->m_fPadStickSeconds), true, false );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bool bIsDown = INPUTMAPPER->IsBeingPressed( StyleI, pn, m_pPlayerState->m_mp );
|
bool bIsDown = INPUTMAPPER->IsBeingPressed( t, pn, m_pPlayerState->m_mp );
|
||||||
if( bIsDown )
|
if( bIsDown )
|
||||||
Step( t, iNoteRow, now, true, false );
|
Step( t, iNoteRow, now, true, false );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -886,8 +886,7 @@ void ScreenEdit::Update( float fDeltaTime )
|
|||||||
{
|
{
|
||||||
for( int t=0; t<GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer; t++ ) // for each track
|
for( int t=0; t<GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer; t++ ) // for each track
|
||||||
{
|
{
|
||||||
StyleInput StyleI( PLAYER_1, t );
|
float fSecsHeld = INPUTMAPPER->GetSecsHeld( t, PLAYER_1 );
|
||||||
float fSecsHeld = INPUTMAPPER->GetSecsHeld( StyleI, PLAYER_1 );
|
|
||||||
fSecsHeld = min( fSecsHeld, m_RemoveNoteButtonLastChanged.Ago() );
|
fSecsHeld = min( fSecsHeld, m_RemoveNoteButtonLastChanged.Ago() );
|
||||||
if( fSecsHeld == 0 )
|
if( fSecsHeld == 0 )
|
||||||
continue;
|
continue;
|
||||||
@@ -934,8 +933,7 @@ void ScreenEdit::Update( float fDeltaTime )
|
|||||||
bool bButtonIsBeingPressed = false;
|
bool bButtonIsBeingPressed = false;
|
||||||
for( int t=0; t<GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer; t++ ) // for each track
|
for( int t=0; t<GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer; t++ ) // for each track
|
||||||
{
|
{
|
||||||
StyleInput StyleI( PLAYER_1, t );
|
if( INPUTMAPPER->IsBeingPressed(t, PLAYER_1) )
|
||||||
if( INPUTMAPPER->IsBeingPressed(StyleI, PLAYER_1) )
|
|
||||||
bButtonIsBeingPressed = true;
|
bButtonIsBeingPressed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1895,8 +1895,7 @@ void ScreenGameplay::UpdateLights()
|
|||||||
|
|
||||||
if( bBlink )
|
if( bBlink )
|
||||||
{
|
{
|
||||||
StyleInput si( pi->m_pn, t );
|
GameInput gi = pStyle->StyleInputToGameInput( t, pi->m_pn );
|
||||||
GameInput gi = pStyle->StyleInputToGameInput( si, pi->m_pn );
|
|
||||||
bBlinkGameButton[gi.controller][gi.button] = true;
|
bBlinkGameButton[gi.controller][gi.button] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -194,8 +194,7 @@ void ScreenNameEntry::Init()
|
|||||||
continue; /* We have enough columns. */
|
continue; /* We have enough columns. */
|
||||||
|
|
||||||
/* Find out if this column is associated with the START menu button. */
|
/* Find out if this column is associated with the START menu button. */
|
||||||
StyleInput si(p, t);
|
GameInput gi=GAMESTATE->GetCurrentStyle()->StyleInputToGameInput(t, p);
|
||||||
GameInput gi=GAMESTATE->GetCurrentStyle()->StyleInputToGameInput(si, p);
|
|
||||||
MenuInput m=GAMESTATE->GetCurrentGame()->GameInputToMenuInput(gi);
|
MenuInput m=GAMESTATE->GetCurrentGame()->GameInputToMenuInput(gi);
|
||||||
if(m.button == MENU_BUTTON_START)
|
if(m.button == MENU_BUTTON_START)
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ StyleInput Style::GameInputToStyleInput( const GameInput &GameI ) const
|
|||||||
if( m_iInputColumn[GameI.controller][i] == END_MAPPING )
|
if( m_iInputColumn[GameI.controller][i] == END_MAPPING )
|
||||||
return SI; // Return invalid.
|
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;
|
return SI;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
#ifndef STYLE_INPUT_H
|
||||||
#define STYLE_INPUT_H
|
#define STYLE_INPUT_H
|
||||||
|
|
||||||
#include "PlayerNumber.h"
|
|
||||||
|
|
||||||
|
|
||||||
struct StyleInput
|
struct StyleInput
|
||||||
{
|
{
|
||||||
PlayerNumber player;
|
|
||||||
int col;
|
int col;
|
||||||
|
|
||||||
StyleInput() { MakeInvalid(); };
|
StyleInput() { MakeInvalid(); };
|
||||||
StyleInput( PlayerNumber pn, int c ) { player = pn; col = c; };
|
StyleInput( int c ) { col = c; }
|
||||||
bool operator==( const StyleInput &other ) { return player == other.player && col == other.col; };
|
bool operator==( const StyleInput &other ) { return col == other.col; }
|
||||||
|
|
||||||
inline bool IsValid() const { return player != PLAYER_INVALID; };
|
bool IsValid() const { return col != -1; }
|
||||||
inline void MakeInvalid() { player = PLAYER_INVALID; col = -1; };
|
void MakeInvalid() { col = -1; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user