diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/class_db.cpp | 9 | ||||
-rw-r--r-- | core/class_db.h | 1 | ||||
-rw-r--r-- | core/math/camera_matrix.cpp | 2 | ||||
-rw-r--r-- | core/object.h | 6 | ||||
-rw-r--r-- | core/ustring.cpp | 4 |
5 files changed, 15 insertions, 7 deletions
diff --git a/core/class_db.cpp b/core/class_db.cpp index 691b5a20fd..5e49688e9b 100644 --- a/core/class_db.cpp +++ b/core/class_db.cpp @@ -930,6 +930,15 @@ void ClassDB::add_property_group(StringName p_class, const String &p_name, const type->property_list.push_back(PropertyInfo(Variant::NIL, p_name, PROPERTY_HINT_NONE, p_prefix, PROPERTY_USAGE_GROUP)); } +void ClassDB::add_property_subgroup(StringName p_class, const String &p_name, const String &p_prefix) { + + OBJTYPE_WLOCK; + ClassInfo *type = classes.getptr(p_class); + ERR_FAIL_COND(!type); + + type->property_list.push_back(PropertyInfo(Variant::NIL, p_name, PROPERTY_HINT_NONE, p_prefix, PROPERTY_USAGE_SUBGROUP)); +} + void ClassDB::add_property(StringName p_class, const PropertyInfo &p_pinfo, const StringName &p_setter, const StringName &p_getter, int p_index) { lock->read_lock(); diff --git a/core/class_db.h b/core/class_db.h index 1cbff34ea1..f760aa1738 100644 --- a/core/class_db.h +++ b/core/class_db.h @@ -349,6 +349,7 @@ public: static void get_signal_list(StringName p_class, List<MethodInfo> *p_signals, bool p_no_inheritance = false); static void add_property_group(StringName p_class, const String &p_name, const String &p_prefix = ""); + static void add_property_subgroup(StringName p_class, const String &p_name, const String &p_prefix = ""); static void add_property(StringName p_class, const PropertyInfo &p_pinfo, const StringName &p_setter, const StringName &p_getter, int p_index = -1); static void set_property_default_value(StringName p_class, const StringName &p_name, const Variant &p_default); static void get_property_list(StringName p_class, List<PropertyInfo> *p_list, bool p_no_inheritance = false, const Object *p_validator = nullptr); diff --git a/core/math/camera_matrix.cpp b/core/math/camera_matrix.cpp index c4981b954b..c36070e47f 100644 --- a/core/math/camera_matrix.cpp +++ b/core/math/camera_matrix.cpp @@ -145,7 +145,7 @@ void CameraMatrix::set_for_hmd(int p_eye, real_t p_aspect, real_t p_intraocular_ f3 *= p_oversample; // always apply KEEP_WIDTH aspect ratio - f3 *= p_aspect; + f3 /= p_aspect; switch (p_eye) { case 1: { // left eye diff --git a/core/object.h b/core/object.h index 40032de271..06dd610a3b 100644 --- a/core/object.h +++ b/core/object.h @@ -107,10 +107,7 @@ enum PropertyUsageFlags { PROPERTY_USAGE_INTERNATIONALIZED = 64, //hint for internationalized strings PROPERTY_USAGE_GROUP = 128, //used for grouping props in the editor PROPERTY_USAGE_CATEGORY = 256, - // FIXME: Drop in 4.0, possibly reorder other flags? - // Those below are deprecated thanks to ClassDB's now class value cache - //PROPERTY_USAGE_STORE_IF_NONZERO = 512, //only store if nonzero - //PROPERTY_USAGE_STORE_IF_NONONE = 1024, //only store if false + PROPERTY_USAGE_SUBGROUP = 512, PROPERTY_USAGE_NO_INSTANCE_STATE = 2048, PROPERTY_USAGE_RESTART_IF_CHANGED = 4096, PROPERTY_USAGE_SCRIPT_VARIABLE = 8192, @@ -138,6 +135,7 @@ enum PropertyUsageFlags { #define ADD_PROPERTYI(m_property, m_setter, m_getter, m_index) ClassDB::add_property(get_class_static(), m_property, _scs_create(m_setter), _scs_create(m_getter), m_index) #define ADD_PROPERTY_DEFAULT(m_property, m_default) ClassDB::set_property_default_value(get_class_static(), m_property, m_default) #define ADD_GROUP(m_name, m_prefix) ClassDB::add_property_group(get_class_static(), m_name, m_prefix) +#define ADD_SUBGROUP(m_name, m_prefix) ClassDB::add_property_subgroup(get_class_static(), m_name, m_prefix) struct PropertyInfo { diff --git a/core/ustring.cpp b/core/ustring.cpp index e56f177103..fbe3fcb1b2 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -647,13 +647,13 @@ String String::camelcase_to_underscore(bool lowercase) const { } String String::get_with_code_lines() const { - Vector<String> lines = split("\n"); + const Vector<String> lines = split("\n"); String ret; for (int i = 0; i < lines.size(); i++) { if (i > 0) { ret += "\n"; } - ret += itos(i + 1) + " " + lines[i]; + ret += vformat("%4d | %s", i + 1, lines[i]); } return ret; } |