summaryrefslogtreecommitdiffstats
path: root/src/model/Map.cpp
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-09-26 03:13:26 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-09-26 03:13:26 +0200
commit124116a8bf56ccc742e6efcb3b9e83abe97bf143 (patch)
tree7ab23aab342477c80af3a0e5c8fb98da90c94548 /src/model/Map.cpp
parent9b91d6f3d0187e0daf29a262cf19ad08ba2b7cf5 (diff)
downloadrpgedit-124116a8bf56ccc742e6efcb3b9e83abe97bf143.tar
rpgedit-124116a8bf56ccc742e6efcb3b9e83abe97bf143.zip
Extend map model with rotated tiles
Diffstat (limited to 'src/model/Map.cpp')
-rw-r--r--src/model/Map.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/model/Map.cpp b/src/model/Map.cpp
index 749b25f..cb1cb30 100644
--- a/src/model/Map.cpp
+++ b/src/model/Map.cpp
@@ -87,8 +87,9 @@ void Map::finishEntityTransition(Entity *entity) {
std::unique_ptr<Map> Map::load(__attribute__((unused)) const std::string &name) {
std::unique_ptr<Map> map(new Map(16, 16, 2));
- map->tileset.push_back("dirt");
- map->tileset.push_back("horizontal_bar");
+ map->tileset.emplace_back("dirt", 0);
+ map->tileset.emplace_back("horizontal_bar", 0);
+ map->tileset.emplace_back("horizontal_bar", 2);
for (int i = 0; i < 16; i++) {
for (int j = 0; j < 16; j++) {
@@ -100,7 +101,9 @@ std::unique_ptr<Map> Map::load(__attribute__((unused)) const std::string &name)
map->setTileAt(0, Position<int>{i, j}, 0);
}
- if (4 <= i && i < 12 && j == 8)
+ if (4 <= i && i < 12 && j == 7)
+ map->setTileAt(1, Position<int>{i, j}, 3);
+ else if (4 <= i && i < 12 && j == 8)
map->setTileAt(1, Position<int>{i, j}, 2);
else
map->setTileAt(1, Position<int>{i, j}, 0);