NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
ef_types.h
1#ifndef NW4R_EF_TYPES_H
2#define NW4R_EF_TYPES_H
3#include <nw4r/types_nw4r.h>
4
5#include <nw4r/math.h>
6
7#define NW4R_EF_MAX_EMITTER 1024
8#define NW4R_EF_MAX_EFFECT 1024
9#define NW4R_EF_MAX_PARTICLEMANAGER 1024
10#define NW4R_EF_MAX_PARTICLE 1024
11
12// Epsilon... but not actually epsilon???
13#define NW4R_EF_EMIT_ANGLE_MIN (1.917476e-4f)
14// 2 * PI... but not actually PI???
15#define NW4R_EF_EMIT_ANGLE_MAX (2 * 3.1414969f)
16
17namespace nw4r {
18namespace ef {
19
20static const ulong NUM_PARAMS = 6;
21
22enum Axis {
23 AXIS_X,
24 AXIS_Y,
25 AXIS_Z,
26
27 AXIS_MAX
28};
29
30enum ColorLayer {
31 COLOR_LAYER_0,
32 COLOR_LAYER_1,
33
34 COLOR_LAYER_MAX
35};
36
37enum ColorIndex {
38 COLOR_IDX_PRI,
39 COLOR_IDX_SEC,
40
41 COLOR_IDX_MAX
42};
43
44enum TextureLayer {
45 TEX_LAYER_1,
46 TEX_LAYER_2,
47 TEX_LAYER_IND,
48
49 TEX_LAYER_MAX
50};
51
52enum EvaluateStatus {
53 NW4R_EF_ES_WAIT,
54 NW4R_EF_ES_DONE,
55 NW4R_EF_ES_STOP,
56 NW4R_EF_ES_SKIP,
57};
58
59typedef ulong ForEachParam;
60typedef void (*ForEachFunc)(void* pObject, ForEachParam param);
61
62inline u8 ConvertF32RadToU8(f32 rad) {
63 rad = math::FCeil(rad / NW4R_MATH_PI * 128.0f - 0.5f);
64 return static_cast<int>(rad) % 256;
65}
66
67} // namespace ef
68} // namespace nw4r
69
70#endif