| 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 |
|
| 32 |
#ifndef __G_GAME__ |
| 33 |
#define __G_GAME__ |
| 34 |
|
| 35 |
#include "doomdef.h" |
| 36 |
#include "d_event.h" |
| 37 |
#include "d_ticcmd.h" |
| 38 |
#include "tables.h" |
| 39 |
|
| 40 |
// |
| 41 |
// GAME |
| 42 |
// |
| 43 |
|
| 44 |
#define DEMOMARKER 0x80 |
| 45 |
|
| 46 |
dboolean G_Responder(event_t *ev); |
| 47 |
dboolean G_CheckDemoStatus(void); |
| 48 |
void G_DeathMatchSpawnPlayer(int playernum); |
| 49 |
void G_InitNew(int skill, int episode, int map, dboolean prepare); |
| 50 |
void G_DeferedInitNew(int skill, int episode, int map); |
| 51 |
void G_DeferedPlayDemo(const char *demo); // CPhipps - const |
| 52 |
void G_LoadGame(int slot); // killough 5/15/98 |
| 53 |
void G_ForcedLoadGame(void); // killough 5/15/98: forced loadgames |
| 54 |
void G_DoLoadGame(void); |
| 55 |
void G_SaveGame(int slot, const char *description); // Called by M_Responder. |
| 56 |
void G_BeginRecording(void); |
| 57 |
void G_ExitLevel(int position); |
| 58 |
void G_SecretExitLevel(int position); |
| 59 |
void G_WorldDone(void); |
| 60 |
void G_EndGame(void); /* cph - make m_menu.c call a G_* function for this */ |
| 61 |
void G_Ticker(void); |
| 62 |
void G_ReloadDefaults(void); // killough 3/1/98: loads game defaults |
| 63 |
void G_RefreshFastMonsters(void); // killough 4/10/98: sets -fast parameters |
| 64 |
void G_DoNewGame(void); |
| 65 |
void G_DoReborn(int playernum); |
| 66 |
void G_StartDemoPlayback(const byte *buffer, int length, int behaviour); |
| 67 |
void G_DoPlayDemo(void); |
| 68 |
void G_DoCompleted(void); |
| 69 |
void G_WriteDemoTiccmd(ticcmd_t *cmd); |
| 70 |
void G_DoWorldDone(void); |
| 71 |
void G_Compatibility(void); |
| 72 |
const byte *G_ReadOptions(const byte *demo_p); /* killough 3/1/98 - cph: const byte* */ |
| 73 |
byte *G_WriteOptions(byte *demo_p); // killough 3/1/98 |
| 74 |
void G_PlayerReborn(int player); |
| 75 |
void G_DoVictory(void); |
| 76 |
void G_BuildTiccmd (ticcmd_t* cmd); // CPhipps - move decl to header |
| 77 |
void G_ReadOneTick(ticcmd_t* cmd, const byte **data_p); |
| 78 |
void G_ChangedPlayerColour(int pn, int cl); // CPhipps - On-the-fly player colour changing |
| 79 |
void G_MakeSpecialEvent(buttoncode_t bc, ...); /* cph - new event stuff */ |
| 80 |
int G_ValidateMapName(const char *mapname, int *pEpi, int *pMap); |
| 81 |
|
| 82 |
//e6y |
| 83 |
void G_ContinueDemo(const char *playback_name); |
| 84 |
void G_SetSpeed(dboolean force); |
| 85 |
|
| 86 |
//e6y |
| 87 |
#define RDH_SAFE 0x00000001 |
| 88 |
#define RDH_SKIP_HEADER 0x00000002 |
| 89 |
const byte* G_ReadDemoHeaderEx(const byte* demo_p, size_t size, unsigned int params); |
| 90 |
void G_CalculateDemoParams(const byte *demo_p); |
| 91 |
|
| 92 |
// killough 1/18/98: Doom-style printf; killough 4/25/98: add gcc attributes |
| 93 |
// CPhipps - renames to doom_printf to avoid name collision with glibc |
| 94 |
void doom_printf(const char *, ...) __attribute__((format(printf,1,2))); |
| 95 |
|
| 96 |
// killough 5/2/98: moved from m_misc.c: |
| 97 |
|
| 98 |
extern int key_forward; |
| 99 |
extern int key_backward; |
| 100 |
|
| 101 |
extern dboolean haswolflevels; //jff 4/18/98 wolf levels present |
| 102 |
extern dboolean secretexit; |
| 103 |
|
| 104 |
// killough 5/2/98: moved from d_deh.c: |
| 105 |
// Par times (new item with BOOM) - from g_game.c |
| 106 |
extern int pars[5][10]; // hardcoded array size |
| 107 |
extern int cpars[]; // hardcoded array size |
| 108 |
// CPhipps - Make savedesciption visible in wider scope |
| 109 |
#define SAVEDESCLEN 32 |
| 110 |
extern char savedescription[SAVEDESCLEN]; // Description to save in savegame |
| 111 |
|
| 112 |
/* cph - compatibility level strings */ |
| 113 |
extern const char * comp_lev_str[]; |
| 114 |
|
| 115 |
// Hexen Skill Strings |
| 116 |
extern const char * hexen_skill_fighter[5]; |
| 117 |
extern const char * hexen_skill_cleric[5]; |
| 118 |
extern const char * hexen_skill_mage[5]; |
| 119 |
|
| 120 |
// e6y |
| 121 |
// There is a new command-line switch "-shorttics". |
| 122 |
// This makes it possible to practice routes and tricks |
| 123 |
// (e.g. glides, where this makes a significant difference) |
| 124 |
// with the same mouse behaviour as when recording, |
| 125 |
// but without having to be recording every time. |
| 126 |
extern int shorttics; |
| 127 |
extern int longtics; |
| 128 |
|
| 129 |
// Allows use of HELP2 screen for PWADs under DOOM 1 |
| 130 |
extern int pwad_help2_check; |
| 131 |
|
| 132 |
// hexen |
| 133 |
|
| 134 |
void G_Completed(int map, int position, int flags, angle_t angle); |
| 135 |
|
| 136 |
#endif |