Blame view

ios/Runner/Wowgame/Classes/game_food/ResourceUtilities.cpp 1.82 KB
cb213901   xiaoyu   添加一个游戏的源码和编译选项
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
  //
  //  ResourceUtilities.cpp
  //  SteveMaggieCpp
  //
  //  Created by Katarzyna Kalinowska-Górska on 23.06.2017.
  //
  //
  
  #include <stdio.h>
  #include "ResourceUtilities.h"
  #include "JSONParseUtils.h"
  #include "ValueStorage.h"
  //#include "ResourceDownloader_cpp.h"
  #include "ResourcesConfig.h"
  
  #define RESOURCES_LOAD_FROM_ASSETS
  //#define FORCE_REDOWNLOAD_RESOURCES
  
  
  std::string ResourceUtilities::getDownloadedResourcesPath(bool deviceDependentFiles)
  {
  #ifdef RESOURCES_LOAD_FROM_ASSETS
      return "";
  #endif
  //    std::string resDownloadDir = ResourceDownloader_getResourceDownloadDirectoryPath();
  //
  //    if(deviceDependentFiles){
  //        return resDownloadDir + "/" + this->getDeviceSpecificFolderName();
  //    }
  //
  //    return resDownloadDir + "/" + ResourcesConfig::UNIVERSAL_RESOURCES_FOLDER_NAME;
  }
  
  std::string ResourceUtilities::getFullPathForDownloadedFile(const std::string& path, bool isDeviceDependent)
  {
  #ifdef RESOURCES_LOAD_FROM_ASSETS
      return path;
  #endif
  //    std::string resDownloadDir = this->getDownloadedResourcesPath(isDeviceDependent);
  //    return resDownloadDir + "/" + path;
  }
  
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
43
  std::vector<std::string> ResourceUtilities::getFullPathsForDownloadedFiles(const std::vector<std::string>& paths, bool areDeviceDependent)
cb213901   xiaoyu   添加一个游戏的源码和编译选项
44
  {
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
45
      std::vector<std::string> fullPaths;
cb213901   xiaoyu   添加一个游戏的源码和编译选项
46
47
48
49
50
51
      fullPaths.reserve(paths.size());
      for(const auto& path : paths){
          fullPaths.push_back(this->getFullPathForDownloadedFile(path, areDeviceDependent));
      }
      return fullPaths;
  }
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
52
  /*
cb213901   xiaoyu   添加一个游戏的源码和编译选项
53
54
55
56
57
58
59
60
61
  std::vector<std::string> ResourceUtilities::getFullPathsForDownloadedFiles(const std::vector<std::string>& paths, bool areDeviceDependent)
  {
      std::vector<std::string> fullPaths;
      fullPaths.reserve(paths.size());
      for(const auto& path : paths){
          fullPaths.push_back(this->getFullPathForDownloadedFile(path, areDeviceDependent));
      }
      return fullPaths;
  }
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
62
  */