(SimpleTextDrawer) Fixed some methods visibility

Former-commit-id: 39bad2d5e64f7132f5cd4d4a949d6d3fbb5b98e1
This commit is contained in:
Lynix 2015-04-01 20:14:03 +02:00
parent 000073bd42
commit fca2dad9d3
2 changed files with 38 additions and 39 deletions

View File

@ -25,6 +25,10 @@ class NAZARA_API NzSimpleTextDrawer : public NzAbstractTextDrawer, NzObjectListe
unsigned int GetCharacterSize() const;
const NzColor& GetColor() const;
NzFont* GetFont() const;
NzFont* GetFont(unsigned int index) const override;
unsigned int GetFontCount() const override;
const Glyph& GetGlyph(unsigned int index) const override;
unsigned int GetGlyphCount() const override;
nzUInt32 GetStyle() const;
const NzString& GetText() const;
@ -38,11 +42,6 @@ class NAZARA_API NzSimpleTextDrawer : public NzAbstractTextDrawer, NzObjectListe
static NzSimpleTextDrawer Draw(NzFont* font, const NzString& str, unsigned int characterSize, nzUInt32 style = nzTextStyle_Regular, const NzColor& color = NzColor::White);
private:
NzFont* GetFont(unsigned int index) const override;
unsigned int GetFontCount() const override;
const Glyph& GetGlyph(unsigned int index) const override;
unsigned int GetGlyphCount() const override;
bool OnObjectModified(const NzRefCounted* object, int index, unsigned int code) override;
void OnObjectReleased(const NzRefCounted* object, int index) override;
void UpdateGlyphs() const;

View File

@ -37,6 +37,40 @@ NzFont* NzSimpleTextDrawer::GetFont() const
return m_font;
}
NzFont* NzSimpleTextDrawer::GetFont(unsigned int index) const
{
#if NAZARA_UTILITY_SAFE
if (index > 0)
{
NazaraError("Font index out of range (" + NzString::Number(index) + " >= 1)");
return nullptr;
}
#endif
return m_font;
}
unsigned int NzSimpleTextDrawer::GetFontCount() const
{
return 1;
}
const NzAbstractTextDrawer::Glyph& NzSimpleTextDrawer::GetGlyph(unsigned int index) const
{
if (!m_glyphUpdated)
UpdateGlyphs();
return m_glyphs[index];
}
unsigned int NzSimpleTextDrawer::GetGlyphCount() const
{
if (!m_glyphUpdated)
UpdateGlyphs();
return m_glyphs.size();
}
nzUInt32 NzSimpleTextDrawer::GetStyle() const
{
return m_style;
@ -106,40 +140,6 @@ NzSimpleTextDrawer NzSimpleTextDrawer::Draw(NzFont* font, const NzString& str, u
return drawer;
}
NzFont* NzSimpleTextDrawer::GetFont(unsigned int index) const
{
#if NAZARA_UTILITY_SAFE
if (index > 0)
{
NazaraError("Font index out of range (" + NzString::Number(index) + " >= 1)");
return nullptr;
}
#endif
return m_font;
}
unsigned int NzSimpleTextDrawer::GetFontCount() const
{
return 1;
}
const NzAbstractTextDrawer::Glyph& NzSimpleTextDrawer::GetGlyph(unsigned int index) const
{
if (!m_glyphUpdated)
UpdateGlyphs();
return m_glyphs[index];
}
unsigned int NzSimpleTextDrawer::GetGlyphCount() const
{
if (!m_glyphUpdated)
UpdateGlyphs();
return m_glyphs.size();
}
bool NzSimpleTextDrawer::OnObjectModified(const NzRefCounted* object, int index, unsigned int code)
{
NazaraUnused(object);