Minor fixes
This commit is contained in:
parent
5e643bca7b
commit
ddf0dc88bc
|
|
@ -180,7 +180,7 @@ namespace Nz
|
||||||
const std::shared_ptr<Font>& defaultFont = Font::GetDefault();
|
const std::shared_ptr<Font>& defaultFont = Font::GetDefault();
|
||||||
defaultFont->SetAtlas(nullptr);
|
defaultFont->SetAtlas(nullptr);
|
||||||
|
|
||||||
if (!defaultAtlas.use_count() > 1)
|
if (defaultAtlas.use_count() >= 1)
|
||||||
{
|
{
|
||||||
// Still not the only one to own it ? Then crap.
|
// Still not the only one to own it ? Then crap.
|
||||||
NazaraWarning("Default font atlas uses hardware storage and is still used");
|
NazaraWarning("Default font atlas uses hardware storage and is still used");
|
||||||
|
|
|
||||||
|
|
@ -49,10 +49,14 @@ namespace Nz
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// At least one font is using this atlas, remove our glyphes
|
// At least one font is using this atlas, remove our glyphes
|
||||||
for (auto&& [_, glyphMap] : m_glyphes)
|
for (auto&& [glyphKey, glyphMap] : m_glyphes)
|
||||||
{
|
{
|
||||||
for (auto&& [_, glyph] : glyphMap)
|
NazaraUnused(glyphKey);
|
||||||
|
for (auto&& [character, glyph] : glyphMap)
|
||||||
|
{
|
||||||
|
NazaraUnused(character);
|
||||||
m_atlas->Free(&glyph.atlasRect, &glyph.layerIndex, 1);
|
m_atlas->Free(&glyph.atlasRect, &glyph.layerIndex, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Free all cached glyphes
|
// Free all cached glyphes
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue