Files
Diddy-Kong-Racing/include/math_util.h
T
FazanaandGitHub 493bece093 More matches and labels (#259)
* match func_80077268

* Update borders.c

* Update borders.h

* game.c labels

* rename border

* match func_80068BF4 and func_80069484

* Update camera.c

* camera.c labels

* more camera.c documentation

oh god this is gonna be another one of THOSE PR's again isn't it?

* Update camera.c

* destruction

* nonmatching func_80002DF8

* make clean now removes the linker

* Update unknown_003260.c

* match func_800A0EB4

* match render_background

* fix warnings

* style fixes

* label indicator arrows in the UI

* requested changes

* struct renames

* match func_800A7B68

* Update README.md

* match func_800A5A64

* Fix unforgivable typo

sorry im not a fake fan I sware on me nan

* Update README.md
2022-10-24 15:37:47 +01:00

35 lines
900 B
C

#ifndef MATH_UTIL_H
#define MATH_UTIL_H
#include "types.h"
#include "structs.h"
/**
* 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*, f32*, s8* surface, s32, s32*);
void func_80070130(Matrix, s32, f32, f32);
void func_80070638(Matrix, f32, f32, f32);
void func_8006FE04(Matrix*, f32);
void func_8006FE30(Matrix*, f32);
#endif // MATH_UTIL_H