summaryrefslogtreecommitdiffstats
path: root/src/model/Map.cpp
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-09-24 03:20:25 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-09-24 03:20:25 +0200
commit3c995acde81feae6c46a14fe7abbc6d2b434422b (patch)
tree34004193dfc64490662c519d5ef45e4c056d7690 /src/model/Map.cpp
parentba321783e7f66068a5a5379992a8e081a70bf243 (diff)
downloadrpgedit-3c995acde81feae6c46a14fe7abbc6d2b434422b.tar
rpgedit-3c995acde81feae6c46a14fe7abbc6d2b434422b.zip
Support multiple map layers, fix transparent tiles
Diffstat (limited to 'src/model/Map.cpp')
-rw-r--r--src/model/Map.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/model/Map.cpp b/src/model/Map.cpp
index db18baf..a770ee4 100644
--- a/src/model/Map.cpp
+++ b/src/model/Map.cpp
@@ -35,13 +35,22 @@ std::shared_ptr<Map> Map::load(__attribute__((unused)) const std::string &name)
std::shared_ptr<Map> map(new Map(16, 16));
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)
- map->setTileAt(i, j, 1);
+ map->setTileAt(0, i, j, 1);
+ else
+ map->setTileAt(0, i, j, 0);
+
+ if (4 <= i && i < 12 && j == 8)
+ map->setTileAt(1, i, j, 2);
else
- map->setTileAt(i, j, 0);
+ map->setTileAt(1, i, j, 0);
}
}