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