diff options
Diffstat (limited to 'platform/osx')
-rw-r--r-- | platform/osx/detect.py | 37 | ||||
-rw-r--r-- | platform/osx/export/export.cpp | 8 | ||||
-rw-r--r-- | platform/osx/os_osx.h | 4 | ||||
-rw-r--r-- | platform/osx/os_osx.mm | 16 |
4 files changed, 50 insertions, 15 deletions
diff --git a/platform/osx/detect.py b/platform/osx/detect.py index 5703cbc546..22cee0527e 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -11,15 +11,17 @@ def get_name(): def can_build(): - if (sys.platform != "darwin"): - return False + if (sys.platform == "darwin" or os.environ.has_key("OSXCROSS_ROOT")): + return True - return True # osx enabled + + return False def get_opts(): return [ ('force_64_bits','Force 64 bits binary','no'), + ('osxcross_sdk','OSXCross SDK version','darwin14'), ] @@ -59,12 +61,31 @@ def configure(env): env.Append(CPPPATH=['#tools/freetype']) env.Append(CPPPATH=['#tools/freetype/freetype/include']) - if (env["bits"]=="64"): - env.Append(CCFLAGS=['-arch', 'x86_64']) - env.Append(LINKFLAGS=['-arch', 'x86_64']) + + + if (not os.environ.has_key("OSXCROSS_ROOT")): + #regular native build + if (env["bits"]=="64"): + env.Append(CCFLAGS=['-arch', 'x86_64']) + env.Append(LINKFLAGS=['-arch', 'x86_64']) + else: + env.Append(CCFLAGS=['-arch', 'i386']) + env.Append(LINKFLAGS=['-arch', 'i386']) else: - env.Append(CCFLAGS=['-arch', 'i386']) - env.Append(LINKFLAGS=['-arch', 'i386']) + #osxcross build + root=os.environ.get("OSXCROSS_ROOT",0) + if env["bits"]=="64": + basecmd=root+"/target/bin/x86_64-apple-"+env["osxcross_sdk"]+"-" + else: + basecmd=root+"/target/bin/i386-apple-"+env["osxcross_sdk"]+"-" + + + env['CC'] = basecmd+"cc" + env['CXX'] = basecmd+"c++" + env['AR'] = basecmd+"ar" + env['RANLIB'] = basecmd+"ranlib" + env['AS'] = basecmd+"as" + # env.Append(CPPPATH=['#platform/osx/include/freetype2', '#platform/osx/include']) # env.Append(LIBPATH=['#platform/osx/lib']) diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp index 823bc46d74..79ee91bc61 100644 --- a/platform/osx/export/export.cpp +++ b/platform/osx/export/export.cpp @@ -57,11 +57,11 @@ public: virtual int get_device_count() const { return 0; }; virtual String get_device_name(int p_device) const { return String(); } virtual String get_device_info(int p_device) const { return String(); } - virtual Error run(int p_device,bool p_dumb=false,bool p_remote_debug=false); + virtual Error run(int p_device,int p_flags=0); virtual bool requieres_password(bool p_debug) const { return false; } virtual String get_binary_extension() const { return "zip"; } - virtual Error export_project(const String& p_path,bool p_debug,bool p_dumb=false,bool p_remote_debug=false); + virtual Error export_project(const String& p_path,bool p_debug,int p_flags=0); virtual bool can_export(String *r_error=NULL) const; @@ -245,7 +245,7 @@ void EditorExportPlatformOSX::_fix_plist(Vector<uint8_t>& plist,const String& p_ } } -Error EditorExportPlatformOSX::export_project(const String& p_path, bool p_debug, bool p_dumb, bool p_remote_debug) { +Error EditorExportPlatformOSX::export_project(const String& p_path, bool p_debug, int p_flags) { String src_pkg; @@ -437,7 +437,7 @@ Error EditorExportPlatformOSX::export_project(const String& p_path, bool p_debug } -Error EditorExportPlatformOSX::run(int p_device, bool p_dumb, bool p_remote_debug) { +Error EditorExportPlatformOSX::run(int p_device, int p_flags) { return OK; } diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h index 144037b1cb..49fa6c0862 100644 --- a/platform/osx/os_osx.h +++ b/platform/osx/os_osx.h @@ -32,7 +32,7 @@ #include "os/input.h" #include "drivers/unix/os_unix.h" - +#include "main/input_default.h" #include "servers/visual_server.h" #include "servers/visual/visual_server_wrap_mt.h" #include "servers/visual/rasterizer.h" @@ -170,7 +170,7 @@ public: virtual int get_screen_count() const; virtual int get_current_screen() const; virtual void set_current_screen(int p_screen); - virtual Point2 get_screen_position(int p_screen=0); + virtual Point2 get_screen_position(int p_screen=0) const; virtual Point2 get_window_position() const; virtual void set_window_position(const Point2& p_position); virtual void set_window_size(const Size2 p_size); diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 72699366c4..b0ce37cecf 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -512,12 +512,26 @@ static int button_mask=0; - (void)mouseExited:(NSEvent *)event { + if (!OS_OSX::singleton) + return; + + if (OS_OSX::singleton->main_loop && OS_OSX::singleton->mouse_mode!=OS::MOUSE_MODE_CAPTURED) + OS_OSX::singleton->main_loop->notification(MainLoop::NOTIFICATION_WM_MOUSE_EXIT); + if (OS_OSX::singleton->input) + OS_OSX::singleton->input->set_mouse_in_window(false); // _glfwInputCursorEnter(window, GL_FALSE); } - (void)mouseEntered:(NSEvent *)event { // _glfwInputCursorEnter(window, GL_TRUE); + if (!OS_OSX::singleton) + return; + if (OS_OSX::singleton->main_loop && OS_OSX::singleton->mouse_mode!=OS::MOUSE_MODE_CAPTURED) + OS_OSX::singleton->main_loop->notification(MainLoop::NOTIFICATION_WM_MOUSE_ENTER); + if (OS_OSX::singleton->input) + OS_OSX::singleton->input->set_mouse_in_window(true); + } - (void)viewDidChangeBackingProperties @@ -1279,7 +1293,7 @@ void OS_OSX::set_current_screen(int p_screen) { current_screen = p_screen; }; -Point2 OS_OSX::get_screen_position(int p_screen) { +Point2 OS_OSX::get_screen_position(int p_screen) const { ERR_FAIL_INDEX_V(p_screen, screens.size(), Point2()); return screens[p_screen].pos; |