2020-06-11 07:22:16 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 2010 EDuke32 developers and contributors
|
|
|
|
|
|
|
|
This file is part of EDuke32.
|
|
|
|
|
|
|
|
EDuke32 is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License version 2
|
|
|
|
as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#ifndef global_h_
|
|
|
|
#define global_h_
|
|
|
|
|
|
|
|
#include "build.h"
|
|
|
|
#include "compat.h"
|
2020-06-21 20:18:12 +00:00
|
|
|
#include "duke3d.h"
|
2020-06-11 07:22:16 +00:00
|
|
|
#include "mmulti.h"
|
2020-07-06 11:26:26 +00:00
|
|
|
#include "quotemgr.h"
|
2020-06-11 07:22:16 +00:00
|
|
|
#include "sounds.h"
|
2020-07-06 11:26:26 +00:00
|
|
|
#include "constants.h"
|
2020-07-19 18:04:11 +00:00
|
|
|
#include "types.h"
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
BEGIN_DUKE_NS
|
|
|
|
|
2020-07-06 13:48:51 +00:00
|
|
|
|
2020-07-19 18:04:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
extern user_defs ud;
|
|
|
|
extern int rtsplaying;
|
|
|
|
|
|
|
|
extern int32_t cameraclock;
|
|
|
|
extern int32_t cameradist;
|
|
|
|
extern int32_t tempwallptr;
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
TFLAG_WALLSWITCH = 1
|
|
|
|
};
|
|
|
|
// for now just flags not related to actors, may get more info later.
|
|
|
|
struct TileInfo
|
|
|
|
{
|
|
|
|
int flags;
|
|
|
|
};
|
|
|
|
extern TileInfo tileinfo[MAXTILES];
|
|
|
|
|
|
|
|
|
|
|
|
extern int32_t actor_tog;
|
|
|
|
extern int32_t otherp;
|
|
|
|
|
|
|
|
|
|
|
|
extern ActorInfo actorinfo[MAXTILES];
|
|
|
|
extern weaponhit hittype[MAXSPRITES];
|
|
|
|
extern bool sound445done;
|
|
|
|
|
|
|
|
extern intptr_t apScriptGameEvent[];
|
|
|
|
|
|
|
|
extern TArray<int> ScriptCode;
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-19 19:04:22 +00:00
|
|
|
#define VOLUMEALL ((g_gameType & GAMEFLAG_SHAREWARE) == 0)
|
|
|
|
#define PLUTOPAK ((g_gameType & GAMEFLAG_PLUTOPAK) != 0)
|
|
|
|
#define VOLUMEONE ((g_gameType & GAMEFLAG_SHAREWARE) != 0)
|
2020-07-06 13:48:51 +00:00
|
|
|
|
|
|
|
#define MOVEFIFOSIZ 256
|
|
|
|
|
|
|
|
#define MAXGAMETYPES 16
|
|
|
|
|
|
|
|
enum {
|
2020-07-07 18:27:21 +00:00
|
|
|
MUS_INTRO = 0,
|
|
|
|
MUS_BRIEFING = 1,
|
|
|
|
MUS_LOADING = 2,
|
2020-07-06 13:48:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-06-11 07:22:16 +00:00
|
|
|
#define MAXMINECARTS 16
|
|
|
|
#define MAXJAILDOORS 32
|
|
|
|
#define MAXLIGHTNINSECTORS 64
|
|
|
|
#define MAXTORCHSECTORS 64
|
|
|
|
#define MAXGEOSECTORS 64
|
|
|
|
|
|
|
|
#ifdef global_c_
|
|
|
|
#define G_EXTERN
|
|
|
|
#else
|
|
|
|
#define G_EXTERN extern
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define MAXINTERPOLATIONS MAXSPRITES
|
|
|
|
|
|
|
|
|
|
|
|
G_EXTERN int32_t duke3d_globalflags;
|
|
|
|
|
|
|
|
// KEEPINSYNC astub.c (used values only)
|
|
|
|
enum DUKE3D_GLOBALFLAGS {
|
|
|
|
DUKE3D_NO_WIDESCREEN_PINNING = 1<<0,
|
|
|
|
DUKE3D_NO_HARDCODED_FOGPALS = 1<<1,
|
|
|
|
DUKE3D_NO_PALETTE_CHANGES = 1<<2,
|
|
|
|
};
|
|
|
|
|
2020-07-06 20:23:18 +00:00
|
|
|
struct animwalltype
|
|
|
|
{
|
|
|
|
int16_t wallnum, tag;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-06-11 07:22:16 +00:00
|
|
|
G_EXTERN animwalltype animwall[MAXANIMWALLS];
|
2020-07-04 19:36:27 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
MAXLABELLEN = 64
|
|
|
|
};
|
|
|
|
|
2020-07-16 15:59:25 +00:00
|
|
|
G_EXTERN bool synchronized_input;
|
|
|
|
|
2020-06-11 07:22:16 +00:00
|
|
|
G_EXTERN char g_loadFromGroupOnly;
|
|
|
|
G_EXTERN char pus,pub;
|
|
|
|
G_EXTERN char ready2send;
|
|
|
|
#define MAXPLAYERNAME 32
|
|
|
|
G_EXTERN char tempbuf[MAXSECTORS<<1],buf[1024];
|
|
|
|
|
|
|
|
|
2020-07-17 18:56:10 +00:00
|
|
|
G_EXTERN input_t loc;
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
G_EXTERN int32_t avgfvel, avgsvel, avgbits;
|
|
|
|
G_EXTERN fix16_t avgavel, avghorz;
|
|
|
|
G_EXTERN int8_t avgextbits;
|
|
|
|
|
|
|
|
G_EXTERN int32_t movefifosendplc;
|
|
|
|
|
|
|
|
G_EXTERN int32_t predictfifoplc;
|
|
|
|
|
2020-07-15 19:11:23 +00:00
|
|
|
G_EXTERN int32_t g_networkBroadcastMode;
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
G_EXTERN int32_t g_animWallCnt;
|
2020-05-10 14:53:09 +00:00
|
|
|
#define numanimwalls g_animWallCnt
|
2020-06-11 07:22:16 +00:00
|
|
|
G_EXTERN int32_t g_animateCnt;
|
2020-05-10 10:42:47 +00:00
|
|
|
#define animatecnt g_animateCnt
|
2020-05-21 09:41:48 +00:00
|
|
|
G_EXTERN int32_t numclouds;
|
2020-07-05 14:49:00 +00:00
|
|
|
G_EXTERN int32_t camsprite;
|
2020-06-11 07:22:16 +00:00
|
|
|
G_EXTERN int32_t g_frameRate;
|
|
|
|
G_EXTERN int32_t g_cyclerCnt;
|
2020-05-06 19:11:36 +00:00
|
|
|
#define numcyclers g_cyclerCnt
|
2020-06-11 07:22:16 +00:00
|
|
|
G_EXTERN int32_t g_damageCameras;
|
2020-05-08 22:34:48 +00:00
|
|
|
#define camerashitable g_damageCameras
|
2020-06-11 07:22:16 +00:00
|
|
|
G_EXTERN int32_t g_defaultLabelCnt;
|
|
|
|
G_EXTERN int32_t g_earthquakeTime;
|
2020-05-07 07:49:05 +00:00
|
|
|
#define earthquaketime g_earthquakeTime
|
2020-06-11 07:22:16 +00:00
|
|
|
G_EXTERN int32_t g_freezerSelfDamage;
|
2020-05-10 18:59:38 +00:00
|
|
|
#define freezerhurtowner g_freezerSelfDamage
|
2020-06-11 07:22:16 +00:00
|
|
|
G_EXTERN int32_t g_gameQuit;
|
2020-07-07 18:27:21 +00:00
|
|
|
G_EXTERN int32_t global_random;
|
2020-05-13 10:18:36 +00:00
|
|
|
G_EXTERN int32_t impact_damage;
|
2020-06-11 07:22:16 +00:00
|
|
|
G_EXTERN int32_t g_maxPlayerHealth;
|
2020-05-21 09:41:48 +00:00
|
|
|
G_EXTERN int32_t mirrorcnt;
|
2020-07-01 18:31:29 +00:00
|
|
|
G_EXTERN int32_t playerswhenstarted;
|
2020-06-11 07:22:16 +00:00
|
|
|
G_EXTERN int32_t g_musicSize;
|
2020-05-20 20:18:03 +00:00
|
|
|
G_EXTERN int32_t numplayersprites;
|
2020-06-11 07:22:16 +00:00
|
|
|
G_EXTERN int32_t g_scriptDebug;
|
2020-07-06 01:00:52 +00:00
|
|
|
G_EXTERN int32_t show_shareware;
|
2020-06-11 07:22:16 +00:00
|
|
|
G_EXTERN int32_t g_spriteDeleteQueuePos;
|
2020-05-13 10:18:36 +00:00
|
|
|
G_EXTERN int32_t max_player_health;
|
|
|
|
G_EXTERN int32_t max_armour_amount;
|
|
|
|
G_EXTERN int32_t lasermode;
|
2020-06-11 07:22:16 +00:00
|
|
|
G_EXTERN int32_t screenpeek;
|
|
|
|
|
|
|
|
G_EXTERN int16_t g_animateSect[MAXANIMATES];
|
2020-05-10 10:42:47 +00:00
|
|
|
#define animatesect g_animateSect
|
2020-06-11 07:22:16 +00:00
|
|
|
G_EXTERN int32_t *g_animatePtr[MAXANIMATES];
|
2020-05-10 14:53:09 +00:00
|
|
|
#define animateptr g_animatePtr
|
2020-06-11 07:22:16 +00:00
|
|
|
G_EXTERN int32_t g_animateGoal[MAXANIMATES];
|
2020-05-10 14:53:09 +00:00
|
|
|
#define animategoal g_animateGoal
|
2020-06-11 07:22:16 +00:00
|
|
|
G_EXTERN int32_t g_animateVel[MAXANIMATES];
|
2020-05-10 14:53:09 +00:00
|
|
|
#define animatevel g_animateVel
|
2020-06-11 07:22:16 +00:00
|
|
|
|
2020-05-21 09:41:48 +00:00
|
|
|
G_EXTERN int16_t clouds[256];
|
2020-07-06 01:00:52 +00:00
|
|
|
G_EXTERN int16_t cloudx;
|
|
|
|
G_EXTERN int16_t cloudy;
|
|
|
|
G_EXTERN ClockTicks cloudtotalclock;
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
G_EXTERN int16_t SpriteDeletionQueue[1024];
|
|
|
|
G_EXTERN int16_t g_cyclers[MAXCYCLERS][6];
|
2020-05-06 19:11:36 +00:00
|
|
|
#define cyclers g_cyclers
|
2020-05-21 09:41:48 +00:00
|
|
|
G_EXTERN int16_t mirrorsector[64];
|
|
|
|
G_EXTERN int16_t mirrorwall[64];
|
2020-06-11 07:22:16 +00:00
|
|
|
G_EXTERN ClockTicks lockclock;
|
|
|
|
G_EXTERN ClockTicks ototalclock;
|
|
|
|
|
2020-05-17 16:04:45 +00:00
|
|
|
G_EXTERN int32_t wupass;
|
2020-05-21 09:41:48 +00:00
|
|
|
G_EXTERN int32_t chickenplant;
|
|
|
|
G_EXTERN int32_t thunderon;
|
2020-06-11 07:22:16 +00:00
|
|
|
G_EXTERN int32_t g_ufoSpawn;
|
2020-05-10 07:08:02 +00:00
|
|
|
#define ufospawn g_ufoSpawn
|
2020-06-11 07:22:16 +00:00
|
|
|
G_EXTERN int32_t g_ufoCnt;
|
2020-05-10 07:08:02 +00:00
|
|
|
#define ufocnt g_ufoCnt
|
2020-06-11 07:22:16 +00:00
|
|
|
G_EXTERN int32_t g_hulkSpawn;
|
2020-05-10 07:08:02 +00:00
|
|
|
#define hulkspawn g_hulkSpawn
|
2020-06-11 07:22:16 +00:00
|
|
|
G_EXTERN int32_t g_lastLevel;
|
2020-05-10 07:08:02 +00:00
|
|
|
#define lastlevel g_lastLevel
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
|
2020-05-21 09:41:48 +00:00
|
|
|
G_EXTERN int32_t geosectorwarp[MAXGEOSECTORS];
|
|
|
|
G_EXTERN int32_t geosectorwarp2[MAXGEOSECTORS];
|
|
|
|
G_EXTERN int32_t geosector[MAXGEOSECTORS];
|
|
|
|
G_EXTERN int32_t geox[MAXGEOSECTORS];
|
|
|
|
G_EXTERN int32_t geoy[MAXGEOSECTORS];
|
|
|
|
G_EXTERN int32_t geox2[MAXGEOSECTORS];
|
|
|
|
G_EXTERN int32_t geoy2[MAXGEOSECTORS];
|
|
|
|
G_EXTERN uint32_t geocnt;
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
G_EXTERN int32_t g_thunderFlash;
|
|
|
|
G_EXTERN int32_t g_thunderTime;
|
|
|
|
G_EXTERN int32_t g_winderFlash;
|
|
|
|
G_EXTERN int32_t g_winderTime;
|
|
|
|
G_EXTERN int32_t g_brightness;
|
|
|
|
|
2020-05-14 07:07:07 +00:00
|
|
|
G_EXTERN int16_t ambientlotag[64];
|
|
|
|
G_EXTERN int16_t ambienthitag[64];
|
2020-05-21 09:41:48 +00:00
|
|
|
G_EXTERN uint32_t ambientfx;
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
|
2020-07-19 17:31:31 +00:00
|
|
|
G_EXTERN int msx[MAXANIMPOINTS], msy[MAXANIMPOINTS];
|
2020-06-11 07:22:16 +00:00
|
|
|
|
2020-05-14 17:23:36 +00:00
|
|
|
G_EXTERN int32_t WindTime, WindDir;
|
2020-05-21 09:41:48 +00:00
|
|
|
G_EXTERN int16_t fakebubba_spawn, mamaspawn_count, banjosound, g_bellTime, BellSprite;
|
2020-05-10 16:05:36 +00:00
|
|
|
#define BellTime g_bellTime
|
2020-05-21 09:41:48 +00:00
|
|
|
#define word_119BE0 BellSprite
|
2020-05-10 18:59:38 +00:00
|
|
|
G_EXTERN uint8_t g_spriteExtra[MAXSPRITES], g_sectorExtra[MAXSECTORS]; // move these back into the base structs!
|
2020-07-07 18:27:21 +00:00
|
|
|
G_EXTERN uint8_t enemysizecheat, ufospawnsminion, pistonsound, chickenphase, RRRA_ExitedLevel, fogactive;
|
2020-07-15 19:11:23 +00:00
|
|
|
extern int32_t g_cdTrack;
|
2020-05-08 22:34:48 +00:00
|
|
|
#define raat607 enemysizecheat // only as a reminder
|
2020-05-17 16:04:45 +00:00
|
|
|
#define raat605 chickenphase
|
|
|
|
#define at59d yeehaa_timer
|
2020-06-11 07:22:16 +00:00
|
|
|
|
2020-07-06 21:33:33 +00:00
|
|
|
G_EXTERN player_orig po[MAXPLAYERS];
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
G_EXTERN uint32_t everyothertime;
|
|
|
|
G_EXTERN double g_gameUpdateTime;
|
|
|
|
G_EXTERN double g_gameUpdateAndDrawTime;
|
|
|
|
#define GAMEUPDATEAVGTIMENUMSAMPLES 100
|
|
|
|
extern float g_gameUpdateAvgTime;
|
|
|
|
|
|
|
|
#ifndef global_c_
|
|
|
|
extern char CheatKeys[2];
|
|
|
|
extern char g_gametypeNames[MAXGAMETYPES][33];
|
|
|
|
|
2020-05-13 10:18:36 +00:00
|
|
|
extern int32_t respawnactortime;
|
2020-07-06 06:55:56 +00:00
|
|
|
extern int32_t bouncemineblastradius;
|
2020-06-11 07:22:16 +00:00
|
|
|
extern int32_t g_deleteQueueSize;
|
|
|
|
extern int32_t g_gametypeCnt;
|
2020-05-13 10:18:36 +00:00
|
|
|
extern int32_t respawnitemtime;
|
2020-06-11 07:22:16 +00:00
|
|
|
extern int32_t g_morterRadius;
|
2020-05-08 22:34:48 +00:00
|
|
|
#define morterblastradius g_morterRadius
|
2020-05-13 10:18:36 +00:00
|
|
|
extern int32_t numfreezebounces;
|
2020-06-11 07:22:16 +00:00
|
|
|
extern int32_t g_pipebombRadius;
|
2020-05-07 07:49:05 +00:00
|
|
|
#define pipebombblastradius g_pipebombRadius
|
2020-05-13 10:18:36 +00:00
|
|
|
extern int32_t dukefriction;
|
|
|
|
extern int32_t rpgblastradius;
|
2020-06-11 07:22:16 +00:00
|
|
|
extern int32_t g_scriptSize;
|
|
|
|
extern int32_t g_seenineRadius;
|
2020-05-07 07:49:05 +00:00
|
|
|
#define seenineblastradius g_seenineRadius
|
2020-06-11 07:22:16 +00:00
|
|
|
extern int32_t g_shrinkerRadius;
|
2020-05-07 12:38:01 +00:00
|
|
|
#define shrinkerblastradius g_shrinkerRadius
|
2020-06-11 07:22:16 +00:00
|
|
|
extern int32_t g_spriteGravity;
|
|
|
|
extern int32_t g_timerTicsPerSecond;
|
|
|
|
extern int32_t g_tripbombRadius;
|
2020-05-07 07:49:05 +00:00
|
|
|
#define tripbombblastradius g_tripbombRadius
|
2020-05-08 22:34:48 +00:00
|
|
|
#define powderkegblastradius g_tripbombRadius
|
2020-06-11 07:22:16 +00:00
|
|
|
extern int32_t g_volumeCnt;
|
2020-05-07 07:49:05 +00:00
|
|
|
#define gc g_spriteGravity
|
2020-06-11 07:22:16 +00:00
|
|
|
|
2020-05-14 10:14:03 +00:00
|
|
|
extern int16_t weaponsandammosprites[15];
|
2020-06-11 07:22:16 +00:00
|
|
|
extern int32_t g_gametypeFlags[MAXGAMETYPES];
|
|
|
|
|
2020-05-10 07:08:02 +00:00
|
|
|
#endif
|
|
|
|
|
2020-05-05 11:15:30 +00:00
|
|
|
// Interpolation code is the same in all games with slightly different naming - this needs to be unified and cleaned up.
|
2020-05-20 21:39:54 +00:00
|
|
|
extern int32_t numinterpolations;
|
2020-05-05 11:15:30 +00:00
|
|
|
extern int32_t* curipos[MAXINTERPOLATIONS];
|
|
|
|
extern int32_t bakipos[MAXINTERPOLATIONS];
|
2020-06-30 09:55:01 +00:00
|
|
|
|
2020-05-05 11:15:30 +00:00
|
|
|
|
|
|
|
// old names as porting help.
|
2020-06-30 09:55:01 +00:00
|
|
|
void updateinterpolations();
|
|
|
|
void restoreinterpolations();
|
|
|
|
void setinterpolation(int* posptr);
|
|
|
|
void stopinterpolation(int* posptr);
|
|
|
|
void dointerpolations(int smoothratio);
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
|
2020-07-14 22:26:58 +00:00
|
|
|
extern player_struct ps[MAXPLAYERS];
|
2020-05-05 09:58:39 +00:00
|
|
|
|
2020-07-06 06:55:56 +00:00
|
|
|
|
|
|
|
extern int spriteqamount;
|
2020-05-06 07:56:13 +00:00
|
|
|
#define spriteq SpriteDeletionQueue
|
|
|
|
#define spriteqloc g_spriteDeleteQueuePos
|
|
|
|
|
2020-07-06 13:48:51 +00:00
|
|
|
|
|
|
|
|
2020-07-06 20:23:18 +00:00
|
|
|
extern uint8_t shadedsector[MAXSECTORS];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 07:22:16 +00:00
|
|
|
END_DUKE_NS
|
|
|
|
|
2020-07-06 20:23:18 +00:00
|
|
|
#include "inlines.h"
|
|
|
|
|
2020-06-11 07:22:16 +00:00
|
|
|
#endif
|