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