Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Doomwad::Sector Class Reference

Inheritance diagram for Doomwad::Sector:

Doomwad::WadEntryElement List of all members.

Detailed Description

Represents a single Sector in a map.

See also:
Sectors Sidedef
Sectors are the empty space between linedefs. While lines determine walls and other vertical structures (e.g. stair steps), sectors describe what appears between walls. They have floor and ceiling heights and textures. This determines the basic appearance. They have a light level that actually spills over and lights the sidedefs facing this sector and any things inside it. Optionally, they have tags that link to linedefs, so the player may teleport in, trigger a door sector, start a crushing ceiling, et al. Finally, they have a type. This can give the sector lighting effects such as blinking or glowing, damage effects such as lava or nukage, or make it count for the secret total of the level.

Definition at line 80 of file sectors.hpp.

Public Member Functions

virtual size_t getLength (void) const throw ()
 Get the length of an element.
virtual bool read (const Lump &lump, Lump::size_type i) throw ()
 Read this element from a Lump.
 Sector (int16=0, int16=0, const std::string &=NOFLAT, const std::string &=NOFLAT, uint16=0, uint16=0, uint16=0) throw ()
 Sector constructor.
virtual std::string toString (void) const throw ()
 Convert this element to a string.
virtual bool write (Lump &lump, Lump::size_type i) const throw ()
 Write this element into a Lump.
virtual ~Sector (void) throw ()
 Sector destructor.

Static Public Member Functions

static uint16 makeGeneralized (uint16) throw ()
 Make a generalized sector type.

Public Attributes

std::string flat_ceil
 Ceiling flat name.
std::string flat_floor
 Floor flat name.
uint16 light
 Light level.
uint16 tag
 Linedef tag.
uint16 type
 Sector type, i.e. blinks, secret, etc.
int16 z_ceil
 Ceiling height.
int16 z_floor
 Floor height.

Static Public Attributes

static const uint16 DAMAGE_10 = 0x0040
 (Boom Generalized) Causes 10% damage per second.
static const uint16 DAMAGE_20 = 0x0060
 (Boom Generalized) Causes 20% damage per second.
static const uint16 DAMAGE_5 = 0x0020
 (Boom Generalized) Causes 5% damage per second.
static const uint16 FRICTION = 0x0100
 (Boom Generalized) Enable friction.
static const uint16 GENERALIZED_MASK = 0x01FF
 Masks the Generalized bits of a type, exposing the standard Doom type bits.
static const uint16 INVALID = 0xFFFF
 Invalid Generalized type.
static const size_t LENGTH = 0x0000001A
 Length of a single record.
static const uint16 LIGHT_BLINK_DAMAGE = 0x0004
 Blinks and causes damage.
static const uint16 LIGHT_BLINK_HALF = 0x0002
 Blinks on every half second.
static const uint16 LIGHT_BLINK_HALF_SYNC = 0x000C
 Blinks on every half second, synchronized with other sectors.
static const uint16 LIGHT_BLINK_SEC = 0x0003
 Blinks on every second.
static const uint16 LIGHT_BLINK_SEC_SYNC = 0x000D
 Blinks on every second, synchronized with other sectors.
static const uint16 LIGHT_FLICKER = 0x0011
 Flickers on and off, including intermediate light values.
static const uint16 LIGHT_OSCILLATE = 0x0008
 Oscillates between on and off.
static const uint16 LIGHT_RANDOM = 0x0001
 Sector blinks randomly.
static const uint16 NO_MOTION_SOUND = 0x0800
 (Boom Generalized) Moving floors and ceiling in this sector do not emit sound.
static const uint16 NO_SOUND = 0x0400
 (Boom Generalized) Nothing in this sector emits sound.
static const std::string NOFLAT = "-"
static const uint16 NORMAL = 0x0000
 No sector special effects.
static const uint16 SECRET = 0x0080
 (Boom Generalized) Counts toward the level's secret total.
static const uint16 WIND = 0x0200
 (Boom Generalized) Enable wind.


Constructor & Destructor Documentation

Sector::Sector int16  _z_f = 0,
int16  _z_c = 0,
const std::string &  _flat_f = NOFLAT,
const std::string &  _flat_c = NOFLAT,
uint16  _light = 0,
uint16  _type = 0,
uint16  _tag = 0
throw ()
 

Sector constructor.

Constructs a Sector object.

Parameters:
_z_f Floor height.
_z_c Ceiling height.
_flat_f Floor flat.
_flat_c Ceiling flat.
_light Light level (0-255). The original game and most ports have breakpoints at multiples of 16.
_type Type. Most types involve lighting effects.
_tag Linedef tag for special effects.

Definition at line 92 of file sectors.cpp.

Sector::~Sector void   )  throw () [virtual]
 

Sector destructor.

Destroys a Sector object.

Definition at line 101 of file sectors.cpp.


Member Function Documentation

size_t Sector::getLength void   )  const throw () [virtual]
 

Get the length of an element.

Each element record type has a length. Some are fixed, in which case this function returns that length. Some records are variable-length, in which case this function returns zero.

Returns:
Length of the record.

Implements Doomwad::WadEntryElement.

Definition at line 116 of file sectors.cpp.

References LENGTH.

uint16 Sector::makeGeneralized uint16  flags  )  throw () [static]
 

Make a generalized sector type.

This function is not strictly necessary, but does provide error correction for generalized types.

Definition at line 165 of file sectors.cpp.

bool Sector::read const Lump lump,
Lump::size_type  i
throw () [virtual]
 

Read this element from a Lump.

Read one element from a Lump at the specified index.

Parameters:
lump Reference to the target Lump.
i Index into the Lump's buffer.
Returns:
True if successful, false if not.

Implements Doomwad::WadEntryElement.

Definition at line 140 of file sectors.cpp.

Referenced by Doomwad::Sectors::setFromLump().

std::string Sector::toString void   )  const throw () [virtual]
 

Convert this element to a string.

The format of the string will vary from class to class, but every subclass must be able to format itself as a string. IMPORTANT: this string representation is not guaranteed to preserve all data. Reading back in is not supported. This function's goal is to make the object's state user-readable, not machine-readable.

Returns:
std::string object containing object state.

Implements Doomwad::WadEntryElement.

Definition at line 105 of file sectors.cpp.

References flat_ceil, flat_floor, light, tag, type, z_ceil, and z_floor.

bool Sector::write Lump lump,
Lump::size_type  i
const throw () [virtual]
 

Write this element into a Lump.

Write one element into a Lump at the specified index.

Parameters:
lump Reference to the target Lump.
i Index into the Lump's buffer.
Returns:
True if successful, false if not.

Implements Doomwad::WadEntryElement.

Definition at line 121 of file sectors.cpp.


Member Data Documentation

const std::string Sector::NOFLAT = "-" [static]
 

Value of a Sector's flat when there is none. This should never happen, but it needs to be set to something before the user can select one.

Definition at line 51 of file sectors.cpp.


Generated on Fri Jun 10 19:38:52 2005 for libdoomwad by  doxygen 1.4.0