Debugging.
This commit is contained in:
+14
-2
@@ -14,6 +14,7 @@
|
||||
#include "LightsManager.h" // for NUM_CabinetLight
|
||||
#include "ActorUtil.h"
|
||||
#include "Preference.h"
|
||||
#include <typeinfo>
|
||||
|
||||
static Preference<bool> g_bShowMasks("ShowMasks", false);
|
||||
|
||||
@@ -694,6 +695,16 @@ void Actor::UpdateInternal( float fDeltaTime )
|
||||
UpdateTweening( fDeltaTime );
|
||||
}
|
||||
|
||||
RString Actor::GetLineage() const
|
||||
{
|
||||
RString sPath;
|
||||
|
||||
if( m_pParent )
|
||||
sPath = m_pParent->GetLineage() + '/';
|
||||
sPath += ssprintf( "<%s> %s", typeid(*this).name(), m_sName.c_str() );
|
||||
return sPath;
|
||||
}
|
||||
|
||||
void Actor::BeginTweening( float time, ITween *pTween )
|
||||
{
|
||||
ASSERT( time >= 0 );
|
||||
@@ -704,7 +715,8 @@ void Actor::BeginTweening( float time, ITween *pTween )
|
||||
// recursing ActorCommand.
|
||||
if( m_Tweens.size() > 50 )
|
||||
{
|
||||
RString sError = ssprintf( "Tween overflow: name = \"%s\"; infinitely recursing ActorCommand?", this->m_sName.c_str() );
|
||||
RString sError = ssprintf( "Tween overflow: \"%s\"; infinitely recursing ActorCommand?", GetLineage().c_str() );
|
||||
|
||||
LOG->Warn( sError );
|
||||
Dialog::OK( sError );
|
||||
FinishTweening();
|
||||
@@ -1156,7 +1168,7 @@ void Actor::AddCommand( const RString &sCmdName, apActorCommands apac )
|
||||
{
|
||||
if( HasCommand(sCmdName) )
|
||||
{
|
||||
RString sWarning = m_sName+"'s command '"+sCmdName+"' defined twice";
|
||||
RString sWarning = GetLineage()+"'s command '"+sCmdName+"' defined twice";
|
||||
Dialog::OK( sWarning, "COMMAND_DEFINED_TWICE" );
|
||||
}
|
||||
|
||||
|
||||
@@ -123,6 +123,7 @@ public:
|
||||
virtual void SetName( const RString &sName ) { m_sName = sName; }
|
||||
void SetParent( Actor *pParent );
|
||||
Actor *GetParent() { return m_pParent; }
|
||||
RString GetLineage() const;
|
||||
|
||||
float GetX() const { return m_current.pos.x; };
|
||||
float GetY() const { return m_current.pos.y; };
|
||||
|
||||
@@ -127,7 +127,7 @@ void ActorFrame::AddChild( Actor *pActor )
|
||||
// check that this Actor isn't already added.
|
||||
vector<Actor*>::iterator iter = find( m_SubActors.begin(), m_SubActors.end(), pActor );
|
||||
if( iter != m_SubActors.end() )
|
||||
Dialog::OK( ssprintf("Actor \"%s\" adds child \"%s\" more than once", GetName().c_str(), pActor->GetName().c_str()) );
|
||||
Dialog::OK( ssprintf("Actor \"%s\" adds child \"%s\" more than once", GetLineage().c_str(), pActor->GetName().c_str()) );
|
||||
#endif
|
||||
|
||||
ASSERT( pActor );
|
||||
|
||||
Reference in New Issue
Block a user