mirror of https://github.com/axmolengine/axmol.git
Linux fix missing file -> rename dir loadSceneEditorFileTest to LoadScene...; add string::npos; const correctness
This commit is contained in:
parent
08dad98592
commit
8ffb05b6c9
|
@ -319,7 +319,7 @@ bool AssetsManager::uncompress()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
string fullPath = _storagePath + fileName;
|
const string fullPath = _storagePath + fileName;
|
||||||
|
|
||||||
// Check if this entry is a directory or a file.
|
// Check if this entry is a directory or a file.
|
||||||
const size_t filenameLength = strlen(fileName);
|
const size_t filenameLength = strlen(fileName);
|
||||||
|
@ -339,15 +339,15 @@ bool AssetsManager::uncompress()
|
||||||
//There are not directory entry in some case.
|
//There are not directory entry in some case.
|
||||||
//So we need to test whether the file directory exists when uncompressing file entry
|
//So we need to test whether the file directory exists when uncompressing file entry
|
||||||
//, if does not exist then create directory
|
//, if does not exist then create directory
|
||||||
string fileNameStr(fileName);
|
const string fileNameStr(fileName);
|
||||||
|
|
||||||
size_t startIndex=0;
|
size_t startIndex=0;
|
||||||
|
|
||||||
size_t index=fileNameStr.find("/",startIndex);
|
size_t index=fileNameStr.find("/",startIndex);
|
||||||
|
|
||||||
while(index!=-1)
|
while(index != std::string::npos)
|
||||||
{
|
{
|
||||||
string dir=_storagePath+fileNameStr.substr(0,index);
|
const string dir=_storagePath+fileNameStr.substr(0,index);
|
||||||
|
|
||||||
FILE *out = fopen(dir.c_str(), "r");
|
FILE *out = fopen(dir.c_str(), "r");
|
||||||
|
|
||||||
|
@ -501,7 +501,7 @@ int assetsManagerProgressFunc(void *ptr, double totalToDownload, double nowDownl
|
||||||
bool AssetsManager::downLoad()
|
bool AssetsManager::downLoad()
|
||||||
{
|
{
|
||||||
// Create a file to save package.
|
// Create a file to save package.
|
||||||
string outFileName = _storagePath + TEMP_PACKAGE_FILE_NAME;
|
const string outFileName = _storagePath + TEMP_PACKAGE_FILE_NAME;
|
||||||
FILE *fp = fopen(outFileName.c_str(), "wb");
|
FILE *fp = fopen(outFileName.c_str(), "wb");
|
||||||
if (! fp)
|
if (! fp)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue