From c998bb33abdd2c2ddd77b2b0642e01a30fd16cc3 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Wed, 4 Sep 2002 08:09:57 +0000 Subject: [PATCH] added support for danger animation through BGAnimations or Movie --- stepmania/TODO.chris | 17 +++++++---------- stepmania/Themes/default/metrics.ini | 16 ++++++++++++++++ stepmania/src/Background.cpp | 28 ++++++++++++++++------------ stepmania/src/Background.h | 6 ++---- 4 files changed, 41 insertions(+), 26 deletions(-) diff --git a/stepmania/TODO.chris b/stepmania/TODO.chris index 4894d1c6f2..fdfbd17cbc 100644 --- a/stepmania/TODO.chris +++ b/stepmania/TODO.chris @@ -2,6 +2,7 @@ Fix ///////////////////////// + new phpwebhosting account call BrainStorm guy @@ -14,9 +15,9 @@ kitsappt photos 100 flash on OK -slower eval bar +slower eval bar tween -option lines wrap +post graphics jobs needed on web site. max style judge tween @@ -26,10 +27,6 @@ precise timing adjustment draw taps on same row as hold with hold head -arrow under options titles - -wrap option title text - texture cache max style lifemeter animation @@ -40,9 +37,11 @@ TICK_MELODY pause in course contents scroll -scrollbar goofed up +gap between wheel items -limit best to 30 songs +sample pop + +fix screwed up scroll bar ready, here we go between each stage of a course @@ -50,8 +49,6 @@ send disc to Penny Arcade danger BGA, danger movie -difficulty colors - different top bar frame for oni move NoteSkin to Theme diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index c63708e970..557a31d52a 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -447,6 +447,20 @@ ColorNotSelected=0.5,0.5,0.5,1 // grayed HelpText=# $ to change line ! " to select between options then press START TimerSeconds=40 +[ScreenPreferences] +LabelsX=140 +LabelsZoom=0.7 +LabelsHAlign=2 // 0,1,2 = left,center,right +ItemsZoom=0.5 +ItemsX=160 +ItemsStartY=88 +ItemsSpacingY=34 +ColorSelected=1,1,1,1 // normal +ColorNotSelected=0.5,0.5,0.5,1 // grayed +ColorSelectedDefault=0.2,1.0,0.2,1 // green +ColorNotSelectedDefault=0.1,0.5,0.1,1 // grayed green +HelpText=# $ to change line ! " to select between options then press START + [ScreenMapInstruments] HelpText=Use arrow keys to navigate, ENTER to assign, SPACE to clear, ESCAPE when done. @@ -590,3 +604,5 @@ Uppercase=1 [OptionIconRow] SpacingX=38 SpacingY=0 + +\ \ No newline at end of file diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index d38db2d2b2..f35c9439e7 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -63,14 +63,17 @@ Background::Background() m_BackgroundMode = MODE_STATIC_BG; - m_sprDanger.SetZoom( 2 ); - m_sprDanger.SetEffectWagging(); - m_sprDanger.Load( THEME->GetPathTo("Graphics","gameplay danger text") ); - m_sprDanger.SetX( (float)RECTCENTERX(RECT_BACKGROUND) ); - m_sprDanger.SetY( (float)RECTCENTERY(RECT_BACKGROUND) ); + CStringArray asPossibleDangerMovies; + GetDirListing( RANDOMMOVIES_DIR+"danger.avi", asPossibleDangerMovies, false, true ); + GetDirListing( RANDOMMOVIES_DIR+"danger.mpg", asPossibleDangerMovies, false, true ); + GetDirListing( RANDOMMOVIES_DIR+"danger.mpeg", asPossibleDangerMovies, false, true ); - m_sprDangerBackground.Load( THEME->GetPathTo("Graphics","gameplay danger background") ); - m_sprDangerBackground.StretchTo( RECT_BACKGROUND ); + if( asPossibleDangerMovies.GetSize()>0 ) + m_BGADanger.LoadFromMovie( asPossibleDangerMovies[0], true, false ); + else if( DoesFileExist(BG_ANIMS_DIR+"danger\\") ) + m_BGADanger.LoadFromAniDir( BG_ANIMS_DIR+"danger\\", "" ); + else + PREFSMAN->m_bShowDanger = false; m_quadBGBrightness.StretchTo( RECT_BACKGROUND ); m_quadBGBrightness.SetDiffuse( D3DXCOLOR(0,0,0,1-PREFSMAN->m_fBGBrightness) ); @@ -248,7 +251,7 @@ void Background::LoadFromSong( Song* pSong ) CStringArray arrayPossibleAnims; GetDirListing( BG_ANIMS_DIR+"*.*", arrayPossibleAnims, true, true ); for( int i=arrayPossibleAnims.GetSize()-1; i>=0; i-- ) - if( 0==stricmp(arrayPossibleAnims[i].Right(3),"cvs") ) + if( 0==stricmp(arrayPossibleAnims[i].Right(3),"cvs") || -1!=arrayPossibleAnims[i].Find("anger") ) arrayPossibleAnims.RemoveAt(i); for( i=0; i<4 && arrayPossibleAnims.GetSize()>0; i++ ) { @@ -266,6 +269,9 @@ void Background::LoadFromSong( Song* pSong ) GetDirListing( RANDOMMOVIES_DIR + "*.avi", arrayPossibleMovies, false, true ); GetDirListing( RANDOMMOVIES_DIR + "*.mpg", arrayPossibleMovies, false, true ); GetDirListing( RANDOMMOVIES_DIR + "*.mpeg", arrayPossibleMovies, false, true ); + for( int i=arrayPossibleMovies.GetSize()-1; i>=0; i-- ) + if( -1!=arrayPossibleMovies[i].Find("anger") ) + arrayPossibleMovies.RemoveAt(i); for( int i=0; i<4 && arrayPossibleMovies.GetSize()>0; i++ ) { int index = rand() % arrayPossibleMovies.GetSize(); @@ -349,8 +355,7 @@ void Background::Update( float fDeltaTime ) if( DangerVisible() ) { - m_sprDangerBackground.Update( fDeltaTime ); - m_sprDanger.Update( fDeltaTime ); + m_BGADanger.Update( fDeltaTime ); } else { @@ -385,8 +390,7 @@ void Background::DrawPrimitives() if( DangerVisible() ) { - m_sprDangerBackground.Draw(); - m_sprDanger.Draw(); + m_BGADanger.Draw(); } else { diff --git a/stepmania/src/Background.h b/stepmania/src/Background.h index 2fd632aac0..25985726a5 100644 --- a/stepmania/src/Background.h +++ b/stepmania/src/Background.h @@ -53,11 +53,9 @@ protected: bool DangerVisible(); enum BackgroundMode { MODE_STATIC_BG, MODE_MOVIE_BG, MODE_ANIMATIONS, MODE_MOVIE_VIS, MODE_RANDOMMOVIES }; - BackgroundMode m_BackgroundMode; + BackgroundMode m_BackgroundMode; - Sprite m_sprDanger; - Sprite m_sprDangerBackground; - + BackgroundAnimation m_BGADanger; // used in all BackgroundModes except OFF CArray m_BackgroundAnimations;