equal
deleted
inserted
replaced
608 |
608 |
609 p:= Surface^.pixels; |
609 p:= Surface^.pixels; |
610 for y:= 0 to LAND_HEIGHT - 1 do |
610 for y:= 0 to LAND_HEIGHT - 1 do |
611 begin |
611 begin |
612 for x:= 0 to LAND_WIDTH - 1 do |
612 for x:= 0 to LAND_WIDTH - 1 do |
613 if Land[y, x] <> 0 then LandPixels[y, x]:= p^[x] or $FF000000; |
613 if Land[y, x] <> 0 then LandPixels[y, x]:= p^[x] or AMask; |
614 |
614 |
615 p:= @(p^[Surface^.pitch div 4]); |
615 p:= @(p^[Surface^.pitch div 4]); |
616 end; |
616 end; |
617 |
617 |
618 if SDL_MustLock(Surface) then |
618 if SDL_MustLock(Surface) then |
684 p:= tmpsurf^.pixels; |
684 p:= tmpsurf^.pixels; |
685 for y:= 0 to Pred(tmpsurf^.h) do |
685 for y:= 0 to Pred(tmpsurf^.h) do |
686 begin |
686 begin |
687 for x:= 0 to Pred(tmpsurf^.w) do |
687 for x:= 0 to Pred(tmpsurf^.w) do |
688 begin |
688 begin |
689 if (($FF000000 and p^[x]) = 0) then // Tiy was having trouble generating transparent black |
689 if ((AMask and p^[x]) = 0) then // Tiy was having trouble generating transparent black |
690 Land[cpY + y, cpX + x]:= 0 |
690 Land[cpY + y, cpX + x]:= 0 |
691 else if p^[x] = $FF0000FF then |
691 else if p^[x] = (AMask or RMask) then |
692 Land[cpY + y, cpX + x]:= COLOR_INDESTRUCTIBLE |
692 Land[cpY + y, cpX + x]:= COLOR_INDESTRUCTIBLE |
693 else if p^[x] = $FFFFFFFF then |
693 else if p^[x] = (AMask or RMask or GMask or BMask) then |
694 Land[cpY + y, cpX + x]:= COLOR_LAND; |
694 Land[cpY + y, cpX + x]:= COLOR_LAND; |
695 |
695 |
696 end; |
696 end; |
697 p:= @(p^[tmpsurf^.pitch div 4]); |
697 p:= @(p^[tmpsurf^.pitch div 4]); |
698 end; |
698 end; |
786 for y:= topY to LAND_HEIGHT - 1 do |
786 for y:= topY to LAND_HEIGHT - 1 do |
787 begin |
787 begin |
788 Land[y, leftX + w]:= COLOR_INDESTRUCTIBLE; |
788 Land[y, leftX + w]:= COLOR_INDESTRUCTIBLE; |
789 Land[y, rightX - w]:= COLOR_INDESTRUCTIBLE; |
789 Land[y, rightX - w]:= COLOR_INDESTRUCTIBLE; |
790 if (y + w) mod 32 < 16 then |
790 if (y + w) mod 32 < 16 then |
791 c:= $FF000000 |
791 c:= AMask |
792 else |
792 else |
793 c:= $FF00FFFF; |
793 c:= AMask or RMask or GMask; |
794 LandPixels[y, leftX + w]:= c; |
794 LandPixels[y, leftX + w]:= c; |
795 LandPixels[y, rightX - w]:= c; |
795 LandPixels[y, rightX - w]:= c; |
796 end; |
796 end; |
797 |
797 |
798 for x:= leftX to rightX do |
798 for x:= leftX to rightX do |
799 begin |
799 begin |
800 Land[topY + w, x]:= COLOR_INDESTRUCTIBLE; |
800 Land[topY + w, x]:= COLOR_INDESTRUCTIBLE; |
801 if (x + w) mod 32 < 16 then |
801 if (x + w) mod 32 < 16 then |
802 c:= $FF000000 |
802 c:= AMask |
803 else |
803 else |
804 c:= $FF00FFFF; |
804 c:= AMask or RMask or GMask; |
805 LandPixels[topY + w, x]:= c; |
805 LandPixels[topY + w, x]:= c; |
806 end; |
806 end; |
807 end; |
807 end; |
808 end; |
808 end; |
809 |
809 |