]> git.jsancho.org Git - lugaru.git/blob - Source/Globals.cpp
License: Update GPLv2+ header to match current FSF recommendation
[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 modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 Lugaru 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.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #include "SDL.h"
21
22 #include "gamegl.h"
23 #include "Quaternions.h"
24 #include "Lights.h"
25 #include "Skeleton.h"
26 #include "Terrain.h"
27 #include "Sprite.h"
28 #include "Frustum.h"
29 #include "Objects.h"
30 #include "Weapons.h"
31 #include "Person.h"
32 #include "TGALoader.h"
33 #include "openal_wrapper.h"
34 #include "Stereo.h"
35
36 #include "Animation.h"
37
38 bool visibleloading = 0;
39
40 float volume = 0;
41 bool ismotionblur = false;
42 float usermousesensitivity = 0;
43 bool floatjump = false;
44 bool cellophane = false;
45 bool autoslomo = false;
46 bool decals = false;
47 bool invertmouse = false;
48 bool texttoggle = false;
49 float blurness = 0;
50 float targetblurness = 0;
51 float windvar = 0;
52 float precipdelay = 0;
53 float gamespeed = 0;
54 float oldgamespeed = 0;
55 float tintr = 0, tintg = 0, tintb = 0;
56 int difficulty = 0;
57 float multiplier = 0;
58 float realmultiplier = 0;
59 float screenwidth = 0, screenheight = 0;
60 bool fullscreen = 0;
61 float viewdistance = 0;
62 XYZ viewer;
63 XYZ viewerfacing;
64 XYZ lightlocation;
65 float fadestart = 0;
66 int environment = 0;
67 float texscale = 0;
68 float gravity = 0;
69 Light light;
70 Animation animation[animation_count];
71 Skeleton testskeleton;
72 int numsounds = 0;
73 Terrain terrain;
74 float sps = 0;
75
76 SDL_Window *sdlwindow;
77
78 int kTextureSize = 0;
79 int detail = 0;
80 FRUSTUM frustum;
81 float texdetail = 0;
82 float realtexdetail = 0;
83 float playerdist = 0;
84 Objects objects;
85 int slomo = 0;
86 float slomodelay = 0;
87 GLubyte bloodText[512 * 512 * 3] = {0};
88 GLubyte wolfbloodText[512 * 512 * 3] = {0};
89 float colors[3] = {0};
90 int bloodtoggle = 0;
91 bool osx = false;
92 float camerashake = 0;
93 float woozy = 0;
94 float blackout = 0;
95 bool foliage = false;
96 bool musictoggle = false;
97 bool trilinear;
98 Weapons weapons;
99 bool damageeffects = false;
100 bool ambientsound = false;
101 bool mousejump = false;
102 bool freeze = false;
103 bool winfreeze = false;
104 float flashamount = 0, flashr = 0, flashg = 0, flashb = 0;
105 int flashdelay = 0;
106 bool vblsync = false;
107 float motionbluramount = 0;
108 bool keyboardfrozen = false;
109 bool loadingstuff = false;
110 bool stillloading = false;
111 bool showpoints = false;
112 bool showdamagebar = false;
113 bool alwaysblur = false;
114 bool immediate = false;
115 bool velocityblur = false;
116 int test = 0;
117 XYZ windvector;
118 short vRefNum = 0;
119 long dirID = 0;
120 int mainmenu = 0;
121 int whichjointstartarray[26] = {0};
122 int whichjointendarray[26] = {0};
123 int kBitsPerPixel = 0;
124
125 int numhotspots = 0;
126 XYZ hotspot[40];
127 int hotspottype[40] = {0};
128 float hotspotsize[40] = {0};
129 char hotspottext[40][256] = {0};
130 int currenthotspot = 0;
131 int killhotspot = 0;
132
133 float menupulse = 0;
134
135 float smoketex = 0;
136
137 float slomospeed = 0;
138 float slomofreq = 0;
139
140 int tutoriallevel = 0;
141 int tutorialstage = 0;
142 float tutorialstagetime = 0;
143 float tutorialmaxtime = 0;
144 float tutorialsuccess = 0;
145
146 bool againbonus = false;
147
148 float damagedealt = 0;
149
150 int maptype = 0;
151
152 int editoractive = 0;
153 int editorpathtype = 0;
154
155 bool reversaltrain = false;
156 bool cananger = false;
157 bool canattack = false;
158
159 bool skyboxtexture = false;
160 float skyboxr = 0;
161 float skyboxg = 0;
162 float skyboxb = 0;
163 float skyboxlightr = 0;
164 float skyboxlightg = 0;
165 float skyboxlightb = 0;
166
167 int hostile = 0;
168 float hostiletime = 0;
169
170 XYZ envsound[30]; // = {0};
171 float envsoundvol[30] = {0};
172 float envsoundlife[30] = {0};
173 int numenvsounds;
174
175
176 bool tilt2weird = false;
177 bool tiltweird = false;
178 bool midweird = false;
179 bool proportionweird = false;
180 bool vertexweird[6] = {0};
181 TGAImageRec texture;
182 bool debugmode = false;
183
184
185 bool campaign = false;
186
187 bool gamestarted = false;
188
189 //TextureList textures;
190
191 StereoMode stereomode =  stereoNone;
192 StereoMode newstereomode = stereoNone;
193 float stereoseparation = 0.05;
194 bool  stereoreverse = false;