V-Gears 0
Free Final Fantasy VII engine.
VGears::TxzFileSerializer Class Reference

#include <TxzFileSerializer.h>

Inheritance diagram for VGears::TxzFileSerializer:
Collaboration diagram for VGears::TxzFileSerializer:

Classes

struct  PsxPixel
 A play station pixel representation. More...
 
struct  PsxPixel4Bit
 Play station pixel representation (4 bits). More...
 
struct  Rgba
 RGBA colour representation. More...
 
struct  VRamBlock
 A video RAM block representation. More...
 
struct  WorldMapTexture
 

Public Member Functions

struct VGears::TxzFileSerializer::WorldMapTexture __attribute__ ((packed))
 
struct VGears::TxzFileSerializer::PsxPixel __attribute__ ((packed))
 
struct VGears::TxzFileSerializer::PsxPixel4Bit __attribute__ ((packed))
 
struct VGears::TxzFileSerializer::Rgba __attribute__ ((packed))
 
 TxzFileSerializer ()
 Constructor. More...
 
virtual ~TxzFileSerializer ()
 Destructor. More...
 
void Import (Ogre::DataStreamPtr &stream, TxzFile &dest)
 Imports a TXZ file. More...
 
std::vector< std::vector< Rgba > > GetWorldMapTexture (uint32 id)
 Retrieves a texture color pixels from a texture ID. More...
 
- Public Member Functions inherited from VGears::Serializer
 Serializer ()
 Constructor. More...
 
virtual ~Serializer ()
 Destructor. More...
 

Public Attributes

struct VGears::TxzFileSerializer::VRamBlock __attribute__
 

Private Member Functions

void ImportDecompressed (Ogre::DataStream &stream, TxzFile &dest)
 Imports a texture from decompressed file contents. More...
 
void ImportTextureSection (Ogre::DataStream &stream, TxzFile &dest, size_t section_end)
 Partially imports a texture from decompressed file contents. More...
 
void ExtractTexture (const std::array< WorldMapTexture, 512 > &pallete_table)
 

Private Attributes

std::vector< VRamBlockv_ram_blocks_
 The list of video RAM blocks. More...
 
std::map< uint32, std::vector< std::vector< Rgba > > > textures_
 The list of textures. More...
 

Additional Inherited Members

- Protected Member Functions inherited from VGears::Serializer
void readObject (Ogre::DataStreamPtr &stream, Ogre::Vector2 &dest)
 Reads an object as a 2 dimensional vector. More...
 
void readObject (Ogre::DataStreamPtr &stream, Ogre::Vector3 &dest)
 Reads an object as a 3 dimensional vector. More...
 
void readObject (Ogre::DataStreamPtr &stream, Ogre::AxisAlignedBox &dest)
 Reads an object as an axis aligned box. More...
 
void readObject (Ogre::DataStreamPtr &stream, Pixel &dest)
 Reads an object as a pixel. More...
 
void ReadChars (Ogre::DataStreamPtr &stream, char *dest, size_t count)
 Reads a stream as text. More...
 
void Read1ByteBool (Ogre::DataStreamPtr &stream, bool &dest)
 Reads one byte from a stream and evaluates it as a boolean. More...
 
void Read2ByteBool (Ogre::DataStreamPtr &stream, bool &dest)
 Reads two bytes from a stream and evaluates them as a boolean. More...
 
void ReadShort (Ogre::DataStreamPtr &stream, uint16 &dest)
 Reads 16 bytes from a stream and evaluates as an unsigned short. More...
 
void ReadInt16 (Ogre::DataStream &stream, sint16 &dest)
 Reads 16 bytes from a stream and evaluates as a signed integer. More...
 
void ReadUInt16 (Ogre::DataStream &stream, uint16 &dest)
 Reads 16 bytes from a stream and evaluates as an unsigned int. More...
 
void ReadInt16 (Ogre::DataStreamPtr &stream, sint16 &dest)
 Reads 16 bytes from a stream and evaluates as a signed integer. More...
 
void ReadUInt16 (Ogre::DataStreamPtr &stream, uint16 &dest)
 Reads 16 bytes from a stream and evaluates as an unsigned int. More...
 
void ReadUInt32 (Ogre::DataStreamPtr &stream, uint32 &dest)
 Reads 32 bytes from a stream and evaluates as an unsigned int. More...
 
void ReadSInt32 (Ogre::DataStreamPtr &stream, sint32 &dest)
 Reads 32 bytes from a stream and evaluates as a signed int. More...
 
void ReadUInt32 (Ogre::DataStream &stream, uint32 &dest)
 Reads 32 bytes from a stream and evaluates as an unsigned int. More...
 
void ReadUInt8 (Ogre::DataStream &stream, uint8 &dest)
 Reads 8 bytes from a stream and evaluates as an unsigned int. More...
 
void ReadUInt8 (Ogre::DataStreamPtr &stream, uint8 &dest)
 Reads 8 bytes from a stream and evaluates as an unsigned int. More...
 
void ReadFloat (Ogre::DataStreamPtr &stream, float &dest)
 Reads bytes from a stream and evaluates them as a float. More...
 
void ReadEndString (Ogre::DataStreamPtr &stream, const String &end_text)
 
String GetLine (Ogre::DataStreamPtr &stream) const
 
- Static Protected Attributes inherited from VGears::Serializer
static const String TAG_COMMENT
 A comment tag. More...
 

Constructor & Destructor Documentation

◆ TxzFileSerializer()

VGears::TxzFileSerializer::TxzFileSerializer ( )

Constructor.

◆ ~TxzFileSerializer()

VGears::TxzFileSerializer::~TxzFileSerializer ( )
virtual

Destructor.

Member Function Documentation

◆ __attribute__() [1/4]

struct VGears::TxzFileSerializer::WorldMapTexture VGears::TxzFileSerializer::__attribute__ ( (packed)  )

◆ __attribute__() [2/4]

struct VGears::TxzFileSerializer::PsxPixel VGears::TxzFileSerializer::__attribute__ ( (packed)  )

◆ __attribute__() [3/4]

struct VGears::TxzFileSerializer::PsxPixel4Bit VGears::TxzFileSerializer::__attribute__ ( (packed)  )

◆ __attribute__() [4/4]

struct VGears::TxzFileSerializer::Rgba VGears::TxzFileSerializer::__attribute__ ( (packed)  )

◆ ExtractTexture()

void VGears::TxzFileSerializer::ExtractTexture ( const std::array< WorldMapTexture, 512 > &  pallete_table)
private
Todo:
Understand and document. Where is this implemented?
Parameters
[in]pallete_table
Todo:
.

◆ GetWorldMapTexture()

std::vector< std::vector< TxzFileSerializer::Rgba > > VGears::TxzFileSerializer::GetWorldMapTexture ( uint32  id)

Retrieves a texture color pixels from a texture ID.

Parameters
[in]idID of the texture.
Returns
List of color pixels conforming the texture, or an empty vector if the texture doesn't exist.

◆ Import()

void VGears::TxzFileSerializer::Import ( Ogre::DataStreamPtr &  stream,
TxzFile dest 
)

Imports a TXZ file.

◆ ImportDecompressed()

void VGears::TxzFileSerializer::ImportDecompressed ( Ogre::DataStream &  stream,
TxzFile dest 
)
private

Imports a texture from decompressed file contents.

Parameters
[in]streamContents of the decompressed file.
[out]destThe texture data will be loaded here.

◆ ImportTextureSection()

void VGears::TxzFileSerializer::ImportTextureSection ( Ogre::DataStream &  stream,
TxzFile dest,
size_t  section_end 
)
private

Partially imports a texture from decompressed file contents.

Parameters
[in]streamContents of the decompressed file.
[out]destThe texture data will be loaded here.
[in]section_endBytes to import.
Todo:
Sure it is decompressed?

Member Data Documentation

◆ __attribute__

struct VGears::TxzFileSerializer::VRamBlock VGears::TxzFileSerializer::__attribute__

◆ textures_

std::map<uint32, std::vector<std::vector<Rgba> > > VGears::TxzFileSerializer::textures_
private

The list of textures.

◆ v_ram_blocks_

std::vector<VRamBlock> VGears::TxzFileSerializer::v_ram_blocks_
private

The list of video RAM blocks.


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