persona-3-dual
A DS demake of Persona 3
Loading...
Searching...
No Matches
GraphicsComponent Class Reference

#include <GraphicsComponent.hpp>

Inheritance diagram for GraphicsComponent:
Collaboration diagram for GraphicsComponent:

Public Member Functions

void init () override
void destroy () override
void update (ae::q20_12_t) override
ae::ComponentTypeID getType () const override
GraphicAsset loadGraphic (const std::string &path)
 Loads a graphic asset's tiles, pal, and map into memory.
template<typename SpriteID>
GraphicAsset loadSpriteGraphic (const std::string &spritePath, SpriteType type, SpriteID spriteId)
 Wrapper function that loads a sprite graphic asset into memory.
void unloadGraphic (GraphicAsset &asset)
 Unload a specific graphic asset from memory.
void unloadAll ()
 Unload all graphic assets from memory.

Static Public Attributes

static constexpr ae::ComponentTypeID TYPE_ID = static_cast<ae::ComponentTypeID>(ComponentType::Graphics)

Protected Member Functions

void submitToManager () override

Private Member Functions

GraphicAsset loadSpriteGraphicImpl (const std::string &spritePath, SpriteType type, int spriteId)
 Loads the sprite graphic asset's tiles, pal, and map into memory via the spriteDb.

Private Attributes

IOManager & io = IOManager::getInstance()
int id = -1
 A GraphicAsset's index in loadedGraphics.
etl::vector< GraphicAsset, 32 > loadedGraphics

Detailed Description

Definition at line 18 of file GraphicsComponent.hpp.

Member Function Documentation

◆ destroy()

void GraphicsComponent::destroy ( )
override

Definition at line 6 of file GraphicsComponent.cpp.

Here is the call graph for this function:

◆ getType()

ae::ComponentTypeID GraphicsComponent::getType ( ) const
inlineoverride

Definition at line 32 of file GraphicsComponent.hpp.

◆ init()

void GraphicsComponent::init ( )
inlineoverride

Definition at line 22 of file GraphicsComponent.hpp.

◆ loadGraphic()

GraphicAsset GraphicsComponent::loadGraphic ( const std::string & path)

Loads a graphic asset's tiles, pal, and map into memory.

Parameters
pathPath relative to the base path.
Returns
GraphicAsset with the loaded graphics data

Definition at line 11 of file GraphicsComponent.cpp.

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

◆ loadSpriteGraphic()

template<typename SpriteID>
GraphicAsset GraphicsComponent::loadSpriteGraphic ( const std::string & spritePath,
SpriteType type,
SpriteID spriteId )
inline

Wrapper function that loads a sprite graphic asset into memory.

This is a templated wrapper function, which calls loadSpriteGraphicImpl

Template Parameters
SpriteID
Parameters
spritePathPath relative to the base path.
typeSprite type
spriteIdSprite id
Returns
GraphicAsset with the loaded graphics data

Definition at line 57 of file GraphicsComponent.hpp.

Here is the call graph for this function:

◆ loadSpriteGraphicImpl()

GraphicAsset GraphicsComponent::loadSpriteGraphicImpl ( const std::string & spritePath,
SpriteType type,
int spriteId )
private

Loads the sprite graphic asset's tiles, pal, and map into memory via the spriteDb.

Parameters
spritePathPath relative to the base path.
typeSprite type
spriteIdSprite id
Returns
GraphicAsset with the loaded graphics data

Definition at line 40 of file GraphicsComponent.cpp.

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

◆ submitToManager()

void GraphicsComponent::submitToManager ( )
inlineoverrideprotected

Definition at line 75 of file GraphicsComponent.hpp.

◆ unloadAll()

void GraphicsComponent::unloadAll ( )

Unload all graphic assets from memory.

Definition at line 83 of file GraphicsComponent.cpp.

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

◆ unloadGraphic()

void GraphicsComponent::unloadGraphic ( GraphicAsset & asset)

Unload a specific graphic asset from memory.

Parameters
assetAsset to unload

Definition at line 52 of file GraphicsComponent.cpp.

Here is the caller graph for this function:

◆ update()

void GraphicsComponent::update ( ae::q20_12_t )
inlineoverride

Definition at line 28 of file GraphicsComponent.hpp.

Member Data Documentation

◆ id

int GraphicsComponent::id = -1
private

A GraphicAsset's index in loadedGraphics.

Definition at line 83 of file GraphicsComponent.hpp.

◆ io

IOManager& GraphicsComponent::io = IOManager::getInstance()
private

Definition at line 80 of file GraphicsComponent.hpp.

◆ loadedGraphics

etl::vector<GraphicAsset, 32> GraphicsComponent::loadedGraphics
private

Definition at line 86 of file GraphicsComponent.hpp.

◆ TYPE_ID

ae::ComponentTypeID GraphicsComponent::TYPE_ID = static_cast<ae::ComponentTypeID>(ComponentType::Graphics)
staticconstexpr

Definition at line 21 of file GraphicsComponent.hpp.


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