Jump to content
shadowrecon

Porting SRL functions - need help

Recommended Posts

So i was going through some fo srl functions and found they have a pretty bad ass walking include, i managed to find the library that goes with it, and im trying to port it over but im having a heck of a time. this is what im trying to fix atm heres the lines its calling

 

function SPS_ColorBoxesMatchInline(var B1, B2: TIntegerArray; tol: extended): boolean;

 

b:= SPS_ColorBoxesMatchInline(LargeMap[cm][x+xx][y+yy], SmallMap[xx][yy], tol);

 

its something to do with the Tint arrays and how they have it set up i tried

 

b:= SPS_ColorBoxesMatchInline(LargeMap[cm,x+xx,y+yy], SmallMap[xx,yy], tol);

 

But that doesnt work, and by the way LargeMap is a T2dIntArray

 

---------- Post added at 11:15 AM ---------- Previous post was at 10:13 AM ----------

 

i have figured this problem out and just set up some types to fix the issue.

Link to comment
Share on other sites

Hmm, it's not going to be that easy nto port SPS to SCAR, because the library it uses is absed on parts of the Simba source, so I doubt that will be compatible with SCAR, you'd have to replace the classes if uses from the Mufasa library (I think that's what it's called) with standard Delphi classes.

Link to comment
Share on other sites

]

Well you guys are correct, and i am wrong, but once they are compiled they are difficult to disassemble. didnt know all of the source was in the open.. err. lol

 

---------- Post added at 08:15 AM ---------- Previous post was at 04:13 AM ----------

 

Im havign trouble figuring out what the heck is bmp.FData[.....]

function SPS_MakeColorBoxEx(bmp: TMufasaBitmap; x1, y1: integer): TIntegerArray;
var
 x, y, width: integer;
 C: TRGB32;
begin
 SetLength(Result, 3);
 width := bmp.Width; // may not be necessary, but should help a bit.

 for x := (x1 + 4) downto x1 do // flipped these to downto since order is irrelevant
   for y := (y1 + 4) downto y1 do // downto will calc the initial only once rather than each time.
   begin
     try
       C := bmp.FData[y * width + x];
       Result[0] := Result[0] + C.R;
       Result[1] := Result[1] + C.G;
       Result[2] := Result[2] + C.B;
     except end;
   end;
end;

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...