X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fporting.cpp;h=92615d77a2b9a21a77313f8b412bbd0b821e9623;hb=81385682c8c1da90f2366452b10e20a93c0865fb;hp=ff8cb3862276f3c1158b8336839dc7e9643221b7;hpb=805ccd449fdd62e05083b71c1e035e5e7347c73a;p=minetest.git diff --git a/src/porting.cpp b/src/porting.cpp index ff8cb3862..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<" + // Use "C:\Documents and Settings\user\Application Data\" len = GetEnvironmentVariable("APPDATA", buf, buflen); assert(len < buflen); - path_userdata = std::string(buf) + "/" + APPNAME; + path_user = std::string(buf) + DIR_DELIM + PROJECT_NAME; /* Linux @@ -209,15 +243,15 @@ void initializePaths() pathRemoveFile(buf, '/'); - path_data = std::string(buf) + "/../share/" + APPNAME; - //path_data = std::string(INSTALL_PREFIX) + "/share/" + APPNAME; - 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 \""<