include/battle/battle_camera.h
The battle camera, its view state and the battle background's affine state, and the stack state an action's staging keeps for its battle effect.
#include "edition.h"#include "fixed_math.h"#include "static_assert.h"#include "types.h"#include "battle/battle_action.h"#include "battle/battle_effect_params.h"#include "system/globals.h"
Included by battle_internal.h, battle_effect_internal.h, field_internal.h and lucky_dice.c.
Structures
| Name | Description | |
|---|---|---|
struct | BATTLE_CAMERA | The battle camera: its eye, the focus it turns about, and its pitch, yaw and distance. |
struct | BATTLE_BACKGROUND_STATE | The HEAP_SLOT_BATTLE_BACKGROUND heap slot: the yaw the battle camera eases toward and the ticks left to ease it, and how the battle background is shown. |
struct | BATTLE_STAGING_STATE | A presentation step's stack state: the battle effect command it builds and runs, and the targets' sprite colour modes saved beside it. |
struct | BATTLE_AFFINE | The battle background's affine parameters and reference point, copied whole to the BG2PA registers. |
struct | BATTLE_AFFINE_HDMA | The battle background's scanline state, in HEAP_SLOT_BATTLE_SCANLINES: two pages of per-line BG2CNT values, swapped each tick, and the affine parameters. |
Macros
| Name | Description | |
|---|---|---|
#define | BATTLE_CAMERA_DISTANCE toFIXED(510) | The battle camera's distance from its focus in its default view, and the unzoomed projection's focal length, in 16.16 pixels (btCameraSetView). |
#define | BattleCameraWork (*(BATTLE_CAMERA **)&HeapSlots[HEAP_SLOT_CAMERA]) | The HEAP_SLOT_CAMERA heap slot during a battle: the battle camera. |
#define | BATTLE_BACKGROUND_FADE_RESTORE 128 | btBackgroundSetMode's fade that restores the saved palette instead of taking from each colour channel. |
Enumerations
| Name | Description | |
|---|---|---|
enum | BATTLE_BACKGROUND_MODE { BATTLE_BACKGROUND_NONE, BATTLE_BACKGROUND_FIXED, BATTLE_BACK … } | BATTLE_BACKGROUND_STATE.mode and secondMode: how the battle background is shown. |
Variables
| Name | Description | |
|---|---|---|
STATIC_ASSERT( | offsetof (BATTLE_STAGING_STATE, effect.targets) |
Description
The battle camera, its view state and the battle background's affine state, and the stack state an action's staging keeps for its battle effect.
Macros in detail
BATTLE_CAMERA_DISTANCE
#define BATTLE_CAMERA_DISTANCE toFIXED(510)
The battle camera's distance from its focus in its default view, and the
unzoomed projection's focal length, in 16.16 pixels (btCameraSetView).
Referenced by btCameraSetDefaultView(), btCameraSetView(), btCameraSetViewAtDepth(), btEffectRunThor() and btStagingDispatchAction().
Definition at line 43 of file battle_camera.h.
BattleCameraWork
#define BattleCameraWork (*(BATTLE_CAMERA **)&HeapSlots[HEAP_SLOT_CAMERA])
The HEAP_SLOT_CAMERA heap slot during a battle: the battle camera.
Referenced by btCameraApplyTransform(), btCameraSetDefaultView(), btCameraSetView(), btCameraSetViewAtDepth(), btEffectRunCybele(), btEffectRunDeathPlunge(), btEffectRunDjinnBeams(), btEffectRunDjinnHeal(), btEffectRunDjinniEntrance(), btEffectRunDragonCloud(), btEffectRunElementPillar(), btEffectRunEruption(), btEffectRunHaunt(), btEffectRunHealingMotes(), btEffectRunPlanetDiver(), btEffectRunPlasma(), btEffectRunPrism(), btEffectRunSleep(), btEffectRunStarfieldFall(), btEffectRunStatReduction(), btEffectRunSwirlingStars(), btEffectRunTargetBursts(), btEffectRunTargetMotes(), btEffectRunUnusedOrbitingSpirals(), btEffectRunVolcano(), btObjectUpdateSpritePriorities(), btUnitProjectToScreen(), fdCameraResetViewDefaults() and fdWorldMapUpdateView().
Definition at line 46 of file battle_camera.h.
BATTLE_BACKGROUND_FADE_RESTORE
#define BATTLE_BACKGROUND_FADE_RESTORE 128
btBackgroundSetMode's fade that restores the saved palette instead of taking
from each colour channel.
Referenced by btBackgroundSetMode() and btEffectOpenCanvasLayer().
Definition at line 107 of file battle_camera.h.
Enumerations in detail
BATTLE_BACKGROUND_MODE
enum BATTLE_BACKGROUND_MODE
BATTLE_BACKGROUND_STATE.mode and secondMode: how the battle background is
shown.
| Enumerator | Value | Description |
|---|---|---|
BATTLE_BACKGROUND_NONE | Not loaded yet: the next load adds btBackgroundShowZoomedPage. | |
BATTLE_BACKGROUND_FIXED | The picture at a fixed size on BG1 (BATTLE_BG1CNT), its scroll following the camera, BG2 left to a battle effect. | |
BATTLE_BACKGROUND_ZOOMED | The picture zoomed and panned on BG2, an affine layer; HBlank DMA sets each line's BG2CNT to the half of the picture it reads. The depth is drawn into the picture; the hardware only zooms it. |
Definition at line 92 of file battle_camera.h.
Variables in detail
offsetof
STATIC_ASSERT(offsetof(BATTLE_STAGING_STATE, effect.targets)
Definition at line 88 of file battle_camera.h.