fixed crash when saving Course records

fixed incorrect handing of "accelerate" token in Actor::Fade
This commit is contained in:
Chris Danford
2003-02-24 00:47:13 +00:00
parent aac5e21f9b
commit bed2c0a74b
3 changed files with 12 additions and 12 deletions
+5 -5
View File
@@ -514,7 +514,7 @@ void GetFadeFlagsFromString( CString sFadeString,
void Actor::Fade( float fSleepSeconds, CString sFadeString, float fFadeSeconds, bool bOnToScreenOrOffOfScreen )
void Actor::Fade( float fSleepSeconds, CString sFadeString, float fFadeSeconds, bool bFadingOff )
{
sFadeString.MakeLower();
@@ -528,8 +528,8 @@ void Actor::Fade( float fSleepSeconds, CString sFadeString, float fFadeSeconds,
TweenType tt;
if( CONTAINS("linear") ) tt = TWEEN_LINEAR;
else if( CONTAINS("accelerate") ) tt = bOnToScreenOrOffOfScreen ? TWEEN_BIAS_END : TWEEN_BIAS_BEGIN;
else if( CONTAINS("bounce") ) tt = bOnToScreenOrOffOfScreen ? TWEEN_BOUNCE_END : TWEEN_BOUNCE_BEGIN;
else if( CONTAINS("accelerate") ) tt = bFadingOff ? TWEEN_BIAS_END : TWEEN_BIAS_BEGIN;
else if( CONTAINS("bounce") ) tt = bFadingOff ? TWEEN_BOUNCE_BEGIN : TWEEN_BOUNCE_END;
else if( CONTAINS("spring") ) tt = TWEEN_SPRING;
else tt = TWEEN_LINEAR;
@@ -561,10 +561,10 @@ void Actor::Fade( float fSleepSeconds, CString sFadeString, float fFadeSeconds,
StopTweening();
m_current = bOnToScreenOrOffOfScreen ? original : mod;
m_current = bFadingOff ? original : mod;
BeginTweening( fSleepSeconds );
BeginTweening( fFadeSeconds, tt );
LatestTween() = bOnToScreenOrOffOfScreen ? mod : original;
LatestTween() = bFadingOff ? mod : original;
}
float Actor::TweenTime() const
+1 -1
View File
@@ -190,7 +190,7 @@ public:
//
// fade command
//
void Fade( float fSleepSeconds, CString sFadeString, float fFadeSeconds, bool bOnToScreenOrOffOfScreen );
void Fade( float fSleepSeconds, CString sFadeString, float fFadeSeconds, bool bFadingOff );
void FadeOn( float fSleepSeconds, CString sFadeString, float fFadeSeconds ) { Fade(fSleepSeconds,sFadeString,fFadeSeconds,false); };
void FadeOff( float fSleepSeconds, CString sFadeString, float fFadeSeconds ) { Fade(fSleepSeconds,sFadeString,fFadeSeconds,true); };
+6 -6
View File
@@ -495,9 +495,9 @@ void SongManager::SaveMachineScoresToDisk()
{
fprintf(fp,"%d\n",COURSE_SCORES_VERSION);
for( unsigned c=0; c<m_pCourses.size(); c++ ) // foreach song
for( unsigned i=0; i<m_pCourses.size(); i++ ) // foreach song
{
Course* pCourse = m_pCourses[c];
Course* pCourse = m_pCourses[i];
ASSERT(pCourse);
if( pCourse->m_bIsAutoGen )
@@ -505,11 +505,11 @@ void SongManager::SaveMachineScoresToDisk()
else
fprintf(fp, "%s\n", pCourse->m_sPath.c_str());
for( int i=0; i<NUM_NOTES_TYPES; i++ )
for( int nt=0; nt<NUM_NOTES_TYPES; nt++ )
fprintf(fp, "%d %d %f\n",
pCourse->m_MemCardScores[c][i].iNumTimesPlayed,
pCourse->m_MemCardScores[c][i].iDancePoints,
pCourse->m_MemCardScores[c][i].fSurviveTime);
pCourse->m_MemCardScores[c][nt].iNumTimesPlayed,
pCourse->m_MemCardScores[c][nt].iDancePoints,
pCourse->m_MemCardScores[c][nt].fSurviveTime);
}
fclose(fp);