mirror of https://github.com/axmolengine/axmol.git
Improve code style
This commit is contained in:
parent
864c73154c
commit
6c63c55abb
|
@ -281,18 +281,13 @@ bool FontAtlas::prepareLetterDefinitions(const std::u32string& utf32Text)
|
|||
tempDef.U = tempDef.U / scaleFactor;
|
||||
tempDef.V = tempDef.V / scaleFactor;
|
||||
tempDef.rotated = false;
|
||||
|
||||
updateTextureContent(pixelFormat, startY);
|
||||
}
|
||||
else
|
||||
{ // don't render anythings
|
||||
{
|
||||
if (bitmap)
|
||||
delete[] bitmap;
|
||||
if (tempDef.xAdvance)
|
||||
tempDef.validDefinition = true;
|
||||
else
|
||||
tempDef.validDefinition = false;
|
||||
|
||||
tempDef.validDefinition = !!tempDef.xAdvance;
|
||||
tempDef.width = 0;
|
||||
tempDef.height = 0;
|
||||
tempDef.U = 0;
|
||||
|
@ -307,6 +302,8 @@ bool FontAtlas::prepareLetterDefinitions(const std::u32string& utf32Text)
|
|||
_letterDefinitions[charCode] = tempDef;
|
||||
}
|
||||
|
||||
updateTextureContent(pixelFormat, startY);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -371,7 +368,6 @@ void FontAtlas::addNewPage()
|
|||
texture->release();
|
||||
|
||||
_currentPageOrigY = 0;
|
||||
|
||||
}
|
||||
|
||||
void FontAtlas::setTexture(unsigned int slot, Texture2D* texture)
|
||||
|
|
|
@ -404,7 +404,7 @@ unsigned char* FontFreeType::getGlyphBitmap(char32_t charCode,
|
|||
if (_mssingGlyphCharacter != 0)
|
||||
{
|
||||
if (_mssingGlyphCharacter == 0x1A)
|
||||
return nullptr; // don't render anything for this character
|
||||
break; // don't render anything for this character
|
||||
|
||||
// Try get new glyph index with missing glyph character code
|
||||
glyphIndex = FT_Get_Char_Index(_fontFace, static_cast<FT_ULong>(_mssingGlyphCharacter));
|
||||
|
|
Loading…
Reference in New Issue