SRL Archive - MSI Suggestions

MSI_FindObjectsTPA


Sir R. M8gic1an

2010-06-11 08:35:31


Function MSI_FindObjectsTPA(Var Objs: TPointArray; Width, Height: Integer;
Colors: TIntegerArray; Accuracy, Tolerance: Integer; HueMod, SatMod: Extended;
FindAllColors: Boolean;
X1, Y1, X2, Y2: Integer;
ExcludeSelf, CheckAnimation: Boolean;
BadColors: TIntegerArray; BadColorTolerance: Integer): Boolean;


Can't we just do:

Function MSI_FindObjectsTPA(Var Objs: TPointArray; Where: TBox; Obj: TMSObject): boolean;

//eg
MSI_FindObjectsTPA(TPA, MSBox, MSI_GetObject(FISHING_SPOT));


And I think these should probably be added to SRL:

function MSBox: TBox;
begin
with Result do
begin
x1 := MSX1;
y1 := MSY1;
x2 := MSX2;
y2 := MSY2;
end;
end;

function MMBox: TBox;
begin
with Result do
begin
x1 := MMX1;
y1 := MMY1;
x2 := MMX2;
y2 := MMY2;
end;
end;

function MIBox: TBox;
begin
with Result do
begin
x1 := MIX1;
y1 := MIY1;
x2 := MIX2;
y2 := MIY2;
end;
end;

function MCBox: TBox;
begin
with Result do
begin
x1 := MCX1;
y1 := MCY1;
x2 := MCX2;
y2 := MCY2;
end;
end;

ps: this ^ is a way of having a constant array or type ;)

~RM

marpis

2010-06-11 10:20:14

Yea we could do that to avoid a million parameters, I just based the function on one of my old ones.

Sir R. M8gic1an

2010-06-11 13:02:57

From: marpis
Yea we could do that to avoid a million parameters, I just based the function on one of my old ones.


Sounds good. When home I'll look into it.

~RM