From 56e0d05640bb51943497c2e5703b61d0e764b6f2 Mon Sep 17 00:00:00 2001 From: Lephenixnoir Date: Thu, 12 Aug 2021 14:03:03 +0200 Subject: [PATCH] Fix some textures not being rendered, like STARGR2 in E2M3 This occurs if all texture IDs on a particular line are multiples of 256 (like STARGR2 = 256) since the cast to boolean (byte) destroys significant bits. --- cgdoom/r_data.c | 3 +-- cgdoom/r_segs.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cgdoom/r_data.c b/cgdoom/r_data.c index 57141ae..1e356b2 100644 --- a/cgdoom/r_data.c +++ b/cgdoom/r_data.c @@ -375,7 +375,7 @@ const byte* R_GetColumn ( int tex, int col ) /* CGDOOM: To save RAM in WADs bound by limited memory, composite textures can be allowed only up to a certain size. Original CGDOOM limits to 8192 - bytes to that switches can appear, but some other textures fail. */ + bytes so that switches can appear, but some other textures fail. */ #if 0 if(lump <= 0 && texturecompositesize[tex] > 8192) { @@ -586,7 +586,6 @@ void R_InitTextures (void) } - // // R_InitFlats // diff --git a/cgdoom/r_segs.c b/cgdoom/r_segs.c index c227999..333718a 100644 --- a/cgdoom/r_segs.c +++ b/cgdoom/r_segs.c @@ -607,7 +607,7 @@ void R_StoreWallRange ( int start, int stop ) } // calculate rw_offset (only needed for textured lines) - segtextured = (boolean)(midtexture | toptexture | bottomtexture | maskedtexture); + segtextured = (midtexture | toptexture | bottomtexture | maskedtexture) != 0; if (segtextured) {