]> git.jsancho.org Git - lugaru.git/blob - Source/Globals.cpp
Got rid of global texture var. Calling load_image directly
[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 float tintr = 0, tintg = 0, tintb = 0;
57 int difficulty = 0;
58 float multiplier = 0;
59 float realmultiplier = 0;
60 float screenwidth = 0, screenheight = 0;
61 bool fullscreen = 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 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];
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 bool debugmode = false;
182
183
184 bool campaign = false;
185
186 bool gamestarted = false;
187
188 StereoMode stereomode =  stereoNone;
189 StereoMode newstereomode = stereoNone;
190 float stereoseparation = 0.05;
191 bool  stereoreverse = false;