X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fporting.cpp;h=92615d77a2b9a21a77313f8b412bbd0b821e9623;hb=81385682c8c1da90f2366452b10e20a93c0865fb;hp=39b2c570587d2f083c2c9752935931321b43640d;hpb=94b42a79d78115277392c7d4b50e520a4b0c98ac;p=minetest.git diff --git a/src/porting.cpp b/src/porting.cpp index 39b2c5705..92615d77a 100644 --- a/src/porting.cpp +++ b/src/porting.cpp @@ -27,6 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "config.h" #include "debug.h" #include "filesys.h" +#include "log.h" #ifdef __APPLE__ #include "CoreFoundation/CoreFoundation.h" @@ -56,9 +57,10 @@ void sigint_handler(int sig) dstream< + #include + + BOOL WINAPI event_handler(DWORD sig) + { + switch(sig) + { + case CTRL_C_EVENT: + case CTRL_CLOSE_EVENT: + case CTRL_LOGOFF_EVENT: + case CTRL_SHUTDOWN_EVENT: + + if(g_killed == false) + { + dstream<" len = GetEnvironmentVariable("APPDATA", buf, buflen); assert(len < buflen); - path_userdata = std::string(buf) + "/" + PROJECT_NAME; + path_user = std::string(buf) + DIR_DELIM + PROJECT_NAME; /* Linux @@ -209,15 +243,15 @@ void initializePaths() pathRemoveFile(buf, '/'); - path_data = std::string(buf) + "/../share/" + PROJECT_NAME; - //path_data = std::string(INSTALL_PREFIX) + "/share/" + PROJECT_NAME; - if (!fs::PathExists(path_data)) { - dstream<<"WARNING: data path " << path_data << " not found!"; - path_data = std::string(buf) + "/../data"; - dstream<<" Trying " << path_data << std::endl; + path_share = std::string(buf) + "/../share/" + PROJECT_NAME; + //path_share = std::string(INSTALL_PREFIX) + "/share/" + PROJECT_NAME; + if (!fs::PathExists(path_share)) { + dstream<<"WARNING: system-wide share not found at \""<