mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-09 11:20:56 +00:00
TINYGL: Changed the way tinyGL textures are disposed.
This commit is contained in:
parent
f0de01af01
commit
2b3fd8501a
@ -54,6 +54,7 @@ GLTexture *alloc_texture(GLContext *c, int h) {
|
|||||||
*ht = t;
|
*ht = t;
|
||||||
|
|
||||||
t->handle = h;
|
t->handle = h;
|
||||||
|
t->disposed = false;
|
||||||
|
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@ -258,7 +259,8 @@ void tglDeleteTextures(int n, const unsigned int *textures) {
|
|||||||
if (t == c->current_texture) {
|
if (t == c->current_texture) {
|
||||||
tglBindTexture(TGL_TEXTURE_2D, 0);
|
tglBindTexture(TGL_TEXTURE_2D, 0);
|
||||||
}
|
}
|
||||||
TinyGL::free_texture(c, textures[i]);
|
t->disposed = true;
|
||||||
|
//TinyGL::free_texture(c, textures[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -138,6 +138,7 @@ struct GLTexture {
|
|||||||
GLImage images[MAX_TEXTURE_LEVELS];
|
GLImage images[MAX_TEXTURE_LEVELS];
|
||||||
int handle;
|
int handle;
|
||||||
struct GLTexture *next, *prev;
|
struct GLTexture *next, *prev;
|
||||||
|
bool disposed;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,6 +10,15 @@ void tglPresentBuffer() {
|
|||||||
}
|
}
|
||||||
c->drawCallsQueue.clear();
|
c->drawCallsQueue.clear();
|
||||||
|
|
||||||
|
TinyGL::GLTexture *t = c->shared_state.texture_hash_table[0];
|
||||||
|
while (t) {
|
||||||
|
int handle = t->handle;
|
||||||
|
if (t->disposed) {
|
||||||
|
TinyGL::free_texture(c, handle);
|
||||||
|
}
|
||||||
|
t = t->next;
|
||||||
|
}
|
||||||
|
|
||||||
Graphics::Internal::tglCleanupImages();
|
Graphics::Internal::tglCleanupImages();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user