add checkpoints to catch input assert

This commit is contained in:
Chris Danford
2005-10-15 16:52:01 +00:00
parent ae7300b3be
commit 349c19cb09
3 changed files with 5 additions and 2 deletions
+2
View File
@@ -611,6 +611,7 @@ void InputMapper::GameToMenu( const GameInput &GameI, MenuInput &MenuI )
void InputMapper::StyleToGame( const StyleInput &StyleI, GameInput &GameI )
{
CHECKPOINT_M( ssprintf("%i %i", StyleI.player, StyleI.col) );
const Style* pStyle = GAMESTATE->GetCurrentStyle();
GameI = pStyle->StyleInputToGameInput( StyleI );
}
@@ -650,6 +651,7 @@ bool InputMapper::IsButtonDown( const MenuInput &MenuI )
bool InputMapper::IsButtonDown( const StyleInput &StyleI )
{
CHECKPOINT_M( ssprintf("%i %i", StyleI.player, StyleI.col) );
GameInput GameI;
StyleToGame( StyleI, GameI );
return IsButtonDown( GameI );
+1
View File
@@ -529,6 +529,7 @@ void Player::Update( float fDeltaTime )
CHECKPOINT_M( ssprintf("P%i, %i %i", pn, col, iNumCols) );
const StyleInput StyleI( pn, col );
CHECKPOINT_M( ssprintf("P%i %i", StyleI.player, StyleI.col) );
bool bIsHoldingButton = INPUTMAPPER->IsButtonDown( StyleI );
// TODO: Make this work for non-human-controlled players
if( bIsHoldingButton && !GAMESTATE->m_bDemonstrationOrJukebox && m_pPlayerState->m_PlayerController==PC_HUMAN )
+2 -2
View File
@@ -40,8 +40,8 @@ void Style::GetTransformedNoteDataForStyle( PlayerNumber pn, const NoteData& ori
GameInput Style::StyleInputToGameInput( const StyleInput& StyleI ) const
{
ASSERT_M( StyleI.player < NUM_PLAYERS, ssprintf("P%i", StyleI.player) );
ASSERT_M( StyleI.col < MAX_COLS_PER_PLAYER, ssprintf("C%i", StyleI.col) );
ASSERT_M( StyleI.player < NUM_PLAYERS && StyleI.col < MAX_COLS_PER_PLAYER,
ssprintf("P%i C%i", StyleI.player, StyleI.col) );
FOREACH_GameController(gc)
{