doomdef.h 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. /* Emacs style mode select -*- C++ -*-
  2. *-----------------------------------------------------------------------------
  3. *
  4. *
  5. * PrBoom: a Doom port merged with LxDoom and LSDLDoom
  6. * based on BOOM, a modified and improved DOOM engine
  7. * Copyright (C) 1999 by
  8. * id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman
  9. * Copyright (C) 1999-2000 by
  10. * Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze
  11. * Copyright 2005, 2006 by
  12. * Florian Schulze, Colin Phipps, Neil Stevens, Andrey Budko
  13. *
  14. * This program is free software; you can redistribute it and/or
  15. * modify it under the terms of the GNU General Public License
  16. * as published by the Free Software Foundation; either version 2
  17. * of the License, or (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, write to the Free Software
  26. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  27. * 02111-1307, USA.
  28. *
  29. * DESCRIPTION:
  30. * Internally used data structures for virtually everything,
  31. * key definitions, lots of other stuff.
  32. *
  33. *-----------------------------------------------------------------------------*/
  34. #ifndef __DOOMDEF__
  35. #define __DOOMDEF__
  36. /* use config.h if autoconf made one -- josh */
  37. #ifdef HAVE_CONFIG_H
  38. #include "config.h"
  39. #endif
  40. // killough 4/25/98: Make gcc extensions mean nothing on other compilers
  41. #ifndef __GNUC__
  42. #define __attribute__(x)
  43. #endif
  44. // This must come first, since it redefines malloc(), free(), etc. -- killough:
  45. #include "z_zone.h"
  46. #include <stdio.h>
  47. #include <stdlib.h>
  48. #include <string.h>
  49. #include <ctype.h>
  50. #include <limits.h>
  51. // this should go here, not in makefile/configure.ac -- josh
  52. #ifndef O_BINARY
  53. #define O_BINARY 0
  54. #endif
  55. #include "m_swap.h"
  56. #include "version.h"
  57. // Game mode handling - identify IWAD version
  58. // to handle IWAD dependend animations etc.
  59. typedef enum {
  60. shareware, // DOOM 1 shareware, E1, M9
  61. registered, // DOOM 1 registered, E3, M27
  62. commercial, // DOOM 2 retail, E1 M34 (DOOM 2 german edition not handled)
  63. retail, // DOOM 1 retail, E4, M36
  64. indetermined // Well, no IWAD found.
  65. } GameMode_t;
  66. // Mission packs - might be useful for TC stuff?
  67. typedef enum {
  68. doom, // DOOM 1
  69. doom2, // DOOM 2
  70. pack_tnt, // TNT mission pack
  71. pack_plut, // Plutonia pack
  72. none
  73. } GameMission_t;
  74. // Identify language to use, software localization.
  75. typedef enum {
  76. english,
  77. french,
  78. german,
  79. unknown
  80. } Language_t;
  81. //
  82. // For resize of screen, at start of game.
  83. //
  84. #define BASE_WIDTH 320
  85. // It is educational but futile to change this
  86. // scaling e.g. to 2. Drawing of status bar,
  87. // menues etc. is tied to the scale implied
  88. // by the graphics.
  89. #define INV_ASPECT_RATIO 0.625 /* 0.75, ideally */
  90. // killough 2/8/98: MAX versions for maximum screen sizes
  91. // allows us to avoid the overhead of dynamic allocation
  92. // when multiple screen sizes are supported
  93. // proff 08/17/98: Changed for high-res
  94. #define MAX_SCREENWIDTH 2048
  95. #define MAX_SCREENHEIGHT 1536
  96. // SCREENWIDTH and SCREENHEIGHT define the visible size
  97. extern int SCREENWIDTH;
  98. extern int SCREENHEIGHT;
  99. // SCREENPITCH is the size of one line in the buffer and
  100. // can be bigger than the SCREENWIDTH depending on the size
  101. // of one pixel (8, 16 or 32 bit) and the padding at the
  102. // end of the line caused by hardware considerations
  103. extern int SCREENPITCH;
  104. // The maximum number of players, multiplayer/networking.
  105. #define MAXPLAYERS 4
  106. // phares 5/14/98:
  107. // DOOM Editor Numbers (aka doomednum in mobj_t)
  108. #define DEN_PLAYER5 4001
  109. #define DEN_PLAYER6 4002
  110. #define DEN_PLAYER7 4003
  111. #define DEN_PLAYER8 4004
  112. // State updates, number of tics / second.
  113. #define TICRATE 35
  114. // The current state of the game: whether we are playing, gazing
  115. // at the intermission screen, the game final animation, or a demo.
  116. typedef enum {
  117. GS_LEVEL,
  118. GS_INTERMISSION,
  119. GS_FINALE,
  120. GS_DEMOSCREEN
  121. } gamestate_t;
  122. //
  123. // Difficulty/skill settings/filters.
  124. //
  125. // These are Thing flags
  126. // Skill flags.
  127. #define MTF_EASY 1
  128. #define MTF_NORMAL 2
  129. #define MTF_HARD 4
  130. // Deaf monsters/do not react to sound.
  131. #define MTF_AMBUSH 8
  132. /* killough 11/98 */
  133. #define MTF_NOTSINGLE 16
  134. #define MTF_NOTDM 32
  135. #define MTF_NOTCOOP 64
  136. #define MTF_FRIEND 128
  137. #define MTF_RESERVED 256
  138. typedef enum {
  139. sk_none=-1, //jff 3/24/98 create unpicked skill setting
  140. sk_baby=0,
  141. sk_easy,
  142. sk_medium,
  143. sk_hard,
  144. sk_nightmare
  145. } skill_t;
  146. //
  147. // Key cards.
  148. //
  149. typedef enum {
  150. it_bluecard,
  151. it_yellowcard,
  152. it_redcard,
  153. it_blueskull,
  154. it_yellowskull,
  155. it_redskull,
  156. NUMCARDS
  157. } card_t;
  158. // The defined weapons, including a marker
  159. // indicating user has not changed weapon.
  160. typedef enum {
  161. wp_fist,
  162. wp_pistol,
  163. wp_shotgun,
  164. wp_chaingun,
  165. wp_missile,
  166. wp_plasma,
  167. wp_bfg,
  168. wp_chainsaw,
  169. wp_supershotgun,
  170. NUMWEAPONS,
  171. wp_nochange // No pending weapon change.
  172. } weapontype_t;
  173. // Ammunition types defined.
  174. typedef enum {
  175. am_clip, // Pistol / chaingun ammo.
  176. am_shell, // Shotgun / double barreled shotgun.
  177. am_cell, // Plasma rifle, BFG.
  178. am_misl, // Missile launcher.
  179. NUMAMMO,
  180. am_noammo // Unlimited for chainsaw / fist.
  181. } ammotype_t;
  182. // Power up artifacts.
  183. typedef enum {
  184. pw_invulnerability,
  185. pw_strength,
  186. pw_invisibility,
  187. pw_ironfeet,
  188. pw_allmap,
  189. pw_infrared,
  190. NUMPOWERS
  191. } powertype_t;
  192. // Power up durations (how many seconds till expiration).
  193. typedef enum {
  194. INVULNTICS = (30*TICRATE),
  195. INVISTICS = (60*TICRATE),
  196. INFRATICS = (120*TICRATE),
  197. IRONTICS = (60*TICRATE)
  198. } powerduration_t;
  199. // DOOM keyboard definition.
  200. // This is the stuff configured by Setup.Exe.
  201. // Most key data are simple ascii (uppercased).
  202. #define KEYD_RIGHTARROW 0xae
  203. #define KEYD_LEFTARROW 0xac
  204. #define KEYD_UPARROW 0xad
  205. #define KEYD_DOWNARROW 0xaf
  206. #define KEYD_ESCAPE 27
  207. #define KEYD_ENTER 13
  208. #define KEYD_TAB 9
  209. #define KEYD_F1 (0x80+0x3b)
  210. #define KEYD_F2 (0x80+0x3c)
  211. #define KEYD_F3 (0x80+0x3d)
  212. #define KEYD_F4 (0x80+0x3e)
  213. #define KEYD_F5 (0x80+0x3f)
  214. #define KEYD_F6 (0x80+0x40)
  215. #define KEYD_F7 (0x80+0x41)
  216. #define KEYD_F8 (0x80+0x42)
  217. #define KEYD_F9 (0x80+0x43)
  218. #define KEYD_F10 (0x80+0x44)
  219. #define KEYD_F11 (0x80+0x57)
  220. #define KEYD_F12 (0x80+0x58)
  221. #define KEYD_BACKSPACE 127
  222. #define KEYD_PAUSE 0xff
  223. #define KEYD_EQUALS 0x3d
  224. #define KEYD_MINUS 0x2d
  225. #define KEYD_RSHIFT (0x80+0x36)
  226. #define KEYD_RCTRL (0x80+0x1d)
  227. #define KEYD_RALT (0x80+0x38)
  228. #define KEYD_LALT KEYD_RALT
  229. #define KEYD_CAPSLOCK 0xba // phares
  230. // phares 3/2/98:
  231. #define KEYD_INSERT 0xd2
  232. #define KEYD_HOME 0xc7
  233. #define KEYD_PAGEUP 0xc9
  234. #define KEYD_PAGEDOWN 0xd1
  235. #define KEYD_DEL 0xc8
  236. #define KEYD_END 0xcf
  237. #define KEYD_SCROLLLOCK 0xc6
  238. #define KEYD_SPACEBAR 0x20
  239. // phares 3/2/98
  240. #define KEYD_NUMLOCK 0xC5 // killough 3/6/98
  241. // cph - Add the numeric keypad keys, as suggested by krose 4/22/99:
  242. // The way numbers are assigned to keys is a mess, but it's too late to
  243. // change that easily. At least these additions are don neatly.
  244. // Codes 0x100-0x200 are reserved for number pad
  245. #define KEYD_KEYPAD0 (0x100 + '0')
  246. #define KEYD_KEYPAD1 (0x100 + '1')
  247. #define KEYD_KEYPAD2 (0x100 + '2')
  248. #define KEYD_KEYPAD3 (0x100 + '3')
  249. #define KEYD_KEYPAD4 (0x100 + '4')
  250. #define KEYD_KEYPAD5 (0x100 + '5')
  251. #define KEYD_KEYPAD6 (0x100 + '6')
  252. #define KEYD_KEYPAD7 (0x100 + '7')
  253. #define KEYD_KEYPAD8 (0x100 + '8')
  254. #define KEYD_KEYPAD9 (0x100 + '9')
  255. #define KEYD_KEYPADENTER (0x100 + KEYD_ENTER)
  256. #define KEYD_KEYPADDIVIDE (0x100 + '/')
  257. #define KEYD_KEYPADMULTIPLY (0x100 + '*')
  258. #define KEYD_KEYPADMINUS (0x100 + '-')
  259. #define KEYD_KEYPADPLUS (0x100 + '+')
  260. #define KEYD_KEYPADPERIOD (0x100 + '.')
  261. // phares 4/19/98:
  262. // Defines Setup Screen groups that config variables appear in.
  263. // Used when resetting the defaults for every item in a Setup group.
  264. typedef enum {
  265. ss_none,
  266. ss_keys,
  267. ss_weap,
  268. ss_stat,
  269. ss_auto,
  270. ss_enem,
  271. ss_mess,
  272. ss_chat,
  273. ss_gen, /* killough 10/98 */
  274. ss_comp, /* killough 10/98 */
  275. ss_max
  276. } ss_types;
  277. // phares 3/20/98:
  278. //
  279. // Player friction is variable, based on controlling
  280. // linedefs. More friction can create mud, sludge,
  281. // magnetized floors, etc. Less friction can create ice.
  282. #define MORE_FRICTION_MOMENTUM 15000 // mud factor based on momentum
  283. #define ORIG_FRICTION 0xE800 // original value
  284. #define ORIG_FRICTION_FACTOR 2048 // original value
  285. #endif // __DOOMDEF__