SSBM Decomp
Toggle main menu visibility
Loading...
Searching...
No Matches
util.h
Go to the documentation of this file.
1
#ifndef _UTIL_H_
2
#define _UTIL_H_
3
4
#include <
Runtime/platform.h
>
5
6
#include <
dolphin/gx.h
>
7
#include <
dolphin/mtx.h
>
8
#include <
sysdolphin/baselib/mtx.h
>
9
11
void
HSD_MulColor
(
GXColor
* arg0,
GXColor
* arg1,
GXColor
* dest);
12
u32
HSD_GetNbBits
(
u32
arg0);
13
s32
HSD_Index2PosNrmMtx
(
u32
arg0);
14
16
extern
Mtx
HSD_identityMtx
;
17
18
#define FLT_MIN 1.17549435e-38f
19
20
#define DEG_TO_RAD 0.017453292519943295
21
#define RAD_TO_DEG 57.29577951308232
22
23
static
inline
int
vec_normalize_check
(
Vec3
* src,
Vec3
* dst)
24
{
25
if
(!src || !dst) {
26
return
-1;
27
}
28
if
(
fabsf_bitwise
(src->
x
) <=
FLT_MIN
&&
fabsf_bitwise
(src->
y
) <=
FLT_MIN
&&
29
fabsf_bitwise
(src->
z
) <=
FLT_MIN
)
30
{
31
return
-1;
32
}
33
PSVECNormalize
(src, dst);
34
return
0;
35
}
36
37
static
inline
f32
atan2f_check
(
s8
y,
s8
x)
38
{
39
if
(
fabs
(x) == 0.0) {
40
return
y >= 0 ? 1.5707963267948966 : -1.5707963267948966;
41
}
else
{
42
return
atan2f
(y, x);
43
}
44
}
45
46
#endif
// _UTIL_H_
mtx.h
PSVECNormalize
void PSVECNormalize(Vec *vec1, Vec *dst)
Vec3
struct Vec Vec3
Mtx
f32 Mtx[3][4]
Definition
mtx.h:50
s8
signed char s8
Definition
types.h:4
u32
unsigned long u32
Definition
types.h:9
f32
float f32
Definition
types.h:13
s32
signed long s32
Definition
types.h:8
gx.h
atan2f
float atan2f(float y, float x)
Definition
lbtrigf.c:22
platform.h
fabs
double fabs(double)
mtx.h
fabsf_bitwise
static f32 fabsf_bitwise(f32 v)
Definition
mtx.h:38
GXColor
Definition
GXStruct.h:29
Vec::z
f32 z
Definition
mtx.h:15
Vec::x
f32 x
Definition
mtx.h:15
Vec::y
f32 y
Definition
mtx.h:15
HSD_identityMtx
Mtx HSD_identityMtx
variables
Definition
util.c:6
HSD_Index2PosNrmMtx
s32 HSD_Index2PosNrmMtx(u32 arg0)
Definition
util.c:31
vec_normalize_check
static int vec_normalize_check(Vec3 *src, Vec3 *dst)
Definition
util.h:23
HSD_MulColor
void HSD_MulColor(GXColor *arg0, GXColor *arg1, GXColor *dest)
functions
Definition
util.c:10
FLT_MIN
#define FLT_MIN
Definition
util.h:18
atan2f_check
static f32 atan2f_check(s8 y, s8 x)
Definition
util.h:37
HSD_GetNbBits
u32 HSD_GetNbBits(u32 arg0)
Definition
util.c:18
src
sysdolphin
baselib
util.h
Generated by
1.17.0