Index: source/gui/CGUI.h =================================================================== --- source/gui/CGUI.h +++ source/gui/CGUI.h @@ -358,7 +358,7 @@ * * @see LoadXmlFile() */ - void Xeromyces_ReadRootObjects(XMBElement Element, CXeromyces* pFile, std::unordered_set& Paths); + void Xeromyces_ReadRootObjects(const XMBData& file, XMBElement element, std::unordered_set& Paths); /** * Reads in the root element \ (the DOMElement). @@ -369,7 +369,7 @@ * * @see LoadXmlFile() */ - void Xeromyces_ReadRootSprites(XMBElement Element, CXeromyces* pFile); + void Xeromyces_ReadRootSprites(const XMBData& file, XMBElement element); /** * Reads in the root element \ (the DOMElement). @@ -380,7 +380,7 @@ * * @see LoadXmlFile() */ - void Xeromyces_ReadRootStyles(XMBElement Element, CXeromyces* pFile); + void Xeromyces_ReadRootStyles(const XMBData& file, XMBElement element); /** * Reads in the root element \ (the DOMElement). @@ -391,7 +391,7 @@ * * @see LoadXmlFile() */ - void Xeromyces_ReadRootSetup(XMBElement Element, CXeromyces* pFile); + void Xeromyces_ReadRootSetup(const XMBData& file, XMBElement element); // Read Subs @@ -417,7 +417,7 @@ * * @see LoadXmlFile() */ - void Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObject* pParent, std::vector >& NameSubst, std::unordered_set& Paths, u32 nesting_depth); + IGUIObject* Xeromyces_ReadObject(const XMBData& file, XMBElement element, IGUIObject* pParent, std::vector >& NameSubst, std::unordered_set& Paths, u32 nesting_depth); /** * Reads in the element \, which repeats its child \s @@ -425,7 +425,7 @@ * 'var' enclosed in square brackets) in its descendants' names with "[0]", * "[1]", etc. */ - void Xeromyces_ReadRepeat(XMBElement Element, CXeromyces* pFile, IGUIObject* pParent, std::vector >& NameSubst, std::unordered_set& Paths, u32 nesting_depth); + void Xeromyces_ReadRepeat(const XMBData& file, XMBElement element, IGUIObject* pParent, std::vector >& NameSubst, std::unordered_set& Paths, u32 nesting_depth); /** * Reads in the element \ (the XMBElement) and executes @@ -438,7 +438,7 @@ * * @see LoadXmlFile() */ - void Xeromyces_ReadScript(XMBElement Element, CXeromyces* pFile, std::unordered_set& Paths); + void Xeromyces_ReadScript(const XMBData& file, XMBElement element, std::unordered_set& Paths); /** * Reads in the element \ (the XMBElement) and stores the @@ -450,7 +450,7 @@ * * @see LoadXmlFile() */ - void Xeromyces_ReadSprite(XMBElement Element, CXeromyces* pFile); + void Xeromyces_ReadSprite(const XMBData& file, XMBElement element); /** * Reads in the element \ (the XMBElement) and stores the @@ -463,7 +463,7 @@ * * @see LoadXmlFile() */ - void Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite& parent); + void Xeromyces_ReadImage(const XMBData& file, XMBElement element, CGUISprite& parent); /** * Reads in the element \ (the XMBElement) and stores the @@ -476,7 +476,7 @@ * * @see LoadXmlFile() */ - void Xeromyces_ReadEffects(XMBElement Element, CXeromyces* pFile, SGUIImageEffects& effects); + void Xeromyces_ReadEffects(const XMBData& file, XMBElement element, SGUIImageEffects& effects); /** * Reads in the element \ (the XMBElement) and stores the @@ -488,7 +488,7 @@ * * @see LoadXmlFile() */ - void Xeromyces_ReadStyle(XMBElement Element, CXeromyces* pFile); + void Xeromyces_ReadStyle(const XMBData& file, XMBElement element); /** * Reads in the element \ (the XMBElement) and stores the @@ -500,7 +500,7 @@ * * @see LoadXmlFile() */ - void Xeromyces_ReadScrollBarStyle(XMBElement Element, CXeromyces* pFile); + void Xeromyces_ReadScrollBarStyle(const XMBData& file, XMBElement element); /** * Reads in the element \ (the XMBElement) and stores the @@ -512,7 +512,7 @@ * * @see LoadXmlFile() */ - void Xeromyces_ReadIcon(XMBElement Element, CXeromyces* pFile); + void Xeromyces_ReadIcon(const XMBData& file, XMBElement element); /** * Reads in the element \ (the XMBElement) and stores the @@ -524,7 +524,7 @@ * * @see LoadXmlFile() */ - void Xeromyces_ReadTooltip(XMBElement Element, CXeromyces* pFile); + void Xeromyces_ReadTooltip(const XMBData& file, XMBElement element); /** * Reads in the element \ (the XMBElement) and stores the @@ -536,7 +536,7 @@ * * @see LoadXmlFile() */ - void Xeromyces_ReadColor(XMBElement Element, CXeromyces* pFile); + void Xeromyces_ReadColor(const XMBData& file, XMBElement element); //@} Index: source/gui/CGUI.cpp =================================================================== --- source/gui/CGUI.cpp +++ source/gui/CGUI.cpp @@ -386,7 +386,7 @@ } m_pAllObjects[child.m_Name] = &child; - parent.AddChild(child); + parent.RegisterChild(&child); return true; } @@ -527,21 +527,21 @@ { Paths.insert(Filename); - CXeromyces XeroFile; - if (XeroFile.Load(g_VFS, Filename, "gui") != PSRETURN_OK) + CXeromyces xeroFile; + if (xeroFile.Load(g_VFS, Filename, "gui") != PSRETURN_OK) return; - XMBElement node = XeroFile.GetRoot(); - CStr root_name(XeroFile.GetElementString(node.GetNodeName())); + XMBElement node = xeroFile.GetRoot(); + CStr root_name(xeroFile.GetElementString(node.GetNodeName())); if (root_name == "objects") - Xeromyces_ReadRootObjects(node, &XeroFile, Paths); + Xeromyces_ReadRootObjects(xeroFile, node, Paths); else if (root_name == "sprites") - Xeromyces_ReadRootSprites(node, &XeroFile); + Xeromyces_ReadRootSprites(xeroFile, node); else if (root_name == "styles") - Xeromyces_ReadRootStyles(node, &XeroFile); + Xeromyces_ReadRootStyles(xeroFile, node); else if (root_name == "setup") - Xeromyces_ReadRootSetup(node, &XeroFile); + Xeromyces_ReadRootSetup(xeroFile, node); else LOGERROR("CGUI::LoadXmlFile encountered an unknown XML root node type: %s", root_name.c_str()); } @@ -560,63 +560,63 @@ // XML Reading Xeromyces Specific Sub-Routines //=================================================================== -void CGUI::Xeromyces_ReadRootObjects(XMBElement Element, CXeromyces* pFile, std::unordered_set& Paths) +void CGUI::Xeromyces_ReadRootObjects(const XMBData& file, XMBElement element, std::unordered_set& Paths) { - int el_script = pFile->GetElementID("script"); + int el_script = file.GetElementID("script"); std::vector > subst; // Iterate main children // they should all be or