1 // Emacs style mode select -*- C++ -*- 2 //----------------------------------------------------------------------------- 3 // 4 // $Id:$ 5 // 6 // Copyright (C) 1993-1996 by id Software, Inc. 7 // 8 // This source is available for distribution and/or modification 9 // only under the terms of the DOOM Source Code License as 10 // published by id Software. All rights reserved. 11 // 12 // The source is distributed in the hope that it will be useful, 13 // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 // FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License 15 // for more details. 16 // 17 // DESCRIPTION: 18 // All the global variables that store the internal state. 19 // Theoretically speaking, the internal state of the engine 20 // should be found by looking at the variables collected 21 // here, and every relevant module will have to include 22 // this header file. 23 // In practice, things are a bit messy. 24 // 25 //----------------------------------------------------------------------------- 26 27 28 #ifndef __D_STATE__ 29 #define __D_STATE__ 30 31 #include "c_cvars.h" 32 33 // ----------------------- 34 // Game speed. 35 // 36 enum EGameSpeed 37 { 38 SPEED_Normal, 39 SPEED_Fast, 40 }; 41 extern EGameSpeed GameSpeed; 42 43 44 // ------------------------ 45 // Command line parameters. 46 // 47 extern bool devparm; // DEBUG: launched with -devparm 48 49 50 51 // ----------------------------------------------------- 52 // Game Mode - identify IWAD as shareware, retail etc. 53 // 54 // ------------------------------------------- 55 // Selected skill type, map etc. 56 // 57 58 extern FString startmap; // [RH] Actual map name now 59 60 extern bool autostart; 61 62 extern FString StoredWarp; // [RH] +warp at the command line 63 64 // Selected by user. 65 EXTERN_CVAR (Int, gameskill); 66 extern int NextSkill; // [RH] Skill to use at next level load 67 68 // Netgame? Only true if >1 player. 69 extern bool netgame; 70 71 // Bot game? Like netgame, but doesn't involve network communication. 72 extern bool multiplayer; 73 74 // Flag: true only if started as net deathmatch. 75 EXTERN_CVAR (Int, deathmatch) 76 77 // [RH] Pretend as deathmatch for purposes of dmflags 78 EXTERN_CVAR (Bool, alwaysapplydmflags) 79 80 // [RH] Teamplay mode 81 EXTERN_CVAR (Bool, teamplay) 82 83 // [RH] Friendly fire amount 84 EXTERN_CVAR (Float, teamdamage) 85 86 // [RH] The class the player will spawn as in single player, 87 // in case using a random class with Hexen. 88 extern int SinglePlayerClass[/*MAXPLAYERS*/]; 89 90 // ------------------------- 91 // Internal parameters for sound rendering. 92 93 EXTERN_CVAR (Float, snd_sfxvolume) // maximum volume for sound 94 EXTERN_CVAR (Float, snd_musicvolume) // maximum volume for music 95 96 97 // ------------------------- 98 // Status flags for refresh. 99 // 100 101 enum EMenuState 102 { 103 MENU_Off, // Menu is closed 104 MENU_On, // Menu is opened 105 MENU_WaitKey, // Menu is opened and waiting for a key in the controls menu 106 MENU_OnNoPause, // Menu is opened but does not pause the game 107 }; 108 109 extern bool automapactive; // In AutoMap mode? 110 extern EMenuState menuactive; // Menu overlayed? 111 extern int paused; // Game Pause? 112 extern bool pauseext; 113 114 115 extern bool viewactive; 116 117 extern bool nodrawers; 118 extern bool noblit; 119 120 extern int viewwindowx; 121 extern int viewwindowy; 122 extern "C" int viewheight; 123 extern "C" int viewwidth; 124 extern "C" int halfviewwidth; // [RH] Half view width, for plane drawing 125 126 127 128 129 130 // Player taking events. i.e. The local player. 131 extern int consoleplayer; 132 133 134 // -------------------------------------- 135 // DEMO playback/recording related stuff. 136 // No demo, there is a human player in charge? 137 // Disable save/end game? 138 extern bool usergame; 139 140 extern FString newdemoname; 141 extern FString newdemomap; 142 extern bool demoplayback; 143 extern bool demorecording; 144 extern int demover; 145 146 // Quit after playing a demo from cmdline. 147 extern bool singledemo; 148 149 extern int SaveVersion; 150 151 152 153 154 //----------------------------- 155 // Internal parameters, fixed. 156 // These are set by the engine, and not changed 157 // according to user inputs. Partly load from 158 // WAD, partly set at startup time. 159 160 161 162 extern int gametic; 163 164 165 // Alive? Disconnected? 166 extern bool playeringame[/*MAXPLAYERS*/]; 167 168 169 //----------------------------------------- 170 // Internal parameters, used for engine. 171 // 172 173 // File handling stuff. 174 extern FILE* debugfile; 175 extern FILE* hashfile; 176 177 // if true, load all graphics at level load 178 extern bool precache; 179 180 181 //------- 182 //REFRESH 183 //------- 184 185 extern bool setsizeneeded; 186 extern bool setmodeneeded; 187 188 extern int BorderNeedRefresh; 189 extern int BorderTopRefresh; 190 191 192 EXTERN_CVAR (Float, mouse_sensitivity) 193 //? 194 // debug flag to cancel adaptiveness 195 extern bool singletics; 196 197 extern int bodyqueslot; 198 199 200 201 // Needed to store the number of the dummy sky flat. 202 // Used for rendering, 203 // as well as tracking projectiles etc. 204 205 206 207 // ---- [RH] ---- 208 EXTERN_CVAR (Bool, developer) 209 210 extern bool ToggleFullscreen; 211 212 extern int Net_Arbitrator; 213 214 EXTERN_CVAR (Bool, var_friction) 215 EXTERN_CVAR (Bool, var_pushers) 216 217 218 // [RH] Miscellaneous info for DeHackEd support 219 struct DehInfo 220 { 221 int StartHealth; 222 int StartBullets; 223 int MaxHealth; 224 int MaxArmor; 225 int GreenAC; 226 int BlueAC; 227 int MaxSoulsphere; 228 int SoulsphereHealth; 229 int MegasphereHealth; 230 int GodHealth; 231 int FAArmor; 232 int FAAC; 233 int KFAArmor; 234 int KFAAC; 235 char PlayerSprite[5]; 236 BYTE ExplosionStyle; 237 fixed_t ExplosionAlpha; 238 int NoAutofreeze; 239 int BFGCells; 240 }; 241 extern DehInfo deh; 242 EXTERN_CVAR (Int, infighting) 243 244 // [RH] Deathmatch flags 245 246 EXTERN_CVAR (Int, dmflags); 247 EXTERN_CVAR (Int, dmflags2); // [BC] 248 249 EXTERN_CVAR (Int, compatflags); 250 EXTERN_CVAR (Int, compatflags2); 251 extern int i_compatflags, i_compatflags2, ii_compatflags, ii_compatflags2, ib_compatflags; 252 253 // Filters from AddAutoloadFiles(). Used to filter files from archives. 254 extern FString LumpFilterIWAD; 255 256 #endif 257