Răsfoiți Sursa

fix bug:Using custom IO logic in Android platform, importing from 'assets' dir,there comes to be one more '/', which makes the '.bin' file loads failed.

bill.shan 6 ani în urmă
părinte
comite
d2ed36756c
2 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 1 1
      code/glTF/glTFAsset.inl
  2. 1 1
      code/glTF2/glTF2Asset.inl

+ 1 - 1
code/glTF/glTFAsset.inl

@@ -325,7 +325,7 @@ inline void Buffer::Read(Value& obj, Asset& r)
     }
     else { // Local file
         if (byteLength > 0) {
-            std::string dir = !r.mCurrentAssetDir.empty() ? (r.mCurrentAssetDir + "/") : "";
+            std::string dir = !r.mCurrentAssetDir.empty() ? (r.mCurrentAssetDir) : "";
 
             IOStream* file = r.OpenFile(dir + uri, "rb");
             if (file) {

+ 1 - 1
code/glTF2/glTF2Asset.inl

@@ -384,7 +384,7 @@ inline void Buffer::Read(Value& obj, Asset& r)
     }
     else { // Local file
         if (byteLength > 0) {
-            std::string dir = !r.mCurrentAssetDir.empty() ? (r.mCurrentAssetDir + "/") : "";
+            std::string dir = !r.mCurrentAssetDir.empty() ? (r.mCurrentAssetDir) : "";
 
             IOStream* file = r.OpenFile(dir + uri, "rb");
             if (file) {