HomeWildfire Games

Stop copying color every draw call for every GUI object using colors.

Description

Stop copying color every draw call for every GUI object using colors.

Avoid color copies for rendering Draw calls in GUIRenderer::UpdateDrawCallCache, CButton::Draw, CChart::DrawAxes, CDropDown::Draw, CList::DrawList, COList::DrawList, refs #1984, rP1518, rP22637, rP22638.
Avoid color copies during XML loading in CGUI::Xeromyces_ReadImage, CGUI::Xeromyces_ReadEffects, COList::HandleAdditionalChildren.
Add CGUI::HasPreDefinedColor and mark m_PreDefinedColors, CGUI::GetPreDefinedColor, IGUIButtonBehavior::ChooseColor() as const for consistency with the other "databases", refs rP22637.
Mark CGUIColor as NONCOPYABLE to add compiler errors if there is an unexplicit copy, refs rP22637.
Explicit ugly copy in CGUI::Xeromyces_ReadColor and CGUIColor::ParseString.
Deregister copying <CGUIColor>GetSetting functions, refs rP1518.
Uses the const ref GetSetting from rP22693.

Event Timeline

elexis added inline comments.Aug 21 2019, 11:16 AM
/ps/trunk/source/gui/GUIRenderer.h
57

Notice that these members are not default-initialized at construction time anymore - however so are the bools, and the value is always assigned for the bools and pointers just after the SDrawCall is created.

Stan added a subscriber: Stan.Aug 21 2019, 11:21 AM
Stan added inline comments.
/ps/trunk/source/gui/GUIRenderer.h
57

This will trigger cppcheck warning once I fix Coala's bug with it upstream.