Use MapLog to keep track of the top screen. It's a bit buried in the crashinfo.txt, but still there.

This commit is contained in:
Steve Checkoway
2007-08-16 08:01:29 +00:00
parent a01bf41010
commit d12e579038
3 changed files with 9 additions and 20 deletions
+2 -9
View File
@@ -6,11 +6,6 @@
#include "Actor.h"
#include "RageTexture.h"
namespace StepMania
{
RString GetTopScreenName();
}
class XNode;
typedef Actor* (*CreateActorFn)();
@@ -51,8 +46,7 @@ namespace ActorUtil
inline void PlayCommand( Actor& actor, const RString &sCommandName ) { actor.PlayCommand( sCommandName ); }
inline void OnCommand( Actor& actor )
{
ASSERT_M( actor.HasCommand("On"), ssprintf("%s is missing an OnCommand. Top Screen is %s.",
actor.GetName().c_str(), StepMania::GetTopScreenName().c_str()) );
ASSERT_M( actor.HasCommand("On"), ssprintf("%s is missing an OnCommand.", actor.GetName().c_str()) );
actor.PlayCommand("On");
}
inline void OffCommand( Actor& actor )
@@ -63,8 +57,7 @@ namespace ActorUtil
// (Do "playcommand" anyway; BGAs often have no name.)
if( actor.GetName().empty() )
return;
ASSERT_M( actor.HasCommand("Off"), ssprintf("Actor %s is missing an OffCommand. Top Screen is %s.",
actor.GetName().c_str(), StepMania::GetTopScreenName().c_str()) );
ASSERT_M( actor.HasCommand("Off"), ssprintf("Actor %s is missing an OffCommand.", actor.GetName().c_str()) );
actor.PlayCommand("Off");
}
+7 -5
View File
@@ -116,6 +116,7 @@ namespace ScreenManagerUtil
void PushLoadedScreen( const LoadedScreen &ls )
{
LOG->Trace( "PushScreen: \"%s\"", ls.m_pScreen->GetName().c_str() );
LOG->MapLog( "ScreenManager::TopScreen", "Top Screen: %s", ls.m_pScreen->GetName().c_str() );
// Be sure to push the screen first, so GetTopScreen returns the screen
// during BeginScreen.
@@ -249,6 +250,7 @@ ScreenManager::ScreenManager()
ScreenManager::~ScreenManager()
{
LOG->Trace( "ScreenManager::~ScreenManager()" );
LOG->UnmapLog( "ScreenManager::TopScreen" );
SAFE_DELETE( g_pSharedBGA );
for( unsigned i=0; i<g_ScreenStack.size(); i++ )
@@ -366,6 +368,11 @@ ScreenMessage ScreenManager::PopTopScreenInternal( bool bSendLoseFocus )
}
}
if( g_ScreenStack.size() )
LOG->MapLog( "ScreenManager::TopScreen", "Top Screen: %s", g_ScreenStack.back().m_pScreen->GetName().c_str() );
else
LOG->UnmapLog( "ScreenManager::TopScreen" );
return ls.m_SendOnPop;
}
@@ -874,11 +881,6 @@ public:
LUA_REGISTER_CLASS( ScreenManager )
// lua end
RString StepMania::GetTopScreenName()
{
return SCREENMAN->GetTopScreen()->GetName();
}
/*
* (c) 2001-2003 Chris Danford, Glenn Maynard
* All rights reserved.
-6
View File
@@ -12,12 +12,6 @@ struct Menu;
struct lua_State;
class InputEventPlus;
// For debugging where you don't want to pull in ScreenManager.h.
namespace StepMania
{
RString GetTopScreenName();
}
class ScreenManager
{
public: