Colobot
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Pages
src
graphics
engine
planet.h
Go to the documentation of this file.
1
// * This file is part of the COLOBOT source code
2
// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
3
// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
4
// *
5
// * This program is free software: you can redistribute it and/or modify
6
// * it under the terms of the GNU General Public License as published by
7
// * the Free Software Foundation, either version 3 of the License, or
8
// * (at your option) any later version.
9
// *
10
// * This program is distributed in the hope that it will be useful,
11
// * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
// * GNU General Public License for more details.
14
// *
15
// * You should have received a copy of the GNU General Public License
16
// * along with this program. If not, see http://www.gnu.org/licenses/.
17
23
#pragma once
24
25
26
#include "
common/event.h
"
27
28
#include "
math/point.h
"
29
30
#include <vector>
31
32
33
34
// Graphics module namespace
35
namespace
Gfx {
36
37
class
CEngine;
38
43
struct
Planet
44
{
46
Math::Point
start
;
48
Math::Point
angle
;
50
float
dim
;
52
float
speed
;
54
float
dir
;
56
std::string
name
;
58
Math::Point
uv1
, uv2;
59
60
// TODO: make all textures transparent?
62
bool
transparent
;
63
64
Planet
()
65
{
66
dim
=
speed
=
dir
= 0.0f;
67
transparent
=
false
;
68
}
69
};
70
71
80
class
CPlanet
81
{
82
public
:
83
CPlanet
(
CEngine
* engine);
84
~
CPlanet
();
85
87
void
Flush
();
89
bool
EventProcess
(
const
Event
&event);
91
void
Create
(
int
mode,
Math::Point
start,
float
dim,
float
speed,
float
dir,
92
const
std::string& name,
Math::Point
uv1,
Math::Point
uv2,
93
bool
transparent);
95
bool
PlanetExist
();
97
void
LoadTexture
();
99
void
Draw
();
101
102
void
SetMode
(
int
mode);
103
int
GetMode();
105
106
protected
:
108
bool
EventFrame
(
const
Event
&event);
109
110
protected
:
111
CEngine
* m_engine;
112
113
float
m_time;
114
int
m_mode;
115
std::vector<Planet> m_planet[2];
116
bool
m_planetExist;
117
};
118
119
120
}
// namespace Gfx
121
Generated on Sat Jul 5 2014 09:25:03 for Colobot by
1.8.1.2