SCAR Code:
function PercentBlackMMEx(StartRadial, EndRadial, StartRadius, EndRadius: Integer): integer;
var
TPA: TPointArray;
A: Integer;
Area: Extended;
begin
A := EndRadial - StartRadial;
FindColors(TPA, 65536, MMX1, MMY1, MMX2, MMY2);
FilterPointsPie(TPA, StartRadial, EndRadial, StartRadius, EndRadius, MMCX, MMCY);
Area := (Pi * A / 360.0) * (sqr(StartRadius + 0.0) - sqr(EndRadius + 0.0));
Result := Round(Length(TPA) * 100 / Area) ;
end;
SCAR Code:
{*******************************************************************************
function PercentColorMMEx(Color, Tol, StartRadial, EndRadial, StartRadius, EndRadius: Integer): integer;
By: Richard, and Nava2
Description: Returns the percentage of colour on the minimap section defined by
StartRadial, EndRadial, StartRadius, and EndRadius.
*******************************************************************************}
function PercentColorMMEx(Color, Tol, StartRadial, EndRadial, StartRadius, EndRadius: Integer): integer;
var
TPA: TPointArray;
A: Integer;
Area: Extended;
begin
A := EndRadial - StartRadial;
FindColorsTolerance(TPA, Colour, MMX1, MMY1, MMX2, MMY2, Tol);
FilterPointsPie(TPA, StartRadial, EndRadial, StartRadius, EndRadius, MMCX, MMCY);
Area := (Pi * A / 360.0) * (sqr(StartRadius + 0.0) - sqr(EndRadius + 0.0));
Result := Round(Length(TPA) * 100 / Area) ;
end;