-
Notifications
You must be signed in to change notification settings - Fork 2
/
env.h
95 lines (79 loc) · 1.95 KB
/
env.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/* --------------------------------------------------------------------
EXTREME TUXRACER
Copyright (C) 1999-2001 Jasmin F. Patry (Tuxracer)
Copyright (C) 2010 Extreme Tuxracer Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
---------------------------------------------------------------------*/
#ifndef ENV_H
#define ENV_H
#include "bh.h"
#define MAX_LOCATIONS 32
typedef struct {
string name;
} TLocInfo;
typedef struct {
string name;
} TLightCond;
typedef struct {
bool is_on;
GLint mode;
float start;
float end;
float height;
float color[4];
float part_color[4];
} TFog;
typedef struct {
bool is_on;
float ambient[4];
float diffuse[4];
float specular[4];
float position[4];
} TLight;
class CEnvironment {
private:
int EnvID;
GLuint Skybox[6];
TLocInfo locs [MAX_LOCATIONS];
int numLocs;
TLightCond lightcond[4];
TLight default_light;
TLight lights[4];
TFog fog;
TFog default_fog;
TPlane leftclip;
TPlane rightclip;
TPlane farclip;
TPlane bottomclip;
string EnvIndex;
string LightIndex;
void ResetSkybox ();
void LoadSkybox ();
void ResetLight ();
void LoadLight ();
void ResetFog ();
string EnvDir;
void Reset ();
string GetDir (int location, int light);
public:
CEnvironment ();
~CEnvironment ();
bool LoadEnvironmentList ();
bool LoadEnvironment (int loc, int light);
void DrawSkybox (TVector3 pos);
void SetupLight ();
void SetupFog ();
void DrawFog ();
TColor ParticleColor ();
int GetEnvIdx (const string tag);
int GetLightIdx (const string tag);
};
extern CEnvironment Env;
#endif