diff options
Diffstat (limited to 'platform/osx')
-rw-r--r-- | platform/osx/SCsub | 2 | ||||
-rw-r--r-- | platform/osx/detect.py | 18 | ||||
-rw-r--r-- | platform/osx/os_osx.mm | 15 |
3 files changed, 18 insertions, 17 deletions
diff --git a/platform/osx/SCsub b/platform/osx/SCsub index d7839d7d65..4904636afd 100644 --- a/platform/osx/SCsub +++ b/platform/osx/SCsub @@ -8,4 +8,4 @@ files = [ # 'context_gl_osx.cpp', ] -env.Program('#bin/godot_osx',files) +env.Program('#bin/godot',files) diff --git a/platform/osx/detect.py b/platform/osx/detect.py index 5337416074..1b32838525 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -38,42 +38,30 @@ def configure(env): env.Append(CPPPATH=['#platform/osx']) - if (env["tools"]=="no"): - #no tools suffix - env['OBJSUFFIX'] = ".nt"+env['OBJSUFFIX'] - env['LIBSUFFIX'] = ".nt"+env['LIBSUFFIX'] + if (env["bits"]=="default"): + env["bits"]="32" if (env["target"]=="release"): env.Append(CCFLAGS=['-O2','-ffast-math','-fomit-frame-pointer','-ftree-vectorize','-msse2']) - env['OBJSUFFIX'] = "_opt"+env['OBJSUFFIX'] - env['LIBSUFFIX'] = "_opt"+env['LIBSUFFIX'] elif (env["target"]=="release_debug"): env.Append(CCFLAGS=['-O2','-DDEBUG_ENABLED']) - env['OBJSUFFIX'] = "_optd"+env['OBJSUFFIX'] - env['LIBSUFFIX'] = "_optd"+env['LIBSUFFIX'] elif (env["target"]=="debug"): env.Append(CCFLAGS=['-g3', '-Wall','-DDEBUG_ENABLED','-DDEBUG_MEMORY_ENABLED']) - elif (env["target"]=="profile"): - env.Append(CCFLAGS=['-g','-pg']) - env.Append(LINKFLAGS=['-pg']) - if (env["freetype"]!="no"): env.Append(CCFLAGS=['-DFREETYPE_ENABLED']) env.Append(CPPPATH=['#tools/freetype']) env.Append(CPPPATH=['#tools/freetype/freetype/include']) - if (env["force_64_bits"]!="no"): + if (env["bits"]=="64"): env.Append(CCFLAGS=['-arch', 'x86_64']) env.Append(LINKFLAGS=['-arch', 'x86_64']) - env['OBJSUFFIX'] = ".64"+env['OBJSUFFIX'] - env['LIBSUFFIX'] = ".64"+env['LIBSUFFIX'] else: env.Append(CCFLAGS=['-arch', 'i386']) env.Append(LINKFLAGS=['-arch', 'i386']) diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index c09dadc066..643c287c95 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -1070,7 +1070,20 @@ bool OS_OSX::is_mouse_grab_enabled() const { void OS_OSX::warp_mouse_pos(const Point2& p_to) { -//not done, must be done + //copied from windows impl with osx native calls + if (mouse_mode == MOUSE_MODE_CAPTURED){ + mouse_x = p_to.x; + mouse_y = p_to.y; + } + else{ //set OS position + CGPoint lMouseWarpPos = {p_to.x, p_to.y}; + + CGEventSourceRef lEventRef = CGEventSourceCreate(kCGEventSourceStateCombinedSessionState); + CGEventSourceSetLocalEventsSuppressionInterval(lEventRef, 0.0); + CGAssociateMouseAndMouseCursorPosition(false); + CGWarpMouseCursorPosition(lMouseWarpPos); + CGAssociateMouseAndMouseCursorPosition(true); + } } Point2 OS_OSX::get_mouse_pos() const { |