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