1 /* Emacs style mode select -*- C++ -*-
2 *-----------------------------------------------------------------------------
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
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
27 * DESCRIPTION: Main game control interface.
28 *-----------------------------------------------------------------------------*/
41 // killough 5/2/98: number of bytes reserved for saving options
42 #define GAME_OPTION_SIZE 64
44 boolean
G_Responder(event_t
*ev
);
45 boolean
G_CheckDemoStatus(void);
46 boolean
G_CheckDemoStatus(void);
47 void G_DeathMatchSpawnPlayer(int playernum
);
48 void G_InitNew(skill_t skill
, int episode
, int map
);
49 void G_DeferedInitNew(skill_t skill
, int episode
, int map
);
50 void G_DeferedPlayDemo(const char *demo
); // CPhipps - const
51 void G_LoadGame(int slot
, boolean is_command
); // killough 5/15/98
52 void G_ForcedLoadGame(void); // killough 5/15/98: forced loadgames
53 void G_DoLoadGame(void);
54 void G_SaveGame(int slot
, char *description
); // Called by M_Responder.
55 void G_BeginRecording(void);
56 // CPhipps - const on these string params
57 void G_RecordDemo(const char *name
); // Only called by startup code.
58 void G_PlayDemo(const char *name
);
59 void G_TimeDemo(const char *name
);
60 void G_ExitLevel(void);
61 void G_SecretExitLevel(void);
62 void G_WorldDone(void);
63 void G_EndGame(void); /* cph - make m_menu.c call a G_* function for this */
65 void G_ReloadDefaults(void); // killough 3/1/98: loads game defaults
66 void G_SaveGameName(char *, size_t, int, boolean
); /* killough 3/22/98: sets savegame filename */
67 void G_SetFastParms(int); // killough 4/10/98: sets -fast parameters
68 void G_DoNewGame(void);
69 void G_DoReborn(int playernum
);
70 void G_DoPlayDemo(void);
71 void G_DoCompleted(void);
72 void G_ReadDemoTiccmd(ticcmd_t
*cmd
);
73 void G_WriteDemoTiccmd(ticcmd_t
*cmd
);
74 void G_DoWorldDone(void);
75 void G_Compatibility(void);
76 const byte
*G_ReadOptions(const byte
*demo_p
); /* killough 3/1/98 - cph: const byte* */
77 byte
*G_WriteOptions(byte
*demo_p
); // killough 3/1/98
78 void G_PlayerReborn(int player
);
79 void G_InitNew(skill_t skill
, int episode
, int map
);
80 void G_RestartLevel(void); // CPhipps - menu involked level restart
81 void G_DoLoadGame(void);
82 void G_DoVictory(void);
83 void G_BuildTiccmd (ticcmd_t
* cmd
); // CPhipps - move decl to header
84 void G_ChangedPlayerColour(int pn
, int cl
); // CPhipps - On-the-fly player colour changing
85 void G_MakeSpecialEvent(buttoncode_t bc
, ...); /* cph - new event stuff */
87 // killough 1/18/98: Doom-style printf; killough 4/25/98: add gcc attributes
88 // CPhipps - renames to doom_printf to avoid name collision with glibc
89 void doom_printf(const char *, ...) __attribute__((format(printf
,1,2)));
91 // killough 5/2/98: moved from m_misc.c:
97 extern int key_menu_right
; // phares 3/7/98
98 extern int key_menu_left
; // |
99 extern int key_menu_up
; // V
100 extern int key_menu_down
;
101 extern int key_menu_backspace
; // ^
102 extern int key_menu_escape
; // |
103 extern int key_menu_enter
; // phares 3/7/98
104 extern int key_strafeleft
;
105 extern int key_straferight
;
109 extern int key_strafe
;
110 extern int key_speed
;
111 extern int key_escape
; // phares
112 extern int key_savegame
; // |
113 extern int key_loadgame
; // V
114 extern int key_autorun
;
115 extern int key_reverse
;
116 extern int key_zoomin
;
117 extern int key_zoomout
;
119 extern int key_backspace
;
120 extern int key_enter
;
122 extern int key_soundvolume
;
124 extern int key_quicksave
;
125 extern int key_endgame
;
126 extern int key_messages
;
127 extern int key_quickload
;
129 extern int key_gamma
;
131 extern int key_pause
;
132 extern int key_setup
;
133 extern int key_forward
;
134 extern int key_leftturn
;
135 extern int key_rightturn
;
136 extern int key_backward
;
137 extern int key_weapon
;
138 extern int key_weapontoggle
;
139 extern int key_weapon1
;
140 extern int key_weapon2
;
141 extern int key_weapon3
;
142 extern int key_weapon4
;
143 extern int key_weapon5
;
144 extern int key_weapon6
;
145 extern int key_weapon7
;
146 extern int key_weapon8
;
147 extern int key_weapon9
;
148 extern int destination_keys
[MAXPLAYERS
];
149 extern int key_map_right
;
150 extern int key_map_left
;
151 extern int key_map_up
;
152 extern int key_map_down
;
153 extern int key_map_zoomin
;
154 extern int key_map_zoomout
;
156 extern int key_map_gobig
;
157 extern int key_map_follow
;
158 extern int key_map_mark
; // ^
159 extern int key_map_clear
; // |
160 extern int key_map_grid
; // phares
161 extern int key_map_rotate
; // cph - map rotation
162 extern int key_map_overlay
;// cph - map overlay
163 extern int key_screenshot
; // killough 2/22/98 -- add key for screenshot
164 extern int autorun
; // always running? // phares
168 extern int joybstrafe
;
169 extern int joybspeed
;
171 extern int mousebfire
;
172 extern int mousebstrafe
;
173 extern int mousebforward
;
176 extern int defaultskill
; //jff 3/24/98 default skill
177 extern boolean haswolflevels
; //jff 4/18/98 wolf levels present
179 extern int bodyquesize
; // killough 2/8/98: adustable corpse limit
181 // killough 5/2/98: moved from d_deh.c:
182 // Par times (new item with BOOM) - from g_game.c
183 extern int pars
[4][10]; // hardcoded array size
184 extern int cpars
[32]; // hardcoded array size
185 // CPhipps - Make savedesciption visible in wider scope
186 #define SAVEDESCLEN 32
187 extern char savedescription
[SAVEDESCLEN
]; // Description to save in savegame
189 /* cph - compatibility level strings */
190 extern const char * comp_lev_str
[];