DB.H 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723
  1. #ifndef __DB_H
  2. #define __DB_H
  3. #include "typedefs.h"
  4. #include "engine.h" // kMaxStatus
  5. /***********************************************************************
  6. * Constants
  7. **********************************************************************/
  8. /*******************************************************************************
  9. The following max constants should be eventually removed, and storage
  10. dynamically allocated.
  11. *******************************************************************************/
  12. #define kMaxXSprites 2048
  13. #define kMaxXWalls 512
  14. #define kMaxXSectors 512
  15. #define kMaxBusyValue 0x10000
  16. #define kFluxMask 0x0FFFF
  17. // status lists
  18. enum {
  19. kStatDefault = 0, // inactive items, like torches and stuff, but NOT dudes
  20. kStatEffect = 1, // non-damaging ricochets, splashes, etc.
  21. kStatExplosion = 2,
  22. kStatItem = 3, // items that can be picked up
  23. kStatThing = 4, // things that can be destroyed/moved
  24. kStatMissile = 5, // player/enemy missiles that do damage
  25. kStatDude = 6, // an active dude
  26. kStatInactive = 7, // an inactive dude
  27. kStatRespawn = 8,
  28. kStatPurge = 9, // use these for purgeable sprites
  29. kStatMarker = 10,
  30. kStatTraps = 11,
  31. kStatProximity = 12, // sprites triggered by proximity
  32. kStatSpares = 13, // allocated invisible sprites
  33. kStatFlare = 14, // flares that are stuck in dudes
  34. kStatDebris = 15, // moving non-Thing debris
  35. kStatFree = kMaxStatus,
  36. };
  37. enum {
  38. kRespawnNever = 0, // sprite cannot respawn
  39. kRespawnOptional = 1, // sprite can optionally respawn in respawnTime seconds
  40. kRespawnAlways = 2, // sprite always respawns in respawnTime seconds
  41. kRespawnPermanent = 3, // sprite is permanent (respawnTime ignored)
  42. };
  43. enum {
  44. kNothing = 0,
  45. kMarkerPlayerStart = 1,
  46. kMarkerDeathStart,
  47. kMarkerOff,
  48. kMarkerOn,
  49. kMarkerAxis,
  50. kMarkerUpperLink,
  51. kMarkerLowerLink,
  52. kMarkerWarpDest,
  53. kMarkerRaingen,
  54. kSwitchBase = 20,
  55. kSwitchToggle = kSwitchBase,
  56. kSwitchMomentary,
  57. kSwitchCombination,
  58. kSwitchPadlock,
  59. kSwitchMax,
  60. kMiscBase = 30,
  61. kMiscTorch = kMiscBase,
  62. kMiscHangingTorch,
  63. kMiscMax,
  64. kWeaponItemBase = 40,
  65. kWeaponItemRandom = kWeaponItemBase,
  66. kWeaponItemShotgun,
  67. kWeaponItemTommyGun,
  68. kWeaponItemFlareGun,
  69. kWeaponItemVoodooDoll,
  70. kWeaponItemSpearGun,
  71. kWeaponItemShadowGun,
  72. kWeaponItemPitchfork, // default weapon, infinite ammo
  73. kWeaponItemSprayCan, // default weapon, just need ammo
  74. kWeaponItemTNT, // default weapon, just need ammo
  75. kWeaponItemMax,
  76. kAmmoItemBase = 60,
  77. kAmmoItemSprayCan = kAmmoItemBase,
  78. kAmmoItemTNTStick,
  79. kAmmoItemTNTBundle,
  80. kAmmoItemTNTCase,
  81. kAmmoItemTNTProximity,
  82. kAmmoItemTNTRemote,
  83. kAmmoItemTNTTimer,
  84. kAmmoItemShells,
  85. kAmmoItemShellBox,
  86. kAmmoItemBullets,
  87. kAmmoItemBulletBox,
  88. kAmmoItemAPBullets,
  89. kAmmoItemTommyDrum,
  90. kAmmoItemSpear,
  91. kAmmoItemSpearPack,
  92. kAmmoItemHESpears,
  93. kAmmoItemFlares,
  94. kAmmoItemHEFlares,
  95. kAmmoItemStarFlares,
  96. kAmmoItemRandom,
  97. kAmmoItemMax,
  98. kItemBase = 100,
  99. kItemKey1 = kItemBase,
  100. kItemKey2,
  101. kItemKey3,
  102. kItemKey4,
  103. kItemKey5,
  104. kItemKey6,
  105. kItemKey7,
  106. kItemDoctorBag,
  107. kItemMedPouch,
  108. kItemLifeEssence,
  109. kItemLifeSeed,
  110. kItemPotion1,
  111. kItemFeatherFall,
  112. kItemLtdInvisibility,
  113. kItemInvulnerability,
  114. kItemJumpBoots,
  115. kItemRavenFlight,
  116. kItemGunsAkimbo,
  117. kItemDivingSuit,
  118. kItemGasMask,
  119. kItemClone,
  120. kItemCrystalBall,
  121. kItemDecoy,
  122. kItemDoppleganger,
  123. kItemReflectiveShots,
  124. kItemRoseGlasses,
  125. kItemShadowCloak,
  126. kItemShroomRage,
  127. kItemShroomDelirium,
  128. kItemShroomGrow,
  129. kItemShroomShrink,
  130. kItemDeathMask,
  131. kItemWineGoblet,
  132. kItemWineBottle,
  133. kItemSkullGrail,
  134. kItemSilverGrail,
  135. kItemTome,
  136. kItemBlackChest,
  137. kItemWoodenChest,
  138. kItemAsbestosArmor,
  139. kItemRandom,
  140. kItemMax,
  141. kDudeBase = 200,
  142. kDudeRandom = kDudeBase,
  143. kDudeTommyCultist,
  144. kDudeShotgunCultist,
  145. kDudeAxeZombie,
  146. kDudeFatZombie,
  147. kDudeEarthZombie,
  148. kDudeFleshGargoyle,
  149. kDudeStoneGargoyle,
  150. kDudeFleshStatue,
  151. kDudeStoneStatue,
  152. kDudePhantasm,
  153. kDudeHound,
  154. kDudeHand,
  155. kDudeBrownSpider,
  156. kDudeRedSpider,
  157. kDudeBlackSpider,
  158. kDudeMotherSpider,
  159. kDudeGillBeast,
  160. kDudeEel,
  161. kDudeBat,
  162. kDudeRat,
  163. kDudeGreenPod,
  164. kDudeGreenTentacle,
  165. kDudeFirePod,
  166. kDudeFireTentacle,
  167. kDudeMotherPod,
  168. kDudeMotherTentacle,
  169. kDudeCerberus,
  170. kDudeCerberus2,
  171. kDudeTchernobog,
  172. kDudeRachel,
  173. kDudePlayer1,
  174. kDudePlayer2,
  175. kDudePlayer3,
  176. kDudePlayer4,
  177. kDudePlayer5,
  178. kDudePlayer6,
  179. kDudePlayer7,
  180. kDudePlayer8,
  181. kDudePlayerBurning, // this one can't explode while burning
  182. kDudeCultistBurning, // this one may explode while burning
  183. kDudeAxeZombieBurning, // this one is taller
  184. kDudeFatZombieBurning, // this one is fatter
  185. kDudePlayer_Owned,
  186. kDudeHound_Owned,
  187. kDudeEel_Owned,
  188. kDudeSpider_Owned,
  189. kDudeMax,
  190. // missile things
  191. kMissileBase = 300,
  192. kMissileButcherKnife = kMissileBase,
  193. kMissileFlare,
  194. kMissileExplodingFlare,
  195. kMissileStarburstFlare,
  196. kMissileSprayFlame,
  197. kMissileFireball,
  198. kMissileSpear,
  199. kMissileEctoSkull,
  200. kMissileHoundFire,
  201. kMissileGreenPuke,
  202. kMissileRedPuke,
  203. kMissileMax,
  204. kThingBase = 400,
  205. kThingTNTBarrel = kThingBase,
  206. kThingTNTProxArmed,
  207. kThingTNTRemArmed,
  208. kThingBlueVase,
  209. kThingBrownVase,
  210. kThingCrateFace,
  211. kThingClearGlass,
  212. kThingFluorescent,
  213. kThingWallCrack,
  214. kThingWoodBeam,
  215. kThingWeb,
  216. kThingMetalGrate1,
  217. kThingFlammableTree,
  218. kThingMachineGun,
  219. // Maintain static Thing numbers above
  220. kThingTNTStick,
  221. kThingTNTBundle,
  222. kThingBoneClub,
  223. kThingZombieBones,
  224. kThingWaterDrip,
  225. kThingBloodDrip,
  226. kThingBubble, // one floating fart bubble
  227. kThingBubbles, // group of floating fart bubbles
  228. kThingGibSmall,
  229. kThingGibCultist,
  230. kThingGibAxeZombie,
  231. kThingGibFatZombie,
  232. kThingGibFleshGargoyle,
  233. kThingGibHound,
  234. kThingGibGillBeast,
  235. kThingGibGreenPod,
  236. kThingGibFirePod,
  237. kThingMax,
  238. // special trap types : traps are damaging to touch
  239. kTrapBase = 450,
  240. kTrapSpiketrap = kTrapBase,
  241. kTrapRocktrap,
  242. kTrapUNUSED1,
  243. kTrapSatellite,
  244. kTrapSawBlade,
  245. kTrapUnpoweredZap,
  246. kTrapPoweredZap,
  247. kTrapPendulum,
  248. kTrapGuillotine,
  249. kTrapMax,
  250. // special wall types
  251. kWallXpanning = 500,
  252. kWallYpanning,
  253. kWallCWpivot,
  254. kWallCCWpivot,
  255. kWallForcefield,
  256. kWallCrushing,
  257. kWallPendulum,
  258. kWallSpeartrap,
  259. kWallFlametrap,
  260. kWallRazordoor,
  261. kWallGuillotine,
  262. kWallClearGlass,
  263. kWallStainedGlass,
  264. kWallWoodBeams,
  265. kWallWeb,
  266. kWallMetalGrate1,
  267. // special sector types
  268. kSectorBase = 600,
  269. kSectorZMotion = kSectorBase,
  270. kSectorZCrusher, // OBSOLETE
  271. kSectorZSprite,
  272. kSectorWarp, // warp when triggered
  273. kSectorTeleport,
  274. kSectorUpperlink, // OBSOLETE
  275. kSectorLowerlink, // OBSOLETE
  276. kSectorUpperwater,
  277. kSectorLowerwater,
  278. kSectorSwingDoor, // OBSOLETE
  279. kSectorTopDoor, // OBSOLETE
  280. kSectorBottomDoor, // OBSOLETE
  281. kSectorPlatformUp, // OBSOLETE
  282. kSectorPlatformDown, // OBSOLETE
  283. kSectorSlideMarked, // slide marked walls and sprites within sector
  284. kSectorRotateMarked, // rotate marked walls and sprites within sector
  285. kSectorSlide, // slide all walls and sprites within sector
  286. kSectorRotate, // rotate all walls and sprites within sector
  287. kSectorSlideCrush, // slide crushing walls within sector
  288. kSectorRotateCrush, // rotating sector with crushing walls
  289. kSectorMax,
  290. kGeneratorBase = 700,
  291. kGenTrigger = kGeneratorBase,
  292. kGenWaterDrip,
  293. kGenBloodDrip,
  294. kGenFireball,
  295. kGenEctoSkull,
  296. kGenDart,
  297. kGenBubble, // a floating bubble
  298. kGenBubbles, // group of floating bubbles
  299. kGenSound,
  300. kGeneratorMax,
  301. };
  302. enum {
  303. kSurfNone = 0,
  304. kSurfStone,
  305. kSurfMetal,
  306. kSurfWood,
  307. kSurfFlesh,
  308. kSurfWater,
  309. kSurfDirt,
  310. kSurfClay,
  311. kSurfSnow,
  312. kSurfIce,
  313. kSurfLeaves,
  314. kSurfCloth,
  315. kSurfPlant,
  316. kSurfGoo,
  317. kSurfLava,
  318. kSurfMax,
  319. };
  320. enum {
  321. kDepthWalk = 0,
  322. kDepthTread = 1,
  323. kDepthWade = 2,
  324. kDepthSwim = 3
  325. };
  326. struct AISTATE; // forward declaration for aiState
  327. /***********************************************************************
  328. * Structures and typedefs
  329. **********************************************************************/
  330. struct XSPRITE
  331. {
  332. signed reference : 14;
  333. unsigned state : 1;
  334. // trigger data
  335. unsigned busy : 17;
  336. // 0 bits unused
  337. unsigned txID : 10;
  338. unsigned rxID : 10;
  339. unsigned command : 8;
  340. unsigned triggerOn : 1;
  341. unsigned triggerOff : 1;
  342. // 2 bits unused
  343. unsigned busyTime : 12; // time to reach next state
  344. unsigned waitTime : 12; // delay before callback
  345. unsigned restState : 1; // state to return to on callback
  346. unsigned interruptable : 1;
  347. unsigned difficulty : 2;
  348. // 4 bits unused
  349. unsigned soundId : 8;
  350. // physical triggers
  351. unsigned decoupled : 1;
  352. unsigned triggerOnce : 1;
  353. unsigned isTriggered : 1; // used for triggerOnce objects
  354. unsigned key : 3;
  355. unsigned triggerPush : 1; // action key
  356. unsigned triggerImpact : 1; // vector hits
  357. unsigned triggerReserved0 : 1;
  358. unsigned triggerPickup : 1; // secrets
  359. unsigned triggerTouch : 1; // sawblades, spikes, zaps?
  360. unsigned triggerSight : 1; // dunno, yet.
  361. unsigned triggerProximity : 1; // proximity bombs
  362. unsigned triggerReserved1 : 1;
  363. unsigned triggerReserved2 : 1;
  364. // 9 bits unused
  365. signed data1 : 16; // combo value?
  366. signed data2 : 16; // combo key?
  367. // 0 bits unused
  368. signed data3 : 16; // combo max?
  369. unsigned goalAng : 11; // dudes
  370. signed dodgeDir : 2; // dudes
  371. unsigned locked: 1;
  372. unsigned unused0 : 2; // USE ME!
  373. // 0 bits unused
  374. unsigned respawn : 2; // 0=optional never, 1=optional always, 2=always, 3=never
  375. unsigned respawnTime : 12; // 0=permanent, >0=time in tenths of a second,
  376. unsigned launchMode : 2; // 0=all, 1=bloodbath, 2=ally, 3=ally&bloodbath,
  377. // this stuff needed for dudes
  378. unsigned moveState : 8; // same as player move states
  379. unsigned unused1 : 8; // USE ME!
  380. // 0 bits unused
  381. unsigned health : 12;
  382. unsigned dudeDeaf : 1; // can't hear players
  383. unsigned dudeAmbush : 1; // must be triggered manually
  384. unsigned dudeGuard : 1; // won't leave sector
  385. unsigned dudeFlag4 : 1;
  386. signed target : 16;
  387. // 0 bits unused
  388. signed targetX : 32;
  389. signed targetY : 32;
  390. signed targetZ : 32;
  391. unsigned burnTime : 16;
  392. signed burnSource : 16;
  393. unsigned unused2 : 16;
  394. unsigned stateTimer : 16;
  395. AISTATE *aiState;
  396. };
  397. struct XWALL
  398. {
  399. signed reference : 14;
  400. unsigned state : 1;
  401. // trigger data
  402. unsigned busy : 17;
  403. signed data : 16;
  404. unsigned txID : 10;
  405. unsigned rxID : 10;
  406. unsigned command : 8;
  407. unsigned triggerOn : 1;
  408. unsigned triggerOff : 1;
  409. unsigned busyTime : 12; // time to reach next state
  410. unsigned waitTime : 12; // delay before callback
  411. unsigned restState : 1; // state to return to on callback
  412. unsigned interruptable : 1;
  413. // panning data
  414. unsigned panAlways : 1;
  415. signed panXVel : 8;
  416. signed panYVel : 8;
  417. // physical triggers
  418. unsigned decoupled : 1;
  419. unsigned triggerOnce : 1;
  420. unsigned isTriggered : 1; // used for triggerOnce objects
  421. unsigned key : 3;
  422. unsigned triggerPush : 1;
  423. unsigned triggerImpact : 1;
  424. unsigned triggerReserved0 : 1;
  425. unsigned triggerReserved1 : 1;
  426. unsigned triggerReserved2 : 1;
  427. unsigned xpanFrac : 8;
  428. unsigned ypanFrac : 8;
  429. unsigned locked : 1;
  430. unsigned pad : 31;
  431. };
  432. struct XSECTOR
  433. {
  434. signed reference : 14;
  435. unsigned state : 1;
  436. // trigger data
  437. unsigned busy : 17;
  438. signed data : 16;
  439. unsigned txID : 10;
  440. unsigned rxID : 10;
  441. unsigned command : 8;
  442. unsigned triggerOn : 1;
  443. unsigned triggerOff : 1;
  444. unsigned busyTime : 12; // time to reach next state
  445. unsigned waitTime : 12; // delay before callback
  446. unsigned restState : 1; // state to return to on callback
  447. unsigned interruptable : 1;
  448. // lighting data
  449. signed amplitude : 8;
  450. unsigned freq : 8;
  451. unsigned phase : 8;
  452. unsigned wave : 4;
  453. unsigned shadeAlways : 1;
  454. unsigned shadeFloor : 1;
  455. unsigned shadeCeiling : 1;
  456. unsigned shadeWalls : 1;
  457. signed shade : 8;
  458. // panning data
  459. unsigned panAlways : 1;
  460. unsigned panFloor : 1;
  461. unsigned panCeiling : 1;
  462. unsigned drag : 1;
  463. // wind/water stuff
  464. unsigned underwater : 1;
  465. unsigned depth : 2;
  466. unsigned panVel : 8;
  467. unsigned panAngle : 11;
  468. unsigned wind : 1;
  469. // physical triggers
  470. unsigned decoupled : 1;
  471. unsigned triggerOnce : 1;
  472. unsigned isTriggered : 1;
  473. unsigned key : 3;
  474. unsigned triggerPush : 1;
  475. unsigned triggerImpact : 1;
  476. unsigned triggerReserved0 : 1;
  477. unsigned triggerEnter : 1;
  478. unsigned triggerExit : 1;
  479. unsigned triggerWPush : 1;
  480. unsigned triggerReserved1 : 1;
  481. unsigned triggerReserved2 : 1;
  482. // movement data
  483. signed offCeilZ : 32;
  484. signed onCeilZ : 32;
  485. signed offFloorZ : 32;
  486. signed onFloorZ : 32;
  487. signed marker0 : 16; // could be 13 bits
  488. signed marker1 : 16; // could be 13 bits
  489. unsigned crush : 1;
  490. unsigned ceilxpanFrac : 8;
  491. unsigned ceilypanFrac : 8;
  492. unsigned floorxpanFrac : 8;
  493. unsigned floorypanFrac : 8;
  494. unsigned locked : 1;
  495. unsigned pad : 31;
  496. // unsigned upperLink : 11;
  497. // signed upperLinkZ : 32;
  498. // unsigned lowerLink : 11;
  499. // signed lowerLinkZ : 32;
  500. };
  501. #if 0
  502. // each physical trigger: command, to
  503. // going on: command, to
  504. // going off: command, to
  505. // PROPOSED XSECTOR CHANGES TO DECREASE MEMORY REQUIREMENTS
  506. //
  507. struct XSECTOR
  508. {
  509. signed reference : 14;
  510. unsigned state : 1;
  511. unsigned trigger : 16; // these fields could be smaller
  512. unsigned lighting : 16; // unless you want to make them pointers
  513. unsigned surfMotion : 16; // and allocate them at load time.
  514. unsigned motion : 16; // this might work since sectors are not
  515. unsigned zMotion : 16; // allocated/deallocated during play
  516. };
  517. struct TRIGGER
  518. {
  519. unsigned state : 1;
  520. unsigned command : 8;
  521. unsigned txID : 10;
  522. unsigned rxID : 10;
  523. signed data : 16;
  524. unsigned busy : 16;
  525. unsigned triggerOn : 1; // trigger on "on" state change
  526. unsigned triggerOff : 1; // trigger on "off" state change
  527. unsigned isTriggered : 1; // trigger is "tripped" - for triggerOnce types
  528. unsigned triggerOnce : 1; // trigger only once
  529. unsigned key : 3; // key required to activate, if any
  530. unsigned triggerEnter : 1; // trigger on player entrance
  531. unsigned triggerExit : 1; // trigger on player exit
  532. unsigned triggerPush : 1; // trigger on player action
  533. unsigned triggerImpact : 1; // trigger on player weapon impact
  534. unsigned triggerWPush : 1; // trigger on push from outside wall (convenience bit)
  535. unsigned waitTime : 8;
  536. unsigned restState : 1; // state to return to on callback
  537. };
  538. struct SURFMOTION
  539. {
  540. // panning/movement data
  541. unsigned depth : 2;
  542. unsigned underwater : 1;
  543. unsigned wind : 1; // wind or underwater current
  544. unsigned panAlways : 1;
  545. unsigned panFloor : 1;
  546. unsigned panCeiling : 1;
  547. unsigned drag : 1;
  548. unsigned panVel : 8;
  549. unsigned panAngle : 11;
  550. };
  551. struct LIGHTING
  552. {
  553. // lighting data
  554. signed amplitude : 8;
  555. unsigned freq : 8;
  556. unsigned wave : 4;
  557. unsigned phase : 8;
  558. unsigned shadeFloor : 1;
  559. unsigned shadeCeiling : 1;
  560. unsigned shadeWalls : 1;
  561. signed shade : 8;
  562. unsigned shadeAlways : 1
  563. }
  564. struct MOTION
  565. {
  566. signed marker0 : 16;
  567. signed marker1 : 16;
  568. int upperOffZ;
  569. int upperOnZ;
  570. int lowerOffZ;
  571. int lowerOnZ;
  572. uchar busyTime;
  573. unsigned upperModelType : 2; // 0:from trigger's, 1:lowest's adjacent, 2-3:unused
  574. unsigned upperOffModel : 3; // 0:same, 1:pic, 2:effects, 3-7:unused
  575. unsigned upperOnModel : 3; // 0:same, 1:pic, 2:effects, 3-7:unused
  576. unsigned lowerModelType : 2; // 0:from trigger's, 1:lowest's adjacent, 2-3:unused
  577. unsigned lowerOnModel : 3; // 0:same, 1:pic, 2:effects, 3-7:unused
  578. unsigned lowerOffModel : 3; // 0:same, 1:pic, 2:effects, 3-7:unused
  579. };
  580. struct DISK_XSECTOR
  581. {
  582. BOOL state;
  583. TRIGGER trigger;
  584. LIGHTING lighting;
  585. SURFMOTION surfMotion;
  586. MOTION motion;
  587. };
  588. // these could be allocated, see XSECTOR notes above
  589. TRIGGER gSectorTriggers[ kMaxSectorTriggers ];
  590. LIGHTING gLighting[ kMaxLighting ];
  591. SURFMOTION gSurfMotion[ kMaxSurfMotion ];
  592. MOTION gMotion[ kMaxMotion ];
  593. NOTES: A SECTOR structure would be saved out prior to the DISK_XSECTOR.
  594. #endif
  595. /***********************************************************************
  596. * Variables
  597. **********************************************************************/
  598. extern XSPRITE xsprite[];
  599. extern XWALL xwall[];
  600. extern XSECTOR xsector[];
  601. #define kMapAuthorLen 64
  602. #define kMapNameLen 64
  603. extern char gMapAuthor[];
  604. extern char gMapName[];
  605. extern int gMapRev;
  606. extern int gSongId;
  607. extern ulong gMapCRC;
  608. extern int gSkyCount;
  609. /***********************************************************************
  610. * Global Variables
  611. **********************************************************************/
  612. extern char *gItemText[ kItemMax - kItemBase ];
  613. extern char *gAmmoText[ kAmmoItemMax - kAmmoItemBase ];
  614. extern char *gWeaponText[ kWeaponItemMax - kWeaponItemBase ];
  615. /***********************************************************************
  616. * Functions
  617. **********************************************************************/
  618. ushort dbInsertXSprite( int nSprite );
  619. void dbDeleteXSprite( int nXSprite );
  620. void dbXSpriteClean( void );
  621. ushort dbInsertXWall( int nWall );
  622. void dbDeleteXWall( int nXWall );
  623. void dbXWallClean( void );
  624. ushort dbInsertXSector( int nSector );
  625. void dbDeleteXSector( int nXSector );
  626. void dbXSectorClean( void );
  627. void dbInit( void );
  628. void dbLoadMap(const char *mapname, long *x, long *y, long *z, short *angle, short *nSector);
  629. void dbSaveMap(const char *mapname, long x, long y, long z, short angle, short nSector);
  630. #endif