Commit 618750f42b9935292858dfdea229efe24550fcce

Authored by xiaoyu
1 parent a1173d4f

修复 xcode 26 c++代码编译失败。

ios/Runner/Wowgame/Classes/game_toy/ToyResourceUtilities.cpp
@@ -40,16 +40,6 @@ std::string ToyResourceUtilities::getFullPathForDownloadedFile(const std::string @@ -40,16 +40,6 @@ std::string ToyResourceUtilities::getFullPathForDownloadedFile(const std::string
40 // return resDownloadDir + "/" + path; 40 // return resDownloadDir + "/" + path;
41 } 41 }
42 42
43 -std::vector<const std::string> ToyResourceUtilities::getFullPathsForDownloadedFiles(const std::vector<const std::string>& paths, bool areDeviceDependent)  
44 -{  
45 - std::vector<const std::string> fullPaths;  
46 - fullPaths.reserve(paths.size());  
47 - for(const auto& path : paths){  
48 - fullPaths.push_back(this->getFullPathForDownloadedFile(path, areDeviceDependent));  
49 - }  
50 - return fullPaths;  
51 -}  
52 -  
53 std::vector<std::string> ToyResourceUtilities::getFullPathsForDownloadedFiles(const std::vector<std::string>& paths, bool areDeviceDependent) 43 std::vector<std::string> ToyResourceUtilities::getFullPathsForDownloadedFiles(const std::vector<std::string>& paths, bool areDeviceDependent)
54 { 44 {
55 std::vector<std::string> fullPaths; 45 std::vector<std::string> fullPaths;
@@ -59,4 +49,3 @@ std::vector&lt;std::string&gt; ToyResourceUtilities::getFullPathsForDownloadedFiles(co @@ -59,4 +49,3 @@ std::vector&lt;std::string&gt; ToyResourceUtilities::getFullPathsForDownloadedFiles(co
59 } 49 }
60 return fullPaths; 50 return fullPaths;
61 } 51 }
62 -  
ios/Runner/Wowgame/Classes/game_toy/ToyResourceUtilities.h
@@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
11 11
12 #include "json/document.h" 12 #include "json/document.h"
13 #include <string> 13 #include <string>
  14 +#include <vector>
14 15
15 class ToyResourceUtilities 16 class ToyResourceUtilities
16 { 17 {
@@ -27,7 +28,6 @@ class ToyResourceUtilities @@ -27,7 +28,6 @@ class ToyResourceUtilities
27 28
28 std::string getDownloadedResourcesPath(bool deviceDependentFiles = true); 29 std::string getDownloadedResourcesPath(bool deviceDependentFiles = true);
29 std::string getFullPathForDownloadedFile(const std::string& path, bool isDeviceDependent = true); 30 std::string getFullPathForDownloadedFile(const std::string& path, bool isDeviceDependent = true);
30 - std::vector<const std::string> getFullPathsForDownloadedFiles(const std::vector<const std::string>& paths, bool areDeviceDependent = true);  
31 std::vector<std::string> getFullPathsForDownloadedFiles(const std::vector<std::string>& paths, bool areDeviceDependent = true); 31 std::vector<std::string> getFullPathsForDownloadedFiles(const std::vector<std::string>& paths, bool areDeviceDependent = true);
32 32
33 protected: 33 protected:
ios/Runner/Wowgame/Classes/game_toy/ToySimpleActionParser.cpp
@@ -307,7 +307,7 @@ cocos2d::Action* ToySimpleActionParser::parsePlayRandomSoundAction(const rapidjs @@ -307,7 +307,7 @@ cocos2d::Action* ToySimpleActionParser::parsePlayRandomSoundAction(const rapidjs
307 auto stopEffects = !ToyJSONParseUtils::hasMemberBool(*storedActionObject, "keepPreviousSounds") || ToyJSONParseUtils::checkMemberBool(*storedActionObject, "keepPreviousSounds", false) ? true : false; 307 auto stopEffects = !ToyJSONParseUtils::hasMemberBool(*storedActionObject, "keepPreviousSounds") || ToyJSONParseUtils::checkMemberBool(*storedActionObject, "keepPreviousSounds", false) ? true : false;
308 308
309 if(ToyJSONParseUtils::hasMemberArray(*storedActionObject, "sounds")){ 309 if(ToyJSONParseUtils::hasMemberArray(*storedActionObject, "sounds")){
310 - std::vector<const std::string> sounds; 310 + std::vector<std::string> sounds;
311 for(const auto& sound : (*storedActionObject)["sounds"].GetArray()){ 311 for(const auto& sound : (*storedActionObject)["sounds"].GetArray()){
312 sounds.push_back(sound.GetString()); 312 sounds.push_back(sound.GetString());
313 } 313 }
@@ -567,4 +567,3 @@ cocos2d::Action* ToySimpleActionParser::parseRandomObjectSwapAction(const rapidj @@ -567,4 +567,3 @@ cocos2d::Action* ToySimpleActionParser::parseRandomObjectSwapAction(const rapidj
567 567
568 568
569 569
570 -  
ios/Runner/Wowgame/Classes/game_toy/ToySoundUtils.cpp
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 #include "ToyMathUtils.h" 10 #include "ToyMathUtils.h"
11 #include "ToySoundsRepo.h" 11 #include "ToySoundsRepo.h"
12 12
13 - unsigned int ToySoundUtils::playRandomSound(std::string soundFolderPath, std::vector<const std::string> soundNames, bool stopEffects){ 13 + unsigned int ToySoundUtils::playRandomSound(std::string soundFolderPath, std::vector<std::string> soundNames, bool stopEffects){
14 14
15 auto soundsLength = soundNames.size(); 15 auto soundsLength = soundNames.size();
16 if(soundsLength > 0){ 16 if(soundsLength > 0){
ios/Runner/Wowgame/Classes/game_toy/ToySoundUtils.h
@@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
16 class ToySoundUtils { 16 class ToySoundUtils {
17 17
18 public: 18 public:
19 - static unsigned int playRandomSound(std::string soundFolderPath = "", std::vector<const std::string> soundNames = std::vector<const std::string>(), bool stopEffects = true); 19 + static unsigned int playRandomSound(std::string soundFolderPath = "", std::vector<std::string> soundNames = std::vector<std::string>(), bool stopEffects = true);
20 20
21 }; 21 };
22 22
ios/Runner/Wowgame/Classes/game_toy/ToySoundsRepo.cpp
@@ -33,21 +33,21 @@ ToySoundsRepo::SoundInfo ToySoundsRepo::gameLetsStartIntroSound(){ @@ -33,21 +33,21 @@ ToySoundsRepo::SoundInfo ToySoundsRepo::gameLetsStartIntroSound(){
33 } 33 }
34 34
35 ToySoundsRepo::SoundInfo ToySoundsRepo::hooraySound(){ 35 ToySoundsRepo::SoundInfo ToySoundsRepo::hooraySound(){
36 - std::vector<const std::string> hooraySounds = {/*"games/g_yes.mp3",*/ "games/g_whoo_hoo.mp3", "games/g_yeah.mp3"}; 36 + std::vector<std::string> hooraySounds = {/*"games/g_yes.mp3",*/ "games/g_whoo_hoo.mp3", "games/g_yeah.mp3"};
37 auto soundFilename = ToyMathUtils::getRandomElement(hooraySounds); 37 auto soundFilename = ToyMathUtils::getRandomElement(hooraySounds);
38 auto fp = soundsFolder + soundFilename; 38 auto fp = soundsFolder + soundFilename;
39 return SoundInfo(fp, soundDuration(fp)); 39 return SoundInfo(fp, soundDuration(fp));
40 } 40 }
41 41
42 ToySoundsRepo::SoundInfo ToySoundsRepo::oopsSound(){ 42 ToySoundsRepo::SoundInfo ToySoundsRepo::oopsSound(){
43 - std::vector<const std::string> oopsSounds = {"games/g_oops.mp3", "games/g_no.mp3", "games/g_uh_oh.mp3"}; 43 + std::vector<std::string> oopsSounds = {"games/g_oops.mp3", "games/g_no.mp3", "games/g_uh_oh.mp3"};
44 auto soundFilename = ToyMathUtils::getRandomElement(oopsSounds); 44 auto soundFilename = ToyMathUtils::getRandomElement(oopsSounds);
45 auto fp = soundsFolder + soundFilename; 45 auto fp = soundsFolder + soundFilename;
46 return SoundInfo(fp, soundDuration(fp)); 46 return SoundInfo(fp, soundDuration(fp));
47 } 47 }
48 48
49 ToySoundsRepo::SoundInfo ToySoundsRepo::pureOopsSound(){ 49 ToySoundsRepo::SoundInfo ToySoundsRepo::pureOopsSound(){
50 - std::vector<const std::string> oopsSounds = {"games/g_oops.mp3", "games/g_uh_oh.mp3"}; 50 + std::vector<std::string> oopsSounds = {"games/g_oops.mp3", "games/g_uh_oh.mp3"};
51 auto soundFilename = ToyMathUtils::getRandomElement(oopsSounds); 51 auto soundFilename = ToyMathUtils::getRandomElement(oopsSounds);
52 auto fp = soundsFolder + soundFilename; 52 auto fp = soundsFolder + soundFilename;
53 return SoundInfo(fp, soundDuration(fp)); 53 return SoundInfo(fp, soundDuration(fp));
@@ -84,7 +84,7 @@ ToySoundsRepo::SoundInfo ToySoundsRepo::hurryUpSound(){ @@ -84,7 +84,7 @@ ToySoundsRepo::SoundInfo ToySoundsRepo::hurryUpSound(){
84 } 84 }
85 85
86 ToySoundsRepo::SoundInfo ToySoundsRepo::tooSlowSound(){ 86 ToySoundsRepo::SoundInfo ToySoundsRepo::tooSlowSound(){
87 - std::vector<const std::string> hooraySounds = {"games/g_slow.mp3", "games/g_slow2.mp3"}; 87 + std::vector<std::string> hooraySounds = {"games/g_slow.mp3", "games/g_slow2.mp3"};
88 auto soundFilename = ToyMathUtils::getRandomElement(hooraySounds); 88 auto soundFilename = ToyMathUtils::getRandomElement(hooraySounds);
89 auto fp = soundsFolder + soundFilename; 89 auto fp = soundsFolder + soundFilename;
90 return SoundInfo(fp, soundDuration(fp)); 90 return SoundInfo(fp, soundDuration(fp));
@@ -211,4 +211,3 @@ void ToySoundsRepo::parseSoundInfoFile(std::string soundFolderPath, std::string @@ -211,4 +211,3 @@ void ToySoundsRepo::parseSoundInfoFile(std::string soundFolderPath, std::string
211 } 211 }
212 } 212 }
213 } 213 }
214 -