MCPcopy Create free account
hub / github.com/RSDKModding/RSDKv3-Decompilation / LoadXMLWindowText

Method LoadXMLWindowText

RSDKv3/RetroEngine.cpp:566–600  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

564const char *GetXMLAttributeValueString(const tinyxml2::XMLAttribute *attributePtr) { return attributePtr->Value(); }
565
566void 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}
601void RetroEngine::LoadXMLVariables()
602{
603 FileInfo info;

Callers

nothing calls this directly

Calls 8

SetActiveModFunction · 0.85
LoadFileFunction · 0.85
FileReadFunction · 0.85
FirstXMLChildElementFunction · 0.85
FindXMLAttributeFunction · 0.85
StrCopyFunction · 0.85
CloseFileFunction · 0.85

Tested by

no test coverage detected