Make tux and yeti dying state not reveal secret tilemaps
[supertux.git] / src / object / text_object.cpp
index efe8708..ea1e4eb 100644 (file)
 #include "object/text_object.hpp"
 
 #include "scripting/squirrel_util.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/resources.hpp"
 #include "video/drawing_context.hpp"
 
-TextObject::TextObject(std::string name) :
+TextObject::TextObject(std::string name_) :
   font(),
   text(),
-  fading(0), 
-  fadetime(0), 
-  visible(false), 
+  fading(0),
+  fadetime(0),
+  visible(false),
   centered(),
   anchor(ANCHOR_MIDDLE),
   pos(0, 0)
 {
-  this->name = name;
-  font = normal_font;
+  this->name = name_;
+  font = Resources::normal_font;
   centered = false;
 }
 
@@ -46,7 +46,7 @@ TextObject::expose(HSQUIRRELVM vm, SQInteger table_idx)
   if (name.empty())
     return;
 
-  Scripting::expose_object(vm, table_idx, dynamic_cast<Scripting::Text *>(this), name, false);
+  scripting::expose_object(vm, table_idx, dynamic_cast<scripting::Text *>(this), name, false);
 }
 
 void
@@ -55,55 +55,55 @@ TextObject::unexpose(HSQUIRRELVM vm, SQInteger table_idx)
   if (name.empty())
     return;
 
-  Scripting::unexpose_object(vm, table_idx, name);
+  scripting::unexpose_object(vm, table_idx, name);
 }
 
 void
-TextObject::set_font(const std::string& name)
+TextObject::set_font(const std::string& name_)
 {
-  if(name == "normal") {
-    font = normal_font;
-  } else if(name == "big") {
-    font = big_font;
-  } else if(name == "small") {
-    font = small_font;
+  if(name_ == "normal") {
+    font = Resources::normal_font;
+  } else if(name_ == "big") {
+    font = Resources::big_font;
+  } else if(name_ == "small") {
+    font = Resources::small_font;
   } else {
-    log_warning << "Unknown font '" << name << "'." << std::endl;
-    font = normal_font;
+    log_warning << "Unknown font '" << name_ << "'." << std::endl;
+    font = Resources::normal_font;
   }
 }
 
 void
-TextObject::set_text(const std::string& text)
+TextObject::set_text(const std::string& text_)
 {
-  this->text = text;
+  this->text = text_;
 }
 
 void
-TextObject::fade_in(float fadetime)
+TextObject::fade_in(float fadetime_)
 {
-  this->fadetime = fadetime;
-  fading = fadetime;
+  this->fadetime = fadetime_;
+  fading = fadetime_;
 }
 
 void
-TextObject::fade_out(float fadetime)
+TextObject::fade_out(float fadetime_)
 {
-  this->fadetime = fadetime;
-  fading = -fadetime;
+  this->fadetime = fadetime_;
+  fading = -fadetime_;
 }
 
 void
-TextObject::set_visible(bool visible)
+TextObject::set_visible(bool visible_)
 {
-  this->visible = visible;
+  this->visible = visible_;
   fading = 0;
 }
 
 void
-TextObject::set_centered(bool centered)
+TextObject::set_centered(bool centered_)
 {
-  this->centered = centered;
+  this->centered = centered_;
 }
 
 void
@@ -122,7 +122,7 @@ TextObject::draw(DrawingContext& context)
 
   float width  = 500;
   float height = 70;
-  Vector spos = pos + get_anchor_pos(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT),
+  Vector spos = pos + get_anchor_pos(Rectf(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT),
                                      width, height, anchor);
 
   context.draw_filled_rect(spos, Vector(width, height),