CharSet Class Reference

#include <CharSet.h>

Inheritance diagram for CharSet:
ListenerObject

# Public Types

typedef const CharSetSpec CharSetROMSpec

# Public Member Functions

void constructor (const CharSetSpec *charSetSpec, uint16 offset)
void increaseUsageCount ()
 Increase the usage count.
bool decreaseUsageCount ()
 Decrease the usage count.
int8 getUsageCount ()
bool hasMultipleFrames ()
bool isShared ()
bool isOptimized ()
void setOffset (uint16 offset)
uint16 getOffset ()
const CharSetSpecgetSpec ()
uint16 getNumberOfChars ()
void addChar (uint32 charToAddTo, const uint32 *newChar)
void putChar (uint32 charToReplace, const uint32 *newChar)
void putPixel (const uint32 charToReplace, const Pixel *charSetPixel, BYTE newPixelColor)
void setFrame (uint16 frame)
uint16 getFrame ()
void write ()
 Write the tile graphical data to VRAM.

# Static Public Member Functions

static CharSet get (const CharSetSpec *charSetSpec)
static bool release (CharSet charSet)

# Protected Attributes

const CharSetSpeccharSetSpec
 Spec used in the construction of the char set.
uint32 tilesDisplacement
uint16 frame
 Indicator of the block inside the tiles array to write to DRAM.
uint16 offset
 Offset in CHAR space where the block allocated for this char set starts.
bool written
 If true the graphical data is written to VRAM; false otherwise.
int8 usageCount
 Number of references to this char set instance.

# Additional Inherited Members

- Private Member Functions inherited from ListenerObject
void constructor ()
 Class' constructor.
void destructor ()
 Class' destructor.
void addEventListener (ListenerObject listener, uint16 eventCode)
void removeEventListener (ListenerObject listener, uint16 eventCode)
void removeEventListeners (uint16 eventCode)
void removeAllEventListeners ()
 Remove all listener objects.
bool hasActiveEventListeners ()
void fireEvent (uint16 eventCode)
void sendMessageTo (ListenerObject receiver, uint32 message, uint32 delay, uint32 randomDelay)
void sendMessageToSelf (uint32 message, uint32 delay, uint32 randomDelay)
void discardAllMessages ()
 Discard all messages, both to be sent and to be received.
void discardMessages (uint32 message)
virtual bool onEvent (ListenerObject eventFirer, uint16 eventCode)
virtual bool handleMessage (Telegram telegram)
- Private Attributes inherited from ListenerObject
VirtualList events
 List of registered events.
int8 eventFirings
 Counter that keeps track of the number of fired events to prevent race conditions in nested firings.

# Detailed Description

Class CharSet

Inherits from ListenerObject

Manages the color data of tile array and writes it to VRAM.

Definition at line 82 of file CharSet.h.

# Member Typedef Documentation

# CharSetROMSpec

typedef const CharSetSpec CharSetROMSpec

A CharSet spec that is stored in ROM

Definition at line 71 of file CharSet.h.

# Member Function Documentation

# addChar()

void CharSet::addChar ( uint32 charToAddTo,
const uint32 * newChar )

Add the color provided color data to a CHAR.

Parameters
charToAddToIndex of the CHAR to add to
newCharColor data array for the CHAR

Definition at line 169 of file CharSet.c.

# constructor()

void CharSet::constructor ( const CharSetSpec * charSetSpec,
uint16 offset )

Class' constructor

Parameters
charSetSpecSpec to use in the construction of the char set
offsetOffset in CHAR space where the block allocated for this char set starts

Definition at line 52 of file CharSet.c.

# decreaseUsageCount()

bool CharSet::decreaseUsageCount ( )

Decrease the usage count.

Definition at line 92 of file CharSet.c.

# get()

static CharSet CharSet::get ( const CharSetSpec * charSetSpec)
static

Get a charSet configured with the provided spec.

Parameters
charSetSpecSpec used to select or initialize a texture with
Returns
CharSet initialized with the provided spec

Definition at line 27 of file CharSet.c.

# getFrame()

uint16 CharSet::getFrame ( )

Retriev the current frame (frame * number of CHARs + number of CHARs) to write to CHAR memory.

Returns
The frame to write to CHAR memory

Definition at line 253 of file CharSet.c.

# getNumberOfChars()

uint16 CharSet::getNumberOfChars ( )

Retrieve the number of CHARs used by the char set.

Returns
Number of CHARs used by the char set

Definition at line 162 of file CharSet.c.

# getOffset()

uint16 CharSet::getOffset ( )

Retrieve the offset within CHAR space.

Returns
Offset within CHAR space

Definition at line 148 of file CharSet.c.

# getSpec()

const CharSetSpec * CharSet::getSpec ( )

Retrieve the spec used in the construction of the char set.

Returns
Spec used in the construction of the char set

Definition at line 155 of file CharSet.c.

# getUsageCount()

int8 CharSet::getUsageCount ( )

Retrieve the usage count.

Returns
Usage count

Definition at line 104 of file CharSet.c.

# hasMultipleFrames()

bool CharSet::hasMultipleFrames ( )

Check if the CharSet has a non NULL array of frame offests.

Returns
True if the CharSet has an array of animation frames

Definition at line 111 of file CharSet.c.

# increaseUsageCount()

void CharSet::increaseUsageCount ( )

Increase the usage count.

Definition at line 85 of file CharSet.c.

# isOptimized()

bool CharSet::isOptimized ( )

Check if the char set is optimized.

Returns
True if the char set is optimized; false otherwise

Definition at line 125 of file CharSet.c.

# isShared()

bool CharSet::isShared ( )

Check if the char set is shared.

Returns
True if the char set is share; false otherwise

Definition at line 118 of file CharSet.c.

# putChar()

void CharSet::putChar ( uint32 charToReplace,
const uint32 * newChar )

Replace the color provided color data to a CHAR.

Parameters
charToReplaceIndex of the CHAR to replace
newCharColor data array for the CHAR

Definition at line 185 of file CharSet.c.

# putPixel()

void CharSet::putPixel ( const uint32 charToReplace,
const Pixel * charSetPixel,
BYTE newPixelColor )

Replace a pixel in a CHAR.

Parameters
charToReplaceIndex of the CHAR to replace
charSetPixelCoordinate in CHAR space of the CHAR to replace
newPixelColorColor data for the pixel

Definition at line 200 of file CharSet.c.

# release()

static bool CharSet::release ( CharSet charSet)
static

Release a charSet.

Parameters
charSetCharSet to release
Returns
True if the char set is successfully deleted; false otherwise

Definition at line 41 of file CharSet.c.

# setFrame()

void CharSet::setFrame ( uint16 frame)

Set the current frame (frame * number of CHARs + number of CHARs) to write to CHAR memory.

Parameters
frameThe frame to write to CHAR memory

Definition at line 227 of file CharSet.c.

# setOffset()

void CharSet::setOffset ( uint16 offset)

Set the offset within CHAR space.

Parameters
offsetOffset within CHAR space

Definition at line 132 of file CharSet.c.

# write()

void CharSet::write ( )

Write the tile graphical data to VRAM.

Definition at line 260 of file CharSet.c.

# Member Data Documentation

# charSetSpec

const CharSetSpec* CharSet::charSetSpec
protected

Spec used in the construction of the char set.

Definition at line 87 of file CharSet.h.

# frame

uint16 CharSet::frame
protected

Indicator of the block inside the tiles array to write to DRAM.

Definition at line 93 of file CharSet.h.

# offset

uint16 CharSet::offset
protected

Offset in CHAR space where the block allocated for this char set starts.

Definition at line 96 of file CharSet.h.

# tilesDisplacement

uint32 CharSet::tilesDisplacement
protected

Definition at line 90 of file CharSet.h.

# usageCount

int8 CharSet::usageCount
protected

Number of references to this char set instance.

Definition at line 102 of file CharSet.h.

# written

bool CharSet::written
protected

If true the graphical data is written to VRAM; false otherwise.

Definition at line 99 of file CharSet.h.


The documentation for this class was generated from the following files:
  • VUEngine-Core/source/Component/VisualComponent/Sprite/Texture/CharSet/CharSet.h
  • VUEngine-Core/source/Component/VisualComponent/Sprite/Texture/CharSet/CharSet.c