]> git.jsancho.org Git - lugaru.git/blob - Source/Globals.cpp
Move stats vars and award computation to Awards.cpp
[lugaru.git] / Source / Globals.cpp
1 /*
2 Copyright (C) 2003, 2010 - Wolfire Games
3
4 This file is part of Lugaru.
5
6 Lugaru is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; either version 2
9 of the License, or (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
14
15 See the GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
20 */
21
22 #include "SDL.h"
23
24 #include "gamegl.h"
25 #include "Quaternions.h"
26 #include "Lights.h"
27 #include "Skeleton.h"
28 #include "Terrain.h"
29 #include "Sprite.h"
30 #include "Frustum.h"
31 #include "Objects.h"
32 #include "Weapons.h"
33 #include "Person.h"
34 #include "TGALoader.h"
35 #include "openal_wrapper.h"
36 #include "Stereo.h"
37
38 #include "Constants.h"
39 #include "Animation.h"
40
41 bool visibleloading = 0;
42 int channels[100] = {0};
43
44 float volume = 0;
45 bool ismotionblur = 0;
46 float usermousesensitivity = 0;
47 bool floatjump = 0;
48 bool cellophane = 0;
49 bool autoslomo = 0;
50 bool decals = 0;
51 bool invertmouse = 0;
52 bool texttoggle = 0;
53 float blurness = 0;
54 float targetblurness = 0;
55 float windvar = 0;
56 float precipdelay = 0;
57 float gamespeed = 0;
58 float oldgamespeed = 0;
59 float tintr = 0,tintg = 0,tintb = 0;
60 int difficulty = 0;
61 float multiplier = 0;
62 float realmultiplier = 0;
63 float screenwidth = 0,screenheight = 0;
64 float viewdistance = 0;
65 XYZ viewer;
66 XYZ viewerfacing;
67 XYZ lightlocation;
68 float fadestart = 0;
69 int environment = 0;
70 float texscale = 0;
71 float gravity = 0;
72 Light light;
73 Animation animation[animation_count];
74 Skeleton testskeleton;
75 int numsounds = 0;
76 Terrain terrain;
77 float sps = 0;
78
79 SDL_Surface *sdlscreen;
80
81 int kTextureSize = 0;
82 int detail = 0;
83 FRUSTUM frustum;
84 float texdetail = 0;
85 float realtexdetail = 0;
86 float terraindetail = 0;
87 float playerdist = 0;
88 Objects objects;
89 int slomo = 0;
90 float slomodelay = 0;
91 GLubyte bloodText[512*512*3] = {0};
92 GLubyte wolfbloodText[512*512*3] = {0};
93 float colors[3] = {0};
94 int bloodtoggle = 0;
95 bool osx = 0;
96 float camerashake = 0;
97 float woozy = 0;
98 float blackout = 0;
99 bool foliage = 0;
100 bool musictoggle = 0;
101 bool trilinear;
102 Weapons weapons;
103 bool damageeffects = 0;
104 //apvector<Person> player(maxplayers);
105 Person player[maxplayers];
106 int numplayers = 0;
107 bool ambientsound = 0;
108 bool mousejump = 0;
109 bool freeze = 0;
110 bool winfreeze = 0;
111 float flashamount = 0,flashr = 0,flashg = 0,flashb = 0;
112 int flashdelay = 0;
113 bool vblsync = 0;
114 float motionbluramount = 0;
115 bool keyboardfrozen = 0;
116 char mapname[256] = {0};
117 bool loadingstuff = 0;
118 bool stillloading = 0;
119 bool showpoints = 0;
120 bool showdamagebar = 0;
121 bool alwaysblur = 0;
122 bool immediate = 0;
123 bool velocityblur = 0;
124 int test = 0;
125 XYZ windvector;
126 short vRefNum = 0;
127 long dirID = 0;
128 int mainmenu = 0;
129 int oldmainmenu = 0;
130 GLubyte texturearray[512*512*3] = {0};
131 int loadscreencolor = 0;
132 int whichjointstartarray[26] = {0};
133 int whichjointendarray[26] = {0};
134 int kBitsPerPixel = 0;
135
136 int numhotspots = 0;
137 XYZ hotspot[40];
138 int hotspottype[40] = {0};
139 float hotspotsize[40] = {0};
140 char hotspottext[40][256] = {0};
141 int currenthotspot = 0; 
142 int winhotspot = 0;
143 int windialogue = 0;
144 int killhotspot = 0;
145
146 float menupulse = 0;
147
148 int numdialogues = 0;
149 int numdialogueboxes[max_dialogues] = {0};
150 int dialoguetype[max_dialogues] = {0};
151 int dialogueboxlocation[max_dialogues][max_dialoguelength] = {0};
152 float dialogueboxcolor[max_dialogues][max_dialoguelength][3] = {0};
153 int dialogueboxsound[max_dialogues][max_dialoguelength] = {0};
154 char dialoguetext[max_dialogues][max_dialoguelength][128] = {0};
155 char dialoguename[max_dialogues][max_dialoguelength][64] = {0};
156 XYZ dialoguecamera[max_dialogues][max_dialoguelength]; //l = {0};
157 XYZ participantlocation[max_dialogues][10]; // = {0};
158 int participantfocus[max_dialogues][max_dialoguelength] = {0};
159 int participantaction[max_dialogues][max_dialoguelength] = {0};
160 float participantrotation[max_dialogues][10] = {0};
161 XYZ participantfacing[max_dialogues][max_dialoguelength][10]; // = {0};
162 float dialoguecamerarotation[max_dialogues][max_dialoguelength] = {0};
163 float dialoguecamerarotation2[max_dialogues][max_dialoguelength] = {0};
164 int indialogue = 0;
165 int whichdialogue = 0;
166 int directing = 0;
167 float dialoguetime = 0;
168 int dialoguegonethrough[20] = {0};
169
170 float smoketex = 0;
171
172 float slomospeed = 0;
173 float slomofreq = 0;
174
175 int tutoriallevel = 0;
176 int tutorialstage = 0;
177 float tutorialstagetime = 0;
178 float tutorialmaxtime = 0;
179 float tutorialsuccess = 0;
180
181 bool againbonus = 0;
182
183 float damagedealt = 0;
184
185 int maptype = 0;
186
187 int editoractive = 0;
188 int editorpathtype = 0;
189
190 bool reversaltrain = 0;
191 bool cananger = 0;
192 bool canattack = 0;
193
194 bool skyboxtexture = 0;
195 float skyboxr = 0;
196 float skyboxg = 0;
197 float skyboxb = 0;
198 float skyboxlightr = 0;
199 float skyboxlightg = 0;
200 float skyboxlightb = 0;
201
202 float bonusnum[100] = {0};
203
204 int hostile = 0;
205 float hostiletime = 0;
206
207 XYZ envsound[30]; // = {0};
208 float envsoundvol[30] = {0};
209 float envsoundlife[30] = {0};
210 int numenvsounds;
211
212
213 bool tilt2weird = 0;
214 bool tiltweird = 0;
215 bool midweird = 0;
216 bool proportionweird = 0;
217 bool vertexweird[6] = {0};
218 TGAImageRec texture;
219 bool debugmode = 0;
220
221 int oldbonus = 0;
222 int bonus = 0;
223 float bonusvalue = 0;
224 float bonustotal = 0;
225 float startbonustotal = 0;
226 float bonustime = 0;
227
228 bool won = 0;
229
230
231 bool campaign = 0;
232
233 bool gamestarted = 0;
234
235 //TextureList textures;
236
237 StereoMode stereomode =  stereoNone;
238 StereoMode newstereomode = stereoNone;
239 float stereoseparation = 0.05;
240 bool  stereoreverse = false;