hedgewars/uLandTexture.pas
changeset 3615 b78d7959540a
parent 3612 b50215a8a43d
child 3666 f9c8fc74ac93
--- 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.