From a6a827b3a83ac078595495a2f0f186955a7a38b6 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 13 Apr 2003 23:22:27 +0000 Subject: [PATCH] Fix ScreenGameply + course problems Put Toasty underneath Players so it doesn't cover up arrows Add support for BackgroundChange to a static graphic in the song dir --- stepmania/src/Background.cpp | 11 +++++++++-- stepmania/src/ScreenEdit.cpp | 9 +++++++++ stepmania/src/ScreenEdit.h | 1 + stepmania/src/ScreenGameplay.cpp | 15 ++++++++++----- 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index 4f4f715161..dc76e90099 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -113,12 +113,19 @@ BGAnimation *Background::CreateSongBGA(const Song *pSong, CString sBGName) const pTempBGA->LoadFromAniDir( asFiles[0] ); return pTempBGA; } - // Look for BG movies in the song dir + // Look for BG movies or static graphics in the song dir GetDirListing( pSong->GetSongDir()+sBGName, asFiles, false, true ); if( !asFiles.empty() ) { pTempBGA = new BGAnimation; - pTempBGA->LoadFromMovie( asFiles[0], true, true ); + CString sThrowAway, sExt; + splitrelpath( asFiles[0], sThrowAway, sThrowAway, sExt ); + if( sExt.CompareNoCase("avi")==0 || + sExt.CompareNoCase("mpg")==0 || + sExt.CompareNoCase("mpeg")==0 ) + pTempBGA->LoadFromMovie( asFiles[0], true, true ); + else + pTempBGA->LoadFromStaticGraphic( asFiles[0] ); return pTempBGA; } // Look for movies in the RandomMovies dir diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index 428e440674..3beed4af93 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -197,6 +197,7 @@ Menu g_BGChange MenuRow( "Add Change to random", true ), MenuRow( "Add Change to song BGAnimation", true ), MenuRow( "Add Change to song Movie", true ), + MenuRow( "Add Change to song Still", true ), MenuRow( "Add Change to global Random Movie", true ), MenuRow( "Add Change to global BGAnimation", true ), MenuRow( "Add Change to global Visualization", true ), @@ -1252,6 +1253,12 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, int* iAnswers ) GetDirListing( m_pSong->GetSongDir()+"*.mpg", g_BGChange.rows[add_song_movie].choices, false ); GetDirListing( m_pSong->GetSongDir()+"*.mpeg", g_BGChange.rows[add_song_movie].choices, false ); + g_BGChange.rows[add_song_still].choices.clear(); + GetDirListing( m_pSong->GetSongDir()+"*.png", g_BGChange.rows[add_song_still].choices, false ); + GetDirListing( m_pSong->GetSongDir()+"*.jpg", g_BGChange.rows[add_song_still].choices, false ); + GetDirListing( m_pSong->GetSongDir()+"*.gif", g_BGChange.rows[add_song_still].choices, false ); + GetDirListing( m_pSong->GetSongDir()+"*.bmp", g_BGChange.rows[add_song_still].choices, false ); + g_BGChange.rows[add_global_random_movie].choices.clear(); GetDirListing( RANDOMMOVIES_DIR+"*.avi", g_BGChange.rows[add_global_random_movie].choices, false ); GetDirListing( RANDOMMOVIES_DIR+"*.mpg", g_BGChange.rows[add_global_random_movie].choices, false ); @@ -1277,6 +1284,7 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, int* iAnswers ) g_BGChange.rows[add_random].enabled = true; g_BGChange.rows[add_song_bganimation].enabled = g_BGChange.rows[add_song_bganimation].choices.size() > 0; g_BGChange.rows[add_song_movie].enabled = g_BGChange.rows[add_song_movie].choices.size() > 0; + g_BGChange.rows[add_song_still].enabled = g_BGChange.rows[add_song_still].choices.size() > 0; g_BGChange.rows[add_global_random_movie].enabled = g_BGChange.rows[add_global_random_movie].choices.size() > 0; g_BGChange.rows[add_global_bganimation].enabled = g_BGChange.rows[add_global_bganimation].choices.size() > 0; g_BGChange.rows[add_global_visualization].enabled = g_BGChange.rows[add_global_visualization].choices.size() > 0; @@ -1543,6 +1551,7 @@ void ScreenEdit::HandleBGChangeChoice( BGChangeChoice c, int* iAnswers ) break; case add_song_bganimation: case add_song_movie: + case add_song_still: case add_global_random_movie: case add_global_bganimation: case add_global_visualization: diff --git a/stepmania/src/ScreenEdit.h b/stepmania/src/ScreenEdit.h index c999ea67cc..07f1e36dc0 100644 --- a/stepmania/src/ScreenEdit.h +++ b/stepmania/src/ScreenEdit.h @@ -170,6 +170,7 @@ public: add_random, add_song_bganimation, add_song_movie, + add_song_still, add_global_random_movie, add_global_bganimation, add_global_visualization, diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index a18093d12b..1b9893560e 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -217,6 +217,12 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) : Screen("ScreenGameplay") m_Background.SetDiffuse( RageColor(0.4f,0.4f,0.4f,1) ); this->AddChild( &m_Background ); + if( !bDemonstration ) // only load if we're going to use it + { + m_Toasty.Load( THEME->GetPathToB("ScreenGameplay toasty") ); + this->AddChild( &m_Toasty ); + } + for( p=0; pIsPlayerEnabled(PlayerNumber(p)) ) @@ -293,6 +299,10 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) : Screen("ScreenGameplay") } + m_sprStage.SetName( ssprintf("Stage%s",bExtra?"Extra":"") ); + SET_XY( m_sprStage ); + + for( p=0; pGetPathToN("ScreenGameplay song num") ); @@ -309,8 +319,6 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) : Screen("ScreenGameplay") case PLAY_MODE_BATTLE: case PLAY_MODE_RAVE: m_sprStage.Load( THEME->GetPathToG("ScreenGameplay stage "+GAMESTATE->GetStageText()) ); - m_sprStage.SetName( ssprintf("Stage%s",bExtra?"Extra":"") ); - SET_XY( m_sprStage ); this->AddChild( &m_sprStage ); break; case PLAY_MODE_NONSTOP: @@ -462,9 +470,6 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) : Screen("ScreenGameplay") m_Extra.Load( THEME->GetPathToB("ScreenGameplay extra2") ); this->AddChild( &m_Extra ); - m_Toasty.Load( THEME->GetPathToB("ScreenGameplay toasty") ); - this->AddChild( &m_Toasty ); - m_In.Load( THEME->GetPathToB("ScreenGameplay in") ); this->AddChild( &m_In );