diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-09-22 21:54:01 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-09-22 21:54:01 +0200 |
commit | fe0c3b733abf6eac5f4b5bc18f24f8a5cda1bfc4 (patch) | |
tree | 6f96e327b37fad557bd7cba7b45911c401f98ad2 /src/control/MapContext.cpp | |
parent | 6e67a0f13263b748718c692b4c6481a70b127fda (diff) | |
download | rpgedit-fe0c3b733abf6eac5f4b5bc18f24f8a5cda1bfc4.tar rpgedit-fe0c3b733abf6eac5f4b5bc18f24f8a5cda1bfc4.zip |
Render entities
Diffstat (limited to 'src/control/MapContext.cpp')
-rw-r--r-- | src/control/MapContext.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/control/MapContext.cpp b/src/control/MapContext.cpp index 4d3a4d7..5fda337 100644 --- a/src/control/MapContext.cpp +++ b/src/control/MapContext.cpp @@ -31,14 +31,18 @@ namespace RPGEdit { namespace Control { -MapContext::MapContext(TileLoader *tileLoader0, const std::shared_ptr<const Model::Map> &map0) - : tileLoader(tileLoader0), map(map0) { +MapContext::MapContext(ImageLoader *imageLoader0, const std::shared_ptr<const Model::Map> &map0) + : imageLoader(imageLoader0), map(map0) { const std::vector<std::string> &tileset = map->getTileset(); tiles.resize(tileset.size()); - for (size_t i = 0; i < tileset.size(); i++) - tiles[i] = tileLoader->get(tileset[i]); + tiles[i] = imageLoader->get("tile/" + tileset[i]); + + std::deque<std::shared_ptr<Model::Entity>> &mapEntities = map->getEntities(); + + for (const std::shared_ptr<Model::Entity> &entity : mapEntities) + entities[entity->getName()] = imageLoader->get("entity/" + entity->getName()); } } |