From: DeaDDooMER Date: Mon, 6 Jun 2022 17:15:03 +0000 (+0300) Subject: gl: free player model textures X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=292e2b4e094da60e0e30512697dd275ff6d5de43;p=d2df-sdl.git gl: free player model textures --- diff --git a/src/game/renders/opengl/r_map.pas b/src/game/renders/opengl/r_map.pas index 695195d..063c36b 100644 --- a/src/game/renders/opengl/r_map.pas +++ b/src/game/renders/opengl/r_map.pas @@ -276,7 +276,7 @@ implementation end; procedure r_Map_Free; - var i, j, k: Integer; d: TDirection; + var i, j, k, a: Integer; d: TDirection; begin for i := 1 to WP_LAST do begin @@ -290,6 +290,18 @@ implementation end; end; end; + for d := TDirection.D_LEFT to TDirection.D_RIGHT do + begin + for a := A_STAND to A_LAST do + begin + if Models[i].anim[d, a].base <> nil then + Models[i].anim[d, a].base.Free; + if Models[i].anim[d, a].mask <> nil then + Models[i].anim[d, a].mask.Free; + Models[i].anim[d, a].base := nil; + Models[i].anim[d, a].mask := nil; + end; + end; for i := MONSTER_DEMON to MONSTER_MAN do begin for j := 0 to ANIM_LAST do