2006-02-24 04:48:15 +00:00
|
|
|
// Emacs style mode select -*- C++ -*-
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// $Id:$
|
|
|
|
//
|
|
|
|
// Copyright (C) 1993-1996 by id Software, Inc.
|
|
|
|
//
|
|
|
|
// This source is available for distribution and/or modification
|
|
|
|
// only under the terms of the DOOM Source Code License as
|
|
|
|
// published by id Software. All rights reserved.
|
|
|
|
//
|
|
|
|
// The source is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
// DESCRIPTION:
|
|
|
|
// All the global variables that store the internal state.
|
|
|
|
// Theoretically speaking, the internal state of the engine
|
|
|
|
// should be found by looking at the variables collected
|
|
|
|
// here, and every relevant module will have to include
|
|
|
|
// this header file.
|
|
|
|
// In practice, things are a bit messy.
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __D_STATE__
|
|
|
|
#define __D_STATE__
|
|
|
|
|
|
|
|
#include "c_cvars.h"
|
|
|
|
|
|
|
|
// -----------------------
|
|
|
|
// Game speed.
|
|
|
|
//
|
|
|
|
enum EGameSpeed
|
|
|
|
{
|
|
|
|
SPEED_Normal,
|
|
|
|
SPEED_Fast,
|
|
|
|
};
|
|
|
|
extern EGameSpeed GameSpeed;
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------
|
|
|
|
// Command line parameters.
|
|
|
|
//
|
2006-09-14 00:02:31 +00:00
|
|
|
extern bool devparm; // DEBUG: launched with -devparm
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// -----------------------------------------------------
|
|
|
|
// Game Mode - identify IWAD as shareware, retail etc.
|
|
|
|
//
|
|
|
|
// -------------------------------------------
|
|
|
|
// Selected skill type, map etc.
|
|
|
|
//
|
|
|
|
|
About a week's worth of changes here. As a heads-up, I wouldn't be
surprised if this doesn't build in Linux right now. The CMakeLists.txt
were checked with MinGW and NMake, but how they fair under Linux is an
unknown to me at this time.
- Converted most sprintf (and all wsprintf) calls to either mysnprintf or
FStrings, depending on the situation.
- Changed the strings in the wbstartstruct to be FStrings.
- Changed myvsnprintf() to output nothing if count is greater than INT_MAX.
This is so that I can use a series of mysnprintf() calls and advance the
pointer for each one. Once the pointer goes beyond the end of the buffer,
the count will go negative, but since it's an unsigned type it will be
seen as excessively huge instead. This should not be a problem, as there's
no reason for ZDoom to be using text buffers larger than 2 GB anywhere.
- Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig().
- Changed CalcMapName() to return an FString instead of a pointer to a static
buffer.
- Changed startmap in d_main.cpp into an FString.
- Changed CheckWarpTransMap() to take an FString& as the first argument.
- Changed d_mapname in g_level.cpp into an FString.
- Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an
FString.
- Fixed: The MAPINFO parser wrote into the string buffer to construct a map
name when given a Hexen map number. This was fine with the old scanner
code, but only a happy coincidence prevents it from crashing with the new
code
- Added the 'B' conversion specifier to StringFormat::VWorker() for printing
binary numbers.
- Added CMake support for building with MinGW, MSYS, and NMake. Linux support
is probably broken until I get around to booting into Linux again. Niceties
provided over the existing Makefiles they're replacing:
* All command-line builds can use the same build system, rather than having
a separate one for MinGW and another for Linux.
* Microsoft's NMake tool is supported as a target.
* Progress meters.
* Parallel makes work from a fresh checkout without needing to be primed
first with a single-threaded make.
* Porting to other architectures should be simplified, whenever that day
comes.
- Replaced the makewad tool with zipdir. This handles the dependency tracking
itself instead of generating an external makefile to do it, since I couldn't
figure out how to generate a makefile with an external tool and include it
with a CMake-generated makefile. Where makewad used a master list of files
to generate the package file, zipdir just zips the entire contents of one or
more directories.
- Added the gdtoa package from netlib's fp library so that ZDoom's printf-style
formatting can be entirely independant of the CRT.
SVN r1082 (trunk)
2008-07-23 04:57:26 +00:00
|
|
|
extern FString startmap; // [RH] Actual map name now
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2006-09-14 00:02:31 +00:00
|
|
|
extern bool autostart;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2013-10-10 03:11:33 +00:00
|
|
|
extern FString StoredWarp; // [RH] +warp at the command line
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
// Selected by user.
|
|
|
|
EXTERN_CVAR (Int, gameskill);
|
|
|
|
extern int NextSkill; // [RH] Skill to use at next level load
|
|
|
|
|
|
|
|
// Netgame? Only true if >1 player.
|
2006-09-14 00:02:31 +00:00
|
|
|
extern bool netgame;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// Bot game? Like netgame, but doesn't involve network communication.
|
2006-09-14 00:02:31 +00:00
|
|
|
extern bool multiplayer;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// Flag: true only if started as net deathmatch.
|
|
|
|
EXTERN_CVAR (Int, deathmatch)
|
|
|
|
|
|
|
|
// [RH] Pretend as deathmatch for purposes of dmflags
|
|
|
|
EXTERN_CVAR (Bool, alwaysapplydmflags)
|
|
|
|
|
|
|
|
// [RH] Teamplay mode
|
|
|
|
EXTERN_CVAR (Bool, teamplay)
|
|
|
|
|
|
|
|
// [RH] Friendly fire amount
|
|
|
|
EXTERN_CVAR (Float, teamdamage)
|
|
|
|
|
|
|
|
// [RH] The class the player will spawn as in single player,
|
|
|
|
// in case using a random class with Hexen.
|
2008-09-14 23:54:38 +00:00
|
|
|
extern int SinglePlayerClass[/*MAXPLAYERS*/];
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// -------------------------
|
|
|
|
// Internal parameters for sound rendering.
|
|
|
|
|
|
|
|
EXTERN_CVAR (Float, snd_sfxvolume) // maximum volume for sound
|
|
|
|
EXTERN_CVAR (Float, snd_musicvolume) // maximum volume for music
|
|
|
|
|
|
|
|
|
|
|
|
// -------------------------
|
|
|
|
// Status flags for refresh.
|
|
|
|
//
|
|
|
|
|
|
|
|
enum EMenuState
|
|
|
|
{
|
|
|
|
MENU_Off, // Menu is closed
|
|
|
|
MENU_On, // Menu is opened
|
|
|
|
MENU_WaitKey, // Menu is opened and waiting for a key in the controls menu
|
|
|
|
MENU_OnNoPause, // Menu is opened but does not pause the game
|
|
|
|
};
|
|
|
|
|
|
|
|
extern bool automapactive; // In AutoMap mode?
|
|
|
|
extern EMenuState menuactive; // Menu overlayed?
|
|
|
|
extern int paused; // Game Pause?
|
2014-11-10 13:18:52 +00:00
|
|
|
extern bool pauseext;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
extern bool viewactive;
|
|
|
|
|
2006-09-14 00:02:31 +00:00
|
|
|
extern bool nodrawers;
|
|
|
|
extern bool noblit;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
extern int viewwindowx;
|
|
|
|
extern int viewwindowy;
|
|
|
|
extern "C" int viewheight;
|
|
|
|
extern "C" int viewwidth;
|
|
|
|
extern "C" int halfviewwidth; // [RH] Half view width, for plane drawing
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Player taking events. i.e. The local player.
|
|
|
|
extern int consoleplayer;
|
|
|
|
|
|
|
|
|
|
|
|
// --------------------------------------
|
|
|
|
// DEMO playback/recording related stuff.
|
|
|
|
// No demo, there is a human player in charge?
|
|
|
|
// Disable save/end game?
|
|
|
|
extern bool usergame;
|
|
|
|
|
2014-11-01 04:47:29 +00:00
|
|
|
extern FString newdemoname;
|
|
|
|
extern FString newdemomap;
|
2006-04-16 19:09:36 +00:00
|
|
|
extern bool demoplayback;
|
|
|
|
extern bool demorecording;
|
2006-02-24 04:48:15 +00:00
|
|
|
extern int demover;
|
|
|
|
|
|
|
|
// Quit after playing a demo from cmdline.
|
2006-09-14 00:02:31 +00:00
|
|
|
extern bool singledemo;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
extern int SaveVersion;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------
|
|
|
|
// Internal parameters, fixed.
|
|
|
|
// These are set by the engine, and not changed
|
|
|
|
// according to user inputs. Partly load from
|
|
|
|
// WAD, partly set at startup time.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern int gametic;
|
|
|
|
|
|
|
|
|
|
|
|
// Alive? Disconnected?
|
2008-09-14 23:54:38 +00:00
|
|
|
extern bool playeringame[/*MAXPLAYERS*/];
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------
|
|
|
|
// Internal parameters, used for engine.
|
|
|
|
//
|
|
|
|
|
|
|
|
// File handling stuff.
|
|
|
|
extern FILE* debugfile;
|
|
|
|
|
|
|
|
// if true, load all graphics at level load
|
2006-09-14 00:02:31 +00:00
|
|
|
extern bool precache;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
//-------
|
|
|
|
//REFRESH
|
|
|
|
//-------
|
|
|
|
|
|
|
|
extern bool setsizeneeded;
|
2006-09-14 00:02:31 +00:00
|
|
|
extern bool setmodeneeded;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
extern int BorderNeedRefresh;
|
|
|
|
extern int BorderTopRefresh;
|
|
|
|
|
|
|
|
|
|
|
|
EXTERN_CVAR (Float, mouse_sensitivity)
|
|
|
|
//?
|
|
|
|
// debug flag to cancel adaptiveness
|
2006-09-14 00:02:31 +00:00
|
|
|
extern bool singletics;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
extern int bodyqueslot;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Needed to store the number of the dummy sky flat.
|
|
|
|
// Used for rendering,
|
|
|
|
// as well as tracking projectiles etc.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ---- [RH] ----
|
|
|
|
EXTERN_CVAR (Bool, developer)
|
|
|
|
|
|
|
|
extern bool ToggleFullscreen;
|
|
|
|
|
|
|
|
extern int Net_Arbitrator;
|
|
|
|
|
|
|
|
EXTERN_CVAR (Bool, var_friction)
|
|
|
|
EXTERN_CVAR (Bool, var_pushers)
|
|
|
|
|
|
|
|
|
|
|
|
// [RH] Miscellaneous info for DeHackEd support
|
|
|
|
struct DehInfo
|
|
|
|
{
|
|
|
|
int StartHealth;
|
|
|
|
int StartBullets;
|
|
|
|
int MaxHealth;
|
|
|
|
int MaxArmor;
|
|
|
|
int GreenAC;
|
|
|
|
int BlueAC;
|
|
|
|
int MaxSoulsphere;
|
|
|
|
int SoulsphereHealth;
|
|
|
|
int MegasphereHealth;
|
|
|
|
int GodHealth;
|
|
|
|
int FAArmor;
|
|
|
|
int FAAC;
|
|
|
|
int KFAArmor;
|
|
|
|
int KFAAC;
|
|
|
|
char PlayerSprite[5];
|
|
|
|
BYTE ExplosionStyle;
|
|
|
|
fixed_t ExplosionAlpha;
|
|
|
|
int NoAutofreeze;
|
2012-04-07 11:33:35 +00:00
|
|
|
int BFGCells;
|
2006-02-24 04:48:15 +00:00
|
|
|
};
|
|
|
|
extern DehInfo deh;
|
|
|
|
EXTERN_CVAR (Int, infighting)
|
|
|
|
|
|
|
|
// [RH] Deathmatch flags
|
|
|
|
|
|
|
|
EXTERN_CVAR (Int, dmflags);
|
|
|
|
EXTERN_CVAR (Int, dmflags2); // [BC]
|
|
|
|
|
|
|
|
EXTERN_CVAR (Int, compatflags);
|
2011-11-01 02:58:52 +00:00
|
|
|
EXTERN_CVAR (Int, compatflags2);
|
|
|
|
extern int i_compatflags, i_compatflags2, ii_compatflags, ii_compatflags2, ib_compatflags;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
#endif
|