You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-29 16:16:38 +00:00
Optimize StringName usage
* Added a new macro SNAME() that constructs and caches a local stringname. * Subsequent usages use the cached version. * Since these use a global static variable, a second refcounter of static usages need to be kept for cleanup time. * Replaced all theme usages by this new macro. * Replace all signal emission usages by this new macro. * Replace all call_deferred usages by this new macro. This is part of ongoing work to optimize GUI and the editor.
This commit is contained in:
@@ -41,7 +41,7 @@ bool EditorDebuggerRemoteObject::_set(const StringName &p_name, const Variant &p
|
||||
}
|
||||
|
||||
prop_values[p_name] = p_value;
|
||||
emit_signal("value_edited", remote_object_id, p_name, p_value);
|
||||
emit_signal(SNAME("value_edited"), remote_object_id, p_name, p_value);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -114,11 +114,11 @@ void EditorDebuggerInspector::_notification(int p_what) {
|
||||
}
|
||||
|
||||
void EditorDebuggerInspector::_object_edited(ObjectID p_id, const String &p_prop, const Variant &p_value) {
|
||||
emit_signal("object_edited", p_id, p_prop, p_value);
|
||||
emit_signal(SNAME("object_edited"), p_id, p_prop, p_value);
|
||||
}
|
||||
|
||||
void EditorDebuggerInspector::_object_selected(ObjectID p_object) {
|
||||
emit_signal("object_selected", p_object);
|
||||
emit_signal(SNAME("object_selected"), p_object);
|
||||
}
|
||||
|
||||
ObjectID EditorDebuggerInspector::add_object(const Array &p_arr) {
|
||||
@@ -190,7 +190,7 @@ ObjectID EditorDebuggerInspector::add_object(const Array &p_arr) {
|
||||
if (old_prop_size == debugObj->prop_list.size() && new_props_added == 0) {
|
||||
//only some may have changed, if so, then update those, if exist
|
||||
for (Set<String>::Element *E = changed.front(); E; E = E->next()) {
|
||||
emit_signal("object_property_updated", debugObj->remote_object_id, E->get());
|
||||
emit_signal(SNAME("object_property_updated"), debugObj->remote_object_id, E->get());
|
||||
}
|
||||
} else {
|
||||
//full update, because props were added or removed
|
||||
|
||||
Reference in New Issue
Block a user