From 07fadbc8f530454863be82233a264e698e89b5cc Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 19 Mar 2003 19:56:27 +0000 Subject: [PATCH] add GetCommandLength --- stepmania/src/Actor.cpp | 11 +++++++++++ stepmania/src/Actor.h | 1 + 2 files changed, 12 insertions(+) diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index 411517973f..271a2dcf02 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -636,6 +636,17 @@ void Actor::Command( CString sCommandString ) } } +float Actor::GetCommandLength( CString command ) +{ + class NullActor: public Actor + { + void DrawPrimitives() { } + } temp; + + temp.Command(command); + return temp.GetTweenTimeLeft(); +} + float Actor::GetTweenTimeLeft() const { float tot = 0; diff --git a/stepmania/src/Actor.h b/stepmania/src/Actor.h index 23e9529f7f..96be1ee6b7 100644 --- a/stepmania/src/Actor.h +++ b/stepmania/src/Actor.h @@ -283,6 +283,7 @@ public: void FadeOff( float fSleepSeconds, CString sFadeString, float fFadeSeconds ) { Fade(fSleepSeconds,sFadeString,fFadeSeconds,true); }; void Command( CString sCommandString ); + static float GetCommandLength( CString command ); protected: