summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/object/class_db.h3
-rw-r--r--core/object/undo_redo.cpp13
-rw-r--r--core/templates/hashfuncs.h9
3 files changed, 14 insertions, 11 deletions
diff --git a/core/object/class_db.h b/core/object/class_db.h
index aceea5b651..d9eec4e4a8 100644
--- a/core/object/class_db.h
+++ b/core/object/class_db.h
@@ -164,6 +164,7 @@ public:
t->creation_func = &creator<T>;
t->exposed = true;
t->class_ptr = T::get_class_ptr_static();
+ t->api = current_api;
T::register_custom_data_to_otdb();
}
@@ -175,6 +176,7 @@ public:
ERR_FAIL_COND(!t);
t->exposed = true;
t->class_ptr = T::get_class_ptr_static();
+ t->api = current_api;
//nothing
}
@@ -195,6 +197,7 @@ public:
t->creation_func = &_create_ptr_func<T>;
t->exposed = true;
t->class_ptr = T::get_class_ptr_static();
+ t->api = current_api;
T::register_custom_data_to_otdb();
}
diff --git a/core/object/undo_redo.cpp b/core/object/undo_redo.cpp
index 905bb587a8..9c84c2add7 100644
--- a/core/object/undo_redo.cpp
+++ b/core/object/undo_redo.cpp
@@ -104,29 +104,22 @@ void UndoRedo::create_action(const String &p_name, MergeMode p_mode) {
memdelete(obj);
}
}
- String s = "removed " + E->get().name + ": ";
- for (int j = 0; j < VARIANT_ARG_MAX; j++) {
- if (E->get().args[j].get_type() == Variant::NIL) {
- break;
- }
- s += String(E->get().args[j]);
- }
- print_line(s);
E->erase();
}
}
actions.write[actions.size() - 1].last_tick = ticks;
+ merge_mode = p_mode;
merging = true;
} else {
Action new_action;
new_action.name = p_name;
new_action.last_tick = ticks;
actions.push_back(new_action);
- }
- merge_mode = p_mode;
+ merge_mode = MERGE_DISABLE;
+ }
}
action_level++;
diff --git a/core/templates/hashfuncs.h b/core/templates/hashfuncs.h
index 2e932f9f26..c1a7c4146e 100644
--- a/core/templates/hashfuncs.h
+++ b/core/templates/hashfuncs.h
@@ -74,6 +74,13 @@ static inline uint32_t hash_djb2_one_32(uint32_t p_in, uint32_t p_prev = 5381) {
return ((p_prev << 5) + p_prev) + p_in;
}
+/**
+ * Thomas Wang's 64-bit to 32-bit Hash function:
+ * https://web.archive.org/web/20071223173210/https:/www.concentric.net/~Ttwang/tech/inthash.htm
+ *
+ * @param p_int - 64-bit unsigned integer key to be hashed
+ * @return unsigned 32-bit value representing hashcode
+ */
static inline uint32_t hash_one_uint64(const uint64_t p_int) {
uint64_t v = p_int;
v = (~v) + (v << 18); // v = (v << 18) - v - 1;
@@ -82,7 +89,7 @@ static inline uint32_t hash_one_uint64(const uint64_t p_int) {
v = v ^ (v >> 11);
v = v + (v << 6);
v = v ^ (v >> 22);
- return (int)v;
+ return uint32_t(v);
}
static inline uint32_t hash_djb2_one_float(double p_in, uint32_t p_prev = 5381) {