src/worldmap/teleporter.cpp

Go to the documentation of this file.
00001 //  SuperTux - Teleporter Worldmap Tile
00002 //  Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de>
00003 //
00004 //  This program is free software: you can redistribute it and/or modify
00005 //  it under the terms of the GNU General Public License as published by
00006 //  the Free Software Foundation, either version 3 of the License, or
00007 //  (at your option) any later version.
00008 //
00009 //  This program is distributed in the hope that it will be useful,
00010 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 //  GNU General Public License for more details.
00013 //
00014 //  You should have received a copy of the GNU General Public License
00015 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016 #include <config.h>
00017 
00018 #include "sprite/sprite.hpp"
00019 #include "sprite/sprite_manager.hpp"
00020 #include "util/reader.hpp"
00021 #include "video/drawing_context.hpp"
00022 #include "worldmap/teleporter.hpp"
00023 
00024 namespace worldmap {
00025 
00026 Teleporter::Teleporter(const Reader& lisp) :
00027   pos(),
00028   sprite(),
00029   worldmap(),
00030   spawnpoint(),
00031   automatic(false),
00032   message()
00033 {
00034   lisp.get("x", pos.x);
00035   lisp.get("y", pos.y);
00036 
00037   std::string spritefile = "";
00038   if (lisp.get("sprite", spritefile)) {
00039     sprite = sprite_manager->create(spritefile);
00040   }
00041 
00042   lisp.get("worldmap", worldmap);
00043   lisp.get("spawnpoint", spawnpoint);
00044   lisp.get("automatic", automatic);
00045   lisp.get("message", message);
00046 }
00047 
00048 void
00049 Teleporter::draw(DrawingContext& context)
00050 {
00051   if (sprite.get() != 0) sprite->draw(context, pos*32 + Vector(16, 16), LAYER_OBJECTS - 1);
00052 }
00053 
00054 void
00055 Teleporter::update(float )
00056 {
00057 }
00058 
00059 } // namespace worldmap
00060 
00061 /* EOF */

Generated on Mon Jun 9 03:38:24 2014 for SuperTux by  doxygen 1.5.1