Fix a problem with alternative input that made hold notes 'let go' when held using the alternative button.

This commit is contained in:
Andrew Livy
2009-05-23 18:13:29 +00:00
parent 5f010e3a4b
commit c9c74c7b05
5 changed files with 76 additions and 8 deletions
+63 -1
View File
@@ -733,10 +733,25 @@ void Player::Update( float fDeltaTime )
GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( col, m_pPlayerState->m_PlayerNumber );
bool bIsHoldingButton = INPUTMAPPER->IsBeingPressed( GameI );
if( m_vAlterMap.size() > 0 ) // alternate input is being used
{
for( unsigned int i=0; i < m_vAlterMap.size(); ++i )
{
if( m_vAlterMap[i].inpMain == GameI )
{
bIsHoldingButton = bIsHoldingButton | INPUTMAPPER->IsBeingPressed( m_vAlterMap[i].inpAlt );
}
}
}
// TODO: Make this work for non-human-controlled players
if( bIsHoldingButton && !GAMESTATE->m_bDemonstrationOrJukebox && m_pPlayerState->m_PlayerController==PC_HUMAN )
if( m_pNoteField )
m_pNoteField->SetPressed( col );
}
@@ -959,7 +974,23 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vector<TrackRowTap
else
{
GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( iTrack, pn );
bIsHoldingButton &= INPUTMAPPER->IsBeingPressed( GameI, m_pPlayerState->m_mp );
// this previously read as bIsHoldingButton &=
// was there a specific reason for this? - Friez
bIsHoldingButton = INPUTMAPPER->IsBeingPressed( GameI, m_pPlayerState->m_mp );
if( m_vAlterMap.size() > 0 ) // alternate input is being used
{
for( unsigned int i=0; i < m_vAlterMap.size(); ++i )
{
if( m_vAlterMap[i].inpMain == GameI )
{
bIsHoldingButton = bIsHoldingButton | INPUTMAPPER->IsBeingPressed( m_vAlterMap[i].inpAlt );
}
}
}
}
}
}
@@ -2440,16 +2471,47 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now )
{
PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( iTrack, pn );
if( PREFSMAN->m_fPadStickSeconds > 0.f )
{
float fSecsHeld = INPUTMAPPER->GetSecsHeld( GameI, m_pPlayerState->m_mp );
if( fSecsHeld >= PREFSMAN->m_fPadStickSeconds )
Step( iTrack, -1, now - PREFSMAN->m_fPadStickSeconds, true, false );
if( m_vAlterMap.size() > 0 ) // alternate input is being used
{
for( unsigned int i=0; i < m_vAlterMap.size(); ++i )
{
if( m_vAlterMap[i].inpMain == GameI )
{
GameInput GameIB = m_vAlterMap[i].inpAlt;
float fSecsHeld = INPUTMAPPER->GetSecsHeld( GameIB, m_pPlayerState->m_mp );
if( fSecsHeld >= PREFSMAN->m_fPadStickSeconds )
Step( iTrack, -1, now - PREFSMAN->m_fPadStickSeconds, true, false );
}
}
}
}
else if( INPUTMAPPER->IsBeingPressed(GameI, m_pPlayerState->m_mp) )
{
Step( iTrack, -1, now, true, false );
}
else if( m_vAlterMap.size() > 0 ) // alternate input being used
{
for( unsigned int i=0; i < m_vAlterMap.size(); ++i )
{
if( m_vAlterMap[i].inpMain == GameI )
{
GameInput GameIB = m_vAlterMap[i].inpAlt;
if( INPUTMAPPER->IsBeingPressed(GameIB, m_pPlayerState->m_mp) )
{
Step( iTrack, -1, now, true, false );
}
}
}
}
}
break;
case TapNote::mine: