2010-08-02 08:13:51 +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
|
2014-07-20 08:55:56 +00:00
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2010-08-02 08:13:51 +00:00
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
2014-11-22 12:32:56 +00:00
|
|
|
#ifndef global_h_
|
|
|
|
#define global_h_
|
2010-08-02 08:13:51 +00:00
|
|
|
|
2014-11-22 12:32:56 +00:00
|
|
|
#ifdef global_c_
|
2010-08-02 08:13:51 +00:00
|
|
|
#define G_EXTERN
|
|
|
|
#else
|
|
|
|
#define G_EXTERN extern
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define MAXINTERPOLATIONS MAXSPRITES
|
2012-06-17 19:45:41 +00:00
|
|
|
// KEEPINSYNC lunatic/con_lang.lua
|
2012-03-25 22:00:27 +00:00
|
|
|
#define MAXSKILLS 7
|
2010-08-02 08:13:51 +00:00
|
|
|
|
2012-11-05 02:49:08 +00:00
|
|
|
// duke3d global soup :(
|
|
|
|
|
2015-04-18 21:59:21 +00:00
|
|
|
// XXX: we don't #include everything we need.
|
2012-11-05 02:49:08 +00:00
|
|
|
#include "compat.h"
|
|
|
|
#include "build.h"
|
|
|
|
|
|
|
|
G_EXTERN int32_t g_numInterpolations;
|
|
|
|
G_EXTERN int32_t g_interpolationLock;
|
|
|
|
G_EXTERN int32_t oldipos[MAXINTERPOLATIONS];
|
|
|
|
G_EXTERN int32_t *curipos[MAXINTERPOLATIONS];
|
|
|
|
G_EXTERN int32_t bakipos[MAXINTERPOLATIONS];
|
2014-07-28 06:43:16 +00:00
|
|
|
|
|
|
|
#include "mmulti.h"
|
2011-04-07 01:16:29 +00:00
|
|
|
|
2012-11-05 02:49:08 +00:00
|
|
|
#include "duke3d.h"
|
|
|
|
#include "sector.h"
|
|
|
|
#include "quotes.h"
|
|
|
|
|
2014-11-26 04:39:23 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2015-04-24 00:08:46 +00:00
|
|
|
G_EXTERN int32_t duke3d_globalflags;
|
|
|
|
|
2015-12-20 05:18:53 +00:00
|
|
|
// KEEPINSYNC astub.c (used values only)
|
|
|
|
enum DUKE3D_GLOBALFLAGS {
|
2015-04-24 00:08:46 +00:00
|
|
|
DUKE3D_NO_WIDESCREEN_PINNING = 1<<0,
|
2015-10-03 11:53:19 +00:00
|
|
|
DUKE3D_NO_HARDCODED_FOGPALS = 1<<1,
|
2015-12-20 05:18:53 +00:00
|
|
|
DUKE3D_NO_PALETTE_CHANGES = 1<<2,
|
2015-04-24 00:08:46 +00:00
|
|
|
};
|
|
|
|
|
2010-08-02 08:13:51 +00:00
|
|
|
G_EXTERN DukeStatus_t sbar;
|
|
|
|
G_EXTERN actor_t actor[MAXSPRITES];
|
2012-11-11 17:57:06 +00:00
|
|
|
// g_tile: tile-specific data THAT DOES NOT CHANGE during the course of a game
|
2012-10-30 15:54:35 +00:00
|
|
|
G_EXTERN tiledata_t g_tile[MAXTILES];
|
2010-08-02 08:13:51 +00:00
|
|
|
G_EXTERN animwalltype animwall[MAXANIMWALLS];
|
|
|
|
G_EXTERN char *ScriptQuotes[MAXQUOTES],*ScriptQuoteRedefinitions[MAXQUOTES];
|
|
|
|
G_EXTERN char *label;
|
2012-06-04 22:01:45 +00:00
|
|
|
G_EXTERN int32_t g_musicIndex;
|
2012-08-16 21:48:13 +00:00
|
|
|
G_EXTERN char g_loadFromGroupOnly;
|
2012-03-25 22:00:27 +00:00
|
|
|
G_EXTERN char g_numSkills;
|
2010-08-02 08:13:51 +00:00
|
|
|
G_EXTERN char myjumpingtoggle,myonground,myhardlanding,myreturntocenter;
|
|
|
|
G_EXTERN char pus,pub;
|
|
|
|
G_EXTERN char ready2send;
|
2014-05-17 12:36:40 +00:00
|
|
|
#define MAXPLAYERNAME 32
|
|
|
|
G_EXTERN char szPlayerName[MAXPLAYERNAME];
|
2013-05-04 16:36:13 +00:00
|
|
|
// XXX: menutextbuf overflow possible?
|
2012-11-04 23:41:05 +00:00
|
|
|
G_EXTERN char tempbuf[MAXSECTORS<<1],packbuf[PACKBUF_SIZE],menutextbuf[128],buf[1024];
|
2014-05-17 12:36:40 +00:00
|
|
|
#define TYPEBUFSIZE 141
|
|
|
|
G_EXTERN char typebuf[TYPEBUFSIZE];
|
2010-08-02 08:13:51 +00:00
|
|
|
G_EXTERN input_t avg;
|
|
|
|
G_EXTERN input_t loc;
|
|
|
|
G_EXTERN input_t recsync[RECSYNCBUFSIZ];
|
2012-12-29 10:58:38 +00:00
|
|
|
G_EXTERN int16_t SpriteDeletionQueue[1024],g_spriteDeleteQueuePos;
|
2010-08-02 08:13:51 +00:00
|
|
|
G_EXTERN int16_t animatesect[MAXANIMATES];
|
2013-12-26 19:45:12 +00:00
|
|
|
G_EXTERN int16_t g_curViewscreen;
|
2010-08-02 08:13:51 +00:00
|
|
|
G_EXTERN int16_t cyclers[MAXCYCLERS][6],g_numCyclers;
|
|
|
|
G_EXTERN int16_t g_globalRandom;
|
|
|
|
G_EXTERN int16_t g_mirrorWall[64],g_mirrorSector[64],g_mirrorCount;
|
|
|
|
G_EXTERN int16_t g_numAnimWalls;
|
2015-04-18 21:59:18 +00:00
|
|
|
G_EXTERN int16_t g_numClouds,clouds[256],cloudx,cloudy;
|
2010-08-02 08:13:51 +00:00
|
|
|
G_EXTERN int16_t myang,omyang,mycursectnum,myjumpingcounter;
|
|
|
|
G_EXTERN int16_t myhoriz,omyhoriz,myhorizoff,omyhorizoff;
|
|
|
|
G_EXTERN int32_t *animateptr[MAXANIMATES];
|
|
|
|
G_EXTERN int32_t animategoal[MAXANIMATES],animatevel[MAXANIMATES],g_animateCount;
|
|
|
|
G_EXTERN int32_t cloudtotalclock;
|
|
|
|
G_EXTERN int32_t g_currentFrameRate;
|
|
|
|
G_EXTERN int32_t g_damageCameras,g_freezerSelfDamage;
|
|
|
|
G_EXTERN int32_t g_doQuickSave;
|
2013-02-11 17:16:50 +00:00
|
|
|
G_EXTERN uint16_t g_earthquakeTime;
|
2010-08-02 08:13:51 +00:00
|
|
|
G_EXTERN int32_t g_gameQuit;
|
|
|
|
G_EXTERN int32_t g_impactDamage,g_maxPlayerHealth;
|
|
|
|
G_EXTERN int32_t g_musicSize;
|
|
|
|
G_EXTERN int32_t g_numLabels,g_numDefaultLabels;
|
|
|
|
G_EXTERN int32_t g_scriptDebug;
|
|
|
|
G_EXTERN int32_t g_showShareware;
|
2012-11-05 02:49:08 +00:00
|
|
|
G_EXTERN int8_t g_numPlayerSprites;
|
2010-08-02 08:13:51 +00:00
|
|
|
G_EXTERN int32_t g_tripbombLaserMode;
|
|
|
|
G_EXTERN int32_t msx[2048],msy[2048];
|
|
|
|
G_EXTERN int32_t neartaghitdist,lockclock,g_startArmorAmount;
|
|
|
|
G_EXTERN int32_t playerswhenstarted;
|
|
|
|
G_EXTERN int32_t screenpeek;
|
|
|
|
G_EXTERN int32_t startofdynamicinterpolations;
|
Clean up some player code a bit... make bobposx/bobposy a vec2_t, make fricxv/fricyv a per-player vec2_t (TODO: CON access), promote angvel in input_t to int16_t and allow for player angle changes that result in odd numbered angles (we were effectively artificially limiting the angle to 1024 values before), fix some HUD model ID stuff that should help with the weapons in the HRP, clean up a bunch of random functions (P_FireWeapon(), P_DisplayTip(), P_DisplayAccess(), P_DisplayWeapon(), P_GetInput(), etc). Also clean up G_SetupFilenameBasedMusic() to loop through flac/ogg/mid when searching for usermap music replacements. Some of this really needs a BYTEVERSION bump, but these commits aren't for synthesis to build so we're not doing it yet. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4703 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-29 17:07:11 +00:00
|
|
|
G_EXTERN int32_t ototalclock;
|
2015-01-11 04:56:10 +00:00
|
|
|
G_EXTERN intptr_t *g_scriptPtr;
|
2011-12-04 21:20:17 +00:00
|
|
|
G_EXTERN int32_t *labelcode,*labeltype;
|
2010-08-02 08:13:51 +00:00
|
|
|
G_EXTERN intptr_t *script;
|
2014-09-07 18:10:14 +00:00
|
|
|
G_EXTERN map_t MapInfo[(MAXVOLUMES+1)*MAXLEVELS]; // +1 volume for "intro", "briefing" and "loading" music
|
2015-02-07 17:29:11 +00:00
|
|
|
|
|
|
|
// XXX: I think this pragma pack is meaningless here.
|
|
|
|
// MSDN (https://msdn.microsoft.com/en-us/library/2e70t5y1%28VS.80%29.aspx) says:
|
|
|
|
// "pack takes effect at the first struct, union, or class declaration after
|
|
|
|
// the pragma is seen; pack has no effect on definitions."
|
2012-11-05 02:49:08 +00:00
|
|
|
#pragma pack(push,1)
|
2015-02-07 17:29:11 +00:00
|
|
|
#ifdef global_c_
|
|
|
|
static playerdata_t g_player_s[1 + MAXPLAYERS];
|
|
|
|
playerdata_t *const g_player = &g_player_s[1];
|
|
|
|
#else
|
|
|
|
extern playerdata_t *const g_player;
|
|
|
|
#endif
|
2010-08-02 08:13:51 +00:00
|
|
|
G_EXTERN playerspawn_t g_playerSpawnPoints[MAXPLAYERS];
|
2012-11-05 02:49:08 +00:00
|
|
|
G_EXTERN input_t inputfifo[MOVEFIFOSIZ][MAXPLAYERS];
|
|
|
|
#pragma pack(pop)
|
2015-02-07 17:29:11 +00:00
|
|
|
|
2012-10-30 15:54:35 +00:00
|
|
|
G_EXTERN projectile_t SpriteProjectile[MAXSPRITES];
|
2010-08-02 08:13:51 +00:00
|
|
|
G_EXTERN sound_t g_sounds[MAXSOUNDS];
|
|
|
|
G_EXTERN uint32_t everyothertime;
|
|
|
|
G_EXTERN uint32_t g_moveThingsCount;
|
|
|
|
G_EXTERN vec3_t my,omy,myvel;
|
|
|
|
G_EXTERN volatile char g_soundlocks[MAXSOUNDS];
|
|
|
|
G_EXTERN int32_t g_restorePalette;
|
|
|
|
G_EXTERN int32_t g_screenCapture;
|
|
|
|
G_EXTERN int32_t g_noEnemies;
|
|
|
|
|
2014-11-22 12:32:56 +00:00
|
|
|
#ifndef global_c_
|
2015-02-07 17:29:11 +00:00
|
|
|
extern const char *s_buildDate;
|
|
|
|
extern int32_t g_spriteGravity;
|
|
|
|
extern int16_t g_spriteDeleteQueueSize;
|
|
|
|
extern char EpisodeNames[MAXVOLUMES][33];
|
2015-02-22 22:15:20 +00:00
|
|
|
extern int32_t EpisodeFlags[MAXVOLUMES];
|
2015-02-07 17:29:11 +00:00
|
|
|
extern char SkillNames[MAXSKILLS][33];
|
|
|
|
extern char GametypeNames[MAXGAMETYPES][33];
|
|
|
|
extern int32_t GametypeFlags[MAXGAMETYPES];
|
|
|
|
extern char g_numGametypes;
|
|
|
|
extern char g_numVolumes;
|
|
|
|
extern int32_t g_timerTicsPerSecond;
|
|
|
|
extern int32_t g_actorRespawnTime;
|
|
|
|
extern int32_t g_itemRespawnTime;
|
|
|
|
extern int32_t g_scriptSize;
|
|
|
|
extern int16_t BlimpSpawnSprites[15];
|
|
|
|
extern int32_t g_playerFriction;
|
|
|
|
extern int32_t g_numFreezeBounces;
|
|
|
|
extern int32_t g_lastSaveSlot;
|
|
|
|
extern int32_t g_rpgBlastRadius;
|
|
|
|
extern int32_t g_pipebombBlastRadius;
|
|
|
|
extern int32_t g_tripbombBlastRadius;
|
|
|
|
extern int32_t g_shrinkerBlastRadius;
|
|
|
|
extern int32_t g_morterBlastRadius;
|
|
|
|
extern int32_t g_bouncemineBlastRadius;
|
|
|
|
extern int32_t g_seenineBlastRadius;
|
|
|
|
extern char CheatKeys[2];
|
|
|
|
extern char setupfilename[BMAX_PATH];
|
2012-12-29 10:58:38 +00:00
|
|
|
#endif
|
|
|
|
|
2015-02-22 22:15:20 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
EF_HIDEFROMSP = 1<<0,
|
2015-03-08 07:56:45 +00:00
|
|
|
// EF_HIDEFROMMP = 1<<1,
|
2015-02-22 22:15:20 +00:00
|
|
|
};
|
|
|
|
|
2016-01-08 01:33:35 +00:00
|
|
|
EXTERN_INLINE_HEADER void G_UpdateInterpolations(void);
|
|
|
|
EXTERN_INLINE_HEADER void G_RestoreInterpolations(void);
|
|
|
|
|
2014-11-26 04:39:23 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2016-01-08 01:33:35 +00:00
|
|
|
#if defined global_c_ || !defined DISABLE_INLINING
|
|
|
|
|
|
|
|
EXTERN_INLINE void G_UpdateInterpolations(void) //Stick at beginning of G_DoMoveThings
|
|
|
|
{
|
|
|
|
for (int i=g_numInterpolations-1; i>=0; i--) oldipos[i] = *curipos[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
EXTERN_INLINE void G_RestoreInterpolations(void) //Stick at end of drawscreen
|
|
|
|
{
|
|
|
|
int32_t i=g_numInterpolations-1;
|
|
|
|
|
|
|
|
if (--g_interpolationLock)
|
|
|
|
return;
|
|
|
|
|
|
|
|
for (; i>=0; i--) *curipos[i] = bakipos[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2010-08-02 08:13:51 +00:00
|
|
|
#endif
|