Franklin Wei | a855d62 | 2017-01-21 15:18:31 -0500 | [diff] [blame] | 1 | //------------------------------------------------------------------------- |
| 2 | /* |
| 3 | Copyright (C) 1996, 2003 - 3D Realms Entertainment |
| 4 | |
| 5 | This file is part of Duke Nukem 3D version 1.5 - Atomic Edition |
| 6 | |
| 7 | Duke Nukem 3D is free software; you can redistribute it and/or |
| 8 | modify it under the terms of the GNU General Public License |
| 9 | as published by the Free Software Foundation; either version 2 |
| 10 | of the License, or (at your option) any later version. |
| 11 | |
| 12 | This program is distributed in the hope that it will be useful, |
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 15 | |
| 16 | See the GNU General Public License for more details. |
| 17 | |
| 18 | You should have received a copy of the GNU General Public License |
| 19 | aint32_t with this program; if not, write to the Free Software |
| 20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 21 | |
| 22 | Original Source: 1996 - Todd Replogle |
| 23 | Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms |
| 24 | */ |
| 25 | //------------------------------------------------------------------------- |
| 26 | #ifndef _INCL_DUKE3D_H_ |
| 27 | #define _INCL_DUKE3D_H_ |
| 28 | |
| 29 | #include "platform.h" |
| 30 | |
Franklin Wei | a855d62 | 2017-01-21 15:18:31 -0500 | [diff] [blame] | 31 | #include <inttypes.h> |
Franklin Wei | a855d62 | 2017-01-21 15:18:31 -0500 | [diff] [blame] | 32 | |
| 33 | #include <fcntl.h> |
| 34 | #include <time.h> |
| 35 | #include <ctype.h> |
| 36 | |
| 37 | #include "../../Engine/src/build.h" |
| 38 | |
| 39 | #if (!defined MAX_PATH) |
| 40 | #if (defined MAXPATHLEN) |
| 41 | #define MAX_PATH MAXPATHLEN |
| 42 | #elif (defined PATH_MAX) |
| 43 | #define MAX_PATH PATH_MAX |
| 44 | #else |
| 45 | #define MAX_PATH 256 |
| 46 | #endif |
| 47 | #endif |
| 48 | |
Franklin Wei | a855d62 | 2017-01-21 15:18:31 -0500 | [diff] [blame] | 49 | #ifdef ROCKBOX |
| 50 | #define PLATFORM_ROCKBOX 1 |
| 51 | #endif |
| 52 | |
| 53 | #if PLATFORM_ROCKBOX |
| 54 | #include "dukerockbox.h" |
| 55 | #endif |
| 56 | |
| 57 | #if USE_SDL |
| 58 | #include "SDL.h" |
| 59 | #include "SDL_mixer.h" |
| 60 | #endif |
| 61 | |
| 62 | #include "function.h" |
| 63 | |
| 64 | // FIX_00022: Automatically recognize the shareware grp (v1.3) + full version (1.3d) + |
| 65 | // atomic (1.4/1.5 grp) and the con files version (either 1.3 or 1.4) (JonoF's idea) |
| 66 | |
| 67 | extern uint8_t conVersion; |
| 68 | extern uint8_t grpVersion; |
| 69 | |
| 70 | |
| 71 | #define RANCID_ID 1 |
| 72 | #define XDUKE_ID 2 |
| 73 | #define JONOF_ID 3 |
| 74 | |
| 75 | //Chocolate DukeNukem3D is a fork of xDuke v17.9 |
| 76 | |
| 77 | #define DUKE_ID XDUKE_ID |
| 78 | #define CHOCOLATE_DUKE_REV_X 1 |
| 79 | #define CHOCOLATE_DUKE_REV_DOT_Y 0 // rev is: CHOCOLATE_DUKE_REV_X.CHOCOLATE_DUKE_REV_DOT_Y |
| 80 | |
| 81 | #define MAX_KNOWN_GRP 4 |
| 82 | |
| 83 | enum |
| 84 | { |
| 85 | UNKNOWN_GRP = 0, |
| 86 | SHAREWARE_GRP13, |
| 87 | REGULAR_GRP13D, |
| 88 | ATOMIC_GRP14_15, |
| 89 | DUKEITOUTINDC_GRP |
| 90 | }; |
| 91 | |
| 92 | #define CRC_BASE_GRP_SHAREWARE_13 0x983AD923 |
| 93 | #define CRC_BASE_GRP_FULL_13 0xBBC9CE44 |
| 94 | #define CRC_BASE_GRP_PLUTONIUM_14 0xF514A6AC |
| 95 | #define CRC_BASE_GRP_ATOMIC_15 0xFD3DCFF1 |
| 96 | |
| 97 | // implies conVersion == 14 or conVersion == 15 |
| 98 | #define PLUTOPAK (!VOLUMEONE && !VOLUMEALL) |
| 99 | #define VOLUMEONE (getGRPcrc32(0)==CRC_BASE_GRP_SHAREWARE_13) |
| 100 | // VOLUMEALL = 1.3d full |
| 101 | #define VOLUMEALL (getGRPcrc32(0)==CRC_BASE_GRP_FULL_13 || (conVersion == 13 && getGRPcrc32(0)!=CRC_BASE_GRP_SHAREWARE_13 && getGRPcrc32(0)!=CRC_BASE_GRP_PLUTONIUM_14 && getGRPcrc32(0)!=CRC_BASE_GRP_ATOMIC_15)) |
| 102 | |
| 103 | #define SCREENSHOTPATH "screenshots" |
| 104 | |
| 105 | |
| 106 | |
| 107 | // #define TEN |
| 108 | // #define BETA |
| 109 | |
| 110 | // #define AUSTRALIA |
| 111 | |
| 112 | #define MAXSLEEPDIST 16384 |
| 113 | #define SLEEPTIME 24*64 |
| 114 | |
| 115 | extern int BYTEVERSION; |
| 116 | |
| 117 | extern int BYTEVERSION_27; |
| 118 | extern int BYTEVERSION_28; |
| 119 | extern int BYTEVERSION_29; // really needed??? |
| 120 | extern int BYTEVERSION_116; |
| 121 | extern int BYTEVERSION_117; |
| 122 | extern int BYTEVERSION_118; |
| 123 | extern int BYTEVERSION_1_3; |
| 124 | |
| 125 | |
| 126 | #define NUMPAGES 1 |
| 127 | |
| 128 | #define AUTO_AIM_ANGLE 48 |
| 129 | #define RECSYNCBUFSIZ 2520 //2520 is the (LCM of 1-8)*3 |
| 130 | #define MOVEFIFOSIZ 256 |
| 131 | |
| 132 | #define FOURSLEIGHT (1<<8) |
| 133 | |
| 134 | struct player_struct; |
| 135 | |
| 136 | #include "../../Game/src/types.h" |
| 137 | #include "file_lib.h" |
| 138 | #include "develop.h" |
| 139 | #include "gamedefs.h" |
| 140 | #include "keyboard.h" |
| 141 | #include "util_lib.h" |
| 142 | #include "function.h" |
| 143 | #include "audiolib/fx_man.h" |
| 144 | #include "config.h" |
| 145 | #include "sounds.h" |
| 146 | #include "control.h" |
| 147 | #include "_rts.h" |
| 148 | #include "rts.h" |
| 149 | #include "soundefs.h" |
| 150 | |
| 151 | #include "audiolib/music.h" |
| 152 | |
| 153 | #include "names.h" |
| 154 | |
| 155 | #include "../../Engine/src/engine.h" |
| 156 | #include "../../Engine/src/fixedPoint_math.h" |
| 157 | |
| 158 | //#define TICRATE (120) |
| 159 | //#define TICSPERFRAME (TICRATE/26) |
| 160 | |
| 161 | extern int g_iTickRate; |
| 162 | extern int g_iTicksPerFrame; |
| 163 | |
| 164 | #define TICRATE g_iTickRate |
| 165 | #define TICSPERFRAME (TICRATE/g_iTicksPerFrame) |
| 166 | |
| 167 | // #define GC (TICSPERFRAME*44) |
| 168 | |
| 169 | #define NUM_SOUNDS 450 |
| 170 | |
| 171 | #define ALT_IS_PRESSED ( KB_KeyPressed( sc_RightAlt ) || KB_KeyPressed( sc_LeftAlt ) ) |
| 172 | #define SHIFTS_IS_PRESSED ( KB_KeyPressed( sc_RightShift ) || KB_KeyPressed( sc_LeftShift ) ) |
| 173 | #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) |
| 174 | |
| 175 | #define BLACK 0 |
| 176 | #define DARKBLUE 1 |
| 177 | #define DARKGREEN 2 |
| 178 | #define DARKCYAN 3 |
| 179 | #define DARKRED 4 |
| 180 | #define DARKPURPLE 5 |
| 181 | #define BROWN 6 |
| 182 | #define LIGHTGRAY 7 |
| 183 | |
| 184 | #define DARKGRAY 8 |
| 185 | #define BLUE 9 |
| 186 | #define GREEN 10 |
| 187 | #define CYAN 11 |
| 188 | #define RED 12 |
| 189 | #define PURPLE 13 |
| 190 | #define YELLOW 14 |
| 191 | #define WHITE 15 |
| 192 | |
| 193 | #define PHEIGHT (38<<8) |
| 194 | |
| 195 | #define WAIT(X) ototalclock=totalclock+(X);while(totalclock<ototalclock) |
| 196 | |
| 197 | |
| 198 | #define MODE_MENU 1 |
| 199 | #define MODE_DEMO 2 |
| 200 | #define MODE_GAME 4 |
| 201 | #define MODE_EOL 8 |
| 202 | #define MODE_TYPE 16 |
| 203 | #define MODE_RESTART 32 |
| 204 | #define MODE_SENDTOWHOM 64 |
| 205 | #define MODE_END 128 |
| 206 | |
| 207 | |
| 208 | #define MAXANIMWALLS 512 |
| 209 | #define MAXINTERPOLATIONS 2048 |
| 210 | #define NUMOFFIRSTTIMEACTIVE 192 |
| 211 | |
| 212 | #define MAXCYCLERS 256 |
| 213 | #define MAXSCRIPTSIZE 20460 |
| 214 | #define MAXANIMATES 64 |
| 215 | |
| 216 | #define SP sprite[i].yvel |
| 217 | #define SX sprite[i].x |
| 218 | #define SY sprite[i].y |
| 219 | #define SZ sprite[i].z |
| 220 | #define SS sprite[i].shade |
| 221 | #define PN sprite[i].picnum |
| 222 | #define SA sprite[i].ang |
| 223 | #define SV sprite[i].xvel |
| 224 | #define ZV sprite[i].zvel |
| 225 | #define RX sprite[i].xrepeat |
| 226 | #define RY sprite[i].yrepeat |
| 227 | #define OW sprite[i].owner |
| 228 | #define CS sprite[i].cstat |
| 229 | #define SH sprite[i].extra |
| 230 | #define CX sprite[i].xoffset |
| 231 | #define CY sprite[i].yoffset |
| 232 | #define CD sprite[i].clipdist |
| 233 | #define PL sprite[i].pal |
| 234 | #define SLT sprite[i].lotag |
| 235 | #define SHT sprite[i].hitag |
| 236 | #define SECT sprite[i].sectnum |
| 237 | |
| 238 | #define face_player 1 |
| 239 | #define geth 2 |
| 240 | #define getv 4 |
| 241 | #define random_angle 8 |
| 242 | #define face_player_slow 16 |
| 243 | #define spin 32 |
| 244 | #define face_player_smart 64 |
| 245 | #define fleeenemy 128 |
| 246 | #define jumptoplayer 257 |
| 247 | #define seekplayer 512 |
| 248 | #define furthestdir 1024 |
| 249 | #define dodgebullet 4096 |
| 250 | |
| 251 | #define TRAND krand() |
| 252 | |
| 253 | #define MAX_WEAPONS 12 |
| 254 | |
| 255 | #define KNEE_WEAPON 0 |
| 256 | #define PISTOL_WEAPON 1 |
| 257 | #define SHOTGUN_WEAPON 2 |
| 258 | #define CHAINGUN_WEAPON 3 |
| 259 | #define RPG_WEAPON 4 |
| 260 | #define HANDBOMB_WEAPON 5 |
| 261 | #define SHRINKER_WEAPON 6 |
| 262 | #define DEVISTATOR_WEAPON 7 |
| 263 | #define TRIPBOMB_WEAPON 8 |
| 264 | #define FREEZE_WEAPON 9 |
| 265 | #define HANDREMOTE_WEAPON 10 |
| 266 | #define GROW_WEAPON 11 |
| 267 | |
| 268 | #define T1 hittype[i].temp_data[0] |
| 269 | #define T2 hittype[i].temp_data[1] |
| 270 | #define T3 hittype[i].temp_data[2] |
| 271 | #define T4 hittype[i].temp_data[3] |
| 272 | #define T5 hittype[i].temp_data[4] |
| 273 | #define T6 hittype[i].temp_data[5] |
| 274 | |
| 275 | #define IFWITHIN(B,E) if((PN)>=(B) && (PN)<=(E)) |
| 276 | #define KILLIT(KX) {deletesprite(KX);goto BOLT;} |
| 277 | |
| 278 | |
| 279 | #define IFMOVING if(ssp(i,CLIPMASK0)) |
| 280 | #define IFHIT j=ifhitbyweapon(i);if(j >= 0) |
| 281 | #define IFHITSECT j=ifhitsectors(s->sectnum);if(j >= 0) |
| 282 | |
| 283 | #define AFLAMABLE(X) (X==BOX||X==TREE1||X==TREE2||X==TIRE||X==CONE) |
| 284 | |
| 285 | |
| 286 | #define IFSKILL1 if(player_skill<1) |
| 287 | #define IFSKILL2 if(player_skill<2) |
| 288 | #define IFSKILL3 if(player_skill<3) |
| 289 | #define IFSKILL4 if(player_skill<4) |
| 290 | |
| 291 | #define rnd(X) ((TRAND>>8)>=(255-(X))) |
| 292 | |
| 293 | typedef struct |
| 294 | { |
| 295 | short i; |
| 296 | int voice; |
| 297 | } SOUNDOWNER; |
| 298 | |
| 299 | #include "audiolib/usrhooks.h" |
| 300 | /* |
| 301 | |
| 302 | |
| 303 | #define __USRHOOKS_H |
| 304 | |
| 305 | enum USRHOOKS_Errors |
| 306 | { |
| 307 | USRHOOKS_Warning = -2, |
| 308 | USRHOOKS_Error = -1, |
| 309 | USRHOOKS_Ok = 0 |
| 310 | }; |
| 311 | */ |
| 312 | |
| 313 | #pragma pack(push) |
| 314 | #pragma pack(1) |
| 315 | |
| 316 | typedef struct |
| 317 | { |
| 318 | int8_t avel, horz; |
| 319 | short fvel, svel; |
| 320 | uint32_t bits; |
| 321 | } input; |
| 322 | |
| 323 | #pragma pack(pop) |
| 324 | |
| 325 | /* !!! FIXME: "sync" is defined in unistd.h ... :( --ryan. */ |
| 326 | #define sync duke_sync |
| 327 | extern input inputfifo[MOVEFIFOSIZ][MAXPLAYERS], sync[MAXPLAYERS]; |
| 328 | extern input recsync[RECSYNCBUFSIZ]; |
| 329 | |
| 330 | extern int32_t movefifosendplc; |
| 331 | |
| 332 | typedef struct |
| 333 | { |
| 334 | uint8_t *ptr; |
| 335 | uint8_t lock; |
| 336 | int length, num; |
| 337 | } SAMPLE; |
| 338 | |
| 339 | struct animwalltype |
| 340 | { |
| 341 | short wallnum; |
| 342 | int32_t tag; |
| 343 | }; |
| 344 | extern struct animwalltype animwall[MAXANIMWALLS]; |
| 345 | extern short numanimwalls,probey,lastprobey; |
| 346 | |
| 347 | char *mymembuf; |
| 348 | extern uint8_t typebuflen; |
| 349 | char typebuf[41]; |
| 350 | extern uint8_t MusicPtr[72000]; |
| 351 | extern int32_t msx[2048],msy[2048]; |
| 352 | extern short cyclers[MAXCYCLERS][6],numcyclers; |
| 353 | extern char myname[2048]; |
| 354 | |
| 355 | struct user_defs |
| 356 | { |
| 357 | uint8_t god,warp_on,cashman,eog,showallmap; |
| 358 | uint8_t show_help,scrollmode,clipping; |
| 359 | char user_name[MAXPLAYERS][32]; |
| 360 | char ridecule[10][40]; |
| 361 | char savegame[10][22]; |
| 362 | char pwlockout[128],rtsname[128]; |
| 363 | uint8_t overhead_on,last_overhead; |
| 364 | |
| 365 | short pause_on,from_bonus; |
| 366 | short camerasprite,last_camsprite; |
| 367 | short last_level,secretlevel; |
| 368 | |
| 369 | int32_t const_visibility,uw_framerate; |
| 370 | int32_t camera_time,folfvel,folavel,folx,foly,fola; |
| 371 | int32_t reccnt; |
| 372 | |
| 373 | int32 entered_name,screen_tilting,shadows,fta_on,executions,auto_run; |
| 374 | int32 coords,tickrate,m_coop,coop,screen_size,extended_screen_size,lockout,crosshair,showweapons; |
| 375 | int32 mywchoice[MAX_WEAPONS],wchoice[MAXPLAYERS][MAX_WEAPONS],playerai; |
| 376 | |
| 377 | int32 respawn_monsters,respawn_items,respawn_inventory,recstat,monsters_off,brightness; |
| 378 | int32 m_respawn_items,m_respawn_monsters,m_respawn_inventory,m_recstat,m_monsters_off,detail; |
| 379 | // FIX_00082: /q option taken off when playing a demo (multimode_bot) |
| 380 | int32 m_ffire,ffire,m_player_skill,m_level_number,m_volume_number,multimode,multimode_bot; |
| 381 | int32 player_skill,level_number,volume_number,m_marker,marker,mouseflip; |
| 382 | |
| 383 | int32 showcinematics, hideweapon; |
| 384 | int32 auto_aim, gitdat_mdk; //AutoAim toggle variable. |
| 385 | int32 weaponautoswitch; |
| 386 | |
| 387 | // FIX_00015: Backward compliance with older demos (down to demos v27, 28, 116 and 117 only) |
| 388 | uint8_t playing_demo_rev; |
| 389 | |
| 390 | uint32_t groupefil_crc32[MAXPLAYERS][4]; |
| 391 | uint16_t conSize[MAXPLAYERS]; |
| 392 | |
| 393 | #ifdef CHECK_XDUKE_REV |
| 394 | uint8_t rev[MAXPLAYERS][10]; |
| 395 | #endif |
| 396 | uint32_t mapCRC[MAXPLAYERS]; |
| 397 | uint32_t exeCRC[MAXPLAYERS]; |
| 398 | uint32_t conCRC[MAXPLAYERS]; |
| 399 | }; |
| 400 | |
| 401 | struct player_orig |
| 402 | { |
| 403 | int32_t ox,oy,oz; |
| 404 | short oa,os; |
| 405 | }; |
| 406 | |
| 407 | |
| 408 | extern uint8_t numplayersprites; |
| 409 | |
| 410 | |
| 411 | typedef struct |
| 412 | { |
| 413 | unsigned int crc32; |
| 414 | char * name; |
| 415 | uint32_t size; |
| 416 | } crc32_t; |
| 417 | |
| 418 | extern crc32_t crc32lookup[]; |
| 419 | |
| 420 | void add_ammo( short, short, short, short ); |
| 421 | |
| 422 | |
| 423 | extern int32_t fricxv,fricyv; |
| 424 | |
| 425 | struct player_struct |
| 426 | { |
| 427 | int32_t zoom,exitx,exity,loogiex[64],loogiey[64],numloogs,loogcnt; |
| 428 | int32_t posx, posy, posz, horiz, ohoriz, ohorizoff, invdisptime; |
| 429 | int32_t bobposx,bobposy,oposx,oposy,oposz,pyoff,opyoff; |
| 430 | int32_t posxv,posyv,poszv,last_pissed_time,truefz,truecz; |
| 431 | int32_t player_par,visibility; |
| 432 | int32_t bobcounter,weapon_sway; |
| 433 | int32_t pals_time,randomflamex,crack_time; |
| 434 | |
| 435 | int32 aim_mode; |
| 436 | |
| 437 | short ang,oang,angvel,cursectnum,look_ang,last_extra,subweapon; |
| 438 | short ammo_amount[MAX_WEAPONS],wackedbyactor,frag,fraggedself; |
| 439 | |
| 440 | short curr_weapon, last_weapon, tipincs, horizoff, wantweaponfire; |
| 441 | short holoduke_amount,newowner,hurt_delay,hbomb_hold_delay; |
| 442 | short jumping_counter,airleft,knee_incs,access_incs; |
| 443 | short fta,ftq,access_wallnum,access_spritenum; |
| 444 | short kickback_pic,got_access,weapon_ang,firstaid_amount; |
| 445 | short somethingonplayer,on_crane,i,one_parallax_sectnum; |
| 446 | short over_shoulder_on,random_club_frame,fist_incs; |
| 447 | short one_eighty_count,cheat_phase; |
| 448 | short dummyplayersprite,extra_extra8,quick_kick; |
| 449 | short heat_amount,actorsqu,timebeforeexit,customexitsound; |
| 450 | |
| 451 | short weaprecs[16],weapreccnt; |
| 452 | uint32_t interface_toggle_flag; |
| 453 | |
| 454 | short rotscrnang,dead_flag,show_empty_weapon; |
| 455 | short scuba_amount,jetpack_amount,steroids_amount,shield_amount; |
| 456 | short holoduke_on,pycount,weapon_pos,frag_ps; |
| 457 | short transporter_hold,last_full_weapon,footprintshade,boot_amount; |
| 458 | |
| 459 | int scream_voice; |
| 460 | |
| 461 | uint8_t gm,on_warping_sector,footprintcount; |
| 462 | uint8_t hbomb_on,jumping_toggle,rapid_fire_hold,on_ground; |
| 463 | uint8_t name[32],inven_icon,buttonpalette; |
| 464 | |
| 465 | uint8_t jetpack_on,spritebridge,lastrandomspot; |
| 466 | uint8_t scuba_on,footprintpal,heat_on; |
| 467 | |
| 468 | uint8_t holster_weapon,falling_counter; |
| 469 | uint8_t gotweapon[MAX_WEAPONS],refresh_inventory,*palette; |
| 470 | |
| 471 | uint8_t toggle_key_flag,knuckle_incs; // ,select_dir; |
| 472 | uint8_t walking_snd_toggle, palookup, hard_landing; |
| 473 | uint8_t max_secret_rooms,secret_rooms,/*fire_flag,*/pals[3]; |
| 474 | uint8_t max_actors_killed,actors_killed,return_to_center; |
| 475 | |
| 476 | // local but synch variables (ud is local but not synch): |
| 477 | |
| 478 | // FIX_00023: Moved Addfaz's autoaim handler to synch variables (to avoid out of synch) |
| 479 | int32 auto_aim; //AutoAim toggle variable. |
| 480 | |
| 481 | // FIX_00012: added "weapon autoswitch" toggle allowing to turn the autoswitch off |
| 482 | // when picking up new weapons. The weapon sound on pickup will remain on, to not |
| 483 | // affect the opponent's gameplay (so he can still hear you picking up new weapons) |
| 484 | int32 weaponautoswitch; |
| 485 | |
| 486 | uint8_t fakeplayer; |
| 487 | }; |
| 488 | |
| 489 | extern uint8_t tempbuf[2048]; |
| 490 | extern uint8_t packbuf[576]; |
| 491 | |
| 492 | extern int32_t gc,max_player_health,max_armour_amount,max_ammo_amount[MAX_WEAPONS]; |
| 493 | |
| 494 | extern int32_t impact_damage,respawnactortime,respawnitemtime; |
| 495 | |
| 496 | #define MOVFIFOSIZ 256 |
| 497 | |
| 498 | extern short spriteq[1024],spriteqloc,spriteqamount; |
| 499 | extern struct player_struct ps[MAXPLAYERS]; |
| 500 | extern struct player_orig po[MAXPLAYERS]; |
| 501 | extern struct user_defs ud; |
| 502 | |
Franklin Wei | a855d62 | 2017-01-21 15:18:31 -0500 | [diff] [blame] | 503 | extern short int global_random; |
| 504 | extern int32_t scaredfallz; |
| 505 | extern char buf[80]; //My own generic input buffer |
| 506 | |
| 507 | extern char fta_quotes[NUMOFFIRSTTIMEACTIVE][64]; |
| 508 | extern uint8_t scantoasc[128],ready2send; |
| 509 | extern uint8_t scantoascwithshift[128]; |
| 510 | |
| 511 | extern fx_device device; |
| 512 | extern SAMPLE Sound[ NUM_SOUNDS ]; |
| 513 | extern int32 VoiceToggle,AmbienceToggle, OpponentSoundToggle; |
| 514 | extern int32 mouseSensitivity_X, mouseSensitivity_Y; |
| 515 | extern SOUNDOWNER SoundOwner[NUM_SOUNDS][4]; |
| 516 | |
| 517 | extern uint8_t playerreadyflag[MAXPLAYERS],playerquitflag[MAXPLAYERS]; |
| 518 | extern char sounds[NUM_SOUNDS][14]; |
| 519 | |
| 520 | extern int32_t script[MAXSCRIPTSIZE],*scriptptr,*insptr,*labelcode,labelcnt; |
| 521 | extern char *label,*textptr,error,warning; |
| 522 | extern uint8_t killit_flag; |
| 523 | extern int32_t *actorscrptr[MAXTILES],*parsing_actor; |
| 524 | extern uint8_t actortype[MAXTILES]; |
| 525 | extern uint8_t *music_pointer; |
| 526 | |
| 527 | extern uint8_t ipath[80],opath[80]; |
| 528 | |
| 529 | extern char music_fn[4][11][13]; |
| 530 | extern uint8_t music_select; |
| 531 | extern char env_music_fn[4][13]; |
| 532 | extern short camsprite; |
| 533 | |
| 534 | // extern uint8_t gotz; |
| 535 | extern uint8_t inspace(short sectnum); |
| 536 | |
| 537 | |
| 538 | struct weaponhit |
| 539 | { |
| 540 | uint8_t cgg; |
| 541 | short picnum,ang,extra,owner,movflag; |
| 542 | short tempang,actorstayput,dispicnum; |
| 543 | short timetosleep; |
| 544 | int32_t floorz,ceilingz,lastvx,lastvy,bposx,bposy,bposz; |
| 545 | int32_t temp_data[6]; |
| 546 | }; |
| 547 | |
| 548 | extern struct weaponhit hittype[MAXSPRITES]; |
| 549 | |
| 550 | extern input loc; |
| 551 | extern input recsync[RECSYNCBUFSIZ]; |
| 552 | extern int32_t avgfvel, avgsvel, avgavel, avghorz, avgbits; |
| 553 | |
| 554 | extern short numplayers, myconnectindex; |
| 555 | extern short connecthead, connectpoint2[MAXPLAYERS]; //Player linked list variables (indeces, not connection numbers) |
| 556 | extern short screenpeek; |
| 557 | |
| 558 | extern int current_menu; |
| 559 | extern int32_t tempwallptr,animatecnt; |
| 560 | extern int32_t lockclock; |
| 561 | extern uint8_t display_mirror,rtsplaying; |
| 562 | |
| 563 | extern int32_t movefifoend[MAXPLAYERS]; |
| 564 | extern int32_t ototalclock; |
| 565 | |
| 566 | extern int32_t *animateptr[MAXANIMATES], animategoal[MAXANIMATES]; |
| 567 | extern int32_t animatevel[MAXANIMATES]; |
| 568 | // extern int32_t oanimateval[MAXANIMATES]; |
| 569 | extern short neartagsector, neartagwall, neartagsprite; |
| 570 | extern int32_t neartaghitdist; |
| 571 | extern short animatesect[MAXANIMATES]; |
| 572 | extern int32_t movefifoplc, vel,svel,angvel,horiz; |
| 573 | |
| 574 | extern short mirrorwall[64], mirrorsector[64], mirrorcnt; |
| 575 | |
| 576 | #define NUMKEYS 19 |
| 577 | |
| 578 | extern int32_t chainplace, chainnumpages; |
| 579 | extern volatile int32_t checksume; |
| 580 | |
| 581 | #include "funct.h" |
| 582 | //#include "engine_protos.h" |
| 583 | |
| 584 | extern uint8_t screencapt; |
| 585 | extern short soundps[NUM_SOUNDS],soundpe[NUM_SOUNDS],soundvo[NUM_SOUNDS]; |
| 586 | extern uint8_t soundpr[NUM_SOUNDS],soundm[NUM_SOUNDS]; |
| 587 | extern int32_t soundsiz[NUM_SOUNDS]; |
| 588 | extern char level_names[44][33]; |
| 589 | extern int32_t partime[44],designertime[44]; |
| 590 | extern char volume_names[4][33]; |
| 591 | extern char skill_names[5][33]; |
| 592 | extern char level_file_names[44][128]; |
| 593 | |
| 594 | extern int32_t SoundToggle,MusicToggle; |
| 595 | extern short last_threehundred,lastsavedpos; |
| 596 | extern uint8_t restorepalette; |
| 597 | |
| 598 | extern short buttonstat; |
| 599 | extern int32_t cachecount; |
| 600 | extern uint8_t waterpal[768],slimepal[768],titlepal[768],drealms[768],endingpal[768]; |
| 601 | extern char boardfilename[128]; |
| 602 | extern uint8_t betaname[80]; |
| 603 | extern uint8_t earthquaketime; |
| 604 | extern uint8_t networkmode; |
| 605 | extern uint8_t lumplockbyte[11]; |
| 606 | |
| 607 | //DUKE3D.H - replace the end "my's" with this |
| 608 | extern int32_t myx, omyx, myxvel, myy, omyy, myyvel, myz, omyz, myzvel; |
| 609 | extern short myhoriz, omyhoriz, myhorizoff, omyhorizoff, globalskillsound; |
| 610 | extern short myang, omyang, mycursectnum, myjumpingcounter; |
| 611 | extern uint8_t myjumpingtoggle, myonground, myhardlanding,myreturntocenter; |
| 612 | extern int32_t fakemovefifoplc; |
| 613 | extern int32_t myxbak[MOVEFIFOSIZ], myybak[MOVEFIFOSIZ], myzbak[MOVEFIFOSIZ]; |
| 614 | extern int32_t myhorizbak[MOVEFIFOSIZ]; |
| 615 | extern short myangbak[MOVEFIFOSIZ]; |
| 616 | |
| 617 | extern short weaponsandammosprites[15]; |
| 618 | |
| 619 | |
| 620 | |
| 621 | |
| 622 | //DUKE3D.H: |
| 623 | typedef struct |
| 624 | { |
| 625 | short frag[MAXPLAYERS], got_access, last_extra, shield_amount, curr_weapon; |
| 626 | short ammo_amount[MAX_WEAPONS], holoduke_on; |
| 627 | uint8_t gotweapon[MAX_WEAPONS], inven_icon, jetpack_on, heat_on; |
| 628 | short firstaid_amount, steroids_amount, holoduke_amount, jetpack_amount; |
| 629 | short heat_amount, scuba_amount, boot_amount; |
| 630 | short last_weapon, weapon_pos, kickback_pic; |
| 631 | |
| 632 | } STATUSBARTYPE; |
| 633 | |
| 634 | extern STATUSBARTYPE sbar; |
| 635 | extern short frags[MAXPLAYERS][MAXPLAYERS]; |
| 636 | extern int32_t cameradist, cameraclock, dukefriction,show_shareware; |
| 637 | extern uint8_t networkmode, movesperpacket; |
| 638 | extern uint8_t gamequit; |
| 639 | |
| 640 | extern uint8_t pus,pub,camerashitable,freezerhurtowner,lasermode; |
| 641 | extern uint8_t syncstat, syncval[MAXPLAYERS][MOVEFIFOSIZ]; |
| 642 | extern int8_t multiwho, multipos, multiwhat, multiflag; |
| 643 | extern int32_t syncvalhead[MAXPLAYERS], syncvaltail, syncvaltottail; |
| 644 | extern int32_t numfreezebounces,rpgblastradius,pipebombblastradius,tripbombblastradius,shrinkerblastradius,morterblastradius,bouncemineblastradius,seenineblastradius; |
| 645 | // CTW - MODIFICATION |
| 646 | // extern uint8_t stereo,eightytwofifty,playerswhenstarted,playonten,everyothertime; |
| 647 | extern uint8_t stereo,eightytwofifty,playerswhenstarted,everyothertime; |
| 648 | // CTW END - MODIFICATION |
| 649 | extern int32_t myminlag[MAXPLAYERS], mymaxlag, otherminlag, bufferjitter; |
| 650 | |
| 651 | extern int32_t numinterpolations, startofdynamicinterpolations; |
| 652 | extern int32_t oldipos[MAXINTERPOLATIONS]; |
| 653 | extern int32_t bakipos[MAXINTERPOLATIONS]; |
| 654 | extern int32_t *curipos[MAXINTERPOLATIONS]; |
| 655 | |
| 656 | extern short numclouds,clouds[128],cloudx[128],cloudy[128]; |
| 657 | extern int32_t cloudtotalclock,totalmemory; |
| 658 | |
| 659 | |
| 660 | |
| 661 | extern int32_t myaimmode, myaimstat, omyaimstat; |
| 662 | |
| 663 | extern uint8_t nHostForceDisableAutoaim; |
| 664 | |
| 665 | #endif // include-once header. |
| 666 | |