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

Doomwad::Animation Class Reference

Inheritance diagram for Doomwad::Animation:

Doomwad::WadEntryElement List of all members.

Detailed Description

Single animation in an ANIMATED Lump.

See also:
Animated WadEntryElement
While the Animated class represents the whole Lump, each Animation is a single record.

Definition at line 75 of file animated.hpp.

Public Member Functions

 Animation (const std::string &, const std::string &, byte=DEFAULT_TYPE, uint32=DEFAULT_SPEED)
 Constructor.
 Animation (void) throw ()
 Default constructor.
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.
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 ~Animation (void) throw ()
 Destructor.

Public Attributes

std::string first
 First animation in the sequence.
std::string last
 Last animation in the sequence.
uint32 speed
 Number of frames between animations.
byte type
 Animation type.

Static Public Attributes

static const uint32 DEFAULT_SPEED = 0x00000008
 Default animation speed when one is not specified.
static const byte DEFAULT_TYPE = Animation::TEXTURE
 Default animation type when one is not specified.
static const byte FLAT = 0x00
 This animation describes a floor/ceiling flat.
static const size_t LENGTH = 0x00000017
 Length of an Animation record.
static const byte TERMINATE = 0xFF
 This animation is the end of Lump marker.
static const byte TEXTURE = 0x01
 This animation describes a wall texture.


Constructor & Destructor Documentation

Animation::Animation void   )  throw ()
 

Default constructor.

Zeros out the texture/flat names and uses default values for speed and type.

Definition at line 63 of file animated.cpp.

Animation::Animation const std::string &  _first,
const std::string &  _last,
byte  _type = DEFAULT_TYPE,
uint32  _speed = DEFAULT_SPEED
 

Constructor.

The user must specify texture/flat names, the type and speed are optional.

Parameters:
_first First texture/flat in sequence.
_last Last texture/flat in sequence.
_type Type of animation.
_speed Animation speed.

Definition at line 81 of file animated.cpp.


Member Function Documentation

size_t Animation::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 94 of file animated.cpp.

References LENGTH.

bool Animation::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 115 of file animated.cpp.

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

std::string Animation::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 131 of file animated.cpp.

References first, last, speed, and type.

Referenced by Doomwad::Animated::toString().

bool Animation::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 99 of file animated.cpp.

Referenced by Doomwad::Animated::toLump().


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