0ad/source/tools/atlas/GameInterface/View.h
Ykkrosh 6cfb96855a # Added initial play-testing support in the scenario editor.
Atlas: Added simulation play/pause/reset controls; automatically plays
while recording cinematics.
FFmpeg: Fixed broken output files.
MapReader: Fixed entity loading.
ObjectHandlers: Made unit preview more robust when the preview unit gets
destroyed.
Various: Replaced manual matrix construction with SetYRotation call.
Turned some more CStr8 back into CStr.
h_mgr: Optimisation - don't calculate slow debug-output strings if
they're never going to be seen (since it takes a few hundred
milliseconds).
TerrainRenderer: Made more tolerant of accidental negative times.
Entity: Fixed m_refd being out of date when deleteAll is called. Fixed
problems when doing an initializeAll...deleteAll...initializeAll
sequence.
SCN: Removed non-useful AoE3Ed code that never did anything.
SVNLog: Made output more valid and made titles more descriptive, so it
works properly in FF's live bookmarks.

This was SVN commit r4779.
2007-01-17 03:25:20 +00:00

95 lines
2.1 KiB
C++

#ifndef VIEW_H__
#define VIEW_H__
#include "graphics/Camera.h"
#include "Messages.h"
class CUnit;
class ViewGame;
class ViewActor;
class View
{
public:
virtual ~View();
virtual void Update(float UNUSED(frameLength)) { };
virtual void Render() { };
virtual CCamera& GetCamera() = 0;
virtual CUnit* GetUnit(AtlasMessage::ObjectID UNUSED(id)) { return NULL; }
virtual bool WantsHighFramerate() { return false; }
virtual void SetParam(const std::wstring& name, bool value);
virtual void SetParam(const std::wstring& name, const AtlasMessage::Colour& value);
// These always return a valid (not NULL) object
static View* GetView(int /*eRenderView*/ view);
static View* GetView_None();
static ViewGame* GetView_Game();
static ViewActor* GetView_Actor();
// Invalidates any View objects previously returned by this class
static void DestroyViews();
};
//////////////////////////////////////////////////////////////////////////
class ViewNone : public View
{
public:
virtual CCamera& GetCamera() { return dummyCamera; }
private:
CCamera dummyCamera;
};
struct SimState;
class ViewGame : public View
{
public:
ViewGame();
virtual ~ViewGame();
virtual void Update(float frameLength);
virtual void Render();
virtual CCamera& GetCamera();
virtual CUnit* GetUnit(AtlasMessage::ObjectID id);
virtual bool WantsHighFramerate();
void SetSpeedMultiplier(float speed);
void SaveState(const std::wstring& label, bool onlyEntities);
void RestoreState(const std::wstring& label);
private:
float m_SpeedMultiplier;
std::map<std::wstring, SimState*> m_SavedStates;
};
class ActorViewer;
class ViewActor : public View
{
public:
ViewActor();
~ViewActor();
virtual void Update(float frameLength);
virtual void Render();
virtual CCamera& GetCamera();
virtual CUnit* GetUnit(AtlasMessage::ObjectID id);
virtual bool WantsHighFramerate();
virtual void SetParam(const std::wstring& name, bool value);
virtual void SetParam(const std::wstring& name, const AtlasMessage::Colour& value);
void SetSpeedMultiplier(float speed);
ActorViewer& GetActorViewer();
private:
float m_SpeedMultiplier;
CCamera m_Camera;
ActorViewer* m_ActorViewer;
};
#endif // VIEW_H__