Skip to Content
The Alchemy Project

struct MAP_STATE

The map grid's state (heap slot HEAP_SLOT_MAP_GRID): the point the view follows, the screen shake, the tile animations and blend script, and the view.

Declared in map_grid.h.

Fields

NameDescription
FIXED *originThe followed point, read as x, height and z in 16.16 fixed-point pixels.
Sint32shakeX, shakeY, shakeDecay , shakeY, shakeDecayScreen shake amplitudes
Uint8 *scriptand the factor that scales them each tick; fdMapGridSetScreenShake keeps a component given as negative.
Uint16dispcntDisplay control bits ORed into DISPCNT;
Uint8wideTilesfdScreenTransitionHideBackgrounds clears those of backgrounds 1 to 3.
Uint8groundEffectsThe ground's marks: bits 1..0 footprints, 3..2 the kind of wading (rooms with a second level set 1).
MAP_ANIMATIONanimation [16]
BLEND_SCRIPT_STATEblend
FIXEDview [2]The view's top left, x then z, 16.16 fixed-point pixels.
Sint32minX
Sint32minZ
Sint32maxX
Sint32maxZ
const Sint16 *cameraBoxesThe camera boxes: a -1-ended list of Sint16 rectangles (x0, z0, x1, z1 in pixels) that fdCameraFollowLeaderInBounds keeps the view out of; NULL for none.
Sint8animationActiveSet while a BG1 animation runs; the tileset animations are then neither suspended nor resumed.
Sint8basePriorityThe sprites' base priority; the
Uint8unusedAfterBasePriority [2]scrolling camera draws one above it.
Uint8enabled [3]Each layer's BG priority, written into its BGCNT; zero hides the layer.
Uint8blendControlThe last BLDCNT the blend script
MAP_LAYERlayers [4]wrote; with mode 1 in bits 7..6 its values go to BLDALPHA, else to BLDY.
Uint8unusedAfterLayers [1908]No code names it.
Sint32farPlane
Sint32zoom
Sint32zoomFrom
Sint32zoomTo
Sint16zoomFrame
Sint16zoomStep

Description

The map grid's state (heap slot HEAP_SLOT_MAP_GRID): the point the view follows, the screen shake, the tile animations and blend script, and the view.

struct MAP_STATE

Referenced by btGeyserDraw(), fdActorGetCueMetatileAheadOfCurrent(), fdActorGetSpriteDepth(), fdActorLiftTargetBlock(), fdActorMoveByKeys(), fdActorPlaceBlocks(), fdActorPlaceMovedBlock(), fdActorResetForLeader(), fdActorRestore(), fdActorSetMetatileOpen(), fdActorSetMetatileShape(), fdActorSystemPlaceSprites(), fdActorUpdatePlayerControl(), fdAssignViewFlags(), fdBlankOverlayDrawMarks(), fdBlendScriptRun(), fdBlendScriptStart(), fdCameraFollowActor(), fdCameraFollowLeaderInBounds(), fdCameraFollowWatchedInBounds(), fdCameraMoveWithinMapBounds(), fdCameraWorldToScreen(), fdClimbDown(), fdClimbUp(), fdCycloneCopyTouchedMetatiles(), fdEffectInitSparkles(), fdEffectSpawnRevealMarkers(), fdEffectUpdateSparkles(), fdFlagBlockApplyFlags(), fdFlagBlockPlaceAll(), fdFlagBlockPlaceAllMarkingEdges(), fdGetCollisionAheadOfLeader(), fdGetCollisionUnderLeader(), fdGroundParticlesDraw(), fdGroundParticlesStart(), fdGroundParticlesUpdate(), fdHangingVineDraw(), fdHangingVineHang(), fdMapGridBlocksJump(), fdMapGridCenterOnFollowedPoint(), fdMapGridCheckCollision(), fdMapGridCheckCollisionAbove(), fdMapGridCheckCollisionAt(), fdMapGridCopyDrawnPicturesRect(), fdMapGridCopyMetatileTilesIndicesRect(), fdMapGridGetLayer(), fdMapGridGetMetatileAt(), fdMapGridGetMetatileBehaviorAt(), fdMapGridGetScreenRelativePos(), fdMapGridGetTerrainHeight() and 157 more.

Definition at line 203 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.

shakeX, shakeY, shakeDecay

Sint32 shakeX, shakeY, shakeDecay

Screen shake amplitudes

script

Uint8 *script

and the factor that scales them each tick; fdMapGridSetScreenShake keeps a component given as negative.

dispcnt

Uint16 dispcnt

Display control bits ORed into DISPCNT;

wideTiles

Uint8 wideTiles

fdScreenTransitionHideBackgrounds clears those of backgrounds 1 to 3.

groundEffects

Uint8 groundEffects

The ground's marks: bits 1..0 footprints, 3..2 the kind of wading (rooms with a second level set 1).

animation

MAP_ANIMATION animation[16]

blend

BLEND_SCRIPT_STATE blend

view

FIXED view[2]

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

minX

Sint32 minX

minZ

Sint32 minZ

maxX

Sint32 maxX

maxZ

Sint32 maxZ

cameraBoxes

const Sint16 *cameraBoxes

The camera boxes: a -1-ended list of Sint16 rectangles (x0, z0, x1, z1 in pixels) that fdCameraFollowLeaderInBounds keeps the view out of; NULL for none.

animationActive

Sint8 animationActive

Set while a BG1 animation runs; the tileset animations are then neither suspended nor resumed.

basePriority

Sint8 basePriority

The sprites' base priority; the

unusedAfterBasePriority

Uint8 unusedAfterBasePriority[2]

scrolling camera draws one above it.

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

layers

MAP_LAYER layers[4]

wrote; with mode 1 in bits 7..6 its values go to BLDALPHA, else to BLDY.

unusedAfterLayers

Uint8 unusedAfterLayers[1908]

No code names it.

farPlane

Sint32 farPlane

zoom

Sint32 zoom

zoomFrom

Sint32 zoomFrom

zoomTo

Sint32 zoomTo

zoomFrame

Sint16 zoomFrame

zoomStep

Sint16 zoomStep