From 4b597b97b734fa7a99241a93ae5852be7341c667 Mon Sep 17 00:00:00 2001 From: Deve Date: Mon, 25 Aug 2014 21:52:42 +0200 Subject: [PATCH] Fixed path to data directory on linux. Ideally we should use relative paths, which could make possible to run the game after using: make install DESTDIR=./any/local/path I also added path to "supertuxkart-assets" directory, which cmake already search. --- src/io/file_manager.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/io/file_manager.cpp b/src/io/file_manager.cpp index ec7d64e32..29f36d7c2 100644 --- a/src/io/file_manager.cpp +++ b/src/io/file_manager.cpp @@ -150,7 +150,7 @@ FileManager::FileManager() if(exe_path.size()==0 || exe_path[exe_path.size()-1]!='/') exe_path += "/"; if ( getenv ( "SUPERTUXKART_DATADIR" ) != NULL ) - root_dir = std::string(getenv("SUPERTUXKART_DATADIR"))+"/" ; + root_dir = std::string(getenv("SUPERTUXKART_DATADIR"))+"/data/" ; #ifdef __APPLE__ else if( macSetBundlePathIfRelevant( root_dir ) ) { root_dir = root_dir + "data/"; } #endif @@ -174,7 +174,7 @@ FileManager::FileManager() else { #ifdef SUPERTUXKART_DATADIR - root_dir = SUPERTUXKART_DATADIR; + root_dir = SUPERTUXKART_DATADIR"/data/"; if(root_dir.size()==0 || root_dir[root_dir.size()-1]!='/') root_dir+='/'; @@ -186,6 +186,8 @@ FileManager::FileManager() addRootDirs(root_dir); if( fileExists(root_dir+"../../stk-assets")) addRootDirs(root_dir+"../../stk-assets"); + if( fileExists(root_dir+"../../supertuxkart-assets")) + addRootDirs(root_dir+"../../supertuxkart-assets"); if ( getenv ( "SUPERTUXKART_ROOT_PATH" ) != NULL ) addRootDirs(getenv("SUPERTUXKART_ROOT_PATH"));