Skip to Content
The Alchemy Project

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.

Included by battle_internal.h, battle_effect_internal.h, field_internal.h and lucky_dice.c.

Structures

NameDescription
structBATTLE_CAMERAThe battle camera: its eye, the focus it turns about, and its pitch, yaw and distance.
structBATTLE_BACKGROUND_STATEThe 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.
structBATTLE_STAGING_STATEA presentation step's stack state: the battle effect command it builds and runs, and the targets' sprite colour modes saved beside it.
structBATTLE_AFFINEThe battle background's affine parameters and reference point, copied whole to the BG2PA registers.
structBATTLE_AFFINE_HDMAThe 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

NameDescription
#defineBATTLE_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).
#defineBattleCameraWork (*(BATTLE_CAMERA **)&HeapSlots[HEAP_SLOT_CAMERA])The HEAP_SLOT_CAMERA heap slot during a battle: the battle camera.
#defineBATTLE_BACKGROUND_FADE_RESTORE 128btBackgroundSetMode's fade that restores the saved palette instead of taking from each colour channel.

Enumerations

NameDescription
enumBATTLE_BACKGROUND_MODE { BATTLE_BACKGROUND_NONE, BATTLE_BACKGROUND_FIXED, BATTLE_BACK … }BATTLE_BACKGROUND_STATE.mode and secondMode: how the battle background is shown.

Variables

NameDescription
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.

EnumeratorValueDescription
BATTLE_BACKGROUND_NONENot loaded yet: the next load adds btBackgroundShowZoomedPage.
BATTLE_BACKGROUND_FIXEDThe picture at a fixed size on BG1 (BATTLE_BG1CNT), its scroll following the camera, BG2 left to a battle effect.
BATTLE_BACKGROUND_ZOOMEDThe 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.