diff options
author | Programerus <alcadeias95@gmail.com> | 2012-06-25 16:37:03 +0200 |
---|---|---|
committer | Programerus <alcadeias95@gmail.com> | 2012-06-25 16:37:03 +0200 |
commit | f58918031c001a0159eaf8f18d4e451e70089d30 (patch) | |
tree | 9b85fe09213b364d837fbd9aeefe3f63b9418f83 /src/graphics/common/planet.h | |
parent | 3478978c21ddc905ceb01f5ffc9c22bbf19bc288 (diff) | |
download | colobot-f58918031c001a0159eaf8f18d4e451e70089d30.tar.gz colobot-f58918031c001a0159eaf8f18d4e451e70089d30.tar.bz2 colobot-f58918031c001a0159eaf8f18d4e451e70089d30.zip |
Declarations for graphics/common
Diffstat (limited to 'src/graphics/common/planet.h')
-rw-r--r-- | src/graphics/common/planet.h | 56 |
1 files changed, 55 insertions, 1 deletions
diff --git a/src/graphics/common/planet.h b/src/graphics/common/planet.h index 537ca0b..2bf4d99 100644 --- a/src/graphics/common/planet.h +++ b/src/graphics/common/planet.h @@ -19,9 +19,63 @@ #pragma once +#include "common/struct.h" +#include "common/event.h" +#include "math/point.h" + + +class CInstanceManager; + namespace Gfx { -// TODO CPlanet +class CEngine; + + +const short MAXPLANET = 10; + +struct Planet +{ + char bUsed; // TRUE -> planet exists + Math::Point start; // initial position in degrees + Math::Point angle; // current position in degrees + float dim; // dimensions (0..1) + float speed; // speed + float dir; // direction in the sky + char name[20]; // name of the texture + Math::Point uv1, uv2; // texture mapping + char bTGA; // texture .TGA +}; + + + + +class CPlanet { +public: + CPlanet(CInstanceManager* iMan, CEngine* engine); + ~CPlanet(); + + void Flush(); + bool EventProcess(const Event &event); + bool Create(int mode, Math::Point start, float dim, float speed, float dir, char *name, Math::Point uv1, Math::Point uv2); + bool PlanetExist(); + void LoadTexture(); + void Draw(); + void SetMode(int mode); + int RetMode(); + +protected: + bool EventFrame(const Event &event); + +protected: + CInstanceManager* m_iMan; + CEngine* m_engine; + + float m_time; + int m_mode; + Planet m_planet[2][MAXPLANET]; + bool m_bPlanetExist; +}; + }; // namespace Gfx |