2024-01-29 05:43:51 +01:00
|
|
|
#ifndef __TRANSFORM_IDS_H__
|
|
|
|
#define __TRANSFORM_IDS_H__
|
|
|
|
|
2024-02-05 05:12:34 +01:00
|
|
|
#define CAMERA_TRANSFORM_ID_START 0x10U
|
|
|
|
|
|
|
|
#define SKYBOX_TRANSFORM_ID_START 0x100U
|
|
|
|
|
2024-02-18 04:11:07 +01:00
|
|
|
#define PARTICLE_TRANSFORM_ID_START 0x200U
|
2024-02-05 05:12:34 +01:00
|
|
|
|
2024-02-19 23:02:10 +01:00
|
|
|
#define SOARING_WINGS_TRANSFORM_ID 0x300U
|
|
|
|
#define SOARING_CAPSULE_TRANSFORM_ID 0x301U
|
|
|
|
|
2024-02-24 22:14:48 +01:00
|
|
|
#define BOWSTRING_TRANSFORM_ID 0x400U
|
|
|
|
|
2024-01-29 05:43:51 +01:00
|
|
|
#define ACTOR_TRANSFORM_LIMB_COUNT 128
|
|
|
|
#define ACTOR_TRANSFORM_ID_COUNT (ACTOR_TRANSFORM_LIMB_COUNT * 2) // One ID for each limb and another for each post-draw
|
|
|
|
#define ACTOR_TRANSFORM_ID_START 0x1000000U
|
|
|
|
|
2024-02-24 22:13:39 +01:00
|
|
|
// Use 16 bits of compiler-inserted padding to hold the actor's transform ID.
|
|
|
|
// 0x22 between halfDaysBits and world
|
|
|
|
#define actorIdByte0(actor) ((u8*)(actor))[0x22]
|
|
|
|
// 0x23 between halfDaysBits and world
|
|
|
|
#define actorIdByte1(actor) ((u8*)(actor))[0x23]
|
|
|
|
|
|
|
|
// Other unused padding:
|
|
|
|
// 0x3A between audioFlags and focus
|
|
|
|
// 0x3B between audioFlags and focus
|
|
|
|
|
|
|
|
static inline u32 actor_transform_id(Actor* actor) {
|
|
|
|
u32 actor_id =
|
|
|
|
(actorIdByte0(actor) << 0) |
|
|
|
|
(actorIdByte1(actor) << 8);
|
|
|
|
|
|
|
|
return (actor_id * ACTOR_TRANSFORM_ID_COUNT) + ACTOR_TRANSFORM_ID_START;
|
|
|
|
}
|
|
|
|
|
2024-01-29 05:43:51 +01:00
|
|
|
#endif
|