From f58918031c001a0159eaf8f18d4e451e70089d30 Mon Sep 17 00:00:00 2001 From: Programerus Date: Mon, 25 Jun 2012 16:37:03 +0200 Subject: Declarations for graphics/common --- src/graphics/common/planet.h | 56 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) (limited to 'src/graphics/common/planet.h') 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 -- cgit v1.2.3-1-g7c22