Alchemy
Loading...
Searching...
No Matches

orbit.h

Go to the documentation of this file.
1#ifndef ALCHEMY_ORBIT_H
2#define ALCHEMY_ORBIT_H
3
4/// @file
5/// The views of an orbiting scene object's sprite.
6
7#include "types.h"
8
9/// A floating Nut's sprite, seen as the attribute bits, palette and state its
10/// scenes set.
12 u8 padding00[5]; ///< AnimationObject's queue link and attribute 0's y
13 /// AnimationObject's attribute 0 high byte.
14 /// bits: 7..6 shape | 5 full colour | 4 mosaic | 3..2 object mode |
15 /// 1..0 affine
16 ///@{
17 u8 flags05Low : 5; ///< affine, object mode and mosaic; not named by scenes
18 u8 flags05Bit5 : 1; ///< full colour; the Nut's scenes clear it
19 u8 flags05High : 2; ///< shape; not named by scenes
20 ///@}
21 u8 padding06[3]; ///< attribute 1 and the low byte of attribute 2
22 /// AnimationObject's attribute 2 high byte.
23 /// bits: 7..4 palette | 3..2 priority | 1..0 tile bits 9..8
24 ///@{
25 u8 flags09Low : 2; ///< tile bits 9..8; not named by scenes
26 u8 flags09Mode : 2; ///< priority; the Nut's scenes set 1
27 u8 flags09High : 4; ///< palette; the Nut's scenes set 0
28 ///@}
30 /// AnimationObject's slot: the VRAM cache entry the Nut's icon is loaded
31 /// into.
34 u8 state; ///< AnimationObject's count of layers; the Nut's scenes zero it
36
37/// A floating Nut's actor: its position, the spot it sways around and how far
38/// through the sway it is, its sprite and its callback.
39typedef struct OrbitingSceneObject {
41 s32 x; ///< 16.16 fixed-point pixels
42 s32 y; ///< 16.16 fixed-point pixels
43 s32 z; ///< 16.16 fixed-point pixels
45 /// FieldActor's priorityFlags; the Nut's scenes clear bit 0,
46 /// ACTOR_PRIORITY_AUTOMATIC.
49 /// 1/65536 turns; advanced by 0x400 plus two random steps each frame.
52 s32 orbitCenterX; ///< 16.16 fixed-point pixels
53 s32 orbitCenterY; ///< 16.16 fixed-point pixels
54 s32 orbitCenterZ; ///< 16.16 fixed-point pixels
58 u8 mode; ///< FieldActor's motionFlags; the Nut's scenes zero it
59 u8 state; ///< FieldActor's first unk56 byte; Scene_FloatNut zeroes it
61 /// FieldActor.retainSpriteCache: the Nut's scenes keep its sprite's VRAM
62 /// cache entry.
65 /// FieldActor's frozen, which skips steering, terrain, gravity and floating;
66 /// the Nut's scenes set it.
69 /// FieldActor's update hook; Scene_FloatNut sets
70 /// SceneEffect_UpdateOrbitPosition.
73
74#endif
A floating Nut's sprite, seen as the attribute bits, palette and state its scenes set.
Definition orbit.h:11
u8 flags05High
shape; not named by scenes
Definition orbit.h:19
u8 flags09Low
AnimationObject's attribute 2 high byte.
Definition orbit.h:25
u8 state
AnimationObject's count of layers; the Nut's scenes zero it.
Definition orbit.h:34
u8 palette
AnimationObject's slot: the VRAM cache entry the Nut's icon is loaded into.
Definition orbit.h:32
u8 padding06[3]
attribute 1 and the low byte of attribute 2
Definition orbit.h:21
u8 flags09Mode
priority; the Nut's scenes set 1
Definition orbit.h:26
u8 flags05Bit5
full colour; the Nut's scenes clear it
Definition orbit.h:18
u8 padding00[5]
AnimationObject's queue link and attribute 0's y.
Definition orbit.h:12
u8 flags09High
palette; the Nut's scenes set 0
Definition orbit.h:27
u8 flags05Low
AnimationObject's attribute 0 high byte.
Definition orbit.h:17
A floating Nut's actor: its position, the spot it sways around and how far through the sway it is,...
Definition orbit.h:39
u8 padding44[12]
Definition orbit.h:55
u8 padding14[15]
Definition orbit.h:44
s32 orbitCenterY
16.16 fixed-point pixels
Definition orbit.h:53
u8 padding62[10]
Definition orbit.h:68
u8 padding24[12]
Definition orbit.h:48
s32 y
16.16 fixed-point pixels
Definition orbit.h:42
OrbitingSceneObjectSprite * sprite
Definition orbit.h:56
u8 flags23
FieldActor's priorityFlags; the Nut's scenes clear bit 0, ACTOR_PRIORITY_AUTOMATIC.
Definition orbit.h:47
u32 callback
FieldActor's update hook; Scene_FloatNut sets SceneEffect_UpdateOrbitPosition.
Definition orbit.h:71
s32 orbitCenterZ
16.16 fixed-point pixels
Definition orbit.h:54
u8 visible
FieldActor's frozen, which skips steering, terrain, gravity and floating; the Nut's scenes set it.
Definition orbit.h:67
u8 mode
FieldActor's motionFlags; the Nut's scenes zero it.
Definition orbit.h:58
s32 x
16.16 fixed-point pixels
Definition orbit.h:41
s32 orbitAngle
1/65536 turns; advanced by 0x400 plus two random steps each frame.
Definition orbit.h:50
u8 active
FieldActor.retainSpriteCache: the Nut's scenes keep its sprite's VRAM cache entry.
Definition orbit.h:63
u8 state
FieldActor's first unk56 byte; Scene_FloatNut zeroes it.
Definition orbit.h:59
s32 z
16.16 fixed-point pixels
Definition orbit.h:43
s32 orbitCenterX
16.16 fixed-point pixels
Definition orbit.h:52
The integer types, TRUE, UNUSED and the fixed-address macros.
signed int s32
Definition types.h:14
unsigned int u32
Definition types.h:15
unsigned char u8
Definition types.h:11