diff -r 5806f8f614b7 -r b78d7959540a hedgewars/uLandTexture.pas --- a/hedgewars/uLandTexture.pas Fri Jul 02 21:20:38 2010 -0400 +++ b/hedgewars/uLandTexture.pas Sat Jul 03 04:09:27 2010 +0200 @@ -26,7 +26,6 @@ procedure freeModule; procedure UpdateLandTexture(X, Width, Y, Height: LongInt); procedure DrawLand(dX, dY: LongInt); -procedure FreeLand; implementation uses uMisc, uLand, uStore, uConsts, GLunit; @@ -38,10 +37,12 @@ shouldUpdate: boolean; tex: PTexture; end; + var LandTextures: array of array of TLandRecord; tmpPixels: array [0..TEXSIZE - 1, 0..TEXSIZE - 1] of LongWord; -LANDTEXARW: LongWord; + LANDTEXARW: LongWord; LANDTEXARH: LongWord; + function Pixels(x, y: Longword): Pointer; var ty: Longword; begin @@ -119,21 +120,6 @@ end; -procedure FreeLand; -var x, y: LongInt; -begin - for x:= 0 to LANDTEXARW -1 do - for y:= 0 to LANDTEXARH - 1 do - with LandTextures[x, y] do - begin - FreeTexture(tex); - tex:= nil; - end; - if LandBackSurface <> nil then - SDL_FreeSurface(LandBackSurface); - LandBackSurface:= nil; -end; - procedure initModule; begin if (cReducedQuality and rqBlurryLand) = 0 then @@ -151,7 +137,18 @@ end; procedure freeModule; +var x, y: LongInt; begin + for x:= 0 to LANDTEXARW -1 do + for y:= 0 to LANDTEXARH - 1 do + with LandTextures[x, y] do + begin + FreeTexture(tex); + tex:= nil; + end; + if LandBackSurface <> nil then + SDL_FreeSurface(LandBackSurface); + LandBackSurface:= nil; LandTextures:= nil; end; end.