hedgewars/uLand.pas
changeset 7293 468cf6d561e5
parent 7170 84ac6c6d2d8e
child 7477 26706bf32ecf
equal deleted inserted replaced
7290:390d76b29ed0 7293:468cf6d561e5
   432         p:= tmpsurf^.pixels;
   432         p:= tmpsurf^.pixels;
   433         for y:= 0 to Pred(tmpsurf^.h) do
   433         for y:= 0 to Pred(tmpsurf^.h) do
   434         begin
   434         begin
   435             for x:= 0 to Pred(tmpsurf^.w) do
   435             for x:= 0 to Pred(tmpsurf^.w) do
   436             begin
   436             begin
   437                 if ((AMask and p^[x]) = 0) then
   437                 // this an if instead of masking colours to avoid confusing map creators
       
   438                 if ((AMask and p^[x]) = 0) then 
   438                     Land[cpY + y, cpX + x]:= 0
   439                     Land[cpY + y, cpX + x]:= 0
   439                 else if p^[x] = $FFFFFFFF then
   440                 else if p^[x] = $FFFFFFFF then                  // white
   440                     Land[cpY + y, cpX + x]:= lfObject
   441                     Land[cpY + y, cpX + x]:= lfObject
   441                 else if p^[x] = (AMask or RMask) then
   442                 else if p^[x] = AMask then                      // black
   442                     Land[cpY + y, cpX + x]:= lfIndestructible
       
   443                 else if p^[x] = AMask then
       
   444                     begin
   443                     begin
   445                     Land[cpY + y, cpX + x]:= lfBasic;
   444                     Land[cpY + y, cpX + x]:= lfBasic;
   446                     disableLandBack:= false
   445                     disableLandBack:= false
   447                     end
   446                     end
   448                 else if p^[x] = (AMask or BMask) then
   447                 else if p^[x] = (AMask or RMask) then           // red
       
   448                     Land[cpY + y, cpX + x]:= lfIndestructible
       
   449                 else if p^[x] = (AMask or BMask) then           // blue
   449                     Land[cpY + y, cpX + x]:= lfObject or lfIce
   450                     Land[cpY + y, cpX + x]:= lfObject or lfIce
       
   451                 else if p^[x] = (AMask or GMask) then           // green
       
   452                     Land[cpY + y, cpX + x]:= lfObject or lfBouncy
   450             end;
   453             end;
   451             p:= @(p^[tmpsurf^.pitch div 4]);
   454             p:= @(p^[tmpsurf^.pitch div 4]);
   452         end;
   455         end;
   453 
   456 
   454     if SDL_MustLock(tmpsurf) then
   457     if SDL_MustLock(tmpsurf) then