hedgewars/uLandObjects.pas
changeset 3053 55a7e3a896ef
parent 2948 3f21a9dc93d0
child 3057 e6e4c109ceb8
--- a/hedgewars/uLandObjects.pas	Tue Mar 23 16:53:45 2010 +0000
+++ b/hedgewars/uLandObjects.pas	Tue Mar 23 19:06:43 2010 +0000
@@ -23,6 +23,7 @@
 uses SDLh;
 
 procedure AddObjects();
+procedure FreeLandObjects();
 procedure LoadThemeConfig;
 procedure BlitImageAndGenerateCollisionInfo(cpX, cpY, Width: Longword; Image: PSDL_Surface);
 procedure AddOnLandObjects(Surface: PSDL_Surface);
@@ -526,4 +527,15 @@
 ReadThemeInfo(ThemeObjects, SprayObjects)
 end;
 
+procedure FreeLandObjects();
+var i: Longword;
+begin
+for i:= 0 to Pred(ThemeObjects.Count) do
+    with ThemeObjects.objs[i] do
+        if Surf <> nil then SDL_FreeSurface(Surf);
+for i:= 0 to Pred(SprayObjects.Count) do
+    with SprayObjects.objs[i] do
+        if Surf <> nil then SDL_FreeSurface(Surf);
+end;
+
 end.