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.
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
2008-12-19 00:53:54 +00:00
|
|
|
#ifndef _duke3d_h_
|
|
|
|
# define _duke3d_h_
|
2006-10-19 00:45:36 +00:00
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// JBF
|
|
|
|
#include "compat.h"
|
|
|
|
#include "a.h"
|
|
|
|
#include "build.h"
|
2008-05-10 01:29:37 +00:00
|
|
|
#ifdef POLYMER
|
2006-10-15 18:51:41 +00:00
|
|
|
# include "polymer.h"
|
|
|
|
#endif
|
2006-04-13 20:47:06 +00:00
|
|
|
#include "cache1d.h"
|
|
|
|
#include "pragmas.h"
|
2008-11-11 13:24:05 +00:00
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
#include "baselayer.h"
|
|
|
|
|
|
|
|
#include "function.h"
|
|
|
|
|
2008-11-24 09:22:07 +00:00
|
|
|
#include "macros.h"
|
2008-11-20 14:06:36 +00:00
|
|
|
|
2009-12-05 09:22:43 +00:00
|
|
|
#include "enet/enet.h"
|
|
|
|
|
2010-01-16 23:08:17 +00:00
|
|
|
extern ENetHost * g_netServer;
|
|
|
|
extern ENetHost * g_netClient;
|
|
|
|
extern ENetPeer * g_netClientPeer;
|
2009-12-05 09:22:43 +00:00
|
|
|
|
2010-01-21 10:02:04 +00:00
|
|
|
enum netchan_t
|
|
|
|
{
|
|
|
|
CHAN_MOVE, // unreliable movement packets
|
|
|
|
CHAN_GAMESTATE, // gamestate changes... frags, respawns, player names, etc
|
|
|
|
CHAN_SYNC, // client join sync packets
|
|
|
|
CHAN_CHAT, // chat and RTS
|
|
|
|
CHAN_MISC, // whatever else
|
|
|
|
CHAN_MAX
|
|
|
|
};
|
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
#define APPNAME "EDuke32"
|
2009-09-28 00:01:06 +00:00
|
|
|
#define VERSION " 2.0.0devel"
|
2009-04-26 05:57:42 +00:00
|
|
|
// this is checked against http://eduke32.com/VERSION
|
|
|
|
extern const char *s_buildDate;
|
2009-01-09 09:29:17 +00:00
|
|
|
#define HEAD2 APPNAME VERSION
|
|
|
|
|
2008-10-25 02:32:57 +00:00
|
|
|
#define HORIZ_MIN -99
|
|
|
|
#define HORIZ_MAX 299
|
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t g_scriptVersion, g_Shareware, g_gameType;
|
2006-07-22 05:20:25 +00:00
|
|
|
|
|
|
|
#define GAMEDUKE 0
|
|
|
|
#define GAMENAM 1
|
2006-11-16 23:06:16 +00:00
|
|
|
#define GAMEWW2 3
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2007-08-26 10:35:52 +00:00
|
|
|
#define VOLUMEALL (g_Shareware==0)
|
2008-11-20 14:06:36 +00:00
|
|
|
#define PLUTOPAK (g_scriptVersion==14)
|
2007-08-26 10:35:52 +00:00
|
|
|
#define VOLUMEONE (g_Shareware==1)
|
2008-11-20 14:06:36 +00:00
|
|
|
#define NAM (g_gameType&1)
|
|
|
|
#define WW2GI (g_gameType&2)
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
#define MAXSLEEPDIST 16384
|
|
|
|
#define SLEEPTIME 24*64
|
|
|
|
|
|
|
|
#define BYTEVERSION_13 27
|
|
|
|
#define BYTEVERSION_14 116
|
|
|
|
#define BYTEVERSION_15 117
|
2009-01-18 07:32:35 +00:00
|
|
|
|
2009-04-14 22:55:32 +00:00
|
|
|
#define BYTEVERSION_JF 195 // increase by 3, because atomic GRP adds 1, and Shareware adds 2
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
#define BYTEVERSION (BYTEVERSION_JF+(PLUTOPAK?1:(VOLUMEONE<<1))) // JBF 20040116: different data files give different versions
|
|
|
|
|
|
|
|
#define NUMPAGES 1
|
|
|
|
|
|
|
|
#define AUTO_AIM_ANGLE 48
|
|
|
|
#define RECSYNCBUFSIZ 2520 //2520 is the (LCM of 1-8)*3
|
2009-12-05 09:22:43 +00:00
|
|
|
#define MOVEFIFOSIZ 2
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
#define FOURSLEIGHT (1<<8)
|
|
|
|
|
2006-04-15 03:12:08 +00:00
|
|
|
#define MAXVOLUMES 7
|
2006-12-04 22:05:30 +00:00
|
|
|
#define MAXLEVELS 32
|
2006-04-15 03:12:08 +00:00
|
|
|
|
2009-04-26 05:57:42 +00:00
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
#include "file_lib.h"
|
|
|
|
#include "gamedefs.h"
|
|
|
|
#include "keyboard.h"
|
|
|
|
#include "util_lib.h"
|
|
|
|
#include "mathutil.h"
|
|
|
|
#include "function.h"
|
|
|
|
#include "fx_man.h"
|
|
|
|
#include "config.h"
|
|
|
|
#include "sounds.h"
|
|
|
|
#include "control.h"
|
|
|
|
#include "_rts.h"
|
|
|
|
#include "rts.h"
|
|
|
|
#include "soundefs.h"
|
|
|
|
|
|
|
|
#include "music.h"
|
|
|
|
|
|
|
|
#include "namesdyn.h"
|
|
|
|
|
2008-12-23 23:27:53 +00:00
|
|
|
#define TICRATE (120)
|
2009-04-26 05:57:42 +00:00
|
|
|
#define GAMETICSPERSEC 26
|
2010-05-02 23:27:30 +00:00
|
|
|
#define TICSPERFRAME 4 // this used to be TICRATE/GAMETICSPERSEC which was 4.615~ truncated to 4 by integer division
|
|
|
|
#define REALGAMETICSPERSEC 30
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-08-06 11:50:34 +00:00
|
|
|
#define MAXSOUNDS 2560
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
#define STAT_DEFAULT 0
|
|
|
|
#define STAT_ACTOR 1
|
|
|
|
#define STAT_ZOMBIEACTOR 2
|
|
|
|
#define STAT_EFFECTOR 3
|
|
|
|
#define STAT_PROJECTILE 4
|
|
|
|
#define STAT_MISC 5
|
|
|
|
#define STAT_STANDABLE 6
|
|
|
|
#define STAT_LOCATOR 7
|
|
|
|
#define STAT_ACTIVATOR 8
|
|
|
|
#define STAT_TRANSPORT 9
|
|
|
|
#define STAT_PLAYER 10
|
|
|
|
#define STAT_FX 11
|
|
|
|
#define STAT_FALLER 12
|
|
|
|
#define STAT_DUMMYPLAYER 13
|
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
#define ALT_IS_PRESSED ( KB_KeyPressed( sc_RightAlt ) || KB_KeyPressed( sc_LeftAlt ) )
|
|
|
|
#define SHIFTS_IS_PRESSED ( KB_KeyPressed( sc_RightShift ) || KB_KeyPressed( sc_LeftShift ) )
|
2008-11-20 14:06:36 +00:00
|
|
|
#define RANDOMSCRAP A_InsertSprite(s->sectnum,s->x+(krand()&255)-128,s->y+(krand()&255)-128,s->z-(8<<8)-(krand()&8191),SCRAP6+(krand()&15),-8,48,48,krand()&2047,(krand()&63)+64,-512-(krand()&2047),i,5)
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
#define PHEIGHT (38<<8)
|
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
enum GameMode_t {
|
2010-05-02 23:27:30 +00:00
|
|
|
MODE_MENU = 0x00000001,
|
|
|
|
MODE_DEMO = 0x00000002,
|
|
|
|
MODE_GAME = 0x00000004,
|
|
|
|
MODE_EOL = 0x00000008,
|
|
|
|
MODE_TYPE = 0x00000010,
|
|
|
|
MODE_RESTART = 0x00000020,
|
|
|
|
MODE_SENDTOWHOM = 0x00000040,
|
2006-04-13 20:47:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#define MAXANIMWALLS 512
|
2006-06-10 23:47:27 +00:00
|
|
|
#define MAXINTERPOLATIONS MAXSPRITES
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2006-04-24 18:52:29 +00:00
|
|
|
#define MAXQUOTES 16384
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
#define FIRST_OBITUARY_QUOTE MAXQUOTES-128
|
|
|
|
#define FIRST_SUICIDE_QUOTE MAXQUOTES-32
|
2006-08-20 22:17:12 +00:00
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
#define MAXCYCLERS 1024
|
|
|
|
|
|
|
|
#define MAXANIMATES 256
|
|
|
|
|
|
|
|
// Defines the motion characteristics of an actor
|
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
enum ActorMoveFlags_t {
|
2006-04-13 20:47:06 +00:00
|
|
|
face_player = 1,
|
|
|
|
geth = 2,
|
|
|
|
getv = 4,
|
|
|
|
random_angle = 8,
|
|
|
|
face_player_slow = 16,
|
|
|
|
spin = 32,
|
|
|
|
face_player_smart = 64,
|
|
|
|
fleeenemy = 128,
|
|
|
|
jumptoplayer = 257,
|
|
|
|
seekplayer = 512,
|
|
|
|
furthestdir = 1024,
|
|
|
|
dodgebullet = 4096
|
|
|
|
};
|
|
|
|
|
|
|
|
// Some misc #defines
|
|
|
|
#define NO 0
|
|
|
|
#define YES 1
|
|
|
|
|
|
|
|
// Defines for 'useractor' keyword
|
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
enum UserActorTypes_t {
|
2006-04-13 20:47:06 +00:00
|
|
|
notenemy,
|
|
|
|
enemy,
|
|
|
|
enemystayput
|
|
|
|
};
|
|
|
|
|
|
|
|
// Player Actions.
|
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
enum PlayerActionFlags_t {
|
2006-04-13 20:47:06 +00:00
|
|
|
pstanding = 1,
|
|
|
|
pwalking = 2,
|
|
|
|
prunning = 4,
|
|
|
|
pducking = 8,
|
|
|
|
pfalling = 16,
|
|
|
|
pjumping = 32,
|
|
|
|
phigher = 64,
|
|
|
|
pwalkingback = 128,
|
|
|
|
prunningback = 256,
|
|
|
|
pkicking = 512,
|
|
|
|
pshrunk = 1024,
|
|
|
|
pjetpack = 2048,
|
|
|
|
ponsteroids = 4096,
|
|
|
|
ponground = 8192,
|
|
|
|
palive = 16384,
|
|
|
|
pdead = 32768,
|
|
|
|
pfacing = 65536
|
|
|
|
};
|
|
|
|
|
2009-06-16 22:11:13 +00:00
|
|
|
enum DukeInventory_t {
|
2006-04-13 20:47:06 +00:00
|
|
|
GET_STEROIDS,
|
|
|
|
GET_SHIELD,
|
|
|
|
GET_SCUBA,
|
|
|
|
GET_HOLODUKE,
|
|
|
|
GET_JETPACK,
|
2009-06-16 22:11:13 +00:00
|
|
|
GET_DUMMY1,
|
|
|
|
GET_ACCESS,
|
2006-04-13 20:47:06 +00:00
|
|
|
GET_HEATS,
|
2009-06-16 22:11:13 +00:00
|
|
|
GET_DUMMY2,
|
|
|
|
GET_FIRSTAID,
|
2009-12-15 05:53:15 +00:00
|
|
|
GET_BOOTS,
|
|
|
|
GET_MAX
|
2006-04-13 20:47:06 +00:00
|
|
|
};
|
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
enum DukeWeapon_t {
|
2006-04-13 20:47:06 +00:00
|
|
|
KNEE_WEAPON,
|
|
|
|
PISTOL_WEAPON,
|
|
|
|
SHOTGUN_WEAPON,
|
|
|
|
CHAINGUN_WEAPON,
|
|
|
|
RPG_WEAPON,
|
|
|
|
HANDBOMB_WEAPON,
|
|
|
|
SHRINKER_WEAPON,
|
|
|
|
DEVISTATOR_WEAPON,
|
|
|
|
TRIPBOMB_WEAPON,
|
|
|
|
FREEZE_WEAPON,
|
|
|
|
HANDREMOTE_WEAPON,
|
|
|
|
GROW_WEAPON,
|
|
|
|
MAX_WEAPONS
|
|
|
|
};
|
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
#define deletesprite A_DeleteSprite
|
2009-01-09 09:29:17 +00:00
|
|
|
void A_DeleteSprite(int32_t s);
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-07-09 02:29:48 +00:00
|
|
|
#pragma pack(push,1)
|
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
typedef struct {
|
2009-07-12 01:55:34 +00:00
|
|
|
uint32_t bits; // 4b
|
|
|
|
int16_t fvel, svel; // 4b
|
|
|
|
int8_t avel, horz; // 2b
|
|
|
|
int8_t extbits, filler; // 2b
|
2008-08-06 11:50:34 +00:00
|
|
|
} input_t;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2007-08-27 20:36:36 +00:00
|
|
|
#define sync dsync // JBF 20040604: sync is a function on some platforms
|
2008-08-06 11:50:34 +00:00
|
|
|
extern input_t recsync[RECSYNCBUFSIZ];
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t movefifosendplc;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2007-10-24 06:48:13 +00:00
|
|
|
typedef struct {
|
2009-07-15 01:26:38 +00:00
|
|
|
int16_t voice;
|
|
|
|
int16_t i;
|
2007-10-24 06:48:13 +00:00
|
|
|
} SOUNDOWNER;
|
|
|
|
|
2010-01-05 21:53:14 +00:00
|
|
|
#define MAXSOUNDINSTANCES 8
|
2009-07-15 01:26:38 +00:00
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
typedef struct {
|
2009-07-12 01:55:34 +00:00
|
|
|
int32_t length, num, soundsiz; // 12b
|
|
|
|
char *filename, *ptr, *filename1; // 12b/24b
|
2010-01-05 21:53:14 +00:00
|
|
|
SOUNDOWNER SoundOwner[MAXSOUNDINSTANCES]; // 32b
|
2009-07-12 01:55:34 +00:00
|
|
|
int16_t ps,pe,vo; // 6b
|
|
|
|
char pr,m; // 2b
|
2007-09-11 05:26:38 +00:00
|
|
|
} sound_t;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-07-12 01:55:34 +00:00
|
|
|
extern volatile char g_soundlocks[MAXSOUNDS];
|
2007-10-24 06:48:13 +00:00
|
|
|
extern sound_t g_sounds[MAXSOUNDS];
|
|
|
|
|
2007-08-27 00:20:15 +00:00
|
|
|
typedef struct {
|
2010-05-02 23:27:30 +00:00
|
|
|
int16_t wallnum, tag;
|
2007-08-27 00:20:15 +00:00
|
|
|
} animwalltype;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2007-08-27 00:20:15 +00:00
|
|
|
extern animwalltype animwall[MAXANIMWALLS];
|
2006-05-04 04:18:55 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int16_t g_numAnimWalls;
|
|
|
|
extern int32_t probey;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern char typebuflen;
|
|
|
|
extern char typebuf[141];
|
|
|
|
extern int32_t g_musicSize;
|
|
|
|
extern int32_t msx[2048],msy[2048];
|
|
|
|
extern int16_t cyclers[MAXCYCLERS][6],g_numCyclers;
|
2008-11-20 14:06:36 +00:00
|
|
|
extern char szPlayerName[32];
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
struct savehead {
|
|
|
|
char name[19];
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t numplr,volnum,levnum,plrskl;
|
2006-04-13 20:47:06 +00:00
|
|
|
char boardfn[BMAX_PATH];
|
|
|
|
};
|
2007-08-27 00:20:15 +00:00
|
|
|
|
|
|
|
typedef struct {
|
2009-07-24 02:31:34 +00:00
|
|
|
vec3_t camera;
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t const_visibility,uw_framerate;
|
|
|
|
int32_t camera_time,folfvel,folavel,folx,foly,fola;
|
|
|
|
int32_t reccnt,crosshairscale;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t runkey_mode,statusbarscale,mouseaiming,weaponswitch,drawweapon; // JBF 20031125
|
|
|
|
int32_t democams,color,msgdisptime,statusbarmode;
|
|
|
|
int32_t m_noexits,noexits,autovote,automsg,idplayers;
|
|
|
|
int32_t team, viewbob, weaponsway, althud, weaponscale, textscale;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t entered_name,screen_tilting,shadows,fta_on,executions,auto_run;
|
|
|
|
int32_t coords,tickrate,levelstats,m_coop,coop,screen_size,lockout,crosshair;
|
|
|
|
int32_t playerai,angleinterpolation,obituaries;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t respawn_monsters,respawn_items,respawn_inventory,recstat,monsters_off,brightness;
|
|
|
|
int32_t m_respawn_items,m_respawn_monsters,m_respawn_inventory,m_recstat,m_monsters_off,detail;
|
|
|
|
int32_t m_ffire,ffire,m_player_skill,m_level_number,m_volume_number,multimode;
|
|
|
|
int32_t player_skill,level_number,volume_number,m_marker,marker,mouseflip;
|
2008-02-14 08:35:30 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t configversion;
|
2008-02-14 08:35:30 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
int16_t cameraang, camerasect, camerahoriz;
|
|
|
|
int16_t pause_on,from_bonus;
|
|
|
|
int16_t camerasprite,last_camsprite;
|
|
|
|
int16_t last_level,secretlevel;
|
2008-02-14 08:35:30 +00:00
|
|
|
|
2009-07-12 01:55:34 +00:00
|
|
|
struct {
|
|
|
|
int32_t UseJoystick;
|
|
|
|
int32_t UseMouse;
|
|
|
|
int32_t RunMode;
|
|
|
|
int32_t AutoAim;
|
|
|
|
int32_t ShowOpponentWeapons;
|
|
|
|
int32_t MouseDeadZone,MouseBias;
|
|
|
|
int32_t SmoothInput;
|
|
|
|
|
|
|
|
// JBF 20031211: Store the input settings because
|
|
|
|
// (currently) jmact can't regurgitate them
|
|
|
|
int32_t MouseFunctions[MAXMOUSEBUTTONS][2];
|
|
|
|
int32_t MouseDigitalFunctions[MAXMOUSEAXES][2];
|
|
|
|
int32_t MouseAnalogueAxes[MAXMOUSEAXES];
|
|
|
|
int32_t MouseAnalogueScale[MAXMOUSEAXES];
|
|
|
|
int32_t JoystickFunctions[MAXJOYBUTTONS][2];
|
|
|
|
int32_t JoystickDigitalFunctions[MAXJOYAXES][2];
|
|
|
|
int32_t JoystickAnalogueAxes[MAXJOYAXES];
|
|
|
|
int32_t JoystickAnalogueScale[MAXJOYAXES];
|
|
|
|
int32_t JoystickAnalogueDead[MAXJOYAXES];
|
|
|
|
int32_t JoystickAnalogueSaturate[MAXJOYAXES];
|
|
|
|
uint8_t KeyboardKeys[NUMGAMEFUNCTIONS][2];
|
|
|
|
|
|
|
|
//
|
|
|
|
// Sound variables
|
|
|
|
//
|
|
|
|
int32_t FXDevice;
|
|
|
|
int32_t MusicDevice;
|
|
|
|
int32_t FXVolume;
|
|
|
|
int32_t MusicVolume;
|
|
|
|
int32_t SoundToggle;
|
|
|
|
int32_t MusicToggle;
|
|
|
|
int32_t VoiceToggle;
|
|
|
|
int32_t AmbienceToggle;
|
|
|
|
|
|
|
|
int32_t NumVoices;
|
|
|
|
int32_t NumChannels;
|
|
|
|
int32_t NumBits;
|
|
|
|
int32_t MixRate;
|
|
|
|
|
|
|
|
int32_t ReverseStereo;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Screen variables
|
|
|
|
//
|
|
|
|
|
|
|
|
int32_t ScreenMode;
|
|
|
|
|
|
|
|
int32_t ScreenWidth;
|
|
|
|
int32_t ScreenHeight;
|
|
|
|
int32_t ScreenBPP;
|
|
|
|
|
|
|
|
int32_t ForceSetup;
|
|
|
|
int32_t NoAutoLoad;
|
|
|
|
|
|
|
|
int32_t scripthandle;
|
|
|
|
int32_t setupread;
|
|
|
|
|
|
|
|
int32_t CheckForUpdates;
|
|
|
|
int32_t LastUpdateCheck;
|
|
|
|
int32_t useprecache;
|
|
|
|
} config;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-07-24 02:31:34 +00:00
|
|
|
char overhead_on,last_overhead,showweapons;
|
|
|
|
char god,warp_on,cashman,eog,showallmap;
|
|
|
|
char show_help,scrollmode,clipping;
|
|
|
|
char ridecule[10][40];
|
|
|
|
char savegame[10][22];
|
|
|
|
char pwlockout[128],rtsname[128];
|
|
|
|
char display_bonus_screen;
|
|
|
|
char show_level_text;
|
|
|
|
} user_defs;
|
2009-07-12 01:55:34 +00:00
|
|
|
|
2007-08-27 00:20:15 +00:00
|
|
|
typedef struct {
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t ox,oy,oz;
|
|
|
|
int16_t oa,os;
|
2008-11-20 14:06:36 +00:00
|
|
|
} PlayerSpawn_t;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
extern char g_numPlayerSprites;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t fricxv,fricyv;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
// TODO: make a dummy player struct for interpolation and sort the first members
|
|
|
|
// of this struct into the same order so we can just memcpy it and get rid of the
|
|
|
|
// mywhatever type globals
|
|
|
|
|
2008-12-01 10:44:18 +00:00
|
|
|
typedef struct {
|
2010-05-02 23:27:30 +00:00
|
|
|
vec3_t pos, opos, posvel;
|
|
|
|
int32_t bobposx, bobposy;
|
|
|
|
int32_t truefz, truecz, player_par;
|
|
|
|
int32_t randomflamex, exitx, exity;
|
|
|
|
int32_t runspeed, max_player_health, max_shield_amount;
|
2008-12-01 10:44:18 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
uint32_t interface_toggle_flag;
|
2008-12-01 10:44:18 +00:00
|
|
|
|
2009-01-10 07:38:50 +00:00
|
|
|
uint8_t *palette;
|
2008-12-01 10:44:18 +00:00
|
|
|
|
2010-05-02 23:27:30 +00:00
|
|
|
uint16_t max_actors_killed, actors_killed;
|
|
|
|
uint16_t gotweapon, zoom;
|
|
|
|
|
|
|
|
int16_t loogiex[64], loogiey[64], sbs, sound_pitch;
|
2008-12-01 10:44:18 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
int16_t ang, oang, angvel, cursectnum, look_ang, last_extra, subweapon;
|
2010-05-02 23:27:30 +00:00
|
|
|
int16_t max_ammo_amount[MAX_WEAPONS], ammo_amount[MAX_WEAPONS], inv_amount[GET_MAX];
|
|
|
|
int16_t wackedbyactor, pyoff, opyoff;
|
2008-12-01 10:44:18 +00:00
|
|
|
|
2010-05-02 23:27:30 +00:00
|
|
|
int16_t horiz, horizoff, ohoriz, ohorizoff;
|
|
|
|
int16_t newowner, jumping_counter, airleft;
|
2009-01-09 09:29:17 +00:00
|
|
|
int16_t fta, ftq, access_wallnum, access_spritenum;
|
2010-05-02 23:27:30 +00:00
|
|
|
int16_t got_access, weapon_ang, visibility;
|
2009-01-09 09:29:17 +00:00
|
|
|
int16_t somethingonplayer, on_crane, i, one_parallax_sectnum;
|
2010-05-02 23:27:30 +00:00
|
|
|
int16_t random_club_frame, one_eighty_count;
|
|
|
|
int16_t dummyplayersprite, extra_extra8;
|
|
|
|
int16_t actorsqu, timebeforeexit, customexitsound, last_pissed_time;
|
|
|
|
|
|
|
|
int16_t weaprecs[MAX_WEAPONS], weapon_sway, crack_time, bobcounter;
|
|
|
|
|
|
|
|
int16_t orotscrnang, rotscrnang, dead_flag; // JBF 20031220: added orotscrnang
|
|
|
|
int16_t holoduke_on, pycount;
|
2008-12-01 10:44:18 +00:00
|
|
|
|
2010-05-02 23:27:30 +00:00
|
|
|
uint8_t max_secret_rooms, secret_rooms;
|
|
|
|
uint8_t frag, fraggedself, quick_kick, last_quick_kick;
|
|
|
|
uint8_t return_to_center, reloading, weapreccnt;
|
|
|
|
uint8_t aim_mode, auto_aim, weaponswitch, movement_lock, team;
|
|
|
|
uint8_t tipincs, hbomb_hold_delay, frag_ps, kickback_pic;
|
2008-12-01 10:44:18 +00:00
|
|
|
|
2010-05-02 23:27:30 +00:00
|
|
|
uint8_t gm, on_warping_sector, footprintcount, hurt_delay;
|
|
|
|
uint8_t hbomb_on, jumping_toggle, rapid_fire_hold, on_ground;
|
|
|
|
uint8_t inven_icon, buttonpalette, over_shoulder_on, show_empty_weapon;
|
2008-12-01 10:44:18 +00:00
|
|
|
|
2010-05-02 23:27:30 +00:00
|
|
|
uint8_t jetpack_on, spritebridge, lastrandomspot;
|
|
|
|
uint8_t scuba_on, footprintpal, heat_on, invdisptime;
|
2008-12-01 10:44:18 +00:00
|
|
|
|
2010-05-02 23:27:30 +00:00
|
|
|
uint8_t holster_weapon, falling_counter, footprintshade;
|
|
|
|
uint8_t refresh_inventory, last_full_weapon;
|
2008-12-01 10:44:18 +00:00
|
|
|
|
2010-05-02 23:27:30 +00:00
|
|
|
uint8_t toggle_key_flag, knuckle_incs, knee_incs, access_incs;
|
|
|
|
uint8_t walking_snd_toggle, palookup, hard_landing, fist_incs;
|
2008-12-01 10:44:18 +00:00
|
|
|
|
2010-05-02 23:27:30 +00:00
|
|
|
int8_t numloogs, loogcnt, scream_voice, transporter_hold;
|
|
|
|
int8_t last_weapon, cheat_phase, weapon_pos, wantweaponfire, curr_weapon;
|
2008-12-01 10:44:18 +00:00
|
|
|
|
2010-05-02 23:27:30 +00:00
|
|
|
palette_t pals;
|
2008-12-01 10:44:18 +00:00
|
|
|
|
2010-05-02 23:27:30 +00:00
|
|
|
char name[32];
|
2008-11-20 14:06:36 +00:00
|
|
|
} DukePlayer_t;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-12-05 09:22:43 +00:00
|
|
|
extern char tempbuf[2048], packbuf[4096], menutextbuf[128];
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t g_spriteGravity;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t g_impactDamage,g_actorRespawnTime,g_itemRespawnTime;
|
|
|
|
extern int32_t g_startArmorAmount;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
#define MOVFIFOSIZ 256
|
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int16_t SpriteDeletionQueue[1024],g_spriteDeleteQueuePos,g_spriteDeleteQueueSize;
|
2007-08-27 00:20:15 +00:00
|
|
|
extern user_defs ud;
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int16_t g_globalRandom;
|
2006-04-13 20:47:06 +00:00
|
|
|
extern char buf[1024]; //My own generic input buffer
|
|
|
|
|
2006-05-05 07:10:36 +00:00
|
|
|
#define MAXQUOTELEN 128
|
2006-04-23 02:30:33 +00:00
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
extern char *ScriptQuotes[MAXQUOTES],*ScriptQuoteRedefinitions[MAXQUOTES];
|
2007-08-27 00:20:15 +00:00
|
|
|
extern char ready2send;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2010-05-02 23:27:30 +00:00
|
|
|
void VM_ScriptInfo(void);
|
2008-11-20 14:06:36 +00:00
|
|
|
extern intptr_t *script,*insptr,*labelcode,*labeltype;
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t g_numLabels,g_numDefaultLabels;
|
|
|
|
extern int32_t g_scriptSize;
|
2006-12-20 03:27:25 +00:00
|
|
|
extern char *label;
|
2008-11-20 14:06:36 +00:00
|
|
|
extern intptr_t *actorscrptr[MAXTILES],*g_parsingActorPtr;
|
2008-02-17 05:08:18 +00:00
|
|
|
extern intptr_t *actorLoadEventScrptr[MAXTILES];
|
2008-11-20 14:06:36 +00:00
|
|
|
extern char ActorType[MAXTILES];
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
extern char g_musicIndex;
|
|
|
|
extern char EnvMusicFilename[MAXVOLUMES+1][BMAX_PATH];
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int16_t camsprite;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2007-09-11 05:26:38 +00:00
|
|
|
typedef struct {
|
2010-05-02 23:27:30 +00:00
|
|
|
int32_t workslike, cstat; // 8b
|
2009-07-12 01:55:34 +00:00
|
|
|
int32_t hitradius, range, flashcolor; // 12b
|
|
|
|
int16_t spawns, sound, isound, vel; // 8b
|
|
|
|
int16_t decal, trail, tnum, drop; // 8b
|
2010-05-02 23:27:30 +00:00
|
|
|
int16_t offset, bounces, bsound; // 6b
|
2009-07-12 01:55:34 +00:00
|
|
|
int16_t toffset; // 2b
|
2010-05-02 23:27:30 +00:00
|
|
|
int16_t extra, extra_rand; // 4b
|
2009-07-12 01:55:34 +00:00
|
|
|
int8_t sxrepeat, syrepeat, txrepeat, tyrepeat; // 4b
|
|
|
|
int8_t shade, xrepeat, yrepeat, pal; // 4b
|
2010-05-02 23:27:30 +00:00
|
|
|
int8_t velmult; // 1b
|
|
|
|
uint8_t clipdist; // 1b
|
|
|
|
int8_t filler[6]; // 6b
|
2008-07-12 23:44:07 +00:00
|
|
|
} projectile_t;
|
2007-09-11 05:26:38 +00:00
|
|
|
|
2007-08-27 00:20:15 +00:00
|
|
|
typedef struct {
|
2010-05-02 23:27:30 +00:00
|
|
|
intptr_t t_data[10]; // 40b/80b sometimes used to hold pointers to con code
|
2009-07-12 01:55:34 +00:00
|
|
|
|
|
|
|
int16_t picnum,ang,extra,owner; //8b
|
2009-12-30 23:07:00 +00:00
|
|
|
int16_t movflag,tempang,timetosleep; //6b
|
|
|
|
|
|
|
|
int32_t flags, bposx,bposy,bposz; //16b
|
|
|
|
int32_t floorz,ceilingz,lastvx,lastvy; //16b
|
|
|
|
int32_t lasttransport; //4b
|
|
|
|
|
2009-07-12 01:55:34 +00:00
|
|
|
int16_t lightId, lightcount, lightmaxrange, cgg; //8b
|
2009-12-30 23:07:00 +00:00
|
|
|
int16_t actorstayput, dispicnum, shootzvel; // 6b
|
2009-07-12 01:55:34 +00:00
|
|
|
|
2009-06-07 06:23:33 +00:00
|
|
|
#ifdef POLYMER
|
2009-07-12 01:55:34 +00:00
|
|
|
_prlight *lightptr; //4b/8b
|
2009-06-07 06:23:33 +00:00
|
|
|
#else
|
|
|
|
void *lightptr;
|
2009-06-05 20:09:13 +00:00
|
|
|
#endif
|
2009-07-12 01:55:34 +00:00
|
|
|
|
|
|
|
projectile_t *projectile; //4b/8b
|
2009-12-05 09:22:43 +00:00
|
|
|
|
|
|
|
int8_t filler[16]; // pad struct to 128 bytes
|
2008-12-21 22:46:55 +00:00
|
|
|
} ActorData_t;
|
2007-03-08 21:07:10 +00:00
|
|
|
|
2009-12-30 23:07:00 +00:00
|
|
|
// this struct needs to match the beginning of ActorData_t above
|
|
|
|
typedef struct {
|
2010-05-02 23:27:30 +00:00
|
|
|
intptr_t t_data[10]; // 40b/80b sometimes used to hold pointers to con code
|
2009-12-30 23:07:00 +00:00
|
|
|
|
|
|
|
int16_t picnum,ang,extra,owner; //8b
|
|
|
|
int16_t movflag,tempang,timetosleep; // 6b
|
|
|
|
|
|
|
|
int32_t flags; // 4b
|
|
|
|
} NetActorData_t;
|
|
|
|
|
2010-05-02 23:27:30 +00:00
|
|
|
extern ActorData_t actor[MAXSPRITES];
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-08-06 11:50:34 +00:00
|
|
|
extern input_t loc;
|
|
|
|
extern input_t recsync[RECSYNCBUFSIZ];
|
2010-05-02 23:27:30 +00:00
|
|
|
extern input_t avg;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t numplayers, myconnectindex;
|
|
|
|
extern int32_t connecthead, connectpoint2[MAXPLAYERS]; //Player linked list variables (indeces, not connection numbers)
|
|
|
|
extern int32_t screenpeek;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t g_currentMenu;
|
|
|
|
extern int32_t tempwallptr,g_animateCount;
|
|
|
|
extern int32_t lockclock;
|
2008-02-16 22:27:08 +00:00
|
|
|
extern intptr_t frameplace;
|
2008-11-20 14:06:36 +00:00
|
|
|
extern char display_mirror,g_loadFromGroupOnly,g_RTSPlaying;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t g_groupFileHandle;
|
|
|
|
extern int32_t ototalclock;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t *animateptr[MAXANIMATES];
|
|
|
|
extern int32_t animategoal[MAXANIMATES];
|
|
|
|
extern int32_t animatevel[MAXANIMATES];
|
|
|
|
extern int16_t neartagsector, neartagwall, neartagsprite;
|
|
|
|
extern int32_t neartaghitdist;
|
|
|
|
extern int16_t animatesect[MAXANIMATES];
|
|
|
|
extern int32_t movefifoplc, vel,svel,angvel,horiz;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int16_t g_mirrorWall[64], g_mirrorSector[64], g_mirrorCount;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
#include "funct.h"
|
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t g_screenCapture;
|
2008-11-20 14:06:36 +00:00
|
|
|
extern char EpisodeNames[MAXVOLUMES][33];
|
|
|
|
extern char SkillNames[5][33];
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t g_currentFrameRate;
|
2006-06-19 19:28:49 +00:00
|
|
|
|
2006-12-04 22:05:30 +00:00
|
|
|
#define MAXGAMETYPES 16
|
2008-11-20 14:06:36 +00:00
|
|
|
extern char GametypeNames[MAXGAMETYPES][33];
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t GametypeFlags[MAXGAMETYPES];
|
2008-11-20 14:06:36 +00:00
|
|
|
extern char g_numGametypes;
|
|
|
|
|
|
|
|
enum GametypeFlags_t {
|
2009-01-13 04:40:56 +00:00
|
|
|
GAMETYPE_COOP = 0x00000001,
|
|
|
|
GAMETYPE_WEAPSTAY = 0x00000002,
|
|
|
|
GAMETYPE_FRAGBAR = 0x00000004,
|
|
|
|
GAMETYPE_SCORESHEET = 0x00000008,
|
|
|
|
GAMETYPE_DMSWITCHES = 0x00000010,
|
|
|
|
GAMETYPE_COOPSPAWN = 0x00000020,
|
|
|
|
GAMETYPE_ACCESSCARDSPRITES = 0x00000040,
|
|
|
|
GAMETYPE_COOPVIEW = 0x00000080,
|
|
|
|
GAMETYPE_COOPSOUND = 0x00000100,
|
|
|
|
GAMETYPE_OTHERPLAYERSINMAP = 0x00000200,
|
|
|
|
GAMETYPE_ITEMRESPAWN = 0x00000400,
|
|
|
|
GAMETYPE_MARKEROPTION = 0x00000800,
|
|
|
|
GAMETYPE_PLAYERSFRIENDLY = 0x00001000,
|
|
|
|
GAMETYPE_FIXEDRESPAWN = 0x00002000,
|
|
|
|
GAMETYPE_ACCESSATSTART = 0x00004000,
|
|
|
|
GAMETYPE_PRESERVEINVENTORYDEATH = 0x00008000,
|
|
|
|
GAMETYPE_TDM = 0x00010000,
|
|
|
|
GAMETYPE_TDMSPAWN = 0x00020000
|
2006-04-13 20:47:06 +00:00
|
|
|
};
|
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
extern char g_numVolumes;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t g_lastSaveSlot;
|
|
|
|
extern int32_t g_restorePalette;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t cachecount;
|
|
|
|
extern char boardfilename[BMAX_PATH];
|
2010-03-14 11:42:13 +00:00
|
|
|
extern uint8_t waterpal[768],slimepal[768],titlepal[768],drealms[768],endingpal[768],*animpal;
|
2008-09-15 02:47:02 +00:00
|
|
|
extern char currentboardfilename[BMAX_PATH];
|
2008-11-20 14:06:36 +00:00
|
|
|
extern char cachedebug,g_earthquakeTime;
|
2006-04-13 20:47:06 +00:00
|
|
|
extern char lumplockbyte[11];
|
|
|
|
|
|
|
|
//DUKE3D.H - replace the end "my's" with this
|
2009-01-13 12:23:18 +00:00
|
|
|
extern vec3_t my;
|
|
|
|
extern vec3_t my, omy, myvel;
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int16_t myhoriz, omyhoriz, myhorizoff, omyhorizoff, g_skillSoundID;
|
|
|
|
extern int16_t myang, omyang, mycursectnum, myjumpingcounter;
|
2006-04-13 20:47:06 +00:00
|
|
|
extern char myjumpingtoggle, myonground, myhardlanding,myreturntocenter;
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t predictfifoplc;
|
|
|
|
extern int32_t myxbak[MOVEFIFOSIZ], myybak[MOVEFIFOSIZ], myzbak[MOVEFIFOSIZ];
|
|
|
|
extern int32_t myhorizbak[MOVEFIFOSIZ];
|
|
|
|
extern int16_t myangbak[MOVEFIFOSIZ];
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int16_t BlimpSpawnSprites[15];
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
//DUKE3D.H:
|
2009-07-12 01:55:34 +00:00
|
|
|
|
|
|
|
#pragma pack(pop)
|
2006-04-13 20:47:06 +00:00
|
|
|
typedef struct {
|
2009-12-15 05:53:15 +00:00
|
|
|
int16_t got_access, last_extra, inv_amount[GET_MAX], curr_weapon, holoduke_on;
|
2009-01-09 09:29:17 +00:00
|
|
|
int16_t last_weapon, weapon_pos, kickback_pic;
|
|
|
|
int16_t ammo_amount[MAX_WEAPONS], frag[MAXPLAYERS];
|
2010-05-02 23:27:30 +00:00
|
|
|
uint16_t gotweapon;
|
|
|
|
char inven_icon, jetpack_on, heat_on;
|
2009-07-12 01:55:34 +00:00
|
|
|
} DukeStatus_t;
|
|
|
|
#pragma pack(push,1)
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-07-12 01:55:34 +00:00
|
|
|
extern DukeStatus_t sbar;
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t g_cameraDistance, g_cameraClock, g_playerFriction,g_showShareware;
|
|
|
|
extern int32_t g_gameQuit;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-06-24 08:20:10 +00:00
|
|
|
extern int32_t playerswhenstarted;
|
|
|
|
|
2007-03-22 20:58:13 +00:00
|
|
|
extern char pus,pub;
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t g_damageCameras,g_freezerSelfDamage,g_tripbombLaserMode;
|
2008-11-17 00:38:26 +00:00
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
// TENSW: on really bad network connections, the sync FIFO queue can overflow if it is the
|
|
|
|
// same size as the move fifo.
|
|
|
|
#define MAXSYNCBYTES 16
|
|
|
|
#define SYNCFIFOSIZ 1024
|
2008-11-17 00:38:26 +00:00
|
|
|
|
|
|
|
extern char syncstat[MAXSYNCBYTES];
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int8_t multiwho, multipos, multiwhat, multiflag;
|
|
|
|
extern int32_t syncvaltail, syncvaltottail;
|
|
|
|
extern int32_t g_numFreezeBounces,g_rpgBlastRadius,g_pipebombBlastRadius,g_tripbombBlastRadius;
|
|
|
|
extern int32_t g_shrinkerBlastRadius,g_morterBlastRadius,g_bouncemineBlastRadius,g_seenineBlastRadius;
|
|
|
|
extern int32_t everyothertime;
|
|
|
|
extern int32_t mymaxlag, otherminlag, bufferjitter;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t g_numInterpolations, startofdynamicinterpolations;
|
2009-10-15 16:02:55 +00:00
|
|
|
extern int32_t g_interpolationLock;
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t oldipos[MAXINTERPOLATIONS];
|
|
|
|
extern int32_t bakipos[MAXINTERPOLATIONS];
|
|
|
|
extern int32_t *curipos[MAXINTERPOLATIONS];
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int16_t g_numClouds,clouds[128],cloudx[128],cloudy[128];
|
|
|
|
extern int32_t cloudtotalclock,totalmemory;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t stereomode, stereowidth, stereopixelwidth;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t g_myAimMode, g_myAimStat, g_oldAimStat;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern uint32_t g_moveThingsCount;
|
2008-11-17 00:38:26 +00:00
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
#define IFISGLMODE if (getrendermode() >= 3)
|
|
|
|
#define IFISSOFTMODE if (getrendermode() < 3)
|
|
|
|
|
|
|
|
#define TILE_SAVESHOT (MAXTILES-1)
|
|
|
|
#define TILE_LOADSHOT (MAXTILES-3)
|
|
|
|
#define TILE_TILT (MAXTILES-2)
|
|
|
|
#define TILE_ANIM (MAXTILES-4)
|
|
|
|
#define TILE_VIEWSCR (MAXTILES-5)
|
|
|
|
|
2010-05-02 23:27:30 +00:00
|
|
|
// the order of these can't be changed or else compatibility with EDuke 2.0 mods will break
|
2008-11-20 14:06:36 +00:00
|
|
|
enum GameEvent_t {
|
2006-04-13 20:47:06 +00:00
|
|
|
EVENT_INIT,
|
|
|
|
EVENT_ENTERLEVEL,
|
|
|
|
EVENT_RESETWEAPONS,
|
|
|
|
EVENT_RESETINVENTORY,
|
|
|
|
EVENT_HOLSTER,
|
|
|
|
EVENT_LOOKLEFT,
|
|
|
|
EVENT_LOOKRIGHT,
|
|
|
|
EVENT_SOARUP,
|
|
|
|
EVENT_SOARDOWN,
|
|
|
|
EVENT_CROUCH,
|
|
|
|
EVENT_JUMP,
|
|
|
|
EVENT_RETURNTOCENTER,
|
|
|
|
EVENT_LOOKUP,
|
|
|
|
EVENT_LOOKDOWN,
|
|
|
|
EVENT_AIMUP,
|
|
|
|
EVENT_FIRE,
|
|
|
|
EVENT_CHANGEWEAPON,
|
|
|
|
EVENT_GETSHOTRANGE,
|
|
|
|
EVENT_GETAUTOAIMANGLE,
|
|
|
|
EVENT_GETLOADTILE,
|
|
|
|
EVENT_CHEATGETSTEROIDS,
|
|
|
|
EVENT_CHEATGETHEAT,
|
|
|
|
EVENT_CHEATGETBOOT,
|
|
|
|
EVENT_CHEATGETSHIELD,
|
|
|
|
EVENT_CHEATGETSCUBA,
|
|
|
|
EVENT_CHEATGETHOLODUKE,
|
|
|
|
EVENT_CHEATGETJETPACK,
|
|
|
|
EVENT_CHEATGETFIRSTAID,
|
|
|
|
EVENT_QUICKKICK,
|
|
|
|
EVENT_INVENTORY,
|
|
|
|
EVENT_USENIGHTVISION,
|
|
|
|
EVENT_USESTEROIDS,
|
|
|
|
EVENT_INVENTORYLEFT,
|
|
|
|
EVENT_INVENTORYRIGHT,
|
|
|
|
EVENT_HOLODUKEON,
|
|
|
|
EVENT_HOLODUKEOFF,
|
|
|
|
EVENT_USEMEDKIT,
|
|
|
|
EVENT_USEJETPACK,
|
|
|
|
EVENT_TURNAROUND,
|
|
|
|
EVENT_DISPLAYWEAPON,
|
|
|
|
EVENT_FIREWEAPON,
|
|
|
|
EVENT_SELECTWEAPON,
|
|
|
|
EVENT_MOVEFORWARD,
|
|
|
|
EVENT_MOVEBACKWARD,
|
|
|
|
EVENT_TURNLEFT,
|
|
|
|
EVENT_TURNRIGHT,
|
|
|
|
EVENT_STRAFELEFT,
|
|
|
|
EVENT_STRAFERIGHT,
|
|
|
|
EVENT_WEAPKEY1,
|
|
|
|
EVENT_WEAPKEY2,
|
|
|
|
EVENT_WEAPKEY3,
|
|
|
|
EVENT_WEAPKEY4,
|
|
|
|
EVENT_WEAPKEY5,
|
|
|
|
EVENT_WEAPKEY6,
|
|
|
|
EVENT_WEAPKEY7,
|
|
|
|
EVENT_WEAPKEY8,
|
|
|
|
EVENT_WEAPKEY9,
|
|
|
|
EVENT_WEAPKEY10,
|
|
|
|
EVENT_DRAWWEAPON,
|
|
|
|
EVENT_DISPLAYCROSSHAIR,
|
|
|
|
EVENT_DISPLAYREST,
|
2007-02-13 02:22:17 +00:00
|
|
|
EVENT_DISPLAYSBAR,
|
2006-04-13 20:47:06 +00:00
|
|
|
EVENT_RESETPLAYER,
|
|
|
|
EVENT_INCURDAMAGE,
|
|
|
|
EVENT_AIMDOWN,
|
|
|
|
EVENT_GAME,
|
|
|
|
EVENT_PREVIOUSWEAPON,
|
|
|
|
EVENT_NEXTWEAPON,
|
|
|
|
EVENT_SWIMUP,
|
|
|
|
EVENT_SWIMDOWN,
|
|
|
|
EVENT_GETMENUTILE,
|
|
|
|
EVENT_SPAWN,
|
|
|
|
EVENT_LOGO,
|
|
|
|
EVENT_EGS,
|
|
|
|
EVENT_DOFIRE,
|
|
|
|
EVENT_PRESSEDFIRE,
|
|
|
|
EVENT_USE,
|
2006-09-19 23:02:33 +00:00
|
|
|
EVENT_PROCESSINPUT,
|
2007-03-11 00:20:32 +00:00
|
|
|
EVENT_FAKEDOMOVETHINGS,
|
2007-12-20 19:14:38 +00:00
|
|
|
EVENT_DISPLAYROOMS,
|
2008-01-15 20:51:18 +00:00
|
|
|
EVENT_KILLIT,
|
2008-08-25 00:49:12 +00:00
|
|
|
EVENT_LOADACTOR,
|
|
|
|
EVENT_DISPLAYBONUSSCREEN,
|
|
|
|
EVENT_DISPLAYMENU,
|
|
|
|
EVENT_DISPLAYMENUREST,
|
|
|
|
EVENT_DISPLAYLOADINGSCREEN,
|
2008-07-17 23:14:32 +00:00
|
|
|
EVENT_ANIMATESPRITES,
|
2008-09-15 02:47:02 +00:00
|
|
|
EVENT_NEWGAME,
|
2008-08-25 10:27:18 +00:00
|
|
|
MAXEVENTS
|
2006-04-13 20:47:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// store global game definitions
|
|
|
|
|
2008-04-01 02:50:44 +00:00
|
|
|
|
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
enum GamevarFlags_t {
|
2008-12-21 22:46:55 +00:00
|
|
|
MAXGAMEVARS = 2048, // must be a power of two
|
|
|
|
MAXVARLABEL = 26,
|
|
|
|
GAMEVAR_PERPLAYER = 0x00000001, // per-player variable
|
|
|
|
GAMEVAR_PERACTOR = 0x00000002, // per-actor variable
|
|
|
|
GAMEVAR_USER_MASK = (0x00000001|0x00000002),
|
|
|
|
GAMEVAR_RESET = 0x00000008, // marks var for to default
|
|
|
|
GAMEVAR_DEFAULT = 0x00000100, // allow override
|
|
|
|
GAMEVAR_SECRET = 0x00000200, // don't dump...
|
|
|
|
GAMEVAR_NODEFAULT = 0x00000400, // don't reset on actor spawn
|
|
|
|
GAMEVAR_SYSTEM = 0x00000800, // cannot change mode flags...(only default value)
|
|
|
|
GAMEVAR_READONLY = 0x00001000, // values are read-only (no setvar allowed)
|
2009-01-09 09:29:17 +00:00
|
|
|
GAMEVAR_INTPTR = 0x00002000, // plValues is a pointer to an int32_t
|
2008-12-21 22:46:55 +00:00
|
|
|
GAMEVAR_SYNCCHECK = 0x00004000, // throw warnings during compile if used in local event
|
|
|
|
GAMEVAR_SHORTPTR = 0x00008000, // plValues is a pointer to a short
|
|
|
|
GAMEVAR_CHARPTR = 0x00010000, // plValues is a pointer to a char
|
|
|
|
GAMEVAR_NORESET = 0x00020000, // var values are not reset when restoring map state
|
2009-02-02 01:49:14 +00:00
|
|
|
GAMEVAR_SPECIAL = 0x00040000, // flag for structure member shortcut vars
|
2009-12-12 11:07:59 +00:00
|
|
|
GAMEVAR_NOMULTI = 0x00080000, // don't attach to multiplayer packets
|
2008-04-01 09:06:29 +00:00
|
|
|
};
|
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
enum GamearrayFlags_t {
|
2008-12-21 22:46:55 +00:00
|
|
|
MAXGAMEARRAYS = (MAXGAMEVARS>>2), // must be lower than MAXGAMEVARS
|
|
|
|
MAXARRAYLABEL = MAXVARLABEL,
|
2008-11-20 14:06:36 +00:00
|
|
|
GAMEARRAY_NORMAL = 0,
|
2008-12-21 22:46:55 +00:00
|
|
|
GAMEARRAY_NORESET = 0x00000001,
|
2006-04-13 20:47:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct {
|
2008-12-21 22:46:55 +00:00
|
|
|
union {
|
|
|
|
intptr_t lValue;
|
|
|
|
intptr_t *plValues; // array of values when 'per-player', or 'per-actor'
|
|
|
|
} val;
|
2008-02-17 05:08:18 +00:00
|
|
|
intptr_t lDefault;
|
2009-07-12 01:55:34 +00:00
|
|
|
uintptr_t dwFlags;
|
2008-02-14 08:35:30 +00:00
|
|
|
char *szLabel;
|
2007-09-11 05:26:38 +00:00
|
|
|
} gamevar_t;
|
2008-04-01 09:06:29 +00:00
|
|
|
|
2008-04-01 02:50:44 +00:00
|
|
|
typedef struct {
|
|
|
|
char *szLabel;
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t *plValues; // array of values
|
2009-07-12 01:55:34 +00:00
|
|
|
intptr_t size;
|
|
|
|
intptr_t bReset;
|
2008-04-01 02:50:44 +00:00
|
|
|
} gamearray_t;
|
2008-04-01 09:06:29 +00:00
|
|
|
|
2007-09-11 05:26:38 +00:00
|
|
|
extern gamevar_t aGameVars[MAXGAMEVARS];
|
2008-04-01 02:50:44 +00:00
|
|
|
extern gamearray_t aGameArrays[MAXGAMEARRAYS];
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t g_gameVarCount;
|
|
|
|
extern int32_t g_gameArrayCount;
|
2008-11-20 14:06:36 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t SpriteFlags[MAXTILES];
|
2008-11-20 14:06:36 +00:00
|
|
|
|
|
|
|
enum SpriteFlags_t {
|
2010-05-02 23:27:30 +00:00
|
|
|
SPRITE_SHADOW = 0x00000001,
|
|
|
|
SPRITE_NVG = 0x00000002,
|
|
|
|
SPRITE_NOSHADE = 0x00000004,
|
|
|
|
SPRITE_PROJECTILE = 0x00000008,
|
|
|
|
SPRITE_DECAL = 0x00000010,
|
|
|
|
SPRITE_BADGUY = 0x00000020,
|
|
|
|
SPRITE_NOPAL = 0x00000040,
|
|
|
|
SPRITE_NOEVENTCODE = 0x00000080,
|
|
|
|
SPRITE_NOLIGHT = 0x00000100,
|
|
|
|
SPRITE_USEACTIVATOR = 0x00000200,
|
|
|
|
SPRITE_NULL = 0x00000400, // null sprite in multiplayer
|
2006-04-13 20:47:06 +00:00
|
|
|
};
|
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int16_t SpriteCacheList[MAXTILES][3];
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t g_iReturnVarID;
|
|
|
|
extern int32_t g_iWeaponVarID;
|
|
|
|
extern int32_t g_iWorksLikeVarID;
|
|
|
|
extern int32_t g_iZRangeVarID;
|
|
|
|
extern int32_t g_iAngRangeVarID;
|
|
|
|
extern int32_t g_iAimAngleVarID;
|
|
|
|
extern int32_t g_iLoTagID; // var ID of "LOTAG"
|
2010-05-02 23:27:30 +00:00
|
|
|
extern int32_t g_iHiTagID; // var ID of "HITAG"
|
|
|
|
extern int32_t g_iTextureID; // var ID of "TEXTURE"
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
extern char g_bEnhanced; // are we 'enhanced' (more minerals, etc)
|
|
|
|
|
|
|
|
extern char g_szBuf[1024];
|
|
|
|
|
2009-07-12 01:55:34 +00:00
|
|
|
#define NAM_GRENADE_LIFETIME 120
|
2006-04-13 20:47:06 +00:00
|
|
|
#define NAM_GRENADE_LIFETIME_VAR 30
|
|
|
|
|
2008-06-10 19:32:14 +00:00
|
|
|
extern intptr_t *aplWeaponClip[MAX_WEAPONS]; // number of items in clip
|
|
|
|
extern intptr_t *aplWeaponReload[MAX_WEAPONS]; // delay to reload (include fire)
|
|
|
|
extern intptr_t *aplWeaponFireDelay[MAX_WEAPONS]; // delay to fire
|
|
|
|
extern intptr_t *aplWeaponHoldDelay[MAX_WEAPONS]; // delay after release fire button to fire (0 for none)
|
|
|
|
extern intptr_t *aplWeaponTotalTime[MAX_WEAPONS]; // The total time the weapon is cycling before next fire.
|
|
|
|
extern intptr_t *aplWeaponFlags[MAX_WEAPONS]; // Flags for weapon
|
|
|
|
extern intptr_t *aplWeaponShoots[MAX_WEAPONS]; // what the weapon shoots
|
|
|
|
extern intptr_t *aplWeaponSpawnTime[MAX_WEAPONS]; // the frame at which to spawn an item
|
|
|
|
extern intptr_t *aplWeaponSpawn[MAX_WEAPONS]; // the item to spawn
|
|
|
|
extern intptr_t *aplWeaponShotsPerBurst[MAX_WEAPONS]; // number of shots per 'burst' (one ammo per 'burst'
|
|
|
|
extern intptr_t *aplWeaponWorksLike[MAX_WEAPONS]; // What original the weapon works like
|
|
|
|
extern intptr_t *aplWeaponInitialSound[MAX_WEAPONS]; // Sound made when initialy firing. zero for no sound
|
|
|
|
extern intptr_t *aplWeaponFireSound[MAX_WEAPONS]; // Sound made when firing (each time for automatic)
|
|
|
|
extern intptr_t *aplWeaponSound2Time[MAX_WEAPONS]; // Alternate sound time
|
|
|
|
extern intptr_t *aplWeaponSound2Sound[MAX_WEAPONS]; // Alternate sound sound ID
|
|
|
|
extern intptr_t *aplWeaponReloadSound1[MAX_WEAPONS]; // Sound of magazine being removed
|
|
|
|
extern intptr_t *aplWeaponReloadSound2[MAX_WEAPONS]; // Sound of magazine being inserted
|
2008-11-20 14:06:36 +00:00
|
|
|
extern intptr_t *aplWeaponSelectSound[MAX_WEAPONS]; // Sound for weapon selection
|
2009-04-13 06:01:50 +00:00
|
|
|
extern intptr_t *aplWeaponFlashColor[MAX_WEAPONS]; // Color for polymer muzzle flash
|
2008-11-20 14:06:36 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t g_timerTicsPerSecond;
|
2008-11-20 14:06:36 +00:00
|
|
|
|
|
|
|
enum WeaponFlags_t {
|
2010-05-02 23:27:30 +00:00
|
|
|
WEAPON_SPAWNTYPE1 = 0x00000000, // just spawn
|
|
|
|
WEAPON_HOLSTER_CLEARS_CLIP = 0x00000001, // 'holstering' clears the current clip
|
|
|
|
WEAPON_GLOWS = 0x00000002, // weapon 'glows' (shrinker and grower)
|
|
|
|
WEAPON_AUTOMATIC = 0x00000004, // automatic fire (continues while 'fire' is held down
|
|
|
|
WEAPON_FIREEVERYOTHER = 0x00000008, // during 'hold time' fire every frame
|
|
|
|
WEAPON_FIREEVERYTHIRD = 0x00000010, // during 'hold time' fire every third frame
|
|
|
|
WEAPON_RANDOMRESTART = 0x00000020, // restart for automatic is 'randomized' by RND 3
|
|
|
|
WEAPON_AMMOPERSHOT = 0x00000040, // uses ammo for each shot (for automatic)
|
|
|
|
WEAPON_BOMB_TRIGGER = 0x00000080, // weapon is the 'bomb' trigger
|
|
|
|
WEAPON_NOVISIBLE = 0x00000100, // weapon use does not cause user to become 'visible'
|
|
|
|
WEAPON_THROWIT = 0x00000200, // weapon 'throws' the 'shoots' item...
|
|
|
|
WEAPON_CHECKATRELOAD = 0x00000400, // check weapon availability at 'reload' time
|
|
|
|
WEAPON_STANDSTILL = 0x00000800, // player stops jumping before actual fire (like tripbomb in duke)
|
|
|
|
WEAPON_SPAWNTYPE2 = 0x00001000, // spawn like shotgun shells
|
|
|
|
WEAPON_SPAWNTYPE3 = 0x00002000, // spawn like chaingun shells
|
|
|
|
WEAPON_SEMIAUTO = 0x00004000, // cancel button press after each shot
|
|
|
|
WEAPON_RELOAD_TIMING = 0x00008000, // special casing for pistol reload sounds
|
|
|
|
WEAPON_RESET = 0x00010000 // cycle weapon back to frame 1 if fire is held, 0 if not
|
2006-04-13 20:47:06 +00:00
|
|
|
};
|
|
|
|
|
2010-05-02 23:27:30 +00:00
|
|
|
#define TRIPBOMB_TRIPWIRE 0x00000001
|
|
|
|
#define TRIPBOMB_TIMER 0x00000002
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2010-05-02 23:27:30 +00:00
|
|
|
#define PIPEBOMB_REMOTE 0x00000001
|
|
|
|
#define PIPEBOMB_TIMER 0x00000002
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
// custom projectiles
|
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
enum ProjectileFlags_t {
|
2010-05-02 23:27:30 +00:00
|
|
|
PROJECTILE_HITSCAN = 0x00000001,
|
|
|
|
PROJECTILE_RPG = 0x00000002,
|
|
|
|
PROJECTILE_BOUNCESOFFWALLS = 0x00000004,
|
|
|
|
PROJECTILE_BOUNCESOFFMIRRORS = 0x00000008,
|
|
|
|
PROJECTILE_KNEE = 0x00000010,
|
|
|
|
PROJECTILE_WATERBUBBLES = 0x00000020,
|
|
|
|
PROJECTILE_TIMED = 0x00000040,
|
|
|
|
PROJECTILE_BOUNCESOFFSPRITES = 0x00000080,
|
|
|
|
PROJECTILE_SPIT = 0x00000100,
|
|
|
|
PROJECTILE_COOLEXPLOSION1 = 0x00000200,
|
|
|
|
PROJECTILE_BLOOD = 0x00000400,
|
|
|
|
PROJECTILE_LOSESVELOCITY = 0x00000800,
|
|
|
|
PROJECTILE_NOAIM = 0x00001000,
|
|
|
|
PROJECTILE_RANDDECALSIZE = 0x00002000,
|
|
|
|
PROJECTILE_EXPLODEONTIMER = 0x00004000,
|
|
|
|
PROJECTILE_RPG_IMPACT = 0x00008000,
|
|
|
|
PROJECTILE_RADIUS_PICNUM = 0x00010000,
|
|
|
|
PROJECTILE_ACCURATE_AUTOAIM = 0x00020000,
|
|
|
|
PROJECTILE_FORCEIMPACT = 0x00040000,
|
|
|
|
PROJECTILE_REALCLIPDIST = 0x00080000,
|
|
|
|
PROJECTILE_ACCURATE = 0x00100000,
|
2006-04-13 20:47:06 +00:00
|
|
|
};
|
|
|
|
|
2009-07-12 01:55:34 +00:00
|
|
|
extern projectile_t ProjectileData[MAXTILES], DefaultProjectileData[MAXTILES], SpriteProjectile[MAXSPRITES];
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
// logo control
|
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
enum LogoFlags_t {
|
2010-05-02 23:27:30 +00:00
|
|
|
LOGO_ENABLED = 0x00000001,
|
|
|
|
LOGO_PLAYANIM = 0x00000002,
|
|
|
|
LOGO_PLAYMUSIC = 0x00000004,
|
|
|
|
LOGO_3DRSCREEN = 0x00000008,
|
|
|
|
LOGO_TITLESCREEN = 0x00000010,
|
|
|
|
LOGO_DUKENUKEM = 0x00000020,
|
|
|
|
LOGO_THREEDEE = 0x00000040,
|
|
|
|
LOGO_PLUTOPAKSPRITE = 0x00000080,
|
|
|
|
LOGO_SHAREWARESCREENS = 0x00000100,
|
|
|
|
LOGO_TENSCREEN = 0x00000200
|
2006-04-13 20:47:06 +00:00
|
|
|
};
|
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t g_numRealPalettes;
|
|
|
|
extern int32_t g_scriptDebug;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
#define MAXCHEATLEN 20
|
2009-01-09 09:29:17 +00:00
|
|
|
#define NUMCHEATCODES (int32_t)(sizeof(CheatStrings)/sizeof(CheatStrings[0]))
|
2006-04-24 04:57:04 +00:00
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
extern char CheatKeys[2];
|
|
|
|
extern char CheatStrings[][MAXCHEATLEN];
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int16_t WeaponPickupSprites[MAX_WEAPONS];
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t g_numQuoteRedefinitions;
|
2006-04-24 04:57:04 +00:00
|
|
|
|
2006-11-24 04:25:13 +00:00
|
|
|
extern char setupfilename[BMAX_PATH];
|
|
|
|
|
2008-07-16 09:27:08 +00:00
|
|
|
typedef struct {
|
|
|
|
// this needs to have a copy of everything related to the map/actor state
|
|
|
|
// see savegame.c
|
2009-07-12 01:55:34 +00:00
|
|
|
int32_t animategoal[MAXANIMATES], animatevel[MAXANIMATES], g_animateCount;
|
|
|
|
int32_t animateptr[MAXANIMATES];
|
|
|
|
int32_t lockclock;
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t msx[2048], msy[2048];
|
2009-07-12 01:55:34 +00:00
|
|
|
int32_t randomseed, g_globalRandom;
|
|
|
|
intptr_t *vars[MAXGAMEVARS];
|
|
|
|
|
|
|
|
int16_t SpriteDeletionQueue[1024],g_spriteDeleteQueuePos;
|
|
|
|
int16_t animatesect[MAXANIMATES];
|
|
|
|
int16_t cyclers[MAXCYCLERS][6];
|
2009-01-09 09:29:17 +00:00
|
|
|
int16_t g_mirrorWall[64], g_mirrorSector[64], g_mirrorCount;
|
2009-07-12 01:55:34 +00:00
|
|
|
int16_t g_numAnimWalls;
|
2009-01-09 09:29:17 +00:00
|
|
|
int16_t g_numClouds,clouds[128],cloudx[128],cloudy[128];
|
2009-07-12 01:55:34 +00:00
|
|
|
int16_t g_numCyclers;
|
|
|
|
int16_t headspritesect[MAXSECTORS+1];
|
|
|
|
int16_t headspritestat[MAXSTATUS+1];
|
|
|
|
int16_t nextspritesect[MAXSPRITES];
|
|
|
|
int16_t nextspritestat[MAXSPRITES];
|
|
|
|
int16_t numsectors;
|
|
|
|
int16_t numwalls;
|
|
|
|
int16_t prevspritesect[MAXSPRITES];
|
|
|
|
int16_t prevspritestat[MAXSPRITES];
|
2009-01-09 09:29:17 +00:00
|
|
|
int16_t pskyoff[MAXPSKYTILES], pskybits;
|
2009-07-12 01:55:34 +00:00
|
|
|
|
2009-01-13 04:40:56 +00:00
|
|
|
uint8_t g_earthquakeTime;
|
2009-07-12 01:55:34 +00:00
|
|
|
uint8_t g_numPlayerSprites;
|
2009-01-13 04:40:56 +00:00
|
|
|
uint8_t scriptptrs[MAXSPRITES];
|
2009-07-12 01:55:34 +00:00
|
|
|
uint8_t show2dsector[(MAXSECTORS+7)>>3];
|
|
|
|
|
2010-05-02 23:27:30 +00:00
|
|
|
ActorData_t actor[MAXSPRITES];
|
2009-07-12 01:55:34 +00:00
|
|
|
PlayerSpawn_t g_playerSpawnPoints[MAXPLAYERS];
|
|
|
|
animwalltype animwall[MAXANIMWALLS];
|
|
|
|
sectortype sector[MAXSECTORS];
|
|
|
|
spriteext_t spriteext[MAXSPRITES];
|
|
|
|
spritetype sprite[MAXSPRITES];
|
|
|
|
walltype wall[MAXWALLS];
|
2008-07-16 09:27:08 +00:00
|
|
|
} mapstate_t;
|
|
|
|
|
2009-12-05 09:22:43 +00:00
|
|
|
extern void G_SaveMapState(mapstate_t *save);
|
|
|
|
extern void G_RestoreMapState(mapstate_t *save);
|
|
|
|
|
2007-08-26 11:28:32 +00:00
|
|
|
typedef struct {
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t partime, designertime;
|
2009-07-28 08:28:58 +00:00
|
|
|
char *name, *filename, *musicfn, *alt_musicfn;
|
2008-07-16 09:27:08 +00:00
|
|
|
mapstate_t *savedstate;
|
2007-08-26 11:28:32 +00:00
|
|
|
} map_t;
|
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
extern map_t MapInfo[(MAXVOLUMES+1)*MAXLEVELS]; // +1 volume for "intro", "briefing" music
|
2007-08-26 11:28:32 +00:00
|
|
|
|
2007-08-27 00:20:15 +00:00
|
|
|
typedef struct {
|
2008-11-20 14:06:36 +00:00
|
|
|
DukePlayer_t *ps;
|
2008-08-25 00:49:12 +00:00
|
|
|
input_t *sync;
|
2007-08-27 00:20:15 +00:00
|
|
|
|
2009-12-15 05:53:15 +00:00
|
|
|
int32_t movefifoend, syncvalhead;
|
|
|
|
int16_t ping, filler;
|
2010-05-02 23:27:30 +00:00
|
|
|
int32_t pcolor, pteam;
|
|
|
|
uint8_t frags[MAXPLAYERS], wchoice[MAX_WEAPONS];
|
2007-08-27 00:20:15 +00:00
|
|
|
|
2008-08-25 00:49:12 +00:00
|
|
|
char vote, gotvote, playerreadyflag, playerquitflag;
|
2008-11-17 00:38:26 +00:00
|
|
|
char user_name[32];
|
2008-11-20 14:06:36 +00:00
|
|
|
char syncval[SYNCFIFOSIZ][MAXSYNCBYTES];
|
2007-08-27 00:20:15 +00:00
|
|
|
} playerdata_t;
|
|
|
|
|
2008-08-06 11:50:34 +00:00
|
|
|
extern input_t inputfifo[MOVEFIFOSIZ][MAXPLAYERS];
|
2008-11-20 14:06:36 +00:00
|
|
|
extern PlayerSpawn_t g_playerSpawnPoints[MAXPLAYERS];
|
2007-08-27 00:20:15 +00:00
|
|
|
extern playerdata_t g_player[MAXPLAYERS];
|
|
|
|
#include "funct.h"
|
|
|
|
|
2008-01-04 01:04:35 +00:00
|
|
|
// key bindings stuff
|
|
|
|
typedef struct {
|
|
|
|
char *name;
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t id;
|
2008-11-22 06:46:27 +00:00
|
|
|
} keydef_t;
|
2008-01-04 01:04:35 +00:00
|
|
|
|
2009-01-10 07:38:50 +00:00
|
|
|
extern keydef_t ConsoleKeys[];
|
|
|
|
extern char *ConsoleButtons[];
|
2008-01-04 01:04:35 +00:00
|
|
|
|
2010-01-16 23:08:17 +00:00
|
|
|
extern char *g_grpNamePtr, *g_gameNamePtr;
|
|
|
|
extern char g_modDir[BMAX_PATH];
|
2008-08-20 09:27:17 +00:00
|
|
|
|
2010-05-02 23:27:30 +00:00
|
|
|
extern hashtable_t h_gamevars;
|
|
|
|
extern hashtable_t h_arrays;
|
|
|
|
extern hashtable_t h_keywords;
|
|
|
|
extern hashtable_t h_gamefuncs;
|
2008-08-25 00:49:12 +00:00
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
enum DukePacket_t
|
|
|
|
{
|
2009-01-10 07:38:50 +00:00
|
|
|
PACKET_MASTER_TO_SLAVE,
|
|
|
|
PACKET_SLAVE_TO_MASTER,
|
2008-11-20 14:06:36 +00:00
|
|
|
|
2009-12-05 09:22:43 +00:00
|
|
|
PACKET_NUM_PLAYERS,
|
|
|
|
PACKET_PLAYER_INDEX,
|
|
|
|
PACKET_PLAYER_DISCONNECTED,
|
2009-12-12 11:07:59 +00:00
|
|
|
PACKET_PLAYER_SPAWN,
|
2009-12-14 05:23:29 +00:00
|
|
|
PACKET_FRAG,
|
2009-12-12 11:07:59 +00:00
|
|
|
PACKET_REQUEST_GAMESTATE,
|
|
|
|
PACKET_LOAD_GAME,
|
2009-12-14 09:54:11 +00:00
|
|
|
PACKET_VERSION,
|
2009-12-14 20:14:12 +00:00
|
|
|
PACKET_AUTH,
|
2009-12-30 23:07:00 +00:00
|
|
|
PACKET_PLAYER_READY,
|
2009-12-12 11:07:59 +00:00
|
|
|
|
|
|
|
// any packet with an ID higher than PACKET_BROADCAST is rebroadcast by server
|
2010-05-02 23:27:30 +00:00
|
|
|
// so hacked clients can't create fake server packets and get the server to
|
|
|
|
// send them to everyone
|
|
|
|
// newer versions of the netcode also make this determination based on which
|
|
|
|
// channel the packet was broadcast on
|
2009-12-12 11:07:59 +00:00
|
|
|
|
|
|
|
PACKET_BROADCAST,
|
2009-12-17 11:17:48 +00:00
|
|
|
PACKET_NEW_GAME,
|
2009-01-10 07:38:50 +00:00
|
|
|
PACKET_RTS,
|
2009-12-17 11:17:48 +00:00
|
|
|
PACKET_CLIENT_INFO,
|
2009-12-12 11:07:59 +00:00
|
|
|
PACKET_MESSAGE,
|
2009-01-10 07:38:50 +00:00
|
|
|
PACKET_USER_MAP,
|
2008-11-20 14:06:36 +00:00
|
|
|
|
2009-01-10 07:38:50 +00:00
|
|
|
PACKET_MAP_VOTE,
|
|
|
|
PACKET_MAP_VOTE_INITIATE,
|
|
|
|
PACKET_MAP_VOTE_CANCEL,
|
2008-11-20 14:06:36 +00:00
|
|
|
};
|
|
|
|
|
2009-12-17 11:17:48 +00:00
|
|
|
enum NetDisconnect_t
|
|
|
|
{
|
|
|
|
DISC_BAD_PASSWORD = 1,
|
|
|
|
DISC_KICKED,
|
|
|
|
DISC_BANNED
|
|
|
|
};
|
|
|
|
|
2009-07-09 02:29:48 +00:00
|
|
|
#pragma pack(pop)
|
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2008-12-19 00:53:54 +00:00
|
|
|
#endif
|