Sprite system for Dual Screen


Functions

void PA_SetScreenSpace (s16 ScreenSpace)
 Set the space between the 2 screens for the Dual Fonctions. 48 pixels by default
void PA_DualSetSpriteY (u8 obj, s16 y)
 Set the Y position of a sprite on screen
void PA_DualCreateSprite (u8 obj_number, void *obj_data, u8 obj_shape, u8 obj_size, u8 color_mode, u8 palette, s16 x, s16 y)
 Create a sprite with it's gfx, on 2 screens
void PA_DualCreateSpriteEx (u8 obj_number, void *obj_data, u8 obj_shape, u8 obj_size, u8 color_mode, u8 palette, u8 obj_mode, bool mosaic, bool hflip, bool vflip, u8 prio, bool dblsize, s16 x, s16 y)
 Create a sprite with it's gfx. This is the complex version of the function
void PA_DualCreate16bitSpriteEx (u8 obj_number, void *obj_data, u8 obj_shape, u8 obj_size, bool mosaic, bool hflip, bool vflip, u8 prio, bool dblsize, s16 x, s16 y)
 Create a 16 bit sprite with it's gfx. This is the complex version of the function. Warning : a 16bit sprite MUST be 128 pixels large, even if you sprite only takes up a small part on the left...
void PA_DualCreate16bitSprite (u8 obj_number, void *obj_data, u8 obj_shape, u8 obj_size, s16 x, s16 y)
 Create a 16 bit sprite with it's gfx. This is the simple version of the function. Warning : a 16bit sprite MUST be 128 pixels large, even if you sprite only takes up a small part on the left...
void PA_DualCreateSpriteFromGfx (u8 obj_number, u16 *obj_gfx, u8 obj_shape, u8 obj_size, u8 color_mode, u8 palette, s16 x, s16 y)
 Create a sprite with it's gfx. This is the simple version of the function
void PA_DualCreateSpriteExFromGfx (u8 obj_number, u16 *obj_gfx, u8 obj_shape, u8 obj_size, u8 color_mode, u8 palette, u8 obj_mode, bool mosaic, bool hflip, bool vflip, u8 prio, bool dblsize, s16 x, s16 y)
 Create a sprite with it's gfx. This is the complex version of the function
void PA_DualUpdateSpriteGfx (u8 obj_number, void *obj_data)
 Update the Gfx of a given sprite
void PA_DualUpdateGfx (u16 gfx_number, void *obj_data)
 Update the Gfx of a given sprite
void PA_DualDeleteSprite (u8 obj_number)
 Delete a given sprite. If it is the only one to use it's gfx, it'll be deleted too.
void PA_DualSetSpriteRotEnable (u8 sprite, u8 rotset)
 Rotate and zoom a sprite
void PA_DualSetSpriteRotDisable (u8 sprite)
 Stop rotating and zooming a sprite
void PA_DualSetRotset (u8 rotset, s16 angle, u16 zoomx, u16 zoomy)
 Rotate and zoom a sprite
void PA_DualSetRotsetNoZoom (u8 rotset, s16 angle)
 Rotate a sprite without zooming. It's a bit faster than the normal PA_SetRotset function
void PA_DualSetRotsetNoAngle (u8 rotset, u16 zoomx, u16 zoomy)
 Zoom a sprite without rotating. It's a bit faster than the normal PA_SetRotset function
void PA_DualSetSpriteX (u8 obj, s16 x)
 Set the X position of a sprite on screen
void PA_DualSetSpriteXY (u8 sprite, s16 x, s16 y)
 Set the X and Y position of a sprite on screen
void PA_DualSetSpritePal (u8 obj, u8 pal)
 Set the 16 color palette used by a sprite
void PA_DualSetSpriteDblsize (u8 obj, bool dblsize)
 Enable or disable double size for a given sprite
void PA_DualSetSpriteColors (u8 sprite, bool n_colors)
 Change the sprite's color mode
void PA_DualSetSpriteMode (u8 sprite, u8 obj_mode)
 Set the sprite's mode : 0 for normal, 1 for alpha blending, 2 for window
void PA_DualSetSpriteMosaic (u8 obj, bool mosaic)
 Enable or disable mosaic mode for a given sprite
void PA_DualSetSpriteHflip (u8 obj, bool hflip)
 Enable or disable horizontal flip for a given sprite
void PA_DualSetSpriteVflip (u8 obj, bool vflip)
 Enable or disable vertical flip for a given sprite
void PA_DualSetSpriteGfx (u8 obj, u16 *gfx)
 Change the gfx used by a sprite
void PA_DualSetSpritePrio (u8 obj, u8 prio)
 Set a sprite's Background priority
void PA_DualCloneSprite (u8 obj, u8 target)
 Clone a sprite. Works only for sprites on the same screen
void PA_DualSetSpriteAnimEx (u8 sprite, u8 lx, u8 ly, u8 ncolors, s16 animframe)
 Set the animation frame for a given sprite. This function is faster than the normal PA_SetSpriteAnim because it doesn't have to lookup the sprite dimensions...
void PA_DualSetSpriteAnim (u8 sprite, s16 animframe)
 Set the animation frame for a given sprite. Same as PA_SetSpriteAnimEx, but a bit slower and easier to use...
void PA_DualSetSpritePixelEx (u8 sprite, u8 hsize, u8 n_colors, u8 x, u8 y, u8 color)
 Set a sprite's pixel to a given palette color
void PA_DualSetSpritePixel (u8 sprite, s16 x, s16 y, bool color)
 Set a sprite's pixel to a given palette color. Like PA_SetSpritePixelEx, with less options, but a little slower

Detailed Description

Load Sprite, move them around, rotate them...

Function Documentation

inline void PA_DualCloneSprite u8  obj,
u8  target
[inline]
 

Clone a sprite. Works only for sprites on the same screen

Parameters:
obj Object number in the sprite system
target Target sprite to clone

inline void PA_DualCreate16bitSprite u8  obj_number,
void *  obj_data,
u8  obj_shape,
u8  obj_size,
s16  x,
s16  y
[inline]
 

Create a 16 bit sprite with it's gfx. This is the simple version of the function. Warning : a 16bit sprite MUST be 128 pixels large, even if you sprite only takes up a small part on the left...

Parameters:
obj_number Object number you want to use (0-127 for each screen seperately).
obj_data Gfx to load
obj_shape Object shape, from 0 to 2. Use the OBJ_SIZE_32X32 (...) macros for object shape and obj_size...
obj_size Object size. Use the OBJ_SIZE_32X32 (...) macros for object shape and obj_size...
x X position of the sprite
y Y position of the sprite

inline void PA_DualCreate16bitSpriteEx u8  obj_number,
void *  obj_data,
u8  obj_shape,
u8  obj_size,
bool  mosaic,
bool  hflip,
bool  vflip,
u8  prio,
bool  dblsize,
s16  x,
s16  y
[inline]
 

Create a 16 bit sprite with it's gfx. This is the complex version of the function. Warning : a 16bit sprite MUST be 128 pixels large, even if you sprite only takes up a small part on the left...

Parameters:
obj_number Object number you want to use (0-127 for each screen seperately).
obj_data Gfx to load
obj_shape Object shape, from 0 to 2. Use the OBJ_SIZE_32X32 (...) macros for object shape and obj_size...
obj_size Object size. Use the OBJ_SIZE_32X32 (...) macros for object shape and obj_size...
mosaic Activate Mosaic for the sprite or not. Not yet functionnal either :p
hflip Horizontal flip on or off...
vflip Vertical flip...
prio Sprite priority regarding backgrounds : in front of which background to show it (0-3)
dblsize Double the possible sprite size. Activate only if you are going to rotate and zoom in the sprite
x X position of the sprite
y Y position of the sprite

inline void PA_DualCreateSprite u8  obj_number,
void *  obj_data,
u8  obj_shape,
u8  obj_size,
u8  color_mode,
u8  palette,
s16  x,
s16  y
[inline]
 

Create a sprite with it's gfx, on 2 screens

Parameters:
obj_number Object number you want to use (0-127 for each screen seperately).
obj_data Gfx to load
obj_shape Object shape, from 0 to 2. Use the OBJ_SIZE_32X32 (...) macros for object shape and obj_size...
obj_size Object size. Use the OBJ_SIZE_32X32 (...) macros for object shape and obj_size...
color_mode 256 or 16 color mode (1 or 0).
palette Palette to use (0-15). Leave to 0 if in 256 color mode...
x X position of the sprite
y Y position of the sprite

inline void PA_DualCreateSpriteEx u8  obj_number,
void *  obj_data,
u8  obj_shape,
u8  obj_size,
u8  color_mode,
u8  palette,
u8  obj_mode,
bool  mosaic,
bool  hflip,
bool  vflip,
u8  prio,
bool  dblsize,
s16  x,
s16  y
[inline]
 

Create a sprite with it's gfx. This is the complex version of the function

Parameters:
obj_number Object number you want to use (0-127 for each screen seperately).
obj_data Gfx to load
obj_shape Object shape, from 0 to 2. Use the OBJ_SIZE_32X32 (...) macros for object shape and obj_size...
obj_size Object size. Use the OBJ_SIZE_32X32 (...) macros for object shape and obj_size...
color_mode 256 or 16 color mode (1 or 0).
palette Palette to use (0-15). Leave to 0 if in 256 color mode...
obj_mode Object mode (normal, transparent, window). Not functionnal yet, please leave to 0 for now
mosaic Activate Mosaic for the sprite or not. Not yet functionnal either :p
hflip Horizontal flip on or off...
vflip Vertical flip...
prio Sprite priority regarding backgrounds : in front of which background to show it (0-3)
dblsize Double the possible sprite size. Activate only if you are going to rotate and zoom in the sprite
x X position of the sprite
y Y position of the sprite

inline void PA_DualCreateSpriteExFromGfx u8  obj_number,
u16 *  obj_gfx,
u8  obj_shape,
u8  obj_size,
u8  color_mode,
u8  palette,
u8  obj_mode,
bool  mosaic,
bool  hflip,
bool  vflip,
u8  prio,
bool  dblsize,
s16  x,
s16  y
[inline]
 

Create a sprite with it's gfx. This is the complex version of the function

Parameters:
obj_number Object number you want to use (0-127 for each screen seperately).
obj_gfx Memory gfx to use. Get it by using PA_GetSpriteGfx or PA_CreateGfx
obj_shape Object shape, from 0 to 2. Use the OBJ_SIZE_32X32 (...) macros for object shape and obj_size...
obj_size Object size. Use the OBJ_SIZE_32X32 (...) macros for object shape and obj_size...
color_mode 256 or 16 color mode (1 or 0).
palette Palette to use (0-15). Leave to 0 if in 256 color mode...
obj_mode Object mode (normal, transparent, window). Not functionnal yet, please leave to 0 for now
mosaic Activate Mosaic for the sprite or not. Not yet functionnal either :p
hflip Horizontal flip on or off...
vflip Vertical flip...
prio Sprite priority regarding backgrounds : in front of which background to show it (0-3)
dblsize Double the possible sprite size. Activate only if you are going to rotate and zoom in the sprite
x X position of the sprite
y Y position of the sprite

inline void PA_DualCreateSpriteFromGfx u8  obj_number,
u16 *  obj_gfx,
u8  obj_shape,
u8  obj_size,
u8  color_mode,
u8  palette,
s16  x,
s16  y
[inline]
 

Create a sprite with it's gfx. This is the simple version of the function

Parameters:
obj_number Object number you want to use (0-127 for each screen seperately).
obj_gfx Memory gfx to use. Get it by using PA_GetSpriteGfx or PA_CreateGfx
obj_shape Object shape, from 0 to 2. Use the OBJ_SIZE_32X32 (...) macros for object shape and obj_size...
obj_size Object size. Use the OBJ_SIZE_32X32 (...) macros for object shape and obj_size...
color_mode 256 or 16 color mode (1 or 0).
palette Palette to use (0-15). Leave to 0 if in 256 color mode...
x X position of the sprite
y Y position of the sprite

inline void PA_DualDeleteSprite u8  obj_number  )  [inline]
 

Delete a given sprite. If it is the only one to use it's gfx, it'll be deleted too.

Parameters:
obj_number Sprite number

inline void PA_DualSetRotset u8  rotset,
s16  angle,
u16  zoomx,
u16  zoomy
[inline]
 

Rotate and zoom a sprite

Parameters:
rotset Rotset you want to change. To give a sprite a rotset, use PA_SetSpriteRotEnable...
angle Angle, between 0 and 512 (not 360, be carefull)
zoomx Horizontal zoom. 256 is unzoomed, 512 is 2 times smaller, and 128 twice as big... So adjust at will ! :p
zoomy Vertical zoom. 256 is unzoomed, 512 is 2 times smaller, and 128 twice as big... So adjust at will ! :p

inline void PA_DualSetRotsetNoAngle u8  rotset,
u16  zoomx,
u16  zoomy
[inline]
 

Zoom a sprite without rotating. It's a bit faster than the normal PA_SetRotset function

Parameters:
rotset Rotset you want to change. To give a sprite a rotset, use PA_SetSpriteRotEnable...
zoomx Horizontal zoom. 256 is unzoomed, 512 is 2 times smaller, and 128 twice as big... So adjust at will ! :p
zoomy Vertical zoom. 256 is unzoomed, 512 is 2 times smaller, and 128 twice as big... So adjust at will ! :p

inline void PA_DualSetRotsetNoZoom u8  rotset,
s16  angle
[inline]
 

Rotate a sprite without zooming. It's a bit faster than the normal PA_SetRotset function

Parameters:
rotset Rotset you want to change. To give a sprite a rotset, use PA_SetSpriteRotEnable...
angle Angle, between 0 and 512 (not 360, be carefull)

inline void PA_DualSetSpriteAnim u8  sprite,
s16  animframe
[inline]
 

Set the animation frame for a given sprite. Same as PA_SetSpriteAnimEx, but a bit slower and easier to use...

Parameters:
sprite sprite number in the sprite system
animframe Sprite animation frame (0, 1, 2, etc...)

inline void PA_DualSetSpriteAnimEx u8  sprite,
u8  lx,
u8  ly,
u8  ncolors,
s16  animframe
[inline]
 

Set the animation frame for a given sprite. This function is faster than the normal PA_SetSpriteAnim because it doesn't have to lookup the sprite dimensions...

Parameters:
sprite sprite number in the sprite system
lx Sprite width (8, 16, 32, 64)
ly Sprite height (8, 16, 32, 64)
ncolors Sprite color mode (0 for 16 colors, 1 for 256)
animframe Sprite animation frame (0, 1, 2, etc...)

inline void PA_DualSetSpriteColors u8  sprite,
bool  n_colors
[inline]
 

Change the sprite's color mode

Parameters:
sprite Object number in the sprite system
n_colors 0 for 16 colors, 1 for 256

inline void PA_DualSetSpriteDblsize u8  obj,
bool  dblsize
[inline]
 

Enable or disable double size for a given sprite

Parameters:
obj Object number in the sprite system
dblsize 1 to enable doublesize, 0 to disable it...

inline void PA_DualSetSpriteGfx u8  obj,
u16 *  gfx
[inline]
 

Change the gfx used by a sprite

Parameters:
obj Object number in the sprite system
gfx Gfx number ; you can get one by using PA_CreateGfx or PA_GetSpriteGfx(obj_number);

inline void PA_DualSetSpriteHflip u8  obj,
bool  hflip
[inline]
 

Enable or disable horizontal flip for a given sprite

Parameters:
obj Object number in the sprite system
hflip Horizontal flip, 1 to enable, 0 to disable...

inline void PA_DualSetSpriteMode u8  sprite,
u8  obj_mode
[inline]
 

Set the sprite's mode : 0 for normal, 1 for alpha blending, 2 for window

Parameters:
sprite Object number in the sprite system
obj_mode Object mode : 0 for normal, 1 for alpha blending, 2 for window ; not working yet

inline void PA_DualSetSpriteMosaic u8  obj,
bool  mosaic
[inline]
 

Enable or disable mosaic mode for a given sprite

Parameters:
obj Object number in the sprite system
mosaic Set mosaic on (1) or off (0)

inline void PA_DualSetSpritePal u8  obj,
u8  pal
[inline]
 

Set the 16 color palette used by a sprite

Parameters:
obj Object number in the sprite system
pal Palette number (0 - 15)

inline void PA_DualSetSpritePixel u8  sprite,
s16  x,
s16  y,
bool  color
[inline]
 

Set a sprite's pixel to a given palette color. Like PA_SetSpritePixelEx, with less options, but a little slower

Parameters:
sprite Sprite number in the sprite system
x X coordinate of the pixel to change
y Y coordinate of the pixel to change
color New palette color to put

inline void PA_DualSetSpritePixelEx u8  sprite,
u8  hsize,
u8  n_colors,
u8  x,
u8  y,
u8  color
[inline]
 

Set a sprite's pixel to a given palette color

Parameters:
sprite Sprite number in the sprite system
hsize Horizontal size '8, 16, 32...)
n_colors 0 or 1 for 16 or 256 colors...
x X coordinate of the pixel to change
y Y coordinate of the pixel to change
color New palette color to put

inline void PA_DualSetSpritePrio u8  obj,
u8  prio
[inline]
 

Set a sprite's Background priority

Parameters:
obj Object number in the sprite system
prio Sprite priority : 0 is over background 0, 1 over Bg 1, etc... (0-3)

inline void PA_DualSetSpriteRotDisable u8  sprite  )  [inline]
 

Stop rotating and zooming a sprite

Parameters:
sprite Sprite you want to rotate

inline void PA_DualSetSpriteRotEnable u8  sprite,
u8  rotset
[inline]
 

Rotate and zoom a sprite

Parameters:
sprite Sprite you want to rotate
rotset Rotset you want to give to that sprite (0-31). You can apparently use a rotset for multiple sprites if zoomed/rotated identically...

inline void PA_DualSetSpriteVflip u8  obj,
bool  vflip
[inline]
 

Enable or disable vertical flip for a given sprite

Parameters:
obj Object number in the sprite system
vflip Vertical flip, 1 to enable, 0 to disable...

inline void PA_DualSetSpriteX u8  obj,
s16  x
[inline]
 

Set the X position of a sprite on screen

Parameters:
obj Object number in the sprite system
x X position

inline void PA_DualSetSpriteXY u8  sprite,
s16  x,
s16  y
[inline]
 

Set the X and Y position of a sprite on screen

Parameters:
sprite sprite number in the sprite system
x X position
y X position

inline void PA_DualSetSpriteY u8  obj,
s16  y
[inline]
 

Set the Y position of a sprite on screen

Parameters:
obj Object number in the sprite system
y Y position

inline void PA_DualUpdateGfx u16  gfx_number,
void *  obj_data
[inline]
 

Update the Gfx of a given sprite

Parameters:
gfx_number Gfx number in memory
obj_data Gfx to load

inline void PA_DualUpdateSpriteGfx u8  obj_number,
void *  obj_data
[inline]
 

Update the Gfx of a given sprite

Parameters:
obj_number Object number in the sprite system
obj_data Gfx to load

inline void PA_SetScreenSpace s16  ScreenSpace  )  [inline]
 

Set the space between the 2 screens for the Dual Fonctions. 48 pixels by default

Parameters:
ScreenSpace Space in pixels


Generated on Fri Dec 2 13:03:20 2005 for PAlib by  doxygen 1.3.9.1