home *** CD-ROM | disk | FTP | other *** search
/ ST-Computer Leser-CD 2000 January / LCD_01_2000.iso / games / doom / pmdoom / include / doomdef.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-12-17  |  7.3 KB  |  339 lines

  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. /*   Internally used data structures for virtually everything, */
  19. /*    key definitions, lots of other stuff. */
  20. /*  */
  21. /* ----------------------------------------------------------------------------- */
  22.  
  23. #ifndef __DOOMDEF__
  24. #define __DOOMDEF__
  25.  
  26. #include <stdio.h>
  27. #include <string.h>
  28.  
  29. /*  */
  30. /*  Global parameters/defines. */
  31. /*  */
  32. /*  DOOM version */
  33. enum { VERSION =  110 };
  34.  
  35.  
  36. /*  Game mode handling - identify IWAD version */
  37. /*   to handle IWAD dependend animations etc. */
  38. typedef enum
  39. {
  40.   shareware,    /*  DOOM 1 shareware, E1, M9 */
  41.   registered,    /*  DOOM 1 registered, E3, M27 */
  42.   commercial,    /*  DOOM 2 retail, E1 M34 */
  43.   /*  DOOM 2 german edition not handled */
  44.   retail,    /*  DOOM 1 retail, E4, M36 */
  45.   indetermined    /*  Well, no IWAD found. */
  46.   
  47. } GameMode_t;
  48.  
  49.  
  50. /*  Mission packs - might be useful for TC stuff? */
  51. typedef enum
  52. {
  53.   doom,        /*  DOOM 1 */
  54.   doom2,    /*  DOOM 2 */
  55.   pack_tnt,    /*  TNT mission pack */
  56.   pack_plut,    /*  Plutonia pack */
  57.   none
  58.  
  59. } GameMission_t;
  60.  
  61.  
  62. /*  Identify language to use, software localization. */
  63. typedef enum
  64. {
  65.   english,
  66.   french,
  67.   german,
  68.   unknown
  69.  
  70. } Language_t;
  71.  
  72.  
  73. /*  If rangecheck is undefined, */
  74. /*  most parameter validation debugging code will not be compiled */
  75. /* #define RANGECHECK */
  76.  
  77. /*  Do or do not use external soundserver. */
  78. /*  The sndserver binary to be run separately */
  79. /*   has been introduced by Dave Taylor. */
  80. /*  The integrated sound support is experimental, */
  81. /*   and unfinished. Default is synchronous. */
  82. /*  Experimental asynchronous timer based is */
  83. /*   handled by SNDINTR.  */
  84. /* #define SNDSERV  1 */
  85. /* #define SNDINTR  1 */
  86.  
  87.  
  88. /*  This one switches between MIT SHM (no proper mouse) */
  89. /*  and XFree86 DGA (mickey sampling). The original */
  90. /*  linuxdoom used SHM, which is default. */
  91. /* #define X11_DGA        1 */
  92.  
  93.  
  94. /*  */
  95. /*  For resize of screen, at start of game. */
  96. /*  It will not work dynamically, see visplanes. */
  97. /*  */
  98. /* #define    BASE_WIDTH        320 */
  99.  
  100. /*  It is educational but futile to change this */
  101. /*   scaling e.g. to 2. Drawing of status bar, */
  102. /*   menues etc. is tied to the scale implied */
  103. /*   by the graphics. */
  104. #define    SCREEN_MUL        1
  105. #define    INV_ASPECT_RATIO    0.625 /*  0.75, ideally */
  106.  
  107. /*  Defines suck. C sucks. */
  108. /*  C++ might sucks for OOP, but it sure is a better C. */
  109. /*  So there. */
  110. #define SCREENWIDTH  320
  111. /* SCREEN_MUL*BASE_WIDTH //320 */
  112. #define SCREENHEIGHT 200
  113. /* (int)(SCREEN_MUL*BASE_WIDTH*INV_ASPECT_RATIO) //200 */
  114.  
  115.  
  116.  
  117.  
  118. /*  The maximum number of players, multiplayer/networking. */
  119. #define MAXPLAYERS        4
  120.  
  121. /*  State updates, number of tics / second. */
  122. #define TICRATE        35
  123.  
  124. /*  The current state of the game: whether we are */
  125. /*  playing, gazing at the intermission screen, */
  126. /*  the game final animation, or a demo.  */
  127. typedef enum
  128. {
  129.     GS_LEVEL,
  130.     GS_INTERMISSION,
  131.     GS_FINALE,
  132.     GS_DEMOSCREEN
  133. } gamestate_t;
  134.  
  135. /*  */
  136. /*  Difficulty/skill settings/filters. */
  137. /*  */
  138.  
  139. /*  Skill flags. */
  140. #define    MTF_EASY        1
  141. #define    MTF_NORMAL        2
  142. #define    MTF_HARD        4
  143.  
  144. /*  Deaf monsters/do not react to sound. */
  145. #define    MTF_AMBUSH        8
  146.  
  147. typedef enum
  148. {
  149.     sk_baby,
  150.     sk_easy,
  151.     sk_medium,
  152.     sk_hard,
  153.     sk_nightmare
  154. } skill_t;
  155.  
  156.  
  157.  
  158.  
  159. /*  */
  160. /*  Key cards. */
  161. /*  */
  162. typedef enum
  163. {
  164.     it_bluecard,
  165.     it_yellowcard,
  166.     it_redcard,
  167.     it_blueskull,
  168.     it_yellowskull,
  169.     it_redskull,
  170.     
  171.     NUMCARDS
  172.     
  173. } card_t;
  174.  
  175.  
  176.  
  177. /*  The defined weapons, */
  178. /*   including a marker indicating */
  179. /*   user has not changed weapon. */
  180. typedef enum
  181. {
  182.     wp_fist,
  183.     wp_pistol,
  184.     wp_shotgun,
  185.     wp_chaingun,
  186.     wp_missile,
  187.     wp_plasma,
  188.     wp_bfg,
  189.     wp_chainsaw,
  190.     wp_supershotgun,
  191.  
  192.     NUMWEAPONS,
  193.     
  194.     /*  No pending weapon change. */
  195.     wp_nochange
  196.  
  197. } weapontype_t;
  198.  
  199.  
  200. /*  Ammunition types defined. */
  201. typedef enum
  202. {
  203.     am_clip,    /*  Pistol / chaingun ammo. */
  204.     am_shell,    /*  Shotgun / double barreled shotgun. */
  205.     am_cell,    /*  Plasma rifle, BFG. */
  206.     am_misl,    /*  Missile launcher. */
  207.     NUMAMMO,
  208.     am_noammo    /*  Unlimited for chainsaw / fist.     */
  209.  
  210. } ammotype_t;
  211.  
  212.  
  213. /*  Power up artifacts. */
  214. typedef enum
  215. {
  216.     pw_invulnerability,
  217.     pw_strength,
  218.     pw_invisibility,
  219.     pw_ironfeet,
  220.     pw_allmap,
  221.     pw_infrared,
  222.     NUMPOWERS
  223.     
  224. } powertype_t;
  225.  
  226.  
  227.  
  228. /*  */
  229. /*  Power up durations, */
  230. /*   how many seconds till expiration, */
  231. /*   assuming TICRATE is 35 ticks/second. */
  232. /*  */
  233. typedef enum
  234. {
  235.     INVULNTICS    = (30*TICRATE),
  236.     INVISTICS    = (60*TICRATE),
  237.     INFRATICS    = (120*TICRATE),
  238.     IRONTICS    = (60*TICRATE)
  239.     
  240. } powerduration_t;
  241.  
  242.  
  243.  
  244.  
  245. /*  */
  246. /*  DOOM keyboard definition. */
  247. /*  This is the stuff configured by Setup.Exe. */
  248. /*  Most key data are simple ascii (uppercased). */
  249. /*  */
  250. #define KEY_RIGHTARROW    (0x80+0x2e)
  251. #define KEY_LEFTARROW    (0x80+0x2c)
  252. #define KEY_UPARROW    (0x80+0x2d)
  253. #define KEY_DOWNARROW    (0x80+0x2f)
  254. #define KEY_ESCAPE    27
  255. #define KEY_ENTER    13
  256. #define KEY_TAB        9
  257. #define KEY_F1        (0x80+0x3b)
  258. #define KEY_F2        (0x80+0x3c)
  259. #define KEY_F3        (0x80+0x3d)
  260. #define KEY_F4        (0x80+0x3e)
  261. #define KEY_F5        (0x80+0x3f)
  262. #define KEY_F6        (0x80+0x40)
  263. #define KEY_F7        (0x80+0x41)
  264. #define KEY_F8        (0x80+0x42)
  265. #define KEY_F9        (0x80+0x43)
  266. #define KEY_F10        (0x80+0x44)
  267. #define KEY_F11        (0x80+0x57)
  268. #define KEY_F12        (0x80+0x58)
  269.  
  270. #define KEY_BACKSPACE    127
  271. #define KEY_PAUSE    0xff
  272.  
  273. #define KEY_EQUALS    0x3d
  274. #define KEY_MINUS    0x2d
  275.  
  276. #define KEY_RSHIFT    (0x80+0x36)
  277. #define KEY_RCTRL    (0x80+0x1d)
  278. #define KEY_RALT    (0x80+0x38)
  279.  
  280. #define KEY_LALT    KEY_RALT
  281.  
  282.  
  283.  
  284. /*  DOOM basic types (boolean), */
  285. /*   and max/min values. */
  286. /* #include "doomtype.h" */
  287.  
  288. /*  Fixed point. */
  289. /* #include "m_fixed.h" */
  290.  
  291. /*  Endianess handling. */
  292. /* #include "m_swap.h" */
  293.  
  294.  
  295. /*  Binary Angles, sine/cosine/atan lookups. */
  296. /* #include "tables.h" */
  297.  
  298. /*  Event type. */
  299. /* #include "d_event.h" */
  300.  
  301. /*  Game function, skills. */
  302. /* #include "g_game.h" */
  303.  
  304. /*  All external data is defined here. */
  305. /* #include "doomdata.h" */
  306.  
  307. /*  All important printed strings. */
  308. /*  Language selection (message strings). */
  309. /* #include "dstrings.h" */
  310.  
  311. /*  Player is a special actor. */
  312. /* struct player_s; */
  313.  
  314.  
  315. /* #include "d_items.h" */
  316. /* #include "d_player.h" */
  317. /* #include "p_mobj.h" */
  318. /* #include "d_net.h" */
  319.  
  320. /*  PLAY */
  321. /* #include "p_tick.h" */
  322.  
  323.  
  324.  
  325.  
  326. /*  Header, generated by sound utility. */
  327. /*  The utility was written by Dave Taylor. */
  328. /* #include "sounds.h" */
  329.  
  330.  
  331.  
  332.  
  333. #endif          /*  __DOOMDEF__ */
  334. /* ----------------------------------------------------------------------------- */
  335. /*  */
  336. /*  $Log:$ */
  337. /*  */
  338. /* ----------------------------------------------------------------------------- */
  339.