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