Call CGUIColor base constructor without C++17 using declaration following 415939b59b.

This removes the trigger for an unidentified VS2015 bug revealed by the
IGUIObject::AddSetting / CGUISetting constructor in 85a622b13a
(unset GUIObject color settings didn't hold the color assigned in the
inherited default constructor, so hovered button text appeared black
instead of white on Windows).
The code in the two commits seems correct, but VS2015 doesn't seem to
implement it correctly (and claims to support C++17) while clang and gcc
behave as intended.
Fix whitespace.

Reported By: gameboy, Angen
Refs
https://wildfiregames.com/forum/index.php?/topic/26694-strange-font-color/

This was SVN commit r22617.
This commit is contained in:
elexis 2019-08-05 20:45:15 +00:00
parent 7e1f959db0
commit f236c07a56

View File

@ -24,13 +24,22 @@
/** /**
* Same as the CColor class, but this one can also parse colors predefined in the GUI page (such as "yellow"). * Same as the CColor class, but this one can also parse colors predefined in the GUI page (such as "yellow").
*/ */
struct CGUIColor : public CColor struct CGUIColor : CColor
{ {
using CColor::CColor; CGUIColor()
{
CColor();
}
bool ParseString(const CStr& value, int defaultAlpha = 255) CGUIColor(float r, float g, float b, float a)
{ {
return g_GUI->GetPreDefinedColor(value, *this) || CColor::ParseString(value, defaultAlpha); CColor(r, g, b, a);
} }
bool ParseString(const CStr& value, int defaultAlpha = 255)
{
return g_GUI->GetPreDefinedColor(value, *this) || CColor::ParseString(value, defaultAlpha);
}
}; };
#endif // INCLUDED_GUICOLOR #endif // INCLUDED_GUICOLOR