Avoid division by zero.

This shouldn't matter; div/0 is not a fatal error by default.  Some people
are getting exceptions for it, though; I have no idea why.
This commit is contained in:
Glenn Maynard
2003-07-09 02:12:14 +00:00
parent f9ff8d49fb
commit e70158e4bc
+5 -1
View File
@@ -164,7 +164,11 @@ void DancingCharacters::DrawPrimitives()
{
DISPLAY->EnterPerspective( 45, false );
float fPercentIntoSweep = SCALE(GAMESTATE->m_fSongBeat, m_fThisCameraStartBeat, m_fThisCameraEndBeat, 0.f, 1.f );
float fPercentIntoSweep;
if(m_fThisCameraStartBeat == m_fThisCameraEndBeat)
fPercentIntoSweep = 0;
else
fPercentIntoSweep = SCALE(GAMESTATE->m_fSongBeat, m_fThisCameraStartBeat, m_fThisCameraEndBeat, 0.f, 1.f );
float fCameraPanY = SCALE( fPercentIntoSweep, 0.f, 1.f, m_CameraPanYStart, m_CameraPanYEnd );
float fCameraHeight = SCALE( fPercentIntoSweep, 0.f, 1.f, m_fCameraHeightStart, m_fCameraHeightEnd );