module system.cleanup; import variables; import system.debugwriteln; import raylib; import core.sys.posix.sys.mman; nothrow void resetAllScriptValues() { debugWriteln("cleaning all values!"); selectedChoice = 0; debugWriteln("unloading animations"); for (int i = 0; i < framesUI.length; i++) { if (framesUI[i].id != 0) UnloadTexture(framesUI[i]); } debugWriteln("unloading characters"); for (int i = 0; i < characterTextures.length; i++) { characterTextures[i].drawTexture = false; if (characterTextures[i].texture.id != 0) UnloadTexture(characterTextures[i].texture); } debugWriteln("unloading backgrounds"); for (int i = 0; i < backgroundTextures.length; i++) { backgroundTextures[i].drawTexture = false; if (backgroundTextures[i].texture.id != 0) UnloadTexture(backgroundTextures[i].texture); } debugWriteln("resetting characterTextures and backgroundTextures"); characterTextures = []; backgroundTextures = []; textures = []; shaders = []; }