doomdef.h 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  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. #ifdef IPHONE // JDC
  95. #define MAX_SCREENWIDTH 1024
  96. #define MAX_SCREENHEIGHT 768
  97. #else
  98. #define MAX_SCREENWIDTH 2048
  99. #define MAX_SCREENHEIGHT 1536
  100. #endif
  101. // SCREENWIDTH and SCREENHEIGHT define the visible size
  102. extern int SCREENWIDTH;
  103. extern int SCREENHEIGHT;
  104. // SCREENPITCH is the size of one line in the buffer and
  105. // can be bigger than the SCREENWIDTH depending on the size
  106. // of one pixel (8, 16 or 32 bit) and the padding at the
  107. // end of the line caused by hardware considerations
  108. extern int SCREENPITCH;
  109. // The maximum number of players, multiplayer/networking.
  110. #define MAXPLAYERS 4
  111. // phares 5/14/98:
  112. // DOOM Editor Numbers (aka doomednum in mobj_t)
  113. #define DEN_PLAYER5 4001
  114. #define DEN_PLAYER6 4002
  115. #define DEN_PLAYER7 4003
  116. #define DEN_PLAYER8 4004
  117. // State updates, number of tics / second.
  118. #define TICRATE 35
  119. // The current state of the game: whether we are playing, gazing
  120. // at the intermission screen, the game final animation, or a demo.
  121. typedef enum {
  122. GS_LEVEL,
  123. GS_INTERMISSION,
  124. GS_FINALE,
  125. GS_DEMOSCREEN
  126. } gamestate_t;
  127. //
  128. // Difficulty/skill settings/filters.
  129. //
  130. // These are Thing flags
  131. // Skill flags.
  132. #define MTF_EASY 1
  133. #define MTF_NORMAL 2
  134. #define MTF_HARD 4
  135. // Deaf monsters/do not react to sound.
  136. #define MTF_AMBUSH 8
  137. /* killough 11/98 */
  138. #define MTF_NOTSINGLE 16
  139. #define MTF_NOTDM 32
  140. #define MTF_NOTCOOP 64
  141. #define MTF_FRIEND 128
  142. #define MTF_RESERVED 256
  143. typedef enum {
  144. sk_none=-1, //jff 3/24/98 create unpicked skill setting
  145. sk_baby=0,
  146. sk_easy,
  147. sk_medium,
  148. sk_hard,
  149. sk_nightmare
  150. } skill_t;
  151. //
  152. // Key cards.
  153. //
  154. typedef enum {
  155. it_bluecard,
  156. it_yellowcard,
  157. it_redcard,
  158. it_blueskull,
  159. it_yellowskull,
  160. it_redskull,
  161. NUMCARDS
  162. } card_t;
  163. // The defined weapons, including a marker
  164. // indicating user has not changed weapon.
  165. typedef enum {
  166. wp_fist,
  167. wp_pistol,
  168. wp_shotgun,
  169. wp_chaingun,
  170. wp_missile,
  171. wp_plasma,
  172. wp_bfg,
  173. wp_chainsaw,
  174. wp_supershotgun,
  175. NUMWEAPONS,
  176. wp_nochange // No pending weapon change.
  177. } weapontype_t;
  178. // Ammunition types defined.
  179. typedef enum {
  180. am_clip, // Pistol / chaingun ammo.
  181. am_shell, // Shotgun / double barreled shotgun.
  182. am_cell, // Plasma rifle, BFG.
  183. am_misl, // Missile launcher.
  184. NUMAMMO,
  185. am_noammo // Unlimited for chainsaw / fist.
  186. } ammotype_t;
  187. // Power up artifacts.
  188. typedef enum {
  189. pw_invulnerability,
  190. pw_strength,
  191. pw_invisibility,
  192. pw_ironfeet,
  193. pw_allmap,
  194. pw_infrared,
  195. NUMPOWERS
  196. } powertype_t;
  197. // Power up durations (how many seconds till expiration).
  198. typedef enum {
  199. INVULNTICS = (30*TICRATE),
  200. INVISTICS = (60*TICRATE),
  201. INFRATICS = (120*TICRATE),
  202. IRONTICS = (60*TICRATE)
  203. } powerduration_t;
  204. // DOOM keyboard definition.
  205. // This is the stuff configured by Setup.Exe.
  206. // Most key data are simple ascii (uppercased).
  207. #define KEYD_RIGHTARROW 0xae
  208. #define KEYD_LEFTARROW 0xac
  209. #define KEYD_UPARROW 0xad
  210. #define KEYD_DOWNARROW 0xaf
  211. #define KEYD_ESCAPE 27
  212. #define KEYD_ENTER 13
  213. #define KEYD_TAB 9
  214. #define KEYD_F1 (0x80+0x3b)
  215. #define KEYD_F2 (0x80+0x3c)
  216. #define KEYD_F3 (0x80+0x3d)
  217. #define KEYD_F4 (0x80+0x3e)
  218. #define KEYD_F5 (0x80+0x3f)
  219. #define KEYD_F6 (0x80+0x40)
  220. #define KEYD_F7 (0x80+0x41)
  221. #define KEYD_F8 (0x80+0x42)
  222. #define KEYD_F9 (0x80+0x43)
  223. #define KEYD_F10 (0x80+0x44)
  224. #define KEYD_F11 (0x80+0x57)
  225. #define KEYD_F12 (0x80+0x58)
  226. #define KEYD_BACKSPACE 127
  227. #define KEYD_PAUSE 0xff
  228. #define KEYD_EQUALS 0x3d
  229. #define KEYD_MINUS 0x2d
  230. #define KEYD_RSHIFT (0x80+0x36)
  231. #define KEYD_RCTRL (0x80+0x1d)
  232. #define KEYD_RALT (0x80+0x38)
  233. #define KEYD_LALT KEYD_RALT
  234. #define KEYD_CAPSLOCK 0xba // phares
  235. // phares 3/2/98:
  236. #define KEYD_INSERT 0xd2
  237. #define KEYD_HOME 0xc7
  238. #define KEYD_PAGEUP 0xc9
  239. #define KEYD_PAGEDOWN 0xd1
  240. #define KEYD_DEL 0xc8
  241. #define KEYD_END 0xcf
  242. #define KEYD_SCROLLLOCK 0xc6
  243. #define KEYD_SPACEBAR 0x20
  244. // phares 3/2/98
  245. #define KEYD_NUMLOCK 0xC5 // killough 3/6/98
  246. // cph - Add the numeric keypad keys, as suggested by krose 4/22/99:
  247. // The way numbers are assigned to keys is a mess, but it's too late to
  248. // change that easily. At least these additions are don neatly.
  249. // Codes 0x100-0x200 are reserved for number pad
  250. #define KEYD_KEYPAD0 (0x100 + '0')
  251. #define KEYD_KEYPAD1 (0x100 + '1')
  252. #define KEYD_KEYPAD2 (0x100 + '2')
  253. #define KEYD_KEYPAD3 (0x100 + '3')
  254. #define KEYD_KEYPAD4 (0x100 + '4')
  255. #define KEYD_KEYPAD5 (0x100 + '5')
  256. #define KEYD_KEYPAD6 (0x100 + '6')
  257. #define KEYD_KEYPAD7 (0x100 + '7')
  258. #define KEYD_KEYPAD8 (0x100 + '8')
  259. #define KEYD_KEYPAD9 (0x100 + '9')
  260. #define KEYD_KEYPADENTER (0x100 + KEYD_ENTER)
  261. #define KEYD_KEYPADDIVIDE (0x100 + '/')
  262. #define KEYD_KEYPADMULTIPLY (0x100 + '*')
  263. #define KEYD_KEYPADMINUS (0x100 + '-')
  264. #define KEYD_KEYPADPLUS (0x100 + '+')
  265. #define KEYD_KEYPADPERIOD (0x100 + '.')
  266. // phares 4/19/98:
  267. // Defines Setup Screen groups that config variables appear in.
  268. // Used when resetting the defaults for every item in a Setup group.
  269. typedef enum {
  270. ss_none,
  271. ss_keys,
  272. ss_weap,
  273. ss_stat,
  274. ss_auto,
  275. ss_enem,
  276. ss_mess,
  277. ss_chat,
  278. ss_gen, /* killough 10/98 */
  279. ss_comp, /* killough 10/98 */
  280. ss_max
  281. } ss_types;
  282. // phares 3/20/98:
  283. //
  284. // Player friction is variable, based on controlling
  285. // linedefs. More friction can create mud, sludge,
  286. // magnetized floors, etc. Less friction can create ice.
  287. #define MORE_FRICTION_MOMENTUM 15000 // mud factor based on momentum
  288. #define ORIG_FRICTION 0xE800 // original value
  289. #define ORIG_FRICTION_FACTOR 2048 // original value
  290. #endif // __DOOMDEF__