From a26fe6fbf33254af82163e2d0c09ca887d4d40df Mon Sep 17 00:00:00 2001 From: Matt Mullins Date: Tue, 12 Jun 2012 22:58:49 -0700 Subject: [PATCH] Formatting and variable name changes for Text constructors. --- Text.cpp | 25 ++++++++++++++++++++----- Text.h | 4 ++-- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/Text.cpp b/Text.cpp index 9ca64b4..7d3f4af 100644 --- a/Text.cpp +++ b/Text.cpp @@ -6,15 +6,29 @@ #include using namespace std; -Text::Text(string filename, FontType t, int s, SDL_Color c, int w, int h ) : WorldObject(filename), mFont(Game::game()->getCurrentLevel()->getFont(s, t)), color(c), width(w), height(h) { +Text::Text(string id, FontType t, int s, SDL_Color c, int w, int h) + : WorldObject(id), + mFont(Game::game()->getCurrentLevel()->getFont(s, t)), + color(c), + width(w), + height(h) +{ } -Text::Text(string name, string t, int s, SDL_Color c, int w, int h) : WorldObject(name), text(t), mFont(Game::game()->getCurrentLevel()->getFont(s, (FontType)0)), color(c), width(w), height(h) { +Text::Text(string name, string t, int s, SDL_Color c, int w, int h) + : WorldObject(name), + text(t), + mFont(Game::game()->getCurrentLevel()->getFont(s, (FontType)0)), + color(c), + width(w), + height(h) +{ } -Text::~Text() { +Text::~Text() +{ Game::game()->getCurrentLevel()->closeFont(mFont); } @@ -73,5 +87,6 @@ void Text::draw() glDeleteTextures(1, &texture); } -void Text::update() { -} \ No newline at end of file +void Text::update() +{ +} diff --git a/Text.h b/Text.h index c7de0f8..10e411b 100644 --- a/Text.h +++ b/Text.h @@ -17,7 +17,7 @@ using namespace std; */ class Text : public WorldObject { - public: +public: Font* mFont; string text; SDL_Color color; @@ -26,7 +26,7 @@ class Text : public WorldObject int width; int height; Text(string name, string t, int size = 24, SDL_Color c = WHITE, int w = 600, int h = 150); - Text(string filename, FontType t, int size = 24, SDL_Color c = WHITE, int w = 600, int h = 150); + Text(string id, FontType t, int size = 24, SDL_Color c = WHITE, int w = 600, int h = 150); ~Text(); }; #endif -- 2.11.0