Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  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. // We need globally shared data structures,
  32. //  for defining the global state variables.
  33. #include "doomdata.h"
  34. #include "d_net.h"
  35.  
  36. // We need the playr data structure as well.
  37. #include "d_player.h"
  38.  
  39.  
  40. #ifdef __GNUG__
  41. #pragma interface
  42. #endif
  43.  
  44.  
  45.  
  46. // ------------------------
  47. // Command line parameters.
  48. //
  49. extern  boolean nomonsters;     // checkparm of -nomonsters
  50. extern  boolean respawnparm;    // checkparm of -respawn
  51. extern  boolean fastparm;       // checkparm of -fast
  52.  
  53. extern  boolean devparm;        // DEBUG: launched with -devparm
  54.  
  55.  
  56.  
  57. // -----------------------------------------------------
  58. // Game Mode - identify IWAD as shareware, retail etc.
  59. //
  60. extern GameMode_t       gamemode;
  61. extern GameMission_t    gamemission;
  62.  
  63. // Set if homebrew PWAD stuff has been added.
  64. extern  boolean modifiedgame;
  65.  
  66.  
  67. // -------------------------------------------
  68. // Language.
  69. extern  Language_t   language;
  70.  
  71.  
  72. // -------------------------------------------
  73. // Selected skill type, map etc.
  74. //
  75.  
  76. // Defaults for menu, methinks.
  77. extern  skill_t         startskill;
  78. extern  int             startepisode;
  79. extern  int             startmap;
  80.  
  81. extern  boolean         autostart;
  82.  
  83. // Selected by user.
  84. extern  skill_t         gameskill;
  85. extern  int             gameepisode;
  86. extern  int             gamemap;
  87.  
  88. // Nightmare mode flag, single player.
  89. extern  boolean         respawnmonsters;
  90.  
  91. // Netgame? Only true if >1 player.
  92. extern  boolean netgame;
  93.  
  94. // Flag: true only if started as net deathmatch.
  95. // An enum might handle altdeath/cooperative better.
  96. extern  boolean deathmatch;    
  97.        
  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.
  103.  
  104. // These are not used, but should be (menu).
  105. // From m_menu.c:
  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
  111.  
  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;
  121.  
  122.  
  123. // -------------------------
  124. // Status flags for refresh.
  125. //
  126.  
  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;
  131.  
  132. extern  boolean automapactive;  // In AutoMap mode?
  133. extern  boolean menuactive;     // Menu overlayed?
  134. extern  boolean paused;         // Game Pause?
  135.  
  136.  
  137. extern  boolean         viewactive;
  138.  
  139. extern  boolean         nodrawers;
  140. extern  boolean         noblit;
  141.  
  142. extern  int             viewwindowx;
  143. extern  int             viewwindowy;
  144. extern  int             viewheight;
  145. extern  int             viewwidth;
  146. extern  int             scaledviewwidth;
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153. // This one is related to the 3-screen display mode.
  154. // ANG90 = left side, ANG270 = right
  155. extern  int     viewangleoffset;
  156.  
  157. // Player taking events, and displaying.
  158. extern  int     consoleplayer; 
  159. extern  int     displayplayer;
  160.  
  161.  
  162. // -------------------------------------
  163. // Scores, rating.
  164. // Statistics on a given map, for intermission.
  165. //
  166. extern  int     totalkills;
  167. extern  int     totalitems;
  168. extern  int     totalsecret;
  169.  
  170. // Timer, for scores.
  171. extern  int     levelstarttic;  // gametic at level start
  172. extern  int     leveltime;      // tics in game play for par
  173.  
  174.  
  175.  
  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;
  181.  
  182. //?
  183. extern  boolean demoplayback;
  184. extern  boolean demorecording;
  185.  
  186. // Quit after playing a demo from cmdline.
  187. extern  boolean         singledemo;    
  188.  
  189.  
  190.  
  191.  
  192. //?
  193. extern  gamestate_t     gamestate;
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  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.
  205.  
  206.  
  207.  
  208. extern  int             gametic;
  209.  
  210.  
  211. // Bookkeeping on players - state.
  212. extern  player_t        players[MAXPLAYERS];
  213.  
  214. // Alive? Disconnected?
  215. extern  boolean         playeringame[MAXPLAYERS];
  216.  
  217.  
  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;
  222.  
  223. // Player spawn spots.
  224. extern  mapthing_t      playerstarts[MAXPLAYERS];
  225.  
  226. // Intermission stats.
  227. // Parameters for world map / intermission.
  228. extern  wbstartstruct_t         wminfo;
  229.  
  230.  
  231. // LUT of ammunition limits for each kind.
  232. // This doubles with BackPack powerup item.
  233. extern  int             maxammo[NUMAMMO];
  234.  
  235.  
  236.  
  237.  
  238.  
  239. //-----------------------------------------
  240. // Internal parameters, used for engine.
  241. //
  242.  
  243. // File handling stuff.
  244. extern  char            basedefault[1024];
  245. extern  FILE*           debugfile;
  246.  
  247. // if true, load all graphics at level load
  248. extern  boolean         precache;
  249.  
  250.  
  251. // wipegamestate can be set to -1
  252. //  to force a wipe on the next draw
  253. extern  gamestate_t     wipegamestate;
  254.  
  255. extern  int             mouseSensitivity;
  256. //?
  257. // debug flag to cancel adaptiveness
  258. extern  boolean         singletics;    
  259.  
  260. extern  int             bodyqueslot;
  261.  
  262.  
  263.  
  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;
  268.  
  269.  
  270.  
  271. // Netgame stuff (buffers and pointers, i.e. indices).
  272.  
  273. // This is ???
  274. extern  doomcom_t*      doomcom;
  275.  
  276. // This points inside doomcom.
  277. extern  doomdata_t*     netbuffer;     
  278.  
  279.  
  280. extern  ticcmd_t        localcmds[BACKUPTICS];
  281. extern  int             rndindex;
  282.  
  283. extern  int             maketic;
  284. extern  int             nettics[MAXNETNODES];
  285.  
  286. extern  ticcmd_t        netcmds[MAXPLAYERS][BACKUPTICS];
  287. extern  int             ticdup;
  288.  
  289.  
  290.  
  291. #endif
  292. //-----------------------------------------------------------------------------
  293. //
  294. // $Log:$
  295. //
  296. //-----------------------------------------------------------------------------
  297.