diff options
Diffstat (limited to 'core/os')
-rw-r--r-- | core/os/keyboard.cpp | 2 | ||||
-rw-r--r-- | core/os/keyboard.h | 1 | ||||
-rw-r--r-- | core/os/os.cpp | 7 | ||||
-rw-r--r-- | core/os/os.h | 15 |
4 files changed, 19 insertions, 6 deletions
diff --git a/core/os/keyboard.cpp b/core/os/keyboard.cpp index 2f5dc03614..e154b1934d 100644 --- a/core/os/keyboard.cpp +++ b/core/os/keyboard.cpp @@ -81,7 +81,6 @@ static const _KeyCodeText _keycodes[] = { {KEY_F14 ,"F14"}, {KEY_F15 ,"F15"}, {KEY_F16 ,"F16"}, - {KEY_KP_ENTER ,"Kp Enter"}, {KEY_KP_MULTIPLY ,"Kp Multiply"}, {KEY_KP_DIVIDE ,"Kp Divide"}, {KEY_KP_SUBTRACT ,"Kp Subtract"}, @@ -334,7 +333,6 @@ bool keycode_has_unicode(uint32_t p_keycode) { case KEY_F14: case KEY_F15: case KEY_F16: - case KEY_KP_ENTER: case KEY_SUPER_L: case KEY_SUPER_R: case KEY_MENU: diff --git a/core/os/keyboard.h b/core/os/keyboard.h index 0a72663867..c6985c887d 100644 --- a/core/os/keyboard.h +++ b/core/os/keyboard.h @@ -96,7 +96,6 @@ enum KeyList { KEY_F14 = SPKEY | 0x29, KEY_F15 = SPKEY | 0x2A, KEY_F16 = SPKEY | 0x2B, - KEY_KP_ENTER = SPKEY | 0x80, KEY_KP_MULTIPLY = SPKEY | 0x81, KEY_KP_DIVIDE = SPKEY | 0x82, KEY_KP_SUBTRACT = SPKEY | 0x83, diff --git a/core/os/os.cpp b/core/os/os.cpp index 5a9766891d..8e4c357195 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -512,7 +512,13 @@ bool OS::check_feature_support(const String &p_feature) { return false; } +void *OS::get_stack_bottom() const { + return _stack_bottom; +} + OS::OS() { + void *volatile stack_bottom; + last_error = NULL; singleton = this; _keep_screen_on = true; // set default value to true, because this had been true before godot 2.0. @@ -525,6 +531,7 @@ OS::OS() { _render_thread_mode = RENDER_THREAD_SAFE; _allow_hidpi = true; + _stack_bottom = (void *)(&stack_bottom); } OS::~OS() { diff --git a/core/os/os.h b/core/os/os.h index 362fec8a9e..703c6a6bcd 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -60,6 +60,8 @@ class OS { char *last_error; + void *_stack_bottom; + public: enum RenderThreadMode { @@ -182,9 +184,9 @@ public: virtual void set_ime_position(const Point2 &p_pos) {} - virtual Error open_dynamic_library(const String p_path, void *&p_library_handle) { return ERR_UNAVAILABLE; }; - virtual Error close_dynamic_library(void *p_library_handle) { return ERR_UNAVAILABLE; }; - virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle) { return ERR_UNAVAILABLE; }; + virtual Error open_dynamic_library(const String p_path, void *&p_library_handle) { return ERR_UNAVAILABLE; } + virtual Error close_dynamic_library(void *p_library_handle) { return ERR_UNAVAILABLE; } + virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional = false) { return ERR_UNAVAILABLE; } virtual void set_keep_screen_on(bool p_enabled); virtual bool is_keep_screen_on() const; @@ -411,6 +413,13 @@ public: bool check_feature_support(const String &p_feature); + /** + * Returns the stack bottom of the main thread of the application. + * This may be of use when integrating languages with garbage collectors that + * need to check whether a pointer is on the stack. + */ + virtual void *get_stack_bottom() const; + bool is_hidpi_allowed() const { return _allow_hidpi; } OS(); virtual ~OS(); |