From e332565c9df78784cc593937258b317ccf738fd4 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Wed, 15 Aug 2007 06:18:19 +0000 Subject: [PATCH] Better debugging messages so we can see which actor on which screen is missing the command. --- stepmania/src/ActorUtil.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/stepmania/src/ActorUtil.h b/stepmania/src/ActorUtil.h index 907f8f6d1f..6b9f580304 100644 --- a/stepmania/src/ActorUtil.h +++ b/stepmania/src/ActorUtil.h @@ -6,6 +6,11 @@ #include "Actor.h" #include "RageTexture.h" +namespace StepMania +{ + RString GetTopScreenName(); +} + class XNode; typedef Actor* (*CreateActorFn)(); @@ -46,7 +51,8 @@ namespace ActorUtil inline void PlayCommand( Actor& actor, const RString &sCommandName ) { actor.PlayCommand( sCommandName ); } inline void OnCommand( Actor& actor ) { - ASSERT( actor.HasCommand("On") ); + ASSERT_M( actor.HasCommand("On"), ssprintf("%s is missing an OnCommand. Top Screen is %s.", + actor.GetName().c_str(), StepMania::GetTopScreenName().c_str()) ); actor.PlayCommand("On"); } inline void OffCommand( Actor& actor ) @@ -57,7 +63,8 @@ namespace ActorUtil // (Do "playcommand" anyway; BGAs often have no name.) if( actor.GetName().empty() ) return; - ASSERT( actor.HasCommand("Off") ); + ASSERT_M( actor.HasCommand("Off"), ssprintf("Actor %s is missing an OffCommand. Top Screen is %s.", + actor.GetName().c_str(), StepMania::GetTopScreenName().c_str()) ); actor.PlayCommand("Off"); }