Skip to Content
The Alchemy Project

struct WORLD_MAP_VIEW

The world map's perspective view: the followed position, screen shake, view position, window, pitch and yaw, tile ids and zoom, in HEAP_SLOT_MAP_GRID where a map keeps its MAP_GRID_SCROLL_STATE.

Declared in perspective.h.

Fields

NameDescription
Sint32 *originThe followed point, as in MAP_GRID_SCROLL_STATE.
Sint32shakeX, shakeY, shakeDecay , shakeY, shakeDecayThe screen shake, as in MAP_GRID_SCROLL_STATE.
Uint8 *scriptMAP_GRID_SCROLL_STATE's treasure spots (markers); NULL at load.
Uint16shownLayersMAP_GRID_SCROLL_STATE's flags: REG_DISPCNT bits, BG0 to BG3 and the sprites at load.
Uint8wideTilesMAP_GRID_SCROLL_STATE's wideTiles, 0x80 at load.
Uint8animationsAndBlend [228 - 23]As MAP_GRID_SCROLL_STATE from byte 23 up to view at 228: footprints, tileset animations and blend script.
FIXEDview [2]The view's top left, x then y, 16.16 fixed-point pixels.
FIXEDscaleXThe view's bounds, as MAP_GRID_SCROLL_STATE's minX, minY, maxX and maxY, in 16.16 fixed-point pixels: 32, 64, 8160 and 8160 at load, and not read by these names.
FIXEDscaleY
FIXEDlimitX
FIXEDlimitY
Sint8stillImageShownSet by fdWorldMapStartStillImage while BG1
Uint8unused [3]shows the drawn map; the tileset animations are then neither suspended nor resumed.
Uint16windowTopScreen rows, 0 and 159 at load and 200 and
Uint16windowBottom255 from fdWorldMapStartStillImage; each VBlank copies them to shownTop and shownBottom and picks BG mode 2 or 0 from them.
Uint16shownTopwindowTop as the VBlank last applied it.
Uint16shownBottomwindowBottom as the VBlank last applied it.
Uint16windowPendingCleared each VBlank; not set by name.
Uint8unusedAfterWindow [6]
void *tilesThe world map's tile offsets
Uint8unusedAfterTiles [4](ResourceIdWorldMapPerspectiveTiles), each tile LZ-compressed.
Uint16pitch1/65536 turns.
Uint16yaw1/65536 turns.
Uint32 *resourcesA row of WorldMapGraphicsResources, by
Uint8unusedAfterResources [24]terrain.
Uint16tileIds [256]The world map tile in each of 16 by 16 grid cells.
Uint16quarterTiles [8]The tile each quarter of each layer's block buffer shows, so an unchanged quarter is not decoded again.
Sint32farPlane510 pixels at load.
Sint32distancefarPlane scaled by the zoom.
Sint32prevZoomThe zoom a transition starts from.
FIXEDzoom16.16 fixed point, toFIXED(1) full size.
Sint16zoomTransitionTicksA zoom transition's length in ticks; 0 when none.
Sint16zoomTransitionStepTicks of the transition done.

Description

The world map's perspective view: the followed position, screen shake, view position, window, pitch and yaw, tile ids and zoom, in HEAP_SLOT_MAP_GRID where a map keeps its MAP_GRID_SCROLL_STATE.

struct WORLD_MAP_VIEW

Referenced by fdActorMoveOnWorldMap(), fdScriptWaitForZoomTransition(), fdWorldMapApplyAffinePage(), fdWorldMapInitPerspective(), fdWorldMapLoadAreaGraphics(), fdWorldMapLoadDefaultMetatilesAndUpdateBlock(), fdWorldMapLoadGraphics(), fdWorldMapPreloadCurrentTileBlock(), fdWorldMapSetGridTile(), fdWorldMapStartStillImage(), fdWorldMapStartZoom(), fdWorldMapStepZoom(), fdWorldMapUpdateCurrentTileBlock(), fdWorldMapUpdateView(), fdWorldMapWriteLayerMetatileTile(), scWorldMapAlignToMap() and scWorldMapSetUpIodem().

Definition at line 13 of file perspective.h.

Fields in detail

origin

Sint32 *origin

The followed point, as in MAP_GRID_SCROLL_STATE.

shakeX, shakeY, shakeDecay

Sint32 shakeX, shakeY, shakeDecay

The screen shake, as in MAP_GRID_SCROLL_STATE.

script

Uint8 *script

MAP_GRID_SCROLL_STATE's treasure spots (markers); NULL at load.

shownLayers

Uint16 shownLayers

MAP_GRID_SCROLL_STATE's flags: REG_DISPCNT bits, BG0 to BG3 and the sprites at load.

wideTiles

Uint8 wideTiles

MAP_GRID_SCROLL_STATE's wideTiles, 0x80 at load.

animationsAndBlend

Uint8 animationsAndBlend[228 - 23]

As MAP_GRID_SCROLL_STATE from byte 23 up to view at 228: footprints, tileset animations and blend script.

view

FIXED view[2]

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

scaleX

FIXED scaleX

The view's bounds, as MAP_GRID_SCROLL_STATE's minX, minY, maxX and maxY, in 16.16 fixed-point pixels: 32, 64, 8160 and 8160 at load, and not read by these names.

scaleY

FIXED scaleY

limitX

FIXED limitX

limitY

FIXED limitY

stillImageShown

Sint8 stillImageShown

Set by fdWorldMapStartStillImage while BG1

unused

Uint8 unused[3]

shows the drawn map; the tileset animations are then neither suspended nor resumed.

windowTop

Uint16 windowTop

Screen rows, 0 and 159 at load and 200 and

windowBottom

Uint16 windowBottom

255 from fdWorldMapStartStillImage; each VBlank copies them to shownTop and shownBottom and picks BG mode 2 or 0 from them.

shownTop

Uint16 shownTop

windowTop as the VBlank last applied it.

shownBottom

Uint16 shownBottom

windowBottom as the VBlank last applied it.

windowPending

Uint16 windowPending

Cleared each VBlank; not set by name.

unusedAfterWindow

Uint8 unusedAfterWindow[6]

tiles

void *tiles

The world map's tile offsets

unusedAfterTiles

Uint8 unusedAfterTiles[4]

(ResourceIdWorldMapPerspectiveTiles), each tile LZ-compressed.

pitch

Uint16 pitch

1/65536 turns.

yaw

Uint16 yaw

1/65536 turns.

resources

Uint32 *resources

A row of WorldMapGraphicsResources, by

unusedAfterResources

Uint8 unusedAfterResources[24]

terrain.

tileIds

Uint16 tileIds[256]

The world map tile in each of 16 by 16 grid cells.

quarterTiles

Uint16 quarterTiles[8]

The tile each quarter of each layer's block buffer shows, so an unchanged quarter is not decoded again.

farPlane

Sint32 farPlane

510 pixels at load.

distance

Sint32 distance

farPlane scaled by the zoom.

prevZoom

Sint32 prevZoom

The zoom a transition starts from.

zoom

FIXED zoom

16.16 fixed point, toFIXED(1) full size.

zoomTransitionTicks

Sint16 zoomTransitionTicks

A zoom transition's length in ticks; 0 when none.

zoomTransitionStep

Sint16 zoomTransitionStep

Ticks of the transition done.