From: Ingo Ruhnke Date: Tue, 2 Mar 2010 19:36:22 +0000 (+0000) Subject: Removed unused TileSet member variable from Tile X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=38e226e68e7f0cd8845ff57ff688079150f0f9f0;p=supertux.git Removed unused TileSet member variable from Tile SVN-Revision: 6522 --- diff --git a/src/supertux/tile.cpp b/src/supertux/tile.cpp index a0b73e149..fbc90716b 100644 --- a/src/supertux/tile.cpp +++ b/src/supertux/tile.cpp @@ -22,8 +22,7 @@ bool Tile::draw_editor_images = false; -Tile::Tile(const TileSet& new_tileset) : - tileset(new_tileset), +Tile::Tile() : imagespecs(), images(), editor_imagespecs(), @@ -34,9 +33,8 @@ Tile::Tile(const TileSet& new_tileset) : { } -Tile::Tile(const TileSet& new_tileset, const std::vector& imagespecs_, const std::vector& editor_imagespecs_, +Tile::Tile(const std::vector& imagespecs_, const std::vector& editor_imagespecs_, uint32_t attributes, uint32_t data, float fps) : - tileset(new_tileset), imagespecs(imagespecs_), images(), editor_imagespecs(editor_imagespecs_), diff --git a/src/supertux/tile.hpp b/src/supertux/tile.hpp index 60b3991fb..c2b9bc593 100644 --- a/src/supertux/tile.hpp +++ b/src/supertux/tile.hpp @@ -25,7 +25,6 @@ #include "video/surface.hpp" #include "util/reader_fwd.hpp" -class TileSet; class DrawingContext; class Tile @@ -93,7 +92,6 @@ public: }; private: - const TileSet& tileset; std::vector imagespecs; std::vector images; std::vector editor_imagespecs; @@ -108,8 +106,8 @@ private: float fps; public: - Tile(const TileSet& tileset); - Tile(const TileSet& tileset, const std::vector& images, const std::vector& editor_images, + Tile(); + Tile(const std::vector& images, const std::vector& editor_images, uint32_t attributes, uint32_t data, float fps); ~Tile(); diff --git a/src/supertux/tile_set.cpp b/src/supertux/tile_set.cpp index 475f4a441..f7450ec86 100644 --- a/src/supertux/tile_set.cpp +++ b/src/supertux/tile_set.cpp @@ -23,7 +23,7 @@ TileSet::TileSet() : tiles_loaded(false) { tiles.resize(1, 0); - tiles[0] = new Tile(*this); + tiles[0] = new Tile(); } TileSet::TileSet(const std::string& filename) : diff --git a/src/supertux/tile_set_parser.cpp b/src/supertux/tile_set_parser.cpp index 42080a966..5daaa4599 100644 --- a/src/supertux/tile_set_parser.cpp +++ b/src/supertux/tile_set_parser.cpp @@ -38,7 +38,7 @@ TileSetParser::parse() m_tiles_path = FileSystem::dirname(m_filename); m_tileset.tiles.resize(1, 0); - m_tileset.tiles[0] = new Tile(m_tileset); + m_tileset.tiles[0] = new Tile(); lisp::Parser parser; const lisp::Lisp* root = parser.parse(m_filename); @@ -137,7 +137,7 @@ TileSetParser::parse_tile(const Reader& reader) if(images) imagespecs = parse_tile_images(*images); - std::auto_ptr tile(new Tile(m_tileset, imagespecs, editor_imagespecs, attributes, data, fps)); + std::auto_ptr tile(new Tile(imagespecs, editor_imagespecs, attributes, data, fps)); if (id >= m_tileset.tiles.size()) m_tileset.tiles.resize(id+1, 0); @@ -299,7 +299,7 @@ TileSetParser::parse_tiles(const Reader& reader) editor_imagespecs.push_back(Tile::ImageSpec(m_tiles_path + *j, Rectf(x, y, x + 32, y + 32))); } - std::auto_ptr tile(new Tile(m_tileset, imagespecs, editor_imagespecs, + std::auto_ptr tile(new Tile(imagespecs, editor_imagespecs, (has_attributes ? attributes[i] : 0), (has_datas ? datas[i] : 0), fps)); if (m_tileset.tiles[ids[i]] == 0) { m_tileset.tiles[ids[i]] = tile.release();