mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-02 22:11:22 +00:00
TexMgr_ReloadImages: put in a workaround for the bug reported by Steven where fullscreen toggle on jam3_tronyn.bsp with -heapsize 65536 causes corrupted textures
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1162 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
bc89fbea05
commit
7be39c651e
1 changed files with 7 additions and 0 deletions
|
@ -1389,6 +1389,13 @@ void TexMgr_ReloadImages (void)
|
||||||
{
|
{
|
||||||
gltexture_t *glt;
|
gltexture_t *glt;
|
||||||
|
|
||||||
|
// ericw -- flush the cache before reloading textures. This avoids an obscure
|
||||||
|
// bug where, if the hunk is almost full, an allocation in TexMgr_ReloadImage
|
||||||
|
// triggers cache items to be freed, which calls back into TexMgr to free the
|
||||||
|
// texture. Calling TexMgr_FreeTexture within the loop below causes things to
|
||||||
|
// go haywire. A test case is jam3_tronyn.bsp with -heapsize 65536
|
||||||
|
Cache_Flush();
|
||||||
|
|
||||||
for (glt = active_gltextures; glt; glt = glt->next)
|
for (glt = active_gltextures; glt; glt = glt->next)
|
||||||
{
|
{
|
||||||
glGenTextures(1, &glt->texnum);
|
glGenTextures(1, &glt->texnum);
|
||||||
|
|
Loading…
Reference in a new issue