diff --git a/linux/include/polyvox_filament/resource_loader.hpp b/linux/include/polyvox_filament/resource_loader.hpp index 6263d33c..ee0157f0 100644 --- a/linux/include/polyvox_filament/resource_loader.hpp +++ b/linux/include/polyvox_filament/resource_loader.hpp @@ -27,12 +27,19 @@ ResourceBuffer loadResource(const char* name) { string name_str(name); auto id = _i++; + // this functions accepts URIs, so + // - file:// points to a file on the filesystem + // - asset:// points to an asset, usually resolved relative to the current working directory + // - no prefix is presumed to be an absolute file path if (name_str.rfind("file://", 0) == 0) { name_str = name_str.substr(7); + } else if(name_str.rfind("asset://", 0) == 0) { + name_str = name_str.substr(7); + name_str = string(cwd) + string("/") + name_str; + } else { + } - name_str = string(cwd) + string("/") + name_str; - std::cout << "Loading resource at " << name_str.c_str() << std::endl; streampos length;