summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/bind/core_bind.cpp6
-rw-r--r--core/bind/core_bind.h6
-rw-r--r--core/math/a_star.cpp4
-rw-r--r--core/object.cpp5
-rw-r--r--core/object.h1
-rw-r--r--core/os/os.cpp8
-rw-r--r--core/os/os.h9
7 files changed, 23 insertions, 16 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index e81468e888..f17d7372e2 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -592,17 +592,17 @@ struct Time {
};
*/
-int _OS::get_static_memory_usage() const {
+uint64_t _OS::get_static_memory_usage() const {
return OS::get_singleton()->get_static_memory_usage();
}
-int _OS::get_static_memory_peak_usage() const {
+uint64_t _OS::get_static_memory_peak_usage() const {
return OS::get_singleton()->get_static_memory_peak_usage();
}
-int _OS::get_dynamic_memory_usage() const {
+uint64_t _OS::get_dynamic_memory_usage() const {
return OS::get_singleton()->get_dynamic_memory_usage();
}
diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h
index a4b4629037..1c8b985d73 100644
--- a/core/bind/core_bind.h
+++ b/core/bind/core_bind.h
@@ -283,9 +283,9 @@ public:
uint64_t get_system_time_secs() const;
uint64_t get_system_time_msecs() const;
- int get_static_memory_usage() const;
- int get_static_memory_peak_usage() const;
- int get_dynamic_memory_usage() const;
+ uint64_t get_static_memory_usage() const;
+ uint64_t get_static_memory_peak_usage() const;
+ uint64_t get_dynamic_memory_usage() const;
void delay_usec(uint32_t p_usec) const;
void delay_msec(uint32_t p_msec) const;
diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp
index a0556ae839..b885a06834 100644
--- a/core/math/a_star.cpp
+++ b/core/math/a_star.cpp
@@ -260,8 +260,8 @@ bool AStar::_solve(Point *begin_point, Point *end_point) {
}
// Check open list
- SelfList<Point> *least_cost_point = NULL;
- real_t least_cost = 1e30;
+ SelfList<Point> *least_cost_point = open_list.first();
+ real_t least_cost = Math_INF;
// TODO: Cache previous results
for (SelfList<Point> *E = open_list.first(); E; E = E->next()) {
diff --git a/core/object.cpp b/core/object.cpp
index 682586a7ab..05e661baab 100644
--- a/core/object.cpp
+++ b/core/object.cpp
@@ -1924,6 +1924,11 @@ void *Object::get_script_instance_binding(int p_script_language_index) {
return _script_instance_bindings[p_script_language_index];
}
+bool Object::has_script_instance_binding(int p_script_language_index) {
+
+ return _script_instance_bindings[p_script_language_index] != NULL;
+}
+
Object::Object() {
_class_ptr = NULL;
diff --git a/core/object.h b/core/object.h
index a5bb6dea5d..5bfef8a439 100644
--- a/core/object.h
+++ b/core/object.h
@@ -729,6 +729,7 @@ public:
//used by script languages to store binding data
void *get_script_instance_binding(int p_script_language_index);
+ bool has_script_instance_binding(int p_script_language_index);
void clear_internal_resource_paths();
diff --git a/core/os/os.cpp b/core/os/os.cpp
index 1f967030e7..d2d39d253a 100644
--- a/core/os/os.cpp
+++ b/core/os/os.cpp
@@ -393,16 +393,16 @@ Error OS::dialog_input_text(String p_title, String p_description, String p_parti
return OK;
};
-int OS::get_static_memory_usage() const {
+uint64_t OS::get_static_memory_usage() const {
return Memory::get_mem_usage();
}
-int OS::get_dynamic_memory_usage() const {
+uint64_t OS::get_dynamic_memory_usage() const {
return MemoryPool::total_memory;
}
-int OS::get_static_memory_peak_usage() const {
+uint64_t OS::get_static_memory_peak_usage() const {
return Memory::get_mem_max_usage();
}
@@ -418,7 +418,7 @@ bool OS::has_touchscreen_ui_hint() const {
return Input::get_singleton() && Input::get_singleton()->is_emulating_touch_from_mouse();
}
-int OS::get_free_static_memory() const {
+uint64_t OS::get_free_static_memory() const {
return Memory::get_mem_available();
}
diff --git a/core/os/os.h b/core/os/os.h
index 36d4e5a8c1..20a3494e11 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -266,6 +266,7 @@ public:
virtual bool has_environment(const String &p_var) const = 0;
virtual String get_environment(const String &p_var) const = 0;
+ virtual bool set_environment(const String &p_var, const String &p_value) const = 0;
virtual String get_name() = 0;
virtual List<String> get_cmdline_args() const { return _cmdline; }
@@ -382,10 +383,10 @@ public:
virtual void print_resources_in_use(bool p_short = false);
virtual void print_all_resources(String p_to_file = "");
- virtual int get_static_memory_usage() const;
- virtual int get_static_memory_peak_usage() const;
- virtual int get_dynamic_memory_usage() const;
- virtual int get_free_static_memory() const;
+ virtual uint64_t get_static_memory_usage() const;
+ virtual uint64_t get_static_memory_peak_usage() const;
+ virtual uint64_t get_dynamic_memory_usage() const;
+ virtual uint64_t get_free_static_memory() const;
RenderThreadMode get_render_thread_mode() const { return _render_thread_mode; }