hedgewars/uLandObjects.pas
changeset 9768 08799c901a42
parent 9721 1833dadcebf0
child 9778 6166aa84a396
--- a/hedgewars/uLandObjects.pas	Sun Dec 08 13:49:11 2013 -0500
+++ b/hedgewars/uLandObjects.pas	Sun Dec 08 16:04:40 2013 -0500
@@ -26,7 +26,7 @@
 procedure FreeLandObjects();
 procedure LoadThemeConfig;
 procedure BlitImageAndGenerateCollisionInfo(cpX, cpY, Width: Longword; Image: PSDL_Surface); inline;
-procedure BlitImageAndGenerateCollisionInfo(cpX, cpY, Width: Longword; Image: PSDL_Surface; extraFlags: Word);
+procedure BlitImageAndGenerateCollisionInfo(cpX, cpY, Width: Longword; Image: PSDL_Surface; LandFlags: Word);
 procedure BlitImageUsingMask(cpX, cpY: Longword;  Image, Mask: PSDL_Surface);
 procedure AddOnLandObjects(Surface: PSDL_Surface);
 procedure SetLand(var LandWord: Word; Pixel: LongWord); inline;
@@ -95,7 +95,7 @@
     BlitImageAndGenerateCollisionInfo(cpX, cpY, Width, Image, 0);
 end;
     
-procedure BlitImageAndGenerateCollisionInfo(cpX, cpY, Width: Longword; Image: PSDL_Surface; extraFlags: Word);
+procedure BlitImageAndGenerateCollisionInfo(cpX, cpY, Width: Longword; Image: PSDL_Surface; LandFlags: Word);
 var p: PLongwordArray;
     x, y: Longword;
     bpp: LongInt;
@@ -128,7 +128,7 @@
                     LandPixels[(cpY + y) div 2, (cpX + x) div 2]:= p^[x];
 
             if (Land[cpY + y, cpX + x] <= lfAllObjMask) and ((p^[x] and AMask) <> 0) then
-                Land[cpY + y, cpX + x]:= lfObject or extraFlags
+                Land[cpY + y, cpX + x]:= lfObject or LandFlags
             end;
     p:= @(p^[Image^.pitch shr 2])
     end;
@@ -277,8 +277,7 @@
     rr.x:= x1;
     while rr.x < x2 do
         begin
-        // I should theme flag this. also snow...
-        if (Theme = 'Snow') or (Theme = 'Christmas') then 
+        if cIce then 
             BlitImageAndGenerateCollisionInfo(rr.x, y, min(x2 - rr.x, tmpsurf^.w), tmpsurf, lfIce)
         else
             BlitImageAndGenerateCollisionInfo(rr.x, y, min(x2 - rr.x, tmpsurf^.w), tmpsurf);
@@ -706,6 +705,10 @@
         cFlattenFlakes:= true
     else if key = 'flatten-clouds' then
         cFlattenClouds:= true
+    else if key = 'ice' then
+        cIce:= true
+    else if key = 'snow' then
+        cSnow:= true
     else if key = 'sd-water-top' then
         begin
         i:= Pos(',', s);