Alchemy
Loading...
Searching...
No Matches

PerspectiveWork Struct Reference

The world map's perspective view: the followed position, screen shake, view position, window, pitch and yaw, tile ids and zoom. More...

#include <field/perspective.h>

Data Fields

s32 * origin
 the followed point, as in MapScrollWork
s32 shakeX
s32 shakeY
s32 shakeDecay
 the screen shake, as in MapScrollWork
u8 * script
 NULL at load.
u16 fade
 MapScrollWork's flags: REG_DISPCNT bits, 0x1f00 at load.
u8 fadeStep
 MapScrollWork's wideTiles, 0x80 at load.
u8 unk017 [0xe4 - 0x17]
 as MapScrollWork: tile animations, blend script
s32 viewX
 16.16 fixed-point pixels
s32 viewY
 16.16 fixed-point pixels
s32 scaleX
 0x200000 at load
s32 scaleY
 0x400000 at load
s32 limitX
 0x1fe00000 at load
s32 limitY
 0x1fe00000 at load
s8 animationActive
 Set by WorldMap_BeginStillView while BG1 shows the drawn map; the tile animations are then neither suspended nor resumed.
u8 unk0fd [3]
 not named by TBS code
u16 shownTop
 windowTop as the frame update last applied it
u16 shownBottom
 windowBottom as the frame update last applied it
u16 windowPending
 cleared by the frame update; not set by name
u8 unk10a [6]
 not named by TBS code
void * tiles
 The world map's tile offsets (ResourceId_PerspectiveDataA), each tile LZ-compressed.
u8 unk114 [4]
 not named by TBS code
u16 pitch
 1/65536 turns
u16 yaw
 1/65536 turns
u32 * resources
 a row of gWorldMap_GraphicsResources, by terrain
u8 unk120 [0x18]
 not named by TBS code
u16 tileIds [256]
 the world map tile in each of 16 by 16 cells
u16 quarterTiles [8]
 The tile each quarter of each layer's block buffer shows, so an unchanged quarter is not decoded again.
s32 farPlane
 0x1fe0000 at load
s32 distance
 farPlane scaled by the zoom
s32 previousZoom
 the zoom a transition starts from
s32 zoom
 16.16 fixed point, 0x10000 full size
u16 zoomTransitionFrames
 a zoom transition's length; 0 when none
s16 zoomTransitionStep
 frames of the transition done
u16 windowTop
 Screen rows, 0 and 159 at load and 200 and 255 from WorldMap_BeginStillView; each frame copies them to shownTop and shownBottom and picks BG mode 2 or 0 from them.
u16 windowBottom

Detailed Description

The world map's perspective view: the followed position, screen shake, view position, window, pitch and yaw, tile ids and zoom.

Heap slot 8.

Definition at line 12 of file perspective.h.

Field Documentation

◆ origin

s32* PerspectiveWork::origin

◆ shakeX

s32 PerspectiveWork::shakeX

Definition at line 14 of file perspective.h.

Referenced by WorldMap_UpdateView().

◆ shakeY

s32 PerspectiveWork::shakeY

Definition at line 14 of file perspective.h.

Referenced by WorldMap_UpdateView().

◆ shakeDecay

s32 PerspectiveWork::shakeDecay

the screen shake, as in MapScrollWork

Definition at line 14 of file perspective.h.

Referenced by WorldMap_UpdateView().

◆ script

u8* PerspectiveWork::script

NULL at load.

Definition at line 15 of file perspective.h.

Referenced by Map_InitializePerspectiveScene().

◆ fade

u16 PerspectiveWork::fade

MapScrollWork's flags: REG_DISPCNT bits, 0x1f00 at load.

Definition at line 16 of file perspective.h.

Referenced by Map_InitializePerspectiveScene().

◆ fadeStep

u8 PerspectiveWork::fadeStep

MapScrollWork's wideTiles, 0x80 at load.

Definition at line 17 of file perspective.h.

Referenced by Map_InitializePerspectiveScene().

◆ unk017

u8 PerspectiveWork::unk017[0xe4 - 0x17]

as MapScrollWork: tile animations, blend script

Definition at line 18 of file perspective.h.

◆ viewX

s32 PerspectiveWork::viewX

16.16 fixed-point pixels

Definition at line 19 of file perspective.h.

Referenced by Map_InitializePerspectiveScene(), and WorldMap_UpdateView().

◆ viewY

s32 PerspectiveWork::viewY

16.16 fixed-point pixels

Definition at line 20 of file perspective.h.

Referenced by Map_InitializePerspectiveScene(), and WorldMap_UpdateView().

◆ scaleX

s32 PerspectiveWork::scaleX

0x200000 at load

Definition at line 21 of file perspective.h.

Referenced by Map_InitializePerspectiveScene().

◆ scaleY

s32 PerspectiveWork::scaleY

0x400000 at load

Definition at line 22 of file perspective.h.

Referenced by Map_InitializePerspectiveScene().

◆ limitX

s32 PerspectiveWork::limitX

0x1fe00000 at load

Definition at line 23 of file perspective.h.

Referenced by Map_InitializePerspectiveScene().

◆ limitY

s32 PerspectiveWork::limitY

0x1fe00000 at load

Definition at line 24 of file perspective.h.

Referenced by Map_InitializePerspectiveScene().

◆ animationActive

s8 PerspectiveWork::animationActive

Set by WorldMap_BeginStillView while BG1 shows the drawn map; the tile animations are then neither suspended nor resumed.

Definition at line 27 of file perspective.h.

Referenced by Map_LoadAreaGraphics(), and WorldMap_BeginStillView().

◆ unk0fd

u8 PerspectiveWork::unk0fd[3]

not named by TBS code

Definition at line 28 of file perspective.h.

◆ windowTop

u16 PerspectiveWork::windowTop

Screen rows, 0 and 159 at load and 200 and 255 from WorldMap_BeginStillView; each frame copies them to shownTop and shownBottom and picks BG mode 2 or 0 from them.

Definition at line 33 of file perspective.h.

Referenced by Map_InitializePerspectiveScene(), Map_LoadAreaGraphics(), Map_LoadDefaultCellsAndUpdateBlock(), MapAnimation_ApplyAffineFrame(), and WorldMap_BeginStillView().

◆ windowBottom

◆ shownTop

u16 PerspectiveWork::shownTop

windowTop as the frame update last applied it

Definition at line 36 of file perspective.h.

Referenced by MapAnimation_ApplyAffineFrame().

◆ shownBottom

u16 PerspectiveWork::shownBottom

windowBottom as the frame update last applied it

Definition at line 37 of file perspective.h.

Referenced by MapAnimation_ApplyAffineFrame().

◆ windowPending

u16 PerspectiveWork::windowPending

cleared by the frame update; not set by name

Definition at line 38 of file perspective.h.

Referenced by MapAnimation_ApplyAffineFrame().

◆ unk10a

u8 PerspectiveWork::unk10a[6]

not named by TBS code

Definition at line 39 of file perspective.h.

◆ tiles

void* PerspectiveWork::tiles

The world map's tile offsets (ResourceId_PerspectiveDataA), each tile LZ-compressed.

Definition at line 42 of file perspective.h.

Referenced by Map_InitializePerspectiveScene(), Map_WriteLayerCellTile(), and WorldMap_LoadGraphics().

◆ unk114

u8 PerspectiveWork::unk114[4]

not named by TBS code

Definition at line 43 of file perspective.h.

◆ pitch

u16 PerspectiveWork::pitch

1/65536 turns

Definition at line 44 of file perspective.h.

Referenced by FieldFx_StepRatioTransition(), Map_InitializePerspectiveScene(), and WorldMap_UpdateView().

◆ yaw

u16 PerspectiveWork::yaw

1/65536 turns

Definition at line 45 of file perspective.h.

Referenced by Map_InitializePerspectiveScene(), Object_MoveOnWorldMap(), and WorldMap_UpdateView().

◆ resources

u32* PerspectiveWork::resources

a row of gWorldMap_GraphicsResources, by terrain

Definition at line 46 of file perspective.h.

Referenced by Map_LoadAreaGraphics(), and WorldMap_LoadGraphics().

◆ unk120

u8 PerspectiveWork::unk120[0x18]

not named by TBS code

Definition at line 47 of file perspective.h.

◆ tileIds

u16 PerspectiveWork::tileIds[256]

the world map tile in each of 16 by 16 cells

Definition at line 48 of file perspective.h.

Referenced by Map_InitializePerspectiveScene(), Map_PreloadCurrentTileBlock(), Map_SetWindowCellTile(), Map_UpdateCurrentTileBlock(), and WorldMap_LoadGraphics().

◆ quarterTiles

u16 PerspectiveWork::quarterTiles[8]

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

Definition at line 51 of file perspective.h.

Referenced by Map_WriteLayerCellTile().

◆ farPlane

s32 PerspectiveWork::farPlane

0x1fe0000 at load

Definition at line 52 of file perspective.h.

Referenced by FieldFx_StepRatioTransition(), Map_InitializePerspectiveScene(), and WorldMap_UpdateView().

◆ distance

s32 PerspectiveWork::distance

farPlane scaled by the zoom

Definition at line 53 of file perspective.h.

Referenced by FieldFx_StepRatioTransition(), Map_InitializePerspectiveScene(), and WorldMap_UpdateView().

◆ previousZoom

s32 PerspectiveWork::previousZoom

the zoom a transition starts from

Definition at line 54 of file perspective.h.

Referenced by BattleFx_ScheduleRatioTransition(), and FieldFx_StepRatioTransition().

◆ zoom

s32 PerspectiveWork::zoom

16.16 fixed point, 0x10000 full size

Definition at line 55 of file perspective.h.

Referenced by BattleFx_ScheduleRatioTransition(), FieldFx_StepRatioTransition(), and Map_InitializePerspectiveScene().

◆ zoomTransitionFrames

u16 PerspectiveWork::zoomTransitionFrames

a zoom transition's length; 0 when none

Definition at line 56 of file perspective.h.

Referenced by BattleFx_ScheduleRatioTransition(), Event_WaitForZoomTransition(), FieldFx_StepRatioTransition(), and Map_InitializePerspectiveScene().

◆ zoomTransitionStep

s16 PerspectiveWork::zoomTransitionStep

frames of the transition done

Definition at line 57 of file perspective.h.

Referenced by BattleFx_ScheduleRatioTransition(), and FieldFx_StepRatioTransition().