include/field/canvas_sprite.h
The canvas sprite of a field Psynergy: a 64 by 64 sprite whose pixels an effect draws into a 4 KB canvas. More…
Included by field_psynergy_internal.h.
Structures
| Name | Description | |
|---|---|---|
struct | CANVAS_SPR_STATE | A field Psynergy's canvas sprite: its effect sprite, the tick it is on and how long it has drawn, and where, how large, at what angle and depth it is drawn. |
Macros
| Name | Description | |
|---|---|---|
#define | CANVAS_WIDTH 64 | The canvas: 64x64 pixels of 8 bits, in 8x8 tiles. |
#define | CANVAS_SPRITE_BYTES 4096 | |
#define | CANVAS_SPRITE_16_COLORS 1 | How the sprite is drawn. |
#define | CANVAS_SPRITE_256_COLORS 2 | rebuilt each tick, in 256 colours |
#define | CANVAS_SPRITE_KEPT 3 | drawn as the effect left it |
#define | CANVAS_PALETTE 14 | The OBJ palette a 16-colour canvas is drawn in. |
#define | CANVAS_UPLOAD_AND_CLEAR 1 | What fdBattleEffectUploadCanvas does with the canvas in the next tick. |
#define | CANVAS_UPLOAD 2 | |
#define | CANVAS_UPLOAD_AND_DARKEN_ONE_LEVEL 3 | |
#define | CANVAS_UPLOAD_AND_DARKEN_TWO_LEVELS 4 | |
#define | CANVAS_UPLOAD_AND_DARKEN_FOUR_LEVELS 5 | |
#define | CANVAS_UPLOAD_TO_BG 11 |
Functions
| Name | Description | |
|---|---|---|
void | fdBattleEffectUploadCanvas (void) | The canvas's tick callback: counts the tick and carries out the command the effect left for it, copying the canvas into the sprite's tiles (or to the start of BG VRAM), and clearing or fading it after the copy. |
void | fdBattleEffectDrawCanvasSprite (void) | The canvas sprite's tick callback: places the sprite at the state's position (whole pixels), scale and angle, and draws it. |
void | fdBattleEffectStartCanvasSprite (void) | Starts the canvas sprite of the field Psynergy scenes: its state, a cleared 64x64 canvas copied into the sprite's tiles, and a map from each canvas pixel (row by row) to its place in the tiles. |
void | fdBattleEffectEndCanvasSprite (void) | Ends the canvas sprite: stops its draw and upload callbacks, waits a tick and frees its sprite state, canvas and pixel map. |
Description
The canvas sprite of a field Psynergy: a 64 by 64 sprite whose pixels an
effect draws into a 4 KB canvas. fdBattleEffectStartCanvasSprite starts it,
fdBattleEffectDrawCanvasSprite draws the sprite each tick,
fdBattleEffectUploadCanvas copies the canvas into its tiles on command, and
fdBattleEffectEndCanvasSprite ends it.
Macros in detail
CANVAS_WIDTH
#define CANVAS_WIDTH 64
The canvas: 64x64 pixels of 8 bits, in 8x8 tiles.
Referenced by fdBattleEffectStartCanvasSprite() and fdCyclonePlotArc().
Definition at line 15 of file canvas_sprite.h.
CANVAS_SPRITE_BYTES
#define CANVAS_SPRITE_BYTES 4096
Referenced by fdBattleEffectPlotCanvasPixel(), fdBattleEffectStartCanvasSprite() and fdBattleEffectUploadCanvas().
Definition at line 16 of file canvas_sprite.h.
CANVAS_SPRITE_16_COLORS
#define CANVAS_SPRITE_16_COLORS 1
How the sprite is drawn.
rebuilt each tick, in OBJ palette 14
Referenced by fdBattleEffectDrawCanvasSprite() and fdBattleEffectStartCanvasSprite().
Definition at line 19 of file canvas_sprite.h.
CANVAS_SPRITE_256_COLORS
#define CANVAS_SPRITE_256_COLORS 2
rebuilt each tick, in 256 colours
Referenced by fdBattleEffectDrawCanvasSprite(), fdPsynergyArrow(), fdPsynergyBurst() and fdPsynergyPound().
Definition at line 20 of file canvas_sprite.h.
CANVAS_SPRITE_KEPT
#define CANVAS_SPRITE_KEPT 3
drawn as the effect left it
Referenced by fdBattleEffectDrawCanvasSprite() and fdPsynergyCyclone().
Definition at line 21 of file canvas_sprite.h.
CANVAS_PALETTE
#define CANVAS_PALETTE 14
The OBJ palette a 16-colour canvas is drawn in. The effects that draw in 256 colours keep their own colours in it and the next, colours 224 to 255.
Referenced by fdBattleEffectDrawCanvasSprite(), fdCyclonePlotArc(), fdPsynergyArrow(), fdPsynergyCyclone(), fdPsynergyUpdateBurst() and fdPsynergyUpdatePound().
Definition at line 25 of file canvas_sprite.h.
CANVAS_UPLOAD_AND_CLEAR
#define CANVAS_UPLOAD_AND_CLEAR 1
What fdBattleEffectUploadCanvas does with the canvas in the next tick.
Referenced by fdBattleEffectUploadCanvas().
Definition at line 28 of file canvas_sprite.h.
CANVAS_UPLOAD
#define CANVAS_UPLOAD 2
Referenced by fdBattleEffectUploadCanvas(), fdPsynergyBurst() and fdPsynergyPound().
Definition at line 29 of file canvas_sprite.h.
CANVAS_UPLOAD_AND_DARKEN_ONE_LEVEL
#define CANVAS_UPLOAD_AND_DARKEN_ONE_LEVEL 3
Referenced by fdBattleEffectUploadCanvas(), fdPsynergyCyclone() and fdPsynergyUpdatePound().
Definition at line 30 of file canvas_sprite.h.
CANVAS_UPLOAD_AND_DARKEN_TWO_LEVELS
#define CANVAS_UPLOAD_AND_DARKEN_TWO_LEVELS 4
Referenced by fdBattleEffectUploadCanvas().
Definition at line 31 of file canvas_sprite.h.
CANVAS_UPLOAD_AND_DARKEN_FOUR_LEVELS
#define CANVAS_UPLOAD_AND_DARKEN_FOUR_LEVELS 5
Referenced by fdBattleEffectUploadCanvas(), fdPsynergyUpdateArrow() and fdPsynergyUpdateBurst().
Definition at line 32 of file canvas_sprite.h.
CANVAS_UPLOAD_TO_BG
#define CANVAS_UPLOAD_TO_BG 11
Referenced by fdBattleEffectUploadCanvas() and fdPsynergyRing().
Definition at line 33 of file canvas_sprite.h.