From 4ab6af4f75bc1fa1f31dcacf4bd5966f1d829213 Mon Sep 17 00:00:00 2001 From: Spoike Date: Tue, 28 May 2019 08:27:52 +0000 Subject: [PATCH] Bugfix for an addition with the last commit. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5463 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/gl_q2bsp.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/engine/common/gl_q2bsp.c b/engine/common/gl_q2bsp.c index e5545bc30..b4a954afb 100644 --- a/engine/common/gl_q2bsp.c +++ b/engine/common/gl_q2bsp.c @@ -2709,10 +2709,18 @@ static void GL_SizePatchFixed(mesh_t *mesh, int patchwidth, int patchheight, int } // allocate space for mesh - step[0] = 2;//patchwidth>>16; - step[1] = 2;//patchheight>>16; - size[0] = (patch_cp[0] / 2) * step[0] + 1; - size[1] = (patch_cp[1] / 2) * step[1] + 1; + step[0] = patchwidth>>16; + step[1] = patchheight>>16; + if (!step[0] || !step[1]) + { + size[0] = patch_cp[0]; + size[1] = patch_cp[1]; + } + else + { + size[0] = (patch_cp[0] / 2) * step[0] + 1; + size[1] = (patch_cp[1] / 2) * step[1] + 1; + } mesh->numvertexes = size[0] * size[1]; mesh->numindexes = (size[0]-1) * (size[1]-1) * 6; @@ -2881,9 +2889,9 @@ static void GL_CreateMeshForPatchFixed (model_t *mod, mesh_t *mesh, int patchwid step[0] = patchwidth>>16; step[1] = patchheight>>16; if (!step[0] || !step[1]) - { + { //explicit CPs only. size[0] = patch_cp[0]; - size[1] = patch_cp[0]; + size[1] = patch_cp[1]; } else {