1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Editor StringName and Viewport optimizations

* Added explicit return type to the SNAME macro.
* Add some extra SNAME usages.
* Change some ClassDB methods to use const StringName & arguments.
* Cache the Window parent in Control because it's used in
  is_layout_rtl(), which is called often.
* Only enable internal processing for viewports that need it.
* Change CanvasItem::group to be a StringName because it's only used as
  that.
This commit is contained in:
Joan Fons
2021-07-19 19:25:15 +02:00
parent b1eee24e26
commit a6adb58493
11 changed files with 80 additions and 66 deletions

View File

@@ -167,6 +167,6 @@ bool operator!=(const char *p_name, const StringName &p_string_name);
StringName _scs_create(const char *p_chr, bool p_static = false);
#define SNAME(m_arg) ([]() { static StringName sname = _scs_create(m_arg, true); return sname; })()
#define SNAME(m_arg) ([]() -> const StringName & { static StringName sname = _scs_create(m_arg, true); return sname; })()
#endif // STRING_NAME_H