Game Development Community

What's up with the text lists?

by Chris Byars · in Torque Game Engine Advanced · 07/27/2006 (10:46 am) · 6 replies

www.ion-productions.com/oddProblem.JPG
Seems to duplicate the binding and put it next to the function. I see this happening in the drop down menus in the World Editor, and in the text list control that displays the list of missions (though it shows the filepath, or at least, part of it, next to the mission name)

Ex: "Warehouse fps/data/missi" will be displayed where it should simply say "Warehouse".

Only in TSE 3.5.

#1
07/29/2006 (2:32 pm)
Can anyone confirm?
#2
07/29/2006 (10:53 pm)
I get it too, i'm sure you could stacktrace the events that go with it and figure out whats going on. (just set a breakpoint and look at the call stack then step-through)
#3
07/31/2006 (12:47 pm)
Yeah, I noticed that too with the level selection. It's possibly related to new GuiInspector code.
#4
08/10/2006 (6:20 am)
Found the bug :)

culprit is in this part of the code in file gfxDevice.h line 1364
inline U32 GFXDevice::drawTextN( GFont *font, const Point2I &ptDraw, const UTF8 *in_string, U32 n,
                               const ColorI *colorTable, const U32 maxColorIndex, F32 rot )
{
   // Convert to UTF16 temporarily.
   FrameTemp<UTF16> ubuf( (n+1) * sizeof(UTF16) );
   U32 realLen = convertUTF8toUTF16(in_string, ubuf, [b][i](n+1)*sizeof(UTF16)[/i][/b]);
   return drawTextN( font, ptDraw, ubuf, realLen, colorTable, maxColorIndex, rot );
}

the code should be
inline U32 GFXDevice::drawTextN( GFont *font, const Point2I &ptDraw, const UTF8 *in_string, U32 n,
                               const ColorI *colorTable, const U32 maxColorIndex, F32 rot )
{
   // Convert to UTF16 temporarily.
   FrameTemp<UTF16> ubuf( (n+1) * sizeof(UTF16) );
   U32 realLen = convertUTF8toUTF16(in_string, ubuf, [b][i](n+1)[/i][/b]);
   return drawTextN( font, ptDraw, ubuf, realLen, colorTable, maxColorIndex, rot );
}

before was reading too many chars from the in_string and so it read the tab and the chars that followed it too until it was terminated by a NULL or until it read the (wrong) number of chars.
#5
08/10/2006 (7:52 am)
Cool, thanks for the info! :)
#6
08/10/2006 (12:49 pm)
Sweet! Well done Florian, I'll get this in soon - right now I'm slammed with GameFest demo work. Thanks for finding that.