From 0bef27cdf93405ea319915261710bdc3b7ea3550 Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 15 Apr 2025 19:14:20 +0200 Subject: [PATCH] fix models lel --- src/hardware/hw_md2.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index d74486ac4..a3413f90f 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -368,7 +368,6 @@ static void md2_loadTexture(md2_t *model) { patch_t *patch; GLPatch_t *glPatch = NULL; - const char *filename = model->filename; if (model->glpatch) @@ -1324,10 +1323,15 @@ void HWR_DrawMD2(gl_vissprite_t *spr) || ((!hwrBlendPatch->mipmap->format || !hwrBlendPatch->mipmap->downloaded) && !hwrPatch->notfound))) md2_loadBlendTexture(md2); + // Load it again, because it isn't being loaded into blendgpatch after md2_loadblendtexture... + blendgpatch = md2->blendglpatch; + if (blendgpatch) + hwrBlendPatch = ((GLPatch_t *)blendgpatch->hardware); + if (gpatch && hwrPatch && hwrPatch->mipmap->format) // else if meant that if a texture couldn't be loaded, it would just end up using something else's texture { if ((skincolors_t)spr->mobj->color != SKINCOLOR_NONE && - md2->blendglpatch && (hwrBlendPatch->mipmap->format + blendgpatch && (hwrBlendPatch->mipmap->format && gpatch->width == (blendgpatch->width && gpatch->height == (blendgpatch->height)))) { INT32 tcskinnum = TC_DEFAULT; @@ -1353,6 +1357,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr) } else tcskinnum = TC_DEFAULT; } + HWR_GetBlendedTexture(gpatch, blendgpatch, tcskinnum, spr->colormap, (skincolors_t)spr->mobj->color); } else