1 /* 2 Copyright (C) 1997-2001 Id Software, Inc. 3 4 This program is free software; you can redistribute it and/or 5 modify it under the terms of the GNU General Public License 6 as published by the Free Software Foundation; either version 2 7 of the License, or (at your option) any later version. 8 9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 13 See the GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program; if not, write to the Free Software 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 */ 19 20 // 21 // cg_media.h 22 // 23 24 /* 25 ============================================================================= 26 27 CGAME MEDIA 28 29 ============================================================================= 30 */ 31 32 // surface-specific step sounds 33 typedef struct cgStepMedia_s { 34 struct sfx_s *standard[4]; 35 36 struct sfx_s *concrete[4]; 37 struct sfx_s *dirt[4]; 38 struct sfx_s *duct[4]; 39 struct sfx_s *grass[4]; 40 struct sfx_s *gravel[4]; 41 struct sfx_s *metal[4]; 42 struct sfx_s *metalGrate[4]; 43 struct sfx_s *metalLadder[4]; 44 struct sfx_s *mud[4]; 45 struct sfx_s *sand[4]; 46 struct sfx_s *slosh[4]; 47 struct sfx_s *snow[6]; 48 struct sfx_s *tile[4]; 49 struct sfx_s *wade[4]; 50 struct sfx_s *wood[4]; 51 struct sfx_s *woodPanel[4]; 52 } cgStepMedia_t; 53 54 // muzzle flash sounds 55 typedef struct cgMzMedia_s { 56 struct sfx_s *bfgFireSfx; 57 struct sfx_s *blasterFireSfx; 58 struct sfx_s *etfRifleFireSfx; 59 struct sfx_s *grenadeFireSfx; 60 struct sfx_s *grenadeReloadSfx; 61 struct sfx_s *hyperBlasterFireSfx; 62 struct sfx_s *ionRipperFireSfx; 63 struct sfx_s *machineGunSfx[5]; 64 struct sfx_s *phalanxFireSfx; 65 struct sfx_s *railgunFireSfx; 66 struct sfx_s *railgunReloadSfx; 67 struct sfx_s *rocketFireSfx; 68 struct sfx_s *rocketReloadSfx; 69 struct sfx_s *shotgunFireSfx; 70 struct sfx_s *shotgun2FireSfx; 71 struct sfx_s *shotgunReloadSfx; 72 struct sfx_s *superShotgunFireSfx; 73 struct sfx_s *trackerFireSfx; 74 } cgMzMedia_t; 75 76 // monster muzzle flash sounds 77 typedef struct cgMz2Media_s { 78 struct sfx_s *chicRocketSfx; 79 struct sfx_s *floatBlasterSfx; 80 struct sfx_s *flyerBlasterSfx; 81 struct sfx_s *gunnerGrenadeSfx; 82 struct sfx_s *gunnerMachGunSfx; 83 struct sfx_s *hoverBlasterSfx; 84 struct sfx_s *jorgMachGunSfx; 85 struct sfx_s *machGunSfx; 86 struct sfx_s *makronBlasterSfx; 87 struct sfx_s *medicBlasterSfx; 88 struct sfx_s *soldierBlasterSfx; 89 struct sfx_s *soldierMachGunSfx; 90 struct sfx_s *soldierShotgunSfx; 91 struct sfx_s *superTankRocketSfx; 92 struct sfx_s *tankBlasterSfx; 93 struct sfx_s *tankMachGunSfx[5]; 94 struct sfx_s *tankRocketSfx; 95 } cgMz2Media_t; 96 97 // all sounds 98 typedef struct cgMediaSounds_s { 99 cgStepMedia_t steps; 100 cgMzMedia_t mz; 101 cgMz2Media_t mz2; 102 103 struct sfx_s *ricochet[3]; 104 struct sfx_s *spark[7]; 105 106 struct sfx_s *disruptExplo; 107 struct sfx_s *grenadeExplo; 108 struct sfx_s *rocketExplo; 109 struct sfx_s *waterExplo; 110 111 struct sfx_s *gib; 112 struct sfx_s *gibSplat[3]; 113 114 struct sfx_s *itemRespawn; 115 struct sfx_s *laserHit; 116 struct sfx_s *lightning; 117 118 struct sfx_s *playerFall; 119 struct sfx_s *playerFallShort; 120 struct sfx_s *playerFallFar; 121 122 struct sfx_s *playerTeleport; 123 struct sfx_s *bigTeleport; 124 125 struct sfx_s *mgShell[2]; 126 struct sfx_s *sgShell[2]; 127 } cgMediaSounds_t; 128 129 // ========================================================================== 130 131 typedef struct cgMedia_s { 132 qBool initialized; 133 qBool loadScreenPrepped; 134 135 // fonts 136 struct font_s *defaultFont; 137 138 // engine generated textures 139 struct shader_s *noTexture; 140 struct shader_s *whiteTexture; 141 struct shader_s *blackTexture; 142 143 // console 144 struct shader_s *consoleShader; 145 146 // load screen images 147 struct shader_s *loadSplash; 148 struct shader_s *loadBarPos; 149 struct shader_s *loadBarNeg; 150 struct shader_s *loadNoMapShot; 151 struct shader_s *loadMapShot; 152 153 // screen shaders 154 struct shader_s *alienInfraredVision; 155 struct shader_s *infraredGoggles; 156 157 // sounds 158 cgMediaSounds_t sfx; 159 160 // models 161 struct refModel_s *parasiteSegmentModel; 162 struct refModel_s *grappleCableModel; 163 struct refModel_s *powerScreenModel; 164 165 struct refModel_s *brassMGModel; 166 struct refModel_s *brassSGModel; 167 168 struct refModel_s *lightningModel; 169 struct refModel_s *heatBeamModel; 170 struct refModel_s *monsterHeatBeamModel; 171 172 struct refModel_s *maleDisguiseModel; 173 struct refModel_s *femaleDisguiseModel; 174 struct refModel_s *cyborgDisguiseModel; 175 176 // skins 177 struct shader_s *maleDisguiseSkin; 178 struct shader_s *femaleDisguiseSkin; 179 struct shader_s *cyborgDisguiseSkin; 180 181 struct shader_s *modelShellGod; 182 struct shader_s *modelShellHalfDam; 183 struct shader_s *modelShellDouble; 184 struct shader_s *modelShellRed; 185 struct shader_s *modelShellGreen; 186 struct shader_s *modelShellBlue; 187 188 // images 189 struct shader_s *crosshairShader; 190 191 struct shader_s *tileBackShader; 192 193 struct shader_s *hudFieldShader; 194 struct shader_s *hudInventoryShader; 195 struct shader_s *hudNetShader; 196 struct shader_s *hudNumShaders[2][11]; 197 struct shader_s *hudPausedShader; 198 199 // particle/decal media 200 struct shader_s *decalTable[DT_PICTOTAL]; 201 struct shader_s *particleTable[PT_PICTOTAL]; 202 } cgMedia_t; 203 204 extern cgMedia_t cgMedia; 205 206 /* 207 ============================================================================= 208 209 UI MEDIA 210 211 ============================================================================= 212 */ 213 214 // sounds 215 typedef struct uiSoundMedia_s { 216 struct sfx_s *menuIn; 217 struct sfx_s *menuMove; 218 struct sfx_s *menuOut; 219 } uiSoundMedia_t; 220 221 // menu banners 222 typedef struct uiBannerMedia_s { 223 struct shader_s *addressBook; 224 struct shader_s *multiplayer; 225 struct shader_s *startServer; 226 struct shader_s *joinServer; 227 struct shader_s *options; 228 struct shader_s *game; 229 struct shader_s *loadGame; 230 struct shader_s *saveGame; 231 struct shader_s *video; 232 struct shader_s *quit; 233 } uiBannerMedia_t; 234 235 // menu media 236 #define MAINMENU_CURSOR_NUMFRAMES 15 237 typedef struct uiMenuMedia_s { 238 struct shader_s *mainCursors[MAINMENU_CURSOR_NUMFRAMES]; 239 struct shader_s *mainPlaque; 240 struct shader_s *mainLogo; 241 242 struct shader_s *mainGame; 243 struct shader_s *mainMultiplayer; 244 struct shader_s *mainOptions; 245 struct shader_s *mainVideo; 246 struct shader_s *mainQuit; 247 248 struct shader_s *mainGameSel; 249 struct shader_s *mainMultiplayerSel; 250 struct shader_s *mainOptionsSel; 251 struct shader_s *mainVideoSel; 252 struct shader_s *mainQuitSel; 253 } uiMenuMedia_t; 254 255 // ========================================================================== 256 257 typedef struct uiMedia_s { 258 // sounds 259 uiSoundMedia_t sounds; 260 261 // background images 262 struct shader_s *bgBig; 263 264 // cursor images 265 struct shader_s *cursorShader; 266 struct shader_s *cursorHoverShader; 267 268 // menu items 269 uiBannerMedia_t banners; 270 uiMenuMedia_t menus; 271 } uiMedia_t; 272 273 extern uiMedia_t uiMedia; 274 275 // ========================================================================== 276 277 // 278 // cg_media.c 279 // 280 281 void CG_CacheGloomMedia (void); 282 void CG_InitBaseMedia (void); 283 void CG_MapInit (void); 284 void CG_ShutdownMap (void); 285 286 void CG_SoundMediaInit (void); 287 void CG_CrosshairShaderInit (void); 288