g_game.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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: Main game control interface.
  30. *-----------------------------------------------------------------------------*/
  31. #ifndef __G_GAME__
  32. #define __G_GAME__
  33. #include "doomdef.h"
  34. #include "d_event.h"
  35. #include "d_ticcmd.h"
  36. //
  37. // GAME
  38. //
  39. // killough 5/2/98: number of bytes reserved for saving options
  40. #define GAME_OPTION_SIZE 64
  41. boolean G_Responder(event_t *ev);
  42. boolean G_CheckDemoStatus(void);
  43. void G_DeathMatchSpawnPlayer(int playernum);
  44. void G_InitNew(skill_t skill, int episode, int map);
  45. void G_DeferedInitNew(skill_t skill, int episode, int map);
  46. void G_DeferedPlayDemo(const char *demo); // CPhipps - const
  47. void G_LoadGame(int slot, boolean is_command); // killough 5/15/98
  48. void G_ForcedLoadGame(void); // killough 5/15/98: forced loadgames
  49. boolean G_SaveGameValid(void);
  50. void G_DoLoadGame(void);
  51. void G_SaveGame(int slot, const char *description); // Called by M_Responder.
  52. void G_BeginRecording(void);
  53. // CPhipps - const on these string params
  54. void G_RecordDemo(const char *name); // Only called by startup code.
  55. void G_ExitLevel(void);
  56. void G_SecretExitLevel(void);
  57. void G_WorldDone(void);
  58. void G_EndGame(void); /* cph - make m_menu.c call a G_* function for this */
  59. void G_Ticker(void);
  60. void G_ReloadDefaults(void); // killough 3/1/98: loads game defaults
  61. void G_SaveGameName(char *, size_t, int, boolean); /* killough 3/22/98: sets savegame filename */
  62. void G_SetFastParms(int); // killough 4/10/98: sets -fast parameters
  63. void G_DoNewGame(void);
  64. void G_DoReborn(int playernum);
  65. void G_DoPlayDemo(void);
  66. void G_DoCompleted(void);
  67. void G_ReadDemoTiccmd(ticcmd_t *cmd);
  68. void G_WriteDemoTiccmd(ticcmd_t *cmd);
  69. void G_DoWorldDone(void);
  70. void G_Compatibility(void);
  71. const byte *G_ReadOptions(const byte *demo_p); /* killough 3/1/98 - cph: const byte* */
  72. byte *G_WriteOptions(byte *demo_p); // killough 3/1/98
  73. void G_PlayerReborn(int player);
  74. void G_RestartLevel(void); // CPhipps - menu involked level restart
  75. void G_DoVictory(void);
  76. void G_BuildTiccmd (ticcmd_t* cmd); // CPhipps - move decl to header
  77. void G_ChangedPlayerColour(int pn, int cl); // CPhipps - On-the-fly player colour changing
  78. void G_MakeSpecialEvent(buttoncode_t bc, ...); /* cph - new event stuff */
  79. // killough 1/18/98: Doom-style printf; killough 4/25/98: add gcc attributes
  80. // CPhipps - renames to doom_printf to avoid name collision with glibc
  81. void doom_printf(const char *, ...) __attribute__((format(printf,1,2)));
  82. // killough 5/2/98: moved from m_misc.c:
  83. extern int key_right;
  84. extern int key_left;
  85. extern int key_up;
  86. extern int key_down;
  87. extern int key_menu_right; // phares 3/7/98
  88. extern int key_menu_left; // |
  89. extern int key_menu_up; // V
  90. extern int key_menu_down;
  91. extern int key_menu_backspace; // ^
  92. extern int key_menu_escape; // |
  93. extern int key_menu_enter; // phares 3/7/98
  94. extern int key_strafeleft;
  95. extern int key_straferight;
  96. extern int key_fire;
  97. extern int key_use;
  98. extern int key_strafe;
  99. extern int key_speed;
  100. extern int key_escape; // phares
  101. extern int key_savegame; // |
  102. extern int key_loadgame; // V
  103. extern int key_autorun;
  104. extern int key_reverse;
  105. extern int key_zoomin;
  106. extern int key_zoomout;
  107. extern int key_chat;
  108. extern int key_backspace;
  109. extern int key_enter;
  110. extern int key_help;
  111. extern int key_soundvolume;
  112. extern int key_hud;
  113. extern int key_quicksave;
  114. extern int key_endgame;
  115. extern int key_messages;
  116. extern int key_quickload;
  117. extern int key_quit;
  118. extern int key_gamma;
  119. extern int key_spy;
  120. extern int key_pause;
  121. extern int key_setup;
  122. extern int key_forward;
  123. extern int key_leftturn;
  124. extern int key_rightturn;
  125. extern int key_backward;
  126. extern int key_weapontoggle;
  127. extern int key_weapon1;
  128. extern int key_weapon2;
  129. extern int key_weapon3;
  130. extern int key_weapon4;
  131. extern int key_weapon5;
  132. extern int key_weapon6;
  133. extern int key_weapon7;
  134. extern int key_weapon8;
  135. extern int key_weapon9;
  136. extern int destination_keys[MAXPLAYERS];
  137. extern int key_map_right;
  138. extern int key_map_left;
  139. extern int key_map_up;
  140. extern int key_map_down;
  141. extern int key_map_zoomin;
  142. extern int key_map_zoomout;
  143. extern int key_map;
  144. extern int key_map_gobig;
  145. extern int key_map_follow;
  146. extern int key_map_mark; // ^
  147. extern int key_map_clear; // |
  148. extern int key_map_grid; // phares
  149. extern int key_map_rotate; // cph - map rotation
  150. extern int key_map_overlay;// cph - map overlay
  151. extern int key_screenshot; // killough 2/22/98 -- add key for screenshot
  152. extern int autorun; // always running? // phares
  153. extern int defaultskill; //jff 3/24/98 default skill
  154. extern boolean haswolflevels; //jff 4/18/98 wolf levels present
  155. extern int bodyquesize; // killough 2/8/98: adustable corpse limit
  156. // killough 5/2/98: moved from d_deh.c:
  157. // Par times (new item with BOOM) - from g_game.c
  158. extern int pars[4][10]; // hardcoded array size
  159. extern int cpars[32]; // hardcoded array size
  160. // CPhipps - Make savedesciption visible in wider scope
  161. #define SAVEDESCLEN 32
  162. extern char savedescription[SAVEDESCLEN]; // Description to save in savegame
  163. /* cph - compatibility level strings */
  164. extern const char * comp_lev_str[];
  165. #endif