2024-01-29 05:43:51 +01:00
|
|
|
#ifndef __TRANSFORM_IDS_H__
|
|
|
|
#define __TRANSFORM_IDS_H__
|
|
|
|
|
2024-03-12 23:01:58 +01:00
|
|
|
#define CAMERA_TRANSFORM_ID 0x10U
|
2024-03-29 01:36:16 +01:00
|
|
|
#define CIRCLE_OVERLAY_TRANSFORM_ID 0x11U
|
|
|
|
#define CIRCLE_OVERLAY_TRANSFORM_PROJECTION_ID 0x12U
|
2024-04-02 00:52:26 +02:00
|
|
|
#define TEXTBOX_TRANSFORM_ID 0x13U
|
|
|
|
#define TEXTBOX_TRANSFORM_PROJECTION_ID 0x14U
|
2024-04-02 03:38:24 +02:00
|
|
|
#define LETTERBOX_TRANSFORM_ID 0x15U
|
|
|
|
#define LETTERBOX_TRANSFORM_PROJECTION_ID 0x16U
|
2024-04-04 08:11:48 +02:00
|
|
|
#define PAUSE_CURSOR_TRANSFORM_ID 0x17U
|
|
|
|
#define PAUSE_INFO_PANEL_TRANSFORM_ID 0x18U
|
2024-02-05 05:12:34 +01:00
|
|
|
|
|
|
|
#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-05-06 01:09:11 +02:00
|
|
|
#define SOARING_LENS_FLARE_TRANSFORM_ID 0x302U
|
2024-02-19 23:02:10 +01:00
|
|
|
|
2024-02-24 22:14:48 +01:00
|
|
|
#define BOWSTRING_TRANSFORM_ID 0x400U
|
2024-03-03 09:18:07 +01:00
|
|
|
#define HOOKSHOT_RETICLE_TRANSFORM_ID 0x401U
|
|
|
|
|
2024-05-06 01:09:11 +02:00
|
|
|
#define CUSTOM_LENS_FLARE_TRANSFORM_ID_START 0x500 // Count: 2
|
|
|
|
#define SUN_LENS_FLARE_TRANSFORM_ID 0x502 // Count: 1
|
2024-02-24 22:14:48 +01:00
|
|
|
|
2024-03-27 23:47:47 +01:00
|
|
|
#define GOHT_ROCKS_TRANSFORM_ID_START 0x600U // Count: 0x200
|
|
|
|
#define SPECIAL_EFFECTS_TRANSFORM_ID_START 0x800U
|
|
|
|
|
2024-03-12 23:01:58 +01:00
|
|
|
#define STAR_TRANSFORM_ID_START 0x1000U
|
|
|
|
|
2024-03-14 00:26:29 +01:00
|
|
|
#define EFFECT_TRANSFORM_ID_COUNT 0x800U
|
|
|
|
#define EFFECT_SPARK_TRANSFORM_ID_START 0x2000U
|
|
|
|
#define EFFECT_BLURE_TRANSFORM_ID_START (EFFECT_SPARK_TRANSFORM_ID_START + 2 * EFFECT_TRANSFORM_ID_COUNT)
|
|
|
|
#define EFFECT_SHIELD_PARTICLE_TRANSFORM_ID_START (EFFECT_BLURE_TRANSFORM_ID_START + 2 * EFFECT_TRANSFORM_ID_COUNT)
|
|
|
|
#define EFFECT_TIRE_MARK_TRANSFORM_ID_START (EFFECT_SHIELD_PARTICLE_TRANSFORM_ID_START + 2 * EFFECT_TRANSFORM_ID_COUNT)
|
|
|
|
|
2024-03-31 22:39:47 +02:00
|
|
|
#define ACTOR_TRANSFORM_LIMB_COUNT 256
|
2024-01-29 05:43:51 +01:00
|
|
|
#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]
|
2024-03-31 22:39:47 +02:00
|
|
|
// 0x3A between audioFlags and focus
|
|
|
|
#define actorIdByte2(actor) ((u8*)(actor))[0x3A]
|
2024-02-24 22:13:39 +01:00
|
|
|
|
|
|
|
// Other unused padding:
|
|
|
|
// 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-03-31 22:39:47 +02:00
|
|
|
typedef enum {
|
|
|
|
ACTOR_TRANSFORM_FLAG_INTERPOLATION_SKIPPED = 1 << 0,
|
2024-04-06 06:34:10 +02:00
|
|
|
ACTOR_CUSTOM_FLAG_1 = 1 << 1,
|
|
|
|
} CustomActorFlags;
|
2024-03-31 22:39:47 +02:00
|
|
|
|
|
|
|
static inline u32 actor_get_interpolation_skipped(Actor* actor) {
|
|
|
|
return (actorIdByte2(actor) & ACTOR_TRANSFORM_FLAG_INTERPOLATION_SKIPPED) != 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void actor_set_interpolation_skipped(Actor* actor) {
|
|
|
|
actorIdByte2(actor) |= ACTOR_TRANSFORM_FLAG_INTERPOLATION_SKIPPED;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void actor_clear_interpolation_skipped(Actor* actor) {
|
|
|
|
actorIdByte2(actor) &= ~ACTOR_TRANSFORM_FLAG_INTERPOLATION_SKIPPED;
|
|
|
|
}
|
|
|
|
|
2024-04-06 06:34:10 +02:00
|
|
|
static inline void actor_set_custom_flag_1(Actor* actor) {
|
|
|
|
actorIdByte2(actor) |= ACTOR_CUSTOM_FLAG_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void actor_clear_custom_flag_1(Actor* actor) {
|
|
|
|
actorIdByte2(actor) &= ~ACTOR_CUSTOM_FLAG_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline bool actor_get_custom_flag_1(Actor* actor) {
|
|
|
|
return (actorIdByte2(actor) & ACTOR_CUSTOM_FLAG_1) != 0;
|
|
|
|
}
|
|
|
|
|
2024-03-03 05:23:29 +01:00
|
|
|
void force_camera_interpolation();
|
|
|
|
void force_camera_skip_interpolation();
|
|
|
|
|
2024-01-29 05:43:51 +01:00
|
|
|
#endif
|