[go: up one dir, main page]

Menu

[904618]: / src / g_state.h  Maximize  Restore  History

Download this file

256 lines (208 with data), 7.6 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
// -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
// ----------------------------------------------------------------------------
// :oCCCCOCoc.
// .cCO8OOOOOOOOO8Oo:
// .oOO8OOOOOOOOOOOOOOOCc
// cO8888: .:oOOOOC. TM
// :888888: :CCCc .oOOOOC. ### ### #########
// C888888: .ooo: .C######## ##### ##### ###### ###### ##########
// O888888: .oO### ### ##### ##### ######## ######## #### ###
// C888888: :8O. .C########## ### #### ### ## ## ## ## #### ###
// :8@@@@8: :888c o### ### #### ### ######## ######## ##########
// :8@@@@C C@@@@ oo######## ### ## ### ###### ###### #########
// cO@@@@@@@@@@@@@@@@@Oc0
// :oO8@@@@@@@@@@Oo.
// .oCOOOOOCc. http://remood.org/
// ----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 2008-2013 GhostlyDeath <ghostlydeath@remood.org>
// <ghostlydeath@gmail.com>
// ----------------------------------------------------------------------------
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 3
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// ----------------------------------------------------------------------------
// DESCRIPTION: Doom/Hexen game states
#ifndef __G_STATE_H__
#define __G_STATE_H__
/*****************************************************************************/
/***************
*** INCLUDES ***
***************/
#include "doomtype.h"
/****************
*** CONSTANTS ***
****************/
/* G_State_t -- Current game state */
typedef enum
{
GS_NULL = 0, // at begin
GS_LEVEL, // we are playing
GS_INTERMISSION, // gazing at the intermission screen
GS_FINALE, // game final animation
GS_DEMOSCREEN, // looking at a demo
//legacy
GS_DEDICATEDSERVER, // added 27-4-98 : new state for dedicated server
GS_WAITINGPLAYERS, // added 3-9-98 : waiting player in net game
// GhostlyDeath <May 17, 2012> -- Waiting for join window
GS_WAITFORJOINWINDOW, // Player must wait to join
} G_State_t;
/* G_Action_t -- Current Action */
typedef enum
{
ga_nothing,
ga_completed,
ga_worlddone,
} G_Action_t;
typedef enum
{
shareware, // DOOM 1 shareware, E1, M9
registered, // DOOM 1 registered, E3, M27
commercial, // DOOM 2 retail, E1 M34
// DOOM 2 german edition not handled
retail, // DOOM 1 retail, E4, M36
indetermined, // Well, no IWAD found.
chexquest1, // DarkWolf95:July 14, 2003: Chex Quest Support
numgamemodes,
heretic
} gamemode_t;
// Mission packs - might be useful for TC stuff?
typedef enum
{
doom, // DOOM 1
doom2, // DOOM 2
pack_tnt, // TNT mission pack
pack_plut, // Plutonia pack
pack_chex, // Chex Quest
none,
numgamemissions
} gamemission_t;
/* CoreIWADFlags_t -- IWAD flags */
typedef enum CoreIWADFlags_e
{
CIF_SHAREWARE = 0x0000001, // Shareware Mode
CIF_COMMERCIAL = 0x0000002, // Commercial
CIF_REGISTERED = 0x0000004, // Registered Mode
CIF_CANFILE = 0x0000008, // Can -file -deh, etc.
CIF_EXTENDED = 0x0000010, // Extended Mode
CIF_DOWNLOADABLE = 0x0000020, // Can be downloaded
CIF_DOUBLEWARP = 0x0000040, // Warp Takes two arguments
CIF_FREEDOOM = 0x0000080, // Free content!
} CoreIWADFlags_t;
/* CoreGame_t -- Game being played... */
typedef enum CoreGame_e
{
CG_UNKNOWN, // Unknown game
CG_DOOM = UINT32_C(0x01), // Doom is being played
CG_HERETIC = UINT32_C(0x02), // Heretic is being played
CG_HEXEN = UINT32_C(0x04), // Hexen is being played
CG_STRIFE = UINT32_C(0x08), // Strife is being played
CG_DOOMHER = CG_DOOM | CG_HERETIC,
CG_ALL = CG_DOOM | CG_HERETIC | CG_HEXEN | CG_STRIFE,
NUMCOREGAMES
} CoreGame_t;
// skill levels
typedef enum
{
sk_baby,
sk_easy,
sk_medium,
sk_hard,
sk_nightmare
} G_Skill_t;
/* P_GameMode_t -- Game Modes */
typedef enum P_GameMode_e
{
PGM_COOP, // Cooperative
PGM_COUNTEROP, // Counteroperative
PGM_DM, // Deathmatch
PGM_CTF, // CTF
PGM_FLAGTAG, // Hold the Flag
PGM_KOTH, // King of the Hill
PGM_POPACAP, // Pop a Cap
PGM_LMS, // Last Man Standing
PGM_SURVIVAL, // Survival
PGM_CUSTOM, // Custom Game Mode
NUMPGAMEMODES
} P_GameMode_t;
typedef enum D_ModelMode_s
{
DMM_DEFAULT, // Default PC
DMM_GCW, // GCW Zero
DMM_WII, // Nintendo Wii
} D_ModelMode_t;
/*****************
*** STRUCTURES ***
*****************/
/* D_IWADInfoEx_t -- Extended IWAD Info */
typedef struct D_IWADInfoEx_s
{
/* Base Info */
const char* NiceTitle; // Nice IWAD Title name
const char* NetName; // Network Name
const char* ForceNames; // Names for forcing [conf = 500]
const char* BaseName; // WAD Basename [conf = 5]
const char* SimpleSum; // Simple sum of WAD [conf = 40]
const char* MD5Sum; // MD5 Sum of WAD [conf = 50]
const char* SHA1Sum; // SHA-1 Sum of WAD [conf = 60]
const char* Lumps; // Identifying lumps [conf = 1]
const char* BonusLumps; // Unique Lumps [conf = 35]
uint32_t Size; // Size of WAD [conf = 15]
uint32_t NumLumps; // Number of lumps in WAD [conf = 15]
/* Game Info */
CoreGame_t CoreGame; // Core Game
bool_t CanDistrib; // Distributable? (Not illegal to give away)
const char* MapInfoLump; // Map Info Lump
const char* TitleScreenLump; // Title screen sequence lump
uint32_t Flags; // Flags for game
const char* MapNameFormat; // Format of map names
gamemission_t mission; // Deprecated mission
gamemode_t mode; // Deprecated mode
} D_IWADInfoEx_t;
/**************
*** GLOBALS ***
**************/
extern G_State_t gamestate;
extern G_State_t wipegamestate;
extern gamemode_t gamemode;
extern gamemission_t gamemission;
extern G_Action_t gameaction;
extern CoreGame_t g_CoreGame; // Core game mode
extern const void* g_ReMooDPtr; // Pointer to remood.wad
extern const char* g_IWADMapInfoName; // Name of IWAD MAPINFO
extern uint32_t g_IWADFlags; // IWAD Flags
extern bool_t g_DedicatedServer; // Dedicated Server
extern tic_t gametic;
extern tic_t g_ProgramTic;
extern tic_t pagetic;
extern int demosequence;
extern bool_t singletics;
extern bool_t demoplayback;
extern bool_t demorecording;
extern bool_t timingdemo;
extern bool_t singledemo;
extern bool_t g_TitleScreenDemo;
extern D_ModelMode_t g_ModelMode; // Model to use
extern bool_t paused; // Game Pause?
extern bool_t noblit;
extern tic_t leveltime;
extern int totalkills;
extern int totalitems;
extern int totalsecret;
extern int32_t g_MapKIS[5];
/****************
*** FUNCTIONS ***
****************/
D_IWADInfoEx_t* D_GetThisIWAD(void);
D_IWADInfoEx_t* D_GetIWADInfoByNum(const uint32_t a_Num);
const char* D_FieldNumber(const char* const a_Str, const size_t a_Num);
void D_InitModelMode(void);
// Was the only prototype in p_tick.h
void P_Ticker(void);
#endif /* __G_STATE_H__ */