From 5ff15c08d48f7f29431d509cd9c8cab794c95671 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Thu, 25 Jul 2013 22:08:51 +0000 Subject: [PATCH] core: Text constructor now wants a String object. --- src/text.cpp | 7 +++---- src/text.h | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/text.cpp b/src/text.cpp index 8763995d..b9d6520e 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -41,18 +41,17 @@ private: * Public Text class */ -Text::Text(char const *text, char const *font) +Text::Text(String const &text, char const *font) : data(new TextData()) { data->font = Forge::Register(font); - if (text) - data->m_text = text; + data->m_text = text; data->pos = vec3(0, 0, 0); m_drawgroup = DRAWGROUP_HUD; } -void Text::SetText(char const *text) +void Text::SetText(String const &text) { data->m_text = text; } diff --git a/src/text.h b/src/text.h index 9fd39f86..56112013 100644 --- a/src/text.h +++ b/src/text.h @@ -26,10 +26,10 @@ class TextData; class Text : public Entity { public: - Text(char const *text, char const *font); + Text(String const &text, char const *font); virtual ~Text(); - void SetText(char const *text); + void SetText(String const &text); void SetInt(int val); void SetPos(vec3 pos); vec3 GetPos();