The casting impact scene and its image helpers. More...
Go to the source code of this file.
Macros | |
| #define | CASTING_IMPACT_ORB_CELLS 0x5100 |
| The impact orb, 20x48 pictures packed at half width. | |
| #define | CASTING_IMPACT_DJINNI_CELLS 0x3c56 |
| The Djinni pictures, 20x40, in Ram_MapCellBuffer after the impact's own. | |
| #define | CASTING_IMPACT_GATHER_FRAMES 32 |
| frames the sparks gather | |
| #define | CASTING_IMPACT_SPARKS 64 |
| sparks in work->particles | |
| #define | CASTING_IMPACT_IMPACT_PARTICLES ((struct EffectStep *)(Ram_MapCellBuffer + 0x4000)) |
| The impact pictures' particles, in Ram_MapCellBuffer after the Djinni. | |
| #define | CASTING_IMPACT_IMPACT_PARTICLE_COUNT 64 |
| #define | CASTING_IMPACT_IMAGE_X(side, image) |
| gCastingImpact_ImageX has seven pictures for each side. | |
Functions | |
| void | BattleFx_StepPaletteToResource (s32 resourceId) |
| Moves each RGB555 channel of background colours 0 to 63 one level towards the resource palette. | |
| static void | CastingImpact_LoadResource (const void *id, void *dest, s32 skip, s32 copy) |
| Loads one of the impact's pictures (Resource_LoadAndDecompress). | |
| static void | CastingImpact_PackRows (void *src, void *dest, s32 width, s32 height) |
| Packs a casting impact's picture rows (Graphics_PackTileRows). | |
| static void | CastingImpact_DrawImage (void *canvas, const void *pixels, s32 x, s32 y, s32 width, s32 height, DrawRectangle *draw) |
| Draws one casting impact image with the given blitter. | |
| static void | CastingImpact_DrawTallImage (void *canvas, const void *pixels, s32 x, s32 y, s32 width, DrawRectangle *draw) |
| Draws a casting-impact image whose height is twice its width. | |
| static void | CastingImpact_DrawScrolledImage (void *canvas, const void *pixels, s32 x, s32 y, s32 width, s32 height, s32 scroll, DrawRectangle *draw) |
| Draws only the unscrolled height of a casting-impact image. | |
| static void | CastingImpact_DrawCroppedImage (void *canvas, const void *pixels, s32 x, s32 y, s32 width, DrawRectangle *draw) |
| Draws a casting-impact image cropped to 91 pixels high. | |
| static void | CastingImpact_EndPrelude (struct BattleEffectWork *work, void *canvas) |
| Clears the prelude image, stops its callbacks and releases its blitters before the next effect takes over. | |
| void | BattleFx_RunCastingImpact (struct BattleEffectArgument *effect, s32 mode) |
| Gathers sparks around the caster, launches the Djinni and draws the impact on the first target. | |
The casting impact scene and its image helpers.
Part of effect.c, the battle effect object, compiled only through it.
Definition in file casting_impact.c.
| #define CASTING_IMPACT_ORB_CELLS 0x5100 |
The impact orb, 20x48 pictures packed at half width.
Definition at line 174 of file casting_impact.c.
Referenced by BattleFx_RunCastingImpact().
| #define CASTING_IMPACT_DJINNI_CELLS 0x3c56 |
The Djinni pictures, 20x40, in Ram_MapCellBuffer after the impact's own.
Definition at line 176 of file casting_impact.c.
Referenced by BattleFx_RunCastingImpact().
| #define CASTING_IMPACT_GATHER_FRAMES 32 |
frames the sparks gather
Definition at line 177 of file casting_impact.c.
Referenced by BattleFx_RunCastingImpact().
| #define CASTING_IMPACT_SPARKS 64 |
sparks in work->particles
Definition at line 178 of file casting_impact.c.
Referenced by BattleFx_RunCastingImpact().
| #define CASTING_IMPACT_IMPACT_PARTICLES ((struct EffectStep *)(Ram_MapCellBuffer + 0x4000)) |
The impact pictures' particles, in Ram_MapCellBuffer after the Djinni.
Definition at line 180 of file casting_impact.c.
Referenced by BattleFx_RunCastingImpact().
| #define CASTING_IMPACT_IMPACT_PARTICLE_COUNT 64 |
Definition at line 182 of file casting_impact.c.
Referenced by BattleFx_RunCastingImpact().
| #define CASTING_IMPACT_IMAGE_X | ( | side, | |
| image ) |
gCastingImpact_ImageX has seven pictures for each side.
Definition at line 185 of file casting_impact.c.
Referenced by BattleFx_RunCastingImpact().
| enum CastingImpact |
The casting impacts, by kind - 100: each is named for the first ability whose gBattle_ActionFlags entry selects it; the four no ability selects keep their numbers.
The trailing comments give each impact's own animation, drawn over the target after the orb and sparks. Most animations use the 64 particles at Ram_MapCellBuffer + 0x4000, which start at the target; their pictures are in Ram_MapCellBuffer. "Smoke" is puffs of smoke rising from the target; "hands off" impacts stop after gathering and hand the canvas to another effect.
Definition at line 132 of file casting_impact.c.
| void BattleFx_StepPaletteToResource | ( | s32 | resourceId | ) |
Moves each RGB555 channel of background colours 0 to 63 one level towards the resource palette.
Colour 0 always goes towards black, whatever the resource holds.
Called once a frame, so a palette arrives in at most 31 frames: by the casting impacts, Ragnarok, the Titan Blade and Ground (hail.c). Reads and rewrites background palette RAM.
Definition at line 17 of file casting_impact.c.
Referenced by BattleFx_RunCastingImpact(), BattleFx_RunGround(), BattleFx_RunRagnarok(), BattleFx_RunTitanBlade(), and BattleFx_StepPaletteToResource().
Loads one of the impact's pictures (Resource_LoadAndDecompress).
Definition at line 50 of file casting_impact.c.
Referenced by BattleFx_RunCastingImpact(), and CastingImpact_LoadResource().
Packs a casting impact's picture rows (Graphics_PackTileRows).
Definition at line 59 of file casting_impact.c.
Referenced by BattleFx_RunCastingImpact(), and CastingImpact_PackRows().
|
inlinestatic |
Draws one casting impact image with the given blitter.
Definition at line 67 of file casting_impact.c.
Referenced by BattleFx_RunCastingImpact(), and CastingImpact_DrawImage().
|
inlinestatic |
Draws a casting-impact image whose height is twice its width.
Definition at line 76 of file casting_impact.c.
Referenced by BattleFx_RunCastingImpact(), and CastingImpact_DrawTallImage().
|
inlinestatic |
Draws only the unscrolled height of a casting-impact image.
Definition at line 85 of file casting_impact.c.
Referenced by BattleFx_RunCastingImpact(), and CastingImpact_DrawScrolledImage().
|
inlinestatic |
Draws a casting-impact image cropped to 91 pixels high.
Definition at line 96 of file casting_impact.c.
Referenced by BattleFx_RunCastingImpact(), and CastingImpact_DrawCroppedImage().
|
inlinestatic |
Clears the prelude image, stops its callbacks and releases its blitters before the next effect takes over.
Called by BattleFx_RunCastingImpact for the impacts that hand off after the gathering (15, 17, 24, 26 and Severe Blow); Meltdown's end does the same inline. Clears the canvas and its VRAM (character block 1) and work->effect->prelude, removes Palette_StepFadeTransfer and the canvas transfer, and frees both blitters.
Definition at line 113 of file casting_impact.c.
Referenced by BattleFx_RunCastingImpact(), and CastingImpact_EndPrelude().
| void BattleFx_RunCastingImpact | ( | struct BattleEffectArgument * | effect, |
| s32 | mode ) |
Gathers sparks around the caster, launches the Djinni and draws the impact on the first target.
Called only by BattleFx_DispatchByIdRange (positions.c), for effect kinds 100 to 135. The phases, the hand-offs and the particle ranges are in the folder README under "Effect families". Opens the canvas layer (tiled for Terra Strike, Mortal Danger and Asura), writes the background palette, BG2's scale and reference and REG_BLDALPHA, holds the caster still while the sparks gather, and adds BattleFx_ArmBg2AffineHBlankDma for the waving impacts; it releases all of them before it returns, or hands them on.
mode: the impact, an enum CastingImpact (the kind less 100). The tests on mode 100 never hold, as the dispatcher passes 0 to 35.
Definition at line 201 of file casting_impact.c.
Referenced by BattleFx_DispatchByIdRange(), and BattleFx_RunCastingImpact().