Subversion Repositories eduke32

Rev

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