瀏覽代碼

Fixed bug that was causing assets to fail to load when specifying a path from root in script

Tim Newell 12 年之前
父節點
當前提交
a78ea62831
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      engine/source/console/console.cc

+ 6 - 2
engine/source/console/console.cc

@@ -1534,11 +1534,15 @@ bool expandPath( char* pDstPath, U32 size, const char* pSrcPath, const char* pWo
         return true;
         return true;
     }
     }
 
 
+    // All else.
+
     //Using a special case here because the code below barfs on trying to build a full path for apk reading
     //Using a special case here because the code below barfs on trying to build a full path for apk reading
  #ifdef TORQUE_OS_ANDROID
  #ifdef TORQUE_OS_ANDROID
- 	   dSprintf(pathBuffer, sizeof(pathBuffer), "/%s", pSrcPath);
+    	if (leadingToken == '/' || strstr(pSrcPath, "/") == NULL)
+    		Platform::makeFullPathName( pSrcPath, pathBuffer, sizeof(pathBuffer), pWorkingDirectoryHint );
+    	else
+    		dSprintf(pathBuffer, sizeof(pathBuffer), "/%s", pSrcPath);
 #else
 #else
- 	  // All else.
  	  Platform::makeFullPathName( pSrcPath, pathBuffer, sizeof(pathBuffer), pWorkingDirectoryHint );
  	  Platform::makeFullPathName( pSrcPath, pathBuffer, sizeof(pathBuffer), pWorkingDirectoryHint );
 #endif
 #endif