MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / GetColor

Method GetColor

ogsr_engine/xrGame/ui/UIXmlInit.cpp:1530–1546  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1528}
1529
1530u32 CUIXmlInit::GetColor(CUIXml& xml_doc, const char* path, int index, u32 def_clr)
1531{
1532 LPCSTR clr_def = xml_doc.ReadAttrib(path, index, "color", NULL);
1533 if (clr_def)
1534 {
1535 VERIFY(GetColorDefs()->find(clr_def) != GetColorDefs()->end());
1536 return (*m_pColorDefs)[clr_def];
1537 }
1538 else
1539 {
1540 int r = xml_doc.ReadAttribInt(path, index, "r", def_clr);
1541 int g = xml_doc.ReadAttribInt(path, index, "g", def_clr);
1542 int b = xml_doc.ReadAttribInt(path, index, "b", def_clr);
1543 int a = xml_doc.ReadAttribInt(path, index, "a", 0xff);
1544 return color_argb(a, r, g, b);
1545 }
1546}

Callers 10

UpdateAnimMethod · 0.45
UpdateMethod · 0.45
CreateDragItemMethod · 0.45
MakeAddonStaticFunction · 0.45
UpdateMethod · 0.45
script_registerMethod · 0.45
GetColorFunction · 0.45
GetTextureColorMethod · 0.45
InitStaticMethod · 0.45
InitMethod · 0.45

Calls 5

color_argbFunction · 0.85
ReadAttribMethod · 0.80
ReadAttribIntMethod · 0.80
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected