From fdc0c55bbceba474750a30a8300dfcb309ccc7d3 Mon Sep 17 00:00:00 2001 From: grumbel Date: Tue, 2 Mar 2010 19:36:22 +0000 Subject: [PATCH] Removed unused TileSet member variable from Tile git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6522 837edb03-e0f3-0310-88ca-d4d4e8b29345 --- src/supertux/tile.cpp | 6 ++---- src/supertux/tile.hpp | 6 ++---- src/supertux/tile_set.cpp | 2 +- src/supertux/tile_set_parser.cpp | 6 +++--- 4 files changed, 8 insertions(+), 12 deletions(-) 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(); -- 2.11.0