Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Namespace Members   Compound Members  

PLMResource Class Reference

Resource object. More...

#include <PLMResource.hpp>

Inheritance diagram for PLMResource:

Inheritance graph
[legend]
List of all members.

Public Types

enum  { FORMAT_UNK = 0, FORMAT_DEF = 1 }

Public Methods

virtual u32 MemoryUsed () const=0
virtual bool Load (PLMResFile &src, int format=FORMAT_UNK)=0
virtual bool Save (PLMResFile &dest, int format=FORMAT_DEF)=0
virtual bool LoadName (const char *filename, int format=FORMAT_UNK)
virtual bool SaveName (const char *filename, int format=FORMAT_DEF)

Detailed Description

Resource object.

A resource is a piece of data used by an application. It can be some text, an image, a sound, a font, a palette, ... All resources can be loaded from a file and saved to a file. This class is just an interface for all resources. A resource should also have a constructor with a PLMResFile&.


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
FORMAT_UNK  unknown format (usually for load)
FORMAT_DEF  default format (usually for save)


Member Function Documentation

virtual u32 PLMResource::MemoryUsed   [pure virtual]
 

Get the total amount of memory used by this resource.

Implemented in PLMFont, PLMImage, PLMPal, PLMText, PLMMusic, PLMSound, and P3DFont.

virtual bool PLMResource::Load PLMResFile   src,
int    format = FORMAT_UNK
[pure virtual]
 

Load data from the file src, using a specific format.

Implemented in PLMFont, PLMImage, PLMPal, PLMText, PLMMusic, PLMSound, and P3DFont.

virtual bool PLMResource::Save PLMResFile   dest,
int    format = FORMAT_DEF
[pure virtual]
 

Save data to the file dest, using a specific format.

Implemented in PLMFont, PLMImage, PLMPal, PLMText, PLMMusic, PLMSound, and P3DFont.

virtual bool PLMResource::LoadName const char *    filename,
int    format = FORMAT_UNK
[virtual]
 

Load data from the file filename.

Reimplemented in PLMMusic.

virtual bool PLMResource::SaveName const char *    filename,
int    format = FORMAT_DEF
[virtual]
 

Save data to the file filename.


The documentation for this class was generated from the following file:
  • PLMResource.hpp

Generated by Doxygen 1.2.18 on Tue Oct 26 12:07:44 2004.