clear texture cache instead of refreshing

This commit is contained in:
Dominicentek 2023-12-16 12:32:40 +01:00
parent b7687b5ff3
commit 250645ab48
4 changed files with 7 additions and 2 deletions

View file

@ -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

View file

@ -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;

View file

@ -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();
}

View file

@ -282,7 +282,7 @@ void parse_custom_level(char* data) {
custom_level_face();
}
}
gfx_precache_textures();
gfx_clear_texture_cache();
custom_level_finish();
}