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.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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; i<m_ScreenStack.size(); i++ )
|
||||
m_ScreenStack[i]->Restore();
|
||||
m_SystemLayer->Restore();
|
||||
}
|
||||
|
||||
void ScreenManager::Invalidate()
|
||||
{
|
||||
for( unsigned i=0; i<m_ScreenStack.size(); i++ )
|
||||
m_ScreenStack[i]->Invalidate();
|
||||
m_SystemLayer->Invalidate();
|
||||
}
|
||||
|
||||
void ScreenManager::Draw()
|
||||
{
|
||||
if(g_TopNeedsNeedsNullUpdate)
|
||||
|
||||
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user