mirror of
https://github.com/Llennpie/Saturn.git
synced 2025-01-22 15:43:05 -05:00
clear texture cache instead of refreshing
This commit is contained in:
parent
b7687b5ff3
commit
250645ab48
4 changed files with 7 additions and 2 deletions
|
@ -571,6 +571,10 @@ static bool texname_to_texformat(const char *name, u8 *fmt, u8 *siz) {
|
|||
|
||||
int preloaded_textures_count;
|
||||
|
||||
void gfx_clear_texture_cache() {
|
||||
memset(&gfx_texture_cache, 0, sizeof(gfx_texture_cache));
|
||||
}
|
||||
|
||||
// calls import_texture() on every texture in the res folder
|
||||
// we can get the format and size from the texture files
|
||||
// and then cache them using gfx_texture_cache_lookup
|
||||
|
|
|
@ -31,6 +31,7 @@ void gfx_start_frame(void);
|
|||
void gfx_run(Gfx *commands);
|
||||
void gfx_end_frame(void);
|
||||
void gfx_precache_textures(void);
|
||||
void gfx_clear_texture_cache(void);
|
||||
void gfx_shutdown(void);
|
||||
|
||||
extern int preloaded_textures_count;
|
||||
|
|
|
@ -51,7 +51,7 @@ void ShowExpressionContextMenu(Expression* expression, int id) {
|
|||
if (expression->CurrentIndex > i || expression->CurrentIndex < i)
|
||||
expression->CurrentIndex = 0;
|
||||
}
|
||||
gfx_precache_textures();
|
||||
gfx_clear_texture_cache();
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
|
||||
|
|
|
@ -282,7 +282,7 @@ void parse_custom_level(char* data) {
|
|||
custom_level_face();
|
||||
}
|
||||
}
|
||||
gfx_precache_textures();
|
||||
gfx_clear_texture_cache();
|
||||
custom_level_finish();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue