From cf381e0812cdfa97819813e731e0954c9028bdc7 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 15 Oct 2004 22:10:27 +0000 Subject: [PATCH] make the BGM time available to actors --- stepmania/src/Actor.cpp | 7 +------ stepmania/src/Actor.h | 8 +++++++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index 482a3c5503..3c128f6b38 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -8,7 +8,7 @@ #include "RageLog.h" #include "arch/Dialog/Dialog.h" -static float g_fCurrentBGMTime = 0; +float Actor::g_fCurrentBGMTime = 0; /* This is Reset instead of Init since many derived classes have Init() functions * that shouldn't change the position of the actor. */ @@ -59,11 +59,6 @@ Actor::Actor() m_bFirstUpdate = true; } -void Actor::SetBGMTime( float fTime ) -{ - g_fCurrentBGMTime = fTime; -} - void Actor::Draw() { if( m_bHidden ) diff --git a/stepmania/src/Actor.h b/stepmania/src/Actor.h index f2daa3f76c..5a339295ab 100644 --- a/stepmania/src/Actor.h +++ b/stepmania/src/Actor.h @@ -18,7 +18,8 @@ public: virtual ~Actor() {} virtual void Reset(); - static void SetBGMTime( float fTime ); + static void SetBGMTime( float fTime ) { g_fCurrentBGMTime = fTime; } + static float GetBGMTime() { return g_fCurrentBGMTime; } enum TweenType { TWEEN_LINEAR, @@ -391,6 +392,11 @@ protected: ZTestMode m_ZTestMode; bool m_bZWrite; CullMode m_CullMode; + + // + // global state + /// + static float g_fCurrentBGMTime; }; #endif