forked from JACoders/OpenJK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcg_media.h
414 lines (336 loc) · 9.33 KB
/
cg_media.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
/*
===========================================================================
Copyright (C) 1999 - 2005, Id Software, Inc.
Copyright (C) 2000 - 2013, Raven Software, Inc.
Copyright (C) 2001 - 2013, Activision, Inc.
Copyright (C) 2013 - 2015, OpenJK contributors
This file is part of the OpenJK source code.
OpenJK is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>.
===========================================================================
*/
#ifndef __CG_MEDIA_H_
#define __CG_MEDIA_H_
#include "../qcommon/q_shared.h"
#include "../rd-common/tr_types.h"
#include "../cgame/cg_local.h"
#include "g_shared.h"
#define NUM_CROSSHAIRS 9
typedef enum {
FOOTSTEP_STONEWALK,
FOOTSTEP_STONERUN,
FOOTSTEP_METALWALK,
FOOTSTEP_METALRUN,
FOOTSTEP_PIPEWALK,
FOOTSTEP_PIPERUN,
FOOTSTEP_SPLASH,
FOOTSTEP_WADE,
FOOTSTEP_SWIM,
FOOTSTEP_SNOWWALK,
FOOTSTEP_SNOWRUN,
FOOTSTEP_SANDWALK,
FOOTSTEP_SANDRUN,
FOOTSTEP_GRASSWALK,
FOOTSTEP_GRASSRUN,
FOOTSTEP_DIRTWALK,
FOOTSTEP_DIRTRUN,
FOOTSTEP_MUDWALK,
FOOTSTEP_MUDRUN,
FOOTSTEP_GRAVELWALK,
FOOTSTEP_GRAVELRUN,
FOOTSTEP_RUGWALK,
FOOTSTEP_RUGRUN,
FOOTSTEP_WOODWALK,
FOOTSTEP_WOODRUN,
FOOTSTEP_TOTAL
} footstep_t;
#define ICON_WEAPONS 0
#define ICON_FORCE 1
#define ICON_INVENTORY 2
#define MAX_HUD_TICS 4
typedef struct HUDMenuItem_s
{
const char *menuName;
const char *itemName;
int xPos;
int yPos;
int width;
int height;
vec4_t color;
qhandle_t background;
} HUDMenuItem_t;
extern HUDMenuItem_t healthTics[];
extern HUDMenuItem_t armorTics[];
extern HUDMenuItem_t ammoTics[];
extern HUDMenuItem_t forceTics[];
extern HUDMenuItem_t otherHUDBits[];
typedef enum
{
OHB_HEALTHAMOUNT = 0,
OHB_ARMORAMOUNT,
OHB_FORCEAMOUNT,
OHB_AMMOAMOUNT,
OHB_SABERSTYLE_STRONG,
OHB_SABERSTYLE_MEDIUM,
OHB_SABERSTYLE_FAST,
OHB_SCANLINE_LEFT,
OHB_SCANLINE_RIGHT,
OHB_FRAME_LEFT,
OHB_FRAME_RIGHT,
OHB_MAX
} otherhudbits_t;
#define NUM_CHUNK_MODELS 4
enum
{
CHUNK_METAL1 = 0,
CHUNK_METAL2,
CHUNK_ROCK1,
CHUNK_ROCK2,
CHUNK_ROCK3,
CHUNK_CRATE1,
CHUNK_CRATE2,
CHUNK_WHITE_METAL,
NUM_CHUNK_TYPES
};
// all of the model, shader, and sound references that are
// loaded at gamestate time are stored in cgMedia_t
// Other media that can be tied to clients, weapons, or items are
// stored in the clientInfo_t, itemInfo_t, weaponInfo_t, and powerupInfo_t
typedef struct {
qhandle_t charsetShader;
qhandle_t whiteShader;
qhandle_t crosshairShader[NUM_CROSSHAIRS];
qhandle_t backTileShader;
// qhandle_t noammoShader;
qhandle_t numberShaders[11];
qhandle_t smallnumberShaders[11];
qhandle_t chunkyNumberShaders[11];
qhandle_t loadTick;
qhandle_t loadTickCap;
// HUD artwork
int currentBackground;
qhandle_t weaponbox;
qhandle_t weaponIconBackground;
qhandle_t forceIconBackground;
qhandle_t inventoryIconBackground;
qhandle_t turretComputerOverlayShader;
qhandle_t turretCrossHairShader;
//Chunks
qhandle_t chunkModels[NUM_CHUNK_TYPES][4];
sfxHandle_t chunkSound;
sfxHandle_t grateSound;
sfxHandle_t rockBreakSound;
sfxHandle_t rockBounceSound[2];
sfxHandle_t metalBounceSound[2];
sfxHandle_t glassChunkSound;
sfxHandle_t crateBreakSound[2];
// Saber shaders
//-----------------------------
qhandle_t forceCoronaShader;
qhandle_t saberBlurShader;
qhandle_t swordTrailShader;
qhandle_t yellowDroppedSaberShader; // glow
qhandle_t redSaberGlowShader;
qhandle_t redSaberCoreShader;
qhandle_t orangeSaberGlowShader;
qhandle_t orangeSaberCoreShader;
qhandle_t yellowSaberGlowShader;
qhandle_t yellowSaberCoreShader;
qhandle_t greenSaberGlowShader;
qhandle_t greenSaberCoreShader;
qhandle_t blueSaberGlowShader;
qhandle_t blueSaberCoreShader;
qhandle_t purpleSaberGlowShader;
qhandle_t purpleSaberCoreShader;
qhandle_t explosionModel;
qhandle_t surfaceExplosionShader;
qhandle_t halfShieldModel;
qhandle_t solidWhiteShader;
qhandle_t electricBodyShader;
qhandle_t electricBody2Shader;
qhandle_t refractShader;
qhandle_t boltShader;
// Disruptor zoom graphics
qhandle_t disruptorMask;
qhandle_t disruptorInsert;
qhandle_t disruptorLight;
qhandle_t disruptorInsertTick;
// Binocular graphics
qhandle_t binocularCircle;
qhandle_t binocularMask;
qhandle_t binocularArrow;
qhandle_t binocularTri;
qhandle_t binocularStatic;
qhandle_t binocularOverlay;
// LA Goggles graphics
qhandle_t laGogglesStatic;
qhandle_t laGogglesMask;
qhandle_t laGogglesSideBit;
qhandle_t laGogglesBracket;
qhandle_t laGogglesArrow;
// wall mark shaders
qhandle_t scavMarkShader;
qhandle_t rivetMarkShader;
qhandle_t shadowMarkShader;
qhandle_t wakeMarkShader;
qhandle_t fsrMarkShader;
qhandle_t fslMarkShader;
qhandle_t fshrMarkShader;
qhandle_t fshlMarkShader;
qhandle_t damageBlendBlobShader;
// fonts...
//
qhandle_t qhFontSmall;
qhandle_t qhFontMedium;
// special effects models / etc.
qhandle_t personalShieldShader;
qhandle_t cloakedShader;
// Interface media
qhandle_t ammoslider;
qhandle_t emplacedHealthBarShader;
qhandle_t dataPadFrame;
qhandle_t DPForcePowerOverlay;
qhandle_t bdecal_burnmark1;
qhandle_t bdecal_saberglowmark;
qhandle_t messageLitOn;
qhandle_t messageLitOff;
qhandle_t messageObjCircle;
qhandle_t batteryChargeShader;
qhandle_t useableHint;
qhandle_t levelLoad;
//new stuff for Jedi Academy
//force power icons
// qhandle_t forcePowerIcons[NUM_FORCE_POWERS];
qhandle_t rageRecShader;
qhandle_t playerShieldDamage;
qhandle_t forceSightBubble;
qhandle_t forceShell;
qhandle_t sightShell;
qhandle_t drainShader;
// sounds
sfxHandle_t disintegrateSound;
sfxHandle_t disintegrate2Sound;
sfxHandle_t grenadeBounce1;
sfxHandle_t grenadeBounce2;
sfxHandle_t flechetteStickSound;
sfxHandle_t detPackStickSound;
sfxHandle_t tripMineStickSound;
sfxHandle_t selectSound;
sfxHandle_t selectSound2;
sfxHandle_t overchargeSlowSound;
sfxHandle_t overchargeFastSound;
sfxHandle_t overchargeLoopSound;
sfxHandle_t overchargeEndSound;
// sfxHandle_t useNothingSound;
sfxHandle_t footsteps[FOOTSTEP_TOTAL][4];
// sfxHandle_t talkSound;
sfxHandle_t noAmmoSound;
sfxHandle_t landSound;
sfxHandle_t rollSound;
sfxHandle_t messageLitSound;
sfxHandle_t batteryChargeSound;
sfxHandle_t watrInSound;
sfxHandle_t watrOutSound;
sfxHandle_t watrUnSound;
sfxHandle_t lavaInSound;
sfxHandle_t lavaOutSound;
sfxHandle_t lavaUnSound;
sfxHandle_t noforceSound;
// Zoom
sfxHandle_t zoomStart;
sfxHandle_t zoomLoop;
sfxHandle_t zoomEnd;
sfxHandle_t disruptorZoomLoop;
//new stuff for Jedi Academy
sfxHandle_t drainSound;
} cgMedia_t;
// Stored FX handles
//--------------------
typedef struct
{
// BRYAR PISTOL
fxHandle_t bryarShotEffect;
fxHandle_t bryarPowerupShotEffect;
fxHandle_t bryarWallImpactEffect;
fxHandle_t bryarWallImpactEffect2;
fxHandle_t bryarWallImpactEffect3;
fxHandle_t bryarFleshImpactEffect;
// BLASTER
fxHandle_t blasterShotEffect;
fxHandle_t blasterOverchargeEffect;
fxHandle_t blasterWallImpactEffect;
fxHandle_t blasterFleshImpactEffect;
// BOWCASTER
fxHandle_t bowcasterShotEffect;
fxHandle_t bowcasterBounceEffect;
fxHandle_t bowcasterImpactEffect;
// FLECHETTE
fxHandle_t flechetteShotEffect;
fxHandle_t flechetteAltShotEffect;
fxHandle_t flechetteShotDeathEffect;
fxHandle_t flechetteFleshImpactEffect;
fxHandle_t flechetteRicochetEffect;
//FORCE
fxHandle_t forceConfusion;
fxHandle_t forceLightning;
fxHandle_t forceLightningWide;
//fxHandle_t forceInvincibility;
fxHandle_t forceHeal;
//new stuff for Jedi Academy
fxHandle_t forceDrain;
fxHandle_t forceDrainWide;
fxHandle_t forceDrained;
//footstep effects
fxHandle_t footstepMud;
fxHandle_t footstepSand;
fxHandle_t footstepSnow;
fxHandle_t footstepGravel;
//landing effects
fxHandle_t landingMud;
fxHandle_t landingSand;
fxHandle_t landingDirt;
fxHandle_t landingSnow;
fxHandle_t landingGravel;
} cgEffects_t;
// The client game static (cgs) structure hold everything
// loaded or calculated from the gamestate. It will NOT
// be cleared when a tournement restart is done, allowing
// all clients to begin playing instantly
#define STRIPED_LEVELNAME_VARIATIONS 3 // sigh, to cope with levels that use text from >1 SP file (plus 1 for common)
typedef struct {
gameState_t gameState; // gamestate from server
glconfig_t glconfig; // rendering configuration
int serverCommandSequence; // reliable command stream counter
// parsed from serverinfo
int dmflags;
int teamflags;
int timelimit;
int maxclients;
char mapname[MAX_QPATH];
char stripLevelName[STRIPED_LEVELNAME_VARIATIONS][MAX_QPATH];
//
// locally derived information from gamestate
//
qhandle_t model_draw[MAX_MODELS];
sfxHandle_t sound_precache[MAX_SOUNDS];
// Ghoul2 start
qhandle_t skins[MAX_CHARSKINS];
// Ghoul2 end
int numInlineModels;
qhandle_t inlineDrawModel[MAX_SUBMODELS];
vec3_t inlineModelMidpoints[MAX_SUBMODELS];
clientInfo_t clientinfo[MAX_CLIENTS];
// media
cgMedia_t media;
// effects
cgEffects_t effects;
} cgs_t;
extern cgs_t cgs;
#endif //__CG_MEDIA_H_