]> git.jsancho.org Git - lugaru.git/blob - Source/Globals.cpp
Seems there were a few things I forgot when I removed FMod. Should be about it
[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 #if USE_SDL
23 #include "SDL.h"
24 #endif
25
26 #include "gamegl.h"
27 #include "Quaternions.h"
28 #include "Lights.h"
29 #include "Skeleton.h"
30 #include "Terrain.h"
31 #include "Sprites.h"
32 #include "Frustum.h"
33 #include "Objects.h"
34 #include "Weapons.h"
35 #include "Person.h"
36 #include "TGALoader.h"
37 #include "openal_wrapper.h"
38
39 #include "Constants.h"
40
41 bool visibleloading = 0;
42 OPENAL_SAMPLE   *samp[100] = {0};
43 OPENAL_STREAM * strm[20] = {0};
44 int channels[100] = {0};
45
46 float volume = 0;bool buttons[3] = {0};
47 bool oldbuttons[3] = {0};
48 bool ismotionblur = 0;
49 float usermousesensitivity = 0;
50 bool floatjump = 0;
51 bool cellophane = 0;
52 bool autoslomo = 0;
53 bool decals = 0;
54 bool invertmouse = 0;
55 bool texttoggle = 0;
56 float blurness = 0;
57 float targetblurness = 0;
58 float windvar = 0;
59 float precipdelay = 0;
60 float gamespeed = 0;
61 float oldgamespeed = 0;
62 float tintr = 0,tintg = 0,tintb = 0;
63 int difficulty = 0;
64 float multiplier = 0;
65 float realmultiplier = 0;
66 float screenwidth = 0,screenheight = 0;
67 float viewdistance = 0;
68 XYZ viewer;
69 XYZ viewerfacing;
70 XYZ lightlocation;
71 float fadestart = 0;
72 int environment = 0;
73 float texscale = 0;
74 float gravity = 0;
75 Light light;
76 Animation animation[animation_count];
77 Skeleton testskeleton;
78 int numsounds = 0;
79 Terrain terrain;
80 Sprites sprites;
81 float sps = 0;
82 #ifdef WIN32
83 HDC hDC;
84 #elif USE_SDL
85 SDL_Surface *sdlscreen;
86 #elif PLATFORM_MACOSX
87 AGLContext gaglContext;
88 #else
89 #error Define your platform.
90 #endif
91 int kTextureSize = 0;
92 int detail = 0;
93 FRUSTUM frustum;
94 float texdetail = 0;
95 float realtexdetail = 0;
96 float terraindetail = 0;
97 float playerdist = 0;
98 Objects objects;
99 int slomo = 0;
100 float slomodelay = 0;
101 GLubyte bloodText[512*512*3] = {0};
102 GLubyte wolfbloodText[512*512*3] = {0};
103 float colors[3] = {0};
104 int bloodtoggle = 0;
105 bool osx = 0;
106 float camerashake = 0;
107 float woozy = 0;
108 float blackout = 0;
109 bool foliage = 0;
110 bool musictoggle = 0;
111 bool trilinear;
112 Weapons weapons;
113 bool damageeffects = 0;
114 //apvector<Person> player(maxplayers);
115 Person player[maxplayers];
116 int numplayers = 0;
117 bool ambientsound = 0;
118 bool mousejump = 0;
119 bool freeze = 0;
120 bool winfreeze = 0;
121 float flashamount = 0,flashr = 0,flashg = 0,flashb = 0;
122 int flashdelay = 0;
123 bool vblsync = 0;
124 float motionbluramount = 0;
125 bool keyboardfrozen = 0;
126 int newnetmessages = 0;
127 char netmessages[256] = {0};
128 char mapname[256] = {0};
129 bool loadingstuff = 0;
130 bool stillloading = 0;
131 bool showpoints = 0;
132 bool alwaysblur = 0;
133 bool immediate = 0;
134 bool velocityblur = 0;
135 int test = 0;
136 XYZ windvector;
137 short vRefNum = 0;
138 long dirID = 0;
139 int mainmenu = 0;
140 int oldmainmenu = 0;
141 GLubyte texturearray[512*512*3] = {0};
142 int loadscreencolor = 0;
143 int whichjointstartarray[26] = {0};
144 int whichjointendarray[26] = {0};
145 int kBitsPerPixel = 0;
146
147 int numhotspots = 0;
148 XYZ hotspot[40];
149 int hotspottype[40] = {0};
150 float hotspotsize[40] = {0};
151 char hotspottext[40][256] = {0};
152 int currenthotspot = 0; 
153 int winhotspot = 0;
154 int windialogue = 0;
155 int killhotspot = 0;
156
157 float menupulse = 0;
158
159 int numdialogues = 0;
160 int numdialogueboxes[max_dialogues] = {0};
161 int dialoguetype[max_dialogues] = {0};
162 int dialogueboxlocation[max_dialogues][max_dialoguelength] = {0};
163 float dialogueboxcolor[max_dialogues][max_dialoguelength][3] = {0};
164 int dialogueboxsound[max_dialogues][max_dialoguelength] = {0};
165 char dialoguetext[max_dialogues][max_dialoguelength][128] = {0};
166 char dialoguename[max_dialogues][max_dialoguelength][64] = {0};
167 XYZ dialoguecamera[max_dialogues][max_dialoguelength]; //l = {0};
168 XYZ participantlocation[max_dialogues][10]; // = {0};
169 int participantfocus[max_dialogues][max_dialoguelength] = {0};
170 int participantaction[max_dialogues][max_dialoguelength] = {0};
171 float participantrotation[max_dialogues][10] = {0};
172 XYZ participantfacing[max_dialogues][max_dialoguelength][10]; // = {0};
173 float dialoguecamerarotation[max_dialogues][max_dialoguelength] = {0};
174 float dialoguecamerarotation2[max_dialogues][max_dialoguelength] = {0};
175 int indialogue = 0;
176 int whichdialogue = 0;
177 int directing = 0;
178 float dialoguetime = 0;
179 int dialoguegonethrough[20] = {0};
180
181 float smoketex = 0;
182
183 float slomospeed = 0;
184 float slomofreq = 0;
185
186 int tutoriallevel = 0;
187 int tutorialstage = 0;
188 float tutorialstagetime = 0;
189 float tutorialmaxtime = 0;
190 float tutorialsuccess = 0;
191
192 bool againbonus = 0;
193
194 float damagedealt = 0;
195 float damagetaken = 0;
196
197 int maptype = 0;
198
199 int editoractive = 0;
200 int editorpathtype = 0;
201
202 bool reversaltrain = 0;
203 bool cananger = 0;
204 bool canattack = 0;
205
206 bool skyboxtexture = 0;
207 float skyboxr = 0;
208 float skyboxg = 0;
209 float skyboxb = 0;
210 float skyboxlightr = 0;
211 float skyboxlightg = 0;
212 float skyboxlightb = 0;
213
214 float bonusnum[100] = {0};
215
216 int hostile = 0;
217 float hostiletime = 0;
218
219 XYZ envsound[30]; // = {0};
220 float envsoundvol[30] = {0};
221 float envsoundlife[30] = {0};
222 int numenvsounds;
223
224
225 bool tilt2weird = 0;
226 bool tiltweird = 0;
227 bool midweird = 0;
228 bool proportionweird = 0;
229 bool vertexweird[6] = {0};
230 TGAImageRec texture;
231 bool debugmode = 0;
232
233 int oldbonus = 0;
234 int bonus = 0;
235 float bonusvalue = 0;
236 float bonustotal = 0;
237 float startbonustotal = 0;
238 float bonustime = 0;
239
240 int numaccounts = 0;
241 int accountactive = 0;
242 int accountdifficulty[10] = {0};
243 int accountprogress[10] = {0};
244 float accountpoints[10] = {0};
245 float accounthighscore[10][50] = {0};
246 float accountfasttime[10][50] = {0};
247 bool accountunlocked[10][60] = {0};
248 char accountname[10][256] = {0};
249 float accountcampaignhighscore[10] = {0};
250 float accountcampaignfasttime[10] = {0};
251 float accountcampaignscore[10] = {0};
252 float accountcampaigntime[10] = {0};
253 int accountcampaignchoicesmade[10] = {0};int accountcampaignchoices[10][5000] = {0};
254 bool won = 0;
255
256
257 bool campaign = 0;
258
259 int numfalls = 0;
260 int numflipfail = 0;
261 int numseen = 0;
262 int numresponded = 0;
263 int numstaffattack = 0;
264 int numswordattack = 0;
265 int numknifeattack = 0;
266 int numunarmedattack = 0;
267 int numescaped = 0;
268 int numflipped = 0;
269 int numwallflipped = 0;
270 int numthrowkill = 0;
271 int numafterkill = 0;
272 int numreversals = 0;
273 int numattacks = 0;
274 int maxalarmed = 0;
275
276 bool gamestarted = 0;
277
278 //TextureList textures;
279