(Font) Added Atlas safe check

Former-commit-id: daf33e34880e6142f2617e8afa84f8d9df12c4f2
This commit is contained in:
Lynix 2015-01-17 22:07:28 +01:00
parent f1694fd6e9
commit 8b1660a121
1 changed files with 11 additions and 2 deletions

View File

@ -431,11 +431,20 @@ const NzFont::Glyph& NzFont::PrecacheGlyph(GlyphMap& glyphMap, unsigned int char
return it->second;
Glyph& glyph = glyphMap[character]; // Insertion du glyphe
glyph.requireFauxBold = false;
glyph.requireFauxItalic = false;
glyph.valid = false;
#if NAZARA_UTILITY_SAFE
if (!m_atlas)
{
NazaraError("Font has no atlas");
return glyph;
}
#endif
// On vérifie que le style demandé est supporté par la police (dans le cas contraire il devra être simulé au rendu)
glyph.requireFauxBold = false;
glyph.requireFauxItalic = false;
nzUInt32 supportedStyle = style;
if (style & nzTextStyle_Bold && !m_data->SupportsStyle(nzTextStyle_Bold))
{