| 1 |
/* Emacs style mode select -*- C -*- |
| 2 |
*----------------------------------------------------------------------------- |
| 3 |
* |
| 4 |
* |
| 5 |
* PrBoom: a Doom port merged with LxDoom and LSDLDoom |
| 6 |
* based on BOOM, a modified and improved DOOM engine |
| 7 |
* Copyright (C) 1999 by |
| 8 |
* id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman |
| 9 |
* Copyright (C) 1999-2006 by |
| 10 |
* Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze |
| 11 |
* Copyright 2005, 2006 by |
| 12 |
* Florian Schulze, Colin Phipps, Neil Stevens, Andrey Budko |
| 13 |
* |
| 14 |
* This program is free software; you can redistribute it and/or |
| 15 |
* modify it under the terms of the GNU General Public License |
| 16 |
* as published by the Free Software Foundation; either version 2 |
| 17 |
* of the License, or (at your option) any later version. |
| 18 |
* |
| 19 |
* This program is distributed in the hope that it will be useful, |
| 20 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 |
* GNU General Public License for more details. |
| 23 |
* |
| 24 |
* You should have received a copy of the GNU General Public License |
| 25 |
* along with this program; if not, write to the Free Software |
| 26 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
| 27 |
* 02111-1307, USA. |
| 28 |
* |
| 29 |
* DESCRIPTION: |
| 30 |
* All the global variables that store the internal state. |
| 31 |
* Theoretically speaking, the internal state of the engine |
| 32 |
* should be found by looking at the variables collected |
| 33 |
* here, and every relevant module will have to include |
| 34 |
* this header file. |
| 35 |
* In practice, things are a bit messy. |
| 36 |
* |
| 37 |
*-----------------------------------------------------------------------------*/ |
| 38 |
|
| 39 |
#ifndef __D_STATE__ |
| 40 |
#define __D_STATE__ |
| 41 |
|
| 42 |
// We need the playr data structure as well. |
| 43 |
#include "d_player.h" |
| 44 |
|
| 45 |
// ------------------------ |
| 46 |
// Command line parameters. |
| 47 |
// |
| 48 |
|
| 49 |
extern dboolean nomonsters; // checkparm of -nomonsters |
| 50 |
extern dboolean respawnparm; // checkparm of -respawn |
| 51 |
extern dboolean fastparm; // checkparm of -fast |
| 52 |
|
| 53 |
// ----------------------------------------------------- |
| 54 |
// Game Mode - identify IWAD as shareware, retail etc. |
| 55 |
// |
| 56 |
|
| 57 |
extern GameMode_t gamemode; |
| 58 |
extern GameMission_t gamemission; |
| 59 |
extern const char *doomverstr; |
| 60 |
|
| 61 |
extern char *VANILLA_MAP_LUMP_NAME(int e, int m); |
| 62 |
|
| 63 |
// Set if homebrew PWAD stuff has been added. |
| 64 |
extern dboolean modifiedgame; |
| 65 |
|
| 66 |
// CPhipps - new compatibility handling |
| 67 |
extern complevel_t compatibility_level; |
| 68 |
|
| 69 |
// CPhipps - old compatibility testing flags aliased to new handling |
| 70 |
#define compatibility (compatibility_level<=boom_compatibility_compatibility) |
| 71 |
#define demo_compatibility (compatibility_level < boom_compatibility_compatibility) |
| 72 |
#define mbf_features (compatibility_level>=mbf_compatibility) |
| 73 |
#define mbf21 (compatibility_level == mbf21_compatibility) |
| 74 |
|
| 75 |
extern int demo_insurance; // killough 4/5/98 |
| 76 |
|
| 77 |
extern dboolean pistolstart; |
| 78 |
|
| 79 |
// ------------------------------------------- |
| 80 |
// killough 10/98: compatibility vector |
| 81 |
|
| 82 |
enum { |
| 83 |
comp_telefrag, |
| 84 |
comp_dropoff, |
| 85 |
comp_vile, |
| 86 |
comp_pain, |
| 87 |
comp_skull, |
| 88 |
comp_blazing, |
| 89 |
comp_doorlight, |
| 90 |
comp_model, |
| 91 |
comp_god, |
| 92 |
comp_falloff, |
| 93 |
comp_floors, |
| 94 |
comp_skymap, |
| 95 |
comp_pursuit, |
| 96 |
comp_doorstuck, |
| 97 |
comp_staylift, |
| 98 |
comp_zombie, |
| 99 |
comp_stairs, |
| 100 |
comp_infcheat, |
| 101 |
comp_zerotags, |
| 102 |
comp_moveblock, |
| 103 |
comp_respawn, /* cph - alias of comp_respawnfix from eternity */ |
| 104 |
comp_sound, |
| 105 |
comp_666, |
| 106 |
comp_soul, |
| 107 |
comp_maskedanim, |
| 108 |
|
| 109 |
//e6y |
| 110 |
comp_ouchface, |
| 111 |
comp_maxhealth, |
| 112 |
comp_translucency, |
| 113 |
|
| 114 |
// mbf21 |
| 115 |
comp_ledgeblock, |
| 116 |
comp_friendlyspawn, |
| 117 |
comp_voodooscroller, |
| 118 |
comp_reservedlineflag, |
| 119 |
|
| 120 |
MBF_COMP_TOTAL = 32 // limit in MBF format |
| 121 |
}; |
| 122 |
|
| 123 |
enum { |
| 124 |
comperr_passuse, |
| 125 |
comperr_hangsolid, |
| 126 |
comperr_blockmap, |
| 127 |
|
| 128 |
COMPERR_NUM |
| 129 |
}; |
| 130 |
|
| 131 |
extern int comp[MBF_COMP_TOTAL]; |
| 132 |
extern int default_comperr[COMPERR_NUM]; |
| 133 |
|
| 134 |
// ------------------------------------------- |
| 135 |
// Language. |
| 136 |
extern Language_t language; |
| 137 |
|
| 138 |
// ------------------------------------------- |
| 139 |
// Selected skill type, map etc. |
| 140 |
// |
| 141 |
|
| 142 |
// Defaults for menu, methinks. |
| 143 |
extern int startskill; |
| 144 |
extern int startepisode; |
| 145 |
|
| 146 |
extern dboolean autostart; |
| 147 |
|
| 148 |
// Selected by user. |
| 149 |
extern int gameskill; |
| 150 |
extern int gameepisode; |
| 151 |
extern int gamemap; |
| 152 |
|
| 153 |
typedef struct |
| 154 |
{ |
| 155 |
int map; |
| 156 |
int position; |
| 157 |
int flags; |
| 158 |
angle_t angle; |
| 159 |
} leave_data_t; |
| 160 |
|
| 161 |
extern leave_data_t leave_data; |
| 162 |
|
| 163 |
#define LF_SET_ANGLE 0x01 |
| 164 |
#define LEAVE_VICTORY -1 |
| 165 |
|
| 166 |
// Netgame? Only true if >1 player. |
| 167 |
extern dboolean netgame; |
| 168 |
|
| 169 |
// Flag: true only if started as net deathmatch. |
| 170 |
// An enum might handle altdeath/cooperative better. |
| 171 |
extern dboolean deathmatch; |
| 172 |
|
| 173 |
extern int solo_net; |
| 174 |
extern dboolean coop_spawns; |
| 175 |
|
| 176 |
extern dboolean randomclass; |
| 177 |
|
| 178 |
// ------------------------------------------ |
| 179 |
// Internal parameters for sound rendering. |
| 180 |
// These have been taken from the DOS version, |
| 181 |
// but are not (yet) supported with Linux |
| 182 |
// (e.g. no sound volume adjustment with menu. |
| 183 |
|
| 184 |
// These are not used, but should be (menu). |
| 185 |
// From m_menu.c: |
| 186 |
// Sound FX volume has default, 0 - 15 |
| 187 |
// Music volume has default, 0 - 15 |
| 188 |
// These are multiplied by 8. |
| 189 |
extern int snd_SfxVolume; // maximum volume for sound |
| 190 |
extern int snd_MusicVolume; // maximum volume for music |
| 191 |
|
| 192 |
// CPhipps - screen parameters |
| 193 |
extern int desired_screenwidth, desired_screenheight; |
| 194 |
|
| 195 |
extern int automap_active; |
| 196 |
extern int automap_overlay; |
| 197 |
extern int automap_rotate; |
| 198 |
extern int automap_follow; |
| 199 |
extern int automap_grid; |
| 200 |
|
| 201 |
#define automap_on (automap_active && !automap_overlay) |
| 202 |
#define automap_off (!automap_active && automap_overlay > 0) |
| 203 |
#define automap_stbar (automap_active && R_StatusBarVisible()) |
| 204 |
#define automap_input (automap_active) |
| 205 |
#define automap_hud (automap_active && !automap_overlay) |
| 206 |
|
| 207 |
typedef enum { |
| 208 |
mnact_nochange = -1, |
| 209 |
mnact_inactive, // no menu |
| 210 |
mnact_float, // doom-style large font menu, doesn't overlap anything |
| 211 |
mnact_full, // boom-style small font menu, may overlap status bar |
| 212 |
} menuactive_t; |
| 213 |
extern menuactive_t menuactive; // Type of menu overlaid, if any |
| 214 |
|
| 215 |
extern dboolean nodrawers; |
| 216 |
|
| 217 |
// Player taking events, and displaying. |
| 218 |
extern int consoleplayer; |
| 219 |
extern int displayplayer; |
| 220 |
|
| 221 |
// ------------------------------------- |
| 222 |
// Scores, rating. |
| 223 |
// Statistics on a given map, for intermission. |
| 224 |
// |
| 225 |
extern int totalkills, totallive; |
| 226 |
extern int totalitems; |
| 227 |
extern int totalsecret; |
| 228 |
|
| 229 |
extern int boom_basetic; |
| 230 |
extern int true_basetic; |
| 231 |
extern int leveltime; // level time in tics |
| 232 |
extern int totalleveltimes; // sum of intermission times in tics at second resolution |
| 233 |
extern int levels_completed; |
| 234 |
|
| 235 |
// -------------------------------------- |
| 236 |
// DEMO playback/recording related stuff. |
| 237 |
|
| 238 |
extern dboolean demoplayback; |
| 239 |
extern dboolean demorecording; |
| 240 |
extern int demover; |
| 241 |
|
| 242 |
#define allow_incompatibility (!demorecording && !demoplayback) |
| 243 |
#define comperr(i) (default_comperr[i] && allow_incompatibility) |
| 244 |
|
| 245 |
extern dboolean userdemo; |
| 246 |
#define userplayback (demoplayback && userdemo) |
| 247 |
#define reelplayback (demoplayback && !userdemo) |
| 248 |
|
| 249 |
// Print timing information after quitting. killough |
| 250 |
extern dboolean timingdemo; |
| 251 |
// Run tick clock at fastest speed possible while playing demo. killough |
| 252 |
extern dboolean fastdemo; |
| 253 |
|
| 254 |
extern gamestate_t gamestate; |
| 255 |
extern dboolean in_game; |
| 256 |
|
| 257 |
//----------------------------- |
| 258 |
// Internal parameters, fixed. |
| 259 |
// These are set by the engine, and not changed |
| 260 |
// according to user inputs. Partly load from |
| 261 |
// WAD, partly set at startup time. |
| 262 |
|
| 263 |
extern int gametic; |
| 264 |
|
| 265 |
#define boom_logictic (gametic - boom_basetic) |
| 266 |
#define true_logictic (gametic - true_basetic) |
| 267 |
|
| 268 |
//e6y |
| 269 |
extern dboolean realframe; |
| 270 |
|
| 271 |
// Bookkeeping on players - state. |
| 272 |
extern player_t players[MAX_MAXPLAYERS]; |
| 273 |
extern int upmove; |
| 274 |
|
| 275 |
// Alive? Disconnected? |
| 276 |
extern dboolean playeringame[MAX_MAXPLAYERS]; |
| 277 |
|
| 278 |
extern pclass_t PlayerClass[MAX_MAXPLAYERS]; |
| 279 |
|
| 280 |
extern mapthing_t *deathmatchstarts; // killough |
| 281 |
extern size_t num_deathmatchstarts; // killough |
| 282 |
|
| 283 |
extern mapthing_t *deathmatch_p; |
| 284 |
|
| 285 |
// Player spawn spots. |
| 286 |
#define MAX_PLAYER_STARTS 8 |
| 287 |
extern mapthing_t playerstarts[MAX_PLAYER_STARTS][MAX_MAXPLAYERS]; |
| 288 |
|
| 289 |
// Intermission stats. |
| 290 |
// Parameters for world map / intermission. |
| 291 |
extern wbstartstruct_t wminfo; |
| 292 |
|
| 293 |
//----------------------------------------- |
| 294 |
// Internal parameters, used for engine. |
| 295 |
// |
| 296 |
|
| 297 |
// File handling stuff. |
| 298 |
extern FILE *debugfile; |
| 299 |
|
| 300 |
// wipegamestate can be set to -1 |
| 301 |
// to force a wipe on the next draw |
| 302 |
extern gamestate_t wipegamestate; |
| 303 |
|
| 304 |
// debug flag to cancel adaptiveness |
| 305 |
extern dboolean singletics; |
| 306 |
|
| 307 |
// Needed to store the number of the dummy sky flat. |
| 308 |
// Used for rendering, as well as tracking projectiles etc. |
| 309 |
|
| 310 |
extern int skyflatnum; |
| 311 |
|
| 312 |
extern int maketic; |
| 313 |
|
| 314 |
// Networking and tick handling related. |
| 315 |
#define BACKUPTICS 12 |
| 316 |
|
| 317 |
extern ticcmd_t local_cmds[][BACKUPTICS]; |
| 318 |
|
| 319 |
//----------------------------------------------------------------------------- |
| 320 |
|
| 321 |
extern int allow_pushers; // MT_PUSH Things // phares 3/10/98 |
| 322 |
|
| 323 |
extern int variable_friction; // ice & mud // phares 3/10/98 |
| 324 |
|
| 325 |
extern int monsters_remember; // killough 3/1/98 |
| 326 |
|
| 327 |
extern int weapon_recoil; // weapon recoil // phares |
| 328 |
|
| 329 |
extern int player_bobbing; // whether player bobs or not // phares 2/25/98 |
| 330 |
|
| 331 |
extern int dogs; // killough 7/19/98: Marine's best friend :) |
| 332 |
extern int dog_jumping; // killough 10/98 |
| 333 |
|
| 334 |
/* killough 8/8/98: distance friendly monsters tend to stay from player */ |
| 335 |
extern int distfriend; |
| 336 |
|
| 337 |
/* killough 9/8/98: whether monsters are allowed to strafe or retreat */ |
| 338 |
extern int monster_backing; |
| 339 |
|
| 340 |
/* killough 9/9/98: whether monsters intelligently avoid hazards */ |
| 341 |
extern int monster_avoid_hazards; |
| 342 |
|
| 343 |
/* killough 10/98: whether monsters are affected by friction */ |
| 344 |
extern int monster_friction; |
| 345 |
|
| 346 |
/* killough 9/9/98: whether monsters help friends */ |
| 347 |
extern int help_friends; |
| 348 |
|
| 349 |
/* killough 7/19/98: whether monsters should fight against each other */ |
| 350 |
extern int monster_infighting; |
| 351 |
|
| 352 |
extern int monkeys; |
| 353 |
|
| 354 |
extern int HelperThing; // type of thing to use for helper |
| 355 |
|
| 356 |
#endif |