XenevaOS
Loading...
Searching...
No Matches
doomstat.h
Go to the documentation of this file.
1//
2// Copyright(C) 1993-1996 Id Software, Inc.
3// Copyright(C) 2005-2014 Simon Howard
4//
5// This program is free software; you can redistribute it and/or
6// modify it under the terms of the GNU General Public License
7// as published by the Free Software Foundation; either version 2
8// of the License, or (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// DESCRIPTION:
16// All the global variables that store the internal state.
17// Theoretically speaking, the internal state of the engine
18// should be found by looking at the variables collected
19// here, and every relevant module will have to include
20// this header file.
21// In practice, things are a bit messy.
22//
23
24
25#ifndef __D_STATE__
26#define __D_STATE__
27
28// We need globally shared data structures,
29// for defining the global state variables.
30#include "doomdata.h"
31#include "d_loop.h"
32
33// We need the playr data structure as well.
34#include "d_player.h"
35
36// Game mode/mission
37#include "d_mode.h"
38
39#include "net_defs.h"
40
41
42
43// ------------------------
44// Command line parameters.
45//
46extern boolean nomonsters; // checkparm of -nomonsters
47extern boolean respawnparm; // checkparm of -respawn
48extern boolean fastparm; // checkparm of -fast
49
50extern boolean devparm; // DEBUG: launched with -devparm
51
52
53// -----------------------------------------------------
54// Game Mode - identify IWAD as shareware, retail etc.
55//
56extern GameMode_t gamemode;
59extern char *gamedescription;
60
61// If true, we're using one of the mangled BFG edition IWADs.
62extern boolean bfgedition;
63
64// Convenience macro.
65// 'gamemission' can be equal to pack_chex or pack_hacx, but these are
66// just modified versions of doom and doom2, and should be interpreted
67// as the same most of the time.
68
69#define logical_gamemission \
70 (gamemission == pack_chex ? doom : \
71 gamemission == pack_hacx ? doom2 : gamemission)
72
73// Set if homebrew PWAD stuff has been added.
74extern boolean modifiedgame;
75
76
77// -------------------------------------------
78// Selected skill type, map etc.
79//
80
81// Defaults for menu, methinks.
82extern skill_t startskill;
83extern int startepisode;
84extern int startmap;
85
86// Savegame slot to load on startup. This is the value provided to
87// the -loadgame option. If this has not been provided, this is -1.
88
89extern int startloadgame;
90
91extern boolean autostart;
92
93// Selected by user.
94extern skill_t gameskill;
95extern int gameepisode;
96extern int gamemap;
97
98// If non-zero, exit the level after this number of minutes
99extern int timelimit;
100
101// Nightmare mode flag, single player.
102extern boolean respawnmonsters;
103
104// Netgame? Only true if >1 player.
105extern boolean netgame;
106
107// 0=Cooperative; 1=Deathmatch; 2=Altdeath
108extern int deathmatch;
109
110// -------------------------
111// Internal parameters for sound rendering.
112// These have been taken from the DOS version,
113// but are not (yet) supported with Linux
114// (e.g. no sound volume adjustment with menu.
115
116// From m_menu.c:
117// Sound FX volume has default, 0 - 15
118// Music volume has default, 0 - 15
119// These are multiplied by 8.
120extern int sfxVolume;
121extern int musicVolume;
122
123// Current music/sfx card - index useless
124// w/o a reference LUT in a sound module.
125// Ideally, this would use indices found
126// in: /usr/include/linux/soundcard.h
127extern int snd_MusicDevice;
128extern int snd_SfxDevice;
129// Config file? Same disclaimer as above.
130extern int snd_DesiredMusicDevice;
131extern int snd_DesiredSfxDevice;
132
133
134// -------------------------
135// Status flags for refresh.
136//
137
138// Depending on view size - no status bar?
139// Note that there is no way to disable the
140// status bar explicitely.
141extern boolean statusbaractive;
142
143extern boolean automapactive; // In AutoMap mode?
144extern boolean menuactive; // Menu overlayed?
145extern boolean paused; // Game Pause?
146
147
148extern boolean viewactive;
149
150extern boolean nodrawers;
151
152
153extern boolean testcontrols;
154extern int testcontrols_mousespeed;
155
156
157
158
159// This one is related to the 3-screen display mode.
160// ANG90 = left side, ANG270 = right
161extern int viewangleoffset;
162
163// Player taking events, and displaying.
164extern int consoleplayer;
165extern int displayplayer;
166
167
168// -------------------------------------
169// Scores, rating.
170// Statistics on a given map, for intermission.
171//
172extern int totalkills;
173extern int totalitems;
174extern int totalsecret;
175
176// Timer, for scores.
177extern int levelstarttic; // gametic at level start
178extern int leveltime; // tics in game play for par
179
180
181
182// --------------------------------------
183// DEMO playback/recording related stuff.
184// No demo, there is a human player in charge?
185// Disable save/end game?
186extern boolean usergame;
187
188//?
189extern boolean demoplayback;
190extern boolean demorecording;
191
192// Round angleturn in ticcmds to the nearest 256. This is used when
193// recording Vanilla demos in netgames.
194
195extern boolean lowres_turn;
196
197// Quit after playing a demo from cmdline.
198extern boolean singledemo;
199
200
201
202
203//?
205
206
207
208
209
210
211//-----------------------------
212// Internal parameters, fixed.
213// These are set by the engine, and not changed
214// according to user inputs. Partly load from
215// WAD, partly set at startup time.
216
217
218
219// Bookkeeping on players - state.
221
222// Alive? Disconnected?
223extern boolean playeringame[MAXPLAYERS];
224
225
226// Player spawn spots for deathmatch.
227#define MAX_DM_STARTS 10
228extern mapthing_t deathmatchstarts[MAX_DM_STARTS];
229extern mapthing_t* deathmatch_p;
230
231// Player spawn spots.
232extern mapthing_t playerstarts[MAXPLAYERS];
233
234// Intermission stats.
235// Parameters for world map / intermission.
236extern wbstartstruct_t wminfo;
237
238
239
240
241
242
243
244//-----------------------------------------
245// Internal parameters, used for engine.
246//
247
248// File handling stuff.
249extern char * savegamedir;
250extern char basedefault[1024];
251
252// if true, load all graphics at level load
253extern boolean precache;
254
255
256// wipegamestate can be set to -1
257// to force a wipe on the next draw
259
260extern int mouseSensitivity;
261
262extern int bodyqueslot;
263
264
265
266// Needed to store the number of the dummy sky flat.
267// Used for rendering,
268// as well as tracking projectiles etc.
269extern int skyflatnum;
270
271
272
273// Netgame stuff (buffers and pointers, i.e. indices).
274
275
276extern int rndindex;
277
278extern ticcmd_t *netcmds;
279
280
281#endif
GameMission_t
Definition d_mode.h:28
GameVersion_t
Definition d_mode.h:58
skill_t
Definition d_mode.h:80
GameMode_t
Definition d_mode.h:47
#define MAXPLAYERS
Definition doomdef.h:45
gamestate_t
Definition doomdef.h:51
int rndindex
Definition m_random.c:46
int skyflatnum
Definition r_sky.c:37
mapthing_t playerstarts[MAXPLAYERS]
Definition p_setup.c:109
boolean modifiedgame
Definition doomstat.c:31
int totalsecret
Definition g_game.c:128
int startmap
Definition d_main.c:111
int mouseSensitivity
Definition m_menu.c:70
GameVersion_t gameversion
Definition doomstat.c:27
char * savegamedir
Definition d_main.c:91
boolean automapactive
Definition am_map.c:200
skill_t startskill
Definition d_main.c:109
gamestate_t wipegamestate
Definition d_main.c:165
boolean netgame
Definition g_game.c:119
char * gamedescription
Definition doomstat.c:28
int levelstarttic
Definition g_game.c:127
boolean demoplayback
Definition g_game.c:134
boolean statusbaractive
boolean autostart
Definition d_main.c:112
boolean devparm
Definition d_main.c:98
int snd_DesiredSfxDevice
int displayplayer
Definition g_game.c:126
int totalkills
Definition g_game.c:128
int testcontrols_mousespeed
Definition g_game.c:144
int snd_MusicDevice
int snd_DesiredMusicDevice
int deathmatch
Definition g_game.c:118
boolean nodrawers
Definition g_game.c:113
int viewangleoffset
Definition r_main.c:47
GameMission_t gamemission
Definition doomstat.c:26
boolean playeringame[MAXPLAYERS]
Definition g_game.c:120
mapthing_t deathmatchstarts[MAX_DM_STARTS]
Definition p_setup.c:107
boolean testcontrols
Definition g_game.c:143
int bodyqueslot
Definition g_game.c:228
int leveltime
Definition p_tick.c:27
ticcmd_t * netcmds
Definition d_net.c:41
boolean viewactive
Definition g_game.c:116
player_t players[MAXPLAYERS]
Definition g_game.c:121
int sfxVolume
Definition s_sound.c:86
boolean precache
Definition g_game.c:141
int musicVolume
Definition s_sound.c:90
char basedefault[1024]
boolean usergame
Definition g_game.c:110
int consoleplayer
Definition g_game.c:125
skill_t gameskill
Definition g_game.c:98
wbstartstruct_t wminfo
Definition g_game.c:148
boolean paused
Definition g_game.c:107
boolean nomonsters
Definition d_main.c:99
boolean lowres_turn
Definition g_game.c:133
int startloadgame
Definition d_main.c:113
GameMode_t gamemode
Definition doomstat.c:25
boolean singledemo
Definition g_game.c:139
int startepisode
Definition d_main.c:110
int gameepisode
Definition g_game.c:100
int timelimit
Definition g_game.c:105
int totalitems
Definition g_game.c:128
#define MAX_DM_STARTS
Definition doomstat.h:227
boolean respawnmonsters
Definition g_game.c:99
int snd_SfxDevice
gamestate_t gamestate
Definition g_game.c:97
boolean respawnparm
Definition d_main.c:100
boolean menuactive
Definition m_menu.c:118
boolean fastparm
Definition d_main.c:101
boolean demorecording
Definition g_game.c:131
boolean bfgedition
Definition d_main.c:121
mapthing_t * deathmatch_p
Definition p_setup.c:108
int gamemap
Definition g_game.c:101
Definition d_player.h:79
Definition d_ticcmd.h:33
Definition d_player.h:183