diff --git a/src/hardware/hw_cache.c b/src/hardware/hw_cache.c index 855d6340e..0b4dd0fb8 100644 --- a/src/hardware/hw_cache.c +++ b/src/hardware/hw_cache.c @@ -536,7 +536,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!"); } @@ -556,9 +560,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); @@ -666,7 +672,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? @@ -679,7 +685,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. @@ -710,7 +715,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 a1d852cd0..b9893538b 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__