xoreos  0.0.5
Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
Graphics::Aurora::PLTFile Class Reference

#include <pltfile.h>

Inheritance diagram for Graphics::Aurora::PLTFile:
Inheritance graph
[legend]
Collaboration diagram for Graphics::Aurora::PLTFile:
Collaboration graph
[legend]

Public Types

enum  Layer {
  kLayerSkin = 0, kLayerHair = 1, kLayerMetal1 = 2, kLayerMetal2 = 3,
  kLayerCloth1 = 4, kLayerCloth2 = 5, kLayerLeather1 = 6, kLayerLeather2 = 7,
  kLayerTattoo1 = 8, kLayerTattoo2 = 9, kLayerMAX
}
 

Public Member Functions

 ~PLTFile ()
 
void setLayerColor (Layer layer, uint8 color)
 Set the color of one layer within this layer texture. More...
 
void rebuild ()
 Rebuild the combined texture image. More...
 
bool isDynamic () const
 Is this a dynamic texture, or a shared static one? More...
 
bool reload ()
 Try to reload the texture. More...
 
- Public Member Functions inherited from Aurora::AuroraFile
 AuroraFile ()
 
void clear ()
 
uint32 getID () const
 Return the file's ID. More...
 
uint32 getVersion () const
 Return the file's version. More...
 
bool isUTF16LE () const
 Were the ID and version encoded in little-endian UTF-16 in the file? More...
 
- Public Member Functions inherited from Graphics::Aurora::Texture
virtual ~Texture ()
 
uint32 getWidth () const
 
uint32 getHeight () const
 
bool hasAlpha () const
 
const TXIgetTXI () const
 Return the TXI. More...
 
const ImageDecodergetImage () const
 Return the image. More...
 
bool dumpTGA (const Common::UString &fileName) const
 Dump the texture into a TGA. More...
 
- Public Member Functions inherited from Graphics::Texture
 Texture ()
 
 ~Texture ()
 
TextureID getID () const
 
- Public Member Functions inherited from Graphics::GLContainer
 GLContainer ()
 
 ~GLContainer ()
 
void rebuild ()
 
void destroy ()
 
- Public Member Functions inherited from Graphics::Queueable
 Queueable ()
 
virtual ~Queueable ()
 
virtual bool operator< (const Queueable &q) const
 

Private Member Functions

 PLTFile (const Common::UString &name, Common::SeekableReadStream &plt)
 
void load (Common::SeekableReadStream &plt)
 
void build ()
 

Static Private Member Functions

static ImageDecodergetLayerPalette (uint32 layer, uint8 row)
 Load a specific layer palette image and perform some sanity checks. More...
 
static void getColorRows (byte rows[4 *256 *kLayerMAX], const uint8 colors[kLayerMAX])
 

Private Attributes

Common::UString _name
 
Surface_surface
 
Common::ScopedArray< uint8_dataImage
 
Common::ScopedArray< uint8_dataLayers
 
uint8 _colors [kLayerMAX]
 

Friends

class Texture
 

Additional Inherited Members

- Static Public Member Functions inherited from Aurora::AuroraFile
static void readHeader (Common::ReadStream &stream, uint32 &id, uint32 &version, bool &utf16le)
 Read the header out of a stream. More...
 
static void readHeader (Common::ReadStream &stream, uint32 &id, uint32 &version)
 Read the ID and version out of a stream. More...
 
static uint32 readHeaderID (Common::ReadStream &stream)
 Read the ID out of a stream. More...
 
- Static Public Member Functions inherited from Graphics::Aurora::Texture
static ImageDecoderloadImage (const Common::UString &name, bool deswizzle=false)
 Load an image in any of the common texture formats. More...
 
static ImageDecoderloadImage (const Common::UString &name, ::Aurora::FileType &type, bool deswizzle=false)
 Load an image in any of the common texture formats. More...
 
static Texturecreate (const Common::UString &name, bool deswizzle=false)
 Create a texture from this image resource. More...
 
static Texturecreate (ImageDecoder *image, ::Aurora::FileType type=::Aurora::kFileTypeNone, TXI *txi=0, bool deswizzle=false)
 Take over the image and create a texture from it. More...
 
- Protected Member Functions inherited from Aurora::AuroraFile
void readHeader (Common::ReadStream &stream)
 
- Protected Member Functions inherited from Graphics::Aurora::Texture
 Texture ()
 
 Texture (const Common::UString &name, ImageDecoder *image, ::Aurora::FileType type, TXI *txi=0, bool deswizzle=false)
 
void set (const Common::UString &name, ImageDecoder *image, ::Aurora::FileType type, TXI *txi, bool deswizzle=false)
 
void addToQueues ()
 
void removeFromQueues ()
 
void refresh ()
 
void doRebuild ()
 
void doDestroy ()
 
void create2DTexture ()
 
void createCubeMapTexture ()
 
void setWrap (GLenum target, GLint wrapModeX, GLint wrapModeY)
 
void setAlign ()
 
void setFilter (GLenum target)
 
void setMipMaps (GLenum target)
 
void setMipMapData (GLenum target, size_t layer, size_t mipMap)
 
- Protected Member Functions inherited from Graphics::Queueable
bool isInQueue (QueueType queue) const
 
void addToQueue (QueueType queue)
 
void removeFromQueue (QueueType queue)
 
void lockQueue (QueueType queue)
 
void unlockQueue (QueueType queue)
 
void sortQueue (QueueType queue)
 
- Static Protected Member Functions inherited from Aurora::AuroraFile
static uint32 convertUTF16LE (uint32 x1, uint32 x2)
 
- Static Protected Member Functions inherited from Graphics::Aurora::Texture
static TXIloadTXI (const Common::UString &name)
 
static ImageDecoderloadImage (Common::SeekableReadStream *imageStream, ::Aurora::FileType type, TXI *txi=0, bool deswizzle=false)
 
static ImageDecoderloadImage (const Common::UString &name, ::Aurora::FileType &type, TXI *txi, bool deswizzle=false)
 
static TexturecreatePLT (const Common::UString &name, Common::SeekableReadStream *imageStream)
 
- Protected Attributes inherited from Aurora::AuroraFile
uint32 _id
 The file's ID. More...
 
uint32 _version
 The file's version. More...
 
bool _utf16le
 The file's ID and version are in little-endian UTF-16. More...
 
- Protected Attributes inherited from Graphics::Aurora::Texture
Common::UString _name
 The name of the texture's image's file. More...
 
::Aurora::FileType _type
 The type of the texture's image's file. More...
 
Common::ScopedPtr< ImageDecoder_image
 The actual image. More...
 
Common::ScopedPtr< TXI_txi
 The TXI. More...
 
uint32 _width
 
uint32 _height
 
bool _deswizzle
 
- Protected Attributes inherited from Graphics::Texture
TextureID _textureID
 OpenGL texture ID. More...
 

Detailed Description

Definition at line 40 of file pltfile.h.

Member Enumeration Documentation

◆ Layer

Enumerator
kLayerSkin 
kLayerHair 
kLayerMetal1 
kLayerMetal2 
kLayerCloth1 
kLayerCloth2 
kLayerLeather1 
kLayerLeather2 
kLayerTattoo1 
kLayerTattoo2 
kLayerMAX 

Definition at line 42 of file pltfile.h.

Constructor & Destructor Documentation

◆ ~PLTFile()

Graphics::Aurora::PLTFile::~PLTFile ( )

Definition at line 79 of file pltfile.cpp.

◆ PLTFile()

Graphics::Aurora::PLTFile::PLTFile ( const Common::UString name,
Common::SeekableReadStream plt 
)
private

Definition at line 70 of file pltfile.cpp.

References _colors, kLayerMAX, and load().

Here is the call graph for this function:

Member Function Documentation

◆ build()

void Graphics::Aurora::PLTFile::build ( )
private

Definition at line 147 of file pltfile.cpp.

References _colors, _dataImage, _dataLayers, Graphics::Aurora::Texture::_height, _surface, Graphics::Aurora::Texture::_width, Common::ScopedPtrBase< T, Deallocator >::get(), getColorRows(), Graphics::Surface::getData(), and kLayerMAX.

Referenced by rebuild().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getColorRows()

void Graphics::Aurora::PLTFile::getColorRows ( byte  rows[4 *256 *kLayerMAX],
const uint8  colors[kLayerMAX] 
)
staticprivate

Definition at line 203 of file pltfile.cpp.

References Common::exceptionDispatcherWarning(), Common::ScopedPtrBase< T, Deallocator >::get(), getLayerPalette(), kLayerMAX, and Graphics::Aurora::kPalettes.

Referenced by build().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLayerPalette()

ImageDecoder * Graphics::Aurora::PLTFile::getLayerPalette ( uint32  layer,
uint8  row 
)
staticprivate

Load a specific layer palette image and perform some sanity checks.

Definition at line 180 of file pltfile.cpp.

References Graphics::ImageDecoder::MipMap::height, kLayerMAX, Graphics::Aurora::kPalettes, Graphics::kPixelFormatBGRA, Graphics::Aurora::Texture::loadImage(), Common::ScopedPtrBase< T, Deallocator >::release(), and Graphics::ImageDecoder::MipMap::width.

Referenced by getColorRows().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isDynamic()

bool Graphics::Aurora::PLTFile::isDynamic ( ) const
virtual

Is this a dynamic texture, or a shared static one?

Reimplemented from Graphics::Aurora::Texture.

Definition at line 82 of file pltfile.cpp.

◆ load()

void Graphics::Aurora::PLTFile::load ( Common::SeekableReadStream plt)
private

◆ rebuild()

void Graphics::Aurora::PLTFile::rebuild ( )

Rebuild the combined texture image.

Definition at line 97 of file pltfile.cpp.

References build(), and Graphics::Aurora::Texture::refresh().

Referenced by Engines::NWN::Creature::finishPLTs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reload()

bool Graphics::Aurora::PLTFile::reload ( )
virtual

Try to reload the texture.

Reimplemented from Graphics::Aurora::Texture.

Definition at line 86 of file pltfile.cpp.

◆ setLayerColor()

void Graphics::Aurora::PLTFile::setLayerColor ( Layer  layer,
uint8  color 
)

Set the color of one layer within this layer texture.

Definition at line 91 of file pltfile.cpp.

References _colors, and kLayerMAX.

Referenced by Engines::NWN::Creature::finishPLTs().

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ Texture

friend class Texture
friend

Definition at line 86 of file pltfile.h.

Member Data Documentation

◆ _colors

uint8 Graphics::Aurora::PLTFile::_colors[kLayerMAX]
private

Definition at line 75 of file pltfile.h.

Referenced by build(), PLTFile(), and setLayerColor().

◆ _dataImage

Common::ScopedArray<uint8> Graphics::Aurora::PLTFile::_dataImage
private

Definition at line 72 of file pltfile.h.

Referenced by build(), and load().

◆ _dataLayers

Common::ScopedArray<uint8> Graphics::Aurora::PLTFile::_dataLayers
private

Definition at line 73 of file pltfile.h.

Referenced by build(), and load().

◆ _name

Common::UString Graphics::Aurora::PLTFile::_name
private

Definition at line 68 of file pltfile.h.

Referenced by load().

◆ _surface

Surface* Graphics::Aurora::PLTFile::_surface
private

Definition at line 70 of file pltfile.h.

Referenced by build(), and load().


The documentation for this class was generated from the following files: