[go: up one dir, main page]

Menu

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

Download this file

390 lines (346 with data), 17.2 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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
// -*- 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) 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:
// Demo Compatibility
#ifndef __P_DEMCMP_H__
#define __P_DEMCMP_H__
#include "doomtype.h"
/*****************************
*** EXTENDED GAME SETTINGS ***
*****************************/
// The way settings were done in Legacy were that they were console variables,
// so you would have tons of console variables for every concievable setting.
// However, of all the settings, virtually all of them are either on/off, pure
// integers, floating point numbers, or a specific list of options.
// Doing individually split game settings allows for them to be saved all at
// once and sent by the server all at once, rather than polluting the console
// code with variables splattered all over the place. Game options aren't
// exactly saveable in configs, only the settings that would take effect the
// next game that is played. Also, settings will change drastically when demos
// are played, so you don't want the ugly demoversion checks and you also don't
// want to lost all your game settings when you play a demo or use similar
// settings from the last demo played.
// So Legacy settings are all demoversion and cvars, an ugly mix.
/*** CONSTANTS ***/
#define PEXGSSTRBUFSIZE 32 // String Buffer Size
/* P_XGSType_t -- Setting type for said setting */
typedef enum P_XGSType_e
{
PEXGST_INTEGER, // Integer
PEXGST_FLOAT, // Floating Point
NUMPEXGSTYPES
} P_XGSType_t;
/* P_XGSDisplayAs_t -- Display as whichever value */
typedef enum P_XGSDisplayAs_e
{
PEXGSDA_INTEGER, // Plain Integer
PEXGSDA_YESNO, // Yes/No
PEXGSDA_TIMESECS, // Time in Seconds
PEXGSDA_STRING, // Show as string
PEXGSDA_TIMEMINS, // Time in Minutes
NUMPEXGSDISPLAYAS
} P_XGSDisplayAs_t;
/* P_XGSDemoRange_t -- Range for demo compatibility */
typedef enum P_XGSDemoRange_e
{
PEXGSDR_NOCHECK, // Do not check range here
PEXGSDR_EQUALS, // ==
PEXGSDR_NOT, // !=
PEXGSDR_LESSTHAN, // <
PEXGSDR_GREATERTHAN, // >
PEXGSDR_ATMOST, // <=
PEXGSDR_ATLEAST, // >=
PEXGSDR_MORETHAN = PEXGSDR_GREATERTHAN,
NUMPEXGSDEMORANGES
} P_XGSDemoRange_t;
/* P_XGSGameMode_t -- Game modes for demo compat */
typedef enum P_XGSGameMode_e
{
PEXGSGM_DOOM = 0x01, // Doom
PEXGSGM_HERETIC = 0x02, // Heretic
PEXGSGM_HEXEN = 0x04, // Hexen
PEXGSGM_STRIFE = 0x08, // Strife
PEXGSGM_ANY = PEXGSGM_DOOM | PEXGSGM_HERETIC,
} P_XGSGameMode_t;
/* P_XGSMenuCategory_t -- Menu category */
typedef enum P_XGSMenuCategory_s
{
PEXGSMC_NONE, // Nothing
PEXGSMC_GAME, // Game Settings
PEXGSMC_ITEMS, // Item Settings
PEXGSMC_PLAYERS, // Players
PEXGSMC_MONSTERS, // Monster Settings
PEXGSMC_MISC, // Misc. Settings
PEXGSMC_FUN, // Fun Settings! =D yay!
PEXGSMC_HERETIC, // Heretic Settings
PEXGSMC_COMPAT, // Compatibility Option
PEXGSMC_CTF, // CTF Options
NUMPEXGSMENUCATEGORIES
} P_XGSMenuCategory_t;
/* P_XGSBitID_t -- Bit ID of flag */
typedef enum P_XGSBitID_e
{
PGS_NOTHINGHERE, // Nothing is here
PGS_COENABLEBLOODSPLATS, // Enables blood splats
PGS_CORANDOMLASTLOOK, // Randomized Last Look
PGS_COUNSHIFTVILERAISE, // <<=2 when vile resurrects
PGS_COMODIFYCORPSE, // Modify corpse more in A_Fall()
PGS_CONOSMOKETRAILS, // Disable smoke trails in A_SmokeTrailer()
PGS_COUSEREALSMOKE, // Use real smoke on trails
PGS_COOLDCUTCORPSERADIUS, // Cut corpse radius when !COMODIFYCORPSE
PGS_COSPAWNDROPSONMOFLOORZ, // Spawn dropped items on the map object's floorz
PGS_CODISABLETEAMPLAY, // Disable support for team play
PGS_COSLOWINWATER, // Move slowly in water
PGS_COSLIDEOFFMOFLOOR, // Slide of mobj's floorz rather than real sector
PGS_COOLDFRICTIONMOVE, // Use old friction in XYMovement()
PGS_COOUCHONCEILING, // Go "ouch" when hitting the ceiling
PGS_COENABLESPLASHES, // Enable water splashes
PGS_COENABLEFLOORSMOKE, // Enable floor smoke
PGS_COENABLESMOKE, // Enables spawning of smoke
PGS_CODAMAGEONLAND, // Damage player once landing on floor
PGS_COABSOLUTEANGLE, // Use absolute angle turning rather than relative
PGS_COOLDJUMPOVER, // Use old jump over code
PGS_COENABLESPLATS, // Enable wall splats
PGS_COOLDFLATPUSHERCODE, // Use Old (non 3D floor capable) pushers/pullers
PGS_COSPAWNPLAYERSEARLY, // Spawn players early (during map setup)
PGS_COENABLEUPDOWNSHOOT, // Enable shooting up/down (aiming) when no target found
PGS_CONOUNDERWATERCHECK, // Don't check for things being underwater
PGS_COSPLASHTRANSWATER, // Cause a splash when transitioning to/from water
PGS_COUSEOLDZCHECK, // Use Old Z Checking Code
PGS_COCHECKXYMOVE, // Check X/Y Movement in old Z Code
PGS_COWATERZFRICTION, // Apply friction when underwater on Z plane
PGS_CORANDOMLASTLOOKSPAWN, // Random last look on spawn
PGS_COALWAYSRETURNDEADSPMISSILE, // Always return the missile even if it died on spawn
PGS_COUSEMOUSEAIMING, // When player autoaimed at nothing, use mouse aiming angle
PGS_COFIXPLAYERMISSILEANGLE, // Fix the angle of player missiles being fired
PGS_COREMOVEMOINSKYZ, // When Z movement into sky, do not explode a missile.
PGS_COFORCEAUTOAIM, // Force Auto-aim
PGS_COFORCEBERSERKSWITCH, // Force switching to berserk enabled slots.
PGS_CODOUBLEPICKUPCHECK, // Check twice when picking things up
PGS_CODISABLEMISSILEIMPACTCHECK, // Disable check for missile impact
PGS_COMISSILESPLATONWALL, // Splat missiles on walls
PGS_CONEWBLOODHITSCANCODE, // Use newer blood spewing code.
PGS_CONEWAIMINGCODE, // Use newer aiming code.
PGS_COMISSILESPECHIT, // Missiles could trigger special hits?
PGS_COHITSCANSSLIDEONFLATS, // Hitscans slide on flats
PGS_CONONSOLIDPASSTHRUOLD, // Non-solid pass through (older trigger)
PGS_CONONSOLIDPASSTHRUNEW, // Non-solid pass through (newer trigger)
PGS_COJUMPCHECK, // Check for jumping
PGS_COLINEARMAPTRAVERSE, // Linearly traverse maps
PGS_COONLYTWENTYDMSPOTS, // Only support 20 deathmatch spawn spots.
PGS_COALLOWSTUCKSPAWNS, // Allow getting stuck in spawn spots.
PGS_COUSEOLDBLOOD, // Use Older Doom Blood
PGS_FUNMONSTERFFA, // Monster Free For All
PGS_FUNINFIGHTING, // Monster Infighting
PGS_COCORRECTVILETARGET, // Correct Arch-Vile Target Fire
PGS_FUNMONSTERSMISSMORE, // Monsters miss more
PGS_COMORECRUSHERBLOOD, // More Crusher Blood
PGS_CORANDOMBLOODDIR, // Spew Blood in random directions
PGS_COINFINITEROCKETZ, // Infinite Rocket Z Damage
PGS_COALLOWROCKETJUMPING, // Allow rocket jumping
PGS_COROCKETZTHRUST, // Rocket Z Thrust
PGS_COLIMITMONSTERZMATTACK, // Limit Monster Z Range
PGS_HEREMONSTERTHRESH, // Heretic Monster Threshold
PGS_COVOODOODOLLS, // Voodoo Dolls
PGS_COEXTRATRAILPUFF, // Extra smoke trail puff
PGS_COLOSTSOULTRAILS, // Trails for lost souls
PGS_COTRANSTWOSIDED, // Transparent Two Sided walls
PGS_COENABLEBLOODTIME, // Enable Blood Time
PGS_PLENABLEJUMPING, // Enable Jumping
PGS_COMOUSEAIM, // Aim by mouse
PGS_MONRESPAWNMONSTERS, // Respawn Monsters
PGS_FUNNOTARGETPLAYER, // Don't Target Players, ever!
PGS_MONARCHVILEANYRESPAWN, // Arch-Viles can respawn anything
PGS_COOLDCHECKPOSITION, // Use Old P_CheckPosition()
PGS_COLESSSPAWNSTICKING, // Make spawn sticking less likely
PGS_PLSPAWNTELEFRAG, // Telefrag on spawn
PGS_GAMEONEHITKILLS, // One Hit Kills
PGS_COBETTERPLCORPSEREMOVAL, // Botter bodyqueue management
PGS_PLSPAWNCLUSTERING, // Cluster spawn spots
PGS_COIMPROVEDMOBJONMOBJ, // Improved Mobj on Mobj
PGS_COIMPROVEPATHTRAVERSE, // Smooth out path traversing
PGS_PLJUMPGRAVITY, // Player Jump Gravity
PGS_FUNNOLOCKEDDOORS, // No Doors are locked
PGS_GAMEAIRFRICTION, // Friction in air
PGS_GAMEWATERFRICTION, // Friction in water
PGS_GAMEMIDWATERFRICTION, // Friction in water (not on ground)
PGS_GAMEALLOWLEVELEXIT, // Allow Exiting the game
PGS_GAMEALLOWROCKETJUMP, // Allow Rocket Jumping
PGS_PLALLOWAUTOAIM, // Allow Auto-Aiming
PGS_PLFORCEWEAPONSWITCH, // Force Weapon Switching
PGS_PLDROPWEAPONS, // Drop Player Weapons
PGS_PLINFINITEAMMO, // Infinite Ammo
PGS_GAMEHERETICGIBBING, // Heretic Gibbing
PGS_MONPREDICTMISSILES, // cv_predictingmonsters
PGS_MONRESPAWNMONSTERSTIME, // cv_respawnmonsterstime
PGS_PLSPAWNWITHMAXGUNS, // Spawn With All Guns
PGS_PLSPAWNWITHSUPERGUNS, // Spawn With Super Guns
PGS_PLSPAWNWITHMAXSTATS, // Spawn With Max Stats
PGS_ITEMSSPAWNPICKUPS, // Spawn Game Pickups
PGS_COHERETICFRICTION, // Allow Heretic Friction
PGS_GAMEDEATHMATCH, // Deathmatch Mode
PGS_PLSPAWNWITHALLKEYS, // Spawn With All Keys
PGS_ITEMSKEEPWEAPONS, // Keep Weapons on the Floor
PGS_GAMETEAMPLAY, // Team Play
PGS_GAMETEAMDAMAGE, // Team Damage
PGS_GAMEFRAGLIMIT, // Frag Limit
PGS_GAMETIMELIMIT, // Time Limit
PGS_MONSTATICRESPAWNTIME, // Static monster respawn time
PGS_PLFASTERWEAPONS, // Faster Player Weapons
PGS_MONSPAWNMONSTERS, // Spawn Monsters
PGS_GAMESPAWNMULTIPLAYER, // Spawn multi-player stuff
PGS_ITEMRESPAWNITEMS, // Respawn Items
PGS_ITEMRESPAWNITEMSTIME, // Respawn Item Time
PGS_MONFASTMONSTERS, // Monsters are fast
PGS_GAMESOLIDCORPSES, // Corpses are solid
PGS_GAMEBLOODTIME, // Time blood stays around
PGS_GAMEGRAVITY, // Level Gravity amount
PGS_MONENABLECLEANUP, // Cleanup Dead monsters
PGS_MONCLEANUPRESPTIME, // Time it takes to cleanup respawnable monsters
PGS_MONCLEANUPNONRTIME, // Time it takes to cleanup non-respawnable monsters
PGS_GAMESKILL, // Current Game Skill Level
PGS_PLHALFDAMAGE, // Take Half Damage
PGS_PLDOUBLEAMMO, // Receive Double Ammo
PGS_MONKILLCOUNTMODE, // Kill Count Mode
PGS_COOLDBFGSPRAY, // Old BFG Spraying
PGS_COEXPLODEHITFLOOR, // HitFloor on explode
PGS_COBOMBTHRUFLOOR, // Bomb through floors
PGS_COOLDEXPLOSIONS, // Old Explosion Code
PGS_COAIMCHECKFAKEFLOOR, // Check 3D Floors when aiming
PGS_CONEWGUNSHOTCODE, // Use New Gunshot code
PGS_COSHOOTCHECKFAKEFLOOR, // Check 3D When Shooting
PGS_COSHOOTFLOORCLIPPING, // Clip gunshots to the floor
PGS_CONEWSSGSPREAD, // New SSG Spread
PGS_COMONSTERLOOKFORMONSTER, // Monsters can look for monsters
PGS_COOLDTHINGHEIGHTS, // Old Thing Heights
PGS_COLASTLOOKMAXPLAYERS, // Last Look Max Players
PGS_COMOVECHECKFAKEFLOOR, // Check Fake floor when moving
PGS_COMULTIPLAYER, // Multiplayer Format
PGS_COBOOMSUPPORT, // boomsupport Flag
PGS_PLSPAWNWITHFAVGUN, // Spawn with favorite gun
PGS_CONOSAWFACING, // No facing when sawing
PGS_COENABLETEAMMONSTERS, // Enable Teamable Monsters
PGS_COMONSTERDEADTARGET, // Monsters stop targetting dead things
PGS_COJUMPREGARDLESS, // Regardless Jump (legacy mishap)
PGS_COOLDLASTLOOKLOGIC, // Old lastlook Logic
PGS_CORADIALSPAWNCHECK, // Perform radial spawn check
PGS_MONENABLEPLAYASMONSTER, // Enable playing of monsters
PGS_COKILLSTOPLAYERONE, // Give kills to player 1
PGS_PLALLOWSUICIDE, // Allow Suicides
PGS_PLSUICIDEDELAY, // Suicide Delay
PGS_PLSPAWNWITHMELEEONLY, // Spawn With Melee Only
PGS_PLSPAWNWITHRANDOMGUN, // Spawn With Random Gun
PGS_COENABLESLOPES, // Enables Slope Support
PGS_FUNFLIPLEVELS, // Levels are flipped
PGS_PLREDUCEINVENTORY, // Reduce inventory at end of level
PGS_CODISPLACESPAWN, // Enables Displace Spawning
PGS_CORESPAWNCORPSESONLY, // Only respawn dead bodies
PGS_CONEWGAMEMODES, // New Game Modes
PGS_GAMEMODE, // Current Game Mode
PGS_CTFNEEDFLAGATHOME, // Need flag at home to score
PGS_COVARIABLEFRICTION, // Boom Variable Friction
PGS_COALLOWPUSHERS, // Allow Boom Pushers
PGS_PLMAXTEAMS, // Max player teams
PGS_PLMAXPLAYERS, // Max players inside
PEXGSNUMBITIDS
} P_XGSBitID_t;
/*** STRUCTURES ***/
/* Define CONL_VarPossibleValue_t */
#if !defined(__REMOOD_CONLVPV_DEFINED)
typedef struct CONL_VarPossibleValue_s CONL_VarPossibleValue_t;
#define __REMOOD_CONLVPV_DEFINED
#endif
/* P_XGSVariable_t -- Variable for game setting */
typedef struct P_XGSVariable_s
{
// Base
const P_XGSType_t Type; // Type of value to conform to
const P_XGSBitID_t BitID; // BitID of flag
const char* Name; // Name of game setting
uint32_t MenuTitle; // Title for menus
uint32_t Description; // Description
const uint8_t GameFlags; // Game Flags
const P_XGSDemoRange_t DemoRange; // Range for "demoversion"
const uint16_t DemoVersion; // "demoversion" wrapper
const int32_t DemoVal[2]; // Demo values (false, true)
const int32_t DefaultVal; // Default value wherever
P_XGSMenuCategory_t Category; // Category for item
P_XGSDisplayAs_t DisplayAs; // Display as this
const CONL_VarPossibleValue_t* Possible; // Possible values
void (*ChangeFunc)(struct P_XGSVariable_s* const a_Bit, const int32_t a_OldValue);
// Settings
bool_t WasSet; // Was Set to value?
int32_t ActualVal; // Actually set value
// String Value
char StrVal[PEXGSSTRBUFSIZE]; // String Value
} P_XGSVariable_t;
/*** FUNCTIONS ***/
// Setting Finder
P_XGSBitID_t P_XGSBitForName(const char* const a_Name);
P_XGSVariable_t* P_XGSVarForBit(const P_XGSBitID_t a_Bit);
P_XGSVariable_t* P_XGSVarForName(const char* const a_Name);
// Value Getter
int32_t P_XGSVal(const P_XGSBitID_t a_Bit);
fixed_t P_XGSFix(const P_XGSBitID_t a_Bit);
int32_t P_XGSGetNextValue(const P_XGSBitID_t a_Bit, const bool_t a_Right);
// General Functions
bool_t P_XGSRegisterStuff(void);
bool_t P_XGSSetAllDefaults(void);
bool_t P_XGSSetVersionLevel(const bool_t a_Master, const uint32_t a_Level);
int32_t P_XGSRootSetValue(const P_XGSBitID_t a_Bit, const int32_t a_Value);
int32_t P_XGSSetValue(const bool_t a_Master, const P_XGSBitID_t a_Bit, const int32_t a_Value);
int32_t P_XGSSetValueStr(const bool_t a_Master, const P_XGSBitID_t a_Bit, const char* const a_Value);
// New Game Control
void NG_ResetVars(void);
void NG_FromCLine(void);
void NG_ApplyVars(void);
void NG_WarpMap(void);
void NG_SetAutoStart(const bool_t a_Value);
bool_t NG_IsAutoStart(void);
bool_t NG_SetRules(const bool_t a_Master, const char* const a_Name);
int32_t NG_SetVarValueStr(const P_XGSBitID_t a_Bit, const char* const a_NewVal);
int32_t NG_SetVarValue(const P_XGSBitID_t a_Bit, const int32_t a_NewVal);
int32_t NG_SetVarDefault(const P_XGSBitID_t a_Bit);
int32_t NG_GetNextValue(const P_XGSBitID_t a_Bit, const bool_t a_Right);
void NG_SetNextMap(const char* const a_Map);
// Game Mode Operation
bool_t P_GMSpecCoop(const int32_t a_Mode, const bool_t a_Team);
bool_t P_GMSpecCounter(const int32_t a_Mode, const bool_t a_Team);
bool_t P_GMSpecDM(const int32_t a_Mode, const bool_t a_Team);
bool_t P_GMSpecLMS(const int32_t a_Mode, const bool_t a_Team);
bool_t P_GMSpecTeam(const int32_t a_Mode, const bool_t a_Team);
bool_t P_GMSpecCTF(const int32_t a_Mode, const bool_t a_Team);
bool_t P_GMIsCoop(void);
bool_t P_GMIsCounter(void);
bool_t P_GMIsDM(void);
bool_t P_GMIsLMS(void);
bool_t P_GMIsTeam(void);
bool_t P_GMIsCTF(void);
#endif /* __P_DEMCMP_H__ */