xoreos
0.0.5
|
#include <pltfile.h>
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 TXI & | getTXI () const |
Return the TXI. More... | |
const ImageDecoder & | getImage () 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 ImageDecoder * | getLayerPalette (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 ImageDecoder * | loadImage (const Common::UString &name, bool deswizzle=false) |
Load an image in any of the common texture formats. More... | |
static ImageDecoder * | loadImage (const Common::UString &name, ::Aurora::FileType &type, bool deswizzle=false) |
Load an image in any of the common texture formats. More... | |
static Texture * | create (const Common::UString &name, bool deswizzle=false) |
Create a texture from this image resource. More... | |
static Texture * | create (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 TXI * | loadTXI (const Common::UString &name) |
static ImageDecoder * | loadImage (Common::SeekableReadStream *imageStream, ::Aurora::FileType type, TXI *txi=0, bool deswizzle=false) |
static ImageDecoder * | loadImage (const Common::UString &name, ::Aurora::FileType &type, TXI *txi, bool deswizzle=false) |
static Texture * | createPLT (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... | |
Graphics::Aurora::PLTFile::~PLTFile | ( | ) |
Definition at line 79 of file pltfile.cpp.
|
private |
Definition at line 70 of file pltfile.cpp.
References _colors, kLayerMAX, and load().
|
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().
|
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().
|
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().
|
virtual |
Is this a dynamic texture, or a shared static one?
Reimplemented from Graphics::Aurora::Texture.
Definition at line 82 of file pltfile.cpp.
|
private |
Definition at line 102 of file pltfile.cpp.
References _dataImage, _dataLayers, Aurora::AuroraFile::_id, _name, _surface, Aurora::AuroraFile::_version, Graphics::Aurora::Texture::addToQueues(), Common::debugTag(), Graphics::Surface::fill(), Common::ScopedPtrBase< T, Deallocator >::get(), Aurora::kFileTypePLT, kLayerMAX, kPLTID, kVersion1, Common::SeekableReadStream::pos(), Common::ReadStream::readByte(), Common::ReadStream::readUint32LE(), Common::ScopedPtrBase< T, Deallocator >::reset(), Common::SeekableReadStream::size(), and Common::SeekableReadStream::skip().
Referenced by PLTFile().
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().
|
virtual |
Try to reload the texture.
Reimplemented from Graphics::Aurora::Texture.
Definition at line 86 of file pltfile.cpp.
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().
Definition at line 75 of file pltfile.h.
Referenced by build(), PLTFile(), and setLayerColor().
|
private |
|
private |
|
private |
|
private |