Thanks for all the responses you guys seem to have a very active community. I Would love to switch to simba but when i first got back into scripting i turned to scar and as of now there includes are clearly labeled and easier to follow. Not that i cant tell time was put into your guys includes but alot fo the functions at the time were broken and had not been updated in years. ( I assume because color based scripting was left in the dark for a while as reflection had taken over )
Back on topic here is a quote from the bitmap unit about FData
public
OnDestroy : procedure(Bitmap : TMufasaBitmap) of object;
//FakeData : array of TRGB32;
FData : PRGB32;
This is why i was confused as what was FakeData? lol. As wizzup? stated its a pointer which i assume points to a data set of RBG values? If its not RGB values then whats being passed in this function? Is there another way to pass the information in a separate variable?
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;