Update CCFileUtils-linux.cpp

This commit is contained in:
Jialong Zhai 2014-11-04 18:23:12 +08:00
parent 2befd74b0e
commit 6e35e91642
1 changed files with 5 additions and 1 deletions

View File

@ -36,6 +36,10 @@ THE SOFTWARE.
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#ifndef CC_RESOURCE_FOLDER_LINUX
#define CC_RESOURCE_FOLDER_LINUX ("/Resources/")
#endif
using namespace std; using namespace std;
NS_CC_BEGIN NS_CC_BEGIN
@ -71,7 +75,7 @@ bool FileUtilsLinux::init()
fullpath[length] = '\0'; fullpath[length] = '\0';
std::string appPath = fullpath; std::string appPath = fullpath;
_defaultResRootPath = appPath.substr(0, appPath.find_last_of("/")); _defaultResRootPath = appPath.substr(0, appPath.find_last_of("/"));
_defaultResRootPath += "/Resources/"; _defaultResRootPath += CC_RESOURCE_FOLDER_LINUX;
// Set writable path to $XDG_CONFIG_HOME or ~/.config/<app name>/ if $XDG_CONFIG_HOME not exists. // Set writable path to $XDG_CONFIG_HOME or ~/.config/<app name>/ if $XDG_CONFIG_HOME not exists.
const char* xdg_config_path = getenv("XDG_CONFIG_HOME"); const char* xdg_config_path = getenv("XDG_CONFIG_HOME");