hedgewars/uLandGraphics.pas
changeset 7268 3a61c53346a8
parent 7170 84ac6c6d2d8e
child 7270 93e92e82d5c8
equal deleted inserted replaced
7266:74ad631a72bf 7268:3a61c53346a8
    38 procedure FillRoundInLand(X, Y, Radius: LongInt; Value: Longword);
    38 procedure FillRoundInLand(X, Y, Radius: LongInt; Value: Longword);
    39 procedure ChangeRoundInLand(X, Y, Radius: LongInt; doSet: boolean);
    39 procedure ChangeRoundInLand(X, Y, Radius: LongInt; doSet: boolean);
    40 function  LandBackPixel(x, y: LongInt): LongWord;
    40 function  LandBackPixel(x, y: LongInt): LongWord;
    41 procedure DrawLine(X1, Y1, X2, Y2: LongInt; Color: Longword);
    41 procedure DrawLine(X1, Y1, X2, Y2: LongInt; Color: Longword);
    42 procedure DrawThickLine(X1, Y1, X2, Y2, radius: LongInt; color: Longword);
    42 procedure DrawThickLine(X1, Y1, X2, Y2, radius: LongInt; color: Longword);
       
    43 procedure DumpLandToLog(x, y, r: LongInt);
    43 
    44 
    44 function TryPlaceOnLand(cpX, cpY: LongInt; Obj: TSprite; Frame: LongInt; doPlace: boolean; indestructible: boolean): boolean;
    45 function TryPlaceOnLand(cpX, cpY: LongInt; Obj: TSprite; Frame: LongInt; doPlace: boolean; indestructible: boolean): boolean;
    45 
    46 
    46 implementation
    47 implementation
    47 uses SDLh, uLandTexture, uVariables, uUtils, uDebug;
    48 uses SDLh, uLandTexture, uVariables, uUtils, uDebug;
  1155         end;
  1156         end;
  1156     if (dx = dy) then
  1157     if (dx = dy) then
  1157         DrawLines(x1, y1, x2, y2, dx, dy, color);
  1158         DrawLines(x1, y1, x2, y2, dx, dy, color);
  1158 end;
  1159 end;
  1159 
  1160 
       
  1161 
       
  1162 procedure DumpLandToLog(x, y, r: LongInt);
       
  1163 var xx, yy, dx: LongInt;
       
  1164     s: shortstring;
       
  1165 begin
       
  1166     s[0]:= char(r * 2 + 1);
       
  1167     for yy:= y - r to y + r do
       
  1168         begin
       
  1169         for dx:= 0 to r*2 do
       
  1170             begin
       
  1171             xx:= dx - r + x;
       
  1172             if (xx = x) and (yy = y) then
       
  1173                 s[dx + 1]:= 'X'
       
  1174             else if Land[yy, xx] > 255 then
       
  1175                 s[dx + 1]:= 'O'
       
  1176             else if Land[yy, xx] > 0 then
       
  1177                 s[dx + 1]:= '*'
       
  1178             else
       
  1179                 s[dx + 1]:= '.'
       
  1180             end;
       
  1181         AddFileLog('Land dump: ' + s);
       
  1182         end;
       
  1183 end;
       
  1184 
  1160 end.
  1185 end.