}
else { // Local file
if (byteLength > 0) {
- IOStream* file = r.OpenFile(uri, "rb");
+ std::string dir = !r.mCurrentAssetDir.empty() ? (r.mCurrentAssetDir + "/") : "";
+
+ IOStream* file = r.OpenFile(dir + uri, "rb");
if (file) {
bool ok = LoadFromStream(*file, byteLength);
delete file;
}
else { // Local file
if (byteLength > 0) {
- IOStream* file = r.OpenFile(uri, "rb");
+ std::string dir = !r.mCurrentAssetDir.empty() ? (r.mCurrentAssetDir + "/") : "";
+
+ IOStream* file = r.OpenFile(dir + uri, "rb");
if (file) {
bool ok = LoadFromStream(*file, byteLength);
delete file;