added object remove_listener so that you can get a message if some objects are remove...
[supertux.git] / lib / special / sprite_manager.h
index 8663081..2925e68 100644 (file)
 
 #include <map>
 
-#include "../special/sprite.h"
+#include "sprite.h"
 
 namespace SuperTux
-  {
+{
 
   class SpriteManager
-    {
-    private:
-      typedef std::map<std::string, Sprite*> Sprites;
-      Sprites sprites;
-    public:
-      SpriteManager(const std::string& filename);
-      ~SpriteManager();
-
-      void    load_resfile(const std::string& filename);
-      /** loads a sprite.
-       * WARNING: You must not delete the returned object.
-       */
-      Sprite* load(const std::string& name);
-    };
-
+  {
+  private:
+    typedef std::map<std::string, SpriteData*> Sprites;
+    Sprites sprites;
+  public:
+    SpriteManager(const std::string& filename);
+    ~SpriteManager();
+
+    void load_resfile(const std::string& filename);
+    /** loads a sprite.
+     * (contrary to the old api you have to delete the sprite!)
+     */
+    Sprite* create(const std::string& name);
+  };
 } //namespace SuperTux
 
 #endif /*SUPERTUX_SPRITE_MANAGER_H*/