461 |
461 |
462 tx:= Max(X - Radius - 1, 0); |
462 tx:= Max(X - Radius - 1, 0); |
463 dx:= Min(X + Radius + 1, LAND_WIDTH) - tx; |
463 dx:= Min(X + Radius + 1, LAND_WIDTH) - tx; |
464 ty:= Max(Y - Radius - 1, 0); |
464 ty:= Max(Y - Radius - 1, 0); |
465 dy:= Min(Y + Radius + 1, LAND_HEIGHT) - ty; |
465 dy:= Min(Y + Radius + 1, LAND_HEIGHT) - ty; |
466 UpdateLandTexture(tx, dx, ty, dy); |
466 UpdateLandTexture(tx, dx, ty, dy, false); |
467 DrawExplosion:= cnt |
467 DrawExplosion:= cnt |
468 end; |
468 end; |
469 |
469 |
470 procedure DrawHLinesExplosions(ar: PRangeArray; Radius: LongInt; y, dY: LongInt; Count: Byte); |
470 procedure DrawHLinesExplosions(ar: PRangeArray; Radius: LongInt; y, dY: LongInt; Count: Byte); |
471 var tx, ty, by, bx, i: LongInt; |
471 var tx, ty, by, bx, i: LongInt; |
663 tx:= Max(stX - HalfWidth * 2 - 4 - abs(hwRound(dX * ticks)), 0); |
663 tx:= Max(stX - HalfWidth * 2 - 4 - abs(hwRound(dX * ticks)), 0); |
664 ty:= Max(stY - HalfWidth * 2 - 4 - abs(hwRound(dY * ticks)), 0); |
664 ty:= Max(stY - HalfWidth * 2 - 4 - abs(hwRound(dY * ticks)), 0); |
665 ddx:= Min(stX + HalfWidth * 2 + 4 + abs(hwRound(dX * ticks)), LAND_WIDTH) - tx; |
665 ddx:= Min(stX + HalfWidth * 2 + 4 + abs(hwRound(dX * ticks)), LAND_WIDTH) - tx; |
666 ddy:= Min(stY + HalfWidth * 2 + 4 + abs(hwRound(dY * ticks)), LAND_HEIGHT) - ty; |
666 ddy:= Min(stY + HalfWidth * 2 + 4 + abs(hwRound(dY * ticks)), LAND_HEIGHT) - ty; |
667 |
667 |
668 UpdateLandTexture(tx, ddx, ty, ddy) |
668 UpdateLandTexture(tx, ddx, ty, ddy, false) |
669 end; |
669 end; |
670 |
670 |
671 function TryPlaceOnLand(cpX, cpY: LongInt; Obj: TSprite; Frame: LongInt; doPlace: boolean; indestructible: boolean): boolean; |
671 function TryPlaceOnLand(cpX, cpY: LongInt; Obj: TSprite; Frame: LongInt; doPlace: boolean; indestructible: boolean): boolean; |
672 var X, Y, bpp, h, w, row, col, gx, gy, numFramesFirstCol: LongInt; |
672 var X, Y, bpp, h, w, row, col, gx, gy, numFramesFirstCol: LongInt; |
673 p: PByteArray; |
673 p: PByteArray; |
751 |
751 |
752 x:= Max(cpX, leftX); |
752 x:= Max(cpX, leftX); |
753 w:= Min(cpX + Image^.w, LAND_WIDTH) - x; |
753 w:= Min(cpX + Image^.w, LAND_WIDTH) - x; |
754 y:= Max(cpY, topY); |
754 y:= Max(cpY, topY); |
755 h:= Min(cpY + Image^.h, LAND_HEIGHT) - y; |
755 h:= Min(cpY + Image^.h, LAND_HEIGHT) - y; |
756 UpdateLandTexture(x, w, y, h) |
756 UpdateLandTexture(x, w, y, h, true) |
757 end; |
757 end; |
758 |
758 |
759 function Despeckle(X, Y: LongInt): boolean; |
759 function Despeckle(X, Y: LongInt): boolean; |
760 var nx, ny, i, j, c, xx, yy: LongInt; |
760 var nx, ny, i, j, c, xx, yy: LongInt; |
761 pixelsweep: boolean; |
761 pixelsweep: boolean; |