hedgewars/uLand.pas
branchwebgl
changeset 9127 e350500c4edb
parent 8444 75db7bb8dce8
parent 9080 9b42757d7e71
child 9521 8054d9d775fd
--- a/hedgewars/uLand.pas	Thu Apr 04 14:37:19 2013 +0200
+++ b/hedgewars/uLand.pas	Tue Jun 04 22:28:12 2013 +0200
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2013 Andrey Korotaev <unC0Rr@gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -484,28 +484,11 @@
 
         p:= tmpsurf^.pixels;
         for y:= 0 to Pred(tmpsurf^.h) do
-        begin
+            begin
             for x:= 0 to Pred(tmpsurf^.w) do
-            begin
-                // this an if instead of masking colours to avoid confusing map creators
-                if ((AMask and p^[x]) = 0) then
-                    Land[cpY + y, cpX + x]:= 0
-                else if p^[x] = $FFFFFFFF then                  // white
-                    Land[cpY + y, cpX + x]:= lfObject
-                else if p^[x] = AMask then                      // black
-                    begin
-                    Land[cpY + y, cpX + x]:= lfBasic;
-                    disableLandBack:= false
-                    end
-                else if p^[x] = (AMask or RMask) then           // red
-                    Land[cpY + y, cpX + x]:= lfIndestructible
-                else if p^[x] = (AMask or BMask) then           // blue
-                    Land[cpY + y, cpX + x]:= lfObject or lfIce
-                else if p^[x] = (AMask or GMask) then           // green
-                    Land[cpY + y, cpX + x]:= lfObject or lfBouncy
+                SetLand(Land[cpY + y, cpX + x], p^[x]);
+            p:= @(p^[tmpsurf^.pitch div 4]);
             end;
-            p:= @(p^[tmpsurf^.pitch div 4]);
-        end;
 
     if SDL_MustLock(tmpsurf) then
         SDL_UnlockSurface(tmpsurf);