From 1e524a8240210bc385106d61e34b2c29e58ca656 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 28 Mar 2024 13:21:58 +0100 Subject: [PATCH] when the GLENCORE --- src/hardware/hw_cache.c | 14 +++++++++----- src/hardware/hw_main.h | 2 -- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/hardware/hw_cache.c b/src/hardware/hw_cache.c index 888a8414e..c506b64e8 100644 --- a/src/hardware/hw_cache.c +++ b/src/hardware/hw_cache.c @@ -535,7 +535,11 @@ void HWR_LoadTextures(size_t pnumtextures) HWR_FreeTextureCache(); gr_numtextures = pnumtextures; +#ifdef GLENCORE gr_textures = calloc(pnumtextures, sizeof (*gr_textures)*2); // *2 - 1 for encore-remapped texture and another for noencore texture (unused when not in encore) +#else + gr_textures = calloc(pnumtextures, sizeof (*gr_textures)); +#endif if (gr_textures == NULL) I_Error("HWR_LoadTextures: ran out of memory for OpenGL textures. Sad!"); } @@ -555,9 +559,11 @@ GLMapTexture_t *HWR_GetTexture(INT32 tex, boolean noencore) tex = 0; #endif } - +#ifdef GLENCORE grtex = &gr_textures[tex*2 + (encoremap && !noencore ? 0 : 1)]; - +#else + grtex = &gr_textures[tex]; +#endif if (!grtex->mipmap.data && !grtex->mipmap.downloaded) HWR_GenerateTexture(tex, grtex, noencore); @@ -665,7 +671,7 @@ static void HWR_LoadMappedPatch(GLMipmap_t *grmip, GLPatch_t *gpatch) { patch_t *patch = gpatch->rawpatch; if (!patch) - patch = W_CacheLumpNumPwad(gpatch->wadnum, gpatch->lumpnum, PU_STATIC); + patch = W_CacheLumpNumPwad(gpatch->wadnum, gpatch->lumpnum, PU_STATIC); HWR_MakePatch(patch, gpatch, grmip, true); // You can't free rawpatch for some reason? @@ -678,7 +684,6 @@ static void HWR_LoadMappedPatch(GLMipmap_t *grmip, GLPatch_t *gpatch) // If hardware does not have the texture, then call pfnSetTexture to upload it if (!grmip->downloaded) HWD.pfnSetTexture(grmip); - HWR_SetCurrentTexture(grmip); // The system-memory data can be purged now. @@ -709,7 +714,6 @@ void HWR_GetPatch(GLPatch_t *gpatch) // If hardware does not have the texture, then call pfnSetTexture to upload it if (!gpatch->mipmap->downloaded) HWD.pfnSetTexture(gpatch->mipmap); - HWR_SetCurrentTexture(gpatch->mipmap); // The system-memory patch data can be purged now. diff --git a/src/hardware/hw_main.h b/src/hardware/hw_main.h index 3530c2915..ec5420f2c 100644 --- a/src/hardware/hw_main.h +++ b/src/hardware/hw_main.h @@ -17,8 +17,6 @@ /// \file /// \brief 3D render mode functions -#define GLENCORE - #ifndef __HWR_MAIN_H__ #define __HWR_MAIN_H__