Coh3n
2009-11-25 16:23:38
function RadialWalkTolerance(Color, sRadial, eRadial, r, modX, modY, Tol: Integer): Boolean;
Well after a few hours of trying to figure out why RadialWalk wasn't working like I wanted to, it came to my attention that RadialWalk doesn't use a tolerance. So, I came up with this, and now it works 100% better, for me at least.
{*******************************************************************************
function RadialWalkTolerance(Color, sRadial, eRadial, r, modX, modY, Tol: Integer): Boolean;
By: Coh3n
Description: Same as RadialWalk, but with a tolerance.
*******************************************************************************}
function RadialWalkTolerance(Color, sRadial, eRadial, r, modX, modY, Tol: Integer): Boolean;
var
TPA: TPointArray;
i, h: Integer;
begin
Result := False;
if RadialWalkEx(TPA, MMCX, MMCY, Color, Tol, sRadial, eRadial, r) then
begin
h := High(TPA);
for i := 0 to h do
if MFNF(TPA[i].x, TPA[i].y, modX, modY) then
begin
FFlag(10);
Result := True;
Exit;
end;
end;
end;
Let me know what you think,
Coh3n