From 84f3102ad08788e4142c9020e0fabb225ea5abcf Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 1 Dec 2016 22:37:33 +0000 Subject: [PATCH] Added FLIPX support for single patch textures with holes This completes FLIPX/FLIPY support for all textures --- src/r_data.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/r_data.c b/src/r_data.c index 3e28b8ca2..350bd4175 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -289,6 +289,14 @@ static UINT8 *R_GenerateTexture(size_t texnum) colofs = (UINT32 *)(void *)(block + 8); texturecolumnofs[texnum] = colofs; blocktex = block; + if (patch->flip & 1) // flip the patch horizontally + { + UINT32 *realcolofs = (UINT32 *)realpatch->columnofs; + for (x = 0; x < texture->width; x++) + colofs[x] = realcolofs[texture->width-1-x]; // swap with the offset of the other side of the texture + } + // we can't as easily flip the patch vertically sadly though, + // we have wait until the texture itself is drawn to do that for (x = 0; x < texture->width; x++) colofs[x] = LONG(LONG(colofs[x]) + 3); goto done;