![]() |
V-Gears 0
Free Final Fantasy VII engine.
|
Handles the serialization of background files. More...
#include <VGearsBackgroundFileSerializer.h>
Classes | |
struct | Header |
A background file header. More... | |
Public Types | |
enum | { BIT_MASK_RED = 0xF800 , BIT_MASK_GREEN = 0x07C0 , BIT_MASK_BLUE = 0x001F , BIT_SIZE = 0x001F , BIT_MASK_RGB = BIT_MASK_BLUE | BIT_MASK_GREEN | BIT_MASK_RED , SPRITE_DST_MAX = 1024 } |
typedef BackgroundFile::Layer | Layer |
typedef BackgroundFile::SpriteData | SpriteData |
typedef BackgroundFile::SpriteList | SpriteList |
typedef BackgroundFile::Page | Page |
typedef BackgroundFile::Color | Color |
Public Member Functions | |
BackgroundFileSerializer () | |
Constructor. More... | |
virtual | ~BackgroundFileSerializer () |
Destructor. More... | |
void | ImportBackgroundFile (Ogre::DataStreamPtr &stream, BackgroundFile *dest) |
Imports a background file. More... | |
![]() | |
Serializer () | |
Constructor. More... | |
virtual | ~Serializer () |
Destructor. More... | |
Protected Member Functions | |
virtual void | ReadFileHeader (Ogre::DataStreamPtr &stream) |
Reads a background file header. More... | |
virtual void | ReadSectionHeader (Ogre::DataStreamPtr &stream, const String §ion_name) |
Reads a section of a background file header. More... | |
virtual void | ReadPallete (Ogre::DataStreamPtr &stream, BackgroundFile *dest) |
Reads pallete data from a background file. More... | |
virtual void | ReadBackground (Ogre::DataStreamPtr &stream, BackgroundFile *dest) |
Reads background data from a background file. More... | |
virtual void | ReadTexture (Ogre::DataStreamPtr &stream, BackgroundFile *dest) |
Reads texture data from a background file. More... | |
virtual void | ReadEnd (Ogre::DataStreamPtr &stream) |
virtual void | ReadLayer (Ogre::DataStreamPtr &stream, Layer *dest, size_t layer_index) |
Reads a layer from a background file. More... | |
virtual void | readObject (Ogre::DataStreamPtr &stream, SpriteData &dest) |
Reads an object as a sprite. More... | |
virtual void | readObject (Ogre::DataStreamPtr &stream, Color &dest) |
Reads an object as colour data. More... | |
virtual void | readObject (Ogre::DataStreamPtr &stream, Page &dest) |
Reads an object as a background page. More... | |
template<typename ValueType > | |
void | ReadVector (Ogre::DataStreamPtr &stream, std::vector< ValueType > &dest, size_t count) |
Reads a stream as a vector. More... | |
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 | 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 | |
static const String | SECTION_NAME_PALETTE |
Name of the palette section in the file. More... | |
static const String | SECTION_NAME_BACK |
Name of the back section in the file. More... | |
static const String | SECTION_NAME_TEXTURE |
Name of the texture section in the file. More... | |
static const String | TAG_FILE_END |
End-of-file tag. More... | |
static const Ogre::Real | SRC_BIG_SCALE |
![]() | |
static const String | TAG_COMMENT |
A comment tag. More... | |
Private Member Functions | |
void | RemoveBuggySprites (SpriteList &sprites) |
Removes malformed sprites from the map. More... | |
Private Attributes | |
Header | header_ |
The file header. More... | |
size_t | layer_index_ |
Handles the serialization of background files.
anonymous enum |
VGears::BackgroundFileSerializer::BackgroundFileSerializer | ( | ) |
Constructor.
|
virtual |
Destructor.
void VGears::BackgroundFileSerializer::ImportBackgroundFile | ( | Ogre::DataStreamPtr & | stream, |
BackgroundFile * | dest | ||
) |
Imports a background file.
[in] | stream | The contents of the background file. |
[out] | dest | The background file. |
|
protectedvirtual |
Reads background data from a background file.
[in] | stream | Input stream. |
[out] | dest | The data will be set on this file. |
|
protectedvirtual |
[in] | stream | Input stream. |
|
protectedvirtual |
Reads a background file header.
[in] | stream | The contents of the header. |
|
protectedvirtual |
Reads a layer from a background file.
[in] | stream | Input stream. |
[out] | dest | The layer info will be loaded here. |
[in] | layer_index | Index of the layer to read. |
|
protectedvirtual |
Reads an object as colour data.
[in] | stream | Input data. |
[out] | dest | The formed colour data. |
|
protected |
Reads an object as an axis aligned box.
Can be used for bounding boxes.
[in] | stream | Input data. |
[out] | dest | The formed box data. |
|
protected |
Reads an object as a 2 dimensional vector.
[in] | stream | Input data. |
[out] | dest | The formed vector data. |
|
protected |
Reads an object as a 3 dimensional vector.
[in] | stream | Input data. |
[out] | dest | The formed vector data. |
|
protectedvirtual |
Reads an object as a background page.
[in] | stream | Input data. |
[out] | dest | The formed page. |
|
protected |
Reads an object as a pixel.
[in] | stream | Input data. |
[out] | dest | The formed pixel data. |
|
protectedvirtual |
Reads an object as a sprite.
[in] | stream | Input data. |
[out] | dest | The formed sprite. |
|
protectedvirtual |
Reads pallete data from a background file.
[in] | stream | Input stream. |
[out] | dest | The data will be set on this file. |
|
protectedvirtual |
Reads a section of a background file header.
[in] | stream | The contents of the header. |
[in] | section_name | The name of the section to read. |
|
protectedvirtual |
Reads texture data from a background file.
[in] | stream | Input stream. |
[out] | dest | The data will be set on this file. |
|
inlineprotected |
Reads a stream as a vector.
[in] | stream | The input stream. |
[out] | dest | The vector data will be loaded here. |
[in] | count | Data units to copy. |
|
private |
Removes malformed sprites from the map.
[in,out] | sprites | The list from which to remove malformed sprites. |
|
private |
The file header.
|
private |
|
staticprotected |
Name of the back section in the file.
|
staticprotected |
Name of the palette section in the file.
|
staticprotected |
Name of the texture section in the file.
|
staticprotected |
|
staticprotected |
End-of-file tag.