when the GLENCORE

This commit is contained in:
Alug committed 2024-03-28 13:21:58 +01:00
1 parent 785881c90e
commit bd83ba8ca9
2 files changed
+9 -7

No files matched your search

+9 -5
View File
@@ -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.
-2
View File
@@ -17,8 +17,6 @@
/// \file
/// \brief 3D render mode functions
#define GLENCORE
#ifndef __HWR_MAIN_H__
#define __HWR_MAIN_H__