Fixed Font::[Get|Set]Atlas interface

Former-commit-id: 7670317dc2684fc0f9240a1f188e4ba92592a263
This commit is contained in:
Lynix
2015-01-17 22:48:27 +01:00
parent 722fba5d0c
commit cfe1bcf107
3 changed files with 6 additions and 6 deletions

View File

@@ -132,7 +132,7 @@ void NzTextSprite::SetText(const NzAbstractTextDrawer& drawer)
unsigned int fontCount = drawer.GetFontCount();
for (unsigned int i = 0; i < fontCount; ++i)
{
const NzAbstractAtlas* atlas = drawer.GetFont(i)->GetAtlas();
const NzAbstractAtlas* atlas = drawer.GetFont(i)->GetAtlas().get();
if (m_atlases.insert(atlas).second)
atlas->AddListener(this);
}

View File

@@ -104,9 +104,9 @@ bool NzFont::ExtractGlyph(unsigned int characterSize, char32_t character, nzUInt
return m_data->ExtractGlyph(characterSize, character, style, glyph);
}
const NzAbstractAtlas* NzFont::GetAtlas() const
const std::shared_ptr<NzAbstractAtlas>& NzFont::GetAtlas() const
{
return m_atlas.get();
return m_atlas;
}
unsigned int NzFont::GetCachedGlyphCount(unsigned int characterSize, nzUInt32 style) const
@@ -277,7 +277,7 @@ bool NzFont::OpenFromStream(NzInputStream& stream, const NzFontParams& params)
return NzFontLoader::LoadFromStream(this, stream, params);
}
void NzFont::SetAtlas(std::shared_ptr<NzAbstractAtlas> atlas)
void NzFont::SetAtlas(const std::shared_ptr<NzAbstractAtlas>& atlas)
{
if (m_atlas != atlas)
{