SSBM Decomp
Toggle main menu visibility
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
5
#include <
sysdolphin/baselib/forward.h
>
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.
18
typedef
enum
EF_SpawnKind
{
19
EF_SPAWN_ATTACH
=
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)
25
EF_SPAWN_ATTACH_PARAM
=
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)
29
EF_SPAWN_POS_OFFSET_PARAM
=
30
5,
// (jobj, &ofs, &f) -> worldpos(jobj, &ofs) ->
31
// efSync(..., &pos, &f)
32
EF_SPAWN_POS_OFFSET_PARAM2
=
33
6,
// (jobj, &ofs, &f1, &f2) -> worldpos(jobj, &ofs) ->
34
// efSync(..., &f1, &f2)
35
EF_SPAWN_ATTACH_OFFSET
=
36
7,
// (jobj, &vec) -> efSync(gfx_id, gobj, jobj, &vec)
37
EF_SPAWN_CAMERA_SHAKE
=
38
8,
// (jobj, &ofs) -> worldpos(jobj, &ofs) ->
39
// Camera_RequestQuake(gfx_id, &pos)
40
}
EF_SpawnKind
;
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
61
struct
EF_Effect
{
62
/* +0 */
EF_Effect
*
next
;
63
/* +4 */
HSD_GObj
*
gobj
;
64
/* +8 */
HSD_GObj
*
parent_gobj
;
65
/* +C */
HSD_JObj
*
attach_jobj
;
66
/* +10 */
EF_UpdateFn
update
;
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
78
struct
EF_EffectDesc
{
79
/* +0 */
float
lifetime
;
80
/* +4 */
StaticModelDesc
model_desc
;
81
};
/* size = 0x14 */
82
83
struct
EF_QueuedEffect
{
84
/* +0 */
EF_QueuedEffect
*
next
;
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
93
typedef
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 */
98
ASSERT_SIZE
(
EF_DAT_Entry
, 0xC);
99
102
typedef
struct
EffectDataTable
{
106
/* 0x0 */
int
* cmd_bank
DAT_EXTENT
;
107
/* 0x4 */
int
* tex_bank
DAT_EXTENT
;
111
/* 0x8 */
EF_EffectDesc
descs[1]
DAT_EXTENT
;
112
}
EffectDataTable
;
113
114
struct
EF_QueuedEffect_ObjAlloc
{
115
char
pad_0
[0x24];
116
};
117
ASSERT_SIZE
(
struct
EF_QueuedEffect_ObjAlloc
, 0x24);
118
119
#endif
dat_macros.h
Annotations describing how archive data is laid out, for the parts a C declaration cannot express: ho...
mtx.h
Vec3
struct Vec Vec3
types.h
s32
signed int s32
Definition
types.h:12
s8
signed char s8
Definition
types.h:4
f32
float f32
Definition
types.h:18
u16
unsigned short int u16
Definition
types.h:7
u8
unsigned char u8
Definition
types.h:5
forward.h
EF_UpdateFn
void(* EF_UpdateFn)(EF_Effect *)
Definition
forward.h:12
ASSERT_SIZE
#define ASSERT_SIZE(expr, size)
Definition
platform.h:127
EF_SpawnKind
EF_SpawnKind
Definition
types.h:18
EF_SPAWN_POS
@ EF_SPAWN_POS
Definition
types.h:21
EF_SPAWN_POS_OFFSET_PARAM2
@ EF_SPAWN_POS_OFFSET_PARAM2
Definition
types.h:32
EF_SPAWN_ATTACH_PARAM
@ EF_SPAWN_ATTACH_PARAM
Definition
types.h:25
EF_SPAWN_ATTACH
@ EF_SPAWN_ATTACH
Definition
types.h:19
EF_SPAWN_ATTACH_OFFSET
@ EF_SPAWN_ATTACH_OFFSET
Definition
types.h:35
EF_SPAWN_POS_PARAM
@ EF_SPAWN_POS_PARAM
Definition
types.h:27
EF_SPAWN_CAMERA_SHAKE
@ EF_SPAWN_CAMERA_SHAKE
Definition
types.h:37
EF_SPAWN_POS_OFFSET
@ EF_SPAWN_POS_OFFSET
Definition
types.h:23
EF_SPAWN_POS_OFFSET_PARAM
@ EF_SPAWN_POS_OFFSET_PARAM
Definition
types.h:29
types.h
EF_DAT_Entry
Definition
types.h:93
EF_DAT_Entry::effDataTable_name
char * effDataTable_name
Definition
types.h:95
EF_DAT_Entry::ef_DAT_file
char * ef_DAT_file
Definition
types.h:94
EF_DAT_Entry::data
EF_EffectDesc * data
Definition
types.h:96
EF_EffectDesc
Definition
types.h:78
EF_EffectDesc::lifetime
float lifetime
Definition
types.h:79
EF_EffectDesc::model_desc
StaticModelDesc model_desc
Definition
types.h:80
EF_Effect
Definition
types.h:61
EF_Effect::lifetime
u16 lifetime
Definition
types.h:69
EF_Effect::attach_jobj
HSD_JObj * attach_jobj
Definition
types.h:65
EF_Effect::is_async
u8 is_async
Definition
types.h:73
EF_Effect::x2A
s8 x2A
Definition
types.h:74
EF_Effect::update
EF_UpdateFn update
Definition
types.h:66
EF_Effect::next
EF_Effect * next
Definition
types.h:62
EF_Effect::state_flags
u8 state_flags
Definition
types.h:72
EF_Effect::parent_gobj
HSD_GObj * parent_gobj
Definition
types.h:64
EF_Effect::params
Vec3 params
Definition
types.h:68
EF_Effect::expire_flags
s8 expire_flags
Definition
types.h:70
EF_Effect::user_data
void * user_data
Definition
types.h:67
EF_Effect::x2B
s8 x2B
Definition
types.h:75
EF_Effect::gobj
HSD_GObj * gobj
Definition
types.h:63
EF_Effect::scale_flags
u8 scale_flags
Definition
types.h:71
EF_QueuedEffect_ObjAlloc
Definition
types.h:114
EF_QueuedEffect_ObjAlloc::pad_0
char pad_0[0x24]
Definition
types.h:115
EF_QueuedEffect
Definition
types.h:83
EF_QueuedEffect::next
EF_QueuedEffect * next
Definition
types.h:84
EF_QueuedEffect::extra2
f32 extra2
Definition
types.h:90
EF_QueuedEffect::spawn_kind
u8 spawn_kind
EF_SpawnKind
Definition
types.h:85
EF_QueuedEffect::extra1
f32 extra1
Definition
types.h:89
EF_QueuedEffect::jobj
HSD_JObj * jobj
Definition
types.h:87
EF_QueuedEffect::gfx_id
s32 gfx_id
Definition
types.h:86
EF_QueuedEffect::params
Vec3 params
Definition
types.h:88
EffectDataTable
The effect data table named by an EF_DAT_Entry, as stored in its archive.
Definition
types.h:102
EffectDataTable::DAT_EXTENT
int *cmd_bank DAT_EXTENT
The particle command and texture banks: words, and offsets into themselves that psInitDataBankLocate ...
Definition
types.h:106
HSD_GObj
Definition
gobj.h:16
HSD_JObj
Definition
jobj.h:106
StaticModelDesc
Model with a single animation or no animation.
Definition
types.h:11
forward.h
src
melee
ef
types.h
Generated by
1.17.0