DB2.H 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789
  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. // 3d view types
  16. enum {
  17. kSpriteViewSingle = 0,
  18. kSpriteView5Full,
  19. kSpriteView8Full,
  20. kSpriteView5Half,
  21. kSpriteView3Flat,
  22. kSpriteView4Flat
  23. };
  24. // status lists
  25. enum {
  26. kStatDefault = 0, // inactive items, like torches and stuff, but NOT dudes
  27. kStatTouch = 1, // items that can be picked up
  28. kStatProximity = 2, // sprites triggered by proximity
  29. kStatMissile = 3, // player/enemy missiles that do damage
  30. kStatExplosion = 4, // an explosion that gives damage and inertia
  31. kStatDebris = 5, // debris from explosions
  32. kStatDude = 6, // an active dude
  33. kStatInactive = 7, // an inactive dude
  34. kStatExplodable = 8, // non-dude objects affected by explosions
  35. kStatPurge = 9, // use these for purgeable sprites
  36. kStatMarker = 10,
  37. kStatEffect = 12, // non-damaging ricochets, splashes, etc.
  38. kStatSpares = kMaxStatus - 1, // allocated invisible sprites
  39. kStatInvalid = kMaxStatus, // invalid sprite status list
  40. };
  41. enum {
  42. kStatDefault=0, // completely inactive sprites
  43. kStatTouch, // sprite items that can be picked up by players
  44. kStatProxBomb, // bombs triggers by proximity or impact damage
  45. kStatDudes1, // dudes processed in phase 1
  46. kStatDudes2, // dudes processed in phase 2
  47. kStatDudes3, // dudes processed in phase 3
  48. kStatDudes4, // dudes processed in phase 4
  49. };
  50. Player
  51. Water Splash
  52. One-shot animation - stays on floor
  53. Sludge Splash
  54. One-shot animation - stays on floor
  55. Blood Squib
  56. One-shot animation - falls to floor
  57. Shotgun/Tommy Gun
  58. Spark Ricochet
  59. One-shot animation - stays on wall
  60. Wood Ricochet
  61. One-shot animation - stays on wall
  62. Bullet Holes
  63. Semi-permanent flat sprite - stays on wall
  64. Pitchfork
  65. Spark Ricochet (?)
  66. 4 one-shot animations - stays on wall
  67. Blood Squib
  68. One-shot animation - falls to floor
  69. Guts (FPP)
  70. One-shot animation - falls off screen
  71. Speargun
  72. Spear
  73. Missile
  74. Flat or multi-view sprite - arcs slowly to floor
  75. Blood Squib
  76. One-shot animation - falls to floor
  77. HE Spear
  78. Missile
  79. Flat or multi-view sprite - arcs slowly to floor
  80. Explosion
  81. One-shot animation - stays on floor
  82. Broken Spear
  83. Face sprite - falls to floor
  84. Flare Gun
  85. Flare
  86. Fire
  87. HE Flare
  88. Explosion
  89. Starburt Flare
  90. Multiple Explosions
  91. enum {
  92. kMarkerOff,
  93. kMarkerOn,
  94. kMarkerAxis,
  95. kMarkerUpperLink,
  96. kMarkerLowerLink,
  97. };
  98. enum {
  99. kNothing = 0,
  100. kMarkerPlayerstart = 1,
  101. kMarkerBathstart,
  102. kMarkerTeleportdest,
  103. kMarkerAsyncsound,
  104. kMarkerSyncsound,
  105. kMarkerRaingen,
  106. kSwitchToggle = 20,
  107. kSwitchMomentary,
  108. kSwitchCombination,
  109. kSwitchMax,
  110. kWeaponItemBase = 40,
  111. kWeaponItem1_Pitchfork = kWeaponItemBase,
  112. kWeaponItemSprayCan,
  113. kWeaponItem3_TNT,
  114. kWeaponItemShotgun,
  115. kWeaponItemFlareGun,
  116. kWeaponItemSpearGun,
  117. kWeaponItemTommyGun,
  118. kWeaponItemEctoBlaster,
  119. kWeaponItemShadowBlaster,
  120. kWeaponItemLifeStealer,
  121. kWeaponItemRandom,
  122. kWeaponItemMax,
  123. kAmmoBase = 60,
  124. kAmmoSprayCan = kAmmoBase,
  125. kAmmoTNTStick,
  126. kAmmoTNTBundle,
  127. kAmmoTNTCase,
  128. kAmmoTNTProximity,
  129. kAmmoTNTRemote,
  130. kAmmoTNTTimer,
  131. kAmmoShells,
  132. kAmmoShellBox,
  133. kAmmoBullets,
  134. kAmmoBulletBox,
  135. kAmmoAPBullets,
  136. kAmmoHEBullets,
  137. kAmmoTommyDrum,
  138. kAmmoSpear,
  139. kAmmoSpearPack,
  140. kAmmoHESpears,
  141. kAmmoFlares,
  142. kAmmoHEFlares,
  143. kAmmoStarFlares,
  144. kAmmoRandom,
  145. kAmmoMax,
  146. kItemBase = kAmmoMax,
  147. kItemKey1 = kItemBase,
  148. kItemKey2,
  149. kItemKey3,
  150. kItemKey4,
  151. kItemKey5,
  152. kItemKey6,
  153. kItemKey7,
  154. kItemDoctorBag,
  155. kItemMedPouch,
  156. kItemLifeEssence,
  157. kItemLifeSeed,
  158. kItemPotion1,
  159. kItemFeatherFall,
  160. kItemLtdInvisibility,
  161. kItemInvulnerability,
  162. kItemJumpBoots,
  163. kItemWitchBroom,
  164. kItemGunsAkimbo,
  165. kItemDivingSuit,
  166. kItemGasMask,
  167. kItemTrickOrTreat,
  168. kItemClone,
  169. kItemCrystalBall,
  170. kItemDecoy,
  171. kItemDoppleganger,
  172. kItemReflectiveShots,
  173. kItemRoseGlasses,
  174. kItemShadowCloak,
  175. kItemShroomRage,
  176. kItemShroomDelirium,
  177. kItemShroomGrow,
  178. kItemShroomShrink,
  179. kItemSnorkel,
  180. kItemDeathmask,
  181. kItemGauntlets,
  182. kItemBoots,
  183. kItemTalisman,
  184. kItemWineGoblet,
  185. kItemWineBottle,
  186. kItemSkullGrail,
  187. kItemSilverGrail,
  188. kItemShrub,
  189. kItemTome,
  190. kItemBlackChest,
  191. kItemWoodenChest,
  192. kItemLocket,
  193. kItemAsbestosArmor,
  194. kItemRandom,
  195. kItemMax,
  196. kCreatureBase = 200,
  197. kCreatureCultist = kCreatureBase,
  198. kCreatureZombie1,
  199. kCreatureZombie2,
  200. kCreatureGargoyle,
  201. kCreaturePhantasm,
  202. kCreatureHellhound,
  203. kCreatureHand,
  204. kCreatureSpider,
  205. kCreatureChrysalid,
  206. kCreatureGillbeast,
  207. kCreaturePirahna,
  208. kCreatureEel,
  209. kCreatureBat,
  210. kCreatureSnake,
  211. kCreatureRat,
  212. kCreaturePod,
  213. kCreatureTentacle,
  214. kCreatureCerberus,
  215. kCreatureIshkabaal,
  216. kCreatureDarkone,
  217. kCreatureRachel,
  218. kCreatureRandom,
  219. kCreaturePlayer,
  220. kCreatureClone,
  221. kCreatureMax,
  222. // missile things
  223. kMissileBase = 300,
  224. kMissileButcherKnife = kMissileBase,
  225. kMissileEctoSkull,
  226. kMissileSpear,
  227. kMissileShadowBall,
  228. kMissileFlare,
  229. kMissileGreenPuke,
  230. kMissileRedPuke,
  231. kMissileSprayFlame,
  232. kMissileTNTStick,
  233. kMissileMax,
  234. // special thing types
  235. kThingBase = 400,
  236. kThingTNTBarrel = kThingBase,
  237. kThingSpiketrap,
  238. kThingRocktrap,
  239. kThingGastrap,
  240. kThingSatellite,
  241. kThingSawBlade,
  242. kThingTNTProxArmed,
  243. kThingTNTRemArmed,
  244. kThingUnpoweredZap,
  245. kThingPoweredZap,
  246. kThingNormalStatue,
  247. kThingLiveStatue,
  248. kThingCrateFace,
  249. kThingMax,
  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. kWallBreakable,
  263. // special sector types
  264. kSectorBase = 600,
  265. kSectorZMotion = kSectorBase,
  266. kSectorZCrusher,
  267. kSectorFloorPad,
  268. kSectorWarp, // warp when triggered
  269. kSectorTeleport,
  270. kSectorUpperlink,
  271. kSectorLowerlink,
  272. kSectorUpperwater,
  273. kSectorLowerwater,
  274. kSectorSwingDoor,
  275. kSectorTopDoor,
  276. kSectorBottomDoor,
  277. kSectorPlatformUp,
  278. kSectorPlatformDown,
  279. kSectorVSplitDoor, // door splits left/right
  280. kSectorHSplitDoor, // door splits top/bottom
  281. kSectorSlide, // slide marked walls within sector
  282. kSectorRotate, // rotating sector that rotates sprites within
  283. kSectorSlideCrush, // slide crushing walls within sector
  284. kSectorRotateCrush, // rotating sector with crushing walls
  285. kSectorMax,
  286. };
  287. enum {
  288. kSurfStone,
  289. kSurfWood,
  290. kSurfDirt,
  291. kSurfMetal,
  292. kSurfWater,
  293. kSurfLava,
  294. };
  295. enum {
  296. kDepthWalk = 0,
  297. kDepthTread = 1,
  298. kDepthWade = 2,
  299. kDepthSwim = 3
  300. };
  301. /***********************************************************************
  302. * Structures and typedefs
  303. **********************************************************************/
  304. struct XSPRITE
  305. {
  306. signed reference : 16;
  307. unsigned state : 1;
  308. // trigger data
  309. unsigned busy : 17;
  310. unsigned type : 10;
  311. signed data : 16;
  312. unsigned txID : 10;
  313. unsigned rxID : 10;
  314. unsigned command : 3;
  315. unsigned triggerOn : 1;
  316. unsigned triggerOff : 1;
  317. unsigned triggerOnce : 1;
  318. unsigned restState : 1; // state to return to on callback
  319. unsigned key : 3;
  320. unsigned difficulty : 2;
  321. unsigned detail : 2;
  322. unsigned map : 2;
  323. unsigned view : 4;
  324. unsigned soundKit : 8;
  325. unsigned isTriggered : 1; // used for triggerOnce objects
  326. unsigned triggerPush : 1; // gates?
  327. unsigned triggerImpact : 1; // exploding things, etc.
  328. unsigned triggerPickup : 1; // secrets
  329. unsigned triggerTouch : 1; // sawblades, spikes, zaps?
  330. unsigned triggerSight : 1; // dunno, yet.
  331. unsigned triggerProximity : 1; // proximity bombs
  332. unsigned decoupled : 1;
  333. unsigned waitTime : 8;
  334. unsigned permanent : 1; // 0=not permanent, 1=permanent (respawn ignored)
  335. unsigned respawn : 2; // 0=never, 1=always, 2=optional never, 3=optional always
  336. unsigned respawnTime : 8; // 0=instant, >0=time in tenths of a second,
  337. unsigned launchMode : 2; // 0=all, 1=bloodbath, 2=ally, 3=ally&bloodbath,
  338. unsigned pad1 : 32;
  339. unsigned pad2 : 32;
  340. };
  341. struct XWALL
  342. {
  343. signed reference : 16;
  344. unsigned state : 1;
  345. unsigned map : 2;
  346. // trigger data
  347. unsigned busy : 17;
  348. unsigned type : 10;
  349. signed data : 16;
  350. unsigned txID : 10;
  351. unsigned rxID : 10;
  352. unsigned command : 3;
  353. unsigned triggerOn : 1;
  354. unsigned triggerOff : 1;
  355. unsigned triggerOnce : 1;
  356. unsigned key : 3;
  357. // panning data
  358. signed panXVel : 8;
  359. signed panYVel : 8;
  360. unsigned isTriggered : 1; // used for triggerOnce objects
  361. unsigned triggerPush : 1;
  362. unsigned triggerImpact : 1;
  363. unsigned triggerRsvd1 : 1;
  364. unsigned triggerRsvd2 : 1;
  365. unsigned decoupled : 1;
  366. unsigned panAlways : 1;
  367. unsigned restState : 1; // state to return to on callback
  368. unsigned waitTime : 8; // delay before callback
  369. unsigned pad1 : 32;
  370. unsigned pad2 : 32;
  371. };
  372. struct XSECTOR
  373. {
  374. signed reference : 16;
  375. unsigned state : 1;
  376. // trigger data
  377. unsigned busy : 17;
  378. unsigned type : 10;
  379. signed data : 16;
  380. unsigned txID : 10;
  381. unsigned rxID : 10;
  382. unsigned command : 3;
  383. unsigned triggerOn : 1;
  384. unsigned triggerOff : 1;
  385. unsigned triggerOnce : 1;
  386. unsigned restState : 1; // state to return to on callback
  387. unsigned key : 3;
  388. // lighting data
  389. signed amplitude : 8;
  390. unsigned freq : 8;
  391. unsigned wave : 4;
  392. unsigned shadeAlways : 1;
  393. unsigned phase : 8;
  394. unsigned shadeFloor : 1;
  395. unsigned shadeCeiling : 1;
  396. unsigned shadeWalls : 1;
  397. signed shade : 8;
  398. // panning data
  399. unsigned panFloor : 1;
  400. unsigned panCeiling : 1;
  401. unsigned panDrag : 1;
  402. unsigned waitTime : 8; // delay before callback
  403. unsigned panAlways : 1;
  404. unsigned busyTime : 8; // time to reach next state
  405. // wind/water stuff
  406. unsigned underwater : 1;
  407. unsigned depth : 2;
  408. unsigned panVel : 8;
  409. unsigned panAngle : 11;
  410. unsigned wind : 1;
  411. unsigned isTriggered : 1;
  412. unsigned triggerPush : 1;
  413. unsigned triggerImpact : 1;
  414. unsigned triggerEnter : 1;
  415. unsigned triggerExit : 1;
  416. unsigned decoupled : 1;
  417. unsigned triggerWPush : 1;
  418. signed offCeilZ : 32;
  419. signed onCeilZ : 32;
  420. signed offFloorZ : 32;
  421. signed onFloorZ : 32;
  422. unsigned pad1 : 32;
  423. unsigned pad2 : 32;
  424. };
  425. #if 0
  426. /***********************************************************************
  427. * Structures and typedefs
  428. **********************************************************************/
  429. struct XSPRITE
  430. {
  431. signed reference : 16;
  432. unsigned state : 1;
  433. // trigger data
  434. unsigned busy : 16;
  435. unsigned type : 10;
  436. signed data : 16;
  437. unsigned txID : 10;
  438. unsigned rxID : 10;
  439. unsigned command : 3;
  440. unsigned triggerOn : 1;
  441. unsigned triggerOff : 1;
  442. unsigned triggerOnce : 1;
  443. unsigned restState : 1; // state to return to on callback
  444. unsigned key : 3;
  445. unsigned difficulty : 2;
  446. unsigned detail : 2;
  447. unsigned map : 2;
  448. unsigned view : 4;
  449. unsigned soundKit : 8;
  450. unsigned isTriggered : 1; // used for triggerOnce objects
  451. unsigned triggerPush : 1; // gates?
  452. unsigned triggerImpact : 1; // exploding things, etc.
  453. unsigned triggerPickup : 1; // secrets
  454. unsigned triggerTouch : 1; // sawblades, spikes, zaps?
  455. unsigned triggerSight : 1; // dunno, yet.
  456. unsigned triggerProximity : 1; // proximity bombs
  457. unsigned decoupled : 1;
  458. unsigned waitTime : 8;
  459. // unsigned permanent : 1; // 0=not permanent, 1=permanent (respawn ignored)
  460. // unsigned respawn : 2; // 0=never, 1=always, 2=optional never, 3=optional always
  461. // unsigned respawnTime : 8; // 0=instant, >0=time in tenths of a second,
  462. // unsigned launchMode : 2; // 0=all, 1=bloodbath, 2=ally, 3=ally&bloodbath,
  463. };
  464. struct XWALL
  465. {
  466. signed reference : 16;
  467. unsigned state : 1;
  468. unsigned map : 2;
  469. // trigger data
  470. unsigned busy : 16;
  471. unsigned type : 10;
  472. signed data : 16;
  473. unsigned txID : 10;
  474. unsigned rxID : 10;
  475. unsigned command : 3;
  476. unsigned triggerOn : 1;
  477. unsigned triggerOff : 1;
  478. unsigned triggerOnce : 1;
  479. unsigned key : 3;
  480. // panning data
  481. signed panXVel : 8;
  482. signed panYVel : 8;
  483. unsigned isTriggered : 1; // used for triggerOnce objects
  484. unsigned triggerPush : 1;
  485. unsigned triggerImpact : 1;
  486. unsigned triggerRsvd1 : 1;
  487. unsigned triggerRsvd2 : 1;
  488. unsigned decoupled : 1;
  489. unsigned panAlways : 1;
  490. unsigned restState : 1; // state to return to on callback
  491. unsigned waitTime : 8;
  492. };
  493. struct XSECTOR
  494. {
  495. signed reference : 16;
  496. unsigned state : 1;
  497. // trigger data
  498. unsigned busy : 16;
  499. unsigned type : 10;
  500. signed data : 16;
  501. unsigned txID : 10;
  502. unsigned rxID : 10;
  503. unsigned command : 3;
  504. unsigned triggerOn : 1;
  505. unsigned triggerOff : 1;
  506. unsigned triggerOnce : 1;
  507. unsigned restState : 1; // state to return to on callback
  508. unsigned key : 3;
  509. // lighting data
  510. signed amplitude : 8;
  511. unsigned freq : 8;
  512. unsigned wave : 4;
  513. unsigned shadeAlways : 1;
  514. unsigned unused2 : 3; // !!! USE ME !!!
  515. unsigned phase : 8;
  516. unsigned shadeFloor : 1;
  517. unsigned shadeCeiling : 1;
  518. unsigned shadeWalls : 1;
  519. signed shade : 8;
  520. // panning data
  521. unsigned panFloor : 1;
  522. unsigned panCeiling : 1;
  523. unsigned panDrag : 1;
  524. unsigned waitTime : 8;
  525. unsigned panAlways : 1;
  526. unsigned unused3 : 3; // !!! USE ME !!!
  527. // speed for moving sectors
  528. unsigned busyTime : 8;
  529. // water stuff
  530. unsigned underwater : 1;
  531. unsigned depth : 2;
  532. unsigned panVel : 8;
  533. unsigned panAngle : 12; // change to 11 bits in CONVDB4!!!
  534. unsigned wind : 3;
  535. unsigned isTriggered : 1; // used for triggerOnce objects
  536. unsigned triggerPush : 1;
  537. unsigned triggerImpact : 1;
  538. unsigned triggerEnter : 1;
  539. unsigned triggerExit : 1;
  540. unsigned decoupled : 1;
  541. unsigned triggerWPush : 1; // push from outside wall (convenience bit)
  542. // uncomment these for CONVDB4
  543. // signed ceilingOffZ : 32;
  544. // signed ceilingOnZ : 32;
  545. // signed floorOffZ : 32;
  546. // signed floorOnZ : 32;
  547. };
  548. #endif
  549. #if 0
  550. // PROPOSED XSECTOR CHANGES TO DECREASE MEMORY REQUIREMENTS
  551. //
  552. struct XSECTOR
  553. {
  554. signed reference : 15; // *** Made 1 bit smaller to accommodate state
  555. unsigned state : 1;
  556. unsigned trigger : 16; // these fields could be smaller
  557. unsigned lighting : 16; // unless you want to make them pointers
  558. unsigned surfMotion : 16; // and allocate them at load time.
  559. unsigned motion : 16; // this might work since sectors are not
  560. unsigned zMotion : 16; // allocated/deallocated during play
  561. };
  562. struct TRIGGER
  563. {
  564. unsigned type : 10;
  565. unsigned state : 1;
  566. unsigned command : 3;
  567. unsigned txID : 10;
  568. unsigned rxID : 10;
  569. signed data : 16;
  570. unsigned busy : 16;
  571. unsigned triggerOn : 1; // trigger on "on" state change
  572. unsigned triggerOff : 1; // trigger on "off" state change
  573. unsigned isTriggered : 1; // trigger is "tripped" - for triggerOnce types
  574. unsigned triggerOnce : 1; // trigger only once
  575. unsigned key : 3; // key required to activate, if any
  576. unsigned triggerEnter : 1; // trigger on player entrance
  577. unsigned triggerExit : 1; // trigger on player exit
  578. unsigned triggerPush : 1; // trigger on player action
  579. unsigned triggerImpact : 1; // trigger on player weapon impact
  580. unsigned triggerWPush : 1; // trigger on push from outside wall (convenience bit)
  581. unsigned waitTime : 8;
  582. unsigned restState : 1; // state to return to on callback
  583. };
  584. struct SURFMOTION
  585. {
  586. // panning/movement data
  587. unsigned depth : 2;
  588. unsigned underwater : 1;
  589. unsigned wind : 1; // wind or underwater current
  590. unsigned panAlways : 1;
  591. unsigned panFloor : 1;
  592. unsigned panCeiling : 1;
  593. unsigned panDrag : 1;
  594. unsigned panVel : 8;
  595. unsigned panAngle : 11;
  596. };
  597. struct LIGHTING
  598. {
  599. // lighting data
  600. signed amplitude : 8;
  601. unsigned freq : 8;
  602. unsigned wave : 4;
  603. unsigned phase : 8;
  604. unsigned shadeFloor : 1;
  605. unsigned shadeCeiling : 1;
  606. unsigned shadeWalls : 1;
  607. signed shade : 8;
  608. unsigned shadeAlways : 1
  609. }
  610. struct MOTION
  611. {
  612. signed marker0 : 16;
  613. signed marker1 : 16;
  614. int upperOffZ;
  615. int upperOnZ;
  616. int lowerOffZ;
  617. int lowerOnZ;
  618. uchar busyTime;
  619. unsigned upperModelType : 2; // 0:from trigger's, 1:lowest's adjacent, 2-3:unused
  620. unsigned upperOffModel : 3; // 0:same, 1:pic, 2:effects, 3-7:unused
  621. unsigned upperOnModel : 3; // 0:same, 1:pic, 2:effects, 3-7:unused
  622. unsigned lowerModelType : 2; // 0:from trigger's, 1:lowest's adjacent, 2-3:unused
  623. unsigned lowerOnModel : 3; // 0:same, 1:pic, 2:effects, 3-7:unused
  624. unsigned lowerOffModel : 3; // 0:same, 1:pic, 2:effects, 3-7:unused
  625. };
  626. struct DISK_XSECTOR
  627. {
  628. BOOL state;
  629. TRIGGER trigger;
  630. LIGHTING lighting;
  631. SURFMOTION surfMotion;
  632. MOTION motion;
  633. ZMOTION zMotion;
  634. };
  635. // these could be allocated, see XSECTOR notes above
  636. TRIGGER gSectorTriggers[ kMaxSectorTriggers ];
  637. LIGHTING gLighting[ kMaxLighting ];
  638. SURFMOTION gSurfMotion[ kMaxSurfMotion ];
  639. MOTION gMotion[ kMaxMotion ];
  640. ZMOTION gZMotion[ kMaxZMotion ];
  641. NOTES: A SECTOR structure would be saved out prior to the DISK_XSECTOR.
  642. Also, surftypes are not accounted for here, but could be saved in both the
  643. lotag and hitag fields of the sector. For walls, the surftype could be
  644. placed in either the lotag or hitag.
  645. #endif
  646. /***********************************************************************
  647. * Variables
  648. **********************************************************************/
  649. extern XSPRITE xsprite[];
  650. extern XWALL xwall[];
  651. extern XSECTOR xsector[];
  652. extern uchar spriteSurf[];
  653. extern uchar wallSurf[];
  654. extern uchar floorSurf[];
  655. extern uchar ceilingSurf[];
  656. #define kMapAuthorLen 64
  657. #define kMapNameLen 64
  658. extern char gMapAuthor[];
  659. extern char gMapName[];
  660. extern int gMapRev;
  661. extern int gSongId;
  662. extern ulong gMapCRC;
  663. extern int gSkyCount;
  664. /***********************************************************************
  665. * Global Variables / MPX related strings
  666. **********************************************************************/
  667. extern char *gItemText[ kItemMax - kItemBase ];
  668. extern char *gAmmoText[ kAmmoMax - kAmmoBase ];
  669. extern char *gWeaponText[ kWeaponItemMax - kWeaponItemBase ];
  670. extern char *gCreatureText[ kCreatureMax - kCreatureBase ];
  671. extern char *gThingText[ kThingMax - kThingBase ];
  672. /***********************************************************************
  673. * Functions
  674. **********************************************************************/
  675. ushort dbInsertXSprite( int nSprite );
  676. void dbDeleteXSprite( int nXSprite );
  677. void dbXSpriteClean( void );
  678. ushort dbInsertXWall( int nWall );
  679. void dbDeleteXWall( int nXWall );
  680. void dbXWallClean( void );
  681. ushort dbInsertXSector( int nSector );
  682. void dbDeleteXSector( int nXSector );
  683. void dbXSectorClean( void );
  684. void dbInit( void );
  685. void dbLoadMap(const char *mapname, long *x, long *y, long *z, short *angle, short *nSector);
  686. void dbSaveMap(const char *mapname, long x, long y, long z, short angle, short nSector);
  687. #endif