bool Tile::draw_editor_images = false;
-Tile::Tile(const TileSet& new_tileset) :
- tileset(new_tileset),
+Tile::Tile() :
imagespecs(),
images(),
editor_imagespecs(),
{
}
-Tile::Tile(const TileSet& new_tileset, const std::vector<ImageSpec>& imagespecs_, const std::vector<ImageSpec>& editor_imagespecs_,
+Tile::Tile(const std::vector<ImageSpec>& imagespecs_, const std::vector<ImageSpec>& editor_imagespecs_,
uint32_t attributes, uint32_t data, float fps) :
- tileset(new_tileset),
imagespecs(imagespecs_),
images(),
editor_imagespecs(editor_imagespecs_),
#include "video/surface.hpp"
#include "util/reader_fwd.hpp"
-class TileSet;
class DrawingContext;
class Tile
};
private:
- const TileSet& tileset;
std::vector<ImageSpec> imagespecs;
std::vector<SurfacePtr> images;
std::vector<ImageSpec> editor_imagespecs;
float fps;
public:
- Tile(const TileSet& tileset);
- Tile(const TileSet& tileset, const std::vector<ImageSpec>& images, const std::vector<ImageSpec>& editor_images,
+ Tile();
+ Tile(const std::vector<ImageSpec>& images, const std::vector<ImageSpec>& editor_images,
uint32_t attributes, uint32_t data, float fps);
~Tile();
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);
if(images)
imagespecs = parse_tile_images(*images);
- std::auto_ptr<Tile> tile(new Tile(m_tileset, imagespecs, editor_imagespecs, attributes, data, fps));
+ std::auto_ptr<Tile> tile(new Tile(imagespecs, editor_imagespecs, attributes, data, fps));
if (id >= m_tileset.tiles.size())
m_tileset.tiles.resize(id+1, 0);
editor_imagespecs.push_back(Tile::ImageSpec(m_tiles_path + *j, Rectf(x, y, x + 32, y + 32)));
}
- std::auto_ptr<Tile> tile(new Tile(m_tileset, imagespecs, editor_imagespecs,
+ std::auto_ptr<Tile> 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();