1 // Emacs style mode select -*- C++ -*-
2 //-----------------------------------------------------------------------------
6 // Copyright (C) 1993-1996 by id Software, Inc.
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.
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
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
23 // In practice, things are a bit messy.
25 //-----------------------------------------------------------------------------
31 // We need globally shared data structures,
32 // for defining the global state variables.
36 // We need the playr data structure as well.
46 // ------------------------
47 // Command line parameters.
49 extern boolean nomonsters; // checkparm of -nomonsters
50 extern boolean respawnparm; // checkparm of -respawn
51 extern boolean fastparm; // checkparm of -fast
53 extern boolean devparm; // DEBUG: launched with -devparm
57 // -----------------------------------------------------
58 // Game Mode - identify IWAD as shareware, retail etc.
60 extern GameMode_t gamemode;
61 extern GameMission_t gamemission;
63 // Set if homebrew PWAD stuff has been added.
64 extern boolean modifiedgame;
67 // -------------------------------------------
69 extern Language_t language;
72 // -------------------------------------------
73 // Selected skill type, map etc.
76 // Defaults for menu, methinks.
77 extern skill_t startskill;
78 extern int startepisode;
81 extern boolean autostart;
84 extern skill_t gameskill;
85 extern int gameepisode;
88 // Nightmare mode flag, single player.
89 extern boolean respawnmonsters;
91 // Netgame? Only true if >1 player.
92 extern boolean netgame;
94 // Flag: true only if started as net deathmatch.
95 // An enum might handle altdeath/cooperative better.
96 extern boolean deathmatch;
98 // -------------------------
99 // Internal parameters for sound rendering.
100 // These have been taken from the DOS version,
101 // but are not (yet) supported with Linux
102 // (e.g. no sound volume adjustment with menu.
104 // These are not used, but should be (menu).
106 // Sound FX volume has default, 0 - 15
107 // Music volume has default, 0 - 15
108 // These are multiplied by 8.
109 extern int snd_SfxVolume; // maximum volume for sound
110 extern int snd_MusicVolume; // maximum volume for music
112 // Current music/sfx card - index useless
113 // w/o a reference LUT in a sound module.
114 // Ideally, this would use indices found
115 // in: /usr/include/linux/soundcard.h
116 extern int snd_MusicDevice;
117 extern int snd_SfxDevice;
118 // Config file? Same disclaimer as above.
119 extern int snd_DesiredMusicDevice;
120 extern int snd_DesiredSfxDevice;
123 // -------------------------
124 // Status flags for refresh.
127 // Depending on view size - no status bar?
128 // Note that there is no way to disable the
129 // status bar explicitely.
130 extern boolean statusbaractive;
132 extern boolean automapactive; // In AutoMap mode?
133 extern boolean menuactive; // Menu overlayed?
134 extern boolean paused; // Game Pause?
137 extern boolean viewactive;
139 extern boolean nodrawers;
140 extern boolean noblit;
142 extern int viewwindowx;
143 extern int viewwindowy;
144 extern int viewheight;
145 extern int viewwidth;
146 extern int scaledviewwidth;
153 // This one is related to the 3-screen display mode.
154 // ANG90 = left side, ANG270 = right
155 extern int viewangleoffset;
157 // Player taking events, and displaying.
158 extern int consoleplayer;
159 extern int displayplayer;
162 // -------------------------------------
164 // Statistics on a given map, for intermission.
166 extern int totalkills;
167 extern int totalitems;
168 extern int totalsecret;
170 // Timer, for scores.
171 extern int levelstarttic; // gametic at level start
172 extern int leveltime; // tics in game play for par
176 // --------------------------------------
177 // DEMO playback/recording related stuff.
178 // No demo, there is a human player in charge?
179 // Disable save/end game?
180 extern boolean usergame;
183 extern boolean demoplayback;
184 extern boolean demorecording;
186 // Quit after playing a demo from cmdline.
187 extern boolean singledemo;
193 extern gamestate_t gamestate;
200 //-----------------------------
201 // Internal parameters, fixed.
202 // These are set by the engine, and not changed
203 // according to user inputs. Partly load from
204 // WAD, partly set at startup time.
211 // Bookkeeping on players - state.
212 extern player_t players[MAXPLAYERS];
214 // Alive? Disconnected?
215 extern boolean playeringame[MAXPLAYERS];
218 // Player spawn spots for deathmatch.
219 #define MAX_DM_STARTS 10
220 extern mapthing_t deathmatchstarts[MAX_DM_STARTS];
221 extern mapthing_t* deathmatch_p;
223 // Player spawn spots.
224 extern mapthing_t playerstarts[MAXPLAYERS];
226 // Intermission stats.
227 // Parameters for world map / intermission.
228 extern wbstartstruct_t wminfo;
231 // LUT of ammunition limits for each kind.
232 // This doubles with BackPack powerup item.
233 extern int maxammo[NUMAMMO];
239 //-----------------------------------------
240 // Internal parameters, used for engine.
243 // File handling stuff.
244 extern char basedefault[1024];
245 extern FILE* debugfile;
247 // if true, load all graphics at level load
248 extern boolean precache;
251 // wipegamestate can be set to -1
252 // to force a wipe on the next draw
253 extern gamestate_t wipegamestate;
255 extern int mouseSensitivity;
257 // debug flag to cancel adaptiveness
258 extern boolean singletics;
260 extern int bodyqueslot;
264 // Needed to store the number of the dummy sky flat.
265 // Used for rendering,
266 // as well as tracking projectiles etc.
267 extern int skyflatnum;
271 // Netgame stuff (buffers and pointers, i.e. indices).
274 extern doomcom_t* doomcom;
276 // This points inside doomcom.
277 extern doomdata_t* netbuffer;
280 extern ticcmd_t localcmds[BACKUPTICS];
284 extern int nettics[MAXNETNODES];
286 extern ticcmd_t netcmds[MAXPLAYERS][BACKUPTICS];
292 //-----------------------------------------------------------------------------
296 //-----------------------------------------------------------------------------