mirror of
https://github.com/moparisthebest/Simba
synced 2024-11-11 03:45:06 -05:00
a063b83081
Basically: x1 = x1 - max(areasize * (negative) distance to main point) <-- Max of all points. Same for the rest. git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@109 3f818213-9676-44b0-a9b4-5e4c4e03d09d
59 lines
1.2 KiB
Plaintext
59 lines
1.2 KiB
Plaintext
program new;
|
|
|
|
const
|
|
dtm_Rectangle = 0;
|
|
dtm_Cross = 1;
|
|
dtm_DiagonalCross = 2;
|
|
dtm_Circle = 3;
|
|
dtm_Triangle = 4;
|
|
|
|
var
|
|
ppdtm: pdtm;
|
|
w,h,x,y,dtm,i: integer;
|
|
|
|
a: extended;
|
|
|
|
p,pp: TPointArray;
|
|
c,t,asz,ash: TIntegerArray;
|
|
|
|
begin
|
|
p := [Point(0,0), Point(1,1)];
|
|
c := [clWhite, clWhite];
|
|
t := [0, 0];
|
|
asz := [0, 0];
|
|
ash := [dtm_Rectangle, dtm_Rectangle];
|
|
setlength(ppdtm.p,2);
|
|
setlength(ppdtm.c,2);
|
|
setlength(ppdtm.t,2);
|
|
setlength(ppdtm.asz,2);
|
|
setlength(ppdtm.ash,2);
|
|
|
|
ppdtm.p := p;
|
|
ppdtm.c := c;
|
|
ppdtm.t := t;
|
|
ppdtm.asz := asz;
|
|
ppdtm.ash := ash;
|
|
|
|
dtm := AddpDTM(ppdtm);
|
|
|
|
getclientdimensions(w,h);
|
|
if FindDTM(dtm, x, y, 0, 0, w-1, h-1) then
|
|
begin
|
|
writeln('Found DTM at ' + inttostr(x) + ', ' + inttostr(y));
|
|
movemouse(x,y);
|
|
end;
|
|
|
|
if FindDTMs(dtm, p, 0, 0, w-1, h-1) then
|
|
begin
|
|
writeln('Found ' + inttostr(length(p)) + ' DTM(s). First one at ' +
|
|
inttostr(p[0].x) + ', ' + inttostr(p[0].y));
|
|
movemouse(p[0].x,p[0].y);
|
|
end;
|
|
|
|
if FindDTMRotated(dtm, x, y, 0, 0, w-1, h-1, -3.14, 3.14, 0.05, a) then
|
|
begin
|
|
writeln('Found DTM at ' + inttostr(x) + ', ' + inttostr(y) + ' Angle: ' + FloatToStr(a));
|
|
movemouse(x,y);
|
|
end;
|
|
end.
|