StyleI.player duplicates MenuI.player when the style is set. It's

essentially being used as a hack to see if the style is set, and
as a shortcut for converting from StyleInput back to GameInput,
complicating InputEventPlus in the process.  Remove it, and just
pass along the PlayerNumber when it's actually needed.

(incremental commit)
This commit is contained in:
Glenn Maynard
2006-09-13 00:02:23 +00:00
parent c419567b23
commit 87bb92451b
4 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -831,7 +831,7 @@ bool InputMapper::IsBeingPressed( const MenuInput &MenuI )
return false;
}
bool InputMapper::IsBeingPressed( const StyleInput &StyleI, MultiPlayer mp )
bool InputMapper::IsBeingPressed( const StyleInput &StyleI, PlayerNumber pn, MultiPlayer mp )
{
GameInput GameI;
StyleToGame( StyleI, GameI );
@@ -870,7 +870,7 @@ float InputMapper::GetSecsHeld( const MenuInput &MenuI )
return fMaxSecsHeld;
}
float InputMapper::GetSecsHeld( const StyleInput &StyleI, MultiPlayer mp )
float InputMapper::GetSecsHeld( const StyleInput &StyleI, PlayerNumber pn, MultiPlayer mp )
{
GameInput GameI;
StyleToGame( StyleI, GameI );
+2 -2
View File
@@ -46,11 +46,11 @@ public:
float GetSecsHeld( const GameInput &GameI, MultiPlayer mp = MultiPlayer_INVALID );
float GetSecsHeld( const MenuInput &MenuI );
float GetSecsHeld( const StyleInput &StyleI, MultiPlayer mp = MultiPlayer_INVALID );
float GetSecsHeld( const StyleInput &StyleI, PlayerNumber pn, MultiPlayer mp = MultiPlayer_INVALID );
bool IsBeingPressed( const GameInput &GameI, MultiPlayer mp = MultiPlayer_INVALID, const DeviceInputList *pButtonState = NULL );
bool IsBeingPressed( const MenuInput &MenuI );
bool IsBeingPressed( const StyleInput &StyleI, MultiPlayer mp = MultiPlayer_INVALID );
bool IsBeingPressed( const StyleInput &StyleI, PlayerNumber pn, MultiPlayer mp = MultiPlayer_INVALID );
void ResetKeyRepeat( const GameInput &GameI );
void ResetKeyRepeat( const MenuInput &MenuI );
+4 -4
View File
@@ -544,7 +544,7 @@ void Player::Update( float fDeltaTime )
PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
const StyleInput StyleI( pn, col );
bool bIsHoldingButton = INPUTMAPPER->IsBeingPressed( StyleI );
bool bIsHoldingButton = INPUTMAPPER->IsBeingPressed( StyleI, pn );
// TODO: Make this work for non-human-controlled players
if( bIsHoldingButton && !GAMESTATE->m_bDemonstrationOrJukebox && m_pPlayerState->m_PlayerController==PC_HUMAN )
if( m_pNoteField )
@@ -622,7 +622,7 @@ void Player::Update( float fDeltaTime )
else
{
const StyleInput StyleI( pn, iTrack );
bIsHoldingButton = INPUTMAPPER->IsBeingPressed( StyleI, m_pPlayerState->m_mp );
bIsHoldingButton = INPUTMAPPER->IsBeingPressed( StyleI, pn, m_pPlayerState->m_mp );
}
int iEndRow = iRow + tn.iDuration;
@@ -1492,13 +1492,13 @@ void Player::CrossedMineRow( int iNoteRow, const RageTimer &now )
const StyleInput StyleI( pn, t );
if( PREFSMAN->m_fPadStickSeconds > 0 )
{
float fSecsHeld = INPUTMAPPER->GetSecsHeld( StyleI, m_pPlayerState->m_mp );
float fSecsHeld = INPUTMAPPER->GetSecsHeld( StyleI, 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, m_pPlayerState->m_mp );
bool bIsDown = INPUTMAPPER->IsBeingPressed( StyleI, pn, m_pPlayerState->m_mp );
if( bIsDown )
Step( t, iNoteRow, now, true, false );
}
+2 -2
View File
@@ -887,7 +887,7 @@ void ScreenEdit::Update( float fDeltaTime )
for( int t=0; t<GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer; t++ ) // for each track
{
StyleInput StyleI( PLAYER_1, t );
float fSecsHeld = INPUTMAPPER->GetSecsHeld( StyleI );
float fSecsHeld = INPUTMAPPER->GetSecsHeld( StyleI, PLAYER_1 );
fSecsHeld = min( fSecsHeld, m_RemoveNoteButtonLastChanged.Ago() );
if( fSecsHeld == 0 )
continue;
@@ -935,7 +935,7 @@ void ScreenEdit::Update( float fDeltaTime )
for( int t=0; t<GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer; t++ ) // for each track
{
StyleInput StyleI( PLAYER_1, t );
if( INPUTMAPPER->IsBeingPressed(StyleI) )
if( INPUTMAPPER->IsBeingPressed(StyleI, PLAYER_1) )
bButtonIsBeingPressed = true;
}