xoreos  0.0.5
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
Graphics Namespace Reference

Namespaces

 Aurora
 
 Mesh
 
 Render
 
 Shader
 

Classes

class  CameraManager
 
class  CBGT
 Loader for CBGT, BioWare's Compressed BackGround Tiles, an image format found in Sonic, used as area background images. More...
 
struct  ColorPosition
 
class  CubeMapCombiner
 
class  Cursor
 An abstract cursor. More...
 
class  DDS
 DDS texture. More...
 
struct  DXT1Texel
 
struct  DXT23Texel
 
struct  DXT45Texel
 
class  Font
 An abstract font. More...
 
class  FPSCounter
 A class counting frames per second. More...
 
class  GLContainer
 A container of OpenGL elements. More...
 
class  GraphicsManager
 The graphics manager. More...
 
class  GUIElement
 An element of the GUI. More...
 
class  ImageDecoder
 A generic interface for image decoders. More...
 
class  IndexBuffer
 Buffer containing indices data. More...
 
class  NBFS
 
class  NCGR
 Image decoder for Nintendo's tile-based graphics format. More...
 
class  NCLR
 Simple utility class to load NCLR palette files. More...
 
class  Object
 A renderable game object. More...
 
class  Queueable
 
class  QueueManager
 The graphics queue manager. More...
 
class  Renderable
 An object that can be displayed by the graphics manager. More...
 
struct  Resolution
 
class  SBM
 SBM font bitmap data. More...
 
class  Surface
 
class  Texture
 A texture. More...
 
class  TGA
 TarGa image. More...
 
class  TPC
 BioWare's own texture format, TPC. More...
 
class  TTFRenderer
 
class  TXB
 Another one of BioWare's own texture formats, TXB. More...
 
class  TXI
 Texture information. More...
 
struct  VertexAttrib
 Generic vertex attribute data. More...
 
class  VertexBuffer
 Buffer containing vertex data. More...
 
class  WindowManager
 The graphics manager. More...
 
class  WinIconImage
 Windows cursor. More...
 
class  XEOSITEX
 
class  YUVToRGBLookup
 
class  YUVToRGBManager
 

Typedefs

typedef GLuint TextureID
 
typedef GLuint ListID
 
typedef std::vector< ColorPositionColorPositions
 
typedef std::vector< VertexAttribVertexDecl
 Vertex data layout. More...
 
typedef SDL_DisplayMode DisplayMode
 

Enumerations

enum  TXICommand {
  TXICommandAlphaMean = 0, TXICommandArturoHeight = 1, TXICommandArturoWidth = 2, TXICommandBaselineHeight = 3,
  TXICommandBlending = 4, TXICommandBumpMapScaling = 5, TXICommandBumpMapTexture = 6, TXICommandBumpyShinyTexture = 7,
  TXICommandCanDownsample = 8, TXICommandCaretIndent = 9, TXICommandChannelScale = 10, TXICommandChannelTranslate = 11,
  TXICommandClamp = 12, TXICommandCodepage = 13, TXICommandCols = 14, TXICommandCompressTexture = 15,
  TXICommandControllerScript = 16, TXICommandCube = 17, TXICommandDBMapping = 18, TXICommandDecal = 19,
  TXICommandDefaultBPP = 20, TXICommandDefaultHeight = 21, TXICommandDefaultWidth = 22, TXICommandDistort = 23,
  TXICommandDistortAngle = 24, TXICommandDistortionAmplitude = 25, TXICommandDownsampleFactor = 26, TXICommandDownsampleMax = 27,
  TXICommandDownsampleMin = 28, TXICommandEnvMapTexture = 29, TXICommandFileRange = 30, TXICommandFilter = 31,
  TXICommandFontHeight = 32, TXICommandFontWidth = 33, TXICommandFPS = 34, TXICommandIsBumpMap = 35,
  TXICommandIsDoubleByte = 36, TXICommandIsLightMap = 37, TXICommandLowerRightCoords = 38, TXICommandMaxSizeHQ = 39,
  TXICommandMaxSizeLQ = 40, TXICommandMinSizeHQ = 41, TXICommandMinSizeLQ = 42, TXICommandMipMap = 43,
  TXICommandNumChars = 44, TXICommandNumCharsPerSheet = 45, TXICommandNumX = 46, TXICommandNumY = 47,
  TXICommandOnDemand = 48, TXICommandPriority = 49, TXICommandProcedureType = 50, TXICommandRows = 51,
  TXICommandSpacingB = 52, TXICommandSpacingR = 53, TXICommandSpeed = 54, TXICommandTemporary = 55,
  TXICommandTextureWidth = 56, TXICommandUnique = 57, TXICommandUpperLeftCoords = 58, TXICommandWaterHeight = 59,
  TXICommandWaterWidth = 60, TXICommandXBoxDownsample = 61, TXICommandMAX
}
 All supported commands in a TXI. More...
 
enum  PixelFormat { kPixelFormatRGB = GL_RGB, kPixelFormatRGBA = GL_RGBA, kPixelFormatBGR = GL_BGR, kPixelFormatBGRA = GL_BGRA }
 
enum  PixelFormatRaw {
  kPixelFormatRGBA8 = GL_RGBA8, kPixelFormatRGB8 = GL_RGB8, kPixelFormatRGB5A1 = GL_RGB5_A1, kPixelFormatRGB5 = GL_RGB5,
  kPixelFormatDXT1 = GL_COMPRESSED_RGB_S3TC_DXT1_EXT, kPixelFormatDXT3 = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, kPixelFormatDXT5 = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
}
 
enum  PixelDataType { kPixelDataType8 = GL_UNSIGNED_BYTE, kPixelDataType1555 = GL_UNSIGNED_SHORT_1_5_5_5_REV, kPixelDataType565 = GL_UNSIGNED_SHORT_5_6_5 }
 
enum  QueueType {
  kQueueTexture = 0, kQueueNewTexture, kQueueWorldObject, kQueueVisibleWorldObject,
  kQueueGUIFrontObject, kQueueGUIBackObject, kQueueGUIConsoleObject, kQueueVisibleGUIFrontObject,
  kQueueVisibleGUIBackObject, kQueueVisibleGUIConsoleObject, kQueueVideo, kQueueVisibleVideo,
  kQueueGLContainer, kQueueNewShader, kQueueMAX
}
 
enum  RenderableType {
  kRenderableTypeVideo = 0, kRenderableTypeObject, kRenderableTypeGUIFront, kRenderableTypeGUIBack,
  kRenderableTypeConsole
}
 
enum  RenderPass { kRenderPassOpaque = 0, kRenderPassTransparent = 1, kRenderPassAll = 2 }
 
enum  VertexAttribIdEnum { VPOSITION = 0, VNORMAL, VCOLOR, VTCOORD }
 Vertex attribute data index enum, hardcoded for now. More...
 

Functions

static void outputGLDebug (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam)
 
static SDL_Surface * createStaticIconSurface ()
 
static void setStaticIcon (SDL_Window &window)
 
void setWindowIcon (SDL_Window &window)
 
static void writePixel (Common::WriteStream &file, const byte *&data, PixelFormat format)
 
static Common::WriteStreamopenTGA (const Common::UString &fileName, int width, int height)
 
static void writeMipMap (Common::WriteStream &stream, const ImageDecoder::MipMap &mipMap, PixelFormat format)
 
void dumpTGA (const Common::UString &fileName, const ImageDecoder *image)
 Dump image into a TGA file. More...
 
static uint32 convert565To8888 (uint16 color)
 
static uint32 interpolate32 (double weight, uint32 color_0, uint32 color_1)
 
void decompressDXT1 (byte *dest, Common::SeekableReadStream &src, uint32 width, uint32 height, uint32 pitch)
 
void decompressDXT3 (byte *dest, Common::SeekableReadStream &src, uint32 width, uint32 height, uint32 pitch)
 
static uint64 readUint48LE (Common::SeekableReadStream &src)
 
void decompressDXT5 (byte *dest, Common::SeekableReadStream &src, uint32 width, uint32 height, uint32 pitch)
 
bool constructFilename (Common::UString &filename)
 
static bool writeBMP (const Common::UString &filename, const byte *data, int width, int height)
 
bool takeScreenshot ()
 Saves a screenshot to a file. More...
 
static uint32 getTXBDataSize (byte encoding, PixelFormatRaw format, int32 width, int32 height)
 
TXICommand parseTXICommand (const Common::UString &str, Common::UString &args)
 Parse a TXI command from a string. More...
 
static uint32 getDataSize (PixelFormatRaw format, int32 width, int32 height)
 Return the number of bytes necessary to hold an image of these dimensions and in this format. More...
 
static bool hasValidDimensions (PixelFormatRaw format, int32 width, int32 height)
 Are these image dimensions valid for this format? More...
 
static void flipHorizontally (byte *data, int width, int height, int bpp)
 Flip an image horizontally. More...
 
static void flipVertically (byte *data, int width, int height, int bpp)
 Flip an image vertically. More...
 
static void rotate90 (byte *data, int width, int height, int bpp, int steps)
 Rotate a square image in 90° steps, clock-wise. More...
 
static uint32 deSwizzleOffset (uint32 x, uint32 y, uint32 width, uint32 height)
 De-"swizzle" a texture pixel offset. More...
 
static bool queueComp (Queueable *a, Queueable *b)
 

Variables

PFNGLCOMPRESSEDTEXIMAGE2DPROC glCompressedTexImage2D
 
static const byte kStaticIcon [32 *32 *4]
 Static version of the xoreos icon. More...
 
static const Resolution kResolutions []
 

Typedef Documentation

◆ ColorPositions

Definition at line 114 of file types.h.

◆ DisplayMode

typedef SDL_DisplayMode Graphics::DisplayMode

Definition at line 36 of file windowman.h.

◆ ListID

typedef GLuint Graphics::ListID

Definition at line 46 of file types.h.

◆ TextureID

typedef GLuint Graphics::TextureID

Definition at line 45 of file types.h.

◆ VertexDecl

typedef std::vector<VertexAttrib> Graphics::VertexDecl

Vertex data layout.

Definition at line 63 of file vertexbuffer.h.

Enumeration Type Documentation

◆ PixelDataType

Enumerator
kPixelDataType8 
kPixelDataType1555 
kPixelDataType565 

Definition at line 65 of file types.h.

◆ PixelFormat

Enumerator
kPixelFormatRGB 
kPixelFormatRGBA 
kPixelFormatBGR 
kPixelFormatBGRA 

Definition at line 48 of file types.h.

◆ PixelFormatRaw

Enumerator
kPixelFormatRGBA8 
kPixelFormatRGB8 
kPixelFormatRGB5A1 
kPixelFormatRGB5 
kPixelFormatDXT1 
kPixelFormatDXT3 
kPixelFormatDXT5 

Definition at line 55 of file types.h.

◆ QueueType

Enumerator
kQueueTexture 

A texture.

kQueueNewTexture 

A newly created texture.

kQueueWorldObject 

An object in 3D space.

kQueueVisibleWorldObject 

A visible object in 3D space.

kQueueGUIFrontObject 

A GUI object, in front of the world objects.

kQueueGUIBackObject 

A GUI object, behind the world objects.

kQueueGUIConsoleObject 

A Debug Console object, in front of the Front GUI.

kQueueVisibleGUIFrontObject 

A visible GUI object, in front of the world objects.

kQueueVisibleGUIBackObject 

A visible GUI object, behind the world objects.

kQueueVisibleGUIConsoleObject 

A visible Debug Console object, in front of the Front GUI.

kQueueVideo 

A video.

kQueueVisibleVideo 

A currently playing video.

kQueueGLContainer 

An object containing OpenGL structures.

kQueueNewShader 

An object containing shader information.

kQueueMAX 

For range checks.

Definition at line 71 of file types.h.

◆ RenderableType

Enumerator
kRenderableTypeVideo 
kRenderableTypeObject 
kRenderableTypeGUIFront 
kRenderableTypeGUIBack 
kRenderableTypeConsole 

Definition at line 89 of file types.h.

◆ RenderPass

Enumerator
kRenderPassOpaque 

Only render opaque parts.

kRenderPassTransparent 

Only render transparent parts.

kRenderPassAll 

Render all parts.

Definition at line 97 of file types.h.

◆ TXICommand

All supported commands in a TXI.

Enumerator
TXICommandAlphaMean 
TXICommandArturoHeight 
TXICommandArturoWidth 
TXICommandBaselineHeight 
TXICommandBlending 
TXICommandBumpMapScaling 
TXICommandBumpMapTexture 
TXICommandBumpyShinyTexture 
TXICommandCanDownsample 
TXICommandCaretIndent 
TXICommandChannelScale 
TXICommandChannelTranslate 
TXICommandClamp 
TXICommandCodepage 
TXICommandCols 
TXICommandCompressTexture 
TXICommandControllerScript 
TXICommandCube 
TXICommandDBMapping 
TXICommandDecal 
TXICommandDefaultBPP 
TXICommandDefaultHeight 
TXICommandDefaultWidth 
TXICommandDistort 
TXICommandDistortAngle 
TXICommandDistortionAmplitude 
TXICommandDownsampleFactor 
TXICommandDownsampleMax 
TXICommandDownsampleMin 
TXICommandEnvMapTexture 
TXICommandFileRange 
TXICommandFilter 
TXICommandFontHeight 
TXICommandFontWidth 
TXICommandFPS 
TXICommandIsBumpMap 
TXICommandIsDoubleByte 
TXICommandIsLightMap 
TXICommandLowerRightCoords 
TXICommandMaxSizeHQ 
TXICommandMaxSizeLQ 
TXICommandMinSizeHQ 
TXICommandMinSizeLQ 
TXICommandMipMap 
TXICommandNumChars 
TXICommandNumCharsPerSheet 
TXICommandNumX 
TXICommandNumY 
TXICommandOnDemand 
TXICommandPriority 
TXICommandProcedureType 
TXICommandRows 
TXICommandSpacingB 
TXICommandSpacingR 
TXICommandSpeed 
TXICommandTemporary 
TXICommandTextureWidth 
TXICommandUnique 
TXICommandUpperLeftCoords 
TXICommandWaterHeight 
TXICommandWaterWidth 
TXICommandXBoxDownsample 
TXICommandMAX 

Definition at line 37 of file txitypes.h.

◆ VertexAttribIdEnum

Vertex attribute data index enum, hardcoded for now.

Enumerator
VPOSITION 

Vertex position.

VNORMAL 

Vertex normal.

VCOLOR 

Vertex color.

VTCOORD 

Vertex texture coordinates, VTCOORDi = VTCOORD + i.

Definition at line 35 of file vertexbuffer.h.

Function Documentation

◆ constructFilename()

bool Graphics::constructFilename ( Common::UString filename)

Definition at line 38 of file screenshot.cpp.

References Common::DateTime::formatDateTimeISO(), Common::FilePath::getUserDataFile(), Common::FilePath::isRegularFile(), and Common::DateTime::kUTC.

Referenced by takeScreenshot().

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

◆ convert565To8888()

static uint32 Graphics::convert565To8888 ( uint16  color)
inlinestatic

Definition at line 32 of file s3tc.cpp.

Referenced by decompressDXT1(), decompressDXT3(), and decompressDXT5().

Here is the caller graph for this function:

◆ createStaticIconSurface()

static SDL_Surface* Graphics::createStaticIconSurface ( )
static

Definition at line 301 of file icon.cpp.

References kStaticIcon.

Referenced by setStaticIcon().

Here is the caller graph for this function:

◆ decompressDXT1()

void Graphics::decompressDXT1 ( byte dest,
Common::SeekableReadStream src,
uint32  width,
uint32  height,
uint32  pitch 
)

Definition at line 64 of file s3tc.cpp.

References Graphics::DXT1Texel::color_0, Graphics::DXT1Texel::color_1, convert565To8888(), interpolate32(), Graphics::DXT1Texel::pixels, and READ_DXT1_TEXEL.

Referenced by Graphics::ImageDecoder::decompress().

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

◆ decompressDXT3()

void Graphics::decompressDXT3 ( byte dest,
Common::SeekableReadStream src,
uint32  width,
uint32  height,
uint32  pitch 
)

Definition at line 114 of file s3tc.cpp.

References Graphics::DXT23Texel::alpha, Graphics::DXT1Texel::color_0, Graphics::DXT1Texel::color_1, convert565To8888(), interpolate32(), Graphics::DXT1Texel::pixels, and READ_DXT3_TEXEL.

Referenced by Graphics::ImageDecoder::decompress().

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

◆ decompressDXT5()

void Graphics::decompressDXT5 ( byte dest,
Common::SeekableReadStream src,
uint32  width,
uint32  height,
uint32  pitch 
)

◆ deSwizzleOffset()

static uint32 Graphics::deSwizzleOffset ( uint32  x,
uint32  y,
uint32  width,
uint32  height 
)
inlinestatic

De-"swizzle" a texture pixel offset.

Definition at line 179 of file util.h.

References Common::intLog2().

Referenced by Graphics::TXB::deSwizzle(), Graphics::TPC::deSwizzle(), and Graphics::SBM::readData().

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

◆ dumpTGA()

void Graphics::dumpTGA ( const Common::UString fileName,
const ImageDecoder image 
)

◆ flipHorizontally()

static void Graphics::flipHorizontally ( byte data,
int  width,
int  height,
int  bpp 
)
inlinestatic

Flip an image horizontally.

Definition at line 95 of file util.h.

References Common::ScopedPtrBase< T, Deallocator >::get().

Here is the call graph for this function:

◆ flipVertically()

static void Graphics::flipVertically ( byte data,
int  width,
int  height,
int  bpp 
)
inlinestatic

Flip an image vertically.

Definition at line 122 of file util.h.

Referenced by Graphics::TGA::readData().

Here is the caller graph for this function:

◆ getDataSize()

static uint32 Graphics::getDataSize ( PixelFormatRaw  format,
int32  width,
int32  height 
)
inlinestatic

Return the number of bytes necessary to hold an image of these dimensions and in this format.

Definition at line 43 of file util.h.

References kPixelFormatDXT1, kPixelFormatDXT3, kPixelFormatDXT5, kPixelFormatRGB5, kPixelFormatRGB5A1, kPixelFormatRGB8, and kPixelFormatRGBA8.

Referenced by getTXBDataSize(), Graphics::TPC::readHeader(), and Graphics::DDS::setSize().

Here is the caller graph for this function:

◆ getTXBDataSize()

static uint32 Graphics::getTXBDataSize ( byte  encoding,
PixelFormatRaw  format,
int32  width,
int32  height 
)
static

Definition at line 66 of file txb.cpp.

References getDataSize(), kEncodingBGRA, kEncodingDXT1, kEncodingDXT5, and kEncodingGray.

Referenced by Graphics::TXB::readHeader().

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

◆ hasValidDimensions()

static bool Graphics::hasValidDimensions ( PixelFormatRaw  format,
int32  width,
int32  height 
)
inlinestatic

◆ interpolate32()

static uint32 Graphics::interpolate32 ( double  weight,
uint32  color_0,
uint32  color_1 
)
inlinestatic

Definition at line 36 of file s3tc.cpp.

Referenced by decompressDXT1(), decompressDXT3(), and decompressDXT5().

Here is the caller graph for this function:

◆ openTGA()

static Common::WriteStream* Graphics::openTGA ( const Common::UString fileName,
int  width,
int  height 
)
static

Definition at line 66 of file dumptga.cpp.

References Common::WriteStream::writeByte(), Common::WriteStream::writeUint16LE(), and Common::WriteStream::writeUint32LE().

Referenced by dumpTGA().

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

◆ outputGLDebug()

static void Graphics::outputGLDebug ( GLenum  source,
GLenum  type,
GLuint  id,
GLenum  severity,
GLsizei  length,
const GLchar *  message,
const void *  userParam 
)
static

◆ parseTXICommand()

TXICommand Graphics::parseTXICommand ( const Common::UString str,
Common::UString args 
)

Parse a TXI command from a string.

Definition at line 99 of file txitypes.cpp.

References Common::UString::c_str(), Common::StringListMap::find(), kTXICommandMap, and TXICommandMAX.

Referenced by Graphics::TXI::load().

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

◆ queueComp()

static bool Graphics::queueComp ( Queueable a,
Queueable b 
)
static

Definition at line 32 of file queueman.cpp.

Referenced by Graphics::QueueManager::sortQueue().

Here is the caller graph for this function:

◆ readUint48LE()

static uint64 Graphics::readUint48LE ( Common::SeekableReadStream src)
static

Definition at line 154 of file s3tc.cpp.

References Common::ReadStream::readUint16LE(), and Common::ReadStream::readUint32LE().

Here is the call graph for this function:

◆ rotate90()

static void Graphics::rotate90 ( byte data,
int  width,
int  height,
int  bpp,
int  steps 
)
inlinestatic

Rotate a square image in 90° steps, clock-wise.

Definition at line 145 of file util.h.

Referenced by Graphics::TPC::fixupCubeMap().

Here is the caller graph for this function:

◆ setStaticIcon()

static void Graphics::setStaticIcon ( SDL_Window &  window)
static

Definition at line 322 of file icon.cpp.

References createStaticIconSurface().

Referenced by setWindowIcon().

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

◆ setWindowIcon()

void Graphics::setWindowIcon ( SDL_Window &  window)

Definition at line 350 of file icon.cpp.

References setStaticIcon().

Referenced by Graphics::WindowManager::initWindow().

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

◆ takeScreenshot()

bool Graphics::takeScreenshot ( )

Saves a screenshot to a file.

Warning: Unsafe outside the main thread.

Definition at line 110 of file screenshot.cpp.

References Common::UString::c_str(), constructFilename(), Common::enforceMainThread(), Common::ScopedPtrBase< T, Deallocator >::get(), status(), warning(), and writeBMP().

Referenced by Graphics::GraphicsManager::endScene().

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

◆ writeBMP()

static bool Graphics::writeBMP ( const Common::UString filename,
const byte data,
int  width,
int  height 
)
static

Definition at line 53 of file screenshot.cpp.

References Common::WriteFile::close(), Common::WriteFile::flush(), Common::WriteFile::open(), Common::WriteFile::write(), Common::WriteStream::writeByte(), Common::WriteStream::writeUint16LE(), and Common::WriteStream::writeUint32LE().

Referenced by takeScreenshot().

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

◆ writeMipMap()

static void Graphics::writeMipMap ( Common::WriteStream stream,
const ImageDecoder::MipMap mipMap,
PixelFormat  format 
)
static

Definition at line 87 of file dumptga.cpp.

References Graphics::ImageDecoder::MipMap::data, Common::ScopedPtrBase< T, Deallocator >::get(), Graphics::ImageDecoder::MipMap::height, Graphics::ImageDecoder::MipMap::width, and writePixel().

Referenced by dumpTGA().

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

◆ writePixel()

static void Graphics::writePixel ( Common::WriteStream file,
const byte *&  data,
PixelFormat  format 
)
static

Definition at line 36 of file dumptga.cpp.

References kPixelFormatBGR, kPixelFormatBGRA, kPixelFormatRGB, kPixelFormatRGBA, and Common::WriteStream::writeByte().

Referenced by writeMipMap().

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

Variable Documentation

◆ glCompressedTexImage2D

PFNGLCOMPRESSEDTEXIMAGE2DPROC Graphics::glCompressedTexImage2D

◆ kResolutions

const Resolution Graphics::kResolutions[]
static

◆ kStaticIcon

const byte Graphics::kStaticIcon[32 *32 *4]
static

Static version of the xoreos icon.

Definition at line 42 of file icon.cpp.

Referenced by createStaticIconSurface().