mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
Fix for Issue #116 for Crash with unicode
This commit is contained in:
parent
942b1c39c1
commit
b085a76e50
1 changed files with 10 additions and 4 deletions
|
|
@ -215,12 +215,18 @@ void FontRenderBatcher::queueChar( UTF16 c, S32 ¤tX, GFXVertexColor &curre
|
||||||
|
|
||||||
FontRenderBatcher::SheetMarker & FontRenderBatcher::getSheetMarker( U32 sheetID )
|
FontRenderBatcher::SheetMarker & FontRenderBatcher::getSheetMarker( U32 sheetID )
|
||||||
{
|
{
|
||||||
// Allocate if it doesn't exist...
|
// Add empty sheets up to and including the requested sheet if necessary
|
||||||
if(mSheets.size() <= sheetID || !mSheets[sheetID])
|
if (mSheets.size() <= sheetID)
|
||||||
{
|
{
|
||||||
if(sheetID >= mSheets.size())
|
S32 oldSize = mSheets.size();
|
||||||
mSheets.setSize(sheetID+1);
|
mSheets.setSize( sheetID + 1 );
|
||||||
|
for ( S32 i = oldSize; i < mSheets.size(); i++ )
|
||||||
|
mSheets[i] = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Allocate if it doesn't exist...
|
||||||
|
if (!mSheets[sheetID])
|
||||||
|
{
|
||||||
S32 size = sizeof( SheetMarker) + mLength * sizeof( CharMarker );
|
S32 size = sizeof( SheetMarker) + mLength * sizeof( CharMarker );
|
||||||
mSheets[sheetID] = (SheetMarker *)mStorage.alloc(size);
|
mSheets[sheetID] = (SheetMarker *)mStorage.alloc(size);
|
||||||
mSheets[sheetID]->numChars = 0;
|
mSheets[sheetID]->numChars = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue