My test script for anyone interested (will probably receive changes as I update MM2MS):
Simba Code:
{$DEFINE SMART}
{$I SRL/OSR.simba}
{$H-}
var
angle: Double;
buffer: TMufasaBitmap;
procedure DrawSquare(vec: Vector3; color: Int32);
var
rect: TRectangle;
q: TPoint;
begin
rect := Minimap.VecToMSRect(vec, angle).Expand(-2);
for q in rect.ToTPA.Connect() do
if q.InBox(Mainscreen.GetBounds) then
Buffer.SetPixel(q.x,q.y, color);
end;
procedure DrawTile(x,y, color: Int32; ForceColor:Boolean=False);
var
i,xx,yy: Int32;
vec: Vector3;
begin
vec := Vec3(x,y).RotateXY(angle, MM2MS.MMCX, MM2MS.MMCY);
// adjust colors if it's a minimap object
if not ForceColor then
begin
for xx:=Round(vec.x)-1 to Round(vec.x) do
for yy:=Round(vec.y)-1 to Round(vec.y) do
if (GetColor(xx,yy+2) = 65536) and SimilarColors(60909, GetColor(xx,yy), 50) then
begin
color := $FFFF00;
break;
end else if (GetColor(xx,yy+2) = 65536) and SimilarColors(395004, GetColor(xx,yy), 50) then
begin
color := $00FF00;
break;
end else if (GetColor(xx,yy+2) = 65536) and SimilarColors(15526885, GetColor(xx,yy), 50) then
begin
color := $FFFFFF;
break;
end
end;
DrawSquare(vec, color);
end;
var
x,y: Int32;
V3A: Vector3Array;
pt: TPoint;
vec: Vector3;
begin
smart.EnableDrawing := True;
smart.Init;
buffer := GetMufasaBitmap(CreateBitmap(GetClientBounds.Width, GetClientBounds.Height));
AddOnTerminate(@buffer.Free);
while True do
begin
angle := minimap.GetCompassAngle(False);
// iterate over minimap tiles and debug them
for x:=MM2MS.MMCX-52 to MM2MS.MMCX+52 with 4 do
for y:=MM2MS.MMCY-52 to MM2MS.MMCY+52 with 4 do
DrawTile(x,y, HSLToColor((y*100+x)/100, 50,50));
DrawTile(MM2MS.MMCX, MM2MS.MMCY, $111111, True);
// debug
buffer.DrawBox(chatbox.FLines[8], True, $1);
Smart.Image.DrawBitmap(buffer.GetIndex, Point(0,0));
buffer.Clear();
end;
end.