diff options
Diffstat (limited to 'platform/osx')
-rw-r--r-- | platform/osx/SCsub | 3 | ||||
-rw-r--r-- | platform/osx/detect.py | 3 | ||||
-rw-r--r-- | platform/osx/os_osx.h | 6 | ||||
-rw-r--r-- | platform/osx/os_osx.mm | 17 |
4 files changed, 18 insertions, 11 deletions
diff --git a/platform/osx/SCsub b/platform/osx/SCsub index 029e3d808c..5efe2d0b22 100644 --- a/platform/osx/SCsub +++ b/platform/osx/SCsub @@ -10,6 +10,7 @@ def make_debug(target, source, env): os.system(mpprefix + '/libexec/llvm-' + mpclangver + '/bin/llvm-dsymutil %s -o %s.dSYM' % (target[0], target[0])) else: os.system('dsymutil %s -o %s.dSYM' % (target[0], target[0])) + os.system('strip -u -r %s' % (target[0])) files = [ 'crash_handler_osx.mm', @@ -23,6 +24,6 @@ files = [ prog = env.add_program('#bin/godot', files) -if env["debug_symbols"] == "full" or env["debug_symbols"] == "yes": +if (env["debug_symbols"] == "full" or env["debug_symbols"] == "yes") and env["separate_debug_symbols"]: env.AddPostAction(prog, make_debug) diff --git a/platform/osx/detect.py b/platform/osx/detect.py index bb601abd40..5f33100e42 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -19,11 +19,12 @@ def can_build(): def get_opts(): - from SCons.Variables import EnumVariable + from SCons.Variables import BoolVariable, EnumVariable return [ ('osxcross_sdk', 'OSXCross SDK version', 'darwin14'), EnumVariable('debug_symbols', 'Add debug symbols to release version', 'yes', ('yes', 'no', 'full')), + BoolVariable('separate_debug_symbols', 'Create a separate file with the debug symbols', False), ] diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h index c422eb9223..d9ad0a7db8 100644 --- a/platform/osx/os_osx.h +++ b/platform/osx/os_osx.h @@ -52,10 +52,6 @@ class OS_OSX : public OS_Unix { public: - enum { - KEY_EVENT_BUFFER_SIZE = 512 - }; - struct KeyEvent { unsigned int osx_state; bool pressed; @@ -64,7 +60,7 @@ public: uint32_t unicode; }; - KeyEvent key_event_buffer[KEY_EVENT_BUFFER_SIZE]; + Vector<KeyEvent> key_event_buffer; int key_event_pos; bool force_quit; diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 8369adbb5f..ab54f62045 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -88,6 +88,15 @@ static void get_key_modifier_state(unsigned int p_osx_state, Ref<InputEventWithM state->set_metakey((p_osx_state & NSEventModifierFlagCommand)); } +static void push_to_key_event_buffer(const OS_OSX::KeyEvent &p_event) { + + Vector<OS_OSX::KeyEvent> &buffer = OS_OSX::singleton->key_event_buffer; + if (OS_OSX::singleton->key_event_pos >= buffer.size()) { + buffer.resize(1 + OS_OSX::singleton->key_event_pos); + } + buffer[OS_OSX::singleton->key_event_pos++] = p_event; +} + static int mouse_x = 0; static int mouse_y = 0; static int prev_mouse_x = 0; @@ -446,7 +455,7 @@ static const NSRange kEmptyRange = { NSNotFound, 0 }; ke.scancode = 0; ke.unicode = codepoint; - OS_OSX::singleton->key_event_buffer[OS_OSX::singleton->key_event_pos++] = ke; + push_to_key_event_buffer(ke); } [self cancelComposition]; } @@ -805,7 +814,7 @@ static int translateKey(unsigned int key) { ke.scancode = latin_keyboard_keycode_convert(translateKey([event keyCode])); ke.unicode = 0; - OS_OSX::singleton->key_event_buffer[OS_OSX::singleton->key_event_pos++] = ke; + push_to_key_event_buffer(ke); } if ((OS_OSX::singleton->im_position.x != 0) && (OS_OSX::singleton->im_position.y != 0)) @@ -858,7 +867,7 @@ static int translateKey(unsigned int key) { ke.scancode = latin_keyboard_keycode_convert(translateKey(key)); ke.unicode = 0; - OS_OSX::singleton->key_event_buffer[OS_OSX::singleton->key_event_pos++] = ke; + push_to_key_event_buffer(ke); } } @@ -874,7 +883,7 @@ static int translateKey(unsigned int key) { ke.scancode = latin_keyboard_keycode_convert(translateKey([event keyCode])); ke.unicode = 0; - OS_OSX::singleton->key_event_buffer[OS_OSX::singleton->key_event_pos++] = ke; + push_to_key_event_buffer(ke); } } |