Subversion Repositories eduke32

Rev

Rev 868 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5 Plagman 1
//-------------------------------------------------------------------------
2
/*
484 terminx 3
Copyright (C) 1996, 2003 - 3D Realms Entertainment
4
Copyright (C) 2000, 2003 - Matt Saettler (EDuke Enhancements)
5
Copyright (C) 2004, 2007 - EDuke32 developers
5 Plagman 6
 
7
This file is part of EDuke32
8
 
9
EDuke32 is free software; you can redistribute it and/or
10
modify it under the terms of the GNU General Public License version 2
11
as published by the Free Software Foundation.
12
 
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
 
17
See the GNU General Public License for more details.
18
 
19
You should have received a copy of the GNU General Public License
20
along with this program; if not, write to the Free Software
21
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22
*/
23
//-------------------------------------------------------------------------
24
 
570 terminx 25
#define VERSION " 1.4.0 svn"
317 terminx 26
 
605 terminx 27
#define HEAD  "EDuke32"VERSION" (shareware)"
317 terminx 28
#define HEAD2 "EDuke32"VERSION
29
 
5 Plagman 30
#ifdef __cplusplus
31
extern "C" {
32
#endif
33
 
34
// JBF
35
#include "compat.h"
36
#include "a.h"
37
#include "build.h"
311 Plagman 38
#if defined(POLYMOST) && defined(USE_OPENGL)
723 terminx 39
# include "polymost.h"
40
#endif
41
#ifdef POLYMER
311 Plagman 42
# include "polymer.h"
43
#endif
5 Plagman 44
#include "cache1d.h"
45
#include "pragmas.h"
46
#include "mmulti.h"
47
 
48
#include "baselayer.h"
49
 
50
#include "function.h"
51
 
561 terminx 52
extern int g_ScriptVersion, g_Shareware, g_GameType;
5 Plagman 53
 
241 terminx 54
#define GAMEDUKE 0
55
#define GAMENAM 1
341 terminx 56
#define GAMEWW2 3
241 terminx 57
 
561 terminx 58
#define VOLUMEALL (g_Shareware==0)
59
#define PLUTOPAK (g_ScriptVersion==14)
60
#define VOLUMEONE (g_Shareware==1)
61
#define NAM (g_GameType&1)
62
#define WW2GI (g_GameType&2)
5 Plagman 63
 
64
#define MAXSLEEPDIST  16384
65
#define SLEEPTIME 24*64
66
 
67
#define BYTEVERSION_13  27
68
#define BYTEVERSION_14  116
69
#define BYTEVERSION_15  117
859 terminx 70
#define BYTEVERSION_JF  183 // increase by 3, because atomic GRP adds 1, and Shareware adds 2
5 Plagman 71
 
72
#define BYTEVERSION (BYTEVERSION_JF+(PLUTOPAK?1:(VOLUMEONE<<1)))    // JBF 20040116: different data files give different versions
73
 
74
#define NUMPAGES 1
75
 
76
#define AUTO_AIM_ANGLE          48
77
#define RECSYNCBUFSIZ 2520   //2520 is the (LCM of 1-8)*3
78
#define MOVEFIFOSIZ 256
79
 
80
#define FOURSLEIGHT (1<<8)
81
 
11 terminx 82
#define MAXVOLUMES 7
381 terminx 83
#define MAXLEVELS 32
11 terminx 84
 
5 Plagman 85
#include "types.h"
86
#include "file_lib.h"
87
#include "develop.h"
88
#include "gamedefs.h"
89
#include "keyboard.h"
90
#include "util_lib.h"
91
#include "mathutil.h"
92
#include "function.h"
93
#include "fx_man.h"
94
#include "config.h"
95
#include "sounds.h"
96
#include "control.h"
97
#include "_rts.h"
98
#include "rts.h"
99
#include "soundefs.h"
100
 
101
#include "music.h"
102
 
103
#include "namesdyn.h"
104
 
105
#define TICRATE (120)
106
#define TICSPERFRAME (TICRATE/26)
107
 
108
// #define GC (TICSPERFRAME*44)
109
 
581 terminx 110
#define MAXSOUNDS 1536
5 Plagman 111
 
112
/*
113
#pragma aux sgn =\
114
        "add ebx, ebx",\
115
        "sbb eax, eax",\
116
        "cmp eax, ebx",\
117
        "adc eax, 0",\
118
        parm [ebx]\
119
*/
120
 
121
#define    ALT_IS_PRESSED ( KB_KeyPressed( sc_RightAlt ) || KB_KeyPressed( sc_LeftAlt ) )
122
#define    SHIFTS_IS_PRESSED ( KB_KeyPressed( sc_RightShift ) || KB_KeyPressed( sc_LeftShift ) )
123
#define    RANDOMSCRAP EGS(s->sectnum,s->x+(TRAND&255)-128,s->y+(TRAND&255)-128,s->z-(8<<8)-(TRAND&8191),SCRAP6+(TRAND&15),-8,48,48,TRAND&2047,(TRAND&63)+64,-512-(TRAND&2047),i,5)
124
 
125
#define    PHEIGHT (38<<8)
126
 
127
enum gamemodes {
128
    MODE_MENU       = 1,
129
    MODE_DEMO       = 2,
130
    MODE_GAME       = 4,
131
    MODE_EOL        = 8,
132
    MODE_TYPE       = 16,
133
    MODE_RESTART    = 32,
134
    MODE_SENDTOWHOM = 64,
135
    MODE_END        = 128
136
};
137
 
138
#define MAXANIMWALLS 512
189 terminx 139
#define MAXINTERPOLATIONS MAXSPRITES
5 Plagman 140
 
108 terminx 141
#define MAXQUOTES 16384
5 Plagman 142
 
271 terminx 143
#define PPDEATHSTRINGS MAXQUOTES-128
144
#define PSDEATHSTRINGS MAXQUOTES-32
145
 
5 Plagman 146
#define MAXCYCLERS 1024
147
 
567 terminx 148
#define MAXSCRIPTSIZE 131072
5 Plagman 149
 
150
#define MAXANIMATES 256
151
 
152
#define SP  sprite[i].yvel
153
#define SX  sprite[i].x
154
#define SY  sprite[i].y
155
#define SZ  sprite[i].z
156
#define SS  sprite[i].shade
157
#define PN  sprite[i].picnum
158
#define SA  sprite[i].ang
159
#define SV  sprite[i].xvel
160
#define ZV  sprite[i].zvel
161
#define RX  sprite[i].xrepeat
162
#define RY  sprite[i].yrepeat
163
#define OW  sprite[i].owner
164
#define CS  sprite[i].cstat
165
#define SH  sprite[i].extra
166
#define CX  sprite[i].xoffset
167
#define CY  sprite[i].yoffset
168
#define CD  sprite[i].clipdist
169
#define PL  sprite[i].pal
170
#define SLT  sprite[i].lotag
171
#define SHT  sprite[i].hitag
172
#define SECT sprite[i].sectnum
173
 
174
// Defines the motion characteristics of an actor
175
 
176
enum actormotion {
177
    face_player         = 1,
178
    geth                = 2,
179
    getv                = 4,
180
    random_angle        = 8,
181
    face_player_slow    = 16,
182
    spin                = 32,
183
    face_player_smart   = 64,
184
    fleeenemy           = 128,
185
    jumptoplayer        = 257,
186
    seekplayer          = 512,
187
    furthestdir         = 1024,
188
    dodgebullet         = 4096
189
};
190
 
191
// Some misc #defines
192
#define NO       0
193
#define YES      1
194
 
195
// Defines for 'useractor' keyword
196
 
197
enum useractortypes {
198
    notenemy,
199
    enemy,
200
    enemystayput
201
};
202
 
203
// Player Actions.
204
 
205
enum playeractions {
206
    pstanding       = 1,
207
    pwalking        = 2,
208
    prunning        = 4,
209
    pducking        = 8,
210
    pfalling        = 16,
211
    pjumping        = 32,
212
    phigher         = 64,
213
    pwalkingback    = 128,
214
    prunningback    = 256,
215
    pkicking        = 512,
216
    pshrunk         = 1024,
217
    pjetpack        = 2048,
218
    ponsteroids     = 4096,
219
    ponground       = 8192,
220
    palive          = 16384,
221
    pdead           = 32768,
222
    pfacing         = 65536
223
};
224
 
225
enum inventory {
226
    GET_STEROIDS,
227
    GET_SHIELD,
228
    GET_SCUBA,
229
    GET_HOLODUKE,
230
    GET_JETPACK,
231
    GET_ACCESS   = 6,
232
    GET_HEATS,
233
    GET_FIRSTAID = 9,
234
    GET_BOOTS
235
};
236
 
237
#define TRAND krand()
238
 
239
enum weapons {
240
    KNEE_WEAPON,
241
    PISTOL_WEAPON,
242
    SHOTGUN_WEAPON,
243
    CHAINGUN_WEAPON,
244
    RPG_WEAPON,
245
    HANDBOMB_WEAPON,
246
    SHRINKER_WEAPON,
247
    DEVISTATOR_WEAPON,
248
    TRIPBOMB_WEAPON,
249
    FREEZE_WEAPON,
250
    HANDREMOTE_WEAPON,
251
    GROW_WEAPON,
252
    MAX_WEAPONS
253
};
254
 
255
#define T1  hittype[i].temp_data[0]
256
#define T2  hittype[i].temp_data[1]
257
#define T3  hittype[i].temp_data[2]
258
#define T4  hittype[i].temp_data[3]
259
#define T5  hittype[i].temp_data[4]
260
#define T6  hittype[i].temp_data[5]
261
#define T7  hittype[i].temp_data[6]
262
#define T8  hittype[i].temp_data[7]
263
#define T9  hittype[i].temp_data[8]
264
 
265
#define ESCESCAPE if(KB_KeyPressed( sc_Escape ) ) gameexit(" ");
266
 
267
#define IFWITHIN(B,E) if((PN)>=(B) && (PN)<=(E))
587 terminx 268
 
269
#define deletesprite deletespriteEVENT
270
void deletespriteEVENT(int s);
193 terminx 271
#define KILLIT(KX) {deletesprite(KX);goto BOLT;}
5 Plagman 272
 
273
 
274
#define IFMOVING if(ssp(i,CLIPMASK0))
275
#define IFHIT j=ifhitbyweapon(i);if(j >= 0)
276
#define IFHITSECT j=ifhitsectors(s->sectnum);if(j >= 0)
277
 
278
#define AFLAMABLE(X) (X==BOX||X==TREE1||X==TREE2||X==TIRE||X==CONE)
279
 
280
 
281
#define IFSKILL1 if(player_skill<1)
282
#define IFSKILL2 if(player_skill<2)
283
#define IFSKILL3 if(player_skill<3)
284
#define IFSKILL4 if(player_skill<4)
285
 
286
#define rnd(X) ((TRAND>>8)>=(255-(X)))
287
 
288
#define __USRHOOKS_H
289
 
290
enum USRHOOKS_Errors {
291
    USRHOOKS_Warning = -2,
292
    USRHOOKS_Error   = -1,
293
    USRHOOKS_Ok      = 0
294
};
295
 
296
typedef struct {
616 terminx 297
    unsigned int bits, extbits;
298
    short fvel, svel;
5 Plagman 299
    signed char avel, horz;
300
} input;
301
 
565 terminx 302
#define sync dsync  // JBF 20040604: sync is a function on some platforms
5 Plagman 303
extern input recsync[RECSYNCBUFSIZ];
304
 
584 terminx 305
extern int movefifosendplc;
5 Plagman 306
 
307
typedef struct {
581 terminx 308
    int voice;
616 terminx 309
    int i;
581 terminx 310
} SOUNDOWNER;
311
 
312
typedef struct {
616 terminx 313
    int  length, num, soundsiz;
808 terminx 314
    char *filename, *ptr, *filename1;
315
    SOUNDOWNER SoundOwner[4];
616 terminx 316
    short ps,pe,vo;
808 terminx 317
    char pr,m;
5 Plagman 318
    volatile char lock;
580 terminx 319
} sound_t;
5 Plagman 320
 
581 terminx 321
extern sound_t g_sounds[MAXSOUNDS];
322
 
563 terminx 323
typedef struct {
616 terminx 324
    int wallnum, tag;
563 terminx 325
} animwalltype;
5 Plagman 326
 
563 terminx 327
extern animwalltype animwall[MAXANIMWALLS];
148 terminx 328
 
432 terminx 329
extern short numanimwalls;
482 terminx 330
extern int probey;
5 Plagman 331
 
81 terminx 332
extern char typebuflen,typebuf[141];
640 terminx 333
extern char *MusicPtr;
334
extern int Musicsize;
584 terminx 335
extern int msx[2048],msy[2048];
5 Plagman 336
extern short cyclers[MAXCYCLERS][6],numcyclers;
337
extern char myname[32];
338
 
339
struct savehead {
340
    char name[19];
584 terminx 341
    int numplr,volnum,levnum,plrskl;
5 Plagman 342
    char boardfn[BMAX_PATH];
343
};
344
 
563 terminx 345
typedef struct {
616 terminx 346
        int UseJoystick;
347
        int UseMouse;
348
        int RunMode;
349
        int AutoAim;
350
        int ShowOpponentWeapons;
351
        int MouseFilter,MouseBias;
352
        int SmoothInput;
353
 
630 terminx 354
        // JBF 20031211: Store the input settings because
355
        // (currently) jmact can't regurgitate them
356
        int MouseFunctions[MAXMOUSEBUTTONS][2];
357
        int MouseDigitalFunctions[MAXMOUSEAXES][2];
358
        int MouseAnalogueAxes[MAXMOUSEAXES];
359
        int MouseAnalogueScale[MAXMOUSEAXES];
360
        int JoystickFunctions[MAXJOYBUTTONS][2];
361
        int JoystickDigitalFunctions[MAXJOYAXES][2];
362
        int JoystickAnalogueAxes[MAXJOYAXES];
363
        int JoystickAnalogueScale[MAXJOYAXES];
364
        int JoystickAnalogueDead[MAXJOYAXES];
365
        int JoystickAnalogueSaturate[MAXJOYAXES];
366
        byte KeyboardKeys[NUMGAMEFUNCTIONS][2];
367
 
563 terminx 368
        //
369
        // Sound variables
370
        //
584 terminx 371
        int FXDevice;
372
        int MusicDevice;
373
        int FXVolume;
374
        int MusicVolume;
375
        int SoundToggle;
376
        int MusicToggle;
377
        int VoiceToggle;
378
        int AmbienceToggle;
563 terminx 379
 
584 terminx 380
        int NumVoices;
381
        int NumChannels;
382
        int NumBits;
383
        int MixRate;
563 terminx 384
 
584 terminx 385
        int ReverseStereo;
563 terminx 386
 
387
        //
388
        // Screen variables
389
        //
390
 
584 terminx 391
        int ScreenMode;
563 terminx 392
 
584 terminx 393
        int ScreenWidth;
394
        int ScreenHeight;
395
        int ScreenBPP;
563 terminx 396
 
584 terminx 397
        int ForceSetup;
563 terminx 398
 
584 terminx 399
        int scripthandle;
400
        int setupread;
563 terminx 401
 
584 terminx 402
        int CheckForUpdates;
403
        int LastUpdateCheck;
404
        int useprecache;
563 terminx 405
} config_t;
406
 
407
typedef struct {
584 terminx 408
    int const_visibility,uw_framerate;
409
    int camera_time,folfvel,folavel,folx,foly,fola;
881 terminx 410
    int reccnt,crosshairscale;
5 Plagman 411
 
584 terminx 412
    int runkey_mode,statusbarscale,mouseaiming,weaponswitch,drawweapon;   // JBF 20031125
413
    int democams,color,msgdisptime,statusbarmode;
414
    int m_noexits,noexits,autovote,automsg,idplayers;
415
        int team, viewbob, weaponsway;
5 Plagman 416
 
584 terminx 417
    int entered_name,screen_tilting,shadows,fta_on,executions,auto_run;
418
    int coords,tickrate,levelstats,m_coop,coop,screen_size,lockout,crosshair;
419
    int playerai,angleinterpolation,deathmsgs;
5 Plagman 420
 
584 terminx 421
    int respawn_monsters,respawn_items,respawn_inventory,recstat,monsters_off,brightness;
422
    int m_respawn_items,m_respawn_monsters,m_respawn_inventory,m_recstat,m_monsters_off,detail;
423
    int m_ffire,ffire,m_player_skill,m_level_number,m_volume_number,multimode;
424
    int player_skill,level_number,volume_number,m_marker,marker,mouseflip;
616 terminx 425
 
426
    int camerax,cameray,cameraz;
427
 
428
    short cameraang, camerasect, camerahoriz;
429
    short pause_on,from_bonus;
430
    short camerasprite,last_camsprite;
431
    short last_level,secretlevel;
432
 
648 terminx 433
    char overhead_on,last_overhead,showweapons;
616 terminx 434
    char god,warp_on,cashman,eog,showallmap;
435
    char show_help,scrollmode,clipping;
436
    char ridecule[10][40];
437
    char savegame[10][22];
438
    char pwlockout[128],rtsname[128];
439
 
563 terminx 440
        config_t config;
441
} user_defs;
5 Plagman 442
 
563 terminx 443
typedef struct {
584 terminx 444
    int ox,oy,oz;
5 Plagman 445
    short oa,os;
581 terminx 446
} playerspawn_t;
5 Plagman 447
 
448
extern char numplayersprites;
449
 
584 terminx 450
extern int fricxv,fricyv;
5 Plagman 451
 
563 terminx 452
typedef struct {
616 terminx 453
    int zoom,exitx,exity;
584 terminx 454
    int posx, posy, posz, horiz, ohoriz, ohorizoff, invdisptime;
455
    int bobposx,bobposy,oposx,oposy,oposz,pyoff,opyoff;
456
    int posxv,posyv,poszv,last_pissed_time,truefz,truecz;
457
    int player_par,visibility;
458
    int bobcounter,weapon_sway;
459
    int pals_time,randomflamex,crack_time;
5 Plagman 460
 
616 terminx 461
    unsigned int interface_toggle_flag;
5 Plagman 462
 
616 terminx 463
    int max_secret_rooms,secret_rooms,max_actors_killed,actors_killed;
464
    int runspeed, movement_lock, team;
465
    int max_player_health, max_shield_amount, max_ammo_amount[MAX_WEAPONS];
466
 
467
    int scream_voice;
468
 
469
    int loogiex[64],loogiey[64],numloogs,loogcnt;
470
 
471
    char *palette;
472
 
473
    short sbs, sound_pitch;
474
 
5 Plagman 475
    short ang,oang,angvel,cursectnum,look_ang,last_extra,subweapon;
476
    short ammo_amount[MAX_WEAPONS],wackedbyactor,frag,fraggedself;
477
 
478
    short curr_weapon, last_weapon, tipincs, horizoff, wantweaponfire;
479
    short holoduke_amount,newowner,hurt_delay,hbomb_hold_delay;
480
    short jumping_counter,airleft,knee_incs,access_incs;
481
    short fta,ftq,access_wallnum,access_spritenum;
482
    short kickback_pic,got_access,weapon_ang,firstaid_amount;
483
    short somethingonplayer,on_crane,i,one_parallax_sectnum;
484
    short over_shoulder_on,random_club_frame,fist_incs;
485
    short one_eighty_count,cheat_phase;
486
    short dummyplayersprite,extra_extra8,quick_kick;
487
    short heat_amount,actorsqu,timebeforeexit,customexitsound;
488
 
489
    short weaprecs[16],weapreccnt;
490
 
616 terminx 491
 
5 Plagman 492
    short orotscrnang,rotscrnang,dead_flag,show_empty_weapon;   // JBF 20031220: added orotscrnang
493
    short scuba_amount,jetpack_amount,steroids_amount,shield_amount;
494
    short holoduke_on,pycount,weapon_pos,frag_ps;
495
    short transporter_hold,last_full_weapon,footprintshade,boot_amount;
496
 
616 terminx 497
    char aim_mode,auto_aim,weaponswitch;
5 Plagman 498
 
499
    char gm,on_warping_sector,footprintcount;
500
    char hbomb_on,jumping_toggle,rapid_fire_hold,on_ground;
616 terminx 501
    char inven_icon,buttonpalette;
5 Plagman 502
 
503
    char jetpack_on,spritebridge,lastrandomspot;
504
    char scuba_on,footprintpal,heat_on;
505
 
506
    char  holster_weapon,falling_counter;
616 terminx 507
    char  gotweapon[MAX_WEAPONS],refresh_inventory;
5 Plagman 508
 
509
    char toggle_key_flag,knuckle_incs; // ,select_dir;
510
    char walking_snd_toggle, palookup, hard_landing;
511
    char /*fire_flag,*/pals[3];
616 terminx 512
    char return_to_center, reloading, name[32];
563 terminx 513
} player_struct;
5 Plagman 514
 
515
extern char tempbuf[2048], packbuf[576];
516
 
584 terminx 517
extern int gc;
5 Plagman 518
 
584 terminx 519
extern int impact_damage,respawnactortime,respawnitemtime;
520
extern int start_armour_amount;
5 Plagman 521
 
522
#define MOVFIFOSIZ 256
523
 
524
extern short spriteq[1024],spriteqloc,spriteqamount;
563 terminx 525
extern user_defs ud;
5 Plagman 526
extern short int moustat;
527
extern short int global_random;
528
extern char buf[1024]; //My own generic input buffer
529
 
151 terminx 530
#define MAXQUOTELEN 128
93 terminx 531
 
108 terminx 532
extern char *fta_quotes[MAXQUOTES],*redefined_quotes[MAXQUOTES];
563 terminx 533
extern char ready2send;
5 Plagman 534
 
535
// JBF 20040531: adding 16 extra to the script so we have some leeway
536
// to (hopefully) safely abort when hitting the limit
619 terminx 537
extern intptr_t *script,*scriptptr,*insptr,*labelcode,*labeltype;
538
extern int labelcnt,defaultlabelcnt;
567 terminx 539
extern int g_ScriptSize;
432 terminx 540
extern char *label;
619 terminx 541
extern intptr_t *actorscrptr[MAXTILES],*parsing_actor;
542
extern intptr_t *actorLoadEventScrptr[MAXTILES];
5 Plagman 543
extern char actortype[MAXTILES];
544
extern char *music_pointer;
545
 
562 terminx 546
extern char music_select;
381 terminx 547
extern char env_music_fn[MAXVOLUMES+1][BMAX_PATH];
5 Plagman 548
extern short camsprite;
549
 
580 terminx 550
typedef struct {
551
    int workslike, extra, cstat, extra_rand, hitradius, range;
552
    short spawns, sound, isound, vel, decal, trail, tnum, drop, clipdist, offset, bounces, bsound, toffset;
553
    signed char sxrepeat, syrepeat, txrepeat, tyrepeat, shade, xrepeat, yrepeat, pal, velmult;
855 terminx 554
} projectile_t;
580 terminx 555
 
5 Plagman 556
// extern char gotz;
580 terminx 557
 
563 terminx 558
typedef struct {
584 terminx 559
/*    int x;
560
    int y;
561
    int z; */
580 terminx 562
    short ang, oldang, angdir, angdif;
563
} spriteinterpolate;
564
 
565
spriteinterpolate sprpos[MAXSPRITES];
566
 
567
typedef struct {
616 terminx 568
    int floorz,ceilingz,lastvx,lastvy,bposx,bposy,bposz;
569
    int flags;
619 terminx 570
    intptr_t temp_data[10]; // sometimes used to hold pointers to con code
5 Plagman 571
    short picnum,ang,extra,owner,movflag;
572
    short tempang,actorstayput,dispicnum;
573
    short timetosleep;
616 terminx 574
    char cgg;
855 terminx 575
    projectile_t projectile;
580 terminx 576
} actordata_t;
5 Plagman 577
 
580 terminx 578
extern actordata_t hittype[MAXSPRITES];
5 Plagman 579
 
580
extern input loc;
581
extern input recsync[RECSYNCBUFSIZ];
584 terminx 582
extern int avgfvel, avgsvel, avgavel, avghorz, avgbits, avgextbits;
5 Plagman 583
 
584 terminx 584
extern int numplayers, myconnectindex;
585
extern int connecthead, connectpoint2[MAXPLAYERS];   //Player linked list variables (indeces, not connection numbers)
593 plagman 586
extern int screenpeek;
5 Plagman 587
 
588
extern int current_menu;
584 terminx 589
extern int tempwallptr,animatecnt;
618 terminx 590
extern int lockclock;
591
extern intptr_t frameplace;
5 Plagman 592
extern char display_mirror,loadfromgrouponly,rtsplaying;
593
 
584 terminx 594
extern int groupfile;
595
extern int ototalclock;
5 Plagman 596
 
709 qbix79 597
extern int *animateptr[MAXANIMATES];
618 terminx 598
extern int animategoal[MAXANIMATES];
584 terminx 599
extern int animatevel[MAXANIMATES];
600
// extern int oanimateval[MAXANIMATES];
5 Plagman 601
extern short neartagsector, neartagwall, neartagsprite;
584 terminx 602
extern int neartaghitdist;
5 Plagman 603
extern short animatesect[MAXANIMATES];
584 terminx 604
extern int movefifoplc, vel,svel,angvel,horiz;
5 Plagman 605
 
606
extern short mirrorwall[64], mirrorsector[64], mirrorcnt;
607
 
608
#define NUMKEYS 19
609
 
610
#include "funct.h"
611
 
444 terminx 612
extern int screencapt;
11 terminx 613
extern char volume_names[MAXVOLUMES][33];
5 Plagman 614
extern char skill_names[5][33];
615
 
193 terminx 616
extern int framerate;
617
 
381 terminx 618
#define MAXGAMETYPES 16
5 Plagman 619
extern char gametype_names[MAXGAMETYPES][33];
620
extern int gametype_flags[MAXGAMETYPES];
621
extern char num_gametypes;
622
 
623
enum gametypeflags {
624
    GAMETYPE_FLAG_COOP                   = 1,
625
    GAMETYPE_FLAG_WEAPSTAY               = 2,
626
    GAMETYPE_FLAG_FRAGBAR                = 4,
627
    GAMETYPE_FLAG_SCORESHEET             = 8,
628
    GAMETYPE_FLAG_DMSWITCHES             = 16,
629
    GAMETYPE_FLAG_COOPSPAWN              = 32,
630
    GAMETYPE_FLAG_ACCESSCARDSPRITES      = 64,
631
    GAMETYPE_FLAG_COOPVIEW               = 128,
632
    GAMETYPE_FLAG_COOPSOUND              = 256,
633
    GAMETYPE_FLAG_OTHERPLAYERSINMAP      = 512,
634
    GAMETYPE_FLAG_ITEMRESPAWN            = 1024,
635
    GAMETYPE_FLAG_MARKEROPTION           = 2048,
636
    GAMETYPE_FLAG_PLAYERSFRIENDLY        = 4096,
637
    GAMETYPE_FLAG_FIXEDRESPAWN           = 8192,
638
    GAMETYPE_FLAG_ACCESSATSTART          = 16384,
268 terminx 639
    GAMETYPE_FLAG_PRESERVEINVENTORYDEATH = 32768,
640
        GAMETYPE_FLAG_TDM                                        = 65536,
641
        GAMETYPE_FLAG_TDMSPAWN                           = 131072
5 Plagman 642
};
643
 
271 terminx 644
#define GTFLAGS(x) (gametype_flags[ud.coop] & x)
645
 
5 Plagman 646
extern char num_volumes;
647
 
482 terminx 648
extern int lastsavedpos;
444 terminx 649
extern int restorepalette;
509 terminx 650
extern int packetrate;
5 Plagman 651
 
584 terminx 652
extern int cachecount;
384 terminx 653
extern char boardfilename[BMAX_PATH],waterpal[768],slimepal[768],titlepal[768],drealms[768],endingpal[768],animpal[768];
5 Plagman 654
extern char cachedebug,earthquaketime;
528 terminx 655
extern int networkmode;
5 Plagman 656
extern char lumplockbyte[11];
657
 
658
//DUKE3D.H - replace the end "my's" with this
584 terminx 659
extern int myx, omyx, myxvel, myy, omyy, myyvel, myz, omyz, myzvel;
5 Plagman 660
extern short myhoriz, omyhoriz, myhorizoff, omyhorizoff, globalskillsound;
661
extern short myang, omyang, mycursectnum, myjumpingcounter;
662
extern char myjumpingtoggle, myonground, myhardlanding,myreturntocenter;
584 terminx 663
extern int fakemovefifoplc;
664
extern int myxbak[MOVEFIFOSIZ], myybak[MOVEFIFOSIZ], myzbak[MOVEFIFOSIZ];
665
extern int myhorizbak[MOVEFIFOSIZ];
5 Plagman 666
extern short myangbak[MOVEFIFOSIZ];
667
 
668
extern short weaponsandammosprites[15];
669
 
670
//DUKE3D.H:
671
typedef struct {
616 terminx 672
    short got_access, last_extra, shield_amount, curr_weapon, holoduke_on;
5 Plagman 673
    short firstaid_amount, steroids_amount, holoduke_amount, jetpack_amount;
674
    short heat_amount, scuba_amount, boot_amount;
675
    short last_weapon, weapon_pos, kickback_pic;
616 terminx 676
    short ammo_amount[MAX_WEAPONS], frag[MAXPLAYERS];
677
    char inven_icon, jetpack_on, heat_on, gotweapon[MAX_WEAPONS];
5 Plagman 678
} STATUSBARTYPE;
679
 
680
extern STATUSBARTYPE sbar;
584 terminx 681
extern int cameradist, cameraclock, dukefriction,show_shareware;
528 terminx 682
extern int networkmode, movesperpacket;
683
extern int gamequit;
5 Plagman 684
 
528 terminx 685
extern char pus,pub;
686
extern int camerashitable,freezerhurtowner,lasermode;
563 terminx 687
extern char syncstat;
5 Plagman 688
extern signed char multiwho, multipos, multiwhat, multiflag;
584 terminx 689
extern int syncvaltail, syncvaltottail;
690
extern int numfreezebounces,rpgblastradius,pipebombblastradius,tripbombblastradius,shrinkerblastradius,morterblastradius,bouncemineblastradius,seenineblastradius;
528 terminx 691
extern int everyothertime;
584 terminx 692
extern int mymaxlag, otherminlag, bufferjitter;
5 Plagman 693
 
584 terminx 694
extern int numinterpolations, startofdynamicinterpolations;
709 qbix79 695
extern int oldipos[MAXINTERPOLATIONS];
696
extern int bakipos[MAXINTERPOLATIONS];
697
extern int *curipos[MAXINTERPOLATIONS];
5 Plagman 698
 
699
extern short numclouds,clouds[128],cloudx[128],cloudy[128];
584 terminx 700
extern int cloudtotalclock,totalmemory;
5 Plagman 701
 
584 terminx 702
extern int stereomode, stereowidth, stereopixelwidth;
5 Plagman 703
 
584 terminx 704
extern int myaimmode, myaimstat, omyaimstat;
5 Plagman 705
 
706
#define IFISGLMODE if (getrendermode() >= 3)
707
#define IFISSOFTMODE if (getrendermode() < 3)
708
 
709
#define TILE_SAVESHOT (MAXTILES-1)
710
#define TILE_LOADSHOT (MAXTILES-3)
711
#define TILE_TILT     (MAXTILES-2)
712
#define TILE_ANIM     (MAXTILES-4)
713
#define TILE_VIEWSCR  (MAXTILES-5)
714
 
715
enum events {
716
    EVENT_INIT,
717
    EVENT_ENTERLEVEL,
718
    EVENT_RESETWEAPONS,
719
    EVENT_RESETINVENTORY,
720
    EVENT_HOLSTER,
721
    EVENT_LOOKLEFT,
722
    EVENT_LOOKRIGHT,
723
    EVENT_SOARUP,
724
    EVENT_SOARDOWN,
725
    EVENT_CROUCH,
726
    EVENT_JUMP,
727
    EVENT_RETURNTOCENTER,
728
    EVENT_LOOKUP,
729
    EVENT_LOOKDOWN,
730
    EVENT_AIMUP,
731
    EVENT_FIRE,
732
    EVENT_CHANGEWEAPON,
733
    EVENT_GETSHOTRANGE,
734
    EVENT_GETAUTOAIMANGLE,
735
    EVENT_GETLOADTILE,
736
    EVENT_CHEATGETSTEROIDS,
737
    EVENT_CHEATGETHEAT,
738
    EVENT_CHEATGETBOOT,
739
    EVENT_CHEATGETSHIELD,
740
    EVENT_CHEATGETSCUBA,
741
    EVENT_CHEATGETHOLODUKE,
742
    EVENT_CHEATGETJETPACK,
743
    EVENT_CHEATGETFIRSTAID,
744
    EVENT_QUICKKICK,
745
    EVENT_INVENTORY,
746
    EVENT_USENIGHTVISION,
747
    EVENT_USESTEROIDS,
748
    EVENT_INVENTORYLEFT,
749
    EVENT_INVENTORYRIGHT,
750
    EVENT_HOLODUKEON,
751
    EVENT_HOLODUKEOFF,
752
    EVENT_USEMEDKIT,
753
    EVENT_USEJETPACK,
754
    EVENT_TURNAROUND,
755
    EVENT_DISPLAYWEAPON,
756
    EVENT_FIREWEAPON,
757
    EVENT_SELECTWEAPON,
758
    EVENT_MOVEFORWARD,
759
    EVENT_MOVEBACKWARD,
760
    EVENT_TURNLEFT,
761
    EVENT_TURNRIGHT,
762
    EVENT_STRAFELEFT,
763
    EVENT_STRAFERIGHT,
764
    EVENT_WEAPKEY1,
765
    EVENT_WEAPKEY2,
766
    EVENT_WEAPKEY3,
767
    EVENT_WEAPKEY4,
768
    EVENT_WEAPKEY5,
769
    EVENT_WEAPKEY6,
770
    EVENT_WEAPKEY7,
771
    EVENT_WEAPKEY8,
772
    EVENT_WEAPKEY9,
773
    EVENT_WEAPKEY10,
774
    EVENT_DRAWWEAPON,
775
    EVENT_DISPLAYCROSSHAIR,
776
    EVENT_DISPLAYREST,
492 terminx 777
    EVENT_DISPLAYSBAR,
5 Plagman 778
    EVENT_RESETPLAYER,
779
    EVENT_INCURDAMAGE,
780
    EVENT_AIMDOWN,
781
    EVENT_GAME,
782
    EVENT_PREVIOUSWEAPON,
783
    EVENT_NEXTWEAPON,
784
    EVENT_SWIMUP,
785
    EVENT_SWIMDOWN,
786
    EVENT_GETMENUTILE,
787
    EVENT_SPAWN,
788
    EVENT_LOGO,
789
    EVENT_EGS,
790
    EVENT_DOFIRE,
791
    EVENT_PRESSEDFIRE,
792
    EVENT_USE,
296 terminx 793
    EVENT_PROCESSINPUT,
521 terminx 794
    EVENT_FAKEDOMOVETHINGS,
587 terminx 795
    EVENT_DISPLAYROOMS,
599 terminx 796
    EVENT_KILLIT,
762 hnt_ts 797
        EVENT_LOADACTOR,
798
        EVENT_DISPLAYBONUSSCREEN,
799
        EVENT_DISPLAYMENU,
800
        EVENT_DISPLAYMENUREST,
853 terminx 801
        EVENT_DISPLAYLOADINGSCREEN,
861 terminx 802
    EVENT_ANIMATESPRITES,
5 Plagman 803
};
804
 
781 hnt_ts 805
enum sysstrs {
806
        STR_MAPNAME,
807
        STR_MAPFILENAME,
808
        STR_PLAYERNAME,
808 terminx 809
        STR_VERSION,
810
    STR_GAMETYPE
781 hnt_ts 811
};
812
 
5 Plagman 813
// store global game definitions
814
 
676 terminx 815
 
816
 
5 Plagman 817
enum gamevarflags {
680 terminx 818
    MAXGAMEVARS             = 2048,  // must be a power of two
5 Plagman 819
    MAXVARLABEL             = 26,
502 terminx 820
    GAMEVAR_FLAG_NORMAL     = 0,     // normal
821
    GAMEVAR_FLAG_PERPLAYER  = 1,     // per-player variable
822
    GAMEVAR_FLAG_PERACTOR   = 2,     // per-actor variable
5 Plagman 823
    GAMEVAR_FLAG_USER_MASK  = 3,
502 terminx 824
    GAMEVAR_FLAG_DEFAULT    = 256,   // allow override
825
    GAMEVAR_FLAG_SECRET     = 512,   // don't dump...
826
    GAMEVAR_FLAG_NODEFAULT  = 1024,  // don't reset on actor spawn
827
    GAMEVAR_FLAG_SYSTEM     = 2048,  // cannot change mode flags...(only default value)
828
    GAMEVAR_FLAG_READONLY   = 4096,  // values are read-only (no setvar allowed)
680 terminx 829
    GAMEVAR_FLAG_INTPTR     = 8192,  // plValue is a pointer to an int
502 terminx 830
    GAMEVAR_FLAG_SYNCCHECK  = 16384, // check event sync when translating
680 terminx 831
    GAMEVAR_FLAG_SHORTPTR   = 32768, // plValue is a pointer to a short
832
    GAMEVAR_FLAG_CHARPTR    = 65536, // plValue is a pointer to a char
862 terminx 833
    GAMEVAR_FLAG_NORESET    = 131072, // var values are not reset when restoring map state
5 Plagman 834
};
835
 
680 terminx 836
enum gamearrayflags {
837
    MAXGAMEARRAYS           = (MAXGAMEVARS>>2), // must be lower than MAXGAMEVARS
838
        MAXARRAYLABEL           = MAXVARLABEL,
839
    GAMEARRAY_FLAG_NORMAL   = 0,
840
    GAMEARRAY_FLAG_NORESET  = 1,
841
};
842
 
5 Plagman 843
typedef struct {
619 terminx 844
    intptr_t lValue;
845
    intptr_t lDefault;
846
    intptr_t *plValues;     // array of values when 'per-player', or 'per-actor'
616 terminx 847
    unsigned int dwFlags;
102 terminx 848
    char *szLabel;
580 terminx 849
    char bReset;
850
} gamevar_t;
680 terminx 851
 
676 terminx 852
typedef struct {
853
    char *szLabel;
693 terminx 854
    int *plValues;     // array of values
676 terminx 855
        int size;
856
    char bReset;
857
} gamearray_t;
680 terminx 858
 
580 terminx 859
extern gamevar_t aGameVars[MAXGAMEVARS];
676 terminx 860
extern gamearray_t aGameArrays[MAXGAMEARRAYS];
5 Plagman 861
extern int iGameVarCount;
676 terminx 862
extern int iGameArrayCount;
5 Plagman 863
 
580 terminx 864
extern int spriteflags[MAXTILES];
5 Plagman 865
 
866
enum spriteflags {
867
    SPRITE_FLAG_SHADOW       = 1,
868
    SPRITE_FLAG_NVG          = 2,
869
    SPRITE_FLAG_NOSHADE      = 4,
870
    SPRITE_FLAG_PROJECTILE   = 8,
871
    SPRITE_FLAG_DECAL        = 16,
582 terminx 872
    SPRITE_FLAG_BADGUY       = 32,
873
    SPRITE_FLAG_NOPAL        = 64
5 Plagman 874
};
875
 
876
extern short spritecache[MAXTILES][3];
877
 
878
extern int g_iReturnVarID;
879
extern int g_iWeaponVarID;
880
extern int g_iWorksLikeVarID;
881
extern int g_iZRangeVarID;
882
extern int g_iAngRangeVarID;
883
extern int g_iAimAngleVarID;
884
extern int g_iLoTagID;          // var ID of "LOTAG"
885
extern int g_iHiTagID;          // ver ID of "HITAG"
886
extern int g_iTextureID;        // ver ID of "TEXTURE"
887
 
888
extern char g_bEnhanced;    // are we 'enhanced' (more minerals, etc)
889
 
890
extern char g_szBuf[1024];
891
 
892
#define NAM_GRENADE_LIFETIME    120
893
#define NAM_GRENADE_LIFETIME_VAR    30
894
 
794 qbix79 895
extern intptr_t *aplWeaponClip[MAX_WEAPONS];            // number of items in clip
896
extern intptr_t *aplWeaponReload[MAX_WEAPONS];          // delay to reload (include fire)
897
extern intptr_t *aplWeaponFireDelay[MAX_WEAPONS];       // delay to fire
898
extern intptr_t *aplWeaponHoldDelay[MAX_WEAPONS];       // delay after release fire button to fire (0 for none)
899
extern intptr_t *aplWeaponTotalTime[MAX_WEAPONS];       // The total time the weapon is cycling before next fire.
900
extern intptr_t *aplWeaponFlags[MAX_WEAPONS];           // Flags for weapon
901
extern intptr_t *aplWeaponShoots[MAX_WEAPONS];          // what the weapon shoots
902
extern intptr_t *aplWeaponSpawnTime[MAX_WEAPONS];       // the frame at which to spawn an item
903
extern intptr_t *aplWeaponSpawn[MAX_WEAPONS];           // the item to spawn
904
extern intptr_t *aplWeaponShotsPerBurst[MAX_WEAPONS];   // number of shots per 'burst' (one ammo per 'burst'
905
extern intptr_t *aplWeaponWorksLike[MAX_WEAPONS];       // What original the weapon works like
906
extern intptr_t *aplWeaponInitialSound[MAX_WEAPONS];    // Sound made when initialy firing. zero for no sound
907
extern intptr_t *aplWeaponFireSound[MAX_WEAPONS];       // Sound made when firing (each time for automatic)
908
extern intptr_t *aplWeaponSound2Time[MAX_WEAPONS];      // Alternate sound time
909
extern intptr_t *aplWeaponSound2Sound[MAX_WEAPONS];     // Alternate sound sound ID
910
extern intptr_t *aplWeaponReloadSound1[MAX_WEAPONS];    // Sound of magazine being removed
911
extern intptr_t *aplWeaponReloadSound2[MAX_WEAPONS];    // Sound of magazine being inserted
5 Plagman 912
 
913
extern short timer;
914
 
915
enum weaponflags {
916
    WEAPON_FLAG_HOLSTER_CLEARS_CLIP = 1,     // 'holstering' clears the current clip
917
    WEAPON_FLAG_GLOWS               = 2,     // weapon 'glows' (shrinker and grower)
918
    WEAPON_FLAG_AUTOMATIC           = 4,     // automatic fire (continues while 'fire' is held down
919
    WEAPON_FLAG_FIREEVERYOTHER      = 8,     // during 'hold time' fire every frame
920
    WEAPON_FLAG_FIREEVERYTHIRD      = 16,    // during 'hold time' fire every third frame
921
    WEAPON_FLAG_RANDOMRESTART       = 32,    // restart for automatic is 'randomized' by RND 3
922
    WEAPON_FLAG_AMMOPERSHOT         = 64,    // uses ammo for each shot (for automatic)
923
    WEAPON_FLAG_BOMB_TRIGGER        = 128,   // weapon is the 'bomb' trigger
924
    WEAPON_FLAG_NOVISIBLE           = 256,   // weapon use does not cause user to become 'visible'
925
    WEAPON_FLAG_THROWIT             = 512,   // weapon 'throws' the 'shoots' item...
926
    WEAPON_FLAG_CHECKATRELOAD       = 1024,  // check weapon availability at 'reload' time
927
    WEAPON_FLAG_STANDSTILL          = 2048,  // player stops jumping before actual fire (like tripbomb in duke)
928
    WEAPON_FLAG_SPAWNTYPE1          = 0,     // just spawn
929
    WEAPON_FLAG_SPAWNTYPE2          = 4096,  // spawn like shotgun shells
930
    WEAPON_FLAG_SPAWNTYPE3          = 8192,  // spawn like chaingun shells
931
    WEAPON_FLAG_SEMIAUTO            = 16384, // cancel button press after each shot
166 terminx 932
    WEAPON_FLAG_RELOAD_TIMING       = 32768, // special casing for pistol reload sounds
933
    WEAPON_FLAG_RESET               = 65536  // cycle weapon back to frame 1 if fire is held, 0 if not
5 Plagman 934
};
935
 
936
#define TRIPBOMB_TRIPWIRE           1
937
#define TRIPBOMB_TIMER              2
938
 
939
#define PIPEBOMB_REMOTE             1
940
#define PIPEBOMB_TIMER              2
941
 
942
// custom projectiles
943
 
944
enum projectileflags {
11 terminx 945
    PROJECTILE_FLAG_HITSCAN             = 1,
5 Plagman 946
    PROJECTILE_FLAG_RPG                 = 2,
947
    PROJECTILE_FLAG_BOUNCESOFFWALLS     = 4,
948
    PROJECTILE_FLAG_BOUNCESOFFMIRRORS   = 8,
949
    PROJECTILE_FLAG_KNEE                = 16,
950
    PROJECTILE_FLAG_WATERBUBBLES        = 32,
951
    PROJECTILE_FLAG_TIMED               = 64,
11 terminx 952
    PROJECTILE_FLAG_BOUNCESOFFSPRITES   = 128,
5 Plagman 953
    PROJECTILE_FLAG_SPIT                = 256,
954
    PROJECTILE_FLAG_COOLEXPLOSION1      = 512,
955
    PROJECTILE_FLAG_BLOOD               = 1024,
956
    PROJECTILE_FLAG_LOSESVELOCITY       = 2048,
957
    PROJECTILE_FLAG_NOAIM               = 4096,
958
    PROJECTILE_FLAG_RANDDECALSIZE       = 8192,
959
    PROJECTILE_FLAG_EXPLODEONTIMER      = 16384,
317 terminx 960
    PROJECTILE_FLAG_RPG_IMPACT          = 32768,
485 terminx 961
    PROJECTILE_FLAG_RADIUS_PICNUM       = 65536,
587 terminx 962
    PROJECTILE_FLAG_ACCURATE_AUTOAIM    = 131072,
963
    PROJECTILE_FLAG_FORCEIMPACT         = 262144
5 Plagman 964
};
965
 
855 terminx 966
extern projectile_t projectile[MAXTILES], defaultprojectile[MAXTILES];
5 Plagman 967
 
968
// logo control
969
 
970
enum logoflags {
971
    LOGO_FLAG_ENABLED           = 1,
972
    LOGO_FLAG_PLAYANIM          = 2,
973
    LOGO_FLAG_PLAYMUSIC         = 4,
974
    LOGO_FLAG_3DRSCREEN         = 8,
975
    LOGO_FLAG_TITLESCREEN       = 16,
976
    LOGO_FLAG_DUKENUKEM         = 32,
977
    LOGO_FLAG_THREEDEE          = 64,
559 terminx 978
    LOGO_FLAG_PLUTOPAKSPRITE    = 128,
979
        LOGO_FLAG_SHAREWARESCREENS      = 256,
980
        LOGO_FLAG_TENSCREEN                     = 512
5 Plagman 981
};
982
 
564 terminx 983
extern int g_NumPalettes;
984
extern int g_ScriptDebug;
5 Plagman 985
 
105 terminx 986
#define MAXCHEATLEN 20
855 terminx 987
#define NUMCHEATCODES (signed int)(sizeof(cheatstrings)/sizeof(cheatstrings[0]))
105 terminx 988
 
5 Plagman 989
extern char cheatkey[2];
855 terminx 990
extern char cheatstrings[][MAXCHEATLEN];
5 Plagman 991
 
992
extern short weapon_sprites[MAX_WEAPONS];
993
 
105 terminx 994
extern int redefined_quote_count;
995
 
360 terminx 996
extern char setupfilename[BMAX_PATH];
997
 
562 terminx 998
typedef struct {
859 terminx 999
// this needs to have a copy of everything related to the map/actor state
1000
// see savegame.c
1001
    short numwalls;
1002
    walltype wall[MAXWALLS];
1003
    short numsectors;
1004
    sectortype sector[MAXSECTORS];
1005
    spritetype sprite[MAXSPRITES];
1006
    spriteexttype spriteext[MAXSPRITES];
1007
    short headspritesect[MAXSECTORS+1];
1008
    short prevspritesect[MAXSPRITES];
1009
    short nextspritesect[MAXSPRITES];
1010
    short headspritestat[MAXSTATUS+1];
1011
    short prevspritestat[MAXSPRITES];
1012
    short nextspritestat[MAXSPRITES];
1013
    short numcyclers;
1014
    short cyclers[MAXCYCLERS][6];
1015
    playerspawn_t g_PlayerSpawnPoints[MAXPLAYERS];
1016
    short numanimwalls;
1017
    short spriteq[1024],spriteqloc;
1018
    animwalltype animwall[MAXANIMWALLS];
1019
    int msx[2048], msy[2048];
1020
    short mirrorwall[64], mirrorsector[64], mirrorcnt;
1021
    char show2dsector[(MAXSECTORS+7)>>3];
1022
    short numclouds,clouds[128],cloudx[128],cloudy[128];
1023
    actordata_t hittype[MAXSPRITES];
1024
    short pskyoff[MAXPSKYTILES], pskybits;
1025
 
1026
    int animategoal[MAXANIMATES], animatevel[MAXANIMATES], animatecnt;
1027
    short animatesect[MAXANIMATES];
1028
    int animateptr[MAXANIMATES];
1029
    char numplayersprites;
1030
    char earthquaketime;
1031
    int lockclock;
1032
    int randomseed, global_random;
860 terminx 1033
    char scriptptrs[MAXSPRITES];
862 terminx 1034
    intptr_t *vars[MAXGAMEVARS];
859 terminx 1035
} mapstate_t;
1036
 
1037
typedef struct {
616 terminx 1038
        int partime, designertime;
634 terminx 1039
        char *name, *filename, *musicfn, *musicfn1;
859 terminx 1040
    mapstate_t *savedstate;
562 terminx 1041
} map_t;
1042
 
634 terminx 1043
extern map_t map[(MAXVOLUMES+1)*MAXLEVELS]; // +1 volume for "intro", "briefing" music
562 terminx 1044
 
563 terminx 1045
typedef struct {
564 terminx 1046
        player_struct *ps;
1047
        input *sync;
563 terminx 1048
 
616 terminx 1049
        int movefifoend, syncvalhead, myminlag;
1050
        int pcolor, pteam, frags[MAXPLAYERS], wchoice[MAX_WEAPONS];
563 terminx 1051
 
616 terminx 1052
        char vote, gotvote, playerreadyflag, playerquitflag;
1053
        char user_name[32], syncval[MOVEFIFOSIZ];
563 terminx 1054
} playerdata_t;
1055
 
1056
extern input inputfifo[MOVEFIFOSIZ][MAXPLAYERS];
581 terminx 1057
extern playerspawn_t g_PlayerSpawnPoints[MAXPLAYERS];
563 terminx 1058
extern playerdata_t g_player[MAXPLAYERS];
1059
#include "funct.h"
1060
 
591 plagman 1061
// key bindings stuff
1062
typedef struct {
1063
    char *name;
1064
    int id;
1065
} keydef;
1066
 
1067
extern keydef keynames[];
826 terminx 1068
extern char *mousenames[];
591 plagman 1069
 
5 Plagman 1070
#ifdef __cplusplus
1071
}
1072
#endif