The SGADE Documentation

the SGADE The Socrates Gameboy Advance Development Engine

The SGADE is a development library for the Nintendo Gameboy Advance. It's free for all uses and is distributed without guarantees. For more information visit the SGADE page.


Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

SoSpriteAnimation

Module for handling sprite frame sets. More...

Files

file  SoSpriteAnimation.c
file  SoSpriteAnimation.h

Data Structures

struct  SoSpriteAnimation
 Sprite animation structure. More...


Defines

#define SoSpriteAnimationGetFrameWidth(a_This)
 Returns width of animation frame in pixels.

#define SoSpriteAnimationGetFrameHeight(a_This)
 Returns height of animation frame in pixels.

#define SoSpriteAnimationGetNumFrames(a_This)
 Returns number of frames in the animation.

#define SoSpriteAnimationIs16Colors(a_This)
 Returns true if the animation is 16 colors, false if it is 256 colors.

#define SoSpriteAnimationGetData(a_This)
 Returns actual animation frame data (grahpics bytes).


Functions

u32 SoSpriteAnimationGetSize (const SoSpriteAnimation *a_This)
 Gets the size of the entire frame set.

u32 SoSpriteAnimationGetNumIndicesPerFrame (const SoSpriteAnimation *a_This)
 Returns the number of sprite memory indices (characters) a single frame occupies.


Detailed Description

Module for handling sprite frame sets.

You can use the SoConverter tool to convert animations to Socrates compatible header files.


Define Documentation

#define SoSpriteAnimationGetData a_This   
 

Returns actual animation frame data (grahpics bytes).

The frame data is arranged in 8x8 blocks, one frame after another. You shouldn't need this function -- it is used by the SoSpriteMemManager module.


Function Documentation

u32 SoSpriteAnimationGetNumIndicesPerFrame const SoSpriteAnimation   a_This
 

Returns the number of sprite memory indices (characters) a single frame occupies.

Parameters:
a_This  This pointer
Returns :
The number of character blocks a single frame takes;
Basically this is the same as the amount of bytes in a frame divided by 32, cause each character block is 32 bytes (smallest unit in sprite memory);

This function can be used for sprite animation. If you add this number to the current sprite tile index, it will use the next tile index. You can subtract it to get the previous tile index. It is up to you to manage what tile of the tileset you are currently displaying.

u32 SoSpriteAnimationGetSize const SoSpriteAnimation   a_This
 

Gets the size of the entire frame set.

Parameters:
a_This  This pointer.
Returns :
The size in bytes.


Copyright 2002 by the SGADE authors. See SoLicense.h or Visit the SGADE page for more information.