From: Perttu Ahola Date: Sat, 18 Jun 2011 15:44:01 +0000 (+0300) Subject: Hand-picked Mac OSX cursor and bundle path fixes from https://bitbucket.org/toabi... X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=5d1ae85ab9829ab38b96277a8cd63e4539774e06;p=zefram%2Fminetest%2Fminetest_engine.git Hand-picked Mac OSX cursor and bundle path fixes from https://bitbucket.org/toabi/minetest-mac --- diff --git a/src/game.cpp b/src/game.cpp index 1ab3d796..f3fac0c8 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1366,7 +1366,11 @@ void the_game( if((device->isWindowActive() && noMenuActive()) || random_input) { if(!random_input) - device->getCursorControl()->setVisible(false); + { + // Mac OSX gets upset if this is set every frame + if(device->getCursorControl()->isVisible()) + device->getCursorControl()->setVisible(false); + } if(first_loop_after_window_activation){ //std::cout<<"window active, first loop"<setMousePos(displaycenter.X, displaycenter.Y); } else{ - device->getCursorControl()->setVisible(true); + // Mac OSX gets upset if this is set every frame + if(device->getCursorControl()->isVisible() == false) + device->getCursorControl()->setVisible(true); //std::cout<<"window inactive"< - + #include "CoreFoundation/CoreFoundation.h" + + // Code based on + // http://stackoverflow.com/questions/516200/relative-paths-not-working-in-xcode-c + CFBundleRef main_bundle = CFBundleGetMainBundle(); + CFURLRef resources_url = CFBundleCopyResourcesDirectoryURL(main_bundle); + char path[PATH_MAX]; + if(CFURLGetFileSystemRepresentation(resources_url, TRUE, (UInt8 *)path, PATH_MAX)) + { + dstream<<"Bundle resource path: "<