Renamed AbstractFontAtlas to AbstractAtlas

Former-commit-id: 2908a05a7d2d6d44e2e29e96c52cafe962382b71
This commit is contained in:
Lynix
2015-01-16 12:40:23 +01:00
parent e3de7e6f3c
commit 1781e93462
5 changed files with 30 additions and 32 deletions

View File

@@ -2,35 +2,34 @@
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/AbstractFontAtlas.hpp>
#include <Nazara/Utility/Font.hpp>
#include <Nazara/Utility/AbstractAtlas.hpp>
#include <Nazara/Utility/Debug.hpp>
NzAbstractFontAtlas::NzAbstractFontAtlas() :
NzAbstractAtlas::NzAbstractAtlas() :
m_listenersLocked(false)
{
}
NzAbstractFontAtlas::~NzAbstractFontAtlas()
NzAbstractAtlas::~NzAbstractAtlas()
{
m_listenersLocked = true;
for (auto& pair : m_listeners)
pair.first->OnAtlasReleased(this, pair.second);
}
void NzAbstractFontAtlas::AddListener(Listener* listener, void* userdata) const
void NzAbstractAtlas::AddListener(Listener* listener, void* userdata) const
{
if (!m_listenersLocked)
m_listeners.insert(std::make_pair(listener, userdata));
}
void NzAbstractFontAtlas::RemoveListener(Listener* listener) const
void NzAbstractAtlas::RemoveListener(Listener* listener) const
{
if (!m_listenersLocked)
m_listeners.erase(listener);
}
void NzAbstractFontAtlas::NotifyCleared()
void NzAbstractAtlas::NotifyCleared()
{
m_listenersLocked = true;
@@ -46,9 +45,9 @@ void NzAbstractFontAtlas::NotifyCleared()
m_listenersLocked = false;
}
NzAbstractFontAtlas::Listener::~Listener() = default;
NzAbstractAtlas::Listener::~Listener() = default;
bool NzAbstractFontAtlas::Listener::OnAtlasCleared(const NzAbstractFontAtlas* atlas, void* userdata)
bool NzAbstractAtlas::Listener::OnAtlasCleared(const NzAbstractAtlas* atlas, void* userdata)
{
NazaraUnused(atlas);
NazaraUnused(userdata);
@@ -56,7 +55,7 @@ bool NzAbstractFontAtlas::Listener::OnAtlasCleared(const NzAbstractFontAtlas* at
return true;
}
void NzAbstractFontAtlas::Listener::OnAtlasReleased(const NzAbstractFontAtlas* atlas, void* userdata)
void NzAbstractAtlas::Listener::OnAtlasReleased(const NzAbstractAtlas* atlas, void* userdata)
{
NazaraUnused(atlas);
NazaraUnused(userdata);

View File

@@ -101,7 +101,7 @@ bool NzFont::ExtractGlyph(unsigned int characterSize, char32_t character, nzUInt
return m_data->ExtractGlyph(characterSize, character, style, glyph);
}
const NzAbstractFontAtlas* NzFont::GetAtlas() const
const NzAbstractAtlas* NzFont::GetAtlas() const
{
return m_atlas.get();
}
@@ -265,7 +265,7 @@ bool NzFont::OpenFromStream(NzInputStream& stream, const NzFontParams& params)
return NzFontLoader::LoadFromStream(this, stream, params);
}
void NzFont::SetAtlas(std::shared_ptr<NzAbstractFontAtlas> atlas)
void NzFont::SetAtlas(std::shared_ptr<NzAbstractAtlas> atlas)
{
ClearGlyphCache();
@@ -314,7 +314,7 @@ nzUInt64 NzFont::ComputeKey(unsigned int characterSize, nzUInt32 style) const
return (stylePart << 32) | sizePart;
}
bool NzFont::OnAtlasCleared(const NzAbstractFontAtlas* atlas, void* userdata)
bool NzFont::OnAtlasCleared(const NzAbstractAtlas* atlas, void* userdata)
{
NazaraUnused(atlas);
NazaraUnused(userdata);
@@ -335,7 +335,7 @@ bool NzFont::OnAtlasCleared(const NzAbstractFontAtlas* atlas, void* userdata)
return true;
}
void NzFont::OnAtlasReleased(const NzAbstractFontAtlas* atlas, void* userdata)
void NzFont::OnAtlasReleased(const NzAbstractAtlas* atlas, void* userdata)
{
NazaraUnused(atlas);
NazaraUnused(userdata);