Background can now render three images: Top, Center and Bottom
[supertux.git] / src / object / platform.cpp
index 9bbc5fe..a28ec87 100644 (file)
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //  02111-1307, USA.
-
 #include <config.h>
 
 #include "platform.hpp"
+
+#include "msg.hpp"
 #include "video/drawing_context.hpp"
 #include "resources.hpp"
 #include "player.hpp"
@@ -36,19 +37,20 @@ Platform::Platform(const lisp::Lisp& reader)
   reader.get("x", bbox.p1.x);
   reader.get("y", bbox.p1.y);
   reader.get("type", type);
-  reader.get("use_path", use_path);
-  sprite = sprite_manager->create("platform");
+  reader.get("path", use_path);
+  sprite = sprite_manager->create("images/objects/flying_platform/platform.sprite");
   sprite->set_action(type);
   bbox.set_size(sprite->get_width(), sprite->get_height());
 
   flags |= FLAG_SOLID;
 
   path = Path::GetByName(use_path);
-  if (path == NULL) { 
-     std::cerr << "Warning: Path for moving platform not found! Make sure that the name is spelled correctly,\nand that the path is initialized before the platform in the level file!\n";
+
+  if (path == NULL) {
+    msg_warning("Path \"" << use_path << "\" for moving platform not found! Make sure that the name is spelled correctly and that the path is initialized before the platform in the level file!");
   }
 
-  path_offset = bbox.p1 - path->GetStart();
+  path_offset = bbox.p1;
 }
 
 Platform::~Platform()