Change GUI Object Setting values to be members of the IGUIObject inheriting class, rename AddSetting to RegisterSetting.

Improves performance for Draw calls by 3-5% according to a shady
benchmark.
Improves memory layout, since the values are not on the heap anymore but
in the using class.
Reduces complexity of the implementation and increases type safety.
Allows specifying default values at setting value construction time,
refs D2242.
Inspired by Vladislav introducing members that cached GetSetting values
in c016a74309/D325, refs #4039, ee38f0db37/D763, refs 4225,
a1c4c23ce4/D474, D406, which were formerly proposed to be removed in
D2241.

Differential Revision: https://code.wildfiregames.com/D2313
Tested on: clang 8.0.1, gcc 9.1.0, Jenkins vs2015
Comments By: Vladislav
This was SVN commit r23005.
This commit is contained in:
elexis
2019-09-27 12:49:59 +00:00
parent 7790fd7d29
commit a33fd55e81
31 changed files with 1019 additions and 877 deletions
+3 -1
View File
@@ -874,10 +874,12 @@ void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec
}
}
object->AdditionalChildrenHandled();
if (!ManuallySetZ)
{
// Set it automatically to 10 plus its parents
if (object->GetSetting<bool>("absolute"))
if (object->m_Absolute)
// If the object is absolute, we'll have to get the parent's Z buffered,
// and add to that!
object->SetSetting<float>("z", pParent->GetBufferedZ() + 10.f, false);