class TileManager
{
private:
- TileManager();
- ~TileManager();
-
typedef std::vector<Tile*> Tiles;
Tiles tiles;
static TileManager* instance_ ;
std::set<TileGroup> tilegroups;
+
+ std::string tiles_path;
+
void load_tileset(std::string filename);
public:
- static TileManager* instance()
- { return instance_ ? instance_ : instance_ = new TileManager(); }
- static void destroy_instance()
- { delete instance_; instance_ = 0; }
+ TileManager(const std::string& filename);
+ ~TileManager();
const std::set<TileGroup>& get_tilegroups() const
{
const Tile* get(uint32_t id) const
{
+ //FIXME: Commenting out tiles in sprites.strf makes tiles.size() fail - it's being set to the first tile commented out.
assert(id < tiles.size());
Tile* tile = tiles[id];
if(!tile) {
}
if(tile->images.size() == 0 && tile->imagespecs.size() != 0)
- tile->load_images();
+ tile->load_images(tiles_path);
return tile;
}
{
return tiles.size();
}
+
+ int get_default_width() const
+ {
+ return 32;
+ }
+
+ int get_default_height() const
+ {
+ return 32;
+ }
};
#endif