I believe this
can be coded to worked in simba, but I have no idea how. The problem can be fixed include side or simba-side. You just have to work around things.
Edit: The original version of DebugATPABounds didn't work either
{$include SRL\SRL.scar}
{*******************************************************************************
function DebugATPABounds2(aPoints: T2DPointArray; BmpName: string): Boolean;
By: Wizzup? & lordsaturn
Description: Shows an image of the client, plotting each TPA's bounds as a box
of different colour per TPA. If a name is specified, an image
will be saved.
*******************************************************************************}
function DebugATPABounds2(aPoints: T2DPointArray; BmpName: string): Boolean;
Var
Width, Height, ClientBMP, I, L, Col, x2, y2, h, hh : Integer;
ClientBox : tbox;
Box : tbox;
p: TPointArray;
Colours: TIntegerArray;
Begin
Try
begin
h := High(aPoints);
for i := 0 to h do
begin
clientbox := GetTPABounds(APoints[i]);
x2 := max(x2, clientbox.x2);
y2 := max(y2, clientbox.y2);
end;
width := x2 + 5;
height := y2 + 5;
DisplayDebugImgWindow(Width, Height);
ClientBMP := BitmapFromString(Width, Height, '');
CopyClientToBitmap(ClientBMP, 0, 0, width, height)
For I := 0 To h Do
Begin
Colours := [clRed, clBlue, clBlack, clGreen, clYellow];
col := Colours[Random(Length(Colours))];
box := GetTPABounds(APoints[i]);
box.x1 := box.x1 - 3;
box.y1 := box.y1 - 3;
box.x2 := box.x2 + 3;
box.y2 := box.y2 + 3;
p := LoadTextTPA(IntToStr(i), UpChars, hh);
hh := High(p);
for L := 0 to hh do
FastSetPixel(ClientBmp, p[L].x + box.x1 + 3, p[L].y + box.y1 + 3, col);
//For L := box.x1 To box.x2 Do
for L := 0 to box.x2- box.x1 do
begin
FastSetPixel(ClientBMP, L, box.y1 - box.y1, Col);
FastSetPixel(ClientBMP, L, box.y2 - box.y1, Col);
end;
//For L := box.y1 To box.y2 Do
for L := 0 to box.y2- box.y1 do
begin
FastSetPixel(ClientBMP, box.x1 - box.x1, L, Col);
FastSetPixel(ClientBMP, box.x2 - box.x1, L, Col);
end;
End;
DisplayDebugImgWindow(Width, Height);
{$ifdef Simba}
DrawBitmapDebugImg(ClientBMP);
{$else}
SafeDrawBitmap(ClientBMP, GetDebugCanvas, 0, 0);
{$endif}
If BmpName <> '' Then
SaveBitmap(ClientBMP, ScriptPath + BmpName + '.bmp');
FreeBitmap(ClientBMP);
End;
Except
FreeBitmap(ClientBMP);
Writeln('Error in DebugATPABounds');
End;
Result := True;
End;
var
TPA: TPointArray;
ATPA: T2DPointArray;
begin
SetUpSRL;
TPA := TPAFromBox(IntToBox(0, 0, 500, 500));
ATPA := TPAToATPAEx(TPA, 10, 10);
DebugATPABounds2(ATPA, '');
end.