Hi I'm trying to create a TBoxArray and store Tboxes into it, but I'm running into an error whenever I try to put a TBox into an index of the array. Here is the code:
Simba Code:
procedure tlobby.setupSorts();
var
boxTextures : GlTextureArray;
boxLength, i : Integer;
boxArray : TBoxArray;
temp : TBox;
begin
boxTextures := ogl.getTextures(11475);
boxLength := length(boxTextures);
for i := 0 to boxLength do
boxArray[i] := TBox(boxTextures[i].bounds);
self.pingBox := boxArray[boxLength-1];
if self.compareBoxes(boxArray[boxLength-1], boxArray[boxLength-2]) then
self.typeBox := boxArray[boxLength-4]
else if self.compareBoxes(boxArray[boxLength-2], boxArray[boxLength-3]) then
self.typeBox := boxArray[boxLength-4]
else
self.typeBox := boxArray[boxLength-3];
self.sortByType := (ogl.getTextures(10, self.typeBox).indexes() = 0);
self.sortByPing := (ogl.getTextures(10, self.pingBox).indexes() = 0);
writeln(sortByType, ' ', sortByPing);
end;
function tlobby.compareBoxes(box1, box2 : TBox): boolean;
begin
if (box1.x1 = box2.x1) and (box1.x2 = box2.x2) and
(box1.y1 = box2.y1) and (box1.y2 = box2.y2) then
result := true
else
result := false;
end;
And here is the error:
Simba Code:
12:29:38 | debugTextureHighlight > setup
ERROR comes from a non-existing file (!addGlobalType)
Error: Access violation at line 1
Execution failed.
The following bitmaps were not freed: [0]
Keep in mind I ran it from another file so the access violation is from the first file.