include/battle/battle_effect_state.h
BATTLE_EFFECT_STATE, the running battle effect's state, and its sprites.
#include "static_assert.h"#include "types.h"#include "battle/battle_effect_params.h"#include "field/particle.h"#include "system.h"
Included by battle_internal.h, battle_effect_internal.h, lucky_dice.c, lucky_wheels.c and battle_effect.h.
Structures
| Name | Description | |
|---|---|---|
struct | BATTLE_BG2_ORIGIN | Two adjacent affine background coordinates, queued together for BG2X/BG2Y. |
struct | BATTLE_EFFECT_STATE | The running battle effect's state: its canvas image, 64 particles, the display registers it stages and its sprites. |
Macros
| Name | Description | |
|---|---|---|
#define | CANVAS_FILL_WORD (level) PIXELS_8BPP(level) | A canvas word holding level in each of its four bytes: a fill for CANVAS_COPY_AND_CLEAR or a step for CANVAS_COPY_AND_DARKEN, one byte per pixel. |
#define | CANVAS_LEVEL_BRIGHTEST 63 | The brightest canvas level: the additive blitters and CANVAS_COPY_AND_BRIGHTEN stop at it. |
Enumerations
| Name | Description | |
|---|---|---|
enum | CANVAS_TRANSFER_MODE { CANVAS_COPY, CANVAS_COPY_AND_CLEAR, CANVAS_COPY_AND_FADE, CA … } | How btEffectTransferCanvas moves the effect's 128x128 canvas into VRAM once a tick (state->transferMode); the canvas pixels are indices into a palette ramp, so scaling them fades a trail. |
enum | CANVAS_FADE_SHARE { CANVAS_FADE_HALF, CANVAS_FADE_THREE_QUARTERS } | CANVAS_COPY_AND_FADE's transferValue: the percentage of each pixel's level kept for the next tick. |
Variables
| Name | Description | |
|---|---|---|
STATIC_ASSERT( | offsetof (BATTLE_EFFECT_STATE, trackedCanvas.origin) | |
extern const Uint32 | BattleEffectMax4Reverse [] | The pixel fragments btEffectBuildBlitter copies into its blitters, from blitter_fragments.c: Forward reads the picture left to right and Reverse right to left. |
extern const Uint32 | BattleEffectMax4Forward [] | Max, four pixels (one canvas word), left to right; a full cell's row takes it twice. |
extern const Uint32 | BattleEffectMaxReverse [] | Max, one pixel, right to left. |
extern const Uint32 | BattleEffectMaxForward [] | Max, one pixel, left to right. |
extern const Uint32 | BattleEffectColorReverse [] | Additive, four pixels added a word at a time, right to left; a full cell's row takes it twice. |
extern const Uint32 | BattleEffectColorForward [] | Additive, four pixels added a word at a time, left to right; a full cell's row takes it twice. |
extern const Uint32 | BattleEffectAdditiveReverse [] | Additive, one pixel, right to left. |
extern const Uint32 | BattleEffectAdditiveForward [] | Additive, one pixel, left to right. |
extern const Uint32 | BattleEffectMask [] | Builds the mask word, 64 in every byte, with which an additive word's pixels are capped at CANVAS_LEVEL_BRIGHTEST. |
extern const Uint32 | BattleEffectTransparent8Reverse [] | Transparent, a full cell's eight pixels, right to left. |
extern const Uint32 | BattleEffectTransparent8Forward [] | Transparent, a full cell's eight pixels, left to right. |
extern const Uint32 | BattleEffectTransparentReverse [] | Transparent, one pixel, right to left. |
extern const Uint32 | BattleEffectTransparentForward [] | Transparent, one pixel, left to right. |
extern const Uint32 | BattleEffectCopyReverse [] | Copy, one pixel, right to left. |
extern const Uint32 | BattleEffectCopyForward [] | Copy, one pixel, left to right. |
Description
BATTLE_EFFECT_STATE, the running battle effect's state, and its sprites.
Macros in detail
CANVAS_FILL_WORD
#define CANVAS_FILL_WORD(level) PIXELS_8BPP(level)
A canvas word holding level in each of its four bytes: a fill for
CANVAS_COPY_AND_CLEAR or a step for CANVAS_COPY_AND_DARKEN, one byte per
pixel.
Referenced by btEffectRunAnnihilation(), btEffectRunBind(), btEffectRunBolt(), btEffectRunCastingImpact(), btEffectRunCondemn(), btEffectRunDragonFire(), btEffectRunDrain(), btEffectRunFlashingStrike(), btEffectRunFlurry(), btEffectRunHaunt(), btEffectRunJudgment(), btEffectRunPlasma(), btEffectRunPrism(), btEffectRunRay(), btEffectRunShatteringOpening(), btEffectRunSparkGroups(), btEffectRunStarfieldFall(), btEffectRunThor(), btEffectRunTitanBlade(), btEffectRunUnusedTriangleStrike(), btEffectRunWhirlwind() and btEffectStartElementStreaks().
Definition at line 60 of file battle_effect_state.h.
CANVAS_LEVEL_BRIGHTEST
#define CANVAS_LEVEL_BRIGHTEST 63
The brightest canvas level: the additive blitters and
CANVAS_COPY_AND_BRIGHTEN stop at it.
Referenced by btEffectRunAnnihilation(), btEffectRunCastingImpact(), btEffectRunCondemn(), btEffectRunDragonFire(), btEffectRunFlashingStrike(), btEffectRunJudgment(), btEffectRunNeptune(), btEffectRunSparkGroups(), btEffectRunThor(), btEffectRunTitanBlade(), btEffectRunTorch() and btEffectUpdatePhasePalette().
Definition at line 64 of file battle_effect_state.h.
Enumerations in detail
CANVAS_TRANSFER_MODE
enum CANVAS_TRANSFER_MODE
How btEffectTransferCanvas moves the effect's 128x128 canvas into VRAM once a
tick (state->transferMode); the canvas pixels are indices into a palette
ramp, so scaling them fades a trail. For the clear, darken and brighten modes
transferValue is a word, a fill or a step repeated in each of its four bytes
(one per pixel, CANVAS_FILL_WORD); the fade mode only compares it with
CANVAS_FADE_HALF.
| Enumerator | Value | Description |
|---|---|---|
CANVAS_COPY | copy as drawn | |
CANVAS_COPY_AND_CLEAR | copy, then fill the canvas with transferValue (0 clears it) | |
CANVAS_COPY_AND_FADE | copy, keeping half of each pixel's level for the next tick when transferValue is CANVAS_FADE_HALF, and three quarters for any other value (CANVAS_FADE_THREE_QUARTERS by convention) | |
CANVAS_COPY_AND_DARKEN | copy, then lower each level by a byte of transferValue, stopping at 0 | |
CANVAS_COPY_AND_BRIGHTEN | copy, then raise each level by a byte of transferValue, stopping at CANVAS_LEVEL_BRIGHTEST; no effect uses it |
Definition at line 32 of file battle_effect_state.h.
CANVAS_FADE_SHARE
enum CANVAS_FADE_SHARE
CANVAS_COPY_AND_FADE's transferValue: the percentage of each pixel's level
kept for the next tick.
| Enumerator | Value | Description |
|---|---|---|
CANVAS_FADE_HALF | 50 | |
CANVAS_FADE_THREE_QUARTERS | 75 |
Definition at line 51 of file battle_effect_state.h.
Variables in detail
offsetof
STATIC_ASSERT(offsetof(BATTLE_EFFECT_STATE, trackedCanvas.origin)
Definition at line 164 of file battle_effect_state.h.