mirror of
https://github.com/moparisthebest/Simba
synced 2024-11-30 12:52:16 -05:00
CTS: Cleanups.
This commit is contained in:
parent
14474a84ab
commit
7a412d1670
@ -30,14 +30,12 @@ interface
|
||||
|
||||
{$define CheckAllBackground}//Undefine this to only check the first white point against the background (in masks).
|
||||
uses
|
||||
colour_conv, Classes, SysUtils,bitmaps,MufasaBase,DTM, MufasaTypes; // Types
|
||||
colour_conv, Classes, SysUtils, bitmaps, DTM, MufasaTypes; // Types
|
||||
|
||||
{ TMFinder Class }
|
||||
|
||||
{
|
||||
Should be 100% OS independant,
|
||||
as all OS dependant code is in the IO Manager
|
||||
|
||||
Should be 100% OS independant, as all OS dependant code is in the IO Manager.
|
||||
Let's try not to use any OS-specific defines here? ;)
|
||||
}
|
||||
|
||||
@ -101,19 +99,16 @@ type
|
||||
|
||||
implementation
|
||||
uses
|
||||
// colour_conv,// For RGBToColor, etc.
|
||||
Client, // For the Client Casts.
|
||||
Client, // For the Client casting.
|
||||
math, // min/max
|
||||
mmath,
|
||||
tpa, //TPABounds
|
||||
dtmutil
|
||||
;
|
||||
dtmutil;
|
||||
|
||||
procedure TMFinder.LoadSpiralPath(startX, startY, x1, y1, x2, y2: Integer);
|
||||
var
|
||||
i,c,Ring : integer;
|
||||
CurrBox : TBox;
|
||||
begin;
|
||||
begin
|
||||
i := 0;
|
||||
Ring := 1;
|
||||
c := 0;
|
||||
@ -126,7 +121,7 @@ begin;
|
||||
ClientTPA[c] := Point(Startx, StartY);
|
||||
Inc(c);
|
||||
end;
|
||||
Repeat
|
||||
repeat
|
||||
if (CurrBox.x2 >= x1) and (CurrBox.x1 <= x2) and (Currbox.y1 >= y1) and (Currbox.y1 <= y2) then
|
||||
for i := CurrBox.x1 + 1 to CurrBox.x2 do
|
||||
if (I >= x1) and ( I <= x2) then
|
||||
@ -168,7 +163,7 @@ function CalculateRowPtrs(ReturnData : TRetData; RowCount : integer) : TPRGB32Ar
|
||||
var
|
||||
I : integer;
|
||||
begin;
|
||||
setlength(result,RowCount);
|
||||
SetLength(result,RowCount);
|
||||
for i := 0 to RowCount - 1 do
|
||||
result[i] := ReturnData.Ptr + ReturnData.RowLen * i;
|
||||
end;
|
||||
@ -1043,7 +1038,6 @@ var
|
||||
Ptr: PRGB32;
|
||||
PtrInc,C: Integer;
|
||||
dX, dY, clR, clG, clB: Integer;
|
||||
H1, S1, L1, H2, S2, L2, hueXTol, satXTol: Extended;
|
||||
|
||||
procedure cts0;
|
||||
var xx, yy: integer;
|
||||
@ -1086,7 +1080,9 @@ var
|
||||
|
||||
procedure cts2;
|
||||
var xx, yy: integer;
|
||||
H1, S1, L1, H2, S2, L2, hueXTol, satXTol: Extended;
|
||||
begin
|
||||
ColorToHSL(color,H1,S1,L1);
|
||||
HueXTol := hueMod * Tol;
|
||||
SatXTol := satMod * Tol;
|
||||
for yy := ys to ye do
|
||||
@ -1105,6 +1101,7 @@ var
|
||||
Inc(Ptr, PtrInc);
|
||||
end;
|
||||
end;
|
||||
|
||||
begin
|
||||
Result := false;
|
||||
DefaultOperations(xs,ys,xe,ye);
|
||||
@ -1113,8 +1110,6 @@ begin
|
||||
dY := ye - ys;
|
||||
//next, convert the color to r,g,b
|
||||
ColorToRGB(Color, clR, clG, clB);
|
||||
if CTS = 2 then
|
||||
ColorToHSL(color,H1,S1,L1);
|
||||
|
||||
PtrData := TClient(Client).IOManager.ReturnData(xs, ys, dX + 1, dY + 1);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user