include/battle/battle_camera.h
The battle camera, the battle background's modes and scanline state, and the presentation state an action's staging hands its battle effect. More…
#include "battle/battle_action.h"#include "fixed_math.h"#include "types.h"#include "static_assert.h"#include "edition.h"#include "system.h"
Included by battle_internal.h, battle_effect_internal.h, field_world_map.c, lucky_dice.c and super_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_PRESENTATION_STATE | A presentation's effect command, laid out as BATTLE_EFFECT_PARM with a ninth actor, and the animation state it keeps. |
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: two pages of per-line values, swapped each tick, and the affine parameters. |
Macros
| Name | Description | |
|---|---|---|
#define | BATTLE_BACKGROUND_FADE_RESTORE 128 | btBackgroundSetMode's fade that restores the saved palette instead of taking from each colour channel. |
#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). |
Enumerations
| Name | Description | |
|---|---|---|
enum | BATTLE_BACKGROUND_MODE { BATTLE_BACKGROUND_NONE, BATTLE_BACKGROUND_FIXED, BATTLE_BACK … } | BATTLE_BACKGROUND_STATE.mode, how the battle background is shown, and its bg1ScrollMode. |
Functions
| Name | Description | |
|---|---|---|
UNREAD_RESULT | btStagingRunMessages (struct BATTLE_PLAN *plan, Sint32 unused) | Plays an action with no battle effect (STAGING_MESSAGES): each target's outcome is applied and its messages shown in turn. |
void | btStagingBuildTargetList (struct BATTLE_PLAN *plan, BATTLE_PRESENTATION_STATE *state) | Fills a battle effect command from an action run: its kind and strength, the user and the targets still standing, or all of them for an effect that revives. |
void | btCameraSetRange (FIXED cx, FIXED cy, Sint32 ox, Sint32 oy, FIXED scale) | Builds the zoomed background's next page for a zoom of scale about centerX and centerY, shifted by offsetX and offsetY, and shows it: below a zoom of 1 the plane lies flat, from 1 it wraps and turns with the camera. |
Sint32 | btObjectIsValidId (Uint32 objectId) | Returns 0 for a party member's or an enemy's unit id, -1 for any other. |
void | btHighlightSetSpriteMode (Sint32 actor, Sint32 mode) | Sets the sprite mode of a unit's picture and its shadow. |
void | btEffectRunSummonStub (Sint32 *context) | Runs one of the large battle effects, the summons and the scenes of a few abilities. |
void | btEffectTransferCanvas (void) | Copies the canvas to VRAM when a transfer is pending. |
void | btEffectArmBg2AffineHBlankDMA (void) | Restarts DMA channel 0 as an H-blank transfer of the effect state's line table into BG2X, one word a line. |
void | btEffectDarkenBackgroundStep (void) | Steps the background palette fade. |
Description
The battle camera, the battle background's modes and scanline state, and the presentation state an action's staging hands its battle effect. The Broken Seal's presentation state holds eight targets; this one nine.
Macros in detail
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 99 of file battle_camera.h.
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 145 of file battle_camera.h.
Enumerations in detail
BATTLE_BACKGROUND_MODE
enum BATTLE_BACKGROUND_MODE
BATTLE_BACKGROUND_STATE.mode, how the battle background is shown, and its
bg1ScrollMode.
| Enumerator | Value | Description |
|---|---|---|
BATTLE_BACKGROUND_NONE | Not loaded yet. | |
BATTLE_BACKGROUND_FIXED | The picture at a fixed size on BG1, 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. |
Definition at line 86 of file battle_camera.h.
Functions in detail
btEffectRunSummonStub
void btEffectRunSummonStub(Sint32 *context)
Runs one of the large battle effects, the summons and the scenes of a few abilities.
Referenced by btAutoBattleRunPsynergy() and btStagingRunFullScreen().
Definition at line 135 of file battle_camera.h.