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 <stdlib.h>
7
8
#include <
dolphin/gx.h
>
9
#include <
dolphin/mtx.h
>
10
#include <
sysdolphin/baselib/mtx.h
>
11
13
void
HSD_MulColor
(
GXColor
* arg0,
GXColor
* arg1,
GXColor
* dest);
14
u32
HSD_GetNbBits
(
u32
arg0);
15
s32
HSD_Index2PosNrmMtx
(
u32
arg0);
16
18
extern
Mtx
HSD_identityMtx
;
19
20
#define FLT_MIN 1.17549435e-38f
21
22
#define DEG_TO_RAD 0.017453292519943295
23
#define RAD_TO_DEG 57.29577951308232
24
25
static
inline
int
vec_normalize_check
(
Vec3
*
src
,
Vec3
* dst)
26
{
27
if
(!
src
|| !dst) {
28
return
-1;
29
}
30
if
(
fabsf_bitwise
(
src
->x) <=
FLT_MIN
&&
fabsf_bitwise
(
src
->y) <=
FLT_MIN
&&
31
fabsf_bitwise
(
src
->z) <=
FLT_MIN
)
32
{
33
return
-1;
34
}
35
PSVECNormalize
(
src
, dst);
36
return
0;
37
}
38
39
static
inline
f32
atan2f_check
(
s8
y
,
s8
x
)
40
{
41
if
(
abs
(
x
) == 0.0) {
42
return
y
>= 0 ? 1.5707963267948966 : -1.5707963267948966;
43
}
else
{
44
return
atan2f
(
y
,
x
);
45
}
46
}
47
48
#endif
// _UTIL_H_
src
const void * src
Definition
__os.h:108
abs
#define abs(x)
Definition
ftmariospecialhi.c:70
gx.h
atan2f
float atan2f(float y, float x)
Definition
lbtrigf.c:22
mtx.h
PSVECNormalize
void PSVECNormalize(Vec *vec1, Vec *dst)
Vec3
struct Vec Vec3
Mtx
f32 Mtx[3][4]
Definition
mtx.h:50
s32
signed int s32
Definition
types.h:12
u32
unsigned int u32
Definition
types.h:13
s8
signed char s8
Definition
types.h:4
f32
float f32
Definition
types.h:18
platform.h
y
int y
Definition
types.h:1
x
int x
Definition
types.h:0
mtx.h
fabsf_bitwise
static f32 fabsf_bitwise(f32 v)
Definition
mtx.h:38
GXColor
Definition
GXStruct.h:27
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:25
HSD_MulColor
void HSD_MulColor(GXColor *arg0, GXColor *arg1, GXColor *dest)
functions
Definition
util.c:10
FLT_MIN
#define FLT_MIN
Definition
util.h:20
atan2f_check
static f32 atan2f_check(s8 y, s8 x)
Definition
util.h:39
HSD_GetNbBits
u32 HSD_GetNbBits(u32 arg0)
Definition
util.c:18
src
sysdolphin
baselib
util.h
Generated by
1.17.0