From 2e8654909af35400dcb93b8d473971af1293c73f Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 28 Mar 2003 00:49:01 +0000 Subject: [PATCH] Remove Invalidate and Restore from Actor, Screen and ScreenManager. They don't do anything, and they're never called; I think they're D3D hangovers. Don't make Actor::DrawPrimitives pure virtual. It's useful to make Actors that don't draw anything, and only receive updates, to modularize functionality, such as TimingTip. This also makes Actor::GetCommandLength somewhat less of a heinous hack. --- stepmania/src/Actor.cpp | 7 ++----- stepmania/src/Actor.h | 10 +++------- stepmania/src/Screen.h | 4 ---- stepmania/src/ScreenManager.cpp | 17 ++--------------- stepmania/src/ScreenManager.h | 4 ---- 5 files changed, 7 insertions(+), 35 deletions(-) diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index c9482c0aa6..b4af66b225 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -671,12 +671,9 @@ void Actor::Command( CString sCommandString ) float Actor::GetCommandLength( CString command ) { - class NullActor: public Actor - { - void DrawPrimitives() { } - } temp; - + Actor temp; temp.Command(command); + return temp.GetTweenTimeLeft(); } diff --git a/stepmania/src/Actor.h b/stepmania/src/Actor.h index 20682f784a..3a6c30dbdc 100644 --- a/stepmania/src/Actor.h +++ b/stepmania/src/Actor.h @@ -67,20 +67,16 @@ public: }; // let subclasses override - - /* Do subclasses really need to override tweening? Tween data should - * probably be private ... - glenn */ - virtual void Restore() {}; - virtual void Invalidate() {}; - virtual void Draw(); // calls, BeginDraw, DrawPrimitives, EndDraw virtual void BeginDraw(); // pushes transform onto world matrix stack - virtual void DrawPrimitives() = 0; // override with Actor specific action + virtual void DrawPrimitives() {} // override with Actor specific action virtual void EndDraw(); // pops transform from world matrix stack bool IsFirstUpdate(); virtual void Update( float fDeltaTime ); virtual void UpdateTweening( float fDeltaTime ); + /* Do subclasses really need to override tweening? Tween data should + * probably be private ... - glenn */ /* Return the current coordinates, not the destination coordinates; * that's what the old behavior was, at least, and it's what ScreenMusicScroll * expects. I could see uses for knowing the destination coords, though, diff --git a/stepmania/src/Screen.h b/stepmania/src/Screen.h index 1e32d28093..ffa8a23a6d 100644 --- a/stepmania/src/Screen.h +++ b/stepmania/src/Screen.h @@ -27,10 +27,6 @@ public: virtual void AddChild( Actor* pActor ); - // let subclass override if they want - virtual void Restore() {}; - virtual void Invalidate() {}; - virtual void Update( float fDeltaTime ); virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ); static bool ChangeCoinModeInput( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ); // return true if CoinMode changed diff --git a/stepmania/src/ScreenManager.cpp b/stepmania/src/ScreenManager.cpp index f07edba76b..bcc9deee6d 100644 --- a/stepmania/src/ScreenManager.cpp +++ b/stepmania/src/ScreenManager.cpp @@ -25,6 +25,8 @@ #include "Screen.h" #include "SongManager.h" +#include "BitmapText.h" +#include "Quad.h" ScreenManager* SCREENMAN = NULL; // global and accessable from anywhere in our program @@ -333,21 +335,6 @@ void ScreenManager::Update( float fDeltaTime ) } -void ScreenManager::Restore() -{ - // Restore all CurrentScreens (back to front) - for( unsigned i=0; iRestore(); - m_SystemLayer->Restore(); -} - -void ScreenManager::Invalidate() -{ - for( unsigned i=0; iInvalidate(); - m_SystemLayer->Invalidate(); -} - void ScreenManager::Draw() { if(g_TopNeedsNeedsNullUpdate) diff --git a/stepmania/src/ScreenManager.h b/stepmania/src/ScreenManager.h index 55095c1bfa..43fb641222 100644 --- a/stepmania/src/ScreenManager.h +++ b/stepmania/src/ScreenManager.h @@ -14,8 +14,6 @@ #include "RageInputDevice.h" -#include "BitmapText.h" -#include "Quad.h" #include "ScreenMessage.h" #include "InputFilter.h" #include "GameInput.h" @@ -33,8 +31,6 @@ public: ~ScreenManager(); // pass these messages along to the current state - void Restore(); - void Invalidate(); void Update( float fDeltaTime ); void Draw(); void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI );