Skip to Content
The Alchemy Project

struct MAP_GRID_SCROLL_STATE

The field map's state: the followed position, screen shake, tileset animations, blend script, view and its bounds, and three scrolling layers.

Declared in map_grid.h.

Fields

NameDescription
FIXED *originThe followed point, read as x, height and z in 16.16 fixed-point pixels; fdCameraFollowActor points it at the camera's position.
FIXEDshakeX, shakeY, shakeDecay , shakeY, shakeDecayScreen shake amplitudes in 16.16 fixed-point pixels, and the 16.16 factor that scales them each tick.
Uint8 *markersThe layout's treasure spots, for fdPlaceTreasureSpots.
Uint16flagsREG_DISPCNT bits: sprites and the BG1 to BG3 shown.
Uint8wideTilesNonzero: tileset animations copy 64-byte tiles.
Uint8footprintsNonzero: the leader leaves footprints.
TILESET_ANIManimations [16]
BLEND_SCRIPT_STATEblend
FIXEDview [2]The view's top left, x then y, 16.16 fixed-point pixels.
FIXEDminX, minY, maxX, maxY , minY, maxX, maxY16.16 fixed-point pixels.
Sint8animationActiveSet while a BG1 animation
Uint8unused [3]runs; the tileset animations are then neither suspended nor resumed.
Uint8enabled [3]Each layer's BG priority, written into its BGCNT; zero hides the layer.
Uint8blendControlThe last BLDCNT the blend script set; with mode 1 in bits 7..6 its values go to BLDALPHA, else to BLDY.
MAP_GRID_LAYER_SCROLLlayers [3]BG3, BG2 and BG1, in that order.

Description

The field map's state: the followed position, screen shake, tileset animations, blend script, view and its bounds, and three scrolling layers.

struct MAP_GRID_SCROLL_STATE

Referenced by fdActorGetCueMetatileAheadOfCurrent(), fdActorGetScreenPos(), fdActorResetForLeader(), fdActorRestore(), fdActorSystemPlaceSprites(), fdActorUpdatePlayerControl(), fdApplyEntrance(), fdAssignViewFlags(), fdBlendScriptRun(), fdBlendScriptStart(), fdCameraFollowActor(), fdCameraFollowLeaderInBounds(), fdCameraMoveWithinMapBounds(), fdCameraWorldToScreen(), fdEffectInitSparkles(), fdEffectSpawnRevealMarkers(), fdEffectUpdateSparkles(), fdGetCollisionAheadOfLeader(), fdGroundMaskDrawMarks(), fdMapGridCenterOnFollowedPoint(), fdMapGridCheckCollision(), fdMapGridCopyMetatileIndexRect(), fdMapGridCopyMetatileRect(), fdMapGridCopyMetatileTilesRect(), fdMapGridGetMetatileBehaviorAt(), fdMapGridGetScreenRelativePos(), fdMapGridGetTerrainHeight(), fdMapGridGetTerrainKindAt(), fdMapGridIsWallAt(), fdMapGridLoadMap(), fdMapGridScrollStateView(), fdMapGridSetCameraBounds(), fdMapGridSetCameraCenter(), fdMapGridSetMetatileBehaviorAt(), fdMapGridSetScreenShake(), fdMapGridSetShownLayers(), fdMapGridUpdateLayerScroll(), fdMapGridWaitForShakeToSettle(), fdMapScreenShow(), fdMotesStart(), fdMotesUpdate(), fdPlaceTreasureSpots(), fdPsynergyCheckCloakTile(), fdPsynergyEnd(), fdPsynergyLoadResources(), fdScreenTransitionUpdateScanlineTable(), fdTilesetAnimationPause(), fdTilesetAnimationResume(), fdTilesetAnimationResumeAll(), fdTilesetAnimationStartAll() and 56 more.

Definition at line 201 of file map_grid.h.

Fields in detail

origin

FIXED *origin

The followed point, read as x, height and z in 16.16 fixed-point pixels; fdCameraFollowActor points it at the camera's position.

shakeX, shakeY, shakeDecay

FIXED shakeX, shakeY, shakeDecay

Screen shake amplitudes in 16.16 fixed-point pixels, and the 16.16 factor that scales them each tick.

markers

Uint8 *markers

The layout's treasure spots, for fdPlaceTreasureSpots.

flags

Uint16 flags

REG_DISPCNT bits: sprites and the BG1 to BG3 shown.

wideTiles

Uint8 wideTiles

Nonzero: tileset animations copy 64-byte tiles.

footprints

Uint8 footprints

Nonzero: the leader leaves footprints.

animations

TILESET_ANIM animations[16]

blend

BLEND_SCRIPT_STATE blend

view

FIXED view[2]

The view's top left, x then y, 16.16 fixed-point pixels.

minX, minY, maxX, maxY

FIXED minX, minY, maxX, maxY

16.16 fixed-point pixels.

animationActive

Sint8 animationActive

Set while a BG1 animation

unused

Uint8 unused[3]

runs; the tileset animations are then neither suspended nor resumed.

enabled

Uint8 enabled[3]

Each layer's BG priority, written into its BGCNT; zero hides the layer.

blendControl

Uint8 blendControl

The last BLDCNT the blend script set; with mode 1 in bits 7..6 its values go to BLDALPHA, else to BLDY.

layers

MAP_GRID_LAYER_SCROLL layers[3]

BG3, BG2 and BG1, in that order.