| 1528 | } |
| 1529 | |
| 1530 | u32 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 | } |
no test coverage detected