doomdef.h 6.4 KB

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