diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/core/StarDirectives.cpp | 10 | ||||
-rw-r--r-- | source/game/StarParallax.cpp | 12 |
2 files changed, 15 insertions, 7 deletions
diff --git a/source/core/StarDirectives.cpp b/source/core/StarDirectives.cpp index 6208b97..4db3837 100644 --- a/source/core/StarDirectives.cpp +++ b/source/core/StarDirectives.cpp @@ -277,8 +277,14 @@ String DirectivesGroup::toString() const { void DirectivesGroup::addToString(String& string) const { for (auto& directives : m_directives) - if (directives.shared) - string += directives.shared->string; + if (directives.shared) { + auto& dirString = directives.shared->string; + if (!dirString.empty()) { + if (dirString.utf8().front() != '?') + string += "?"; + string += dirString; + } + } } void DirectivesGroup::forEach(DirectivesCallback callback) const { diff --git a/source/game/StarParallax.cpp b/source/game/StarParallax.cpp index fe20f95..8ebb391 100644 --- a/source/game/StarParallax.cpp +++ b/source/game/StarParallax.cpp @@ -60,14 +60,16 @@ Json ParallaxLayer::store() const { void ParallaxLayer::addImageDirectives(Directives const& newDirectives) { if (newDirectives) { // TODO: Move to Directives += if (directives) { - String newString; + String dirString = directives.string(); - for (auto const& entry : newDirectives.shared->entries) { - newString += "+"; - newString += entry.string(*newDirectives.shared); + auto& newString = newDirectives.shared->string; + if (!newString.empty()) { + if (newString.utf8().front() != '?') + dirString += "?"; + dirString += newString; } - directives = move(newString); + directives = move(dirString); } else directives = newDirectives; |