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 <dat_macros.h>
8
9#include <dolphin/mtx.h>
10#include <dolphin/types.h>
11#include <melee/sc/types.h>
12
13// How efAsync_Spawn resolves position and forwards args to efSync_Spawn.
14// ATTACH = passes jobj directly (effect tracks the joint).
15// POS = converts jobj to world coords via lb_8000B1CC (effect at fixed
16// pos). OFFSET = Vec3 offset applied during world-pos calculation. PARAM =
17// extra float(s) forwarded to efSync_Spawn after the position arg.
18typedef enum EF_SpawnKind {
20 0, // (jobj) -> efSync(gfx_id, gobj, jobj)
21 EF_SPAWN_POS = 1, // (jobj) -> worldpos(jobj) ->
22 // efSync(gfx_id, gobj, &pos)
23 EF_SPAWN_POS_OFFSET = 2, // (jobj, &ofs) -> worldpos(jobj, &ofs)
24 // -> efSync(gfx_id, gobj, &pos)
26 3, // (jobj, &f) -> efSync(gfx_id, gobj, jobj, &f)
27 EF_SPAWN_POS_PARAM = 4, // (jobj, &f) -> worldpos(jobj) ->
28 // efSync(gfx_id, gobj, &pos, &f)
30 5, // (jobj, &ofs, &f) -> worldpos(jobj, &ofs) ->
31 // efSync(..., &pos, &f)
33 6, // (jobj, &ofs, &f1, &f2) -> worldpos(jobj, &ofs) ->
34 // efSync(..., &f1, &f2)
36 7, // (jobj, &vec) -> efSync(gfx_id, gobj, jobj, &vec)
38 8, // (jobj, &ofs) -> worldpos(jobj, &ofs) ->
39 // Camera_RequestQuake(gfx_id, &pos)
41
42// 0 = async load (default)
43// 1 = sync load
44#define EF_LOADKIND_ASYNC 0
45#define EF_LOADKIND_SYNC 1
46
47// EF_Effect: scale_flags
48#define EF_SCALE_NO_INHERIT 0x00
49#define EF_SCALE_INHERIT 0x01
50
51// EF_Effect: expire_flags
52#define EF_DOES_NOT_EXPIRE 0x00
53#define EF_DOES_EXPIRE 0x01
54
55// EF_Effect: state_flags
56#define EF_STATE_ACTIVE 0x00
57#define EF_STATE_ENTERING_PAUSE 0x01
58#define EF_STATE_PAUSED 0x02
59#define EF_STATE_ASYNC 0x80
60
61struct EF_Effect {
62 /* +0 */ EF_Effect* next;
63 /* +4 */ HSD_GObj* gobj;
67 /* +14 */ void* user_data;
68 /* +18 */ Vec3 params; // callback parameters, usage depends per-callback
69 /* +24 */ u16 lifetime;
70 /* +26 */ s8 expire_flags;
71 /* +27 */ u8 scale_flags;
72 /* +28 */ u8 state_flags;
73 /* +29 */ u8 is_async;
74 /* +2A */ s8 x2A;
75 /* +2B */ s8 x2B;
76}; /* size = 0x2C */
77
79 /* +0 */ float lifetime;
81}; /* size = 0x14 */
82
85 /* +4 */ u8 spawn_kind;
86 /* +8 */ s32 gfx_id;
87 /* +C */ HSD_JObj* jobj;
88 /* +10 */ Vec3 params; // parameters depending on spawn_kind
89 /* +1C */ f32 extra1; // forwarded to efSync_Spawn depending on spawn_kind
90 /* +20 */ f32 extra2; // second extra float used depending on spawn_kind
91}; /* size = 0x24 */
92
93typedef struct EF_DAT_Entry {
94 /* 0x0 */ char* ef_DAT_file; // ex. "EfCoData.dat"
95 /* 0x4 */ char* effDataTable_name; // ex. "effCommonDataTable"
96 /* 0x8 */ EF_EffectDesc* data; // loaded data table's effects
97} EF_DAT_Entry; /* size = 0xC */
99
102typedef struct EffectDataTable {
106 /* 0x0 */ int* cmd_bank DAT_EXTENT;
107 /* 0x4 */ int* tex_bank DAT_EXTENT;
111 /* 0x8 */ EF_EffectDesc descs[1] DAT_EXTENT;
113
115 char pad_0[0x24];
116};
118
119#endif
Annotations describing how archive data is laid out, for the parts a C declaration cannot express: ho...
struct Vec Vec3
signed int s32
Definition types.h:12
signed char s8
Definition types.h:4
float f32
Definition types.h:18
unsigned short int u16
Definition types.h:7
unsigned char u8
Definition types.h:5
void(* EF_UpdateFn)(EF_Effect *)
Definition forward.h:12
#define ASSERT_SIZE(expr, size)
Definition platform.h:127
EF_SpawnKind
Definition types.h:18
@ EF_SPAWN_POS
Definition types.h:21
@ EF_SPAWN_POS_OFFSET_PARAM2
Definition types.h:32
@ EF_SPAWN_ATTACH_PARAM
Definition types.h:25
@ EF_SPAWN_ATTACH
Definition types.h:19
@ EF_SPAWN_ATTACH_OFFSET
Definition types.h:35
@ EF_SPAWN_POS_PARAM
Definition types.h:27
@ EF_SPAWN_CAMERA_SHAKE
Definition types.h:37
@ EF_SPAWN_POS_OFFSET
Definition types.h:23
@ EF_SPAWN_POS_OFFSET_PARAM
Definition types.h:29
Definition types.h:93
char * effDataTable_name
Definition types.h:95
char * ef_DAT_file
Definition types.h:94
EF_EffectDesc * data
Definition types.h:96
Definition types.h:78
float lifetime
Definition types.h:79
StaticModelDesc model_desc
Definition types.h:80
Definition types.h:61
u16 lifetime
Definition types.h:69
HSD_JObj * attach_jobj
Definition types.h:65
u8 is_async
Definition types.h:73
s8 x2A
Definition types.h:74
EF_UpdateFn update
Definition types.h:66
EF_Effect * next
Definition types.h:62
u8 state_flags
Definition types.h:72
HSD_GObj * parent_gobj
Definition types.h:64
Vec3 params
Definition types.h:68
s8 expire_flags
Definition types.h:70
void * user_data
Definition types.h:67
s8 x2B
Definition types.h:75
HSD_GObj * gobj
Definition types.h:63
u8 scale_flags
Definition types.h:71
Definition types.h:114
char pad_0[0x24]
Definition types.h:115
Definition types.h:83
EF_QueuedEffect * next
Definition types.h:84
f32 extra2
Definition types.h:90
u8 spawn_kind
EF_SpawnKind
Definition types.h:85
f32 extra1
Definition types.h:89
HSD_JObj * jobj
Definition types.h:87
s32 gfx_id
Definition types.h:86
Vec3 params
Definition types.h:88
The effect data table named by an EF_DAT_Entry, as stored in its archive.
Definition types.h:102
int *cmd_bank DAT_EXTENT
The particle command and texture banks: words, and offsets into themselves that psInitDataBankLocate ...
Definition types.h:106
Definition gobj.h:16
Definition jobj.h:106
Model with a single animation or no animation.
Definition types.h:11