xoreos
0.0.5
|
A texture. More...
#include <texture.h>
Public Member Functions | |
virtual | ~Texture () |
uint32 | getWidth () const |
uint32 | getHeight () const |
bool | hasAlpha () const |
virtual bool | isDynamic () const |
Is this a dynamic texture, or a shared static one? More... | |
const TXI & | getTXI () const |
Return the TXI. More... | |
const ImageDecoder & | getImage () const |
Return the image. More... | |
virtual bool | reload () |
Try to reload the texture. 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 |
Static Public Member Functions | |
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 | |
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 | |
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 | |
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... | |
|
virtual |
Definition at line 69 of file texture.cpp.
References Graphics::Texture::_textureID, GfxMan, and removeFromQueues().
|
protected |
Definition at line 58 of file texture.cpp.
Referenced by create().
|
protected |
Definition at line 61 of file texture.cpp.
References addToQueues().
|
protected |
Definition at line 407 of file texture.cpp.
References Graphics::Queueable::addToQueue(), Graphics::kQueueNewTexture, and Graphics::kQueueTexture.
Referenced by Graphics::Aurora::PLTFile::load(), refresh(), reload(), and Texture().
|
static |
Create a texture from this image resource.
Definition at line 323 of file texture.cpp.
References Common::StackException::add(), ARRAYSIZE, Common::UString::c_str(), Common::composeString(), createPLT(), Graphics::TXI::Features::cube, Graphics::TXI::Features::fileRange, Graphics::TXI::getFeatures(), Aurora::kFileTypeNone, Aurora::kFileTypePLT, Aurora::kResourceImage, loadImage(), loadTXI(), ResMan, and Texture().
Referenced by Graphics::Aurora::ModelNode_NWN2::createTint(), Graphics::Aurora::NFTRFont::drawGlyphs(), Graphics::Aurora::ModelNode_DragonAge::fixTexturesAlpha(), Graphics::Aurora::ModelNode_DragonAge::fixTexturesHair(), Graphics::Aurora::TextureManager::get(), Graphics::Aurora::Cursor::load(), Engines::Sonic::AreaMiniMap::loadMiniMap(), Engines::Sonic::loadNCGR(), Engines::Sonic::AreaBackground::loadTexture(), and Graphics::Aurora::TTFFont::Page::Page().
|
static |
Take over the image and create a texture from it.
Definition at line 376 of file texture.cpp.
References Graphics::ImageDecoder::getMipMapCount(), and Texture().
|
protected |
Definition at line 256 of file texture.cpp.
References _image, Graphics::Texture::_textureID, setAlign(), setFilter(), setMipMapData(), setMipMaps(), and setWrap().
Referenced by doRebuild().
|
protected |
Definition at line 277 of file texture.cpp.
References _image, Graphics::Texture::_textureID, setAlign(), setFilter(), setMipMapData(), setMipMaps(), and setWrap().
Referenced by doRebuild().
|
staticprotected |
Definition at line 310 of file texture.cpp.
Referenced by create().
|
protectedvirtual |
Implements Graphics::GLContainer.
Definition at line 146 of file texture.cpp.
References Graphics::Texture::_textureID.
|
protectedvirtual |
Implements Graphics::GLContainer.
Definition at line 155 of file texture.cpp.
References _image, Graphics::Texture::_textureID, create2DTexture(), and createCubeMapTexture().
bool Graphics::Aurora::Texture::dumpTGA | ( | const Common::UString & | fileName | ) | const |
uint32 Graphics::Aurora::Texture::getHeight | ( | ) | const |
Definition at line 80 of file texture.cpp.
References _height.
Referenced by Graphics::Aurora::BorderQuad::BorderQuad(), Graphics::Aurora::ABCFont::calcCharVertices(), Graphics::Aurora::Model_Sonic::createPrimitives(), Engines::Sonic::AreaBackground::getImageHeight(), Engines::WidgetScrollbar::load(), Engines::WidgetCheckBox::load(), Engines::KotORInventoryItem::load(), Graphics::Aurora::TextureFont::load(), and Engines::Sonic::AreaBackground::setPosition().
const ImageDecoder & Graphics::Aurora::Texture::getImage | ( | ) | const |
Return the image.
Definition at line 106 of file texture.cpp.
References _image.
Referenced by Graphics::Aurora::ModelNode_Witcher::buildMaterial(), and Graphics::Aurora::ModelNode::buildMaterial().
const TXI & Graphics::Aurora::Texture::getTXI | ( | ) | const |
Return the TXI.
Definition at line 96 of file texture.cpp.
References _image, _txi, and Graphics::Aurora::kEmptyTXI.
Referenced by Graphics::Aurora::GUIQuad::GUIQuad(), Graphics::Aurora::TextureFont::load(), and setFilter().
uint32 Graphics::Aurora::Texture::getWidth | ( | ) | const |
Definition at line 76 of file texture.cpp.
References _width.
Referenced by Graphics::Aurora::BorderQuad::BorderQuad(), Graphics::Aurora::ABCFont::calcCharVertices(), Graphics::Aurora::Model_Sonic::createPrimitives(), Engines::Sonic::AreaBackground::getImageWidth(), Engines::WidgetCheckBox::load(), Graphics::Aurora::TextureFont::load(), and Engines::Sonic::AreaBackground::setPosition().
bool Graphics::Aurora::Texture::hasAlpha | ( | ) | const |
Definition at line 84 of file texture.cpp.
References _image.
Referenced by Graphics::Aurora::BorderQuad::render(), Graphics::Aurora::CubeSide::render(), Engines::NWN::Portrait::render(), and Graphics::Aurora::GUIQuad::render().
|
virtual |
Is this a dynamic texture, or a shared static one?
Reimplemented in Graphics::Aurora::PLTFile.
Definition at line 91 of file texture.cpp.
Referenced by Graphics::Aurora::TextureManager::get().
|
static |
Load an image in any of the common texture formats.
Definition at line 401 of file texture.cpp.
Referenced by create(), Graphics::Aurora::ModelNode_NWN2::createTint(), Engines::dumpTGA(), Graphics::Aurora::ModelNode_DragonAge::fixTexturesAlpha(), Graphics::Aurora::ModelNode_DragonAge::fixTexturesHair(), Graphics::Aurora::PLTFile::getLayerPalette(), loadImage(), and reload().
|
static |
Load an image in any of the common texture formats.
Definition at line 422 of file texture.cpp.
References loadImage().
|
staticprotected |
Definition at line 460 of file texture.cpp.
References Graphics::TXI::Features::cube, Graphics::ImageDecoder::decompress(), Graphics::TXI::Features::fileRange, Graphics::TXI::getFeatures(), Graphics::ImageDecoder::getMipMapCount(), GfxMan, Aurora::kFileTypeDDS, Aurora::kFileTypeSBM, Aurora::kFileTypeTGA, Aurora::kFileTypeTPC, Aurora::kFileTypeTXB, and Aurora::kFileTypeXEOSITEX.
|
staticprotected |
Definition at line 426 of file texture.cpp.
References ARRAYSIZE, Common::UString::c_str(), Common::composeString(), Graphics::TXI::Features::cube, Graphics::TXI::Features::fileRange, Graphics::TXI::getFeatures(), Aurora::kResourceImage, loadImage(), and ResMan.
|
staticprotected |
Definition at line 502 of file texture.cpp.
References Common::UString::c_str(), Common::exceptionDispatcherWarning(), Aurora::kFileTypeTXI, and ResMan.
Referenced by create(), and reload().
|
protected |
Definition at line 417 of file texture.cpp.
References addToQueues(), and removeFromQueues().
Referenced by Graphics::Aurora::PLTFile::rebuild().
|
virtual |
Try to reload the texture.
Reimplemented in Graphics::Aurora::PLTFile.
Definition at line 112 of file texture.cpp.
References _deswizzle, _name, Common::StackException::add(), addToQueues(), Common::UString::c_str(), Common::UString::empty(), Aurora::kFileTypeNone, loadImage(), loadTXI(), and removeFromQueues().
|
protected |
Definition at line 412 of file texture.cpp.
References Graphics::kQueueNewTexture, Graphics::kQueueTexture, and Graphics::Queueable::removeFromQueue().
Referenced by refresh(), reload(), and ~Texture().
|
protected |
Definition at line 386 of file texture.cpp.
References _deswizzle, _height, _image, _name, _txi, _type, and _width.
|
protected |
Definition at line 177 of file texture.cpp.
References _image, Graphics::kPixelFormatDXT1, Graphics::kPixelFormatDXT3, Graphics::kPixelFormatDXT5, Graphics::kPixelFormatRGB5, Graphics::kPixelFormatRGB5A1, Graphics::kPixelFormatRGB8, and Graphics::kPixelFormatRGBA8.
Referenced by create2DTexture(), and createCubeMapTexture().
|
protected |
Definition at line 216 of file texture.cpp.
References Graphics::TXI::Features::filter, Graphics::TXI::getFeatures(), and getTXI().
Referenced by create2DTexture(), and createCubeMapTexture().
|
protected |
Definition at line 244 of file texture.cpp.
References _image, Graphics::ImageDecoder::MipMap::data, Common::ScopedPtrBase< T, Deallocator >::get(), Graphics::glCompressedTexImage2D, Graphics::ImageDecoder::MipMap::height, Graphics::ImageDecoder::MipMap::size, and Graphics::ImageDecoder::MipMap::width.
Referenced by create2DTexture(), and createCubeMapTexture().
|
protected |
Definition at line 228 of file texture.cpp.
References _image.
Referenced by create2DTexture(), and createCubeMapTexture().
|
protected |
Definition at line 172 of file texture.cpp.
Referenced by create2DTexture(), and createCubeMapTexture().
|
protected |
|
protected |
Definition at line 93 of file texture.h.
Referenced by Graphics::Aurora::PLTFile::build(), getHeight(), and set().
|
protected |
The actual image.
Definition at line 89 of file texture.h.
Referenced by create2DTexture(), createCubeMapTexture(), doRebuild(), dumpTGA(), getImage(), getTXI(), hasAlpha(), set(), setAlign(), setMipMapData(), and setMipMaps().
|
protected |
|
protected |
|
protected |
|
protected |
Definition at line 92 of file texture.h.
Referenced by Graphics::Aurora::PLTFile::build(), getWidth(), and set().