doomstat.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  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. #ifndef __D_STATE__
  27. #define __D_STATE__
  28. // We need globally shared data structures,
  29. // for defining the global state variables.
  30. #include "doomdata.h"
  31. #include "d_net.h"
  32. // We need the playr data structure as well.
  33. #include "d_player.h"
  34. #ifdef __GNUG__
  35. #pragma interface
  36. #endif
  37. // ------------------------
  38. // Command line parameters.
  39. //
  40. extern boolean nomonsters; // checkparm of -nomonsters
  41. extern boolean respawnparm; // checkparm of -respawn
  42. extern boolean fastparm; // checkparm of -fast
  43. extern boolean devparm; // DEBUG: launched with -devparm
  44. // -----------------------------------------------------
  45. // Game Mode - identify IWAD as shareware, retail etc.
  46. //
  47. extern GameMode_t gamemode;
  48. extern GameMission_t gamemission;
  49. // Set if homebrew PWAD stuff has been added.
  50. extern boolean modifiedgame;
  51. // -------------------------------------------
  52. // Language.
  53. extern Language_t language;
  54. // -------------------------------------------
  55. // Selected skill type, map etc.
  56. //
  57. // Defaults for menu, methinks.
  58. extern skill_t startskill;
  59. extern int startepisode;
  60. extern int startmap;
  61. extern boolean autostart;
  62. // Selected by user.
  63. extern skill_t gameskill;
  64. extern int gameepisode;
  65. extern int gamemap;
  66. // Nightmare mode flag, single player.
  67. extern boolean respawnmonsters;
  68. // Netgame? Only true if >1 player.
  69. extern boolean netgame;
  70. // Flag: true only if started as net deathmatch.
  71. // An enum might handle altdeath/cooperative better.
  72. extern boolean deathmatch;
  73. // -------------------------
  74. // Internal parameters for sound rendering.
  75. // These have been taken from the DOS version,
  76. // but are not (yet) supported with Linux
  77. // (e.g. no sound volume adjustment with menu.
  78. // These are not used, but should be (menu).
  79. // From m_menu.c:
  80. // Sound FX volume has default, 0 - 15
  81. // Music volume has default, 0 - 15
  82. // These are multiplied by 8.
  83. extern int snd_SfxVolume; // maximum volume for sound
  84. extern int snd_MusicVolume; // maximum volume for music
  85. // Current music/sfx card - index useless
  86. // w/o a reference LUT in a sound module.
  87. // Ideally, this would use indices found
  88. // in: /usr/include/linux/soundcard.h
  89. extern int snd_MusicDevice;
  90. extern int snd_SfxDevice;
  91. // Config file? Same disclaimer as above.
  92. extern int snd_DesiredMusicDevice;
  93. extern int snd_DesiredSfxDevice;
  94. // -------------------------
  95. // Status flags for refresh.
  96. //
  97. // Depending on view size - no status bar?
  98. // Note that there is no way to disable the
  99. // status bar explicitely.
  100. extern boolean statusbaractive;
  101. extern boolean automapactive; // In AutoMap mode?
  102. extern boolean menuactive; // Menu overlayed?
  103. extern boolean paused; // Game Pause?
  104. extern boolean viewactive;
  105. extern boolean nodrawers;
  106. extern boolean noblit;
  107. extern int viewwindowx;
  108. extern int viewwindowy;
  109. extern int viewheight;
  110. extern int viewwidth;
  111. extern int scaledviewwidth;
  112. // This one is related to the 3-screen display mode.
  113. // ANG90 = left side, ANG270 = right
  114. extern int viewangleoffset;
  115. // Player taking events, and displaying.
  116. extern int consoleplayer;
  117. extern int displayplayer;
  118. // -------------------------------------
  119. // Scores, rating.
  120. // Statistics on a given map, for intermission.
  121. //
  122. extern int totalkills;
  123. extern int totalitems;
  124. extern int totalsecret;
  125. // Timer, for scores.
  126. extern int levelstarttic; // gametic at level start
  127. extern int leveltime; // tics in game play for par
  128. // --------------------------------------
  129. // DEMO playback/recording related stuff.
  130. // No demo, there is a human player in charge?
  131. // Disable save/end game?
  132. extern boolean usergame;
  133. //?
  134. extern boolean demoplayback;
  135. extern boolean demorecording;
  136. // Quit after playing a demo from cmdline.
  137. extern boolean singledemo;
  138. //?
  139. extern gamestate_t gamestate;
  140. //-----------------------------
  141. // Internal parameters, fixed.
  142. // These are set by the engine, and not changed
  143. // according to user inputs. Partly load from
  144. // WAD, partly set at startup time.
  145. extern int gametic;
  146. // Bookkeeping on players - state.
  147. extern player_t players[MAXPLAYERS];
  148. // Alive? Disconnected?
  149. extern boolean playeringame[MAXPLAYERS];
  150. // Player spawn spots for deathmatch.
  151. #define MAX_DM_STARTS 10
  152. extern mapthing_t deathmatchstarts[MAX_DM_STARTS];
  153. extern mapthing_t* deathmatch_p;
  154. // Player spawn spots.
  155. extern mapthing_t playerstarts[MAXPLAYERS];
  156. // Intermission stats.
  157. // Parameters for world map / intermission.
  158. extern wbstartstruct_t wminfo;
  159. // LUT of ammunition limits for each kind.
  160. // This doubles with BackPack powerup item.
  161. extern int maxammo[NUMAMMO];
  162. //-----------------------------------------
  163. // Internal parameters, used for engine.
  164. //
  165. // File handling stuff.
  166. extern char basedefault[1024];
  167. extern FILE* debugfile;
  168. // if true, load all graphics at level load
  169. extern boolean precache;
  170. // wipegamestate can be set to -1
  171. // to force a wipe on the next draw
  172. extern gamestate_t wipegamestate;
  173. extern int mouseSensitivity;
  174. //?
  175. // debug flag to cancel adaptiveness
  176. extern boolean singletics;
  177. extern int bodyqueslot;
  178. // Needed to store the number of the dummy sky flat.
  179. // Used for rendering,
  180. // as well as tracking projectiles etc.
  181. extern int skyflatnum;
  182. // Netgame stuff (buffers and pointers, i.e. indices).
  183. // This is ???
  184. extern doomcom_t* doomcom;
  185. // This points inside doomcom.
  186. extern doomdata_t* netbuffer;
  187. extern ticcmd_t localcmds[BACKUPTICS];
  188. extern int rndindex;
  189. extern int maketic;
  190. extern int nettics[MAXNETNODES];
  191. extern ticcmd_t netcmds[MAXPLAYERS][BACKUPTICS];
  192. extern int ticdup;
  193. #endif
  194. //-----------------------------------------------------------------------------
  195. //
  196. // $Log:$
  197. //
  198. //-----------------------------------------------------------------------------