diff --git a/quakespasm/Quake/gl_rlight.c b/quakespasm/Quake/gl_rlight.c index e37c988e..86c73b87 100644 --- a/quakespasm/Quake/gl_rlight.c +++ b/quakespasm/Quake/gl_rlight.c @@ -267,8 +267,6 @@ mplane_t *lightplane; vec3_t lightspot; vec3_t lightcolor; //johnfitz -- lit support via lordhavoc -#define DoublePrecisionDotProduct(x,y) ((double)x[0]*y[0]+(double)x[1]*y[1]+(double)x[2]*y[2]) - /* ============= RecursiveLightPoint -- johnfitz -- replaced entire function for lit support via lordhavoc diff --git a/quakespasm/Quake/mathlib.h b/quakespasm/Quake/mathlib.h index a9001314..a607905f 100644 --- a/quakespasm/Quake/mathlib.h +++ b/quakespasm/Quake/mathlib.h @@ -52,6 +52,7 @@ static inline int IS_NAN (float x) { #define Q_rint(x) ((x) > 0 ? (int)((x) + 0.5) : (int)((x) - 0.5)) //johnfitz -- from joequake #define DotProduct(x,y) (x[0]*y[0]+x[1]*y[1]+x[2]*y[2]) +#define DoublePrecisionDotProduct(x,y) ((double)x[0]*y[0]+(double)x[1]*y[1]+(double)x[2]*y[2]) #define VectorSubtract(a,b,c) {c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];} #define VectorAdd(a,b,c) {c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];} #define VectorCopy(a,b) {b[0]=a[0];b[1]=a[1];b[2]=a[2];} diff --git a/quakespasm/Quake/world.c b/quakespasm/Quake/world.c index 6c0e1e5b..552f455d 100644 --- a/quakespasm/Quake/world.c +++ b/quakespasm/Quake/world.c @@ -495,7 +495,7 @@ int SV_HullPointContents (hull_t *hull, int num, vec3_t p) if (plane->type < 3) d = p[plane->type] - plane->dist; else - d = DotProduct (plane->normal, p) - plane->dist; + d = DoublePrecisionDotProduct (plane->normal, p) - plane->dist; if (d < 0) num = node->children[1]; else @@ -606,8 +606,8 @@ qboolean SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec } else { - t1 = DotProduct (plane->normal, p1) - plane->dist; - t2 = DotProduct (plane->normal, p2) - plane->dist; + t1 = DoublePrecisionDotProduct (plane->normal, p1) - plane->dist; + t2 = DoublePrecisionDotProduct (plane->normal, p2) - plane->dist; } #if 1