2006-04-13 20:47:06 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
2007-02-08 04:19:39 +00:00
|
|
|
Copyright (C) 1996, 2003 - 3D Realms Entertainment
|
|
|
|
Copyright (C) 2000, 2003 - Matt Saettler (EDuke Enhancements)
|
|
|
|
Copyright (C) 2004, 2007 - EDuke32 developers
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
#include "duke3d.h"
|
|
|
|
|
2009-12-14 09:54:11 +00:00
|
|
|
const char *s_buildDate = "20091214";
|
2008-03-09 08:14:12 +00:00
|
|
|
char *MusicPtr = NULL;
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t g_musicSize;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
int16_t g_globalRandom;
|
|
|
|
int16_t neartagsector, neartagwall, neartagsprite;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t neartaghitdist,lockclock,g_startArmorAmount;
|
2008-11-24 09:22:07 +00:00
|
|
|
// JBF: g_spriteGravity modified to default to Atomic ed. default when using 1.3d CONs
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t g_spriteGravity=176;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
// int32_t temp_data[MAXSPRITES][6];
|
2008-12-21 22:46:55 +00:00
|
|
|
ActorData_t ActorExtra[MAXSPRITES];
|
2007-03-08 21:07:10 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
int16_t SpriteDeletionQueue[1024],g_spriteDeleteQueuePos,g_spriteDeleteQueueSize=64;
|
2007-08-27 00:20:15 +00:00
|
|
|
animwalltype animwall[MAXANIMWALLS];
|
2009-01-09 09:29:17 +00:00
|
|
|
int16_t g_numAnimWalls;
|
|
|
|
int32_t *animateptr[MAXANIMATES];
|
|
|
|
int32_t animategoal[MAXANIMATES], animatevel[MAXANIMATES], g_animateCount;
|
|
|
|
// int32_t oanimateval[MAXANIMATES];
|
|
|
|
int16_t animatesect[MAXANIMATES];
|
|
|
|
int32_t msx[2048],msy[2048];
|
|
|
|
int16_t cyclers[MAXCYCLERS][6],g_numCyclers;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
char *ScriptQuotes[MAXQUOTES], *ScriptQuoteRedefinitions[MAXQUOTES];
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-12-05 09:22:43 +00:00
|
|
|
char tempbuf[2048], packbuf[4096], menutextbuf[128], buf[1024];
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
int16_t camsprite;
|
|
|
|
int16_t g_mirrorWall[64], g_mirrorSector[64], g_mirrorCount;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t g_currentMenu;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
map_t MapInfo[(MAXVOLUMES+1)*MAXLEVELS]; // +1 volume for "intro", "briefing" music
|
2009-07-09 02:29:48 +00:00
|
|
|
sound_t g_sounds[ MAXSOUNDS ];
|
2009-07-12 01:55:34 +00:00
|
|
|
volatile char g_soundlocks[MAXSOUNDS];
|
2007-08-26 11:28:32 +00:00
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
char EpisodeNames[MAXVOLUMES][33] = { "L.A. MELTDOWN", "LUNAR APOCALYPSE", "SHRAPNEL CITY" };
|
|
|
|
char SkillNames[5][33] = { "PIECE OF CAKE", "LET'S ROCK", "COME GET SOME", "DAMN I'M GOOD" };
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
char GametypeNames[MAXGAMETYPES][33] = { "DUKEMATCH (SPAWN)","COOPERATIVE PLAY","DUKEMATCH (NO SPAWN)","TEAM DM (SPAWN)","TEAM DM (NO SPAWN)"};
|
2008-12-15 13:56:30 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t GametypeFlags[MAXGAMETYPES] =
|
2008-12-15 13:56:30 +00:00
|
|
|
{
|
|
|
|
4+8+16+1024+2048+16384,
|
|
|
|
1+2+32+64+128+256+512+4096+8192+32768,
|
|
|
|
2+4+8+16+16384,
|
|
|
|
4+8+16+1024+2048+16384+65536+131072,
|
|
|
|
2+4+8+16+16384+65536+131072
|
|
|
|
};
|
2008-11-20 14:06:36 +00:00
|
|
|
char g_numGametypes = 5;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t g_currentFrameRate;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
char g_numVolumes = 3;
|
2006-06-19 19:28:49 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t g_timerTicsPerSecond=TICRATE;
|
2006-04-13 20:47:06 +00:00
|
|
|
//fx_device device;
|
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
char g_numPlayerSprites,g_loadFromGroupOnly=0,g_earthquakeTime;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-06-24 08:20:10 +00:00
|
|
|
int32_t playerswhenstarted;
|
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t fricxv,fricyv;
|
2007-08-27 00:20:15 +00:00
|
|
|
playerdata_t g_player[MAXPLAYERS];
|
2008-08-06 11:50:34 +00:00
|
|
|
input_t inputfifo[MOVEFIFOSIZ][MAXPLAYERS];
|
2008-11-20 14:06:36 +00:00
|
|
|
PlayerSpawn_t g_playerSpawnPoints[MAXPLAYERS];
|
2007-08-27 00:20:15 +00:00
|
|
|
user_defs ud;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
char pus, pub;
|
2008-11-17 00:38:26 +00:00
|
|
|
char syncstat[MAXSYNCBYTES];
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t syncvaltail, syncvaltottail;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-08-06 11:50:34 +00:00
|
|
|
input_t loc;
|
|
|
|
input_t recsync[RECSYNCBUFSIZ];
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t avgfvel, avgsvel, avgavel, avghorz, avgbits, avgextbits;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t movefifosendplc;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
//Multiplayer syncing variables
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t screenpeek;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
//Game recording variables
|
|
|
|
|
2007-08-27 00:20:15 +00:00
|
|
|
char ready2send;
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t vel, svel, angvel, horiz, ototalclock, g_actorRespawnTime=768, g_itemRespawnTime=768, g_groupFileHandle;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
intptr_t *g_scriptPtr,*insptr,*labelcode,*labeltype;
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t g_numLabels,g_numDefaultLabels;
|
2008-11-20 14:06:36 +00:00
|
|
|
intptr_t *actorscrptr[MAXTILES],*g_parsingActorPtr;
|
2006-12-20 03:27:25 +00:00
|
|
|
char *label;
|
2008-11-20 14:06:36 +00:00
|
|
|
char ActorType[MAXTILES];
|
2008-02-17 05:08:18 +00:00
|
|
|
intptr_t *script = NULL;
|
2007-08-29 04:01:21 +00:00
|
|
|
|
2009-05-22 23:49:25 +00:00
|
|
|
int32_t g_scriptSize = 1048576;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-04-10 08:24:06 +00:00
|
|
|
char typebuflen,typebuf[141];
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
char g_musicIndex;
|
|
|
|
char EnvMusicFilename[MAXVOLUMES+1][BMAX_PATH];
|
|
|
|
char g_RTSPlaying;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
int16_t BlimpSpawnSprites[15] =
|
2007-08-25 01:05:00 +00:00
|
|
|
{
|
|
|
|
RPGSPRITE__STATIC,
|
|
|
|
CHAINGUNSPRITE__STATIC,
|
|
|
|
DEVISTATORAMMO__STATIC,
|
|
|
|
RPGAMMO__STATIC,
|
|
|
|
RPGAMMO__STATIC,
|
|
|
|
JETPACK__STATIC,
|
|
|
|
SHIELD__STATIC,
|
|
|
|
FIRSTAID__STATIC,
|
|
|
|
STEROIDS__STATIC,
|
|
|
|
RPGAMMO__STATIC,
|
|
|
|
RPGAMMO__STATIC,
|
|
|
|
RPGSPRITE__STATIC,
|
|
|
|
RPGAMMO__STATIC,
|
|
|
|
FREEZESPRITE__STATIC,
|
|
|
|
FREEZEAMMO__STATIC
|
|
|
|
};
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t g_impactDamage;
|
|
|
|
int32_t g_scriptDebug;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
//GLOBAL.C - replace the end "my's" with this
|
2009-01-13 12:23:18 +00:00
|
|
|
vec3_t my, omy, myvel;
|
2009-01-09 09:29:17 +00:00
|
|
|
int16_t myhoriz, omyhoriz, myhorizoff, omyhorizoff;
|
|
|
|
int16_t myang, omyang, mycursectnum, myjumpingcounter;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
char myjumpingtoggle, myonground, myhardlanding, myreturntocenter;
|
2009-01-09 09:29:17 +00:00
|
|
|
int8_t multiwho, multipos, multiwhat, multiflag;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t predictfifoplc,movefifoplc;
|
|
|
|
int32_t myxbak[MOVEFIFOSIZ], myybak[MOVEFIFOSIZ], myzbak[MOVEFIFOSIZ];
|
|
|
|
int32_t myhorizbak[MOVEFIFOSIZ],g_playerFriction = 0xcc00, g_showShareware;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
int16_t myangbak[MOVEFIFOSIZ];
|
2008-11-20 14:06:36 +00:00
|
|
|
char szPlayerName[32];
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t g_damageCameras,g_freezerSelfDamage=0,g_tripbombLaserMode=0;
|
2009-12-05 09:22:43 +00:00
|
|
|
int32_t g_gameQuit = 0,everyothertime;
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t g_numFreezeBounces=3,g_rpgBlastRadius,g_pipebombBlastRadius,g_tripbombBlastRadius,
|
2009-01-13 04:40:56 +00:00
|
|
|
g_shrinkerBlastRadius,g_morterBlastRadius,g_bouncemineBlastRadius,g_seenineBlastRadius;
|
2009-07-12 01:55:34 +00:00
|
|
|
DukeStatus_t sbar;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t mymaxlag, otherminlag, bufferjitter = 1;
|
|
|
|
int16_t g_numClouds,clouds[128],cloudx[128],cloudy[128];
|
|
|
|
int32_t cloudtotalclock = 0,totalmemory = 0;
|
|
|
|
int32_t g_numInterpolations = 0, startofdynamicinterpolations = 0;
|
2009-10-15 16:02:55 +00:00
|
|
|
int32_t g_interpolationLock = 0;
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t oldipos[MAXINTERPOLATIONS];
|
|
|
|
int32_t bakipos[MAXINTERPOLATIONS];
|
|
|
|
int32_t *curipos[MAXINTERPOLATIONS];
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t nextvoxid = 0;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t SpriteFlags[MAXTILES];
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-07-12 01:55:34 +00:00
|
|
|
projectile_t ProjectileData[MAXTILES], DefaultProjectileData[MAXTILES], SpriteProjectile[MAXSPRITES];
|
2006-04-22 22:33:52 +00:00
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
char CheatKeys[2] = { sc_D, sc_N };
|
2008-12-10 11:36:53 +00:00
|
|
|
char setupfilename[BMAX_PATH]= SETUPFILENAME;
|
2006-12-09 23:41:43 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t g_doQuickSave = 0;
|
|
|
|
uint32_t g_moveThingsCount = 0;
|
2008-06-30 07:30:48 +00:00
|
|
|
|