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

Handles colour palette files. More...

#include <VGearsPaletteFile.h>

Inheritance diagram for VGears::PaletteFile:
Collaboration diagram for VGears::PaletteFile:

Public Types

typedef Ogre::ColourValue Color
 
typedef std::vector< ColorPage
 
typedef std::vector< PagePageList
 

Public Member Functions

 PaletteFile (Ogre::ResourceManager *creator, const String &name, Ogre::ResourceHandle handle, const String &group, bool is_manual=false, Ogre::ManualResourceLoader *loader=nullptr)
 Constructor. More...
 
virtual ~PaletteFile ()
 Destructor. More...
 
virtual PageListGetPages ()
 Retrieevs the list of pages. More...
 
virtual const PageGetPage (size_t index) const
 Retrieves a page. More...
 

Static Public Attributes

static const String RESOURCE_TYPE
 The type of resource. More...
 

Protected Member Functions

virtual void loadImpl () override
 Loads the file. More...
 
virtual void unloadImpl () override
 Unloads the file. More...
 
virtual size_t calculateSize () const override
 Calculates the size of the palette. More...
 

Private Attributes

PageList pages_
 The list of palette pages. More...
 

Detailed Description

Handles colour palette files.

Member Typedef Documentation

◆ Color

typedef Ogre::ColourValue VGears::PaletteFile::Color

◆ Page

typedef std::vector<Color> VGears::PaletteFile::Page

◆ PageList

typedef std::vector<Page> VGears::PaletteFile::PageList

Constructor & Destructor Documentation

◆ PaletteFile()

VGears::PaletteFile::PaletteFile ( Ogre::ResourceManager *  creator,
const String name,
Ogre::ResourceHandle  handle,
const String group,
bool  is_manual = false,
Ogre::ManualResourceLoader *  loader = nullptr 
)

Constructor.

Parameters
[in]creatorPointer to the ResourceManager that is creating this resource.
[in]nameThe unique name of the resource.
[in]handle
Todo:
Understand and document.
Parameters
[in]groupThe name of the resource group to which this resource belong.
[in]is_manualTrue if the resource is manually loaded, false otherwise.
[in]loaderPointer to a ManualResourceLoader implementation which will be called when the Resource wishes to load (should be supplied if is_manual is set to true). It can be null, but the Resource will never be able to reload if anything ever causes it to unload. Therefore provision of a proper ManualResourceLoader instance is strongly recommended.

◆ ~PaletteFile()

VGears::PaletteFile::~PaletteFile ( )
virtual

Destructor.

Member Function Documentation

◆ calculateSize()

size_t VGears::PaletteFile::calculateSize ( void  ) const
overrideprotectedvirtual

Calculates the size of the palette.

Returns
The size of the palette.
Todo:
Units?

◆ GetPage()

virtual const Page & VGears::PaletteFile::GetPage ( size_t  index) const
inlinevirtual

Retrieves a page.

Parameters
[in]indexPage index.
Returns
The page at the specified index.

◆ GetPages()

virtual PageList & VGears::PaletteFile::GetPages ( )
inlinevirtual

Retrieevs the list of pages.

Returns
The list of pages.

◆ loadImpl()

void VGears::PaletteFile::loadImpl ( void  )
overrideprotectedvirtual

Loads the file.

◆ unloadImpl()

void VGears::PaletteFile::unloadImpl ( void  )
overrideprotectedvirtual

Unloads the file.

Member Data Documentation

◆ pages_

PageList VGears::PaletteFile::pages_
private

The list of palette pages.

◆ RESOURCE_TYPE

const String VGears::PaletteFile::RESOURCE_TYPE
static

The type of resource.


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