mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-03-02 01:11:19 +00:00
Update texturecache user when reallocating
# Conflicts: # src/r_textures.c
This commit is contained in:
parent
9fe2184c08
commit
cd7e125863
1 changed files with 11 additions and 1 deletions
|
|
@ -1056,10 +1056,20 @@ static void R_AllocateTextures(INT32 add)
|
|||
// Create brightmap texture table.
|
||||
Z_Realloc(texturebrightmaps, (newtextures + 1) * sizeof(*texturebrightmaps), PU_STATIC, &texturebrightmaps);
|
||||
|
||||
for (i = numtextures; i < newtextures; ++i)
|
||||
for (i = 0; i < numtextures; ++i)
|
||||
{
|
||||
// R_FlushTextureCache relies on the user for
|
||||
// Z_Free, texturecache has been reallocated so the
|
||||
// user is now garbage memory.
|
||||
Z_SetUser(texturecache[i],
|
||||
(void**)&texturecache[i]);
|
||||
}
|
||||
|
||||
while (i < newtextures)
|
||||
{
|
||||
texturetranslation[i] = i;
|
||||
texturebrightmaps[i] = 0;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue