From 7eb010d4a1c6a90d5040b3ec2e7d189fb387b9b2 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Sat, 24 Jun 2023 22:49:47 +1000 Subject: Pretty much working now --- source/base/StarAssets.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'source/base/StarAssets.cpp') diff --git a/source/base/StarAssets.cpp b/source/base/StarAssets.cpp index 6bd9c09..e5313ea 100644 --- a/source/base/StarAssets.cpp +++ b/source/base/StarAssets.cpp @@ -234,11 +234,10 @@ void Assets::queueJsons(StringList const& paths) const { })); } -ImageConstPtr Assets::image(String const& path) const { - auto components = AssetPath::split(path); - validatePath(components, true, true); +ImageConstPtr Assets::image(AssetPath const& path) const { + validatePath(path, true, true); - return as(getAsset(AssetId{AssetType::Image, move(components)}))->image; + return as(getAsset(AssetId{AssetType::Image, path}))->image; } void Assets::queueImages(StringList const& paths) const { @@ -250,11 +249,10 @@ void Assets::queueImages(StringList const& paths) const { })); } -ImageConstPtr Assets::tryImage(String const& path) const { - auto components = AssetPath::split(path); - validatePath(components, true, true); +ImageConstPtr Assets::tryImage(AssetPath const& path) const { + validatePath(path, true, true); - if (auto imageData = as(tryAsset(AssetId{AssetType::Image, move(components)}))) + if (auto imageData = as(tryAsset(AssetId{AssetType::Image, path}))) return imageData->image; else return {}; -- cgit v1.2.3