summaryrefslogtreecommitdiffstats
path: root/src/control/MapContext.cpp
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-09-24 02:27:30 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-09-24 02:27:30 +0200
commitb5c7b4a162a780980b3ecacf0edd49541888a0a8 (patch)
treea401b50e2e8071fc6aec6b5392997b902e1b721d /src/control/MapContext.cpp
parentea8840291cdf66784c6a2cb465b63ccfb5483c38 (diff)
downloadrpgedit-b5c7b4a162a780980b3ecacf0edd49541888a0a8.tar
rpgedit-b5c7b4a162a780980b3ecacf0edd49541888a0a8.zip
Move more SDL-specific things to the view
Diffstat (limited to 'src/control/MapContext.cpp')
-rw-r--r--src/control/MapContext.cpp15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/control/MapContext.cpp b/src/control/MapContext.cpp
index a981e8a..5c715db 100644
--- a/src/control/MapContext.cpp
+++ b/src/control/MapContext.cpp
@@ -31,19 +31,8 @@ namespace RPGEdit {
namespace Control {
-MapContext::MapContext(EventBus *eventBus0, InputHandler *inputHandler0, ImageLoader *imageLoader0, const std::shared_ptr<const Model::Map> &map0)
- : eventBus(eventBus0), inputHandler(inputHandler0), 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] = 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());
-
+MapContext::MapContext(EventBus *eventBus0, InputHandler *inputHandler0, const std::shared_ptr<const Model::Map> &map0)
+ : eventBus(eventBus0), inputHandler(inputHandler0), map(map0) {
inputHandler->registerListener(
[this] (uint16_t key, bool pressed, uint64_t time) {
if (pressed)