summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4915b85)
raw | patch | inline | side by side (parent: 4915b85)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Tue, 5 Sep 2017 22:06:24 +0000 (01:06 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Tue, 5 Sep 2017 22:07:11 +0000 (01:07 +0300) |
src/game/g_grid.pas | patch | blob | history |
diff --git a/src/game/g_grid.pas b/src/game/g_grid.pas
index 55feca9a094f1ac89568f79b79e78f5ab2e72d93..5fd0a331d0448d7bc7c63c60c30914bbc7fc8836 100644 (file)
--- a/src/game/g_grid.pas
+++ b/src/game/g_grid.pas
// ////////////////////////////////////////////////////////////////////////// //
procedure swapInt (var a: Integer; var b: Integer); inline; var t: Integer; begin t := a; a := b; b := t; end;
+procedure swapInt (var a: Integer; var b: Integer); inline; begin a := a xor b; b := b xor a; a := a xor b; end;
//function minInt (a, b: Integer): Integer; inline; begin if (a < b) then result := a else result := b; end;
//function maxInt (a, b: Integer): Integer; inline; begin if (a > b) then result := a else result := b; end;
@@ -446,7 +447,7 @@ function TLineWalker.dx (): Integer; inline; begin if xyswapped then result := s
function TLineWalker.dy (): Integer; inline; begin if xyswapped then result := sty else result := stx; end;
function TLineWalker.setup (x0, y0, x1, y1: Integer): Boolean;
- procedure swapInt (var a: Integer; var b: Integer); inline; var t: Integer; begin t := a; a := b; b := t; end;
+ procedure swapInt (var a: Integer; var b: Integer); inline; begin a := a xor b; b := b xor a; a := a xor b; end;
var
dsx, dsy: Integer; // "lengthes" for x and y axes
rem: Integer;
begin
yd := wy0;
e -= rem+dsx;
- if (rem > 0) then begin Inc(xd); e += dy2; end;
+ //if (rem > 0) then begin Inc(xd); e += dy2; end; //BUGGY
+ if (xd < wx0) then begin xd += 1; e += dy2; end; //???
xfixed := true;
end;
end;
begin
yd := wy0;
e -= rem+dsx;
- if (rem > 0) then begin Inc(xd); e += dy2; end;
+ //if (rem > 0) then begin Inc(xd); e += dy2; end; //BUGGY
+ if (xd < wx0) then begin xd += 1; e += dy2; end; //???
xfixed := true;
end;
end;
begin
yd := wy0;
e -= rem+dsx;
- if (rem > 0) then begin Inc(xd); e += dy2; end;
+ //if (rem > 0) then begin Inc(xd); e += dy2; end; //BUGGY
+ if (xd < wx0) then begin xd += 1; e += dy2; end; //???
xfixed := true;
end;
end;