diff options
Diffstat (limited to 'src/world.cpp')
-rw-r--r-- | src/world.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/world.cpp b/src/world.cpp index d7639c2..365345d 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -359,6 +359,17 @@ void WorldSystem::load(const std::string& file) vec2(0, 0)); } else if (tname == "Portal") { entity.assign<Portal>(wxml->StrAttribute("inside")); + } else if (tname == "Solid") { + vec2 dim; + + if (abcd->Attribute("value") != nullptr) { + dim = str2coord(abcd->StrAttribute("value")); + } else { + dim = entity.component<Sprite>().get()->getSpriteSize(); + } + + float cdat[2] = {dim.x, dim.y}; + entity.assign<Solid>(cdat[0], cdat[1]); } abcd = abcd->NextSiblingElement(); |