From 9e98e44500ae13a80fe4cc91ae244ac29e84fa8f Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 4 Nov 2018 22:22:18 +0000 Subject: [PATCH] Try to fix some cubemap issues. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5332 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/q1bsp.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/engine/common/q1bsp.c b/engine/common/q1bsp.c index afb429d44..58bbb591a 100644 --- a/engine/common/q1bsp.c +++ b/engine/common/q1bsp.c @@ -2638,19 +2638,15 @@ unsigned int Mod_NearestCubeForSurf(msurface_t *surf, denvmap_t *envmap, size_t VectorCopy(surf->mesh->xyz_array[0], mins); VectorCopy(surf->mesh->xyz_array[0], maxs); for (v = 1; v < surf->mesh->numvertexes; v++) - AddPointToBounds(surf->mesh->xyz_array[0], mins, maxs); + AddPointToBounds(surf->mesh->xyz_array[v], mins, maxs); VectorAvg(mins, maxs, mid); for (n = 0; n < nenvmap; n++) { VectorSubtract(envmap[n].origin, mid, diff); -#if 1 +#if 0 //axial distance - dist = fabs(diff[0]); - if (dist > fabs(diff[1])) - dist = fabs(diff[1]); - if (dist > fabs(diff[2])) - dist = fabs(diff[2]); + dist = fabs(diff[0]) + fabs(diff[1]) + fabs(diff[2]); #else //radial distance (squared) dist = DotProduct(diff,diff);