Don't play "On" automatically for non-generic BGAnimations; play it

explicitly, like we do with all other objects.
This commit is contained in:
Glenn Maynard
2005-01-15 19:21:09 +00:00
parent dc7fcbc776
commit c9091a1214
14 changed files with 17 additions and 5 deletions
-3
View File
@@ -238,9 +238,6 @@ void BGAnimation::LoadFromNode( const CString &sDir, const XNode& node )
cmd.Load( "PlayCommand,Init" ); cmd.Load( "PlayCommand,Init" );
this->RunCommandOnChildren( cmd ); this->RunCommandOnChildren( cmd );
if( !m_bGeneric )
PlayCommand( "On" );
/* Backwards-compatibility: if a "LengthSeconds" value is present, create a dummy /* Backwards-compatibility: if a "LengthSeconds" value is present, create a dummy
* actor that sleeps for the given length of time. This will extend GetTweenTimeLeft. */ * actor that sleeps for the given length of time. This will extend GetTweenTimeLeft. */
float fLengthSeconds = 0; float fLengthSeconds = 0;
+5
View File
@@ -250,6 +250,7 @@ CString Background::CreateRandomBGA()
case PrefsManager::BGMODE_MOVIEVIS: ret->LoadFromVisualization( file ); break; case PrefsManager::BGMODE_MOVIEVIS: ret->LoadFromVisualization( file ); break;
case PrefsManager::BGMODE_RANDOMMOVIES: ret->LoadFromMovie( file ); break; case PrefsManager::BGMODE_RANDOMMOVIES: ret->LoadFromMovie( file ); break;
} }
ret->PlayCommand( "On" );
m_BGAnimations[file] = ret; m_BGAnimations[file] = ret;
m_RandomBGAnimations.push_back( file ); m_RandomBGAnimations.push_back( file );
@@ -326,7 +327,10 @@ void Background::LoadFromSong( const Song* pSong )
{ {
BGAnimation *pTempBGA = CreateSongBGA( sBGName ); BGAnimation *pTempBGA = CreateSongBGA( sBGName );
if( pTempBGA ) if( pTempBGA )
{
pTempBGA->PlayCommand( "On" );
m_BGAnimations[sBGName] = pTempBGA; m_BGAnimations[sBGName] = pTempBGA;
}
else // the background was not found. Use a random one instead else // the background was not found. Use a random one instead
{ {
sBGName = CreateRandomBGA(); sBGName = CreateRandomBGA();
@@ -365,6 +369,7 @@ void Background::LoadFromSong( const Song* pSong )
CString sSongBGPath = pSong->HasBackground() ? pSong->GetBackgroundPath() : THEME->GetPathToG("Common fallback background"); CString sSongBGPath = pSong->HasBackground() ? pSong->GetBackgroundPath() : THEME->GetPathToG("Common fallback background");
BGAnimation *pTempBGA = new BGAnimation; BGAnimation *pTempBGA = new BGAnimation;
pTempBGA->LoadFromStaticGraphic( sSongBGPath ); pTempBGA->LoadFromStaticGraphic( sSongBGPath );
pTempBGA->PlayCommand( "On" );
m_BGAnimations[STATIC_BACKGROUND] = pTempBGA; m_BGAnimations[STATIC_BACKGROUND] = pTempBGA;
} }
+1
View File
@@ -265,6 +265,7 @@ void ConditionalBGA::Load(CString szScreenName)
{ {
LOG->Info("Best Match BGA Was: %s",bganimtouse.c_str()); LOG->Info("Best Match BGA Was: %s",bganimtouse.c_str());
bganim.LoadFromAniDir( THEME->GetPathToB(bganimtouse) ); bganim.LoadFromAniDir( THEME->GetPathToB(bganimtouse) );
bganim.PlayCommand( "On" );
} }
} }
+1
View File
@@ -40,6 +40,7 @@ void Foreground::LoadFromSong( const Song *pSong )
LoadedBGA bga; LoadedBGA bga;
bga.m_bga = new BGAnimation; bga.m_bga = new BGAnimation;
bga.m_bga->LoadFromAniDir( sAniDir ); bga.m_bga->LoadFromAniDir( sAniDir );
bga.m_bga->PlayCommand( "On" );
bga.m_fStartBeat = change.m_fStartBeat; bga.m_fStartBeat = change.m_fStartBeat;
const float fStartSecond = pSong->m_Timing.GetElapsedTimeFromBeat( bga.m_fStartBeat ); const float fStartSecond = pSong->m_Timing.GetElapsedTimeFromBeat( bga.m_fStartBeat );
+1 -1
View File
@@ -252,13 +252,13 @@ ScreenCredits::ScreenCredits( CString sName ) : ScreenAttract( sName )
} }
m_Overlay.LoadFromAniDir( THEME->GetPathToB("ScreenCredits overlay") ); m_Overlay.LoadFromAniDir( THEME->GetPathToB("ScreenCredits overlay") );
m_Overlay.PlayCommand( "On" );
this->AddChild( &m_Overlay ); this->AddChild( &m_Overlay );
this->MoveToTail( &m_In ); // put it in the back so it covers up the stuff we just added this->MoveToTail( &m_In ); // put it in the back so it covers up the stuff we just added
this->MoveToTail( &m_Out ); // put it in the back so it covers up the stuff we just added this->MoveToTail( &m_Out ); // put it in the back so it covers up the stuff we just added
this->ClearMessageQueue( SM_BeginFadingOut ); // ignore ScreenAttract's SecsToShow this->ClearMessageQueue( SM_BeginFadingOut ); // ignore ScreenAttract's SecsToShow
LOG->Trace("XXXXXXXXX %f", fTime);
this->PostScreenMessage( SM_BeginFadingOut, fTime ); this->PostScreenMessage( SM_BeginFadingOut, fTime );
// this->PostScreenMessage( SM_BeginFadingOut, m_Background.GetLengthSeconds() ); // this->PostScreenMessage( SM_BeginFadingOut, m_Background.GetLengthSeconds() );
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("credits") ); SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("credits") );
+1
View File
@@ -45,6 +45,7 @@ void ScreenDemonstration::Init()
m_Overlay.LoadFromAniDir( THEME->GetPathToB("ScreenDemonstration overlay") ); m_Overlay.LoadFromAniDir( THEME->GetPathToB("ScreenDemonstration overlay") );
m_Overlay.PlayCommand( "On" );
this->AddChild( &m_Overlay ); this->AddChild( &m_Overlay );
this->MoveToTail( &m_In ); this->MoveToTail( &m_In );
+1
View File
@@ -80,6 +80,7 @@ ScreenHowToPlay::ScreenHowToPlay( CString sName ) : ScreenAttract( sName )
m_Out.Load( THEME->GetPathToB("ScreenHowToPlay out") ); m_Out.Load( THEME->GetPathToB("ScreenHowToPlay out") );
m_Overlay.LoadFromAniDir( THEME->GetPathToB("ScreenHowToPlay overlay") ); m_Overlay.LoadFromAniDir( THEME->GetPathToB("ScreenHowToPlay overlay") );
m_Overlay.PlayCommand("On");
this->AddChild( &m_Overlay ); this->AddChild( &m_Overlay );
if( (bool)USEPAD && DoesFileExist( GetAnimPath(ANIM_DANCE_PAD) ) ) if( (bool)USEPAD && DoesFileExist( GetAnimPath(ANIM_DANCE_PAD) ) )
+2
View File
@@ -99,6 +99,7 @@ void ScreenManager::ThemeChanged()
// reload shared BGA // reload shared BGA
m_pSharedBGA->LoadFromAniDir( m_sLastLoadedBackgroundPath ); m_pSharedBGA->LoadFromAniDir( m_sLastLoadedBackgroundPath );
m_pSharedBGA->PlayCommand( "On" );
} }
void ScreenManager::EmptyDeleteQueue() void ScreenManager::EmptyDeleteQueue()
@@ -376,6 +377,7 @@ retry:
// any common textures loaded. // any common textures loaded.
BGAnimation *pNewBGA = new BGAnimation; BGAnimation *pNewBGA = new BGAnimation;
pNewBGA->LoadFromAniDir( sNewBGA ); pNewBGA->LoadFromAniDir( sNewBGA );
pNewBGA->PlayCommand( "On" );
SAFE_DELETE( m_pSharedBGA ); SAFE_DELETE( m_pSharedBGA );
m_pSharedBGA = pNewBGA; m_pSharedBGA = pNewBGA;
+1
View File
@@ -41,6 +41,7 @@ ScreenMiniMenu::ScreenMiniMenu( Menu* pDef, ScreenMessage SM_SendOnOK, ScreenMes
m_Background.LoadFromAniDir( THEME->GetPathToB("ScreenMiniMenu background") ); m_Background.LoadFromAniDir( THEME->GetPathToB("ScreenMiniMenu background") );
m_Background.PlayCommand("On");
this->AddChild( &m_Background ); this->AddChild( &m_Background );
float fHeightOfAll = min( SCREEN_HEIGHT-80, (m_Def.rows.size()-1)*SPACING_Y ); float fHeightOfAll = min( SCREEN_HEIGHT-80, (m_Def.rows.size()-1)*SPACING_Y );
+1
View File
@@ -30,6 +30,7 @@ ScreenPrompt::ScreenPrompt( CString sText, bool bYesNoPrompt, bool bDefaultAnswe
m_pCallbackData = pCallbackData; m_pCallbackData = pCallbackData;
m_Background.LoadFromAniDir( THEME->GetPathToB("ScreenPrompt background") ); m_Background.LoadFromAniDir( THEME->GetPathToB("ScreenPrompt background") );
m_Background.PlayCommand("On");
this->AddChild( &m_Background ); this->AddChild( &m_Background );
m_textQuestion.LoadFromFont( THEME->GetPathToF("Common normal") ); m_textQuestion.LoadFromFont( THEME->GetPathToF("Common normal") );
+1
View File
@@ -32,6 +32,7 @@ ScreenStage::ScreenStage( CString sClassName ) : Screen( sClassName )
m_Background.LoadFromAniDir( THEME->GetPathToB(m_sName + " "+GAMESTATE->GetStageText()) ); m_Background.LoadFromAniDir( THEME->GetPathToB(m_sName + " "+GAMESTATE->GetStageText()) );
m_Background.SetDrawOrder( DRAW_ORDER_BEFORE_EVERYTHING ); m_Background.SetDrawOrder( DRAW_ORDER_BEFORE_EVERYTHING );
m_Background.PlayCommand( "On" );
this->AddChild( &m_Background ); this->AddChild( &m_Background );
m_Overlay.SetName( "Overlay" ); m_Overlay.SetName( "Overlay" );
+1
View File
@@ -43,6 +43,7 @@ ScreenTextEntry::ScreenTextEntry( CString sClassName, CString sQuestion, CString
m_bCancelled = false; m_bCancelled = false;
m_Background.LoadFromAniDir( THEME->GetPathToB("ScreenPrompt background") ); m_Background.LoadFromAniDir( THEME->GetPathToB("ScreenPrompt background") );
m_Background.PlayCommand( "On" );
this->AddChild( &m_Background ); this->AddChild( &m_Background );
m_textQuestion.LoadFromFont( THEME->GetPathToF("Common normal") ); m_textQuestion.LoadFromFont( THEME->GetPathToF("Common normal") );
-1
View File
@@ -4,7 +4,6 @@
#include "Screen.h" #include "Screen.h"
#include "Sprite.h" #include "Sprite.h"
#include "Transition.h" #include "Transition.h"
#include "BGAnimation.h"
#include "ActorUtil.h" #include "ActorUtil.h"
#include "RageSound.h" #include "RageSound.h"
#include "MemoryCardDisplay.h" #include "MemoryCardDisplay.h"
+1
View File
@@ -18,6 +18,7 @@ void Transition::Load( CString sBGAniDir )
sBGAniDir += "/"; sBGAniDir += "/";
m_BGAnimation.LoadFromAniDir( sBGAniDir ); m_BGAnimation.LoadFromAniDir( sBGAniDir );
m_BGAnimation.PlayCommand( "On" );
m_fLengthSeconds = m_BGAnimation.GetTweenTimeLeft(); m_fLengthSeconds = m_BGAnimation.GetTweenTimeLeft();
m_State = waiting; m_State = waiting;