summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/core_bind.cpp14
-rw-r--r--core/extension/gdnative_interface.h2
-rw-r--r--core/os/main_loop.cpp4
-rw-r--r--core/os/main_loop.h4
-rw-r--r--core/templates/set.h7
-rw-r--r--core/variant/binder_common.h6
-rw-r--r--core/variant/method_ptrcall.h2
7 files changed, 21 insertions, 18 deletions
diff --git a/core/core_bind.cpp b/core/core_bind.cpp
index 12fca4215a..9e96d4b079 100644
--- a/core/core_bind.cpp
+++ b/core/core_bind.cpp
@@ -355,20 +355,20 @@ void _OS::print_all_textures_by_size() {
List<Ref<Resource>> rsrc;
ResourceCache::get_cached_resources(&rsrc);
- for (Ref<Resource> E : rsrc) {
- if (!E->is_class("ImageTexture")) {
+ for (Ref<Resource> &res : rsrc) {
+ if (!res->is_class("ImageTexture")) {
continue;
}
- Size2 size = E->call("get_size");
- int fmt = E->call("get_format");
+ Size2 size = res->call("get_size");
+ int fmt = res->call("get_format");
_OSCoreBindImg img;
img.size = size;
img.fmt = fmt;
- img.path = E->get_path();
+ img.path = res->get_path();
img.vram = Image::get_image_data_size(img.size.width, img.size.height, Image::Format(img.fmt));
- img.id = E->get_instance_id();
+ img.id = res->get_instance_id();
total += img.vram;
imgs.push_back(img);
}
@@ -387,7 +387,7 @@ void _OS::print_resources_by_type(const Vector<String> &p_types) {
List<Ref<Resource>> resources;
ResourceCache::get_cached_resources(&resources);
- for (Ref<Resource> r : resources) {
+ for (const Ref<Resource> &r : resources) {
bool found = false;
for (int i = 0; i < p_types.size(); i++) {
diff --git a/core/extension/gdnative_interface.h b/core/extension/gdnative_interface.h
index c1ebb3e76a..3e69a28d59 100644
--- a/core/extension/gdnative_interface.h
+++ b/core/extension/gdnative_interface.h
@@ -134,7 +134,7 @@ typedef void *GDNativeObjectPtr;
typedef void *GDNativeTypePtr;
typedef void *GDNativeMethodBindPtr;
typedef int64_t GDNativeInt;
-typedef uint32_t GDNativeBool;
+typedef uint8_t GDNativeBool;
typedef uint64_t GDObjectInstanceID;
/* VARIANT DATA I/O */
diff --git a/core/os/main_loop.cpp b/core/os/main_loop.cpp
index 016d9d0a09..3c0e56f5a8 100644
--- a/core/os/main_loop.cpp
+++ b/core/os/main_loop.cpp
@@ -66,7 +66,7 @@ void MainLoop::initialize() {
}
}
-bool MainLoop::physics_process(float p_time) {
+bool MainLoop::physics_process(double p_time) {
if (get_script_instance()) {
return get_script_instance()->call("_physics_process", p_time);
}
@@ -74,7 +74,7 @@ bool MainLoop::physics_process(float p_time) {
return false;
}
-bool MainLoop::process(float p_time) {
+bool MainLoop::process(double p_time) {
if (get_script_instance()) {
return get_script_instance()->call("_process", p_time);
}
diff --git a/core/os/main_loop.h b/core/os/main_loop.h
index 34e944709b..b42e9b18ff 100644
--- a/core/os/main_loop.h
+++ b/core/os/main_loop.h
@@ -60,8 +60,8 @@ public:
};
virtual void initialize();
- virtual bool physics_process(float p_time);
- virtual bool process(float p_time);
+ virtual bool physics_process(double p_time);
+ virtual bool process(double p_time);
virtual void finalize();
void set_initialize_script(const Ref<Script> &p_initialize_script);
diff --git a/core/templates/set.h b/core/templates/set.h
index 245c174862..9261d2d3d2 100644
--- a/core/templates/set.h
+++ b/core/templates/set.h
@@ -71,6 +71,9 @@ public:
Element *prev() {
return _prev;
}
+ T &get() {
+ return value;
+ }
const T &get() const {
return value;
};
@@ -118,8 +121,8 @@ public:
return *this;
}
- _FORCE_INLINE_ bool operator==(const Iterator &b) const { return E == b.E; }
- _FORCE_INLINE_ bool operator!=(const Iterator &b) const { return E != b.E; }
+ _FORCE_INLINE_ bool operator==(const ConstIterator &b) const { return E == b.E; }
+ _FORCE_INLINE_ bool operator!=(const ConstIterator &b) const { return E != b.E; }
_FORCE_INLINE_ ConstIterator(const Element *p_E) { E = p_E; }
_FORCE_INLINE_ ConstIterator() {}
diff --git a/core/variant/binder_common.h b/core/variant/binder_common.h
index ef5867c685..3cb2a6bfb5 100644
--- a/core/variant/binder_common.h
+++ b/core/variant/binder_common.h
@@ -69,17 +69,17 @@ struct VariantCaster<const T &> {
template <> \
struct VariantCaster<m_enum> { \
static _FORCE_INLINE_ m_enum cast(const Variant &p_variant) { \
- return (m_enum)p_variant.operator int(); \
+ return (m_enum)p_variant.operator int64_t(); \
} \
}; \
template <> \
struct PtrToArg<m_enum> { \
_FORCE_INLINE_ static m_enum convert(const void *p_ptr) { \
- return m_enum(*reinterpret_cast<const int *>(p_ptr)); \
+ return m_enum(*reinterpret_cast<const int64_t *>(p_ptr)); \
} \
typedef int64_t EncodeT; \
_FORCE_INLINE_ static void encode(m_enum p_val, const void *p_ptr) { \
- *(int *)p_ptr = p_val; \
+ *(int64_t *)p_ptr = p_val; \
} \
};
diff --git a/core/variant/method_ptrcall.h b/core/variant/method_ptrcall.h
index 7852187b77..8836e257a9 100644
--- a/core/variant/method_ptrcall.h
+++ b/core/variant/method_ptrcall.h
@@ -105,7 +105,7 @@ struct PtrToArg {};
} \
}
-MAKE_PTRARGCONV(bool, uint32_t);
+MAKE_PTRARGCONV(bool, uint8_t);
// Integer types.
MAKE_PTRARGCONV(uint8_t, int64_t);
MAKE_PTRARGCONV(int8_t, int64_t);