| 564 | const char *GetXMLAttributeValueString(const tinyxml2::XMLAttribute *attributePtr) { return attributePtr->Value(); } |
| 565 | |
| 566 | void RetroEngine::LoadXMLWindowText() |
| 567 | { |
| 568 | FileInfo info; |
| 569 | for (int m = 0; m < (int)modList.size(); ++m) { |
| 570 | if (!modList[m].active) |
| 571 | continue; |
| 572 | |
| 573 | SetActiveMod(m); |
| 574 | if (LoadFile("Data/Game/Game.xml", &info)) { |
| 575 | tinyxml2::XMLDocument *doc = new tinyxml2::XMLDocument; |
| 576 | |
| 577 | char *xmlData = new char[info.fileSize + 1]; |
| 578 | FileRead(xmlData, info.fileSize); |
| 579 | xmlData[info.fileSize] = 0; |
| 580 | |
| 581 | bool success = doc->Parse(xmlData) == tinyxml2::XML_SUCCESS; |
| 582 | |
| 583 | if (success) { |
| 584 | const tinyxml2::XMLElement *gameElement = FirstXMLChildElement(doc, nullptr, "game"); |
| 585 | const tinyxml2::XMLElement *titleElement = FirstXMLChildElement(doc, gameElement, "title"); |
| 586 | if (titleElement) { |
| 587 | const tinyxml2::XMLAttribute *nameAttr = FindXMLAttribute(titleElement, "name"); |
| 588 | if (nameAttr) |
| 589 | StrCopy(gameWindowText, GetXMLAttributeValueString(nameAttr)); |
| 590 | } |
| 591 | } |
| 592 | |
| 593 | delete[] xmlData; |
| 594 | delete doc; |
| 595 | |
| 596 | CloseFile(); |
| 597 | } |
| 598 | } |
| 599 | SetActiveMod(-1); |
| 600 | } |
| 601 | void RetroEngine::LoadXMLVariables() |
| 602 | { |
| 603 | FileInfo info; |
nothing calls this directly
no test coverage detected