summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/global_constants.cpp1
-rw-r--r--core/io/resource_loader.cpp3
-rw-r--r--core/os/keyboard.cpp2
-rw-r--r--core/os/keyboard.h1
-rw-r--r--core/os/os.cpp7
-rw-r--r--core/os/os.h15
-rw-r--r--core/reference.cpp3
-rw-r--r--core/script_debugger_remote.cpp2
8 files changed, 25 insertions, 9 deletions
diff --git a/core/global_constants.cpp b/core/global_constants.cpp
index 4f535fb05e..18071d7748 100644
--- a/core/global_constants.cpp
+++ b/core/global_constants.cpp
@@ -106,7 +106,6 @@ static _GlobalConstant _global_constants[] = {
BIND_GLOBAL_CONSTANT(KEY_F14),
BIND_GLOBAL_CONSTANT(KEY_F15),
BIND_GLOBAL_CONSTANT(KEY_F16),
- BIND_GLOBAL_CONSTANT(KEY_KP_ENTER),
BIND_GLOBAL_CONSTANT(KEY_KP_MULTIPLY),
BIND_GLOBAL_CONSTANT(KEY_KP_DIVIDE),
BIND_GLOBAL_CONSTANT(KEY_KP_SUBTRACT),
diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp
index 285cc6e3c2..9b89fa3399 100644
--- a/core/io/resource_loader.cpp
+++ b/core/io/resource_loader.cpp
@@ -430,6 +430,9 @@ void ResourceLoader::reload_translation_remaps() {
void ResourceLoader::load_translation_remaps() {
+ if (!ProjectSettings::get_singleton()->has("locale/translation_remaps"))
+ return;
+
Dictionary remaps = ProjectSettings::get_singleton()->get("locale/translation_remaps");
List<Variant> keys;
remaps.get_key_list(&keys);
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();
diff --git a/core/reference.cpp b/core/reference.cpp
index c55f8a7fe3..060608eacb 100644
--- a/core/reference.cpp
+++ b/core/reference.cpp
@@ -74,7 +74,8 @@ bool Reference::unreference() {
bool die = refcount.unref();
if (get_script_instance()) {
- die = die && get_script_instance()->refcount_decremented();
+ bool script_ret = get_script_instance()->refcount_decremented();
+ die = die && script_ret;
}
return die;
diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp
index a7b6f25590..dec41e7976 100644
--- a/core/script_debugger_remote.cpp
+++ b/core/script_debugger_remote.cpp
@@ -74,7 +74,7 @@ Error ScriptDebuggerRemote::connect_to_host(const String &p_host, uint16_t p_por
} else {
OS::get_singleton()->delay_usec(1000000);
- print_line("Remote Debugger: Connection failed with status: " + String::num(tcp_client->get_status()) + "'', retrying in 1 sec.");
+ print_line("Remote Debugger: Connection failed with status: '" + String::num(tcp_client->get_status()) + "', retrying in 1 sec.");
};
};