From 3964d4e1880d92d256eee928f45a1353813ac091 Mon Sep 17 00:00:00 2001 From: Indev Date: Sun, 5 Oct 2025 21:12:46 +0300 Subject: [PATCH] Always initialize all column offsets inside multi-patch textures --- src/r_data.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/r_data.c b/src/r_data.c index ec866b79e..ab704675c 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -445,6 +445,12 @@ UINT8 *R_GenerateTexture(size_t texnum) // texture data after the lookup table blocktex = block + (texture->width*4); + for (x = 0; x < texture->width; ++x) + { + // generate column ofset lookup + *(UINT32 *)&colofs[x<<2] = LONG((x * texture->height) + (texture->width*4)); + } + // Composite the columns together. for (i = 0, patch = texture->patches; i < texture->patchcount; i++, patch++) { @@ -481,8 +487,6 @@ UINT8 *R_GenerateTexture(size_t texnum) { patchcol = (column_t *)((UINT8 *)realpatch + LONG(realpatch->columnofs[x-x1])); - // generate column ofset lookup - *(UINT32 *)&colofs[x<<2] = LONG((x * texture->height) + (texture->width*4)); R_DrawColumnInCache(patchcol, block + LONG(*(UINT32 *)&colofs[x<<2]), patch, texture->height); } }