From: Holger Schemel Date: Mon, 9 Dec 2024 18:32:56 +0000 (+0100) Subject: added function to free all textures X-Git-Tag: 4.4.0.0-test-6~21 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=692708c0d4c35bb0bafa38e2869f2876494b2364;p=rocksndiamonds.git added function to free all textures --- diff --git a/src/init.c b/src/init.c index 1355af88..04d55b8b 100644 --- a/src/init.c +++ b/src/init.c @@ -449,6 +449,11 @@ void InitImageTextures(void) CreateImageTextures(texture_graphics[i]); } +void FreeAllTextures(void) +{ + FreeAllImageTextures(); +} + static int getFontSpecialSuffix(void) { int special = -1; diff --git a/src/init.h b/src/init.h index 9479f0f8..517bf7d3 100644 --- a/src/init.h +++ b/src/init.h @@ -39,6 +39,7 @@ void KeyboardAutoRepeatOffUnlessAutoplay(void); void InitGfxBuffers(void); void InitGadgets(void); void InitImageTextures(void); +void FreeAllTextures(void); boolean anyImagehasColorTemplate(void); void InitColorTemplateImages(void); diff --git a/src/tools.c b/src/tools.c index a20fc51a..1fdc53e9 100644 --- a/src/tools.c +++ b/src/tools.c @@ -11951,7 +11951,7 @@ void ChangeVsyncModeIfNeeded(void) video.fullscreen_enabled = !setup.fullscreen; // when creating new renderer, destroy textures linked to old renderer - FreeAllImageTextures(); // needs old renderer to free the textures + FreeAllTextures(); // needs old renderer to free the textures // re-create screen and renderer (including change of vsync mode) ChangeVideoModeIfNeeded(setup.fullscreen); @@ -12304,7 +12304,7 @@ void ChangeViewportPropertiesIfNeeded(void) { // Debug("tools:viewport", "init_video_buffer"); - FreeAllImageTextures(); // needs old renderer to free the textures + FreeAllTextures(); // needs old renderer to free the textures InitVideoBuffer(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH, setup.fullscreen); InitImageTextures();