From c30010370e28cf20b4788928d30903e0be49b80b Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Thu, 1 Jun 2017 00:26:25 +0200 Subject: [PATCH] - Fix voxels not being rendered when the replaced sprite texture doesn't exist --- src/swrenderer/scene/r_opaque_pass.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/swrenderer/scene/r_opaque_pass.cpp b/src/swrenderer/scene/r_opaque_pass.cpp index 9bdbd9aea..1838122d0 100644 --- a/src/swrenderer/scene/r_opaque_pass.cpp +++ b/src/swrenderer/scene/r_opaque_pass.cpp @@ -1008,17 +1008,22 @@ namespace swrenderer bool flipX; FTextureID tex = sprdef->GetSpriteFrame(thing->frame, -1, sprangle, &flipX, !!(thing->flags7 & MF7_SPRITEFLIP)); - if (!tex.isValid()) return false; - - if (flipX) + if (tex.isValid()) { - sprite.renderflags ^= RF_XFLIP; + if (flipX) + { + sprite.renderflags ^= RF_XFLIP; + } + sprite.tex = TexMan[tex]; // Do not animate the rotation } - sprite.tex = TexMan[tex]; // Do not animate the rotation + if (r_drawvoxels) { sprite.voxel = SpriteFrames[sprdef->spriteframes + thing->frame].Voxel; } + + if (sprite.voxel == nullptr && !tex.isValid()) + return false; } if (sprite.voxel == nullptr && (sprite.tex == nullptr || sprite.tex->UseType == FTexture::TEX_Null))