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

Doomwad::PlayPal Class Reference

Inheritance diagram for Doomwad::PlayPal:

Doomwad::WadEntry List of all members.

Detailed Description

Represents a PLAYPAL wad entry.

See also:
ColorMap WadEntry
PLAYPAL is a collection of 14 palettes used for showing red when the player is hurt, flashes when picking up items, green when wearing a radiation suit, and of course, normal usage. It works with the ColorMap resource to display colors of various light levels on screen.

PLAYPAL Palettes:
0 normal
1 unknown
2 pain (lightest), berserk
3 pain, berserk
4 pain
5 pain
6 pain
7 pain
8 pain (worst)
9 unknown
10 item pickup (bright)
11 item pickup (brighter)
12 item pickup (brightest)
13 radiation suit

Definition at line 86 of file playpal.hpp.

Public Member Functions

 PlayPal (const Lump &) throw ()
 Construct from a Lump.
 PlayPal (void) throw ()
 Default constructor.
virtual bool setFromLump (const Lump &lump) throw ()
 Convert a Lump to this entry.
virtual Lump toLump (void) const throw ()
 Convert this entry to a Lump.
virtual std::string toString (void) const throw ()
 Convert this entry to a std::string.
virtual ~PlayPal (void) throw ()
 Destructor.

Static Public Attributes

static const std::string NAME = "PLAYPAL"
 Name of an entry.


Constructor & Destructor Documentation

PlayPal::PlayPal const Lump lump  )  throw ()
 

Construct from a Lump.

Parameters:
lump Source Lump.

Definition at line 60 of file playpal.cpp.

References setFromLump().


Member Function Documentation

bool PlayPal::setFromLump const Lump lump  )  throw () [virtual]
 

Convert a Lump to this entry.

Lumps should not know about specific data structures. Those structures know about Lumps, including how to convert from them.

Setting from a Lump involves parsing that Lump's contents to see if they are valid. If they are, then this object will contain what you expect it to. If not, it will return false and the atomic operation will not succeed.

Parameters:
lump Reference to a source Lump object.
Returns:
True if successful, false if not.

Implements Doomwad::WadEntry.

Definition at line 74 of file playpal.cpp.

Referenced by PlayPal().

Lump PlayPal::toLump void   )  const throw () [virtual]
 

Convert this entry to a Lump.

Each subclass must be able to convert itself to a Lump for storage in a Wad.

Returns:
Lump containing the raw file representation of this entry.

Implements Doomwad::WadEntry.

Definition at line 81 of file playpal.cpp.

References NAME.

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

Convert this entry to a std::string.

The exact implementation varies by the exact concrete class, but the idea is to convert the entry into a summary to be displayed to the user. Please note that converting to a string may lose information. This is not serialization in the purest sense of the word, this is merely a quick and dirty user-readable summary of the entry.

True serialization is achieved by converting a Lump object and using its stream I/O functions to read and write.

Returns:
std::string containing a summary of this entry.

Implements Doomwad::WadEntry.

Definition at line 88 of file playpal.cpp.


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