diff --git a/run-all.sh b/run-all.sh index 66751ca..3eb213b 100755 --- a/run-all.sh +++ b/run-all.sh @@ -38,7 +38,6 @@ ${CLANG_BINARY} -target assigner \ -I${HOME}/zkllvm/libs/stdlib/libcpp \ -I${HOME}/zkllvm/libs/crypto3/algebra/include \ -I${HOME}/zkllvm/build/include \ - -I/usr/local/include \ -I${HOME}/zkllvm/libs/blueprint/include \ -I${HOME}/zkllvm/libs/crypto3/block/include -I${HOME}/zkllvm/libs/crypto3/codec/include -I${HOME}/zkllvm/libs/crypto3/containers/include -I${HOME}/zkllvm/libs/crypto3/hash/include -I${HOME}/zkllvm/libs/crypto3/kdf/include -I${HOME}/zkllvm/libs/crypto3/mac/include -I${HOME}/zkllvm/libs/crypto3/marshalling/core/include -I -I${HOME}/zkllvm/libs/crypto3/marshalling/algebra/include -I${HOME}/zkllvm/libs/crypto3/marshalling/multiprecision/include -I${HOME}/zkllvm/libs/crypto3/marshalling/zk/include -I${HOME}/zkllvm/libs/crypto3/math/include -I${HOME}/zkllvm/libs/crypto3/modes/include -I${HOME}/zkllvm/libs/crypto3/multiprecision/include -I${HOME}/zkllvm/libs/crypto3/passhash/include -I${HOME}/zkllvm/libs/crypto3/pbkdf/include -I${HOME}/zkllvm/libs/crypto3/pkmodes/include -I${HOME}/zkllvm/libs/crypto3/pkpad/include -I${HOME}/zkllvm/libs/crypto3/pubkey/include -I${HOME}/zkllvm/libs/crypto3/random/include -I${HOME}/zkllvm/libs/crypto3/stream/include -I${HOME}/zkllvm/libs/crypto3/vdf/include -I${HOME}/zkllvm/libs/crypto3/zk/include \ -D__ZKLLVM__ \ diff --git a/zkldoom/z_main.c b/zkldoom/z_main.c index 8a2dc46..92ef58a 100644 --- a/zkldoom/z_main.c +++ b/zkldoom/z_main.c @@ -16,16 +16,12 @@ // Main program, simply calls D_DoomMain high level loop. // -//#include "config.h" - #include -#include -//#include "doomtype.h" -//#include "i_system.h" -#include "m_argv.h" +#include +#include // for strlen -#include +#include "m_argv.h" #include "doomreplay.h" @@ -36,10 +32,9 @@ */ -char *USER_INPUT = ",,,,,,,,,,,,,,,,,,,,,,,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,r,r,r,r,f,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,f,f,f,f,f,f"; -unsigned long prepare_inputs(char * input, unsigned char *input_codes) { +unsigned long prepare_inputs(const char * input, unsigned char *input_codes) { // string with inputs like // ",,,,,,,,,,,,,,,,,,,,,,,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,r,r,r,r,f,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,f,f,f,f,f,f"; unsigned long n_inputs = strlen(input); @@ -77,10 +72,75 @@ unsigned long prepare_inputs(char * input, unsigned char *input_codes) { } +// ALL GLOBAL STATE HERE + +// All globals from "*.h" headers combined +#include "z_main.h" + + + + + +// AAAA Globals from d_main.c + +// will be moved to function inputs +const char *USER_INPUT = ",,,,,,,,,,,,,,,,,,,,,,,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,r,r,r,r,f,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,f,f,f,f,f,f"; + +static replay_data_t replay_data; + +// Location where savegames are stored +char * savegamedir; + +// location of IWAD and WAD files +char * iwadfile; + +boolean devparm; // started game with -devparm +boolean nomonsters; // checkparm of -nomonsters +boolean respawnparm; // checkparm of -respawn +boolean fastparm; // checkparm of -fast + +extern boolean inhelpscreens; + +skill_t startskill; +int startepisode; +int startmap; +boolean autostart; +int startloadgame; + +boolean advancedemo; + +// Store demo, do not accept any inputs +boolean storedemo; + +// "BFG Edition" version of doom2.wad does not include TITLEPIC. +boolean bfgedition; + +// If true, the main game loop has started. +boolean main_loop_started = false; + +char wadfile[1024]; // primary wad file +char mapdir[1024]; // directory of development maps + +int show_endoom = 1; + + + + + + + + + + + + + + + + int main(int argc, char **argv) { - replay_data_t replay_data; replay_data.framerate = 35; replay_data.n_start = 0; @@ -92,7 +152,7 @@ int main(int argc, char **argv) replay_data.n_frames = 1; unsigned char *input_codes = malloc(sizeof(unsigned char) * strlen(USER_INPUT)); - unsigned int n_inputs = prepare_inputs(USER_INPUT, input_codes); + unsigned long n_inputs = prepare_inputs(USER_INPUT, input_codes); for (int i = 0; i < n_inputs; ++i) { switch (input_codes[i]) { @@ -102,7 +162,7 @@ int main(int argc, char **argv) }; } - printf("[DEBUG] target n_frames: %d %d\n", replay_data.n_frames); + printf("[DEBUG] target n_frames: %d\n", replay_data.n_frames); replay_data.frames = malloc(replay_data.n_frames*sizeof(frame_data_t)); replay_data.usernames = malloc(replay_data.n_usernames*sizeof(username_data_t)); @@ -114,7 +174,6 @@ int main(int argc, char **argv) } int cur_frame = 0; - int cur_username = 0; for (int i = 0; i < n_inputs; ++i) { frame_data_t * frame = replay_data.frames + cur_frame; @@ -125,12 +184,106 @@ int main(int argc, char **argv) } } - DR_Init(replay_data); + // AAAAAAA DR_Init() moved + g_key_map[dr_key_escape ] = KEY_ESCAPE; + g_key_map[dr_key_enter ] = KEY_ENTER; + g_key_map[dr_key_left ] = KEY_LEFTARROW; + g_key_map[dr_key_right ] = KEY_RIGHTARROW; + g_key_map[dr_key_up ] = KEY_UPARROW; + g_key_map[dr_key_down ] = KEY_DOWNARROW; + g_key_map[dr_key_alt ] = KEY_LALT; + g_key_map[dr_key_shift ] = KEY_RSHIFT; + g_key_map[dr_key_use ] = KEY_USE; + g_key_map[dr_key_fire ] = KEY_FIRE; + g_key_map[dr_key_tab ] = KEY_TAB; + g_key_map[dr_key_yes ] = 'y'; + g_key_map[dr_key_no ] = 'n'; + g_key_map[dr_key_strafe_left ] = KEY_STRAFE_L; + g_key_map[dr_key_strafe_right] = KEY_STRAFE_R; + g_key_map[dr_key_0 ] = '0'; + g_key_map[dr_key_1 ] = '1'; + g_key_map[dr_key_2 ] = '2'; + g_key_map[dr_key_3 ] = '3'; + g_key_map[dr_key_4 ] = '4'; + g_key_map[dr_key_5 ] = '5'; + g_key_map[dr_key_6 ] = '6'; + g_key_map[dr_key_7 ] = '7'; + g_key_map[dr_key_8 ] = '8'; + g_key_map[dr_key_9 ] = '9'; + + g_replay_data = replay_data; + + for (int i = 0; i < dr_key_COUNT; ++i) { + g_pressed_last[i] = 0; + } + + printf("\n\n======= DOOM REPLAY ===========\n"); + printf("Frames to simulate: %6d (%g seconds)\n", g_replay_data.n_frames, (float)(g_replay_data.n_frames)/TICRATE); + printf("Start frame: %6d (%g seconds)\n", g_replay_data.n_start, (float)(g_replay_data.n_start)/TICRATE); + printf("Frames to record: %6d (%g seconds)\n", g_replay_data.n_record, (float)(g_replay_data.n_record)/TICRATE); + printf("Framerate: %6d\n", g_replay_data.framerate); + printf("===============================\n"); + + printf("[DEBUG] DR_init completed\n"); + // DR_Init(replay_data); + + // dg_Create(); + DG_ScreenBuffer = malloc(DOOMGENERIC_RESX * DOOMGENERIC_RESY * 4); + printf("[DEBUG] dg_Create completed\n"); + + + + // DoomMain(); + + printf("[DEBUG] Z_Init: Init zone memory allocation daemon. \n"); + Z_Init (); + + nomonsters = 0; + respawnparm = 0; + fastparm = 0; + devparm = 0; + deathmatch = 0; + + modifiedgame = false; + + D_AddFile("../doom1.wad"); + + // Generate the WAD hash table. Speed things up a bit. + // HZ CCCCCCCCCCC check + //W_GenerateHashTable(); + + I_InitTimer(); + + // get skill / episode / map from parms + startskill = sk_medium; + startepisode = 1; + startmap = 1; + autostart = false; + + timelimit = 0; + + // Not loading a game + startloadgame = -1; + + R_Init (); + + P_Init (); + + D_CheckNetGame (); + + ST_Init (); + + // [AAAA] autostart + autostart = 1; + G_InitNew (startskill, startepisode, startmap); + + D_DoomLoop (); // never returns - dg_Create(); - D_DoomMain (); return 0; } + + + diff --git a/zkldoom/z_main.h b/zkldoom/z_main.h new file mode 100644 index 0000000..997e77e --- /dev/null +++ b/zkldoom/z_main.h @@ -0,0 +1,2571 @@ +// +// Copyright(C) 1993-1996 Id Software, Inc. +// Copyright(C) 2005-2014 Simon Howard +// +// 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 2 +// 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: +// Main program, simply calls D_DoomMain high level loop. +// + +//#include +//#include + +//#include "m_argv.h" +//#include "doomreplay.h" + + +// [FROM] "i_input.h" +#define TICRATE 35 +// [ENDFROM] "i_input.h" + + +// [FROM] doomgeneric_dr.h +#include "doomkeys.h" + +#define KEYQUEUE_SIZE 16 + +static unsigned short s_KeyQueue[KEYQUEUE_SIZE]; +static unsigned int s_KeyQueueWriteIndex = 0; +static unsigned int s_KeyQueueReadIndex = 0; + +static FILE * g_fp = NULL; + +static clock_t g_t_start = 0; + +static const int64_t g_dt = 35000; +static const int64_t g_dt_gs = (g_dt/5)/TICRATE; // ensure at least 5 updates per frame + +static int64_t g_time_gs = 0; // current time +static int32_t g_frame_id = 0; // frame index +static int32_t g_username_id = 0; // username index + +static dr_keys_t g_pressed_last; +static dr_keys_t g_key_map; +static replay_data_t g_replay_data; +// [ENDFROM] "doomgeneric_dr.h" + + + + + +// [FROM] "doomgeneric.c/doomgeneric.h" (dg_Create()) +#define DOOMGENERIC_RESX 640 +#define DOOMGENERIC_RESY 400 +uint32_t* DG_ScreenBuffer = 0; +// [ENDFROM] "doomgeneric.c/doomgeneric.h" + + + + + +// [FROM] "m_fixed.h" +#define FRACBITS 16 +#define FRACUNIT (1<type] + + int tics; // state tic counter + state_t* state; + int flags; + int health; + + // Movement direction, movement generation (zig-zagging). + int movedir; // 0-7 + int movecount; // when 0, select a new dir + + // Thing being chased/attacked (or NULL), + // also the originator for missiles. + struct mobj_s* target; + + // Reaction time: if non 0, don't attack yet. + // Used by player to freeze a bit after teleporting. + int reactiontime; + + // If >0, the target will be chased + // no matter what (even if shot) + int threshold; + + // Additional info record for player avatars only. + // Only valid if type == MT_PLAYER + struct player_s* player; + + // Player number last looked for. + int lastlook; + + // For nightmare respawn. + mapthing_t spawnpoint; + + // Thing being chased/attacked for tracers. + struct mobj_s* tracer; + +} mobj_t; +// [ENDFROM] "p_mobj.h" + + + + +// [FROM] "doomdef.h" + +// +// Global parameters/defines. +// +// DOOM version +#define DOOM_VERSION 109 + +// Version code for cph's longtics hack ("v1.91") +#define DOOM_191_VERSION 111 + + +// If rangecheck is undefined, +// most parameter validation debugging code will not be compiled +#define RANGECHECK + +// The maximum number of players, multiplayer/networking. +#define MAXPLAYERS 4 + +// The current state of the game: whether we are +// playing, gazing at the intermission screen, +// the game final animation, or a demo. +typedef enum +{ + GS_LEVEL, + GS_INTERMISSION, + GS_FINALE, + GS_DEMOSCREEN, +} gamestate_t; + +typedef enum +{ + ga_nothing, + ga_loadlevel, + ga_newgame, + ga_loadgame, + ga_savegame, + ga_playdemo, + ga_completed, + ga_victory, + ga_worlddone, + ga_screenshot +} gameaction_t; + +// +// Difficulty/skill settings/filters. +// + +// Skill flags. +#define MTF_EASY 1 +#define MTF_NORMAL 2 +#define MTF_HARD 4 + +// Deaf monsters/do not react to sound. +#define MTF_AMBUSH 8 + + +// +// Key cards. +// +typedef enum +{ + it_bluecard, + it_yellowcard, + it_redcard, + it_blueskull, + it_yellowskull, + it_redskull, + + NUMCARDS + +} card_t; + + + +// The defined weapons, +// including a marker indicating +// user has not changed weapon. +typedef enum +{ + wp_fist, + wp_pistol, + wp_shotgun, + wp_chaingun, + wp_missile, + wp_plasma, + wp_bfg, + wp_chainsaw, + wp_supershotgun, + + NUMWEAPONS, + + // No pending weapon change. + wp_nochange + +} weapontype_t; + + +// Ammunition types defined. +typedef enum +{ + am_clip, // Pistol / chaingun ammo. + am_shell, // Shotgun / double barreled shotgun. + am_cell, // Plasma rifle, BFG. + am_misl, // Missile launcher. + NUMAMMO, + am_noammo // Unlimited for chainsaw / fist. + +} ammotype_t; + + +// Power up artifacts. +typedef enum +{ + pw_invulnerability, + pw_strength, + pw_invisibility, + pw_ironfeet, + pw_allmap, + pw_infrared, + NUMPOWERS + +} powertype_t; + + + +// +// Power up durations, +// how many seconds till expiration, +// assuming TICRATE is 35 ticks/second. +// +typedef enum +{ + INVULNTICS = (30*TICRATE), + INVISTICS = (60*TICRATE), + INFRATICS = (120*TICRATE), + IRONTICS = (60*TICRATE) + +} powerduration_t; +// [ENDFROM] "doomdef.h" + + + +// [FROM] "p_pspr.h" +// +// Frame flags: +// handles maximum brightness (torches, muzzle flare, light sources) +// +#define FF_FULLBRIGHT 0x8000 // flag in thing->frame +#define FF_FRAMEMASK 0x7fff + +// +// Overlay psprites are scaled shapes +// drawn directly on the view screen, +// coordinates are given for a 320*200 view screen. +// +typedef enum +{ + ps_weapon, + ps_flash, + NUMPSPRITES + +} psprnum_t; + +typedef struct +{ + state_t* state; // a NULL state means not active + int tics; + fixed_t sx; + fixed_t sy; + +} pspdef_t; +// [ENDFROM] "p_pspr.h" + + + +// [FROM] "d_player.h" +// +// Player states. +// +typedef enum +{ + // Playing or camping. + PST_LIVE, + // Dead on the ground, view follows killer. + PST_DEAD, + // Ready to restart/respawn??? + PST_REBORN + +} playerstate_t; + + +// +// Player internal flags, for cheats and debug. +// +typedef enum +{ + // No clipping, walk through barriers. + CF_NOCLIP = 1, + // No damage, no health loss. + CF_GODMODE = 2, + // Not really a cheat, just a debug aid. + CF_NOMOMENTUM = 4 + +} cheat_t; + + +// +// Extended player object info: player_t +// +typedef struct player_s +{ + mobj_t* mo; + playerstate_t playerstate; + ticcmd_t cmd; + + // Determine POV, + // including viewpoint bobbing during movement. + // Focal origin above r.z + fixed_t viewz; + // Base height above floor for viewz. + fixed_t viewheight; + // Bob/squat speed. + fixed_t deltaviewheight; + // bounded/scaled total momentum. + fixed_t bob; + + // This is only used between levels, + // mo->health is used during levels. + int health; + int armorpoints; + // Armor type is 0-2. + int armortype; + + // Power ups. invinc and invis are tic counters. + int powers[NUMPOWERS]; + boolean cards[NUMCARDS]; + boolean backpack; + + // Frags, kills of other players. + int frags[MAXPLAYERS]; + weapontype_t readyweapon; + + // Is wp_nochange if not changing. + weapontype_t pendingweapon; + + boolean weaponowned[NUMWEAPONS]; + int ammo[NUMAMMO]; + int maxammo[NUMAMMO]; + + // True if button down last tic. + int attackdown; + int usedown; + + // Bit flags, for cheats and debug. + // See cheat_t, above. + int cheats; + + // Refired shots are less accurate. + int refire; + + // For intermission stats. + int killcount; + int itemcount; + int secretcount; + + // Hint messages. + char* message; + + // For screen flashing (red or bright). + int damagecount; + int bonuscount; + + // Who did damage (NULL for floors/ceilings). + mobj_t* attacker; + + // So gun flashes light up areas. + int extralight; + + // Current PLAYPAL, ??? + // can be set to REDCOLORMAP for pain, etc. + int fixedcolormap; + + // Player skin colorshift, + // 0-3 for which color to draw player. + int colormap; + + // Overlay view sprites (gun, etc). + pspdef_t psprites[NUMPSPRITES]; + + // True if secret level has been done. + boolean didsecret; + +} player_t; + + +// +// INTERMISSION +// Structure passed e.g. to WI_Start(wb) +// +typedef struct +{ + boolean in; // whether the player is in game + + // Player stats, kills, collected items etc. + int skills; + int sitems; + int ssecret; + int stime; + int frags[4]; + int score; // current score on entry, modified on return + +} wbplayerstruct_t; + +typedef struct +{ + int epsd; // episode # (0-2) + + // if true, splash the secret level + boolean didsecret; + + // previous and next levels, origin 0 + int last; + int next; + + int maxkills; + int maxitems; + int maxsecret; + int maxfrags; + + // the par time + int partime; + + // index of this player in game + int pnum; + + wbplayerstruct_t plyr[MAXPLAYERS]; + +} wbstartstruct_t; +// [ENDFROM] "d_player.h" + + + + + +// [FROM] "d_mode.h" +typedef enum +{ + doom, // Doom 1 + doom2, // Doom 2 + pack_tnt, // Final Doom: TNT: Evilution + pack_plut, // Final Doom: The Plutonia Experiment + pack_chex, // Chex Quest (modded doom) + pack_hacx, // Hacx (modded doom2) + heretic, // Heretic + hexen, // Hexen + strife, // Strife + + none +} GameMission_t; + +// The "mode" allows more accurate specification of the game mode we are +// in: eg. shareware vs. registered. So doom1.wad and doom.wad are the +// same mission, but a different mode. + +typedef enum +{ + shareware, // Doom/Heretic shareware + registered, // Doom/Heretic registered + commercial, // Doom II/Hexen + retail, // Ultimate Doom + indetermined // Unknown. +} GameMode_t; + +// What version are we emulating? + +typedef enum +{ + exe_doom_1_2, // Doom 1.2: shareware and registered + exe_doom_1_666, // Doom 1.666: for shareware, registered and commercial + exe_doom_1_7, // Doom 1.7/1.7a: " + exe_doom_1_8, // Doom 1.8: " + exe_doom_1_9, // Doom 1.9: " + exe_hacx, // Hacx + exe_ultimate, // Ultimate Doom (retail) + exe_final, // Final Doom + exe_final2, // Final Doom (alternate exe) + exe_chex, // Chex Quest executable (based on Final Doom) + + exe_heretic_1_3, // Heretic 1.3 + + exe_hexen_1_1, // Hexen 1.1 + exe_strife_1_2, // Strife v1.2 + exe_strife_1_31 // Strife v1.31 +} GameVersion_t; + +// Skill level. + +typedef enum +{ + sk_noitems = -1, // the "-skill 0" hack + sk_baby = 0, + sk_easy, + sk_medium, + sk_hard, + sk_nightmare +} skill_t; + +boolean D_ValidGameMode(GameMission_t mission, GameMode_t mode); +boolean D_ValidGameVersion(GameMission_t mission, GameVersion_t version); +boolean D_ValidEpisodeMap(GameMission_t mission, GameMode_t mode, + int episode, int map); +int D_GetNumEpisodes(GameMission_t mission, GameMode_t mode); +boolean D_IsEpisodeMap(GameMission_t mission); +char *D_GameMissionString(GameMission_t mission); + + + +// [ENDFROM] "d_mode.h" + + + + +// [FROM] "d_main.h" +// Read events from all input devices + +// void D_ProcessEvents (void); + + +// +// BASE LEVEL +// +/* +void D_PageTicker (void); +void D_PageDrawer (void); +void D_AdvanceDemo (void); +void D_DoAdvanceDemo (void); +void D_StartTitle (void); +*/ +// +// GLOBAL VARIABLES +// + +extern gameaction_t gameaction; +// [ENDFROM] "d_main.h" + + + + +// [FROM] "doomstat.h" +// BBBBBBBBBBBBBB - "cross-includes" + +// ------------------------ +// Command line parameters. +// +extern boolean nomonsters; // checkparm of -nomonsters +extern boolean respawnparm; // checkparm of -respawn +extern boolean fastparm; // checkparm of -fast + +extern boolean devparm; // DEBUG: launched with -devparm + + +// ----------------------------------------------------- +// Game Mode - identify IWAD as shareware, retail etc. +// +extern GameMode_t gamemode; +extern GameMission_t gamemission; +extern GameVersion_t gameversion; +extern char *gamedescription; + +// If true, we're using one of the mangled BFG edition IWADs. +extern boolean bfgedition; + +// Convenience macro. +// 'gamemission' can be equal to pack_chex or pack_hacx, but these are +// just modified versions of doom and doom2, and should be interpreted +// as the same most of the time. + +#define logical_gamemission \ + (gamemission == pack_chex ? doom : \ + gamemission == pack_hacx ? doom2 : gamemission) + +// Set if homebrew PWAD stuff has been added. +extern boolean modifiedgame; + + +// ------------------------------------------- +// Selected skill type, map etc. +// + +// Defaults for menu, methinks. +extern skill_t startskill; +extern int startepisode; +extern int startmap; + +// Savegame slot to load on startup. This is the value provided to +// the -loadgame option. If this has not been provided, this is -1. + +extern int startloadgame; + +extern boolean autostart; + +// Selected by user. +extern skill_t gameskill; +extern int gameepisode; +extern int gamemap; + +// If non-zero, exit the level after this number of minutes +extern int timelimit; + +// Nightmare mode flag, single player. +extern boolean respawnmonsters; + +// Netgame? Only true if >1 player. +extern boolean netgame; + +// 0=Cooperative; 1=Deathmatch; 2=Altdeath +extern int deathmatch; + +// ------------------------- +// Internal parameters for sound rendering. +// These have been taken from the DOS version, +// but are not (yet) supported with Linux +// (e.g. no sound volume adjustment with menu. + +// From m_menu.c: +// Sound FX volume has default, 0 - 15 +// Music volume has default, 0 - 15 +// These are multiplied by 8. +extern int sfxVolume; +extern int musicVolume; + +// Current music/sfx card - index useless +// w/o a reference LUT in a sound module. +// Ideally, this would use indices found +// in: /usr/include/linux/soundcard.h +extern int snd_MusicDevice; +extern int snd_SfxDevice; +// Config file? Same disclaimer as above. +extern int snd_DesiredMusicDevice; +extern int snd_DesiredSfxDevice; + + +// ------------------------- +// Status flags for refresh. +// + +// Depending on view size - no status bar? +// Note that there is no way to disable the +// status bar explicitely. +extern boolean statusbaractive; + +extern boolean automapactive; // In AutoMap mode? +extern boolean menuactive; // Menu overlayed? +extern boolean paused; // Game Pause? + + +extern boolean viewactive; + +extern boolean nodrawers; + + +extern boolean testcontrols; +extern int testcontrols_mousespeed; + + + + +// This one is related to the 3-screen display mode. +// ANG90 = left side, ANG270 = right +extern int viewangleoffset; + +// Player taking events, and displaying. +extern int consoleplayer; +extern int displayplayer; + + +// ------------------------------------- +// Scores, rating. +// Statistics on a given map, for intermission. +// +extern int totalkills; +extern int totalitems; +extern int totalsecret; + +// Timer, for scores. +extern int levelstarttic; // gametic at level start +extern int leveltime; // tics in game play for par + + + +// -------------------------------------- +// DEMO playback/recording related stuff. +// No demo, there is a human player in charge? +// Disable save/end game? +extern boolean usergame; + +//? +extern boolean demoplayback; +extern boolean demorecording; + +// Round angleturn in ticcmds to the nearest 256. This is used when +// recording Vanilla demos in netgames. + +extern boolean lowres_turn; + +// Quit after playing a demo from cmdline. +extern boolean singledemo; + + + + +//? +extern gamestate_t gamestate; + + + + + + +//----------------------------- +// 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. + + + +// Bookkeeping on players - state. +extern player_t players[MAXPLAYERS]; + +// Alive? Disconnected? +extern boolean playeringame[MAXPLAYERS]; + + +// Player spawn spots for deathmatch. +#define MAX_DM_STARTS 10 +extern mapthing_t deathmatchstarts[MAX_DM_STARTS]; +extern mapthing_t* deathmatch_p; + +// Player spawn spots. +extern mapthing_t playerstarts[MAXPLAYERS]; + +// Intermission stats. +// Parameters for world map / intermission. +extern wbstartstruct_t wminfo; + + + + + + + +//----------------------------------------- +// Internal parameters, used for engine. +// + +// File handling stuff. +extern char * savegamedir; +extern char basedefault[1024]; + +// if true, load all graphics at level load +extern boolean precache; + + +// wipegamestate can be set to -1 +// to force a wipe on the next draw +extern gamestate_t wipegamestate; + +extern int mouseSensitivity; + +extern int bodyqueslot; + + + +// Needed to store the number of the dummy sky flat. +// Used for rendering, +// as well as tracking projectiles etc. +extern int skyflatnum; + + + +// Netgame stuff (buffers and pointers, i.e. indices). + + +extern int rndindex; + +extern ticcmd_t *netcmds; +// [ENDFROM] "doomstat.h" + +