diff options
Diffstat (limited to 'src/model/Map.cpp')
-rw-r--r-- | src/model/Map.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/model/Map.cpp b/src/model/Map.cpp index a770ee4..aff05d1 100644 --- a/src/model/Map.cpp +++ b/src/model/Map.cpp @@ -32,14 +32,11 @@ namespace RPGEdit { namespace Model { std::shared_ptr<Map> Map::load(__attribute__((unused)) const std::string &name) { - std::shared_ptr<Map> map(new Map(16, 16)); + std::shared_ptr<Map> map(new Map(16, 16, 2)); map->tileset.push_back("dirt"); map->tileset.push_back("horizontal_bar"); - for (int i = 0; i < 2; i++) - map->tiles.emplace_back(new uint32_t[16*16]); - for (int i = 0; i < 16; i++) { for (int j = 0; j < 16; j++) { if (4 <= i && i < 12 && 4 <= j && j < 12) @@ -54,10 +51,8 @@ std::shared_ptr<Map> Map::load(__attribute__((unused)) const std::string &name) } } - map->playerEntity = std::make_shared<Entity>("square"); - map->playerEntity->moveTo(Model::Position{6, 6}); - - map->entities.push_back(map->playerEntity); + map->entities.emplace_back("square"); + map->entities.back().moveTo(Model::Position{6, 6}); return map; } |