X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fobject%2Ftilemap.hpp;h=da17b5de1395b166cd45153e883bcf66d4e1f291;hb=35fa1ef8cc5d73d7b6d0a13873e3eadf35d873f5;hp=28f9407d4fc0aa37cd8c95b9870e4ff70f71b609;hpb=09c91c0f9f096f2b045912b2bfbbd27ea25d00fa;p=supertux.git diff --git a/src/object/tilemap.hpp b/src/object/tilemap.hpp index 28f9407d4..da17b5de1 100644 --- a/src/object/tilemap.hpp +++ b/src/object/tilemap.hpp @@ -17,6 +17,8 @@ #ifndef HEADER_SUPERTUX_OBJECT_TILEMAP_HPP #define HEADER_SUPERTUX_OBJECT_TILEMAP_HPP +#include + #include "object/path_walker.hpp" #include "supertux/game_object.hpp" #include "supertux/script_interface.hpp" @@ -34,7 +36,7 @@ class TileSet; /** * This class is responsible for drawing the level tiles */ -class TileMap : public GameObject, +class TileMap : public GameObject, public ScriptInterface { public: @@ -76,7 +78,10 @@ public: Vector get_offset() const { return offset; } - Vector get_movement(bool actual = false) const + /** Get the movement of this tilemap. The collision detection code may need a + * non-negative y-movement. Passing `false' as the `actual' argument will + * provide that. Used exclusively in src/supertux/sector.cpp. */ + Vector get_movement(bool actual) const { if(actual) { return movement; @@ -85,11 +90,14 @@ public: } } - Path *get_path() - { return path.get(); } + boost::shared_ptr get_path() + { return path; } + + boost::shared_ptr get_walker() + { return walker; } - void set_offset(const Vector &offset) - { this->offset = offset; } + void set_offset(const Vector &offset_) + { this->offset = offset_; } /* Returns the position of the upper-left corner of * tile (x, y) in the sector. */ @@ -185,8 +193,8 @@ private: float current_alpha; /**< current tilemap opacity */ float remaining_fade_time; /**< seconds until requested tilemap opacity is reached */ - std::auto_ptr path; - std::auto_ptr walker; + boost::shared_ptr path; + boost::shared_ptr walker; DrawingContext::Target draw_target; /**< set to LIGHTMAP to draw to lightmap */