From 41cc3e60cdb6af9b98c5803e8784698b15058883 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Mon, 14 Apr 2003 07:11:04 +0000 Subject: [PATCH] fade between random movies --- stepmania/Courses/Samples/PlayersBest1-4.crs | 8 ++--- .../Courses/Samples/PlayersBest13-16.crs | 8 ++--- stepmania/Courses/Samples/PlayersBest5-8.crs | 8 ++--- stepmania/Courses/Samples/PlayersBest9-12.crs | 8 ++--- stepmania/Courses/Samples/PlayersWorst.crs | 8 ++--- stepmania/src/Background.cpp | 4 ++- stepmania/src/Course.cpp | 32 +++++++++---------- stepmania/src/Course.h | 4 +-- 8 files changed, 41 insertions(+), 39 deletions(-) diff --git a/stepmania/Courses/Samples/PlayersBest1-4.crs b/stepmania/Courses/Samples/PlayersBest1-4.crs index d850dcb8c5..ad4cc9559f 100644 --- a/stepmania/Courses/Samples/PlayersBest1-4.crs +++ b/stepmania/Courses/Samples/PlayersBest1-4.crs @@ -1,6 +1,6 @@ #COURSE:Players Best 1-4; -#SONG:PlayersBest1:TRICK; -#SONG:PlayersBest2:TRICK; -#SONG:PlayersBest3:TRICK; -#SONG:PlayersBest4:TRICK; +#SONG:BEST1:TRICK; +#SONG:BEST2:TRICK; +#SONG:BEST3:TRICK; +#SONG:BEST4:TRICK; diff --git a/stepmania/Courses/Samples/PlayersBest13-16.crs b/stepmania/Courses/Samples/PlayersBest13-16.crs index 3d285cc817..6e44697ecd 100644 --- a/stepmania/Courses/Samples/PlayersBest13-16.crs +++ b/stepmania/Courses/Samples/PlayersBest13-16.crs @@ -1,5 +1,5 @@ #COURSE:Players Best 13-16; -#SONG:PlayersBest13:TRICK; -#SONG:PlayersBest14:TRICK; -#SONG:PlayersBest15:TRICK; -#SONG:PlayersBest16:TRICK; +#SONG:BEST13:TRICK; +#SONG:BEST14:TRICK; +#SONG:BEST15:TRICK; +#SONG:BEST16:TRICK; diff --git a/stepmania/Courses/Samples/PlayersBest5-8.crs b/stepmania/Courses/Samples/PlayersBest5-8.crs index 7d6301ca79..1f3a52903c 100644 --- a/stepmania/Courses/Samples/PlayersBest5-8.crs +++ b/stepmania/Courses/Samples/PlayersBest5-8.crs @@ -1,5 +1,5 @@ #COURSE:Players Best 5-8; -#SONG:PlayersBest5:TRICK; -#SONG:PlayersBest6:TRICK; -#SONG:PlayersBest7:TRICK; -#SONG:PlayersBest8:TRICK; +#SONG:BEST5:TRICK; +#SONG:BEST6:TRICK; +#SONG:BEST7:TRICK; +#SONG:BEST8:TRICK; diff --git a/stepmania/Courses/Samples/PlayersBest9-12.crs b/stepmania/Courses/Samples/PlayersBest9-12.crs index c1f96ffca9..2bcc274976 100644 --- a/stepmania/Courses/Samples/PlayersBest9-12.crs +++ b/stepmania/Courses/Samples/PlayersBest9-12.crs @@ -1,5 +1,5 @@ #COURSE:Players Best 9-12; -#SONG:PlayersBest9:TRICK; -#SONG:PlayersBest10:TRICK; -#SONG:PlayersBest11:TRICK; -#SONG:PlayersBest12:TRICK; +#SONG:BEST9:TRICK; +#SONG:BEST10:TRICK; +#SONG:BEST11:TRICK; +#SONG:BEST12:TRICK; diff --git a/stepmania/Courses/Samples/PlayersWorst.crs b/stepmania/Courses/Samples/PlayersWorst.crs index 39094a57c8..b0804bcb04 100644 --- a/stepmania/Courses/Samples/PlayersWorst.crs +++ b/stepmania/Courses/Samples/PlayersWorst.crs @@ -1,5 +1,5 @@ #COURSE:Players Worst; -#SONG:PlayersWorst1:TRICK; -#SONG:PlayersWorst2:TRICK; -#SONG:PlayersWorst3:TRICK; -#SONG:PlayersWorst4:TRICK; +#SONG:WORST1:TRICK; +#SONG:WORST2:TRICK; +#SONG:WORST3:TRICK; +#SONG:WORST4:TRICK; diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index 260f5d5d10..6551b2db3d 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -292,7 +292,9 @@ void Background::LoadFromSong( Song* pSong ) if( bLoadedAnyRandomBackgrounds ) { CString sBGName = RANDOM_BACKGROUND[ rand()%MAX_RANDOM_BACKGROUNDS ]; - m_aBGChanges.push_back( BackgroundChange(f,sBGName) ); + bool bFade = PREFSMAN->m_BackgroundMode==PrefsManager::BGMODE_RANDOMMOVIES || + PREFSMAN->m_BackgroundMode==PrefsManager::BGMODE_MOVIEVIS; + m_aBGChanges.push_back( BackgroundChange(f,sBGName,1.f,bFade) ); } } diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index 902af73488..e47704f0b6 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -150,16 +150,16 @@ void Course::LoadFromCRSFile( CString sPath ) Entry new_entry; // infer entry::Type from the first param - if( sParams[1].Left(strlen("PlayersBest")) == "PlayersBest" ) + if( sParams[1].Left(strlen("BEST")) == "BEST" ) { - new_entry.type = Entry::players_best; - new_entry.players_index = atoi( sParams[1].Right(sParams[1].size()-strlen("PlayersBest")) ) - 1; + new_entry.type = Entry::best; + new_entry.players_index = atoi( sParams[1].Right(sParams[1].size()-strlen("BEST")) ) - 1; CLAMP( new_entry.players_index, 0, 500 ); } - else if( sParams[1].Left(strlen("PlayersWorst")) == "PlayersWorst" ) + else if( sParams[1].Left(strlen("WORST")) == "WORST" ) { - new_entry.type = Entry::players_worst; - new_entry.players_index = atoi( sParams[1].Right(sParams[1].size()-strlen("PlayersWorst")) ) - 1; + new_entry.type = Entry::worst; + new_entry.players_index = atoi( sParams[1].Right(sParams[1].size()-strlen("WORST")) ) - 1; CLAMP( new_entry.players_index, 0, 500 ); } else if( sParams[1] == "*" ) @@ -273,11 +273,11 @@ void Course::Save() case Entry::random_within_group: fprintf( fp, "#SONG:%s/*", entry.group_name.GetString() ); break; - case Entry::players_best: - fprintf( fp, "#SONG:PlayersBest%d", entry.players_index+1 ); + case Entry::best: + fprintf( fp, "#SONG:BEST%d", entry.players_index+1 ); break; - case Entry::players_worst: - fprintf( fp, "#SONG:PlayersWorst%d", entry.players_index+1 ); + case Entry::worst: + fprintf( fp, "#SONG:WORST%d", entry.players_index+1 ); break; default: ASSERT(0); @@ -433,8 +433,8 @@ void Course::GetStageInfo( } } break; - case Entry::players_best: - case Entry::players_worst: + case Entry::best: + case Entry::worst: { if(vSongsByMostPlayed.size() == 0) { @@ -461,10 +461,10 @@ void Course::GetStageInfo( switch( e.type ) { - case Entry::players_best: + case Entry::best: pSong = vSongsByMostPlayed[e.players_index]; break; - case Entry::players_worst: + case Entry::worst: pSong = vSongsByMostPlayed[vSongsByMostPlayed.size()-1-e.players_index]; break; default: @@ -552,8 +552,8 @@ bool Course::IsMysterySong( int stage ) const case Entry::fixed: return false; case Entry::random: return true; case Entry::random_within_group: return true; - case Entry::players_best: return false; - case Entry::players_worst: return false; + case Entry::best: return false; + case Entry::worst: return false; default: ASSERT(0); return true; } } diff --git a/stepmania/src/Course.h b/stepmania/src/Course.h index ee94d6524d..cb45e1138b 100644 --- a/stepmania/src/Course.h +++ b/stepmania/src/Course.h @@ -22,13 +22,13 @@ class Notes; class Course { struct Entry { - enum Type { fixed, random, random_within_group, players_best, players_worst } type; + enum Type { fixed, random, random_within_group, best, worst } type; Song* pSong; // used in type=fixed CString group_name; // used in type=random_within_group Difficulty difficulty; // = DIFFICULTY_INVALID if no difficulty specified int low_meter; // = -1 if no meter range specified int high_meter; // = -1 if no meter range specified - int players_index; // ignored if type isn't a players_* + int players_index; // ignored if type isn't 'best' or 'worst' CString modifiers; // set player and song options using these Entry()