From 8ffb05b6c9f4a057179710952f605c2206d80202 Mon Sep 17 00:00:00 2001 From: "Daniel T. Borelli" Date: Sat, 4 Jan 2014 19:26:16 -0300 Subject: [PATCH] Linux fix missing file -> rename dir loadSceneEditorFileTest to LoadScene...; add string::npos; const correctness --- extensions/assets-manager/AssetsManager.cpp | 10 +++++----- .../Images/startMenuBG.png.REMOVED.git-id | 0 .../Misc/music_logo.mp3.REMOVED.git-id | 0 .../Misc/music_logo.wav.REMOVED.git-id | 0 .../Butterflyfish/Butterflyfish0.png.REMOVED.git-id | 0 .../fishes/blowFish/Blowfish0.png.REMOVED.git-id | 0 .../Fish_UI/ui_logo_001-hd.png.REMOVED.git-id | 0 7 files changed, 5 insertions(+), 5 deletions(-) rename samples/Cpp/TestCpp/Resources/scenetest/{loadSceneEdtiorFileTest => LoadSceneEdtiorFileTest}/Images/startMenuBG.png.REMOVED.git-id (100%) rename samples/Cpp/TestCpp/Resources/scenetest/{loadSceneEdtiorFileTest => LoadSceneEdtiorFileTest}/Misc/music_logo.mp3.REMOVED.git-id (100%) rename samples/Cpp/TestCpp/Resources/scenetest/{loadSceneEdtiorFileTest => LoadSceneEdtiorFileTest}/Misc/music_logo.wav.REMOVED.git-id (100%) rename samples/Cpp/TestCpp/Resources/scenetest/{loadSceneEdtiorFileTest => LoadSceneEdtiorFileTest}/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id (100%) rename samples/Cpp/TestCpp/Resources/scenetest/{loadSceneEdtiorFileTest => LoadSceneEdtiorFileTest}/fishes/blowFish/Blowfish0.png.REMOVED.git-id (100%) rename samples/Cpp/TestCpp/Resources/scenetest/{loadSceneEdtiorFileTest => LoadSceneEdtiorFileTest}/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id (100%) diff --git a/extensions/assets-manager/AssetsManager.cpp b/extensions/assets-manager/AssetsManager.cpp index 52080d811c..23818d9e6d 100644 --- a/extensions/assets-manager/AssetsManager.cpp +++ b/extensions/assets-manager/AssetsManager.cpp @@ -319,7 +319,7 @@ bool AssetsManager::uncompress() return false; } - string fullPath = _storagePath + fileName; + const string fullPath = _storagePath + fileName; // Check if this entry is a directory or a file. const size_t filenameLength = strlen(fileName); @@ -339,15 +339,15 @@ bool AssetsManager::uncompress() //There are not directory entry in some case. //So we need to test whether the file directory exists when uncompressing file entry //, if does not exist then create directory - string fileNameStr(fileName); + const string fileNameStr(fileName); size_t startIndex=0; 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"); @@ -501,7 +501,7 @@ int assetsManagerProgressFunc(void *ptr, double totalToDownload, double nowDownl bool AssetsManager::downLoad() { // 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"); if (! fp) { diff --git a/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/Images/startMenuBG.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/Images/startMenuBG.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/Images/startMenuBG.png.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/Images/startMenuBG.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/Misc/music_logo.mp3.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.mp3.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/Misc/music_logo.mp3.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.mp3.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id