]> git.jsancho.org Git - lugaru.git/blob - Source/Globals.cpp
Merge branch 'sdl2-rebase' into 'master'
[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 "Animation.h"
39
40 bool visibleloading = 0;
41
42 float volume = 0;
43 bool ismotionblur = false;
44 float usermousesensitivity = 0;
45 bool floatjump = false;
46 bool cellophane = false;
47 bool autoslomo = false;
48 bool decals = false;
49 bool invertmouse = false;
50 bool texttoggle = false;
51 float blurness = 0;
52 float targetblurness = 0;
53 float windvar = 0;
54 float precipdelay = 0;
55 float gamespeed = 0;
56 float oldgamespeed = 0;
57 float tintr = 0, tintg = 0, tintb = 0;
58 int difficulty = 0;
59 float multiplier = 0;
60 float realmultiplier = 0;
61 float screenwidth = 0, screenheight = 0;
62 float viewdistance = 0;
63 XYZ viewer;
64 XYZ viewerfacing;
65 XYZ lightlocation;
66 float fadestart = 0;
67 int environment = 0;
68 float texscale = 0;
69 float gravity = 0;
70 Light light;
71 Animation animation[animation_count];
72 Skeleton testskeleton;
73 int numsounds = 0;
74 Terrain terrain;
75 float sps = 0;
76
77 SDL_Window *sdlwindow;
78
79 int kTextureSize = 0;
80 int detail = 0;
81 FRUSTUM frustum;
82 float texdetail = 0;
83 float realtexdetail = 0;
84 float playerdist = 0;
85 Objects objects;
86 int slomo = 0;
87 float slomodelay = 0;
88 GLubyte bloodText[512 * 512 * 3] = {0};
89 GLubyte wolfbloodText[512 * 512 * 3] = {0};
90 float colors[3] = {0};
91 int bloodtoggle = 0;
92 bool osx = false;
93 float camerashake = 0;
94 float woozy = 0;
95 float blackout = 0;
96 bool foliage = false;
97 bool musictoggle = false;
98 bool trilinear;
99 Weapons weapons;
100 bool damageeffects = false;
101 bool ambientsound = false;
102 bool mousejump = false;
103 bool freeze = false;
104 bool winfreeze = false;
105 float flashamount = 0, flashr = 0, flashg = 0, flashb = 0;
106 int flashdelay = 0;
107 bool vblsync = false;
108 float motionbluramount = 0;
109 bool keyboardfrozen = false;
110 bool loadingstuff = false;
111 bool stillloading = false;
112 bool showpoints = false;
113 bool showdamagebar = false;
114 bool alwaysblur = false;
115 bool immediate = false;
116 bool velocityblur = false;
117 int test = 0;
118 XYZ windvector;
119 short vRefNum = 0;
120 long dirID = 0;
121 int mainmenu = 0;
122 int whichjointstartarray[26] = {0};
123 int whichjointendarray[26] = {0};
124 int kBitsPerPixel = 0;
125
126 int numhotspots = 0;
127 XYZ hotspot[40];
128 int hotspottype[40] = {0};
129 float hotspotsize[40] = {0};
130 char hotspottext[40][256] = {0};
131 int currenthotspot = 0;
132 int killhotspot = 0;
133
134 float menupulse = 0;
135
136 float smoketex = 0;
137
138 float slomospeed = 0;
139 float slomofreq = 0;
140
141 int tutoriallevel = 0;
142 int tutorialstage = 0;
143 float tutorialstagetime = 0;
144 float tutorialmaxtime = 0;
145 float tutorialsuccess = 0;
146
147 bool againbonus = false;
148
149 float damagedealt = 0;
150
151 int maptype = 0;
152
153 int editoractive = 0;
154 int editorpathtype = 0;
155
156 bool reversaltrain = false;
157 bool cananger = false;
158 bool canattack = false;
159
160 bool skyboxtexture = false;
161 float skyboxr = 0;
162 float skyboxg = 0;
163 float skyboxb = 0;
164 float skyboxlightr = 0;
165 float skyboxlightg = 0;
166 float skyboxlightb = 0;
167
168 int hostile = 0;
169 float hostiletime = 0;
170
171 XYZ envsound[30]; // = {0};
172 float envsoundvol[30] = {0};
173 float envsoundlife[30] = {0};
174 int numenvsounds;
175
176
177 bool tilt2weird = false;
178 bool tiltweird = false;
179 bool midweird = false;
180 bool proportionweird = false;
181 bool vertexweird[6] = {0};
182 TGAImageRec texture;
183 bool debugmode = false;
184
185
186 bool campaign = false;
187
188 bool gamestarted = false;
189
190 //TextureList textures;
191
192 StereoMode stereomode =  stereoNone;
193 StereoMode newstereomode = stereoNone;
194 float stereoseparation = 0.05;
195 bool  stereoreverse = false;