• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Small footprint UI library for hardware accelerated games & applications


コミットメタ情報

リビジョン86794f28fc80ed11818576451b10901e3bc43703 (tree)
日時2016-12-22 05:02:37
作者Emil Segerås <emilsegers@gmai...>
コミッターEmil Segerås

ログメッセージ

Added follow_ref to CloneChildren.

変更サマリ

差分

--- a/src/tb/tb_node_tree.cpp
+++ b/src/tb/tb_node_tree.cpp
@@ -92,7 +92,7 @@ TBNode *TBNode::GetNodeInternal(const char *name, int name_len) const
9292 return nullptr;
9393 }
9494
95-bool TBNode::CloneChildren(TBNode *source)
95+bool TBNode::CloneChildren(TBNode *source, bool follow_refs)
9696 {
9797 TBNode *item = source->GetFirstChild();
9898 while (item)
@@ -101,10 +101,10 @@ bool TBNode::CloneChildren(TBNode *source)
101101 if (!new_child)
102102 return false;
103103
104- new_child->m_value.Copy(item->m_value);
104+ new_child->m_value.Copy(follow_refs ? item->GetValueFollowRef() : item->m_value);
105105 Add(new_child);
106106
107- if (!new_child->CloneChildren(item))
107+ if (!new_child->CloneChildren(item, follow_refs))
108108 return false;
109109 item = item->GetNext();
110110 }
--- a/src/tb/tb_node_tree.h
+++ b/src/tb/tb_node_tree.h
@@ -67,9 +67,11 @@ public:
6767 void Delete(TBNode *n) { m_children.Delete(n); }
6868
6969 /** Create duplicates of all items in source and add them to this node.
70+ If follow_refs is true, any references will be followed and the final target
71+ will be cloned instead of the ref node.
7072 Note: Nodes does not replace existing nodes with the same name. Cloned nodes
7173 are added after any existing nodes. */
72- bool CloneChildren(TBNode *source);
74+ bool CloneChildren(TBNode *source, bool follow_refs = false);
7375
7476 enum GET_MISS_POLICY {
7577 /** GetNode will return nullptr if the node doesn't exist. */