Quickmarch
2009-06-19 20:06:28
Basically the same as RadialWalkEx but it takes the map angle into account:
So which ever way the map is turned to, it will change the StartDegree and EndDegree accordingly.
function RadialWalkEx(var tpa: TPointArray; cx, cy, TheColor, tol: Integer; StartRadial, EndRadial: Integer; Radius: Integer): Boolean;
var
SD, ED: Integer;
begin
Result := False;
if (not LoggedIn) then Exit;
SD := Round(FixD(AdjustD(StartRadial, rs_GetCompassAngleDegrees)));
ED := Round(FixD(AdjustD(EndRadial, rs_GetCompassAngleDegrees)));
try
FindColorsTolerance(tpa, TheColor, MMX1, MMY1, MMX2, MMY2, tol);
FilterPointsPie(tpa, SD, ED, 10, Radius, cx, cy);
SortCircleWise(tpa, cx, cy, StartRadial, False, StartRadial > EndRadial);
Result := (Length(tpa) > 0);
except srl_Warn('RadialWalkEx', 'An exception has occured', warn_AllVersions); Exit; end;
end;
So which ever way the map is turned to, it will change the StartDegree and EndDegree accordingly.