X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fsupertux%2Fmain.cpp;h=31d8f435c3d07ad3afaa940fb08590555fc2b06e;hb=a8cc9fe8bc3cc825c8ec87ee7d7a58ba79f12478;hp=73e4e7d9a3b4bed8597fb1925922987e6e846313;hpb=7bfc7df1a3fc3e5198f9f1eca69378045f552d2d;p=supertux.git diff --git a/src/supertux/main.cpp b/src/supertux/main.cpp index 73e4e7d9a..31d8f435c 100644 --- a/src/supertux/main.cpp +++ b/src/supertux/main.cpp @@ -14,8 +14,6 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -#include "supertux/main.hpp" - #include #include @@ -25,6 +23,8 @@ #include #include +#include "supertux/main.hpp" + #ifdef MACOSX namespace supertux_apple { # include @@ -93,7 +93,7 @@ Main::init_physfs(const char* argv0) // Initialize physfs (this is a slightly modified version of // PHYSFS_setSaneConfig - const char* application = "supertux2"; //instead of PACKAGE_NAME so we can coexist with MS1 + const char* application = PACKAGE_NAME; const char* userdir = PHYSFS_getUserDir(); char* writedir = new char[strlen(userdir) + strlen(application) + 2]; @@ -176,23 +176,21 @@ Main::init_physfs(const char* argv0) #endif if(!sourcedir) { -#if defined(APPDATADIR) || defined(ENABLE_BINRELOC) - std::string datadir; + std::string datadir = PHYSFS_getBaseDir(); + datadir = datadir.substr(0, datadir.rfind(INSTALL_SUBDIR_BIN)); + datadir += "/" INSTALL_SUBDIR_SHARE; #ifdef ENABLE_BINRELOC char* dir; br_init (NULL); - dir = br_find_data_dir(APPDATADIR); + dir = br_find_data_dir(datadir.c_str()); datadir = dir; free(dir); -#else - datadir = APPDATADIR; #endif if(!PHYSFS_addToSearchPath(datadir.c_str(), 1)) { log_warning << "Couldn't add '" << datadir << "' to physfs searchpath: " << PHYSFS_getLastError() << std::endl; } -#endif } //show search Path @@ -528,7 +526,7 @@ static inline void timelog(const char* ) #endif int -Main::main(int argc, char** argv) +Main::run(int argc, char** argv) { int result = 0;