From 38ef55b8698ccfd98f696cc2a1d52155b13c1902 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 29 Dec 2024 15:40:11 +0100 Subject: [PATCH] add a mipmap check here ig --- src/hardware/hw_cache.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/hardware/hw_cache.c b/src/hardware/hw_cache.c index 16b6b3735..ad140c025 100644 --- a/src/hardware/hw_cache.c +++ b/src/hardware/hw_cache.c @@ -74,6 +74,9 @@ static void HWR_DrawColumnInCache(const column_t *patchcol, UINT8 *block, GLMipm (void)patchheight; // This parameter is unused + if (!mipmap) + return; + if (originPatch) // originPatch can be NULL here, unlike in the software version originy = originPatch->originy; @@ -112,11 +115,11 @@ static void HWR_DrawColumnInCache(const column_t *patchcol, UINT8 *block, GLMipm alpha = 0xFF; // Make pixel transparent if chroma keyed - if ((mipmap->flags & TF_CHROMAKEYED) && (texel == HWR_PATCHES_CHROMAKEY_COLORINDEX)) + if ((mipmap && mipmap->flags & TF_CHROMAKEYED) && (texel == HWR_PATCHES_CHROMAKEY_COLORINDEX)) alpha = 0x00; //Hurdler: 25/04/2000: now support colormap in hardware mode - if (mipmap->colormap) + if (mipmap && mipmap->colormap) texel = mipmap->colormap[texel]; // hope compiler will get this switch out of the loops (dreams...)