From d45c211ad88219adadd80ccc6607aa1eba3c1e15 Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Tue, 10 Oct 2023 18:10:02 +1100 Subject: [PATCH] allow asset:// URIs on Windows --- windows/polyvox_filament_plugin.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/windows/polyvox_filament_plugin.cpp b/windows/polyvox_filament_plugin.cpp index 68bd1c24..4438637e 100644 --- a/windows/polyvox_filament_plugin.cpp +++ b/windows/polyvox_filament_plugin.cpp @@ -75,11 +75,16 @@ ResourceBuffer PolyvoxFilamentPlugin::loadResource(const char *name) { if (name_str.rfind("file://", 0) == 0) { targetFilePath = name_str.substr(7); } else { + + if (name_str.rfind("asset://", 0) == 0) { + name_str = name_str.substr(8); + } + TCHAR pBuf[256]; size_t len = sizeof(pBuf); int bytes = GetModuleFileName(NULL, pBuf, len); std::wstring_convert> converter; - std::wstring assetPath = converter.from_bytes(name); + std::wstring assetPath = converter.from_bytes(name_str.c_str()); std::wstring exePathBuf(pBuf); std::filesystem::path exePath(exePathBuf);