From: DeaDDooMER Date: Mon, 6 Jun 2022 17:12:05 +0000 (+0300) Subject: gl: free weapon textures X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=6837a957a80cae5f212cc5a1447b2e7dac15c159;p=d2df-sdl.git gl: free weapon textures --- diff --git a/src/game/renders/opengl/r_map.pas b/src/game/renders/opengl/r_map.pas index 60f1ee6..695195d 100644 --- a/src/game/renders/opengl/r_map.pas +++ b/src/game/renders/opengl/r_map.pas @@ -276,8 +276,20 @@ implementation end; procedure r_Map_Free; - var i, j: Integer; d: TDirection; + var i, j, k: Integer; d: TDirection; begin + for i := 1 to WP_LAST do + begin + for j := 0 to W_POS_LAST do + begin + for k := 0 to W_ACT_LAST do + begin + if WeapTextures[i, j, k] <> nil then + WeapTextures[i, j, k].Free; + WeapTextures[i, j, k] := nil; + end; + end; + end; for i := MONSTER_DEMON to MONSTER_MAN do begin for j := 0 to ANIM_LAST do @@ -515,7 +527,7 @@ implementation a := pm.CurrentAnimation; d := pm.Direction; // TODO draw flag - if PlayerModelsArray[pm.id].HaveWeapon and not (pm.CurrentAnimation in [A_DIE1, A_DIE2, A_PAIN]) then + if PlayerModelsArray[pm.id].HaveWeapon and not (a in [A_DIE1, A_DIE2, A_PAIN]) then begin case a of A_SEEUP, A_ATTACKUP: pos := W_POS_UP;