Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

SpritesBase Class Reference

A sample base class for applications that use sprites. It handles dealing with the OAM on the NDS. More...

#include <sprites.hpp>

Inheritance diagram for SpritesBase:

Inheritance graph
[legend]
List of all members.

Public Member Functions

void initOAM (void)
 Loops through all of the OAM entires turning the sprites off.

void updateOAM (void)
 Copy the internal OAM data to the real OAM memory.

 SpritesBase ()
 Simple constructor initializes internal variables.

void MoveSprite (Sprite *sp)
 Updates the sprites attributes to move it's location as indicated by the current x/y coordinates for the sprite.

virtual ~SpritesBase ()
 Virtual destructor due to inheritance.


Public Attributes

SpriteEntry OAMCopy [128]
 Copy of the OAM memory for updating while the screen is being drawn. This copy is for the touch screen.

SpriteRotation * rotationData
 Overlay of the rotation data on top of the OAM. This rotation data is for the touch screen.

SpriteEntry OAMSubCopy [128]
 Copy of the OAM memory for updating while the screen is being drawn. This copy is for the top screen.

SpriteRotation * rotationSubData
 Overlay of the rotation data on top of the OAM. This rotation data is for the top screen.


Detailed Description

A sample base class for applications that use sprites. It handles dealing with the OAM on the NDS.


Member Function Documentation

void SpritesBase::updateOAM void   ) 
 

Copy the internal OAM data to the real OAM memory.

This can only be done during VBlank, or HBlank if specifically requested in the mode using H_BLANK_OAM.

void SpritesBase::MoveSprite Sprite sp  ) 
 

Updates the sprites attributes to move it's location as indicated by the current x/y coordinates for the sprite.

Parameters:
sp The sprite to move on the screen.


Member Data Documentation

SpriteEntry SpritesBase::OAMCopy[128]
 

Copy of the OAM memory for updating while the screen is being drawn. This copy is for the touch screen.

Copied during the VBlank (or sometimes the HBlank.)

SpriteRotation* SpritesBase::rotationData
 

Overlay of the rotation data on top of the OAM. This rotation data is for the touch screen.

Apparently, there are 128 sprites, but only 32 rotation entries. Each sprite can point to one of the 32 rotation entries.

SpriteEntry SpritesBase::OAMSubCopy[128]
 

Copy of the OAM memory for updating while the screen is being drawn. This copy is for the top screen.

Copied during the VBlank (or sometimes the HBlank.)

SpriteRotation* SpritesBase::rotationSubData
 

Overlay of the rotation data on top of the OAM. This rotation data is for the top screen.

Apparently, there are 128 sprites, but only 32 rotation entries. Each sprite can point to one of the 32 rotation entries.


The documentation for this class was generated from the following files:
Generated on Fri Apr 22 13:53:32 2005 for Sprite01 Example Application by doxygen 1.3.6