add viewport node, return ptr instead of ref for layout[id] to check wether is valid or not

This commit is contained in:
2017-03-02 21:40:36 +00:00
parent 75f1b96b4f
commit 8242db8815
5 changed files with 148 additions and 38 deletions

View File

@@ -391,11 +391,18 @@ void Node::load_internal(const tinyxml2::XMLElement* x_node)
n->load_internal(x_child);
break;
}
case kWidget::Viewport:
{
auto n = new NodeViewport();
add_child(n);
n->load_internal(x_child);
break;
}
case kWidget::Ref:
{
auto ids = x_child->Attribute("id");
auto id = const_hash(ids);
auto& ref = (*m_manager)[id].m_children[0];
auto& ref = (*m_manager)[id]->m_children[0];
auto n = ref->clone();
add_child(n);
break;