Load gltf .bin files from correct directory

pull/1423/head
Daniel Hritzkiv 2017-09-07 14:55:44 -04:00
parent a438ece655
commit 5cb13aa4b3
No known key found for this signature in database
GPG Key ID: D1D19875679D5CBF
2 changed files with 6 additions and 2 deletions

View File

@ -337,7 +337,9 @@ inline void Buffer::Read(Value& obj, Asset& r)
} }
else { // Local file else { // Local file
if (byteLength > 0) { 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) { if (file) {
bool ok = LoadFromStream(*file, byteLength); bool ok = LoadFromStream(*file, byteLength);
delete file; delete file;

View File

@ -316,7 +316,9 @@ inline void Buffer::Read(Value& obj, Asset& r)
} }
else { // Local file else { // Local file
if (byteLength > 0) { 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) { if (file) {
bool ok = LoadFromStream(*file, byteLength); bool ok = LoadFromStream(*file, byteLength);
delete file; delete file;