[cppcheck] Part 1: Performance
[supertux.git] / src / object / infoblock.cpp
index 2bbb42f..d81fc93 100644 (file)
 #include "video/drawing_context.hpp"
 #include "sprite/sprite.hpp"
 
-namespace {
-const float SCROLL_DELAY = 0.5;
-const float SCROLL_DISTANCE = 16;
-const float WIDTH = 400;
-const float HEIGHT = 200;
-}
-
 InfoBlock::InfoBlock(const Reader& lisp) :
   Block(SpriteManager::current()->create("images/objects/bonus_block/infoblock.sprite")),
   message(),
@@ -60,7 +53,7 @@ InfoBlock::InfoBlock(const Reader& lisp) :
 
 InfoBlock::~InfoBlock()
 {
-  for(std::vector<InfoBoxLine*>::iterator i = lines.begin(); i != lines.end(); i++) {
+  for(std::vector<InfoBoxLine*>::iterator i = lines.begin(); i != lines.end(); ++i) {
     delete *i;
   }
 }
@@ -80,8 +73,8 @@ InfoBlock::hit(Player& player)
     // first hide all other InfoBlocks' messages in same sector
     Sector* parent = Sector::current();
     if (!parent) return;
-    for (Sector::GameObjects::iterator i = parent->gameobjects.begin(); i != parent->gameobjects.end(); i++) {
-      InfoBlock* block = dynamic_cast<InfoBlock*>(*i);
+    for (Sector::GameObjects::iterator i = parent->gameobjects.begin(); i != parent->gameobjects.end(); ++i) {
+      InfoBlock* block = dynamic_cast<InfoBlock*>(i->get());
       if (!block) continue;
       if (block != this) block->hide_message();
     }