1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-25 10:42:20 -05:00

This one should work.

git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@550 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
Wizzup? 2010-02-25 01:40:05 +00:00
parent 816961da9e
commit 8a63cc43ac
2 changed files with 15 additions and 10 deletions

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
*.bak
*.ppu
*.o
*.compiled
*.or

View File

@ -243,7 +243,8 @@ Function ValidMainPointBoxRotated(var dtm: pDTM; const x1, y1, x2, y2: Integer;
sAngle, eAngle, aStep: Extended): TBox; sAngle, eAngle, aStep: Extended): TBox;
var var
i, d: Integer; i: Integer;
d:extended;
begin begin
for i := 1 to high(dtm.c) do for i := 1 to high(dtm.c) do
@ -252,19 +253,18 @@ begin
end; end;
dtm.p[0] := dtm.p[0] - dtm.p[0]; dtm.p[0] := dtm.p[0] - dtm.p[0];
for i := 0 to high(dtm.c) do for i := 0 to high(dtm.c) do
begin begin
d := max(dtm.p[i].x - dtm.asz[i], d); d := max(d, sqrt(sqr(dtm.p[i].x - dtm.asz[i]) + sqr(dtm.p[i].x - dtm.asz[i])));
d := max(dtm.p[i].x + dtm.asz[i], d); d := max(d, sqrt(sqr(dtm.p[i].y - dtm.asz[i]) + sqr(dtm.p[i].y - dtm.asz[i])));
d := max(dtm.p[i].y - dtm.asz[i], d); d := max(d, sqrt(sqr(dtm.p[i].x + dtm.asz[i]) + sqr(dtm.p[i].x + dtm.asz[i])));
d := max(dtm.p[i].y + dtm.asz[i], d); d := max(d, sqrt(sqr(dtm.p[i].y + dtm.asz[i]) + sqr(dtm.p[i].y + dtm.asz[i])));
end; end;
Result.x1 := d; Result.x1 := x1 + ceil(d);
Result.y1 := d; Result.y1 := y1 + ceil(d);
Result.x2 := d; Result.x2 := x2 - ceil(d);
Result.y2 := d; Result.y2 := y2 - ceil(d);
end; end;