From 41cb3e932a5d2a71927eeba81b8f22be7f09c11f Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 16 Apr 2025 15:58:30 +0200 Subject: [PATCH] readd freeing those dont want kart to use like 4gbs of memory for no reason lel --- src/r_data.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/r_data.c b/src/r_data.c index c91910a32..015cc626f 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -323,7 +323,7 @@ static UINT8 *R_GenerateTexture(size_t texnum) { boolean holey = false; patch = texture->patches; - pdata = W_CacheLumpNumPwad(patch->wad, patch->lump, PU_CACHE); + pdata = W_CacheLumpNumPwad(patch->wad, patch->lump, PU_LEVEL); realpatch = (softwarepatch_t *)pdata; // Check the patch for holes. @@ -359,7 +359,7 @@ static UINT8 *R_GenerateTexture(size_t texnum) { texture->holes = true; blocksize = W_LumpLengthPwad(patch->wad, patch->lump); - block = Z_Calloc(blocksize, PU_STATIC, // will change tag at end of this function + block = Z_Calloc(blocksize, PU_LEVEL, // will change tag at end of this function &texturecache[texnum]); M_Memcpy(block, realpatch, blocksize); texturememory += blocksize; @@ -380,7 +380,7 @@ static UINT8 *R_GenerateTexture(size_t texnum) texture->holes = false; blocksize = (texture->width * 4) + (texture->width * texture->height); texturememory += blocksize; - block = Z_Malloc(blocksize+1, PU_STATIC, &texturecache[texnum]); + block = Z_Malloc(blocksize+1, PU_LEVEL, &texturecache[texnum]); memset(block, TRANSPARENTPIXEL, blocksize+1); // Transparency hack @@ -394,7 +394,7 @@ static UINT8 *R_GenerateTexture(size_t texnum) // Composite the columns together. for (i = 0, patch = texture->patches; i < texture->patchcount; i++, patch++) { - pdata = W_CacheLumpNumPwad(patch->wad, patch->lump, PU_CACHE); + pdata = W_CacheLumpNumPwad(patch->wad, patch->lump, PU_LEVEL); realpatch = (softwarepatch_t *)pdata; // Well, it's not valid... @@ -436,8 +436,6 @@ static UINT8 *R_GenerateTexture(size_t texnum) } done: - // Now that the texture has been built in column cache, it is purgable from zone memory. - Z_ChangeTag(block, PU_CACHE); return blocktex; } @@ -487,7 +485,7 @@ UINT8 *R_GetColumn(fixed_t tex, INT32 col) // UINT8 *R_GetFlat(lumpnum_t flatlumpnum) { - return W_CacheLumpNum(flatlumpnum, PU_CACHE); + return W_CacheLumpNum(flatlumpnum, PU_LEVEL); } //