User:Monster Iestyn/Source Code Documentation/doomstat.h

From SRB2 Wiki
Jump to: navigation, search
Test.png This article or section is incomplete. It doesn't have all of the necessary core information on this topic. Please help the SRB2 Wiki by finishing this article.
Online link GitHub entry
File type C header file
#include guard __DOOMSTAT__

Includes

Externs

Data name Data type Non-extern location(s) Description
gamemap INT16 g_game.c The map number of the map currently being played. This is 1-based, i.e. 1 is MAP01.
mapmusname[7] char g_game.c The name for the current music track set for the map.
mapmusflags UINT16 g_game.c The flags set for the current music track being played:
  • mapmusflags & MUSIC_TRACKMASK – these bits give the subtrack number, if applicable to the music track being played.
  • mapmusflags & MUSIC_RELOADRESET – if this flag is set, reloading the current level will reset the music track to the map's default; otherwise, the current music track will continue playing even after the level has been reloaded.
  • mapmusflags & MUSIC_FORCERESET – if this flag is set, the music track can be reset by S_ChangeMusicEx even if the new track set to be played is the same as the current one.
mapmusposition UINT32 g_game.c The position within the current music track, given as a time in milliseconds, that the game starts playing the track from.
maptol INT16 g_game.c The TypeOfLevel of the map currently being played.
globalweather UINT8 g_game.c The current weather type set globally.
curWeather INT32 g_game.c The current weather type set locally.
cursaveslot INT32 g_game.c The number of the Single Player savegame slot currently in use. If the game is not to be saved (e.g. the "no save" slot was chosen, or the game was modified), this will have a value of -1. If the "Play Credits" option from the secrets menu was selected, this will have a value of -2.
lastmapsaved INT16 g_game.c The map number of the map where the game last auto-saved to a Single Player savegame. This is 1-based, i.e. 1 is MAP01.

When starting a Single Player game, this is set to 0 (not used by any map), to make sure the starting map will always be saved. When loading an existing savegame for Single Player, this will be set to the map that was saved in it. Note that maps that cannot be saved – such as Special stages, levels hidden from the menu, or levels with an act number of 2 or greater – will not update this value.

gamecomplete boolean g_game.c This is true if the game has been completed, i.e. the game has just reached the credits or evaluation screen on a Single Player game. Otherwise, this is false. If the game can be saved, this value is saved to the savegame slot being used; when the savegame is loaded again, a level select will be available, and the game will be saved for levels of any act number (but not Special Stages and levels hidden from the menu).
modifiedgame boolean g_game.c This is true if the game is modified, false if not.
mainwads UINT16 g_game.c The number of main resource WADs used by SRB2, not including music.dta. In v2.1.20, this should currently have a value of 5.
savemoddata boolean g_game.c This is true if the game is modified but has a custom gamedata file that data can be saved to, false if not or the game is not currently modified.
disableSpeedAdjust boolean g_game.c If false, the player's animation speed will be adjusted according to the player's velocity. If true, this behavior is disabled, meaning player animations will use the default speeds determined by their states. This setting can be modified by the MainCfg SOC block.
imcontinuing boolean g_game.c
metalrecording boolean g_game.c
modeattacking UINT8 g_game.c The current "attacking mode" – i.e. the demo recording/playback mode. See the ATTACKING_* macros below.
numDemos UINT8 g_game.c This setting can be modified by the MainCfg SOC block.
demoDelayTime UINT32 g_game.c This setting can be modified by the MainCfg SOC block.
demoIdleTime UINT32 g_game.c This setting can be modified by the MainCfg SOC block.
netgame boolean g_game.c This if true if a netgame is being played, false if not.
addedtogame boolean g_game.c
multiplayer boolean g_game.c This is true if playing a multiplayer game mode (i.e. two-player mode or netgame), false if not.
gametype INT16 d_netcmd.c The current gametype being played. See GameType for a list of gametype numbers.
splitscreen boolean d_netcmd.c This if true if two-player mode is being played, false if not.
circuitmap boolean d_netcmd.c This if true if a Circuit map is being played, false if not. More specifically, this is true only when the Circuit Finish Line sector type is present and the Race gametype is being played.
fromlevelselect boolean m_menu.c
midi_disabled boolean d_main.c
sound_disabled boolean d_main.c
digital_disabled boolean d_main.c
menuactive boolean m_menu.c
paused UINT8 g_game.c
window_notinfocus UINT8 d_main.c
nodrawers boolean g_game.c
noblit boolean g_game.c
lastdraw boolean d_main.c
postimgtype postimg_t d_main.c
postimgparam INT32 d_main.c
postimgtype2 postimg_t d_main.c
postimgparam2 INT32 d_main.c
viewwindowx
viewwindowy
INT32 r_draw.c The X and Y screen coordinates of the view window's top left corner, respectively. In Doom Legacy and early versions of SRB2, these were used to adjust the position of the view window relatively to the screen's full window, depending on the set view size; a view border and status bar appear around the view window for view sizes smaller than the screen window. In current versions of SRB2, viewwindowx will always be 0, and viewwindowy will either be 0 or vid.height/2 depending on whether Player 1 or Player 2's view is being rendered.
viewwidth
scaledviewwidth
INT32 r_draw.c The real and scaled width of the view window, respectively. In Doom Legacy, the real and scaled view widths were intended to differ if the view window's detail level was altered, but this has never been possible in any version of Doom Legacy SRB2 was based on (and by extension, any version of SRB2). In current versions of SRB2, both variables will always be the same as vid.width.
gamedataloaded boolean g_game.c
consoleplayer INT32 g_game.c
displayplayer INT32 g_game.c
secondarydisplayplayer INT32 g_game.c
spstage_start INT16 g_game.c This setting can be modified by the MainCfg SOC block.
sstage_start INT16 g_game.c This setting can be modified by the MainCfg SOC block.
sstage_end INT16 g_game.c This setting can be modified by the MainCfg SOC block.
looptitle boolean g_game.c This setting can be modified by the MainCfg SOC block.
useNightsSS boolean g_game.c This setting can be modified by the MainCfg SOC block.
skincolor_redteam
skincolor_blueteam
skincolor_redring
skincolor_bluering
UINT8 g_game.c These settings can be modified by the MainCfg SOC block.
countdowntimer tic_t g_game.c
countdowntimeup boolean g_game.c
exitfadestarted boolean g_game.c
*cutscenes[128] cutscene_t g_game.c
nextmapoverride INT16 g_game.c
skipstats boolean g_game.c
totalrings UINT32 g_game.c
lastmap INT16 g_game.c
*redflag
*blueflag
mobj_t g_game.c
*rflagpoint
*bflagpoint
mapthing_t g_game.c
quake struct quake g_game.c
*mapheaderinfo[NUMMAPS] mapheader_t g_game.c
*Gametype_Names[NUMGAMETYPES] const char g_game.c String names for gametypes.
totalplaytime tic_t g_game.c
stagefailed UINT8 g_game.c
emeralds UINT16 g_game.c
nummaprings INT32 g_game.c
*nightsrecords[NUMMAPS] nightsdata_t g_game.c
*mainrecords[NUMMAPS] recorddata_t g_game.c
mapvisited[NUMMAPS] UINT8 g_game.c
token UINT32 g_game.c
tokenlist UINT32 g_game.c
tokenbits INT32 g_game.c
sstimer INT32 g_game.c
bluescore UINT32 g_game.c
redscore UINT32 g_game.c
CheckForBustableBlocks boolean g_game.c
CheckForBouncySector boolean g_game.c
CheckForQuicksand boolean g_game.c
CheckForMarioBlocks boolean g_game.c
CheckForFloatBob boolean g_game.c
CheckForReverseGravity boolean g_game.c
invulntics UINT16 g_game.c This setting can be modified by the MainCfg SOC block.
sneakertics UINT16 g_game.c This setting can be modified by the MainCfg SOC block.
flashingtics UINT16 g_game.c This setting can be modified by the MainCfg SOC block.
tailsflytics UINT16 g_game.c This setting can be modified by the MainCfg SOC block.
underwatertics UINT16 g_game.c This setting can be modified by the MainCfg SOC block.
spacetimetics UINT16 g_game.c This setting can be modified by the MainCfg SOC block.
extralifetics UINT16 g_game.c This setting can be modified by the MainCfg SOC block.
introtoplay UINT8 g_game.c This setting can be modified by the MainCfg SOC block.
creditscutscene UINT8 g_game.c This setting can be modified by the MainCfg SOC block.
use1upSound UINT8 g_game.c This setting can be modified by the MainCfg SOC block.
maxXtraLife UINT8 g_game.c This setting can be modified by the MainCfg SOC block.
*hunt1
*hunt2
*hunt3
mobj_t g_game.c
countdown UINT32 g_game.c In Race and Competition, this variable is used the countdown timer before players get a Time Over. When it is not in use, it is set to zero. When a player finishes the level, the timer is set to a value of cv_countdowntime.value*TICRATE + 1. The game then decrements the timer's value each tic until it reaches zero. When it reaches a value of 1, all players who still have lives and have not yet finished the level are instantly killed. The game also sets their lives to 0 and gives them the PF_TIMEOVER flag when this happens.
countdown2 UINT32 g_game.c In Race, Competition and Coop, this variable is used as a countdown timer before automatically ending the level after a Time Over or after all players have died. When a player finishes a level in Race or Competition, the timer is set to a value of countdown2 = (8 + cv_countdowntime.value)*TICRATE + 1, so that the level ends 8 seconds after countdown has reached zero. In Competition or Coop, 8 seconds after a player has died and there are no other living players who have not finished the level, this variable will automatically be set to a value of 1*TICRATE, if the timer was not already running or has a value greater than 1*TICRATE. The game then decrements the timer's value each tic until it reaches zero. When it reaches a value of 2, the game exits the level automatically. Note that in Coop, the game will restart the current level, instead of loading the next level in the rotation as with Race or Competition.
gravity fixed_t g_game.c
autobalance INT16 g_game.c
teamscramble INT16 g_game.c
scrambleplayers[MAXPLAYERS] INT16 g_game.c
scrambleteams[MAXPLAYERS] INT16 g_game.c
scrambletotal INT16 g_game.c
scramblecount INT16 g_game.c
cheats INT32 g_game.c
hidetime tic_t g_game.c
timesBeaten UINT32 g_game.c
timesBeatenWithEmeralds UINT32 g_game.c
timesBeatenUltimate UINT32 g_game.c
gametic tic_t g_game.c Stores the number of the next game tic (a game state update) to be run. Note that in a netgame, everyone's gametic value should be synchronised with the server's own gametic value from the moment they join the netgame.
*playerstarts[MAXPLAYERS] mapthing_t p_setup.c
*bluectfstarts[MAXPLAYERS] mapthing_t p_setup.c
*redctfstarts[MAXPLAYERS] mapthing_t p_setup.c
*debugfile FILE d_net.c Declared only if DEBUGFILE is defined

The pointer to the file stream for the debug file, if the game is run with the command line parameter -debugfile.

debugload INT32 d_main.c Declared only if DEBUGFILE is defined

The "LOAD" timer variable displayed in "Tryruntic" messages written to debugfile. Each time one such message is printed, debugload's value is set to 100000; when non-zero, debugload's value decreases each run of D_SRB2Loop's loop between realtics. This can then be used to work out how many times D_SRB2Loop's loop was run before each call of TryRunTics, by subtracting the resulting value from 100000.

precache boolean g_game.c
wipegamestate gamestate_t d_main.c
singletics boolean d_main.c If true, the game runs as fast as possible – instead of the game running gametics at its normal framerate, every run of D_SRB2Loop's loop will run one gametic each. This is set to false normally, except when a demo is being played back using the console command timedemo (it will be reset back to false afterwards).
cv_timetic consvar_t d_netcmd.c timerres console variable struct
cv_forceskin consvar_t d_netcmd.c forceskin console variable struct
cv_downloading consvar_t d_netcmd.c downloading console variable struct
netcmds[BACKUPTICS][MAXPLAYERS] ticcmd_t d_clisrv.c
serverplayer INT32 d_clisrv.c
adminplayers[MAXPLAYERS] INT32 d_netcmd.c

Macros

Macro Defined as Description
Music flags
MUSIC_TRACKMASK 0x0FFF
MUSIC_RELOADRESET 0x8000
MUSIC_FORCERESET 0x4000
Weather
PRECIP_NONE 0 None
PRECIP_STORM 1 Storm (thunder, lightning and rain)
PRECIP_SNOW 2 Snow
PRECIP_RAIN 3 Rain
PRECIP_BLANK 4 Preloaded precipitation
PRECIP_STORM_NORAIN 5 Storm (no rain)
PRECIP_STORM_NOSTRIKES 6 Storm (no lightning)
Record attacking modes
ATTACKING_NONE 0 No demo is being recorded or played back.
ATTACKING_RECORD 1 A regular demo is being recorded or played back. This includes both replays for Record Attack, and demos recorded with -record or -metal.
ATTACKING_NIGHTS 2 A NiGHTS Mode replay is being recorded or played back.
Player gotflag flags
GF_REDFLAG 1 Player is carrying the Red CTF flag
GF_BLUEFLAG 2 Player is carrying the Blue CTF flag
Level flags
LF_SCRIPTISFILE 1
LF_SPEEDMUSIC 2
LF_NOSSMUSIC 4
LF_NORELOAD 8
LF_NOZONE 16
Menu flags
LF2_HIDEINMENU 1
LF2_HIDEINSTATS 2
LF2_RECORDATTACK 4
LF2_NIGHTSATTACK 8
LF2_NOVISITNEEDED 16
Save override
SAVE_NEVER -1
SAVE_DEFAULT 0
SAVE_ALWAYS 1
Chaos Emerald flags
EMERALD1 1 Green Emerald
EMERALD2 2 Purple Emerald
EMERALD3 4 Blue Emerald
EMERALD4 8 Light Blue Emerald
EMERALD5 16 Orange Emerald
EMERALD6 32 Red Emerald
EMERALD7 64 Gray Emerald
Grades
GRADE_F 0 F grade
GRADE_E 1 E grade
GRADE_D 2 D grade
GRADE_C 3 C grade
GRADE_B 4 B grade
GRADE_A 5 A grade
GRADE_S 6 Rainbow A grade
mapvisited flags
MV_VISITED 1
MV_BEATEN 2
MV_ALLEMERALDS 4
MV_ULTIMATE 8
MV_PERFECT 16
MV_VISITED 31
Other
localgametic leveltime
DEBUGFILE 1 (Enabled) Declared only if not compiled for macintosh (?)

If enabled, running the game with the command line parameter -debugfile will print debugging information to the file debugnum.txt.

Function macros

Macro Defined as Description
ALL7EMERALDS(v)
((v & (EMERALD1|EMERALD2|EMERALD3|EMERALD4|EMERALD5|EMERALD6|EMERALD7)) == (EMERALD1|EMERALD2|EMERALD3|EMERALD4|EMERALD5|EMERALD6|EMERALD7))
DEBFILE(msg) macintosh:
I_OutputMsg(msg)

Other, DEBUGFILE defined

{ if (debugfile) { fputs(msg, debugfile); fflush(debugfile); } }
Writes a debug message to the debug file, if the game is run with the command line parameter -debugfile.

Typedefs

Name Type Description
scene_t struct
cutscene_t struct
mappoint_t struct
struct quake struct
nightsgrades_t struct
customoption_t struct
mapheader_t struct Level header structure
enum TypeOfLevel enum TypeOfLevel flags
enum GameType enum Gametypes
recorddata_t struct
nightsdata_t struct

Structs

scene_t

Data name Data type Description
numpics UINT8
picname[8][8] char
pichires[8] UINT8
*text char
xcoord[8] UINT16
ycoord[8] UINT16
picduration[8] UINT16
musicloop UINT8
textxpos UINT16
textypos UINT16
musswitch[7] char
musswitchflags UINT16
musswitchposition UINT32
fadecolor UINT8
fadeinid UINT8
fadeoutid UINT8

cutscene_t

Data name Data type Description
scene[128] scene_t
numscenes INT32

mappoint_t

Data name Data type Description
x
y
z
fixed_t

quake

Data name Data type Description
x
y
z
fixed_t
time UINT16
*epicenter mappoint_t
radius
intensity
fixed_t

nightsgrades_t

Data name Data type Description
grade[6] UINT32

customoption_t

Data name Data type Description
option[32] char
value[256] char

mapheader_t

Data name Data type Description
lvlttl[22] char
subttl[33] char
actnum UINT8
typeoflevel UINT16
nextlevel INT16
musname[7] char
mustrack UINT16
muspos UINT32
forcecharacter[17] char
weather UINT8
skynum INT16
skybox_scalex INT16
skybox_scaley INT16
skybox_scalez INT16
interscreen[8] char
runsoc[33] char
scriptname[33] char
precutscenenum UINT8
cutscenenum UINT8
countdown INT16
palette UINT16
numlaps UINT8
unlockrequired SINT8
levelselect UINT8
bonustype SINT8
saveoverride SINT8
levelflags UINT8
menuflags UINT8
numGradedMares UINT8
*grades nightsgrades_t
musinterfadeout UINT32
musintername[7] char
numCustomOptions UINT8
*customopts customoption_t

recorddata_t

Data name Data type Description
time tic_t
score UINT32
rings UINT16

nightsdata_t

Data name Data type Description
nummares UINT8
score[9] UINT32
grade[9] UINT8
time[9] tic_t

Enumerations

TypeOfLevel

Value (Decimal) Value (Hex) Name Description
1 0x01 TOL_SP Single Player
2 0x02 TOL_COOP Co-op
4 0x04 TOL_COMPETITION Competition
8 0x08 TOL_RACE Race
16 0x10 TOL_MATCH Match
32 0x20 TOL_TAG Tag
64 0x40 TOL_CTF Capture the Flag
128 0x80 TOL_CUSTOM Custom (Lua-scripted, etc.)
256 0x100 TOL_2D 2D
512 0x200 TOL_MARIO Mario
1024 0x400 TOL_NIGHTS NiGHTS
2048 0x800 TOL_ERZ3 ERZ3
4096 0x1000 TOL_XMAS Christmas NiGHTS

GameType

Value Name Description
0 GT_COOP Single Player/Co-op
1 GT_COMPETITION Competition
2 GT_RACE Race
3 GT_MATCH Match
4 GT_TEAMMATCH Team Match
5 GT_TAG Tag
6 GT_HIDEANDSEEK Hide & Seek
7 GT_CTF Capture the Flag
8 NUMGAMETYPES Total number of gametypes

Variables

Name Type Description
ntemprecords nightsdata_t