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.

pull/2853/head
bill.shan 2019-12-27 11:21:05 +08:00
parent ab4166a279
commit d2ed36756c
2 changed files with 2 additions and 2 deletions

View File

@ -325,7 +325,7 @@ inline void Buffer::Read(Value& obj, Asset& r)
} }
else { // Local file else { // Local file
if (byteLength > 0) { 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"); IOStream* file = r.OpenFile(dir + uri, "rb");
if (file) { if (file) {

View File

@ -384,7 +384,7 @@ inline void Buffer::Read(Value& obj, Asset& r)
} }
else { // Local file else { // Local file
if (byteLength > 0) { 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"); IOStream* file = r.OpenFile(dir + uri, "rb");
if (file) { if (file) {