From 00630f728fcc0c8bd11136f4423ec48246503f42 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 18 Oct 2019 22:25:47 +0200 Subject: [PATCH] - fixed voxel rendering. Still need to move the voxel textures into the texture manager but at least they render properly again. --- source/build/include/mdsprite.h | 1 + source/build/src/voxmodel.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/source/build/include/mdsprite.h b/source/build/include/mdsprite.h index 1fb347cd3..b85449204 100644 --- a/source/build/include/mdsprite.h +++ b/source/build/include/mdsprite.h @@ -189,6 +189,7 @@ struct voxmodel_t : public mdmodel_t vec3_t siz; vec3f_t piv; int32_t is8bit; + FHardwareTexture* texid[256] = { 0 }; }; diff --git a/source/build/src/voxmodel.cpp b/source/build/src/voxmodel.cpp index d8bfc6b4a..f4bd4efff 100644 --- a/source/build/src/voxmodel.cpp +++ b/source/build/src/voxmodel.cpp @@ -46,9 +46,9 @@ FHardwareTexture *gloadtex(const int32_t *picbuf, int32_t xsiz, int32_t ysiz, in { for (bssize_t i=xsiz*ysiz-1; i>=0; i--) { - pic2[i].b = pic[i].r; + pic2[i].r = pic[i].r; pic2[i].g = pic[i].g; - pic2[i].r = pic[i].b; + pic2[i].b = pic[i].b; pic2[i].a = 255; } } @@ -61,9 +61,9 @@ FHardwareTexture *gloadtex(const int32_t *picbuf, int32_t xsiz, int32_t ysiz, in { const int32_t ii = palookup[dapal][pic[i].a]; - pic2[i].r = curpalette[ii].b; + pic2[i].r = curpalette[ii].r; pic2[i].g = curpalette[ii].g; - pic2[i].b = curpalette[ii].r; + pic2[i].b = curpalette[ii].b; pic2[i].a = 255; } } @@ -1128,7 +1128,7 @@ int32_t polymost_voxdraw(voxmodel_t *m, tspriteptr_t const tspr) int prevClamp = GLInterface.GetClamp(); GLInterface.SetClamp(0); -#if 0 +#if 1 if (!m->texid[globalpal]) m->texid[globalpal] = gloadtex(m->mytex, m->mytexx, m->mytexy, m->is8bit, globalpal);