Alchemy

map_scroll.h

games/tbs/include/map_scroll.h on GitHub

Structures

MapLayerScroll

struct MapLayerScroll

One background layer of the field map: its scroll position, origin, parallax against the view, drift and wrap, and its first map cell.

FieldDeclared as
x, ys32 x, y16.16 fixed-point pixels
offsetX, offsetYs32 offsetX, offsetY16.16 fixed-point pixels
scaleX, scaleYs32 scaleX, scaleY16.16 fixed point, 0x10000 moves with the view
speedX, speedYs32 speedX, speedY16.16 fixed-point pixels per frame
phaseX, phaseYs32 phaseX, phaseY16.16 fixed-point pixels
maskX, maskYu16 maskX, maskYa drifting layer's wrap mask, in 8-pixel tiles
cellsstruct MapCell *cellsthe layer's first cell in the map cell buffer

Used by Event_StepOnEastWallSwitch, Event_StepOnWallSwitch, Event_StepOnWestWallSwitch, LemurianShip_SetupScene, LunpaFortress_UpdateHallGuardDetection, LunpaFortress_UpdateOuterGuardDetection, LunpaFortress_UpdatePairedGuardDetection, Map_CopyCellIndexRect, Map_CopyMetatileCellsRect, Map_CopyMetatileIndicesRect, Map_LoadLayeredScene, Map_SetCameraCenter, Map_UpdateLayerScroll, MercuryLighthouseAerie_AlexAppears, MercuryLighthouseAerie_CallLift, MercuryLighthouseAerie_Initialize, MercuryLighthouseAerie_LowerLift, MercuryLighthouseAerie_RaiseLift, TolbiShipDeck_Initialize, TolbiShipDeck_RockDeck, TretTreeBranch_UpdateBg3ScrollSplit, TretTreeInteriors_EnterRoom.

Line 14

MapScrollWork

struct MapScrollWork

The field map's work: the followed position, screen shake, tile animations, blend script, view and its bounds, and three scrolling layers. Heap slot 8.

FieldDeclared as
origins32 *originThe followed point, read as x, height and z in 16.16 fixed-point pixels; Camera_FollowActor points it at the camera's position.
shakeX, shakeY, shakeDecays32 shakeX, shakeY, shakeDecayScreen shake amplitudes in 16.16 fixed-point pixels, and the 16.16 factor that scales them each frame.
scriptu8 *scriptset from the layered scene's header; not read by name
flagsu16 flagsREG_DISPCNT bits: objects and the BG1 to BG3 shown
wideTilesu8 wideTilesnonzero: tile animations copy 64-byte tiles
footprintsu8 footprintsnonzero: the leader leaves footprints
animstruct MapAnimation anim[16]
blendstruct BlendScriptState blend
viewX, viewYs32 viewX, viewYthe view's top left, 16.16 fixed-point pixels
minX, minY, maxX, maxYs32 minX, minY, maxX, maxY16.16 fixed-point pixels
animationActives8 animationActiveSet while a BG1 animation runs; the tile animations are then neither suspended nor resumed.
unk0fdu8 unk0fd[3]not named by TBS code
enabledu8 enabled[3]Each layer's BG priority, written into its BGCNT; zero hides the layer.
unk103u8 unk103MapState's blendControl, the last BLDCNT the blend script set
layersstruct MapLayerScroll layers[3]BG3, BG2 and BG1, in that order

Used by BattleEffect_CleanupSceneObjects, BattleFx_LoadActionEffectResources, Camera_FollowActor, Camera_FollowLeaderInBounds, Camera_MoveWithinMapBounds, Clear_LoadBackground, CrossboneIslePillarRooms_QueryFootprint, CrossboneIslePillarRooms_ReadMapCell, CrossboneIslePillarRooms_SetCellAttributes, DisplayTransition_UpdateScanlineTable, Event_DemonstratePsynergy, Event_DoraWakesIsaac, Event_StepOnEastWallSwitch, Event_StepOnWallSwitch, Event_StepOnWestWallSwitch, Event_WatchThePuppies, FadeOverlay_DrawMarks, FieldEffect_InitSparkles, FieldEffect_UpdateSparkles, FieldFx_StartGroundParticles, FieldFx_UpdateGroundParticles, FieldMotes_Start, FieldMotes_Update, FieldObject_UpdatePlayerControl, Kolima_UpdateCurseDust, LemurianShip_SetupScene, LunpaFortress_UpdateHallGuardDetection, LunpaFortress_UpdateOuterGuardDetection, LunpaFortress_UpdatePairedGuardDetection, MapAnimation_Resume, MapAnimation_Suspend, Map_CenterOnFollowedPoint, Map_CopyCellIndexRect, Map_CopyMetatileCellsRect, Map_CopyMetatileIndicesRect, Map_GetScreenRelativePosition, Map_LoadLayeredScene, Map_SetCameraCenter, Map_SetScreenShake, Map_SetViewBounds and 31 more.

Line 27

BgScroll

struct BgScroll

A background's hardware scroll offsets.

FieldDeclared as
x, yu16 x, ypixels

Used by BattlePres_AdvanceTransitionTimer, Clear_LoadBackground, gBgScroll.

Line 64

Globals, without a comment: gBgScroll.

On this page