ref: a54ece93551f44af6fafb49363a1e0ac2e3f0bb2
parent: 87f457bc54dc3686f61b02d9d12c2576caf09a13
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Sat Dec 16 19:14:43 EST 2023
make some of the stuff use floats
--- a/mathlib.c
+++ b/mathlib.c
@@ -78,8 +78,7 @@
void AngleVectors (vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
{
- double angle;
- double sr, sp, sy, cr, cp, cy;
+ float angle, sr, sp, sy, cr, cp, cy;
angle = angles[YAW] * (M_PI*2 / 360.0);
sy = sinf(angle);
@@ -202,8 +201,7 @@
====================
*/
-void FloorDivMod (double numer, double denom, int *quotient,
- int *rem)
+void FloorDivMod (double numer, double denom, int *quotient, int *rem)
{
int q, r;
double x;
--- a/model_bsp.c
+++ b/model_bsp.c
@@ -48,8 +48,8 @@
}
for(i = 0; i < 2; i++){
- bmins[i] = floor(mins[i]/16.0);
- bmaxs[i] = ceil(maxs[i]/16.0);
+ bmins[i] = floorf(mins[i]/16.0);
+ bmaxs[i] = ceilf(maxs[i]/16.0);
s->texturemins[i] = bmins[i] * 16;
s->extents[i] = (bmaxs[i] - bmins[i]) * 16;
--- a/plan9/platform.h
+++ b/plan9/platform.h
@@ -4,11 +4,14 @@
#include <ctype.h>
#define RAND_MAX ((2<<15)-1)
+
#define acosf acos
#define asinf asin
#define atan2f atan2
#define atanf atan
+#define ceilf ceil
#define cosf cos
+#define floorf floor
#define sinf sin
#define sqrtf sqrt
#define tanf tan
--- a/pr_cmds.c
+++ b/pr_cmds.c
@@ -1234,13 +1234,13 @@
static void
PF_floor(pr_t *pr)
{
- G_FLOAT(pr, OFS_RETURN) = floor(G_FLOAT(pr, OFS_PARM0));
+ G_FLOAT(pr, OFS_RETURN) = floorf(G_FLOAT(pr, OFS_PARM0));
}
static void
PF_ceil(pr_t *pr)
{
- G_FLOAT(pr, OFS_RETURN) = ceil(G_FLOAT(pr, OFS_PARM0));
+ G_FLOAT(pr, OFS_RETURN) = ceilf(G_FLOAT(pr, OFS_PARM0));
}
/*