orbit.h
games/tbs/include/orbit.h on GitHub
Structures
OrbitingSceneObjectSprite
struct OrbitingSceneObjectSprite
A floating Nut's sprite, seen as the attribute bits, palette and state its scenes set.
| Field | Declared as | |
|---|---|---|
padding00 | u8 padding00[5] | AnimationObject's queue link and attribute 0's y |
flags05Low | u8 flags05Low : 5 | AnimationObject's attribute 0 high byte. bits: 7..6 shape | 5 full colour | 4 mosaic | 3..2 object mode | 1..0 affine @{ affine, object mode and mosaic; not named by scenes |
flags05Bit5 | u8 flags05Bit5 : 1 | full colour; the Nut's scenes clear it |
flags05High | u8 flags05High : 2 | shape; not named by scenes |
padding06 | u8 padding06[3] | @} attribute 1 and the low byte of attribute 2 |
flags09Low | u8 flags09Low : 2 | AnimationObject's attribute 2 high byte. bits: 7..4 palette | 3..2 priority | 1..0 tile bits 9..8 @{ tile bits 9..8; not named by scenes |
flags09Mode | u8 flags09Mode : 2 | priority; the Nut's scenes set 1 |
flags09High | u8 flags09High : 4 | palette; the Nut's scenes set 0 |
padding0a | u8 padding0a[18] | @} |
palette | u8 palette | AnimationObject's slot: the VRAM cache entry the Nut's icon is loaded into. |
padding1d | u8 padding1d[10] | |
state | u8 state | AnimationObject's count of layers; the Nut's scenes zero it |
Used by Kalay_PrepareTown, Scene_FloatNut.
OrbitingSceneObject
struct OrbitingSceneObject
A floating Nut's actor: its position, the spot it sways around and how far through the sway it is, its sprite and its callback.
| Field | Declared as | |
|---|---|---|
padding00 | u8 padding00[8] | |
x | s32 x | 16.16 fixed-point pixels |
y | s32 y | 16.16 fixed-point pixels |
z | s32 z | 16.16 fixed-point pixels |
padding14 | u8 padding14[15] | |
flags23 | u8 flags23 | FieldActor's priorityFlags; the Nut's scenes clear bit 0, ACTOR_PRIORITY_AUTOMATIC. |
padding24 | u8 padding24[12] | |
orbitAngle | s32 orbitAngle | 1/65536 turns; advanced by 0x400 plus two random steps each frame. |
padding34 | u8 padding34[4] | |
orbitCenterX | s32 orbitCenterX | 16.16 fixed-point pixels |
orbitCenterY | s32 orbitCenterY | 16.16 fixed-point pixels |
orbitCenterZ | s32 orbitCenterZ | 16.16 fixed-point pixels |
padding44 | u8 padding44[12] | |
sprite | OrbitingSceneObjectSprite *sprite | |
padding54 | u8 padding54 | |
mode | u8 mode | FieldActor's motionFlags; the Nut's scenes zero it |
state | u8 state | FieldActor's first unk56 byte; Scene_FloatNut zeroes it |
padding57 | u8 padding57[5] | |
active | u8 active | FieldActor.retainSpriteCache: the Nut's scenes keep its sprite's VRAM cache entry. |
padding5d | u8 padding5d[4] | |
visible | u8 visible | FieldActor's frozen, which skips steering, terrain, gravity and floating; the Nut's scenes set it. |
padding62 | u8 padding62[10] | |
callback | u32 callback | FieldActor's update hook; Scene_FloatNut sets SceneEffect_UpdateOrbitPosition. |
Used by Kalay_PrepareTown, Scene_FloatNut.