Skip to Content
The Alchemy Project

struct WORLD_MAP_VIEW

The world map's perspective view, in the map's heap slot: the followed position, screen shake, view position, window, pitch and yaw, a 32 by 32 grid of tile ids and zoom, then the still image's state and the region tint.

Declared in perspective.h.

Fields

NameDescription
Sint32 *originThe followed point, as in MAP_STATE.
Sint32shakeX, shakeY, shakeDecay , shakeY, shakeDecayThe screen shake, as in MAP_STATE.
Uint8 *scriptNULL at load.
Uint16shownLayersMAP_STATE's flags: REG_DISPCNT bits, BG0 to BG3 and the sprites at load.
Uint8wideTilesMAP_STATE's wideTiles, 0x80 at load.
Uint8animationsAndBlend [205]As MAP_STATE: footprints, tileset animations and blend script.
FIXEDview [2]The view's top left, x then y, 16.16 fixed-point pixels.
FIXEDscaleX32 in 16.16 at load.
FIXEDscaleY64 in 16.16 at load.
FIXEDlimitX16352 in 16.16 at load.
FIXEDlimitY16352 in 16.16 at load.
Uint8unusedAfterLimitY [4]No code names it.
Sint8animationActiveSet by
Uint8unused [3]fdWorldMapStartStillImage while BG1 shows the drawn map; the tileset animations are then neither suspended nor resumed.
Uint16windowTopScreen rows, 0 and 159 at load
Uint16windowBottomand 200 and 255 from fdWorldMapStartStillImage; each tick copies them to shownTop and shownBottom and picks BG mode 2 or 0 from them.
Uint16shownTopwindowTop as the tick update last applied it.
Uint16shownBottomwindowBottom as the tick update last applied it.
Uint16windowPendingCleared by the tick update; not
Uint8unusedAfterWindow [6]set by name.
void *tilesThe world map's tile offsets
Uint8unusedAfterTiles [4](ResourceIdPerspectiveDataA), each tile LZ-compressed.
Uint16pitch1/65536 turns.
Uint16yaw1/65536 turns.
const Uint32 *resourcesA row of
Uint8unusedAfterResources [36]WorldMapGraphicsResources, by the region the party is in.
Uint16tileIds [32 * 32]The world map tile in each of 32 by 32 metatiles.
Uint16quarterTiles [8]The tile each quarter of each layer's block buffer shows, so an unchanged quarter is not decoded again.
Sint32reloadStepsSteps left of reloading the area's graphics after the region changed, one a tick from 12 (fdWorldMapPreloadCurrentTileBlock).
Sint32farPlane510 pixels at load.
Sint32distancefarPlane scaled by the zoom.
Sint32prevZoomThe zoom a transition starts from.
FIXEDzoom16.16 fixed point, toFIXED(1) full size.
Uint16zoomTransitionFrameA zoom transition's length; 0 when none.
Sint16zoomTransitionStepTicks of the transition done.
Sint8tileBufUsedSet when a field Psynergy cast on the World Map has used the second half of the BG tile buffer; the still image then decodes it again.
Sint8stillImageShownSet while BG1 shows the still image: the view then only shakes BG1.
Sint8viewHeldSet while the view is held for the still image or the map screen: no tile is preloaded, and without a shake the tick does nothing.
Sint8tintRegionThe encounter region the tint was chosen for.
Sint8tintBrightness steps, darker when negative.
Sint8tintTargetThe tint the region asks for.
Sint8fixedEyeSet: the tick update leaves the eye where it is.

Description

The world map's perspective view, in the map's heap slot: the followed position, screen shake, view position, window, pitch and yaw, a 32 by 32 grid of tile ids and zoom, then the still image's state and the region tint.

struct WORLD_MAP_VIEW

Referenced by fdActorFlyOnWorldMap(), fdActorMoveAsSandOnWorldMap(), fdActorMoveOnWorldMap(), fdActorSailOnWorldMap(), fdMapScreenShow(), fdPsynergyMarkWorldMapTilesUsed(), fdWorldMapApplyAffinePage(), fdWorldMapInitPerspective(), fdWorldMapLoadAreaGraphics(), fdWorldMapLoadDefaultMetatilesAndUpdateBlock(), fdWorldMapLoadGraphics(), fdWorldMapPreloadCurrentTileBlock(), fdWorldMapSetWindowMetatileTile(), fdWorldMapSetWindowMetatileTileAndDraw(), fdWorldMapStartStillImage(), fdWorldMapStepZoom(), fdWorldMapUpdateCurrentTileBlock(), fdWorldMapUpdateRegionTint(), fdWorldMapUpdateView(), fdWorldMapWriteLayerMetatileTile(), scStaffCreditShowBeacon(), scTileSpriteReset(), scWorldMapDriftNorthOfContinent(), scWorldMapSetIslandTile() and scWorldMapSetPlacedActorTile().

Definition at line 13 of file perspective.h.

Fields in detail

origin

Sint32 *origin

The followed point, as in MAP_STATE.

shakeX, shakeY, shakeDecay

Sint32 shakeX, shakeY, shakeDecay

The screen shake, as in MAP_STATE.

script

Uint8 *script

NULL at load.

shownLayers

Uint16 shownLayers

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

wideTiles

Uint8 wideTiles

MAP_STATE's wideTiles, 0x80 at load.

animationsAndBlend

Uint8 animationsAndBlend[205]

As MAP_STATE: 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

32 in 16.16 at load.

scaleY

FIXED scaleY

64 in 16.16 at load.

limitX

FIXED limitX

16352 in 16.16 at load.

limitY

FIXED limitY

16352 in 16.16 at load.

unusedAfterLimitY

Uint8 unusedAfterLimitY[4]

No code names it.

animationActive

Sint8 animationActive

Set by

unused

Uint8 unused[3]

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

windowTop

Uint16 windowTop

Screen rows, 0 and 159 at load

windowBottom

Uint16 windowBottom

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

shownTop

Uint16 shownTop

windowTop as the tick update last applied it.

shownBottom

Uint16 shownBottom

windowBottom as the tick update last applied it.

windowPending

Uint16 windowPending

Cleared by the tick update; not

unusedAfterWindow

Uint8 unusedAfterWindow[6]

set by name.

tiles

void *tiles

The world map's tile offsets

unusedAfterTiles

Uint8 unusedAfterTiles[4]

(ResourceIdPerspectiveDataA), each tile LZ-compressed.

pitch

Uint16 pitch

1/65536 turns.

yaw

Uint16 yaw

1/65536 turns.

resources

const Uint32 *resources

A row of

unusedAfterResources

Uint8 unusedAfterResources[36]

WorldMapGraphicsResources, by the region the party is in.

tileIds

Uint16 tileIds[32 * 32]

The world map tile in each of 32 by 32 metatiles.

quarterTiles

Uint16 quarterTiles[8]

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

reloadSteps

Sint32 reloadSteps

Steps left of reloading the area's graphics after the region changed, one a tick from 12 (fdWorldMapPreloadCurrentTileBlock).

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.

zoomTransitionFrame

Uint16 zoomTransitionFrame

A zoom transition's length; 0 when none.

zoomTransitionStep

Sint16 zoomTransitionStep

Ticks of the transition done.

tileBufUsed

Sint8 tileBufUsed

Set when a field Psynergy cast on the World Map has used the second half of the BG tile buffer; the still image then decodes it again.

stillImageShown

Sint8 stillImageShown

Set while BG1 shows the still image: the view then only shakes BG1.

viewHeld

Sint8 viewHeld

Set while the view is held for the still image or the map screen: no tile is preloaded, and without a shake the tick does nothing.

tintRegion

Sint8 tintRegion

The encounter region the tint was chosen for.

tint

Sint8 tint

Brightness steps, darker when negative.

tintTarget

Sint8 tintTarget

The tint the region asks for.

fixedEye

Sint8 fixedEye

Set: the tick update leaves the eye where it is.