diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-26 01:42:18 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-26 01:42:18 +1000 |
commit | 09d26d43b5262f480fd55eab9980eff06a71edbb (patch) | |
tree | 1e53765861cd966d204782aeefd15b1a67b3266f /source/game/StarImageMetadataDatabase.cpp | |
parent | 13a74602bd4c46149da9949d448387a40b8ebd1c (diff) |
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
Diffstat (limited to 'source/game/StarImageMetadataDatabase.cpp')
-rw-r--r-- | source/game/StarImageMetadataDatabase.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
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<Directives::Entry> 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<HueShiftImageOperation>() || - operation.is<SaturationShiftImageOperation>() || - operation.is<BrightnessMultiplyImageOperation>() || - operation.is<FadeToColorImageOperation>() || - operation.is<ScanLinesImageOperation>() || - operation.is<SetColorImageOperation>())) { - filtered.emplace_back(entry); + if (!(operation.is<HueShiftImageOperation>() || + operation.is<SaturationShiftImageOperation>() || + operation.is<BrightnessMultiplyImageOperation>() || + operation.is<FadeToColorImageOperation>() || + operation.is<ScanLinesImageOperation>() || + operation.is<SetColorImageOperation>())) { + 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; }); |