1 //---------------------------------------------------------------------------- 2 // EDGE DDF: Lines and Sectors 3 //---------------------------------------------------------------------------- 4 // 5 // Copyright (c) 1999-2008 The EDGE Team. 6 // 7 // This program 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. See the 15 // GNU General Public License for more details. 16 // 17 //---------------------------------------------------------------------------- 18 19 #ifndef __DDF_LINE_H__ 20 #define __DDF_LINE_H__ 21 22 #include "epi/utility.h" 23 24 #include "types.h" 25 26 // ------------------------------------------------------------------ 27 // ------------------------LINEDEF TYPES----------------------------- 28 // ------------------------------------------------------------------ 29 30 #define FLO_UNUSED ((float) 3.18081979f) 31 32 // Triggers (What the line triggers) 33 // NOTE TO SELF: Move to an area for linedef/rts/sector stuff 34 typedef enum 35 { 36 line_none, 37 line_shootable, 38 line_walkable, 39 line_pushable, 40 line_manual, // same as pushable, but ignore any tag 41 line_Any 42 } 43 trigger_e; 44 45 // Triggers (What object types can cause the line to be triggered) 46 // NOTE TO SELF: Move to an area for linedef/rts/sector stuff 47 typedef enum 48 { 49 trig_none = 0, 50 trig_player = 1, 51 trig_monster = 2, 52 trig_other = 4, 53 trig_nobot = 8 // -AJA- 2009/10/17 54 } 55 trigacttype_e; 56 57 // Height Info Reference 58 // NOTE TO SELF: Move to an area for linedef/rts/sector stuff 59 typedef enum 60 { 61 REF_Absolute = 0, // Absolute from current position 62 REF_Current, // Measure from current sector height 63 REF_Surrounding, // Measure from surrounding heights 64 REF_LowestLoTexture, 65 REF_Trigger, // Use the triggering linedef 66 67 // additive flags 68 REF_MASK = 0x00FF, 69 REF_CEILING = 0x0100, // otherwise floor 70 REF_HIGHEST = 0x0200, // otherwise lowest 71 REF_NEXT = 0x0400, // otherwise absolute 72 REF_INCLUDE = 0x0800, // otherwise excludes self 73 } 74 heightref_e; 75 76 // Movement type 77 typedef enum 78 { 79 mov_undefined = 0, 80 mov_Once, 81 mov_MoveWaitReturn, 82 mov_Continuous, 83 mov_Plat, 84 mov_Stairs, 85 mov_Stop, 86 mov_Toggle, // -AJA- 2004/10/07: added. 87 mov_Elevator, // -AJA- 2006/11/17: added. 88 } 89 movetype_e; 90 91 // Security type: requires certain key 92 // NOTE TO SELF: Move to an area for linedef/rts/sector stuff 93 typedef enum 94 { 95 KF_NONE = 0, 96 97 // keep card/skull together, for easy SKCK check 98 KF_BlueCard = (1 << 0), 99 KF_YellowCard = (1 << 1), 100 KF_RedCard = (1 << 2), 101 KF_GreenCard = (1 << 3), 102 103 KF_BlueSkull = (1 << 4), 104 KF_YellowSkull = (1 << 5), 105 KF_RedSkull = (1 << 6), 106 KF_GreenSkull = (1 << 7), 107 108 // -AJA- 2001/06/30: ten new keys (these + Green ones) 109 KF_GoldKey = (1 << 8), 110 KF_SilverKey = (1 << 9), 111 KF_BrassKey = (1 << 10), 112 KF_CopperKey = (1 << 11), 113 KF_SteelKey = (1 << 12), 114 KF_WoodenKey = (1 << 13), 115 KF_FireKey = (1 << 14), 116 KF_WaterKey = (1 << 15), 117 118 // this is a special flag value that indicates that _all_ of the 119 // keys in the bitfield must be held. Normally we require _any_ of 120 // the keys in the bitfield to be held. 121 // 122 KF_STRICTLY_ALL = (1 << 16), 123 124 // Boom compatibility: don't care if card or skull 125 KF_BOOM_SKCK = (1 << 17), 126 127 // mask of actual key bits 128 KF_CARDS = 0x000F, 129 KF_SKULLS = 0x00F0, 130 KF_MASK = 0xFFFF 131 } 132 keys_e; 133 134 #define EXPAND_KEYS(set) ((set) | \ 135 (((set) & KF_CARDS) << 4) | (((set) & KF_SKULLS) >> 4)) 136 137 // NOTE TO SELF: Move to an area for linedef/rts/sector stuff 138 typedef enum 139 { 140 EXIT_None = 0, 141 EXIT_Normal, 142 EXIT_Secret, 143 EXIT_Hub 144 } 145 exittype_e; 146 147 // -AJA- 1999/10/24: Reimplemented when_appear_e type. 148 // NOTE TO SELF: Move to an area for linedef/rts/sector stuff 149 typedef enum 150 { 151 WNAP_None = 0x0000, 152 153 WNAP_SkillLevel1 = 0x0001, 154 WNAP_SkillLevel2 = 0x0002, 155 WNAP_SkillLevel3 = 0x0004, 156 WNAP_SkillLevel4 = 0x0008, 157 WNAP_SkillLevel5 = 0x0010, 158 159 WNAP_Single = 0x0100, 160 WNAP_Coop = 0x0200, 161 WNAP_DeathMatch = 0x0400, 162 163 WNAP_SkillBits = 0x001F, 164 WNAP_NetBits = 0x0700 165 } 166 when_appear_e; 167 168 #define DEFAULT_APPEAR ((when_appear_e)(0xFFFF)) 169 170 // -AJA- 1999/06/21: extra floor types 171 // FIXME!!! Move into to extrafloordef_c? 172 typedef enum 173 { 174 EXFL_None = 0x0000, 175 176 // keeps the value from being zero 177 EXFL_Present = 0x0001, 178 179 // floor is thick, has sides. When clear: surface only 180 EXFL_Thick = 0x0002, 181 182 // floor is liquid, i.e. non-solid. When clear: solid 183 EXFL_Liquid = 0x0004, 184 185 // can monsters see through this extrafloor ? 186 EXFL_SeeThrough = 0x0010, 187 188 // things with the WATERWALKER tag will not fall through. 189 // Also, certain player sounds (pain, death) can be overridden when 190 // in a water region. Scope for other "waterish" effects... 191 // 192 EXFL_Water = 0x0020, 193 194 // the region properties will "flood" all lower regions (unless it 195 // finds another flooder). 196 // 197 EXFL_Flooder = 0x0040, 198 199 // the properties (lighting etc..) below are not transferred from 200 // the dummy sector, they'll be the same as the above region. 201 // 202 EXFL_NoShade = 0x0080, 203 204 // take the side texture for THICK floors from the upper part of the 205 // sidedef where the thick floor is drawn (instead of tagging line). 206 // 207 EXFL_SideUpper = 0x0100, 208 209 // like above, but use the lower part. 210 EXFL_SideLower = 0x0200, 211 212 // this controls the Y offsets on normal THICK floors. 213 EXFL_SideMidY = 0x0800, 214 215 // Boom compatibility flag (for linetype 242) 216 EXFL_BoomTex = 0x1000 217 } 218 extrafloor_type_e; 219 220 #define EF_DEF_THIN ((extrafloor_type_e)(EXFL_Present | 0)) 221 #define EF_DEF_THICK ((extrafloor_type_e)(EXFL_Present | EXFL_Thick)) 222 #define EF_DEF_LIQUID ((extrafloor_type_e)(EXFL_Present | EXFL_Liquid)) 223 224 // FIXME!! Move into extrafloordef_c 225 typedef enum 226 { 227 // remove an extra floor 228 EFCTL_None = 0, 229 EFCTL_Remove 230 } 231 extrafloor_control_e; 232 233 class extrafloordef_c 234 { 235 public: 236 extrafloordef_c(); 237 extrafloordef_c(extrafloordef_c &rhs); 238 ~extrafloordef_c(); 239 240 private: 241 void Copy(extrafloordef_c &src); 242 243 public: 244 void Default(void); 245 extrafloordef_c& operator=(extrafloordef_c &src); 246 247 extrafloor_type_e type; 248 extrafloor_control_e control; 249 }; 250 251 // --> Moving plane def (Ceilings, floors and doors) 252 class movplanedef_c 253 { 254 public: 255 movplanedef_c(); 256 movplanedef_c(movplanedef_c &rhs); 257 ~movplanedef_c(); 258 259 enum default_e 260 { 261 DEFAULT_CeilingLine, 262 DEFAULT_CeilingSect, 263 DEFAULT_DonutFloor, 264 DEFAULT_FloorLine, 265 DEFAULT_FloorSect, 266 DEFAULT_Numtypes 267 }; 268 269 private: 270 void Copy(movplanedef_c &src); 271 272 public: 273 void Default(default_e def); 274 movplanedef_c& operator=(movplanedef_c &rhs); 275 276 // Type of floor: raise/lower/etc 277 movetype_e type; 278 279 // True for a ceiling, false for a floor 280 bool is_ceiling; 281 282 // How fast the plane moves. 283 float speed_up; 284 float speed_down; 285 286 // This refers to what the dest. height refers to. 287 heightref_e destref; 288 289 // Destination height. 290 float dest; 291 292 // -AJA- 2001/05/28: This specifies the other height used. 293 heightref_e otherref; 294 float other; 295 296 // Floor texture to change to. 297 lumpname_c tex; 298 299 // How much crush damage to do (0 for none). 300 int crush_damage; 301 302 // PLAT/DOOR Specific: Time to wait before returning. 303 int wait; 304 int prewait; 305 306 // Up/Down/Stop sfx 307 struct sfx_s *sfxstart, *sfxup, *sfxdown, *sfxstop; 308 309 // Scrolling. -AJA- 2000/04/16 310 angle_t scroll_angle; 311 float scroll_speed; 312 313 // Boom compatibility bits 314 bool ignore_texture; 315 }; 316 317 318 // --> Sliding door definition class 319 320 // FIXME Move inside sliding_door_c? 321 typedef enum 322 { 323 // not a slider 324 SLIDE_None = 0, 325 326 // door slides left (when looking at the right side) 327 SLIDE_Left, 328 329 // door slides right (when looking at the right side) 330 SLIDE_Right, 331 332 // door opens from middle 333 SLIDE_Center 334 } 335 slidetype_e; 336 337 // --> Sliding Door Definition 338 339 // 340 // Thin Sliding Doors 341 // 342 // -AJA- 2000/08/05: added this. 343 // 344 class sliding_door_c 345 { 346 public: 347 sliding_door_c(); 348 sliding_door_c(sliding_door_c &rhs); 349 ~sliding_door_c(); 350 351 private: 352 void Copy(sliding_door_c &src); 353 354 public: 355 void Default(void); 356 sliding_door_c& operator=(sliding_door_c &rhs); 357 358 // type of slider, normally SLIDE_None 359 slidetype_e type; 360 361 // how fast it opens/closes 362 float speed; 363 364 // time to wait before returning (in tics). Note: door stays open 365 // after the last activation. 366 int wait; 367 368 // whether or not the texture can be seen through 369 bool see_through; 370 371 // how far it actually opens (usually 100%) 372 percent_t distance; 373 374 // sound effects. 375 struct sfx_s *sfx_start; 376 struct sfx_s *sfx_open; 377 struct sfx_s *sfx_close; 378 struct sfx_s *sfx_stop; 379 }; 380 381 // --> Donut definition class 382 383 class donutdef_c 384 { 385 public: 386 donutdef_c(); 387 donutdef_c(donutdef_c &rhs); 388 ~donutdef_c(); 389 390 private: 391 void Copy(donutdef_c &src); 392 393 public: 394 void Default(void); 395 donutdef_c& operator=(donutdef_c &rhs); 396 397 // Do Donut? 398 399 // 400 // FIXME! Make the objects that use this require 401 // a pointer/ref. This becomes an 402 // therefore becomes an unnecessary entry 403 // 404 bool dodonut; 405 406 // FIXME! Strip out the d_ since we're not trying to 407 // to differentiate them now? 408 409 // SFX for inner donut parts 410 struct sfx_s *d_sfxin, *d_sfxinstop; 411 412 // SFX for outer donut parts 413 struct sfx_s *d_sfxout, *d_sfxoutstop; 414 }; 415 416 // -AJA- 1999/07/12: teleporter special flags. 417 // FIXME!! Move into teleport def class? 418 typedef enum 419 { 420 TELSP_None = 0, 421 422 TELSP_Relative = 0x0001, // keep same relative angle 423 TELSP_SameHeight = 0x0002, // keep same height off the floor 424 TELSP_SameSpeed = 0x0004, // keep same momentum 425 TELSP_SameOffset = 0x0008, // keep same X/Y offset along line 426 427 TELSP_SameAbsDir = 0x0010, // keep same _absolute_ angle (DEPRECATED) 428 TELSP_Rotate = 0x0020, // rotate by target angle (DEPRECATED) 429 430 TELSP_Line = 0x0100, // target is a line (not a thing) 431 TELSP_Flipped = 0x0200, // pretend target was flipped 180 degrees 432 TELSP_Silent = 0x0400 // no fog or sound 433 } 434 teleportspecial_e; 435 436 // --> Teleport def class 437 438 class teleportdef_c 439 { 440 public: 441 teleportdef_c(); 442 teleportdef_c(teleportdef_c &rhs); 443 ~teleportdef_c(); 444 445 private: 446 void Copy(teleportdef_c &src); 447 448 public: 449 void Default(void); 450 teleportdef_c& operator=(teleportdef_c &rhs); 451 452 // If true, teleport activator 453 // 454 // FIXME! Make the objects that use this require 455 // a pointer/ref. This 456 // therefore becomes an unnecessary entry 457 // 458 bool teleport; 459 460 // effect object spawned when going in... 461 const mobjtype_c *inspawnobj; // FIXME! Do mobjtypes.Lookup()? 462 epi::strent_c inspawnobj_ref; 463 464 // effect object spawned when going out... 465 const mobjtype_c *outspawnobj; // FIXME! Do mobjtypes.Lookup()? 466 epi::strent_c outspawnobj_ref; 467 468 // Teleport delay 469 int delay; 470 471 // Special flags. 472 teleportspecial_e special; 473 }; 474 475 // Light Specials 476 typedef enum 477 { 478 LITE_None, 479 480 // set light to new level instantly 481 LITE_Set, 482 483 // fade light to new level over time 484 LITE_Fade, 485 486 // flicker like a fire 487 LITE_FireFlicker, 488 489 // smoothly fade between bright and dark, continously 490 LITE_Glow, 491 492 // blink randomly between bright and dark 493 LITE_Flash, 494 495 // blink between bright and dark, alternating 496 LITE_Strobe 497 } 498 lighttype_e; 499 500 // --> Light information class 501 class lightdef_c 502 { 503 public: 504 lightdef_c(); 505 lightdef_c(lightdef_c &rhs); 506 ~lightdef_c(); 507 508 private: 509 void Copy(lightdef_c &src); 510 511 public: 512 void Default(void); 513 lightdef_c& operator=(lightdef_c &rhs); 514 515 lighttype_e type; 516 517 // light level to change to (for SET and FADE) 518 int level; 519 520 // chance value for FLASH type 521 percent_t chance; 522 523 // time remaining dark and bright, in tics 524 int darktime; 525 int brighttime; 526 527 // synchronisation time, in tics 528 int sync; 529 530 // stepping used for FADE and GLOW types 531 int step; 532 }; 533 534 // --> Ladder definition class (Probably somewhat OTT) 535 536 class ladderdef_c 537 { 538 public: 539 ladderdef_c(); 540 ladderdef_c(ladderdef_c &rhs); 541 ~ladderdef_c(); 542 543 private: 544 void Copy(ladderdef_c &src); 545 546 public: 547 void Default(void); 548 ladderdef_c& operator=(ladderdef_c &rhs); 549 550 // height of ladder itself. Zero or negative disables. Bottom of 551 // ladder comes from Y_OFFSET on the linedef. 552 float height; 553 }; 554 555 typedef enum 556 { 557 LINEFX_NONE = 0, 558 559 // make tagged lines (inclusive) 50% translucent 560 LINEFX_Translucency = (1 << 0), 561 562 // make tagged walls (inclusive) scroll using vector 563 LINEFX_VectorScroll = (1 << 1), 564 565 // make source line scroll using sidedef offsets 566 LINEFX_OffsetScroll = (1 << 2), 567 568 // experimental: tagged walls (inclusive) scaling & skewing 569 LINEFX_Scale = (1 << 3), 570 LINEFX_Skew = (1 << 4), 571 572 // experimental: transfer properties to tagged walls (incl) 573 LINEFX_LightWall = (1 << 5), 574 575 // experimental: make tagged lines (exclusive) non-blocking 576 LINEFX_UnblockThings = (1 << 6), 577 578 // experimental: make tagged lines (incl) block bullets/missiles 579 LINEFX_BlockShots = (1 << 7), 580 581 // experimental: make tagged lines (incl) block monster sight 582 LINEFX_BlockSight = (1 << 8), 583 } 584 line_effect_type_e; 585 586 typedef enum 587 { 588 SECTFX_None = 0, 589 590 // transfer sector lighting to tagged floors/ceilings 591 SECTFX_LightFloor = 0x0001, 592 SECTFX_LightCeiling = 0x0002, 593 594 // make tagged floors/ceilings scroll 595 SECTFX_ScrollFloor = 0x0004, 596 SECTFX_ScrollCeiling = 0x0008, 597 598 // push things on tagged floor 599 SECTFX_PushThings = 0x0010, 600 601 // restore light/scroll/push in tagged floors/ceilings 602 SECTFX_ResetFloor = 0x0040, 603 SECTFX_ResetCeiling = 0x0080, 604 605 // experimental: set floor/ceiling texture scale 606 SECTFX_ScaleFloor = 0x0100, 607 SECTFX_ScaleCeiling = 0x0200, 608 609 // experimental: align floor/ceiling texture to line 610 SECTFX_AlignFloor = 0x0400, 611 SECTFX_AlignCeiling = 0x0800, 612 613 // set various force parameters 614 SECTFX_SetFriction = 0x1000, 615 SECTFX_WindForce = 0x2000, 616 SECTFX_CurrentForce = 0x4000, 617 SECTFX_PointForce = 0x8000 618 619 } 620 sector_effect_type_e; 621 622 typedef enum 623 { 624 PORTFX_None = 0, 625 626 PORTFX_Standard = (1 << 0), 627 PORTFX_Mirror = (1 << 1), 628 PORTFX_Camera = (1 << 2), 629 } 630 portal_effect_type_e; 631 632 // -AJA- 2008/03/08: slope types 633 typedef enum 634 { 635 SLP_NONE = 0, 636 637 SLP_DetailFloor = (1 << 0), 638 SLP_DetailCeiling = (1 << 1), 639 } 640 slope_type_e; 641 642 // -AJA- 1999/10/12: Generalised scrolling parts of walls. 643 typedef enum 644 { 645 SCPT_None = 0, 646 647 SCPT_RightUpper = 0x0001, 648 SCPT_RightMiddle = 0x0002, 649 SCPT_RightLower = 0x0004, 650 651 SCPT_LeftUpper = 0x0010, 652 SCPT_LeftMiddle = 0x0020, 653 SCPT_LeftLower = 0x0040, 654 655 SCPT_LeftRevX = 0x0100, 656 SCPT_LeftRevY = 0x0200 657 } 658 scroll_part_e; 659 660 #define SCPT_RIGHT ((scroll_part_e)(SCPT_RightUpper | SCPT_RightMiddle | SCPT_RightLower)) 661 #define SCPT_LEFT ((scroll_part_e)(SCPT_LeftUpper | SCPT_LeftMiddle | SCPT_LeftLower)) 662 663 // -AJA- 1999/12/07: Linedef special flags 664 typedef enum 665 { 666 LINSP_None = 0, 667 668 // player must be able to vertically reach this linedef to press it 669 LINSP_MustReach = (1 << 0), 670 671 // don't change the texture on other linedefs with the same tag 672 LINSP_SwitchSeparate = (1 << 1), 673 674 // -AJA- 2007/09/14: for SECTOR_EFFECT with no tag 675 LINSP_BackSector = (1 << 2), 676 } 677 line_special_e; 678 679 // --> Line definition type class 680 681 class linetype_c 682 { 683 public: 684 linetype_c(); 685 ~linetype_c(); 686 687 public: 688 void Default(void); 689 void CopyDetail(linetype_c &src); 690 691 // Member vars.... 692 int number; 693 694 // Linedef will change to this. 695 int newtrignum; 696 697 // Determines whether line is shootable/walkable/pushable 698 trigger_e type; 699 700 // Determines whether line is acted on by monsters/players/projectiles 701 trigacttype_e obj; 702 703 // Keys required to use 704 keys_e keys; 705 706 // Number of times this line can be triggered. -1 = Any amount 707 int count; 708 709 // Floor 710 movplanedef_c f; 711 712 // Ceiling 713 movplanedef_c c; 714 715 // Donut 716 donutdef_c d; 717 718 // Slider 719 sliding_door_c s; 720 721 // Ladder -AJA- 2001/03/10 722 ladderdef_c ladder; 723 724 // Teleporter 725 teleportdef_c t; 726 727 // LIGHT SPECIFIC 728 // Things may be added here; start strobing/flashing glowing lights. 729 lightdef_c l; 730 731 // EXIT SPECIFIC 732 exittype_e e_exit; 733 int hub_exit; 734 735 // SCROLLER SPECIFIC 736 float s_xspeed; 737 float s_yspeed; 738 scroll_part_e scroll_parts; 739 740 // -ACB- 1998/09/11 Message handling 741 epi::strent_c failedmessage; 742 743 // -AJA- 2011/01/14: sound for unusable locked door 744 struct sfx_s *failed_sfx; 745 746 // Colourmap changing 747 // -AJA- 1999/07/09: Now uses colmap.ddf 748 const colourmap_c *use_colourmap; 749 750 // Property Transfers (FLO_UNUSED if unset) 751 float gravity; 752 float friction; 753 float viscosity; 754 float drag; 755 756 // Ambient sound transfer 757 struct sfx_s *ambient_sfx; 758 759 // Activation sound (overrides the switch sound) 760 struct sfx_s *activate_sfx; 761 762 int music; 763 764 // Automatically trigger this line at level start ? 765 bool autoline; 766 767 // Activation only possible from right side of line 768 bool singlesided; 769 770 // -AJA- 1999/06/21: Extra floor handling 771 extrafloordef_c ef; 772 773 // -AJA- 1999/06/30: TRANSLUCENT MID-TEXTURES 774 percent_t translucency; 775 776 // -AJA- 1999/10/24: Appearance control. 777 when_appear_e appear; 778 779 // -AJA- 1999/12/07: line special flags 780 line_special_e special_flags; 781 782 // -AJA- 2000/01/09: enable (if +1) or disable (if -1) all radius 783 // triggers with the same tag as the linedef. 784 int trigger_effect; 785 786 // -AJA- 2000/09/28: BOOM compatibility fields (and more !). 787 line_effect_type_e line_effect; 788 scroll_part_e line_parts; 789 790 sector_effect_type_e sector_effect; 791 portal_effect_type_e portal_effect; 792 793 slope_type_e slope_type; 794 795 // -AJA- 2007/07/05: color for effects (e.g. MIRRORs) 796 rgbcol_t fx_color; 797 798 private: 799 // disable copy construct and assignment operator linetype_c(linetype_c & rhs)800 explicit linetype_c(linetype_c &rhs) { } 801 linetype_c& operator= (linetype_c &rhs) { return *this; } 802 }; 803 804 805 // --> Linetype container class 806 807 class linetype_container_c : public epi::array_c 808 { 809 public: 810 linetype_container_c(); 811 ~linetype_container_c(); 812 813 private: 814 void CleanupObject(void *obj); 815 816 linetype_c* lookup_cache[LOOKUP_CACHESIZE]; 817 818 public: 819 // List Management GetSize()820 int GetSize() { return array_entries; } Insert(linetype_c * l)821 int Insert(linetype_c *l) { return InsertObject((void*)&l); } 822 linetype_c* Lookup(int num); 823 linetype_c* operator[](int idx) { return *(linetype_c**)FetchObject(idx); } 824 void Reset(); 825 }; 826 827 // ------------------------------------------------------------------ 828 // -------------------------SECTOR TYPES----------------------------- 829 // ------------------------------------------------------------------ 830 831 // -AJA- 1999/11/25: Sector special flags 832 typedef enum 833 { 834 SECSP_None = 0x0000, 835 836 // apply damage whenever in whole region (not just touching floor) 837 SECSP_WholeRegion = 0x0001, 838 839 // goes with above: damage is proportional to how deep you're in 840 // Also affects pushing sectors. 841 SECSP_Proportional = 0x0002, 842 843 // push _all_ things, including NOGRAVITY ones 844 SECSP_PushAll = 0x0008, 845 846 // the push force is constant, regardless of the mass 847 SECSP_PushConstant = 0x0010, 848 849 // breathing support: this sector contains no air. 850 SECSP_AirLess = 0x0020, 851 852 // player can swim in this sector 853 SECSP_Swimming = 0x0040 854 } 855 sector_flag_e; 856 857 class sectortype_c 858 { 859 public: 860 sectortype_c(); 861 ~sectortype_c(); 862 863 public: 864 void Default(void); 865 void CopyDetail(sectortype_c &src); 866 867 // Member vars.... 868 int number; 869 870 // This sector gives you secret count 871 bool secret; 872 bool crush; 873 874 // Hub entry, player starts are treated differently 875 bool hub; 876 877 // Gravity 878 float gravity; 879 float friction; 880 float viscosity; 881 float drag; 882 883 // Movement 884 movplanedef_c f, c; 885 886 // Lighting 887 lightdef_c l; 888 889 // Slime 890 damage_c damage; 891 892 // -AJA- 1999/11/25: sector special flags 893 sector_flag_e special_flags; 894 895 // Exit. Also disables god mode. 896 exittype_e e_exit; 897 898 // Colourmap changing 899 // -AJA- 1999/07/09: Now uses colmap.ddf 900 const colourmap_c *use_colourmap; 901 902 // Ambient sound transfer 903 struct sfx_s *ambient_sfx; 904 905 // -AJA- 2008/01/20: Splash sounds 906 struct sfx_s *splash_sfx; 907 908 // -AJA- 1999/10/24: Appearance control. 909 when_appear_e appear; 910 911 // -AJA- 2000/04/16: Pushing (fixed direction). 912 float push_speed; 913 float push_zspeed; 914 angle_t push_angle; 915 916 private: 917 // disable copy construct and assignment operator sectortype_c(sectortype_c & rhs)918 explicit sectortype_c(sectortype_c &rhs) { } 919 sectortype_c& operator= (sectortype_c &rhs) { return *this; } 920 }; 921 922 923 // --> Sectortype container class 924 925 class sectortype_container_c : public epi::array_c 926 { 927 public: 928 sectortype_container_c(); 929 ~sectortype_container_c(); 930 931 private: 932 void CleanupObject(void *obj); 933 934 sectortype_c* lookup_cache[LOOKUP_CACHESIZE]; 935 936 public: 937 // List Management GetSize()938 int GetSize() { return array_entries; } Insert(sectortype_c * s)939 int Insert(sectortype_c *s) { return InsertObject((void*)&s); } 940 sectortype_c* Lookup(int num); 941 sectortype_c* operator[](int idx) { return *(sectortype_c**)FetchObject(idx); } 942 void Reset(); 943 }; 944 945 946 /* EXTERNALISATIONS */ 947 948 extern linetype_container_c linetypes; // -ACB- 2004/07/05 Implemented 949 extern sectortype_container_c sectortypes; // -ACB- 2004/07/05 Implemented 950 951 bool DDF_ReadLines(void *data, int size); 952 bool DDF_ReadSectors(void *data, int size); 953 954 #endif // __DDF_LINE_H__ 955 956 //--- editor settings --- 957 // vi:ts=4:sw=4:noexpandtab 958