SpriteManager Class Reference
#include <SpriteManager.h>
![](../class_sprite_manager.png)
# Public Member Functions | |
void | constructor () |
Class' constructor. | |
override bool | onEvent (ListenerObject eventFirer, uint16 eventCode) |
override uint32 | getType () |
override void | enable () |
Enable the manager. | |
override void | disable () |
Disable the manager. | |
override Sprite | create (Entity owner, const SpriteSpec *spriteSpec) |
override void | purgeComponents () |
Force the purging of deleted components. | |
override bool | areComponentsVisual () |
void | configure (uint8 texturesMaximumRowsToWrite, int32 maximumParamTableRowsToComputePerCall, const int16 size[4], const int16 z[4], Clock animationsClock) |
void | setAnimationsClock (Clock animationsClock) |
void | setupObjectSpriteContainers (int16 size[4], int16 z[4]) |
void | setMaximumParamTableRowsToComputePerCall (int32 maximumParamTableRowsToComputePerCall) |
int32 | getMaximumParamTableRowsToComputePerCall () |
void | setTexturesMaximumRowsToWrite (uint8 texturesMaximumRowsToWrite) |
int8 | getTexturesMaximumRowsToWrite () |
void | deferTextureUpdating (bool deferTextureUpdating) |
void | deferParamTableEffects (bool deferAffineTransformations) |
void | prepareAll () |
Force the rendering and drawing of all sprites. | |
void | render () |
Render sprites. | |
void | renderAndDraw () |
Force the rendering and drawing of all sprites (available only when __TOOLS is defined). | |
void | writeTextures () |
Force the writing of graphical data to DRAM space. | |
void | invalidateRendering () |
Invalidate the rendering status of all sprites so they re-render again in the next cycle. | |
void | hideAllSprites (Sprite spareSprite, bool hidePrinting) |
void | showAllSprites (Sprite spareSprite, bool showPrinting) |
void | hideAllSprites (Sprite spareSprite, bool hidePrinting) |
void | computeTotalPixelsDrawn () |
Compute the total pixels drawn. | |
int8 | getFreeLayer () |
int32 | getNumberOfSprites () |
Sprite | getSpriteAtIndex (int16 index) |
void | print (int32 x, int32 y, bool resumed) |
void | printSPTInfo (int16 spt, int32 x, int32 y) |
# Protected Attributes | |
WorldAttributes * | worldAttributesBaseAddress |
ObjectAttributes * | objectAttributesBaseAddress |
Clock | animationsClock |
Clock for the animations. | |
SpriteRegistry | spriteRegistry [kSpriteListEnd] |
List of all created sprites. | |
ObjectSpriteContainer | objectSpriteContainers [4] |
List of object sprite containers. | |
int32 | totalPixelsDrawn |
Total pixels currently drawn. | |
int16 | maximumParamTableRowsToComputePerCall |
Number of param table rows to write during each rendering cycle. | |
bool | evenFrame |
Flag to distinguish between even and odd game frames. | |
int16 | bgmapIndex |
Free WORLD layer during the last rendering cycle. | |
int16 | objectIndex |
Free OBJECT during the last rendering cycle. | |
int16 | previousObjectIndex |
int8 | texturesMaximumRowsToWrite |
Number of texture rows to write during each rendering cycle. | |
bool | deferTextureUpdating |
Flag to defer texturing writing over time. | |
bool | deferParamTableEffects |
Flag to defer param tables writing over time. | |
bool | completeSort |
int8 | spt |
SPT index that for OBJECT memory management. | |
uint16 | vipSPTRegistersCache [4] |
Cache for the VIP SPT registers. |
# Additional Inherited Members | |
![]() | |
void | constructor () |
Class' constructor. | |
void | destroyAllComponents () |
Destroy all the manager's components. | |
virtual Component | create (Entity owner, const ComponentSpec *componentSpec)=0 |
![]() | |
static Component | createComponent (Entity owner, const ComponentSpec *componentSpec) |
static void | destroyComponent (Entity owner, Component component) |
static Component | addComponent (Entity owner, const ComponentSpec *componentSpec) |
static void | removeComponent (Entity owner, Component component) |
static void | addComponents (Entity owner, ComponentSpec **componentSpecs, uint32 componentType) |
static void | removeComponents (Entity owner, uint32 componentType) |
static void | createComponents (Entity owner, ComponentSpec **componentSpecs) |
static void | destroyComponents (Entity owner) |
static Component | getComponentAtIndex (Entity owner, uint32 componentType, int16 componentIndex) |
static void | getComponents (Entity owner, uint32 componentType, VirtualList components) |
static bool | getComponentsOfClass (Entity owner, ClassPointer classPointer, VirtualList components, uint32 componentType) |
static uint16 | getComponentsCount (Entity owner, uint32 componentType) |
static void | propagateCommand (int32 command, Entity owner, uint32 componentType,...) |
static bool | calculateRightBox (Entity owner, RightBox *rightBox) |
![]() | |
VirtualList | components |
List of components. | |
bool | locked |
Flag to prevent the manipulation of the components list. |
# Detailed Description
Class SpriteManager
Inherits from ComponentManager
Manages all the sprite instances.
Definition at line 69 of file SpriteManager.h.
# Member Function Documentation
# areComponentsVisual()
|
virtual |
Retrieve information regarding if the components are visile.
- Returns
- True if the components managed are visual; false otherwise
Reimplemented from ComponentManager.
Definition at line 330 of file SpriteManager.c.
# computeTotalPixelsDrawn()
void SpriteManager::computeTotalPixelsDrawn | ( | ) |
Compute the total pixels drawn.
Definition at line 835 of file SpriteManager.c.
# configure()
void SpriteManager::configure | ( | uint8 | texturesMaximumRowsToWrite, |
int32 | maximumParamTableRowsToComputePerCall, | ||
const int16 | size[4], | ||
const int16 | z[4], | ||
Clock | animationsClock ) |
Configure the manager's state.
- Parameters
-
texturesMaximumRowsToWrite Number of texture rows to write during each rendering cycle maximumParamTableRowsToComputePerCall Number of param table rows to write during each rendering cycle size Array with the number of OBJECTS for each container z Array of Z coordinates for each container animationsClock Clock for the animations
Definition at line 337 of file SpriteManager.c.
# constructor()
void SpriteManager::constructor | ( | ) |
Class' constructor.
Definition at line 76 of file SpriteManager.c.
# create()
Sprite SpriteManager::create | ( | Entity | owner, |
const SpriteSpec * | spriteSpec ) |
Create a sprite with the provided spec.
- Parameters
-
owner Object to which the sprite will attach to spriteSpec Spec to use to create the sprite
- Returns
- Created sprite
Definition at line 240 of file SpriteManager.c.
# deferParamTableEffects()
void SpriteManager::deferParamTableEffects | ( | bool | deferAffineTransformations | ) |
Enable or disable the writing of param tables over time.
- Parameters
-
deferAffineTransformations If true, param tables are written overtime; otherwise they are written in a single pass
# deferTextureUpdating()
void SpriteManager::deferTextureUpdating | ( | bool | deferTextureUpdating | ) |
Enable or disable the texture writing over time.
- Parameters
-
deferTextureUpdating If true, textures are written overtime; otherwise they are written in a single pass
# disable()
|
virtual |
Disable the manager.
Reimplemented from ComponentManager.
Definition at line 208 of file SpriteManager.c.
# enable()
|
virtual |
Enable the manager.
Reimplemented from ComponentManager.
Definition at line 168 of file SpriteManager.c.
# getFreeLayer()
int8 SpriteManager::getFreeLayer | ( | ) |
Retrieve the free WORLD layer during the last rendering cycle.
- Returns
- Free WORLD layer during the last rendering cycle
# getMaximumParamTableRowsToComputePerCall()
int32 SpriteManager::getMaximumParamTableRowsToComputePerCall | ( | ) |
Retrieve the number of param table rows to write during each rendering cycle.
- Returns
- Number of param table rows to write during each rendering cycle
Definition at line 472 of file SpriteManager.c.
# getNumberOfSprites()
int32 SpriteManager::getNumberOfSprites | ( | ) |
Retrieve the total number of registerd sprites.
- Returns
- Total number of registerd sprites
Definition at line 849 of file SpriteManager.c.
# getSpriteAtIndex()
Retrieve the sprite at the provided position in the list of sprites.
- Parameters
-
index Index of the node in the list of sprites
- Returns
- Sprite at the provided position in the list of sprites
Definition at line 856 of file SpriteManager.c.
# getTexturesMaximumRowsToWrite()
int8 SpriteManager::getTexturesMaximumRowsToWrite | ( | ) |
Get the number of texture rows to write during each rendering cycle.
- Returns
- Number of texture rows to write during each rendering cycle
Definition at line 486 of file SpriteManager.c.
# getType()
|
virtual |
Retrieve the compoment type that the manager manages.
- Returns
- Component type
Implements ComponentManager.
Definition at line 161 of file SpriteManager.c.
# hideAllSprites() [1/2]
Hide all sprites except the provided one.
- Parameters
-
spareSprite Sprite to not hide hidePrinting Flag to allow/prohibit the display of the printing sprite
# hideAllSprites() [2/2]
Hide all sprites except the provided one (available only when __TOOLS is defined).
- Parameters
-
spareSprite Sprite to not hide hidePrinting Flag to allow/prohibit the display of the printing sprite
# invalidateRendering()
void SpriteManager::invalidateRendering | ( | ) |
Invalidate the rendering status of all sprites so they re-render again in the next cycle.
Definition at line 746 of file SpriteManager.c.
# onEvent()
|
virtual |
Process an event that the instance is listen for.
- Parameters
-
eventFirer ListenerObject that signals the event eventCode Code of the firing event
- Returns
- False if the listener has to be removed; true to keep it
Reimplemented from ListenerObject.
Definition at line 144 of file SpriteManager.c.
# prepareAll()
void SpriteManager::prepareAll | ( | ) |
Force the rendering and drawing of all sprites.
Definition at line 516 of file SpriteManager.c.
# print()
Print sprites statistics.
- Parameters
-
x Screen x coordinate where to print y Screen y coordinate where to print resumed If true it only prints the most important statistics
Definition at line 915 of file SpriteManager.c.
# printSPTInfo()
Print OBJECT related stats.
- Parameters
-
x Screen x coordinate where to print y Screen y coordinate where to print
Definition at line 979 of file SpriteManager.c.
# purgeComponents()
|
virtual |
Force the purging of deleted components.
Reimplemented from ComponentManager.
Definition at line 299 of file SpriteManager.c.
# render()
void SpriteManager::render | ( | ) |
Render sprites.
Definition at line 556 of file SpriteManager.c.
# renderAndDraw()
void SpriteManager::renderAndDraw | ( | ) |
Force the rendering and drawing of all sprites (available only when __TOOLS is defined).
# setAnimationsClock()
void SpriteManager::setAnimationsClock | ( | Clock | animationsClock | ) |
Set the clock that determines if the animations must be updated or not.
- Parameters
-
clock Clock for the animations
Definition at line 351 of file SpriteManager.c.
# setMaximumParamTableRowsToComputePerCall()
void SpriteManager::setMaximumParamTableRowsToComputePerCall | ( | int32 | maximumParamTableRowsToComputePerCall | ) |
Set the number of param table rows to write during each rendering cycle.
- Parameters
-
maximumParamTableRowsToComputePerCall Number of param table rows to write during each rendering cycle
Definition at line 465 of file SpriteManager.c.
# setTexturesMaximumRowsToWrite()
void SpriteManager::setTexturesMaximumRowsToWrite | ( | uint8 | texturesMaximumRowsToWrite | ) |
Set the number of texture rows to write during each rendering cycle.
- Parameters
-
texturesMaximumRowsToWrite Number of texture rows to write during each rendering cycle
Definition at line 479 of file SpriteManager.c.
# setupObjectSpriteContainers()
Configure the object sprite containers.
- Parameters
-
size Array with the number of OBJECTS for each container z Array of Z coordinates for each container
# showAllSprites()
Show all sprites except the provided one (available only when __TOOLS is defined).
- Parameters
-
spareSprite Sprite to not show showPrinting Flag to allow/prohibit the display of the printing sprite
# writeTextures()
void SpriteManager::writeTextures | ( | ) |
Force the writing of graphical data to DRAM space.
Definition at line 735 of file SpriteManager.c.
# Member Data Documentation
# animationsClock
|
protected |
Clock for the animations.
Definition at line 80 of file SpriteManager.h.
# bgmapIndex
|
protected |
Free WORLD layer during the last rendering cycle.
Definition at line 98 of file SpriteManager.h.
# completeSort
|
protected |
Definition at line 117 of file SpriteManager.h.
# deferParamTableEffects
|
protected |
Flag to defer param tables writing over time.
Definition at line 114 of file SpriteManager.h.
# deferTextureUpdating
|
protected |
Flag to defer texturing writing over time.
Definition at line 111 of file SpriteManager.h.
# evenFrame
|
protected |
Flag to distinguish between even and odd game frames.
Definition at line 95 of file SpriteManager.h.
# maximumParamTableRowsToComputePerCall
|
protected |
Number of param table rows to write during each rendering cycle.
Definition at line 92 of file SpriteManager.h.
# objectAttributesBaseAddress
|
protected |
Definition at line 77 of file SpriteManager.h.
# objectIndex
|
protected |
Free OBJECT during the last rendering cycle.
Definition at line 101 of file SpriteManager.h.
# objectSpriteContainers
|
protected |
List of object sprite containers.
Definition at line 86 of file SpriteManager.h.
# previousObjectIndex
|
protected |
Previous free OBJECT during the last rendering cycle, used to avoid writing the whole address space
Definition at line 105 of file SpriteManager.h.
# spriteRegistry
|
protected |
List of all created sprites.
Definition at line 83 of file SpriteManager.h.
# spt
|
protected |
SPT index that for OBJECT memory management.
Definition at line 120 of file SpriteManager.h.
# texturesMaximumRowsToWrite
|
protected |
Number of texture rows to write during each rendering cycle.
Definition at line 108 of file SpriteManager.h.
# totalPixelsDrawn
|
protected |
Total pixels currently drawn.
Definition at line 89 of file SpriteManager.h.
# vipSPTRegistersCache
|
protected |
Cache for the VIP SPT registers.
Definition at line 123 of file SpriteManager.h.
# worldAttributesBaseAddress
|
protected |
Definition at line 74 of file SpriteManager.h.
The documentation for this class was generated from the following files:
- VUEngine-Core/source/Component/VisualComponent/Sprite/SpriteManager.h
- VUEngine-Core/source/Component/VisualComponent/Sprite/SpriteManager.c