I tried to spot a segfault in my game and run it via debug - and this was the first time the following "crash" happened:
so setColor in max2d:
originally called this way (_DrawBox):
And _DrawBox() is called by this one:
Method DrawBox:SVec2I(txt:String,X:Float,Y:Float,w:Float,h:Float, alignment:SVec2F, color:SColor8, handle:SVec2F, parseInfo:STextParseInfo Var, options:EDrawTextOption = EDrawTextOption.None, effect:SDrawTextEffect Var, settings:SDrawTextSettings Var, limitFirstElement:Int = -1, limitLastElement:Int = -1)
So "parseInfo" (whose "color" is passed around) is passed as var there.
I use a lot of overloads for "DrawBox()" - so this might even have been called by an other "DrawBox()" (with less params etc).
IMPORTANT: For now this STextParseInfo is NOT a struct (it did not work well with types - think there is a bug in bcc or so) hence I for now used a "type". Edit: seems current BCC can handle that now ... so will change that asap (albeit this means it might not work with last official "stable" release)
Does one of you see an issue in doing this at all? Might it be a red herring (the "var") ?
I tried to spot a segfault in my game and run it via debug - and this was the first time the following "crash" happened:
so setColor in max2d:
originally called this way (
_DrawBox
):And
_DrawBox()
is called by this one:Method DrawBox:SVec2I(txt:String,X:Float,Y:Float,w:Float,h:Float, alignment:SVec2F, color:SColor8, handle:SVec2F, parseInfo:STextParseInfo Var, options:EDrawTextOption = EDrawTextOption.None, effect:SDrawTextEffect Var, settings:SDrawTextSettings Var, limitFirstElement:Int = -1, limitLastElement:Int = -1)
So "parseInfo" (whose "color" is passed around) is passed as
var
there.I use a lot of overloads for "DrawBox()" - so this might even have been called by an other "DrawBox()" (with less params etc).
Source of the methods: https://github.com/TVTower/TVTower/blob/master/source/Dig/base.gfx.bitmapfont.bmx
IMPORTANT: For now this
STextParseInfo
is NOT a struct (it did not work well with types - think there is a bug in bcc or so) hence I for now used a "type". Edit: seems current BCC can handle that now ... so will change that asap (albeit this means it might not work with last official "stable" release)Does one of you see an issue in doing this at all? Might it be a red herring (the "var") ?