I knocked up a script in about half an hour that is meant to display all the different colours in the area of the client that I hard code. Initially I left it to feed all the colours into the debug box, but that was a) quite inefficient and b) extremely useless as looking through all those colours would have taken forever. To counter this, I made it search through the array I created to make sure there was no repetitions in colours, but it only displays the very top left colour of the area selected. I'm guessing the problem lies in the TIA search. Code:
SCAR Code:
program ListColours;
type
TPixel = record
Point: TPoint;
Colour: Integer;
end;
Var
Pixels: Array of TPixel;
Colours: TIntegerArray;
x, y, i, ii: integer;
begin
SetArrayLength(Pixels, 26*32 + 1)
for x := 5 to 26 do //these are the parameters
for y := 5 to 32 do //of the area that I'm searching
begin
With Pixels[x*y] do
begin
Point.x := x //ignore these for now
Point.y := y //they'll have future use
Colour := GetColor(x, y);
end;
end;
SetArrayLength(Colours, 1);
for i := 25 to High(Pixels) do
for ii := 0 to High(Colours) do
if Pixels[i].Colour <> Colours[ii] then
begin
SetArrayLength(Colours, High(colours) + 1);
Colours[ii] := Pixels[i].Colour;
end;
for i := 0 to High(Colours) do
WriteLN(IntToStr(Colours[i]));
end.