Commit 41efacc9 authored by cutealien's avatar cutealien

- CGUIEnvironment::loadGui - loading a gui into a target-element no longer...

- CGUIEnvironment::loadGui - loading a gui into a target-element no longer messes up when the gui-file contained guienvironment serialization.
- Improve IGUIEnvironment::loadGui documentation.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4272 dfc29bdd-3216-0410-991c-e03cc46cb475
parent af0ccd9d
Changes in 1.8 (??.??.2011)
- CGUIEnvironment::loadGui - loading a gui into a target-element no longer messes up when the gui-file contained guienvironment serialization.
- Colladawriter now exports materials per node when those are used in Irrlicht
- Colladawriter now writing matrices for node transformations as old solution did not work with CDummyTransformationSceneNode's.
......
......@@ -582,13 +582,19 @@ public:
virtual bool saveGUI(io::IWriteFile* file, IGUIElement* start=0) = 0;
//! Loads the gui. Note that the current gui is not cleared before.
/** \param filename Name of the file.
/** When a parent is set the elements will be added below the parent, the parent itself does not deserialize.
When the file contains skin-settings from the gui-environment those are always serialized into the
guienvironment independent of the parent setting.
\param filename Name of the file.
\param parent Parent for the loaded GUI, root if 0.
\return True if loading succeeded, else false. */
virtual bool loadGUI(const io::path& filename, IGUIElement* parent=0) = 0;
//! Loads the gui. Note that the current gui is not cleared before.
/** \param file The file to load from.
/** When a parent is set the elements will be added below the parent, the parent itself does not deserialize.
When the file contains skin-settings from the gui-environment those are always serialized into the
guienvironment independent of the parent setting.
\param file The file to load from.
\param parent Parent for the loaded GUI, root if 0.
\return True if loading succeeded, else false. */
virtual bool loadGUI(io::IReadFile* file, IGUIElement* parent=0) = 0;
......
......@@ -813,10 +813,14 @@ void CGUIEnvironment::readGUIElement(io::IXMLReader* reader, IGUIElement* node)
if (nodeType == io::EXN_NONE || nodeType == io::EXN_UNKNOWN || nodeType == io::EXN_ELEMENT_END)
return;
IGUIElement* deferedNode = 0;
if (!wcscmp(IRR_XML_FORMAT_GUI_ENV, reader->getNodeName()))
{
if (!node)
node = this; // root
// GuiEnvironment always must be this as it would serialize into a wrong element otherwise.
// So we use the given node next time
if ( node && node != this )
deferedNode = node;
node = this; // root
}
else if (!wcscmp(IRR_XML_FORMAT_GUI_ELEMENT, reader->getNodeName()))
{
......@@ -860,7 +864,10 @@ void CGUIEnvironment::readGUIElement(io::IXMLReader* reader, IGUIElement* node)
if (!wcscmp(IRR_XML_FORMAT_GUI_ELEMENT, reader->getNodeName()) ||
!wcscmp(IRR_XML_FORMAT_GUI_ENV, reader->getNodeName()))
{
readGUIElement(reader, node);
if ( deferedNode )
readGUIElement(reader, deferedNode);
else
readGUIElement(reader, node);
}
else
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment