]> git.jsancho.org Git - lugaru.git/blob - Source/Globals.cpp
Moved clothes loop to Person, got rid of globals tintr,tintg,tintb
[lugaru.git] / Source / Globals.cpp
1 /*
2 Copyright (C) 2003, 2010 - Wolfire Games
3 Copyright (C) 2010-2016 - Lugaru contributors (see AUTHORS file)
4
5 This file is part of Lugaru.
6
7 Lugaru is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 Lugaru is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #include "SDL.h"
22
23 #include "gamegl.h"
24 #include "Quaternions.h"
25 #include "Lights.h"
26 #include "Skeleton.h"
27 #include "Terrain.h"
28 #include "Sprite.h"
29 #include "Frustum.h"
30 #include "Objects.h"
31 #include "Weapons.h"
32 #include "Person.h"
33 #include "ImageIO.h"
34 #include "openal_wrapper.h"
35 #include "Stereo.h"
36
37 #include "Animation.h"
38
39 bool visibleloading = 0;
40
41 float volume = 0;
42 bool ismotionblur = false;
43 float usermousesensitivity = 0;
44 bool floatjump = false;
45 bool cellophane = false;
46 bool autoslomo = false;
47 bool decals = false;
48 bool invertmouse = false;
49 bool texttoggle = false;
50 float blurness = 0;
51 float targetblurness = 0;
52 float windvar = 0;
53 float precipdelay = 0;
54 float gamespeed = 0;
55 float oldgamespeed = 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 float camerashake = 0;
92 float woozy = 0;
93 float blackout = 0;
94 bool foliage = false;
95 bool musictoggle = false;
96 bool trilinear;
97 Weapons weapons;
98 bool damageeffects = false;
99 bool ambientsound = false;
100 bool mousejump = false;
101 bool freeze = false;
102 bool winfreeze = false;
103 float flashamount = 0, flashr = 0, flashg = 0, flashb = 0;
104 int flashdelay = 0;
105 bool vblsync = false;
106 float motionbluramount = 0;
107 bool keyboardfrozen = false;
108 bool loadingstuff = false;
109 bool stillloading = false;
110 bool showpoints = false;
111 bool showdamagebar = false;
112 bool alwaysblur = false;
113 bool immediate = false;
114 bool velocityblur = false;
115 int test = 0;
116 XYZ windvector;
117 short vRefNum = 0;
118 long dirID = 0;
119 int mainmenu = 0;
120 int whichjointstartarray[26] = {0};
121 int whichjointendarray[26] = {0};
122 int kBitsPerPixel = 0;
123
124 int numhotspots = 0;
125 XYZ hotspot[40];
126 int hotspottype[40] = {0};
127 float hotspotsize[40] = {0};
128 char hotspottext[40][256] = {0};
129 int currenthotspot = 0;
130 int killhotspot = 0;
131
132 float menupulse = 0;
133
134 float smoketex = 0;
135
136 float slomospeed = 0;
137 float slomofreq = 0;
138
139 int tutoriallevel = 0;
140 int tutorialstage = 0;
141 float tutorialstagetime = 0;
142 float tutorialmaxtime = 0;
143 float tutorialsuccess = 0;
144
145 bool againbonus = false;
146
147 float damagedealt = 0;
148
149 int maptype = 0;
150
151 int editoractive = 0;
152 int editorpathtype = 0;
153
154 bool reversaltrain = false;
155 bool cananger = false;
156 bool canattack = false;
157
158 bool skyboxtexture = false;
159 float skyboxr = 0;
160 float skyboxg = 0;
161 float skyboxb = 0;
162 float skyboxlightr = 0;
163 float skyboxlightg = 0;
164 float skyboxlightb = 0;
165
166 int hostile = 0;
167 float hostiletime = 0;
168
169 XYZ envsound[30];
170 float envsoundvol[30] = {0};
171 float envsoundlife[30] = {0};
172 int numenvsounds;
173
174
175 bool tilt2weird = false;
176 bool tiltweird = false;
177 bool midweird = false;
178 bool proportionweird = false;
179 bool vertexweird[6] = {0};
180 bool debugmode = false;
181
182
183 bool campaign = false;
184
185 bool gamestarted = false;
186
187 StereoMode stereomode =  stereoNone;
188 StereoMode newstereomode = stereoNone;
189 float stereoseparation = 0.05;
190 bool  stereoreverse = false;