X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fsprite%2Fsprite_manager.hpp;h=070a29420aa441e91791d4805e64006103eea2e4;hb=HEAD;hp=dcdcbf9368e10446ece966886c98c2ba59d9bb4c;hpb=5b7f9214cb929399f1a855ef5807018a9447d510;p=supertux.git diff --git a/src/sprite/sprite_manager.hpp b/src/sprite/sprite_manager.hpp index dcdcbf936..070a29420 100644 --- a/src/sprite/sprite_manager.hpp +++ b/src/sprite/sprite_manager.hpp @@ -1,43 +1,48 @@ -// $Id$ -// // SuperTux -// Copyright (C) 2004 Ingo Ruhnke +// Copyright (C) 2006 Matthias Braun // -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// along with this program. If not, see . -#ifndef SUPERTUX_SPRITE_MANAGER_H -#define SUPERTUX_SPRITE_MANAGER_H +#ifndef HEADER_SUPERTUX_SPRITE_SPRITE_MANAGER_HPP +#define HEADER_SUPERTUX_SPRITE_SPRITE_MANAGER_HPP #include +#include +#include + +#include "sprite/sprite_ptr.hpp" +#include "util/currenton.hpp" -#include "sprite.hpp" +class SpriteData; -class SpriteManager +class SpriteManager : public Currenton { private: - typedef std::map Sprites; - Sprites sprites; + typedef std::map 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); + SpriteManager(); + ~SpriteManager(); + + /** loads a sprite. */ + SpritePtr create(const std::string& filename); + +private: + SpriteData* load(const std::string& filename); }; #endif + +/* EOF */