Further matches + bit of labelling (#228)

* match func_80058D5C

* minor cosmetic tweak

* what is to crush the spirit of somebody but to discover more unions

* dont mind me just switching computers

* remove a tempstruct

* temp thing

* match func_80054110

* Delete func_80054110.s

* racer.c cleanup

* Update math_util.h

* Update racer.c

* added CLAMP and WRAP macros

* Update math_util.h

* match func_80055A84

* he

* match func_80057A40

* we do a little labelling

* match update_camera_loop

* match update_camera_hovercraft

* Update structs.h

* pain.

* Update README.md

* Update racer.c

* like this?
This commit is contained in:
Fazana
2022-05-20 15:37:55 -04:00
committed by GitHub
parent 3898b4b04b
commit 519ff3c09c
17 changed files with 1458 additions and 2587 deletions
+21 -3
View File
@@ -4,8 +4,26 @@
#include "types.h"
#include "structs.h"
extern s16 arctan2_f(f32 y, f32 x);
extern f32 sine_s(s16 angle);
extern f32 cosine_s(s16 angle);
/**
* Keeps the value within the range.
*/
#define CLAMP(x, low, high) { \
if ((x) > (high)) (x) = (high); \
if ((x) < (low)) (x) = (low); \
}
/**
* Allows an arbitrary range the number can wrap around.
* Often used for angles, to keep them within s16 bounds while stored in an s32.
*/
#define WRAP(x, low, high) { \
if ((x) > (high)) (x) -= ((high) * 2) - 1; \
if ((x) < (low)) (x) += ((high) * 2) - 1; \
}
s16 arctan2_f(f32 y, f32 x);
f32 sine_s(s16 angle);
f32 cosine_s(s16 angle);
void func_80031130(s32, f32*, f32*, s32);
s32 func_80031600(f32*, f32*, s32*, s8*, s32, s32*);
#endif // MATH_UTIL_H