# HG changeset patch # User sheepluva # Date 1441149929 -7200 # Node ID 659427d9fd17af3ade2d3283b46c71eb54ad7029 # Parent b91667fd6f2019c2f4030552fd4ec3b7aa879aaf display circle for custom build dist values, display nothing if no limit. map borders are not taken into account at this point diff -r b91667fd6f20 -r 659427d9fd17 hedgewars/uGearsRender.pas --- a/hedgewars/uGearsRender.pas Wed Sep 02 00:39:35 2015 +0200 +++ b/hedgewars/uGearsRender.pas Wed Sep 02 01:25:29 2015 +0200 @@ -746,32 +746,39 @@ amRubber, amGirder: begin DrawSpriteRotated(sprHandConstruction, hx, hy, sign, aangle); - if WorldEdge = weWrap then + if cBuildMaxDist = cDefaultBuildMaxDist then begin - if hwRound(Gear^.X) < LongInt(leftX) + 256 then - DrawSpriteClipped(sprGirder, - rightX+(ox-leftX)-256, - oy-256, - LongInt(topY)+WorldDy, - LongInt(rightX)+WorldDx, - cWaterLine+WorldDy, - LongInt(leftX)+WorldDx); - if hwRound(Gear^.X) > LongInt(rightX) - 256 then - DrawSpriteClipped(sprGirder, - leftX-(rightX-ox)-256, - oy-256, - LongInt(topY)+WorldDy, - LongInt(rightX)+WorldDx, - cWaterLine+WorldDy, - LongInt(leftX)+WorldDx) + if WorldEdge = weWrap then + begin + if hwRound(Gear^.X) < LongInt(leftX) + 256 then + DrawSpriteClipped(sprGirder, + rightX+(ox-leftX)-256, + oy-256, + LongInt(topY)+WorldDy, + LongInt(rightX)+WorldDx, + cWaterLine+WorldDy, + LongInt(leftX)+WorldDx); + if hwRound(Gear^.X) > LongInt(rightX) - 256 then + DrawSpriteClipped(sprGirder, + leftX-(rightX-ox)-256, + oy-256, + LongInt(topY)+WorldDy, + LongInt(rightX)+WorldDx, + cWaterLine+WorldDy, + LongInt(leftX)+WorldDx) + end; + DrawSpriteClipped(sprGirder, + ox-256, + oy-256, + LongInt(topY)+WorldDy, + LongInt(rightX)+WorldDx, + cWaterLine+WorldDy, + LongInt(leftX)+WorldDx) + end + else if cBuildMaxDist > 0 then + begin + DrawCircle(hx, hy, cBuildMaxDist, 3, $FF, 0, 0, $80); end; - DrawSpriteClipped(sprGirder, - ox-256, - oy-256, - LongInt(topY)+WorldDy, - LongInt(rightX)+WorldDx, - cWaterLine+WorldDy, - LongInt(leftX)+WorldDx) end; amBee: DrawSpriteRotatedF(sprHandBee, hx, hy, (RealTicks div 125) mod 4, sign, aangle); amFlamethrower: DrawSpriteRotatedF(sprHandFlamethrower, hx, hy, (RealTicks div 125) mod 4, sign, aangle);