mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-24 00:02:43 +02:00
37 lines
543 B
C
37 lines
543 B
C
#include <ultra64.h>
|
|
#include "constants.h"
|
|
#include "game/acosasin.h"
|
|
#include "bss.h"
|
|
#include "data.h"
|
|
#include "types.h"
|
|
|
|
f32 acosf(f32 value)
|
|
{
|
|
s16 intval;
|
|
|
|
if (value >= 1) {
|
|
intval = 32767;
|
|
} else if (value <= -1) {
|
|
intval = -32767;
|
|
} else {
|
|
intval = value * 32767.0f;
|
|
}
|
|
|
|
return (acos(intval) * M_PI) / 65535.0f;
|
|
}
|
|
|
|
f32 asinf(f32 value)
|
|
{
|
|
s16 intval;
|
|
|
|
if (value >= 1) {
|
|
intval = 32767;
|
|
} else if (value <= -1) {
|
|
intval = -32767;
|
|
} else {
|
|
intval = (value * 32767.0f);
|
|
}
|
|
|
|
return (asin(intval) * M_PI) / 65535.0f;
|
|
}
|