Load gltf .bin files from correct directory
This commit is contained in:
@@ -337,7 +337,9 @@ inline void Buffer::Read(Value& obj, Asset& r)
|
||||
}
|
||||
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;
|
||||
|
||||
@@ -316,7 +316,9 @@ inline void Buffer::Read(Value& obj, Asset& r)
|
||||
}
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user