From 09d26d43b5262f480fd55eab9980eff06a71edbb Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Mon, 26 Jun 2023 01:42:18 +1000 Subject: Add string view variant of Star::String and use it it's 1:30 AM AGAIN !! !!!!! This might have broken the inventory icons of custom hats a little, need to look into that --- source/game/StarImageMetadataDatabase.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'source/game/StarImageMetadataDatabase.cpp') diff --git a/source/game/StarImageMetadataDatabase.cpp b/source/game/StarImageMetadataDatabase.cpp index d15d802..e47c841 100644 --- a/source/game/StarImageMetadataDatabase.cpp +++ b/source/game/StarImageMetadataDatabase.cpp @@ -120,20 +120,21 @@ RectU ImageMetadataDatabase::nonEmptyRegion(AssetPath const& path) const { AssetPath ImageMetadataDatabase::filterProcessing(AssetPath const& path) { AssetPath newPath = { path.basePath, path.subPath, {} }; - List filtered; - path.directives.forEach([&](auto const& entry) { + String filtered; + path.directives.forEach([&](auto const& entry, Directives const& directives) { ImageOperation const& operation = entry.operation; - if (!(operation.is() || - operation.is() || - operation.is() || - operation.is() || - operation.is() || - operation.is())) { - filtered.emplace_back(entry); + if (!(operation.is() || + operation.is() || + operation.is() || + operation.is() || + operation.is() || + operation.is())) { + filtered += "?"; + filtered += entry.string(*directives.shared); } - }); + }); - newPath.directives.append(move(filtered)); + newPath.directives = move(filtered); return newPath; } @@ -230,7 +231,7 @@ Vec2U ImageMetadataDatabase::calculateImageSize(AssetPath const& path) const { OperationSizeAdjust osa(imageSize); - bool complete = path.directives.forEachAbortable([&](auto const& entry) -> bool { + bool complete = path.directives.forEachAbortable([&](auto const& entry, Directives const& directives) -> bool { entry.operation.call(osa); return !osa.hasError; }); -- cgit v1.2.3