SSBM Decomp
Loading...
Searching...
No Matches
types.h
Go to the documentation of this file.
1#ifndef MELEE_EF_TYPES_H
2#define MELEE_EF_TYPES_H
3
4#include <melee/ef/forward.h> // IWYU pragma: export
6
7#include <dolphin/mtx.h>
8#include <dolphin/types.h>
9#include <melee/sc/types.h>
10
11// How efAsync_Spawn resolves position and forwards args to efSync_Spawn.
12// ATTACH = passes jobj directly (effect tracks the joint).
13// POS = converts jobj to world coords via lb_8000B1CC (effect at fixed
14// pos). OFFSET = Vec3 offset applied during world-pos calculation. PARAM =
15// extra float(s) forwarded to efSync_Spawn after the position arg.
16typedef enum EF_SpawnKind {
18 0, // (jobj) -> efSync(gfx_id, gobj, jobj)
19 EF_SPAWN_POS = 1, // (jobj) -> worldpos(jobj) ->
20 // efSync(gfx_id, gobj, &pos)
21 EF_SPAWN_POS_OFFSET = 2, // (jobj, &ofs) -> worldpos(jobj, &ofs)
22 // -> efSync(gfx_id, gobj, &pos)
24 3, // (jobj, &f) -> efSync(gfx_id, gobj, jobj, &f)
25 EF_SPAWN_POS_PARAM = 4, // (jobj, &f) -> worldpos(jobj) ->
26 // efSync(gfx_id, gobj, &pos, &f)
28 5, // (jobj, &ofs, &f) -> worldpos(jobj, &ofs) ->
29 // efSync(..., &pos, &f)
31 6, // (jobj, &ofs, &f1, &f2) -> worldpos(jobj, &ofs) ->
32 // efSync(..., &f1, &f2)
34 7, // (jobj, &vec) -> efSync(gfx_id, gobj, jobj, &vec)
36 8, // (jobj, &ofs) -> worldpos(jobj, &ofs) ->
37 // Camera_RequestQuake(gfx_id, &pos)
39
40// 0 = async load (default)
41// 1 = sync load
42#define EF_LOADKIND_ASYNC 0
43#define EF_LOADKIND_SYNC 1
44
45// EF_Effect: scale_flags
46#define EF_SCALE_NO_INHERIT 0x00
47#define EF_SCALE_INHERIT 0x01
48
49// EF_Effect: expire_flags
50#define EF_DOES_NOT_EXPIRE 0x00
51#define EF_DOES_EXPIRE 0x01
52
53// EF_Effect: state_flags
54#define EF_STATE_ACTIVE 0x00
55#define EF_STATE_ENTERING_PAUSE 0x01
56#define EF_STATE_PAUSED 0x02
57#define EF_STATE_ASYNC 0x80
58
59struct EF_Effect {
60 /* +0 */ EF_Effect* next;
61 /* +4 */ HSD_GObj* gobj;
65 /* +14 */ void* user_data;
66 /* +18 */ Vec3 params; // callback parameters, usage depends per-callback
67 /* +24 */ u16 lifetime;
68 /* +26 */ s8 expire_flags;
69 /* +27 */ u8 scale_flags;
70 /* +28 */ u8 state_flags;
71 /* +29 */ u8 is_async;
72 /* +2A */ s8 x2A;
73 /* +2B */ s8 x2B;
74}; /* size = 0x2C */
75
77 /* +0 */ float lifetime;
79}; /* size = 0x14 */
80
83 /* +4 */ u8 spawn_kind; // EF_SpawnKind
84 /* +8 */ s32 gfx_id;
85 /* +C */ HSD_JObj* jobj;
86 /* +10 */ Vec3 params; // parameters depending on spawn_kind
87 /* +1C */ f32 extra1; // forwarded to efSync_Spawn depending on spawn_kind
88 /* +20 */ f32 extra2; // second extra float used depending on spawn_kind
89}; /* size = 0x24 */
90
91typedef struct EF_DAT_Entry {
92 /* 0x0 */ char* ef_DAT_file; // ex. "EfCoData.dat"
93 /* 0x4 */ char* effDataTable_name; // ex. "effCommonDataTable"
94 /* 0x8 */ void* data; // loaded data pointer
95} EF_DAT_Entry; /* size = 0xC */
97
99 char pad_0[0x24];
100};
102
103#endif
struct Vec Vec3
signed char s8
Definition types.h:4
float f32
Definition types.h:13
unsigned short int u16
Definition types.h:7
signed long s32
Definition types.h:8
unsigned char u8
Definition types.h:5
void(* EF_UpdateFn)(EF_Effect *)
Definition forward.h:12
#define ASSERT_SIZE(expr, size)
Definition platform.h:161
EF_SpawnKind
Definition types.h:16
@ EF_SPAWN_POS
Definition types.h:19
@ EF_SPAWN_POS_OFFSET_PARAM2
Definition types.h:30
@ EF_SPAWN_ATTACH_PARAM
Definition types.h:23
@ EF_SPAWN_ATTACH
Definition types.h:17
@ EF_SPAWN_ATTACH_OFFSET
Definition types.h:33
@ EF_SPAWN_POS_PARAM
Definition types.h:25
@ EF_SPAWN_CAMERA_SHAKE
Definition types.h:35
@ EF_SPAWN_POS_OFFSET
Definition types.h:21
@ EF_SPAWN_POS_OFFSET_PARAM
Definition types.h:27
Definition types.h:91
char * effDataTable_name
Definition types.h:93
char * ef_DAT_file
Definition types.h:92
void * data
Definition types.h:94
Definition types.h:76
float lifetime
Definition types.h:77
StaticModelDesc model_desc
Definition types.h:78
Definition types.h:59
u16 lifetime
Definition types.h:67
HSD_JObj * attach_jobj
Definition types.h:63
u8 is_async
Definition types.h:71
s8 x2A
Definition types.h:72
EF_UpdateFn update
Definition types.h:64
EF_Effect * next
Definition types.h:60
u8 state_flags
Definition types.h:70
HSD_GObj * parent_gobj
Definition types.h:62
Vec3 params
Definition types.h:66
s8 expire_flags
Definition types.h:68
void * user_data
Definition types.h:65
s8 x2B
Definition types.h:73
HSD_GObj * gobj
Definition types.h:61
u8 scale_flags
Definition types.h:69
Definition types.h:98
char pad_0[0x24]
Definition types.h:99
Definition types.h:81
EF_QueuedEffect * next
Definition types.h:82
f32 extra2
Definition types.h:88
u8 spawn_kind
Definition types.h:83
f32 extra1
Definition types.h:87
HSD_JObj * jobj
Definition types.h:85
s32 gfx_id
Definition types.h:84
Vec3 params
Definition types.h:86
Definition gobj.h:13
Definition jobj.h:104
Model with a single animation or no animation.
Definition types.h:8