spriteManager Class Reference

The spriteManger is responsible for managing low-level memory allocation for the needs of spriteObjects. More...

#include <spriteManager.h>

Inherited by gameManager, menuBottom, menuGBottom, and menuTitle.

Inheritance diagram for spriteManager:

Inheritance graph
[legend]
Collaboration diagram for spriteManager:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 spriteManager (u8 newscreen=0)
 Create a new spriteManager instance and assign it a screen to manage.
virtual ~spriteManager ()
 Upon destroying this spriteManager, deactivate it first.
virtual void activate ()
 Set this spriteManager as the active manager for the screen it is assigned to.
virtual void deactivate ()
 Put this spriteManager into a hibernation state so that tick events are no longer executed for it.
virtual bool isActive ()
 Detect whether or not this spriteManager should be currently executing tick events and controlling its screen.
virtual void gameTick ()
 The game's 'tick' function, run once per frame to update all spriteObjects, sounds etc.
void resetBackground ()
 Reset the background system to its original state (all backgrounds off).
void unloadBackground ()
 Reset the background system to its original state and delete any background images that may be in memory.
void resetText ()
 Reset the text output system for this screen.
void loadSpriteSet (spriteSet *target, const unsigned short *p, const unsigned char *s)
 Load raw pallete and sprite data into a spriteSet.
bool spriteSetHasPallete (spriteSet *s)
 Check that a spriteSet has its pallete loaded into memory.
void spriteSetLoadPallete (spriteSet *s)
 Load a spriteSet's pallete (if needed) so that the spriteSet can successfully be used to create sprites.
void createSingleFireSprite (u8 palID, const unsigned char *gfx, vector< u8 > frames, u8 ticksPerFrame, s16 nx=OFFX, s16 ny=OFFY, u8 objSize1=0, u8 objSize2=2, u8 cx=16, u8 cy=16, u8 minIndex=0, u8 colorMode=1)
 Create a 'single effect' sprite, which will play once, then delete itself.
void createSingleFireSprite (u8 palID, u16 gfxID, vector< u8 > frames, u8 ticksPerFrame, s16 nx=OFFX, s16 ny=OFFY, u8 objSize1=0, u8 objSize2=2, u8 cx=16, u8 cy=16, u8 minIndex=0, u8 colorMode=1)
 Another utility function to create 'single effect' sprites, but for effects with preloaded GFX.
s8 loadPallete (void *newpallete)
 Load a pallete into memory, to later be used by sprite GFX.
s8 loadSprite (const unsigned char *newSprite, u8 sizex, u8 sizey, u8 minIndex=0, u8 palleteID=0, s16 x=OFFX, s16 y=OFFY, u8 colorMode=1)
 Load a sprite into OAM by passing GFX directly to the sprite.
void replaceSprite (u8 id, void *newSprite)
 Replace the sprite's GFX at the specified OAM slot with new GFX.
void updateSpritePallete (u8 spriteID, u16 gfxID, u8 palleteID, u8 sizex, u8 sizey, u8 colorMode, u8 x, u8 y)
 Update the pallete of a sprite without the need to delete, recreate or otherwise modify it.
void setAlpha (u8 transLevel)
 Set the global transparency level for the screen this spriteManager belongs to.
u16 loadGFX (const unsigned char *newGFX, u8 sizex, u8 sizey, u8 colorMode=1)
 Load some GFX data into memory for it to be later used by a spriteObject.
s8 loadSpriteFromGFX (u16 GFXid, u8 sizex, u8 sizey, u8 palleteID=0, u8 minIndex=0, u8 colorMode=1, s16 x=OFFX, s16 y=OFFY)
 Loads a sprite into OAM, using a previously created GFX and pallete.
void updateSpriteGFX (s8 spriteID, void *GFXid)
 Update the graphics of a sprite without the need to delete, recreate or otherwise modify it.
virtual void clearOutSprites (bool keepSound=false)
 Clean up all spriteObject's and reset the screen along with all video memory for that screen.
bool isSprite (s8 index) const
 Checks if a sprite in OAM is currently active.
void removeSprite (s8 index)
 Removes a sprite from OAM so that it may be reused.
void loadSound (soundData *ref, const u8 *data, const u32 *size)
 Fill a soundData with raw sound data and the size of that sound.
s8 playSound (const u8 *data, const u32 *size, bool repeat=false, u8 vol=127)
 Play a sound effect.
void stopSound (s8 channel)
 Stop playing a sound effect.
bool soundLooping (s8 channel)
 Checks whether the sound playing in the specified channel is looping or not.
void soundTick ()
bool isResetting () const
 Check whether or not the spriteManager is clearing out all data for its screen.

Public Attributes

bool bActive
 specifies whether or not this spriteManager is in control of its screen
bgSprite backGroundSprite
vector< spriteObject * > gameSprites
 the array of spriteObjects for this spriteManager. This contains all active spriteObjects for the screen.
u8 screen
 which screen this spriteManager relates to - 0 (bottom) or 1 (top)

Protected Member Functions

s8 getNextPalleteID ()
 Find out the next available pallete id for a new pallete to be loaded into.
s8 getNextSpriteID (u8 minIndex=0)
 Find out the next available OAM slot for a new sprite to be loaded into.

Protected Attributes

u8 sprites [128]
 array of sprite OAM toggles (0=no sprite, 1=allocated)
u8 palletes [16]
 array of pallete toggles (0=no pallete, 1=pallete loaded)
bool totalReset
 true only when the entire screen is being destroyed and refreshed. In such a case, there's no need for sprites to clean themselves up properly.
bool soundLoopings [8]
 sound channels, and whether or not the sound playing in that channel is looping

Classes

struct  bgSprite
 A set of raw data that tiled image backgrounds may use to be more easily loaded. More...
struct  soundData
 A set of raw data that sounds may use to be more easily played. More...
struct  spriteSet
 A set of raw data that spriteObjects may use to easily load themselves. More...

Detailed Description

The spriteManger is responsible for managing low-level memory allocation for the needs of spriteObjects.

This includes sprite graphics, palletes and of course the sprites themselves. There is always 1 spriteManager active for each screen at a time, as the different screens on a DS occupy entirely separate memory spaces.

There are 4 main areas managed here which it is important to differentiate between:

Sprites are stored in an 128 element array (spriteManager::sprites) - this is referred to as Object Address Memory (OAM). Each element in this array is a boolean toggle to show whether the sprite at that index is in use. Once a sprite is no longer needed, its position is set back to 0 so that future sprites can reuse it. Sprites reference GFX in order to draw themselves.

GFX are allowed rather more memory space (1024 slots iirc) and manage themselves rather more effectively, so such an array is not necessary for them. A sprite must be assigned a GFX in order for it to be visible.

Palletes are stored similarly to sprites, in a 16 element array of toggles (spriteManager::palletes). All palletes are generally loaded at the start of a screen refresh so that they are available on demand.

spriteObjects are the sum of these three parts, and are stored in a dynamic array (spriteManager::gameSprites). Each references a sprite ID in OAM, which it uses to manage its position variables. When a spriteObject is deleted, the sprite is freed up and the GFX the spriteObject was using is destroyed, but only if it is not being shared by other spriteObjects. spriteObjects also require a pallete in order to display their GFX.

spriteManagers also handle the use of background layers. The DS supports 4 sprite layers, any of which can be set as background layers to display tiled images instead of sprites.

A spriteManager is intended to stay in memory for the entire execution of the game. The methods spriteManager::activate() and spriteManager::deactivate() are used to change which spriteManager is active for its screen.

Author:
pospi

Definition at line 76 of file spriteManager.h.


Constructor & Destructor Documentation

spriteManager::spriteManager ( u8  newscreen = 0  )  [inline]

Create a new spriteManager instance and assign it a screen to manage.

Parameters:
newscreen the screen this spriteManager should handle. 1 is the top screen, 0 is the bottom one.

Definition at line 84 of file spriteManager.h.

References palletes, soundLoopings, and sprites.

virtual spriteManager::~spriteManager (  )  [inline, virtual]

Upon destroying this spriteManager, deactivate it first.

This will likely never be called as spriteManager objects should be used in global program scope.

Definition at line 99 of file spriteManager.h.

References deactivate().

Here is the call graph for this function:


Member Function Documentation

virtual void spriteManager::activate (  )  [inline, virtual]

Set this spriteManager as the active manager for the screen it is assigned to.

spriteManager::gameTick() is only executed for the active spriteManager. NEVER set two different spriteManagers to be active on the same screen at the same time.

Reimplemented in gameManager, menuBottom, menuGBottom, and menuTitle.

Definition at line 106 of file spriteManager.h.

References bActive, and clearOutSprites().

Referenced by menuTitle::activate(), menuGBottom::activate(), menuBottom::activate(), gameManager::activate(), menuGBottom::gameTick(), and menuBottom::mainAction().

Here is the call graph for this function:

virtual void spriteManager::deactivate (  )  [inline, virtual]

Put this spriteManager into a hibernation state so that tick events are no longer executed for it.

Reimplemented in gameManager, menuBottom, menuGBottom, and menuTitle.

Definition at line 110 of file spriteManager.h.

References bActive, and clearOutSprites().

Referenced by menuTitle::deactivate(), menuGBottom::deactivate(), menuBottom::deactivate(), gameManager::deactivate(), menuBottom::mainAction(), and ~spriteManager().

Here is the call graph for this function:

virtual bool spriteManager::isActive (  )  [inline, virtual]

Detect whether or not this spriteManager should be currently executing tick events and controlling its screen.

Returns:
true if the spriteManager is active, false otherwise

Definition at line 118 of file spriteManager.h.

References bActive.

Referenced by main().

void spriteManager::gameTick (  )  [virtual]

The game's 'tick' function, run once per frame to update all spriteObjects, sounds etc.

This function should be extended in child spriteManager classes to implement higher level game logic, menu navigation etc.

Reimplemented in gameManager, menuBottom, menuGBottom, and menuTitle.

Definition at line 381 of file spriteManager.cpp.

References gameSprites, and screen.

Referenced by menuTitle::gameTick(), menuGBottom::gameTick(), menuBottom::gameTick(), and gameManager::gameTick().

void spriteManager::resetBackground (  ) 

Reset the background system to its original state (all backgrounds off).

This function does not destroy any background data that may be loaded.

Definition at line 408 of file spriteManager.cpp.

References screen.

Referenced by menuBottom::controlsAction(), and menuBottom::controlsMenu().

void spriteManager::unloadBackground (  ) 

Reset the background system to its original state and delete any background images that may be in memory.

Definition at line 418 of file spriteManager.cpp.

References screen.

Referenced by menuTitle::deactivate(), menuGBottom::deactivate(), and menuBottom::deactivate().

void spriteManager::resetText (  ) 

Reset the text output system for this screen.

Note that the text system acts through a background layer, so the text layer (layer 2) must not be used for other purposes while in use.

Definition at line 429 of file spriteManager.cpp.

References screen.

Referenced by menuGBottom::activate(), menuBottom::activate(), menuBottom::clearMenus(), menuBottom::controlsAction(), and menuBottom::drawStatsFor().

void spriteManager::loadSpriteSet ( spriteSet target,
const unsigned short *  p,
const unsigned char *  s 
)

Load raw pallete and sprite data into a spriteSet.

The data passed in comes straight from the PAGfx converter. The spriteSet's pallete will automatically be loaded as well.

Parameters:
target a pointer to the spriteSet to fill
p a pointer to a raw array of pallete data
s a pointer to a raw array of sprite date

Definition at line 238 of file spriteManager.cpp.

References spriteManager::spriteSet::palleteData, spriteManager::spriteSet::spriteData, and spriteSetLoadPallete().

Referenced by gameManager::loadBootsSpriteSet(), menuBottom::loadCursorSpriteSet(), gameManager::loadDunceSpriteSet(), gameManager::loadEnvSpriteSet(), gameManager::loadFXSpriteSet(), menuGBottom::loadMenuSpriteSet(), menuBottom::loadMenuSpriteSet(), menuGBottom::loadPickupSpriteSet(), menuBottom::loadPickupSpriteSet(), gameManager::loadPickupSpriteSet(), gameManager::loadPlayer1SpriteSet(), gameManager::loadPlayer2SpriteSet(), and menuGBottom::loadSpawnerSpriteSet().

Here is the call graph for this function:

bool spriteManager::spriteSetHasPallete ( spriteSet s  ) 

Check that a spriteSet has its pallete loaded into memory.

Parameters:
s a pointer to the spriteSet to check up on
Returns:
true if the spriteSet's pallete was loaded, false otherwise

Definition at line 213 of file spriteManager.cpp.

References spriteManager::spriteSet::palleteID.

Referenced by spriteSetLoadPallete().

void spriteManager::spriteSetLoadPallete ( spriteSet s  ) 

Load a spriteSet's pallete (if needed) so that the spriteSet can successfully be used to create sprites.

Parameters:
s a pointer to the spriteSet to load palletes for

Definition at line 224 of file spriteManager.cpp.

References loadPallete(), spriteManager::spriteSet::palleteData, spriteManager::spriteSet::palleteID, and spriteSetHasPallete().

Referenced by loadSpriteSet().

Here is the call graph for this function:

void spriteManager::createSingleFireSprite ( u8  palID,
const unsigned char *  gfx,
vector< u8 >  frames,
u8  ticksPerFrame,
s16  nx = OFFX,
s16  ny = OFFY,
u8  objSize1 = 0,
u8  objSize2 = 2,
u8  cx = 16,
u8  cy = 16,
u8  minIndex = 0,
u8  colorMode = 1 
)

Create a 'single effect' sprite, which will play once, then delete itself.

See also:
singleFireSprite
Parameters:
palID id of the pallete to give the effect
gfx GFX data to give the effect
frames a vector of frames that the effect should play through before dieing
ticksPerFrame animation speed for the effect
nx x position for the effect to play at
ny y position for the effect to play at
objSize1 memory constant to specify x size of the sprite
objSize2 memory constant to specify y size of the sprite
cx x center offset (from the top left corner) for the sprite
cy y center offset (from the top left corner) for the sprite
minIndex minimum sprite index in OAM array, which can be used as a depth hierachy
colorMode colour mode, using PALib constants. 1 = 8bit.

Definition at line 265 of file spriteManager.cpp.

References totalReset.

Referenced by Pickup::Pickup(), Player::play1000VHitEffect(), Player::playSplashEffect(), Player::playWarpEffect(), gameManager::resetGame(), wp_weasel_proj::updateSprite(), wp_puck_proj::updateSprite(), wp_gren_proj::updateSprite(), wp_boomerang_proj::updateSprite(), Pickup::~Pickup(), wp_gren_proj::~wp_gren_proj(), wp_mine_proj::~wp_mine_proj(), and wp_puck_proj::~wp_puck_proj().

void spriteManager::createSingleFireSprite ( u8  palID,
u16  gfxID,
vector< u8 >  frames,
u8  ticksPerFrame,
s16  nx = OFFX,
s16  ny = OFFY,
u8  objSize1 = 0,
u8  objSize2 = 2,
u8  cx = 16,
u8  cy = 16,
u8  minIndex = 0,
u8  colorMode = 1 
)

Another utility function to create 'single effect' sprites, but for effects with preloaded GFX.

See also:
spriteManager::createSingleFireSprite()

Definition at line 279 of file spriteManager.cpp.

References totalReset.

s8 spriteManager::loadPallete ( void *  newpallete  ) 

Load a pallete into memory, to later be used by sprite GFX.

Parameters:
newpallete new pallete data to load
Returns:
id of the newly created pallete, or -1 if no pallete slots were free.

Definition at line 160 of file spriteManager.cpp.

References getNextPalleteID(), palletes, and screen.

Referenced by menuBottom::characterMenu(), spriteObject::givePallete(), gameManager::refreshPalletes(), and spriteSetLoadPallete().

Here is the call graph for this function:

s8 spriteManager::loadSprite ( const unsigned char *  newSprite,
u8  sizex,
u8  sizey,
u8  minIndex = 0,
u8  palleteID = 0,
s16  x = OFFX,
s16  y = OFFY,
u8  colorMode = 1 
)

Load a sprite into OAM by passing GFX directly to the sprite.

This will implicitly create a GFX as well, which is externally linked to the sprite and will delete itself when the sprite is deleted.

Parameters:
newSprite pointer to the GFX data to load into the sprite
sizex memory constant to specify x size of the sprite
sizey memory constant to specify y size of the sprite
minIndex minimum sprite index in OAM array, which can be used as a depth hierachy
palleteID id of the loaded pallete to use for the sprite
x new x position of modified sprite
y new y position of modified sprite
colorMode colour mode, using PALib constants. 1 = 8bit.
Returns:
OAM index of the newly created sprite, or -1 if out of OAM slots

Definition at line 131 of file spriteManager.cpp.

References getNextSpriteID(), screen, and sprites.

Here is the call graph for this function:

void spriteManager::replaceSprite ( u8  id,
void *  newSprite 
)

Replace the sprite's GFX at the specified OAM slot with new GFX.

Parameters:
id OAM id of the sprite to replace
newSprite new GFX data to give that sprite

Definition at line 148 of file spriteManager.cpp.

References screen.

void spriteManager::updateSpritePallete ( u8  spriteID,
u16  gfxID,
u8  palleteID,
u8  sizex,
u8  sizey,
u8  colorMode,
u8  x,
u8  y 
)

Update the pallete of a sprite without the need to delete, recreate or otherwise modify it.

Note that the sprite's GFX is not deleted, so if changing the GFX as well the old one should be deleted first.

Parameters:
spriteID the OAM index of the sprite to modify
gfxID id of the loaded GFX to use for the sprite
palleteID id of the loaded pallete to use for the sprite
sizex memory constant to specify x size of the sprite
sizey memory constant to specify y size of the sprite
colorMode colour mode, using PALib constants. 1 = 8bit.
x new x position of modified sprite
y new y position of modified sprite

Definition at line 91 of file spriteManager.cpp.

References screen.

Referenced by spriteObject::updatePallete().

void spriteManager::setAlpha ( u8  transLevel  ) 

Set the global transparency level for the screen this spriteManager belongs to.

Note that this is due to DS hardware limitations, where only 1 transparency level may be set for each screen.

See also:
spriteObject::setTransparency()
Parameters:
translevel the transparency level to set. Levels range from 0 (invisible) to 15 (opaque)

Definition at line 104 of file spriteManager.cpp.

References screen.

Referenced by clearOutSprites(), and spriteObject::setTransparency().

u16 spriteManager::loadGFX ( const unsigned char *  newGFX,
u8  sizex,
u8  sizey,
u8  colorMode = 1 
)

Load some GFX data into memory for it to be later used by a spriteObject.

Parameters:
newGFX pointer to the GFX data to load
sizex memory constant to specify x size of the sprite
sizey memory constant to specify y size of the sprite
colorMode colour mode, using PALib constants. 1 = 8bit.
Returns:
id of the loaded GFX

Definition at line 34 of file spriteManager.cpp.

References screen.

Referenced by gameManager::generateBricks(), gameManager::generateRopes(), spriteObject::giveSprite(), gameManager::preloadGFX(), and gameManager::resetGame().

s8 spriteManager::loadSpriteFromGFX ( u16  GFXid,
u8  sizex,
u8  sizey,
u8  palleteID = 0,
u8  minIndex = 0,
u8  colorMode = 1,
s16  x = OFFX,
s16  y = OFFY 
)

Loads a sprite into OAM, using a previously created GFX and pallete.

Parameters:
GFXid id of the GFX previously loaded via spriteManager::loadGFX()
sizex memory constant to specify x size of the sprite
sizey memory constant to specify y size of the sprite
palleteID id of the pallete previously created via spriteManager::loadPallete()
minIndex minimum sprite index in OAM array, which can be used as a depth hierachy
colorMode colour mode, using PALib constants. 1 = 8bit.
x initial x position of created sprite
y initial y position of created sprite
Returns:
OAM index of the newly created sprite, or -1 if out of OAM slots

Definition at line 55 of file spriteManager.cpp.

References getNextSpriteID(), screen, and sprites.

Referenced by spriteObject::giveGFX(), and spriteObject::giveSprite().

Here is the call graph for this function:

void spriteManager::updateSpriteGFX ( s8  spriteID,
void *  GFXid 
)

Update the graphics of a sprite without the need to delete, recreate or otherwise modify it.

Parameters:
spriteID the OAM index of the sprite to modify
GFXid id of the loaded GFX to make this sprite use

Definition at line 72 of file spriteManager.cpp.

References screen.

void spriteManager::clearOutSprites ( bool  keepSound = false  )  [virtual]

Clean up all spriteObject's and reset the screen along with all video memory for that screen.

Parameters:
keepSound if true, non-looping sounds will continue playing until they expire.

Reimplemented in gameManager, and menuBottom.

Definition at line 293 of file spriteManager.cpp.

References gameSprites, palletes, screen, setAlpha(), sprites, stopSound(), and totalReset.

Referenced by activate(), menuBottom::clearOutSprites(), gameManager::clearOutSprites(), and deactivate().

Here is the call graph for this function:

bool spriteManager::isSprite ( s8  index  )  const [inline]

Checks if a sprite in OAM is currently active.

Parameters:
index the OAM index of the sprite to check
Returns:
true if the sprite slot is in use, false otherwise

Definition at line 188 of file spriteManager.h.

References sprites.

Referenced by spriteObject::hasGraphics().

void spriteManager::removeSprite ( s8  index  )  [inline]

Removes a sprite from OAM so that it may be reused.

Definition at line 192 of file spriteManager.h.

References sprites.

Referenced by spriteObject::deleteSprite().

void spriteManager::loadSound ( soundData ref,
const u8 *  data,
const u32 *  size 
) [inline]

Fill a soundData with raw sound data and the size of that sound.

See also:
soundData
Parameters:
ref the soundData to fill
data pointer to the data that the soundData will be filled with
size the length of the sound

Definition at line 212 of file spriteManager.h.

References spriteManager::soundData::data, and spriteManager::soundData::size.

Referenced by main().

s8 spriteManager::playSound ( const u8 *  data,
const u32 *  sizePointer,
bool  repeat = false,
u8  vol = 127 
)

Play a sound effect.

There are 8 sound channels for use. Once a sound has completed, it will automatically be removed from its sound channel and free it up for other sounds to use.

Parameters:
data the sound data to play
sizePointer length of the sound
repeat if true, the sound will loop until the spriteObject responsible for playing it is destroyed
vol volume to play the sound at
Returns:
the channel the sound has begun playing in

Definition at line 338 of file spriteManager.cpp.

References soundLoopings.

Referenced by menuBottom::charAction(), menuBottom::charNameAction(), menuBottom::charNameNav(), menuBottom::charNav(), menuBottom::controlsAction(), menuBottom::creditsAction(), menuBottom::gameTick(), menuBottom::mainAction(), menuBottom::miscAction(), menuBottom::pickupsAction(), spriteObject::playSound(), menuBottom::roundsAction(), menuBottom::roundsNav(), menuBottom::sramAction(), menuBottom::statsAction(), and menuBottom::statsNav().

void spriteManager::stopSound ( s8  channel  ) 

Stop playing a sound effect.

Required to halt looping sounds.

Parameters:
channel channel of the sound to halt prematurely.

Definition at line 355 of file spriteManager.cpp.

References soundLoopings.

Referenced by clearOutSprites(), and spriteObject::stopSound().

bool spriteManager::soundLooping ( s8  channel  ) 

Checks whether the sound playing in the specified channel is looping or not.

Parameters:
channel the sound channel to check
Returns:
true if that sound is looping, false otherwise.

Definition at line 369 of file spriteManager.cpp.

References soundLoopings.

Referenced by spriteObject::hasSoundLooping().

void spriteManager::soundTick (  ) 

bool spriteManager::isResetting (  )  const [inline]

Check whether or not the spriteManager is clearing out all data for its screen.

Returns:
true if the spriteManager is resetting, false otherwise.

Definition at line 225 of file spriteManager.h.

References totalReset.

Referenced by spriteObject::deleteSprite(), Pickup::~Pickup(), wp_gren_proj::~wp_gren_proj(), wp_mine_proj::~wp_mine_proj(), and wp_puck_proj::~wp_puck_proj().

s8 spriteManager::getNextPalleteID (  )  [protected]

Find out the next available pallete id for a new pallete to be loaded into.

Returns:
the next pallete ID available (between 0 and 15), or -1 if there were no free slots

Definition at line 176 of file spriteManager.cpp.

References palletes.

Referenced by loadPallete().

s8 spriteManager::getNextSpriteID ( u8  minIndex = 0  )  [protected]

Find out the next available OAM slot for a new sprite to be loaded into.

Returns:
the next OAM slot available (between 0 and 127), or -1 if there were no free slots

Definition at line 194 of file spriteManager.cpp.

References sprites.

Referenced by gameManager::gameTick(), loadSprite(), and loadSpriteFromGFX().


Member Data Documentation

bool spriteManager::bActive

specifies whether or not this spriteManager is in control of its screen

Definition at line 112 of file spriteManager.h.

Referenced by activate(), deactivate(), and isActive().

bgSprite spriteManager::backGroundSprite

Definition at line 152 of file spriteManager.h.

vector<spriteObject*> spriteManager::gameSprites

the array of spriteObjects for this spriteManager. This contains all active spriteObjects for the screen.

Definition at line 178 of file spriteManager.h.

Referenced by wp_weasel_proj::atEdge(), spriteObject::checkCollisions(), massObject::checkPenetration(), clearOutSprites(), Pickup::collidingWith(), gameTick(), gameManager::gameTick(), gameManager::generateBricks(), spriteObject::spriteObject(), wp_gren_proj::updateSprite(), wp_mine::weaponFireAction(), and wp_hook::weaponFireAction().

u8 spriteManager::screen

which screen this spriteManager relates to - 0 (bottom) or 1 (top)

Definition at line 181 of file spriteManager.h.

Referenced by menuBottom::alterPlayerName(), menuBottom::characterMenu(), menuBottom::charNameNav(), clearOutSprites(), menuBottom::controlsMenu(), menuBottom::creditsMenu(), spriteObject::deleteSprite(), spriteObject::disableRotation(), menuBottom::drawStatsFor(), spriteObject::enableRotation(), gameTick(), menuTitle::gameTick(), menuGBottom::gameTick(), spriteObject::giveGFX(), spriteObject::givePallete(), spriteObject::giveSprite(), spriteObject::isColliding(), menuGBottom::loadBackground(), menuBottom::loadBackground(), loadGFX(), loadPallete(), menuTitle::loadRotatingBackground(), loadSprite(), loadSpriteFromGFX(), menuBottom::normalRender(), menuBottom::playerRenameMenu(), spriteObject::playSound(), replaceSprite(), resetBackground(), resetText(), menuBottom::roundsMenu(), menuBottom::roundsNav(), menuBottom::saveWarningMenu(), setAlpha(), spriteObject::setArbitraryAnim(), spriteObject::setFrame(), spriteObject::setTransparency(), spriteObject::spriteObject(), menuBottom::statsRender(), unloadBackground(), gameManager::unloadGFX(), spriteObject::updatePallete(), spriteObject::updateSprite(), updateSpriteGFX(), updateSpritePallete(), and Player::~Player().

u8 spriteManager::sprites[128] [protected]

array of sprite OAM toggles (0=no sprite, 1=allocated)

Definition at line 234 of file spriteManager.h.

Referenced by clearOutSprites(), getNextSpriteID(), isSprite(), loadSprite(), loadSpriteFromGFX(), removeSprite(), and spriteManager().

u8 spriteManager::palletes[16] [protected]

array of pallete toggles (0=no pallete, 1=pallete loaded)

Definition at line 236 of file spriteManager.h.

Referenced by clearOutSprites(), getNextPalleteID(), loadPallete(), and spriteManager().

bool spriteManager::totalReset [protected]

true only when the entire screen is being destroyed and refreshed. In such a case, there's no need for sprites to clean themselves up properly.

Definition at line 239 of file spriteManager.h.

Referenced by clearOutSprites(), createSingleFireSprite(), and isResetting().

bool spriteManager::soundLoopings[8] [protected]

sound channels, and whether or not the sound playing in that channel is looping

Definition at line 243 of file spriteManager.h.

Referenced by playSound(), soundLooping(), spriteManager(), and stopSound().


The documentation for this class was generated from the following files:
Generated on Tue Mar 13 23:27:55 2007 for MDuel DS by  doxygen 1.5.1-p1