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 pos).
18// OFFSET = Vec3 offset applied during world-pos calculation.
19// PARAM = extra float(s) forwarded to efSync_Spawn after the position arg.
20typedef enum EF_SpawnKind {
21 EF_SPAWN_ATTACH = 0, // (jobj) -> efSync(gfx_id, gobj, jobj)
22 EF_SPAWN_POS = 1, // (jobj) -> worldpos(jobj) -> efSync(gfx_id, gobj, &pos)
23 EF_SPAWN_POS_OFFSET = 2, // (jobj, &ofs) -> worldpos(jobj, &ofs) -> efSync(gfx_id, gobj, &pos)
24 EF_SPAWN_ATTACH_PARAM = 3, // (jobj, &f) -> efSync(gfx_id, gobj, jobj, &f)
25 EF_SPAWN_POS_PARAM = 4, // (jobj, &f) -> worldpos(jobj) -> efSync(gfx_id, gobj, &pos, &f)
26 EF_SPAWN_POS_OFFSET_PARAM = 5, // (jobj, &ofs, &f) -> worldpos(jobj, &ofs) -> efSync(..., &pos, &f)
27 EF_SPAWN_POS_OFFSET_PARAM2 = 6, // (jobj, &ofs, &f1, &f2) -> worldpos(jobj, &ofs) -> efSync(..., &f1, &f2)
28 EF_SPAWN_ATTACH_OFFSET = 7, // (jobj, &vec) -> efSync(gfx_id, gobj, jobj, &vec)
29 EF_SPAWN_CAMERA_SHAKE = 8, // (jobj, &ofs) -> worldpos(jobj, &ofs) -> Camera_80030E44(gfx_id, &pos)
31
32// 0 = async load (default)
33// 1 = sync load
34#define EF_LOADKIND_ASYNC 0
35#define EF_LOADKIND_SYNC 1
36
37// EF_Effect: scale_flags
38#define EF_SCALE_NO_INHERIT 0x00
39#define EF_SCALE_INHERIT 0x01
40
41// EF_Effect: expire_flags
42#define EF_DOES_NOT_EXPIRE 0x00
43#define EF_DOES_EXPIRE 0x01
44
45// EF_Effect: state_flags
46#define EF_STATE_ACTIVE 0x00
47#define EF_STATE_ENTERING_PAUSE 0x01
48#define EF_STATE_PAUSED 0x02
49#define EF_STATE_ASYNC 0x80
50
51struct EF_Effect {
52 /* +0 */ EF_Effect* next;
53 /* +4 */ HSD_GObj* gobj;
57 /* +14 */ void* user_data;
58 /* +18 */ Vec3 params; // callback parameters, usage depends per-callback
59 /* +24 */ u16 lifetime;
60 /* +26 */ s8 expire_flags;
61 /* +27 */ u8 scale_flags;
62 /* +28 */ u8 state_flags;
63 /* +29 */ u8 is_async;
64 /* +2A */ s8 x2A;
65 /* +2B */ s8 x2B;
66}; /* size = 0x2C */
67
69 /* +0 */ float lifetime;
71}; /* size = 0x14 */
72
75 /* +4 */ u8 spawn_kind; // EF_SpawnKind
76 /* +8 */ s32 gfx_id;
77 /* +C */ HSD_JObj* jobj;
78 /* +10 */ Vec3 params; // parameters depending on spawn_kind
79 /* +1C */ f32 extra1; // forwarded to efSync_Spawn depending on spawn_kind
80 /* +20 */ f32 extra2; // second extra float used depending on spawn_kind
81}; /* size = 0x24 */
82
83typedef struct EF_DAT_Entry {
84 /* 0x0 */ char* ef_DAT_file; // ex. "EfCoData.dat"
85 /* 0x4 */ char* effDataTable_name; // ex. "effCommonDataTable"
86 /* 0x8 */ void* data; // loaded data pointer
87} EF_DAT_Entry; /* size = 0xC */
89
91 char pad_0[0x24];
92};
94
95#endif
EF_SpawnKind
Definition types.h:20
@ EF_SPAWN_POS
Definition types.h:22
@ EF_SPAWN_POS_OFFSET_PARAM2
Definition types.h:27
@ EF_SPAWN_ATTACH_PARAM
Definition types.h:24
@ EF_SPAWN_ATTACH
Definition types.h:21
@ EF_SPAWN_ATTACH_OFFSET
Definition types.h:28
@ EF_SPAWN_POS_PARAM
Definition types.h:25
@ EF_SPAWN_CAMERA_SHAKE
Definition types.h:29
@ EF_SPAWN_POS_OFFSET
Definition types.h:23
@ EF_SPAWN_POS_OFFSET_PARAM
Definition types.h:26
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:83
char * effDataTable_name
Definition types.h:85
char * ef_DAT_file
Definition types.h:84
void * data
Definition types.h:86
Definition types.h:68
float lifetime
Definition types.h:69
StaticModelDesc model_desc
Definition types.h:70
Definition types.h:51
u16 lifetime
Definition types.h:59
HSD_JObj * attach_jobj
Definition types.h:55
u8 is_async
Definition types.h:63
s8 x2A
Definition types.h:64
EF_UpdateFn update
Definition types.h:56
EF_Effect * next
Definition types.h:52
u8 state_flags
Definition types.h:62
HSD_GObj * parent_gobj
Definition types.h:54
Vec3 params
Definition types.h:58
s8 expire_flags
Definition types.h:60
void * user_data
Definition types.h:57
s8 x2B
Definition types.h:65
HSD_GObj * gobj
Definition types.h:53
u8 scale_flags
Definition types.h:61
Definition types.h:90
char pad_0[0x24]
Definition types.h:91
Definition types.h:73
EF_QueuedEffect * next
Definition types.h:74
f32 extra2
Definition types.h:80
u8 spawn_kind
Definition types.h:75
f32 extra1
Definition types.h:79
HSD_JObj * jobj
Definition types.h:77
s32 gfx_id
Definition types.h:76
Vec3 params
Definition types.h:78
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