replace ASSERT(0) with useful fail messages

This commit is contained in:
Devin J. Pohly
2012-12-27 16:59:35 -05:00
parent 376056a0cf
commit bd0e2074ad
71 changed files with 289 additions and 245 deletions
+5 -6
View File
@@ -107,7 +107,8 @@ void TimingWindowSecondsInit( size_t /*TimingWindow*/ i, RString &sNameOut, floa
sNameOut = "TimingWindowSeconds" + TimingWindowToString( (TimingWindow)i );
switch( i )
{
default: ASSERT(0);
default:
FAIL_M(ssprintf("Invalid timing window: %i", i));
case TW_W1: defaultValueOut = 0.0225f; break;
case TW_W2: defaultValueOut = 0.045f; break;
case TW_W3: defaultValueOut = 0.090f; break;
@@ -691,7 +692,7 @@ void Player::Load()
NoteDataUtil::Turn( m_NoteData, st, NoteDataUtil::right);
break;
default:
ASSERT(0);
FAIL_M(ssprintf("Count %i not in range 0-3", count));
}
count++;
count %= 4;
@@ -1309,7 +1310,7 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vector<TrackRowTap
break;
*/
default:
ASSERT(0);
FAIL_M(ssprintf("Invalid tap note subtype: %i", subType));
}
}
@@ -2381,9 +2382,7 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b
break;
*/
default:
ASSERT(0);
score = TNS_None;
break;
FAIL_M(ssprintf("Invalid player controller type: %i", m_pPlayerState->m_PlayerController));
}
switch( pbt )