Remove backgrounds on screens. Have one shared background that persists across screens.
This commit is contained in:
@@ -33,9 +33,6 @@ ScreenAttract::ScreenAttract( CString sName, bool bResetGameState ) : Screen( sN
|
|||||||
|
|
||||||
// We have to do initialization in the first update because this->GetElementName() won't
|
// We have to do initialization in the first update because this->GetElementName() won't
|
||||||
// work until the object has been fully constructed.
|
// work until the object has been fully constructed.
|
||||||
m_Background.LoadFromAniDir( THEME->GetPathToB(m_sName+" background") );
|
|
||||||
this->AddChild( &m_Background );
|
|
||||||
|
|
||||||
m_In.Load( THEME->GetPathToB(m_sName+" in") );
|
m_In.Load( THEME->GetPathToB(m_sName+" in") );
|
||||||
m_In.StartTransitioning();
|
m_In.StartTransitioning();
|
||||||
m_In.SetDrawOrder( DRAW_ORDER_TRANSITIONS );
|
m_In.SetDrawOrder( DRAW_ORDER_TRANSITIONS );
|
||||||
@@ -46,16 +43,6 @@ ScreenAttract::ScreenAttract( CString sName, bool bResetGameState ) : Screen( sN
|
|||||||
this->AddChild( &m_Out );
|
this->AddChild( &m_Out );
|
||||||
|
|
||||||
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo(m_sName) );
|
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo(m_sName) );
|
||||||
|
|
||||||
float fTimeUntilBeginFadingOut = m_Background.GetLengthSeconds() - m_Out.GetLengthSeconds();
|
|
||||||
if( fTimeUntilBeginFadingOut < 0 )
|
|
||||||
{
|
|
||||||
LOG->Warn( "Screen '%s' Out BGAnimation (%f seconds) is longer than Background BGAnimation (%f seconds); background BGA will be truncated",
|
|
||||||
m_sName.c_str(), m_Out.GetLengthSeconds(), m_Background.GetLengthSeconds() );
|
|
||||||
fTimeUntilBeginFadingOut = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
this->PostScreenMessage( SM_BeginFadingOut, fTimeUntilBeginFadingOut );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -132,6 +119,19 @@ void ScreenAttract::Update( float fDelta )
|
|||||||
{
|
{
|
||||||
if( IsFirstUpdate() )
|
if( IsFirstUpdate() )
|
||||||
{
|
{
|
||||||
|
// The shared background isn't loaded until the screen is actually
|
||||||
|
// showing. The background is loaded by the time of the first update.
|
||||||
|
BGAnimation &background = *SCREENMAN->m_pSharedBGA;
|
||||||
|
float fTimeUntilBeginFadingOut = background.GetLengthSeconds() - m_Out.GetLengthSeconds();
|
||||||
|
if( fTimeUntilBeginFadingOut < 0 )
|
||||||
|
{
|
||||||
|
LOG->Warn( "Screen '%s' Out BGAnimation (%f seconds) is longer than Background BGAnimation (%f seconds); background BGA will be truncated",
|
||||||
|
m_sName.c_str(), m_Out.GetLengthSeconds(), background.GetLengthSeconds() );
|
||||||
|
fTimeUntilBeginFadingOut = 0;
|
||||||
|
}
|
||||||
|
this->PostScreenMessage( SM_BeginFadingOut, fTimeUntilBeginFadingOut );
|
||||||
|
|
||||||
|
|
||||||
if( GAMESTATE->IsTimeToPlayAttractSounds() )
|
if( GAMESTATE->IsTimeToPlayAttractSounds() )
|
||||||
SOUND->PlayMusic( THEME->GetPathToS(m_sName + " music") );
|
SOUND->PlayMusic( THEME->GetPathToS(m_sName + " music") );
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ public:
|
|||||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
BGAnimation m_Background;
|
|
||||||
Transition m_In;
|
Transition m_In;
|
||||||
Transition m_Out;
|
Transition m_Out;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -412,8 +412,6 @@ ScreenEdit::ScreenEdit( CString sName ) : Screen( sName )
|
|||||||
GAMESTATE->ResetNoteSkins();
|
GAMESTATE->ResetNoteSkins();
|
||||||
GAMESTATE->StoreSelectedOptions();
|
GAMESTATE->StoreSelectedOptions();
|
||||||
|
|
||||||
m_BGAnimation.LoadFromAniDir( THEME->GetPathToB("ScreenEdit background") );
|
|
||||||
|
|
||||||
shiftAnchor = -1;
|
shiftAnchor = -1;
|
||||||
|
|
||||||
|
|
||||||
@@ -605,7 +603,6 @@ void ScreenEdit::Update( float fDeltaTime )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_BGAnimation.Update( fDeltaTime );
|
|
||||||
m_SnapDisplay.Update( fDeltaTime );
|
m_SnapDisplay.Update( fDeltaTime );
|
||||||
m_NoteFieldEdit.Update( fDeltaTime );
|
m_NoteFieldEdit.Update( fDeltaTime );
|
||||||
m_In.Update( fDeltaTime );
|
m_In.Update( fDeltaTime );
|
||||||
@@ -713,7 +710,6 @@ void ScreenEdit::DrawPrimitives()
|
|||||||
{
|
{
|
||||||
case MODE_EDITING:
|
case MODE_EDITING:
|
||||||
{
|
{
|
||||||
m_BGAnimation.Draw();
|
|
||||||
m_sprHelp.Draw();
|
m_sprHelp.Draw();
|
||||||
m_textHelp.Draw();
|
m_textHelp.Draw();
|
||||||
m_sprInfo.Draw();
|
m_sprInfo.Draw();
|
||||||
@@ -733,8 +729,6 @@ void ScreenEdit::DrawPrimitives()
|
|||||||
case MODE_RECORDING:
|
case MODE_RECORDING:
|
||||||
if( PREFSMAN->m_bEditorShowBGChangesPlay )
|
if( PREFSMAN->m_bEditorShowBGChangesPlay )
|
||||||
m_Background.Draw();
|
m_Background.Draw();
|
||||||
else
|
|
||||||
m_BGAnimation.Draw();
|
|
||||||
|
|
||||||
m_NoteFieldRecord.Draw();
|
m_NoteFieldRecord.Draw();
|
||||||
if( PREFSMAN->m_bEditorShowBGChangesPlay )
|
if( PREFSMAN->m_bEditorShowBGChangesPlay )
|
||||||
@@ -743,8 +737,6 @@ void ScreenEdit::DrawPrimitives()
|
|||||||
case MODE_PLAYING:
|
case MODE_PLAYING:
|
||||||
if( PREFSMAN->m_bEditorShowBGChangesPlay )
|
if( PREFSMAN->m_bEditorShowBGChangesPlay )
|
||||||
m_Background.Draw();
|
m_Background.Draw();
|
||||||
else
|
|
||||||
m_BGAnimation.Draw();
|
|
||||||
|
|
||||||
m_Player.Draw();
|
m_Player.Draw();
|
||||||
if( PREFSMAN->m_bEditorShowBGChangesPlay )
|
if( PREFSMAN->m_bEditorShowBGChangesPlay )
|
||||||
|
|||||||
@@ -51,8 +51,6 @@ protected:
|
|||||||
Song* m_pSong;
|
Song* m_pSong;
|
||||||
Steps* m_pSteps;
|
Steps* m_pSteps;
|
||||||
|
|
||||||
BGAnimation m_BGAnimation;
|
|
||||||
|
|
||||||
NoteField m_NoteFieldEdit;
|
NoteField m_NoteFieldEdit;
|
||||||
SnapDisplay m_SnapDisplay;
|
SnapDisplay m_SnapDisplay;
|
||||||
|
|
||||||
|
|||||||
@@ -246,15 +246,6 @@ ScreenEnding::ScreenEnding( CString sClassName ) : ScreenAttract( sClassName, fa
|
|||||||
|
|
||||||
// Now that we've read the data from the profile, it's ok to Reset()
|
// Now that we've read the data from the profile, it's ok to Reset()
|
||||||
GAMESTATE->Reset();
|
GAMESTATE->Reset();
|
||||||
|
|
||||||
float fSecsUntilBeginFadingOut = m_Background.GetLengthSeconds() - m_Out.GetLengthSeconds();
|
|
||||||
if( fSecsUntilBeginFadingOut < 0 )
|
|
||||||
{
|
|
||||||
LOG->Warn( "Screen '%s' Out BGAnimation (%f seconds) is longer than Background BGAnimation (%f seconds); background BGA will be truncated",
|
|
||||||
m_sName.c_str(), m_Out.GetLengthSeconds(), m_Background.GetLengthSeconds() );
|
|
||||||
fSecsUntilBeginFadingOut = 0;
|
|
||||||
}
|
|
||||||
this->PostScreenMessage( SM_BeginFadingOut, fSecsUntilBeginFadingOut );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ScreenEnding::~ScreenEnding()
|
ScreenEnding::~ScreenEnding()
|
||||||
@@ -263,6 +254,22 @@ ScreenEnding::~ScreenEnding()
|
|||||||
|
|
||||||
void ScreenEnding::Update( float fDeltaTime )
|
void ScreenEnding::Update( float fDeltaTime )
|
||||||
{
|
{
|
||||||
|
// The shared background isn't loaded until the screen is actually
|
||||||
|
// showing. The background is loaded by the time of the first update.
|
||||||
|
if( IsFirstUpdate() )
|
||||||
|
{
|
||||||
|
BGAnimation &background = *SCREENMAN->m_pSharedBGA;
|
||||||
|
float fSecsUntilBeginFadingOut = background.GetLengthSeconds() - m_Out.GetLengthSeconds();
|
||||||
|
if( fSecsUntilBeginFadingOut < 0 )
|
||||||
|
{
|
||||||
|
LOG->Warn( "Screen '%s' Out BGAnimation (%f seconds) is longer than Background BGAnimation (%f seconds); background BGA will be truncated",
|
||||||
|
m_sName.c_str(), m_Out.GetLengthSeconds(), background.GetLengthSeconds() );
|
||||||
|
fSecsUntilBeginFadingOut = 0;
|
||||||
|
}
|
||||||
|
this->PostScreenMessage( SM_BeginFadingOut, fSecsUntilBeginFadingOut );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ScreenAttract::Update( fDeltaTime );
|
ScreenAttract::Update( fDeltaTime );
|
||||||
|
|
||||||
if( m_In.IsTransitioning() && m_Out.IsTransitioning() )
|
if( m_In.IsTransitioning() && m_Out.IsTransitioning() )
|
||||||
|
|||||||
@@ -45,9 +45,6 @@ ScreenEz2SelectPlayer::ScreenEz2SelectPlayer( CString sName ) : ScreenWithMenuEl
|
|||||||
|
|
||||||
LOG->Trace( "ScreenEz2SelectPlayer::ScreenEz2SelectPlayer()" );
|
LOG->Trace( "ScreenEz2SelectPlayer::ScreenEz2SelectPlayer()" );
|
||||||
|
|
||||||
m_Background.LoadFromAniDir( THEME->GetPathToB("ScreenEz2SelectPlayer background") );
|
|
||||||
this->AddChild( &m_Background ); // animated background =)
|
|
||||||
|
|
||||||
FOREACH_PlayerNumber( p )
|
FOREACH_PlayerNumber( p )
|
||||||
{
|
{
|
||||||
m_sprJoinFrame[p].Load( THEME->GetPathToG("ScreenEz2SelectPlayer join frame 1x2") );
|
m_sprJoinFrame[p].Load( THEME->GetPathToG("ScreenEz2SelectPlayer join frame 1x2") );
|
||||||
|
|||||||
@@ -28,8 +28,6 @@ private:
|
|||||||
|
|
||||||
Sprite m_sprJoinMessage[NUM_PLAYERS];
|
Sprite m_sprJoinMessage[NUM_PLAYERS];
|
||||||
Sprite m_sprJoinFrame[NUM_PLAYERS];
|
Sprite m_sprJoinFrame[NUM_PLAYERS];
|
||||||
|
|
||||||
BGAnimation m_Background;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
#include "RageTextureManager.h"
|
#include "RageTextureManager.h"
|
||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
#include "ScreenSystemLayer.h"
|
#include "ScreenSystemLayer.h"
|
||||||
|
#include "BGAnimation.h"
|
||||||
|
|
||||||
ScreenManager* SCREENMAN = NULL; // global and accessable from anywhere in our program
|
ScreenManager* SCREENMAN = NULL; // global and accessable from anywhere in our program
|
||||||
|
|
||||||
@@ -50,6 +51,7 @@ void ScreenManager::Register( const CString& sClassName, CreateScreenFn pfn )
|
|||||||
|
|
||||||
ScreenManager::ScreenManager()
|
ScreenManager::ScreenManager()
|
||||||
{
|
{
|
||||||
|
m_pSharedBGA = new BGAnimation;
|
||||||
m_SystemLayer = NULL;
|
m_SystemLayer = NULL;
|
||||||
|
|
||||||
/* By the time this is constructed, THEME has already been set up and set to
|
/* By the time this is constructed, THEME has already been set up and set to
|
||||||
@@ -60,7 +62,6 @@ ScreenManager::ScreenManager()
|
|||||||
this->ThemeChanged();
|
this->ThemeChanged();
|
||||||
|
|
||||||
m_ScreenBuffered = NULL;
|
m_ScreenBuffered = NULL;
|
||||||
|
|
||||||
m_MessageSendOnPop = SM_None;
|
m_MessageSendOnPop = SM_None;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +72,7 @@ ScreenManager::~ScreenManager()
|
|||||||
|
|
||||||
EmptyDeleteQueue();
|
EmptyDeleteQueue();
|
||||||
|
|
||||||
// delete current Screens
|
SAFE_DELETE( m_pSharedBGA );
|
||||||
for( unsigned i=0; i<m_ScreenStack.size(); i++ )
|
for( unsigned i=0; i<m_ScreenStack.size(); i++ )
|
||||||
delete m_ScreenStack[i];
|
delete m_ScreenStack[i];
|
||||||
delete m_ScreenBuffered;
|
delete m_ScreenBuffered;
|
||||||
@@ -139,6 +140,8 @@ void ScreenManager::Update( float fDeltaTime )
|
|||||||
*/
|
*/
|
||||||
ASSERT( !m_ScreenStack.empty() || m_DelayedScreen != "" ); // Why play the game if there is nothing showing?
|
ASSERT( !m_ScreenStack.empty() || m_DelayedScreen != "" ); // Why play the game if there is nothing showing?
|
||||||
|
|
||||||
|
m_pSharedBGA->Update( fDeltaTime );
|
||||||
|
|
||||||
if( !m_ScreenStack.empty() )
|
if( !m_ScreenStack.empty() )
|
||||||
{
|
{
|
||||||
Screen* pScreen = GetTopScreen();
|
Screen* pScreen = GetTopScreen();
|
||||||
@@ -180,13 +183,21 @@ void ScreenManager::Draw()
|
|||||||
if( !DISPLAY->BeginFrame() )
|
if( !DISPLAY->BeginFrame() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
m_pSharedBGA->Draw();
|
||||||
|
|
||||||
if( !m_ScreenStack.empty() && !m_ScreenStack.back()->IsTransparent() ) // top screen isn't transparent
|
if( !m_ScreenStack.empty() && !m_ScreenStack.back()->IsTransparent() ) // top screen isn't transparent
|
||||||
|
{
|
||||||
m_ScreenStack.back()->Draw();
|
m_ScreenStack.back()->Draw();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
for( unsigned i=0; i<m_ScreenStack.size(); i++ ) // Draw all screens bottom to top
|
for( unsigned i=0; i<m_ScreenStack.size(); i++ ) // Draw all screens bottom to top
|
||||||
m_ScreenStack[i]->Draw();
|
m_ScreenStack[i]->Draw();
|
||||||
|
}
|
||||||
|
|
||||||
m_SystemLayer->Draw();
|
m_SystemLayer->Draw();
|
||||||
|
|
||||||
|
|
||||||
DISPLAY->EndFrame();
|
DISPLAY->EndFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,7 +213,7 @@ void ScreenManager::Input( const DeviceInput& DeviceI, const InputEventType type
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Screen* ScreenManager::MakeNewScreen( const CString &sName )
|
Screen* ScreenManager::MakeNewScreen( const CString &sScreenName )
|
||||||
{
|
{
|
||||||
/* By default, RageSounds handles the song timer. When we change screens, reset this;
|
/* By default, RageSounds handles the song timer. When we change screens, reset this;
|
||||||
* screens turn this off in SM_GainFocus if they handle timers themselves (edit).
|
* screens turn this off in SM_GainFocus if they handle timers themselves (edit).
|
||||||
@@ -214,20 +225,20 @@ Screen* ScreenManager::MakeNewScreen( const CString &sName )
|
|||||||
SONGMAN->Cleanup();
|
SONGMAN->Cleanup();
|
||||||
|
|
||||||
RageTimer t;
|
RageTimer t;
|
||||||
LOG->Trace( "Loading screen name '%s'", sName.c_str() );
|
LOG->Trace( "Loading screen name '%s'", sScreenName.c_str() );
|
||||||
|
|
||||||
CString sClassName = sName;
|
CString sClassName = sScreenName;
|
||||||
// Look up the class in the metrics group sName
|
// Look up the class in the metrics group sName
|
||||||
if( THEME->HasMetric(sClassName,"Class") )
|
if( THEME->HasMetric(sClassName,"Class") )
|
||||||
sClassName = THEME->GetMetric(sClassName,"Class");
|
sClassName = THEME->GetMetric(sClassName,"Class");
|
||||||
|
|
||||||
map<CString,CreateScreenFn>::iterator iter = g_pmapRegistrees->find( sClassName );
|
map<CString,CreateScreenFn>::iterator iter = g_pmapRegistrees->find( sClassName );
|
||||||
ASSERT_M( iter != g_pmapRegistrees->end(), ssprintf("Screen '%s' has an invalid class '%s'",sName.c_str(),sClassName.c_str()) )
|
ASSERT_M( iter != g_pmapRegistrees->end(), ssprintf("Screen '%s' has an invalid class '%s'",sScreenName.c_str(),sClassName.c_str()) )
|
||||||
|
|
||||||
CreateScreenFn pfn = iter->second;
|
CreateScreenFn pfn = iter->second;
|
||||||
Screen* ret = pfn( sName );
|
Screen* ret = pfn( sScreenName );
|
||||||
|
|
||||||
LOG->Trace( "Loaded '%s' ('%s') in %f", sName.c_str(), sClassName.c_str(), t.GetDeltaTime());
|
LOG->Trace( "Loaded '%s' ('%s') in %f", sScreenName.c_str(), sClassName.c_str(), t.GetDeltaTime());
|
||||||
|
|
||||||
/* Loading probably took a little while. Let's reset stats. This prevents us
|
/* Loading probably took a little while. Let's reset stats. This prevents us
|
||||||
* from displaying an unnaturally low FPS value, and the next FPS value we
|
* from displaying an unnaturally low FPS value, and the next FPS value we
|
||||||
@@ -238,10 +249,10 @@ Screen* ScreenManager::MakeNewScreen( const CString &sName )
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenManager::PrepNewScreen( const CString &sClassName )
|
void ScreenManager::PrepNewScreen( const CString &sScreenName )
|
||||||
{
|
{
|
||||||
ASSERT(m_ScreenBuffered == NULL);
|
ASSERT(m_ScreenBuffered == NULL);
|
||||||
m_ScreenBuffered = MakeNewScreen(sClassName);
|
m_ScreenBuffered = MakeNewScreen(sScreenName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenManager::LoadPreppedScreen()
|
void ScreenManager::LoadPreppedScreen()
|
||||||
@@ -255,6 +266,7 @@ void ScreenManager::LoadPreppedScreen()
|
|||||||
void ScreenManager::DeletePreppedScreen()
|
void ScreenManager::DeletePreppedScreen()
|
||||||
{
|
{
|
||||||
SAFE_DELETE( m_ScreenBuffered );
|
SAFE_DELETE( m_ScreenBuffered );
|
||||||
|
|
||||||
TEXTUREMAN->DeleteCachedTextures();
|
TEXTUREMAN->DeleteCachedTextures();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -285,9 +297,9 @@ void ScreenManager::SetFromNewScreen( Screen *pNewScreen, bool Stack )
|
|||||||
PostMessageToTopScreen( SM_GainFocus, 0 );
|
PostMessageToTopScreen( SM_GainFocus, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenManager::SetNewScreen( const CString &sClassName )
|
void ScreenManager::SetNewScreen( const CString &sScreenName )
|
||||||
{
|
{
|
||||||
m_DelayedScreen = sClassName;
|
m_DelayedScreen = sScreenName;
|
||||||
|
|
||||||
/* If we're not delaying screen loads, load it now. Otherwise, we'll load
|
/* If we're not delaying screen loads, load it now. Otherwise, we'll load
|
||||||
* it on the next iteration. Only delay if we already have a screen
|
* it on the next iteration. Only delay if we already have a screen
|
||||||
@@ -299,7 +311,7 @@ void ScreenManager::SetNewScreen( const CString &sClassName )
|
|||||||
void ScreenManager::LoadDelayedScreen()
|
void ScreenManager::LoadDelayedScreen()
|
||||||
{
|
{
|
||||||
retry:
|
retry:
|
||||||
CString sClassName = m_DelayedScreen;
|
CString sScreenName = m_DelayedScreen;
|
||||||
m_DelayedScreen = "";
|
m_DelayedScreen = "";
|
||||||
|
|
||||||
/* If we prepped a screen but didn't use it, nuke it. */
|
/* If we prepped a screen but didn't use it, nuke it. */
|
||||||
@@ -307,10 +319,13 @@ retry:
|
|||||||
|
|
||||||
Screen* pOldTopScreen = m_ScreenStack.empty() ? NULL : m_ScreenStack.back();
|
Screen* pOldTopScreen = m_ScreenStack.empty() ? NULL : m_ScreenStack.back();
|
||||||
|
|
||||||
|
|
||||||
// It makes sense that ScreenManager should allocate memory for a new screen since it
|
// It makes sense that ScreenManager should allocate memory for a new screen since it
|
||||||
// deletes it later on. This also convention will reduce includes because screens won't
|
// deletes it later on. This also convention will reduce includes because screens won't
|
||||||
// have to include each other's headers of other screens.
|
// have to include each other's headers of other screens.
|
||||||
Screen* pNewScreen = MakeNewScreen(sClassName);
|
Screen* pNewScreen = MakeNewScreen(sScreenName);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if( pOldTopScreen!=NULL && m_ScreenStack.back()!=pOldTopScreen )
|
if( pOldTopScreen!=NULL && m_ScreenStack.back()!=pOldTopScreen )
|
||||||
{
|
{
|
||||||
@@ -333,16 +348,16 @@ retry:
|
|||||||
|
|
||||||
/* If this is a system menu, don't let the operator key touch it!
|
/* If this is a system menu, don't let the operator key touch it!
|
||||||
However, if you add an options screen, please include it here -- Miryokuteki */
|
However, if you add an options screen, please include it here -- Miryokuteki */
|
||||||
if( sClassName == "ScreenOptionsMenu" ||
|
if( sScreenName == "ScreenOptionsMenu" ||
|
||||||
sClassName == "ScreenMachineOptions" ||
|
sScreenName == "ScreenMachineOptions" ||
|
||||||
sClassName == "ScreenInputOptions" ||
|
sScreenName == "ScreenInputOptions" ||
|
||||||
sClassName == "ScreenGraphicOptions" ||
|
sScreenName == "ScreenGraphicOptions" ||
|
||||||
sClassName == "ScreenGameplayOptions" ||
|
sScreenName == "ScreenGameplayOptions" ||
|
||||||
sClassName == "ScreenMapControllers" ||
|
sScreenName == "ScreenMapControllers" ||
|
||||||
sClassName == "ScreenAppearanceOptions" ||
|
sScreenName == "ScreenAppearanceOptions" ||
|
||||||
sClassName == "ScreenEdit" ||
|
sScreenName == "ScreenEdit" ||
|
||||||
sClassName == "ScreenEditMenu" ||
|
sScreenName == "ScreenEditMenu" ||
|
||||||
sClassName == "ScreenSoundOptions" )
|
sScreenName == "ScreenSoundOptions" )
|
||||||
GAMESTATE->m_bIsOnSystemMenu = true;
|
GAMESTATE->m_bIsOnSystemMenu = true;
|
||||||
else
|
else
|
||||||
GAMESTATE->m_bIsOnSystemMenu = false;
|
GAMESTATE->m_bIsOnSystemMenu = false;
|
||||||
@@ -355,14 +370,14 @@ retry:
|
|||||||
SetFromNewScreen( pNewScreen, false );
|
SetFromNewScreen( pNewScreen, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenManager::AddNewScreenToTop( const CString &sClassName, ScreenMessage messageSendOnPop )
|
void ScreenManager::AddNewScreenToTop( const CString &sScreenName, ScreenMessage messageSendOnPop )
|
||||||
{
|
{
|
||||||
/* Send this before making the new screen, since it might set things that will be re-set
|
/* Send this before making the new screen, since it might set things that will be re-set
|
||||||
* in the new screen's ctor. */
|
* in the new screen's ctor. */
|
||||||
if( m_ScreenStack.size() )
|
if( m_ScreenStack.size() )
|
||||||
m_ScreenStack.back()->HandleScreenMessage( SM_LoseFocus );
|
m_ScreenStack.back()->HandleScreenMessage( SM_LoseFocus );
|
||||||
|
|
||||||
Screen* pNewScreen = MakeNewScreen(sClassName);
|
Screen* pNewScreen = MakeNewScreen(sScreenName);
|
||||||
SetFromNewScreen( pNewScreen, true );
|
SetFromNewScreen( pNewScreen, true );
|
||||||
m_MessageSendOnPop = messageSendOnPop;
|
m_MessageSendOnPop = messageSendOnPop;
|
||||||
}
|
}
|
||||||
@@ -512,6 +527,11 @@ void ScreenManager::PlayBackSound()
|
|||||||
m_soundBack.Play( &p );
|
m_soundBack.Play( &p );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScreenManager::PlaySharedBackgroundOffCommand()
|
||||||
|
{
|
||||||
|
m_pSharedBGA->PlayCommand("Off");
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (c) 2001-2003 Chris Danford, Glenn Maynard
|
* (c) 2001-2003 Chris Danford, Glenn Maynard
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
class Screen;
|
class Screen;
|
||||||
struct Menu;
|
struct Menu;
|
||||||
class ScreenSystemLayer;
|
class ScreenSystemLayer;
|
||||||
|
class BGAnimation;
|
||||||
|
|
||||||
|
|
||||||
typedef Screen* (*CreateScreenFn)(const CString&);
|
typedef Screen* (*CreateScreenFn)(const CString&);
|
||||||
@@ -37,6 +38,7 @@ public:
|
|||||||
void PrepNewScreen( const CString &sName );
|
void PrepNewScreen( const CString &sName );
|
||||||
void LoadPreppedScreen();
|
void LoadPreppedScreen();
|
||||||
void DeletePreppedScreen();
|
void DeletePreppedScreen();
|
||||||
|
|
||||||
void SetNewScreen( const CString &sName );
|
void SetNewScreen( const CString &sName );
|
||||||
void AddNewScreenToTop( const CString &sName, ScreenMessage messageSendOnPop );
|
void AddNewScreenToTop( const CString &sName, ScreenMessage messageSendOnPop );
|
||||||
void Prompt( ScreenMessage SM_SendWhenDone, const CString &sText, bool bYesNo = false, bool bDefaultAnswer = false, void(*OnYes)(void*) = NULL, void(*OnNo)(void*) = NULL, void* pCallbackData = NULL );
|
void Prompt( ScreenMessage SM_SendWhenDone, const CString &sText, bool bYesNo = false, bool bDefaultAnswer = false, void(*OnYes)(void*) = NULL, void(*OnNo)(void*) = NULL, void* pCallbackData = NULL );
|
||||||
@@ -59,6 +61,12 @@ public:
|
|||||||
|
|
||||||
Screen *GetTopScreen();
|
Screen *GetTopScreen();
|
||||||
|
|
||||||
|
public:
|
||||||
|
//
|
||||||
|
// in draw order first to last
|
||||||
|
//
|
||||||
|
BGAnimation *m_pSharedBGA; // BGA object that's persistent between screens
|
||||||
|
void PlaySharedBackgroundOffCommand();
|
||||||
private:
|
private:
|
||||||
vector<Screen*> m_ScreenStack; // bottommost to topmost
|
vector<Screen*> m_ScreenStack; // bottommost to topmost
|
||||||
ScreenMessage m_MessageSendOnPop;
|
ScreenMessage m_MessageSendOnPop;
|
||||||
|
|||||||
@@ -157,9 +157,6 @@ ScreenNameEntry::ScreenNameEntry( CString sClassName ) : Screen( sClassName )
|
|||||||
|
|
||||||
GAMESTATE->m_bPastHereWeGo = true; // enable the gray arrows
|
GAMESTATE->m_bPastHereWeGo = true; // enable the gray arrows
|
||||||
|
|
||||||
m_Background.LoadFromAniDir( THEME->GetPathToB("ScreenNameEntry background") );
|
|
||||||
this->AddChild( &m_Background );
|
|
||||||
|
|
||||||
FOREACH_PlayerNumber( p )
|
FOREACH_PlayerNumber( p )
|
||||||
{
|
{
|
||||||
// load last used ranking name if any
|
// load last used ranking name if any
|
||||||
|
|||||||
@@ -29,8 +29,6 @@ public:
|
|||||||
private:
|
private:
|
||||||
bool AnyStillEntering() const;
|
bool AnyStillEntering() const;
|
||||||
|
|
||||||
BGAnimation m_Background;
|
|
||||||
|
|
||||||
ReceptorArrowRow m_ReceptorArrowRow[NUM_PLAYERS];
|
ReceptorArrowRow m_ReceptorArrowRow[NUM_PLAYERS];
|
||||||
BitmapText m_textSelectedChars[NUM_PLAYERS][ABS_MAX_RANKING_NAME_LENGTH];
|
BitmapText m_textSelectedChars[NUM_PLAYERS][ABS_MAX_RANKING_NAME_LENGTH];
|
||||||
BitmapText m_textScrollingChars[NUM_PLAYERS][ABS_MAX_RANKING_NAME_LENGTH];
|
BitmapText m_textScrollingChars[NUM_PLAYERS][ABS_MAX_RANKING_NAME_LENGTH];
|
||||||
|
|||||||
@@ -60,8 +60,6 @@ private:
|
|||||||
void ChangeDisplayedFeat();
|
void ChangeDisplayedFeat();
|
||||||
void SelectChar( PlayerNumber pn, int c );
|
void SelectChar( PlayerNumber pn, int c );
|
||||||
|
|
||||||
BGAnimation m_Background;
|
|
||||||
|
|
||||||
ActorFrame m_Keyboard[NUM_PLAYERS];
|
ActorFrame m_Keyboard[NUM_PLAYERS];
|
||||||
Sprite m_sprCursor[NUM_PLAYERS];
|
Sprite m_sprCursor[NUM_PLAYERS];
|
||||||
vector<BitmapText*> m_textAlphabet[NUM_PLAYERS];
|
vector<BitmapText*> m_textAlphabet[NUM_PLAYERS];
|
||||||
|
|||||||
@@ -31,11 +31,6 @@ ScreenStage::ScreenStage( CString sClassName ) : Screen( sClassName )
|
|||||||
|
|
||||||
LIGHTSMAN->SetLightsMode( LIGHTSMODE_STAGE );
|
LIGHTSMAN->SetLightsMode( LIGHTSMODE_STAGE );
|
||||||
|
|
||||||
|
|
||||||
m_Background.LoadFromAniDir( THEME->GetPathToB(m_sName + " "+GAMESTATE->GetStageText()) );
|
|
||||||
m_Background.SetDrawOrder( DRAW_ORDER_BEFORE_EVERYTHING );
|
|
||||||
this->AddChild( &m_Background );
|
|
||||||
|
|
||||||
m_Overlay.SetName( "Overlay" );
|
m_Overlay.SetName( "Overlay" );
|
||||||
m_Overlay.LoadFromAniDir( THEME->GetPathToB(m_sName + " overlay"));
|
m_Overlay.LoadFromAniDir( THEME->GetPathToB(m_sName + " overlay"));
|
||||||
ON_COMMAND( m_Overlay );
|
ON_COMMAND( m_Overlay );
|
||||||
@@ -54,9 +49,6 @@ ScreenStage::ScreenStage( CString sClassName ) : Screen( sClassName )
|
|||||||
m_Back.SetDrawOrder( DRAW_ORDER_TRANSITIONS );
|
m_Back.SetDrawOrder( DRAW_ORDER_TRANSITIONS );
|
||||||
this->AddChild( &m_Back );
|
this->AddChild( &m_Back );
|
||||||
|
|
||||||
/* Prep the new screen once m_In is complete. */
|
|
||||||
this->PostScreenMessage( SM_PrepScreen, m_Background.GetLengthSeconds() );
|
|
||||||
|
|
||||||
FOREACH_PlayerNumber(p)
|
FOREACH_PlayerNumber(p)
|
||||||
{
|
{
|
||||||
Character* pChar = GAMESTATE->m_pCurCharacters[p];
|
Character* pChar = GAMESTATE->m_pCurCharacters[p];
|
||||||
@@ -123,7 +115,8 @@ void ScreenStage::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
OFF_COMMAND( m_SongTitle );
|
OFF_COMMAND( m_SongTitle );
|
||||||
OFF_COMMAND( m_Artist );
|
OFF_COMMAND( m_Artist );
|
||||||
OFF_COMMAND( m_Banner );
|
OFF_COMMAND( m_Banner );
|
||||||
OFF_COMMAND( m_Background );
|
SCREENMAN->PlaySharedBackgroundOffCommand();
|
||||||
|
|
||||||
|
|
||||||
this->PostScreenMessage( SM_GoToNextScreen, this->GetTweenTimeLeft() );
|
this->PostScreenMessage( SM_GoToNextScreen, this->GetTweenTimeLeft() );
|
||||||
|
|
||||||
@@ -140,6 +133,11 @@ void ScreenStage::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
|
|
||||||
void ScreenStage::Update( float fDeltaTime )
|
void ScreenStage::Update( float fDeltaTime )
|
||||||
{
|
{
|
||||||
|
// The shared BGA isn't loaded until after the screen is showing. It is ready
|
||||||
|
// to access by the time of the first update.
|
||||||
|
if( IsFirstUpdate() )
|
||||||
|
this->PostScreenMessage( SM_PrepScreen, SCREENMAN->m_pSharedBGA->GetLengthSeconds() );
|
||||||
|
|
||||||
if( m_bZeroDeltaOnNextUpdate )
|
if( m_bZeroDeltaOnNextUpdate )
|
||||||
{
|
{
|
||||||
m_bZeroDeltaOnNextUpdate = false;
|
m_bZeroDeltaOnNextUpdate = false;
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Transition m_In, m_Out, m_Back;
|
Transition m_In, m_Out, m_Back;
|
||||||
BGAnimation m_Background;
|
|
||||||
BGAnimation m_Overlay; // overlays all elements except bitmaptexts
|
BGAnimation m_Overlay; // overlays all elements except bitmaptexts
|
||||||
Banner m_Banner;
|
Banner m_Banner;
|
||||||
BitmapText m_SongTitle;
|
BitmapText m_SongTitle;
|
||||||
|
|||||||
@@ -39,9 +39,6 @@ ScreenStyleSplash::ScreenStyleSplash( CString sName ) : ScreenWithMenuElements(
|
|||||||
iDifficulty = GAMESTATE->m_PreferredDifficulty[PLAYER_2];
|
iDifficulty = GAMESTATE->m_PreferredDifficulty[PLAYER_2];
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Background.LoadFromAniDir( THEME->GetPathToB(ssprintf("ScreenStyleSplash-%s-%s-%d",sGameName.c_str(),sStyleName.c_str(),iDifficulty) ) );
|
|
||||||
this->AddChild( &m_Background );
|
|
||||||
|
|
||||||
this->PostScreenMessage( SM_StartClosing, 2 );
|
this->PostScreenMessage( SM_StartClosing, 2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,6 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void MenuStart( PlayerNumber pn );
|
void MenuStart( PlayerNumber pn );
|
||||||
void MenuBack( PlayerNumber pn );
|
void MenuBack( PlayerNumber pn );
|
||||||
|
|
||||||
BGAnimation m_Background;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -29,9 +29,6 @@ ScreenWithMenuElements::ScreenWithMenuElements( CString sClassName ) : Screen( s
|
|||||||
|
|
||||||
this->SetName( sClassName );
|
this->SetName( sClassName );
|
||||||
|
|
||||||
m_Background.LoadFromAniDir( THEME->GetPathToB(m_sName+" background") );
|
|
||||||
this->AddChild( &m_Background );
|
|
||||||
|
|
||||||
m_autoHeader.Load( THEME->GetPathToG(m_sName+" header") );
|
m_autoHeader.Load( THEME->GetPathToG(m_sName+" header") );
|
||||||
m_autoHeader->SetName("Header");
|
m_autoHeader->SetName("Header");
|
||||||
UtilSetXY( m_autoHeader, m_sName );
|
UtilSetXY( m_autoHeader, m_sName );
|
||||||
@@ -140,7 +137,7 @@ void ScreenWithMenuElements::StartTransitioning( ScreenMessage smSendWhenDone )
|
|||||||
UtilOffCommand( m_autoFooter, m_sName );
|
UtilOffCommand( m_autoFooter, m_sName );
|
||||||
UtilOffCommand( m_textHelp, m_sName );
|
UtilOffCommand( m_textHelp, m_sName );
|
||||||
|
|
||||||
m_Background.PlayCommand("Off");
|
SCREENMAN->PlaySharedBackgroundOffCommand();
|
||||||
|
|
||||||
m_Out.StartTransitioning(smSendWhenDone);
|
m_Out.StartTransitioning(smSendWhenDone);
|
||||||
|
|
||||||
|
|||||||
@@ -27,8 +27,6 @@ public:
|
|||||||
void ResetTimer();
|
void ResetTimer();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
BGAnimation m_Background;
|
|
||||||
|
|
||||||
AutoActor m_autoHeader;
|
AutoActor m_autoHeader;
|
||||||
Sprite m_sprStyleIcon;
|
Sprite m_sprStyleIcon;
|
||||||
MemoryCardDisplay m_MemoryCardDisplay[NUM_PLAYERS];
|
MemoryCardDisplay m_MemoryCardDisplay[NUM_PLAYERS];
|
||||||
|
|||||||
Reference in New Issue
Block a user