From dde25820e24e6e243eae96d53a9a19e437bc1c6c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 11 Oct 2016 09:08:31 +0200 Subject: [PATCH 1/2] - fixed winding of voxel polygons. --- src/gl/models/gl_voxels.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gl/models/gl_voxels.cpp b/src/gl/models/gl_voxels.cpp index 288b1a9db6..6e84bd7abf 100644 --- a/src/gl/models/gl_voxels.cpp +++ b/src/gl/models/gl_voxels.cpp @@ -314,12 +314,12 @@ void FVoxelModel::MakeSlabPolys(int x, int y, kvxslab_t *voxptr, FVoxelMap &chec } if (cull & 4) { - AddFace(x, y, z, x+1, y, z, x, y, z+c, x+1, y, z+c, *col, check); + AddFace(x+1, y, z, x, y, z, x+1, y, z+c, x, y, z+c, *col, check); } if (cull & 8) { - AddFace(x+1, y+1, z, x, y+1, z, x+1, y+1, z+c, x, y+1, z+c, *col, check); - } + AddFace(x, y+1, z, x+1, y+1, z, x, y+1, z+c, x+1, y+1, z+c, *col, check); + } z+=c; col+=c; } From 7510ad1635f3c4f26b905d6d10bb95bb7a2c0e88 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Tue, 11 Oct 2016 14:52:47 +0300 Subject: [PATCH 2/2] Fixed missing fake floors in deferred buffer mode wow.wad is now genuine and authentic... --- src/gl/scene/gl_flats.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/gl/scene/gl_flats.cpp b/src/gl/scene/gl_flats.cpp index 394ca16265..c41e7664f9 100644 --- a/src/gl/scene/gl_flats.cpp +++ b/src/gl/scene/gl_flats.cpp @@ -187,21 +187,18 @@ void GLFlat::DrawSubsector(subsector_t * sub) unsigned int vi[4]; vi[0] = 0; - for (unsigned int i = 1; i < sub->numlines-1; i += 2) + for (unsigned int i = 0; i < sub->numlines - 2; i += 2) { - if (i < sub->numlines - 3) + for (unsigned int j = 1; j < 4; j++) { - for (unsigned int j = 1; j < 4; j++) - { - vi[j] = MIN(i + j, sub->numlines - 1); - } - for (unsigned int x = 0; x < 4; x++) - { - vertex_t *vt = sub->firstline[vi[x]].v1; - qd.Set(x, vt->fX(), plane.plane.ZatPoint(vt) + dz, vt->fY(), vt->fX() / 64.f, -vt->fY() / 64.f); - } - qd.Render(GL_TRIANGLE_FAN); + vi[j] = MIN(i + j, sub->numlines - 1); } + for (unsigned int x = 0; x < 4; x++) + { + vertex_t *vt = sub->firstline[vi[x]].v1; + qd.Set(x, vt->fX(), plane.plane.ZatPoint(vt) + dz, vt->fY(), vt->fX() / 64.f, -vt->fY() / 64.f); + } + qd.Render(GL_TRIANGLE_FAN); } }