Index: ps/trunk/source/gui/CGUI.h =================================================================== --- ps/trunk/source/gui/CGUI.h +++ ps/trunk/source/gui/CGUI.h @@ -357,7 +357,7 @@ * * @see LoadXmlFile() */ - void Xeromyces_ReadRootObjects(XMBElement Element, CXeromyces* pFile, std::unordered_set& Paths); + void Xeromyces_ReadRootObjects(const XMBData& xmb, XMBElement element, std::unordered_set& Paths); /** * Reads in the root element \ (the DOMElement). @@ -368,7 +368,7 @@ * * @see LoadXmlFile() */ - void Xeromyces_ReadRootSprites(XMBElement Element, CXeromyces* pFile); + void Xeromyces_ReadRootSprites(const XMBData& xmb, XMBElement element); /** * Reads in the root element \ (the DOMElement). @@ -379,7 +379,7 @@ * * @see LoadXmlFile() */ - void Xeromyces_ReadRootStyles(XMBElement Element, CXeromyces* pFile); + void Xeromyces_ReadRootStyles(const XMBData& xmb, XMBElement element); /** * Reads in the root element \ (the DOMElement). @@ -390,7 +390,7 @@ * * @see LoadXmlFile() */ - void Xeromyces_ReadRootSetup(XMBElement Element, CXeromyces* pFile); + void Xeromyces_ReadRootSetup(const XMBData& xmb, XMBElement element); // Read Subs @@ -416,7 +416,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& xmb, XMBElement element, IGUIObject* pParent, std::vector >& NameSubst, std::unordered_set& Paths, u32 nesting_depth); /** * Reads in the element \, which repeats its child \s @@ -424,7 +424,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& xmb, XMBElement element, IGUIObject* pParent, std::vector >& NameSubst, std::unordered_set& Paths, u32 nesting_depth); /** * Reads in the element \ (the XMBElement) and executes @@ -437,7 +437,7 @@ * * @see LoadXmlFile() */ - void Xeromyces_ReadScript(XMBElement Element, CXeromyces* pFile, std::unordered_set& Paths); + void Xeromyces_ReadScript(const XMBData& xmb, XMBElement element, std::unordered_set& Paths); /** * Reads in the element \ (the XMBElement) and stores the @@ -449,7 +449,7 @@ * * @see LoadXmlFile() */ - void Xeromyces_ReadSprite(XMBElement Element, CXeromyces* pFile); + void Xeromyces_ReadSprite(const XMBData& xmb, XMBElement element); /** * Reads in the element \ (the XMBElement) and stores the @@ -462,7 +462,7 @@ * * @see LoadXmlFile() */ - void Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite& parent); + void Xeromyces_ReadImage(const XMBData& xmb, XMBElement element, CGUISprite& parent); /** * Reads in the element \ (the XMBElement) and stores the @@ -475,7 +475,7 @@ * * @see LoadXmlFile() */ - void Xeromyces_ReadEffects(XMBElement Element, CXeromyces* pFile, SGUIImageEffects& effects); + void Xeromyces_ReadEffects(const XMBData& xmb, XMBElement element, SGUIImageEffects& effects); /** * Reads in the element \ (the XMBElement) and stores the @@ -487,7 +487,7 @@ * * @see LoadXmlFile() */ - void Xeromyces_ReadStyle(XMBElement Element, CXeromyces* pFile); + void Xeromyces_ReadStyle(const XMBData& xmb, XMBElement element); /** * Reads in the element \ (the XMBElement) and stores the @@ -499,7 +499,7 @@ * * @see LoadXmlFile() */ - void Xeromyces_ReadScrollBarStyle(XMBElement Element, CXeromyces* pFile); + void Xeromyces_ReadScrollBarStyle(const XMBData& xmb, XMBElement element); /** * Reads in the element \ (the XMBElement) and stores the @@ -511,7 +511,7 @@ * * @see LoadXmlFile() */ - void Xeromyces_ReadIcon(XMBElement Element, CXeromyces* pFile); + void Xeromyces_ReadIcon(const XMBData& xmb, XMBElement element); /** * Reads in the element \ (the XMBElement) and stores the @@ -523,7 +523,7 @@ * * @see LoadXmlFile() */ - void Xeromyces_ReadTooltip(XMBElement Element, CXeromyces* pFile); + void Xeromyces_ReadTooltip(const XMBData& xmb, XMBElement element); /** * Reads in the element \ (the XMBElement) and stores the @@ -535,7 +535,7 @@ * * @see LoadXmlFile() */ - void Xeromyces_ReadColor(XMBElement Element, CXeromyces* pFile); + void Xeromyces_ReadColor(const XMBData& xmb, XMBElement element); //@} Index: ps/trunk/source/gui/CGUI.cpp =================================================================== --- ps/trunk/source/gui/CGUI.cpp +++ ps/trunk/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(); - std::string_view root_name(XeroFile.GetElementStringView(node.GetNodeName())); + XMBElement node = xeroFile.GetRoot(); + std::string_view root_name(xeroFile.GetElementStringView(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.data()); } @@ -560,63 +560,62 @@ // XML Reading Xeromyces Specific Sub-Routines //=================================================================== -void CGUI::Xeromyces_ReadRootObjects(XMBElement Element, CXeromyces* pFile, std::unordered_set& Paths) +void CGUI::Xeromyces_ReadRootObjects(const XMBData& xmb, XMBElement element, std::unordered_set& Paths) { - int el_script = pFile->GetElementID("script"); + int el_script = xmb.GetElementID("script"); std::vector > subst; // Iterate main children // they should all be or