V-Gears 0
Free Final Fantasy VII engine.
OgreGenUtilites.h File Reference
#include <Ogre.h>
#include "installer/common/Logger.h"
#include "installer/common/Vram.h"
Include dependency graph for OgreGenUtilites.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  MeshData
 Mesh data. More...
 
struct  TexForGen
 Texture data. More...
 

Typedefs

typedef std::vector< TexForGenVectorTexForGen
 

Enumerations

enum  BPP { BPP_4 = 0 , BPP_8 = 1 , BPP_BLACK = -1 }
 Bits per pixel modes. More...
 

Functions

void CreateTexture (Vram *vram, const MeshData &mesh_data, const Ogre::String &texture_file_name, const VectorTexForGen &textures)
 Creates a texture from video memory and saves it to a file. More...
 
void CreateMaterial (const Ogre::String &material_name, const Ogre::String &material_file_name, const Ogre::String &texture_name, const Ogre::String &vertex_program, const Ogre::String &fragment_program)
 Creates a material and saves it to a file. More...
 
void CreateTextureFromVram (const Ogre::PixelBox &pixel_box, Vram *vram, const int start_x, const int start_y, const int clut_x, const int clut_y, const int texture_x, const int texture_y, const BPP bpp, const bool transparency)
 Creates a material from video memory and adds it to the texture list. More...
 
void AddTexture (TexForGen &texture, const MeshData &data, VectorTexForGen &textures, Logger *logger)
 Adds a texture to the list. More...
 
void AddTransparency (u32 &colour, const bool transparency, const bool stp)
 Adds or removes a transparency to a colour. More...
 

Typedef Documentation

◆ VectorTexForGen

typedef std::vector< TexForGen > VectorTexForGen

Enumeration Type Documentation

◆ BPP

enum BPP

Bits per pixel modes.

Enumerator
BPP_4 

4 bites per pixel.

BPP_8 

8 bits per pixel.

BPP_BLACK 

No color data, always black.

Function Documentation

◆ AddTexture()

void AddTexture ( TexForGen texture,
const MeshData data,
VectorTexForGen textures,
Logger logger 
)

Adds a texture to the list.

Parameters
[in]textureTexture information.
[in]dataMesh information.
[in,out]texturesThe texture will be added to this list.
[in]loggerCustom logger to print info about the process. It can be NULL, but then nothing will be printed.

◆ AddTransparency()

void AddTransparency ( u32 colour,
const bool  transparency,
const bool  stp 
)

Adds or removes a transparency to a colour.

Parameters
[in,out]colourThe colour to add or remove the transparency to.
[in]transparencyTrue to add transparency, false to remove it.
[in]stp
Todo:
Understand and document.

◆ CreateMaterial()

void CreateMaterial ( const Ogre::String &  material_name,
const Ogre::String &  material_file_name,
const Ogre::String &  texture_name,
const Ogre::String &  vertex_program,
const Ogre::String &  fragment_program 
)

Creates a material and saves it to a file.

Parameters
[in]material_nameThe material name.
[in]material_file_namePath to the material file to save.
[in]texture_nameName of the texture to assign to the material.
[in]vertex_program
Todo:
Understand and document. Can be empty.
Parameters
[in]fragment_program
Todo:
Understand and document. Can be empty.

◆ CreateTexture()

void CreateTexture ( Vram vram,
const MeshData mesh_data,
const Ogre::String &  texture_file_name,
const VectorTexForGen textures 
)

Creates a texture from video memory and saves it to a file.

Parameters
[in]vramMemory block to load the texture from.
[in]mesh_dataInformation about the mesh the texture is assigned to.
[in]texture_file_namePath to the texture file to save.
[in]textures
Todo:
It's used to get some coordinates, but for what?

◆ CreateTextureFromVram()

void CreateTextureFromVram ( const Ogre::PixelBox &  pixel_box,
Vram vram,
const int  start_x,
const int  start_y,
const int  clut_x,
const int  clut_y,
const int  texture_x,
const int  texture_y,
const BPP  bpp,
const bool  transparency 
)

Creates a material from video memory and adds it to the texture list.

Parameters
[in]pixel_boxTexture image descriptor.
[in]vramMemory block to load the material from.
[in]start_xX coordinate for the texture.
[in]start_yY coordinate for the texture.
[in]clut_xX coordinate for the texture CLUT.
[in]clut_yY coordinate for the texture CLUT.
[in]texture_xX coordinate for the texture.
[in]texture_yY coordinate for the texture.
[in]bppBPP mode for the texture colour.
[in]transparencyIndicates if the texture has transparencies.
Todo:
What's the difference between start_x/start_y and texture_x/texture_y?