diff options
Diffstat (limited to 'src/map.cpp')
-rw-r--r-- | src/map.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/map.cpp b/src/map.cpp index c3ac828..8d0ada6 100644 --- a/src/map.cpp +++ b/src/map.cpp | |||
@@ -71,12 +71,20 @@ Map::Map(std::string_view name) : name_(name) { | |||
71 | } else if (layer->getType() == tmx::Layer::Type::Object) { | 71 | } else if (layer->getType() == tmx::Layer::Type::Object) { |
72 | const auto& objectLayer = layer->getLayerAs<tmx::ObjectGroup>(); | 72 | const auto& objectLayer = layer->getLayerAs<tmx::ObjectGroup>(); |
73 | 73 | ||
74 | bool masked = false; | ||
75 | for (const tmx::Property& property : objectLayer.getProperties()) { | ||
76 | if (property.getName() == "masked" && property.getBoolValue()) { | ||
77 | masked = true; | ||
78 | } | ||
79 | } | ||
80 | |||
74 | for (const tmx::Object& object : objectLayer.getObjects()) { | 81 | for (const tmx::Object& object : objectLayer.getObjects()) { |
75 | if (object.getType() == "sprite") { | 82 | if (object.getType() == "sprite") { |
76 | Prototype p; | 83 | Prototype p; |
77 | p.name = object.getName(); | 84 | p.name = object.getName(); |
78 | p.pos.x() = object.getPosition().x; | 85 | p.pos.x() = object.getPosition().x; |
79 | p.pos.y() = object.getPosition().y; | 86 | p.pos.y() = object.getPosition().y; |
87 | p.masked = masked; | ||
80 | 88 | ||
81 | for (const tmx::Property& property : object.getProperties()) { | 89 | for (const tmx::Property& property : object.getProperties()) { |
82 | if (property.getName() == "collisionOffsetX") { | 90 | if (property.getName() == "collisionOffsetX") { |
@@ -159,6 +167,8 @@ Map::Map(std::string_view name) : name_(name) { | |||
159 | for (const tmx::Property& property : mapfile.getProperties()) { | 167 | for (const tmx::Property& property : mapfile.getProperties()) { |
160 | if (property.getName() == "music") { | 168 | if (property.getName() == "music") { |
161 | music_ = property.getStringValue(); | 169 | music_ = property.getStringValue(); |
170 | } else if (property.getName() == "maskZone") { | ||
171 | maskZone_ = property.getStringValue(); | ||
162 | } | 172 | } |
163 | } | 173 | } |
164 | } | 174 | } |