summaryrefslogtreecommitdiffstats
path: root/libdimension/prtree.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-05-04 10:50:38 -0600
committerTavian Barnes <tavianator@gmail.com>2010-05-05 22:33:28 -0600
commit0149cd51012afe439c1b179a4d1715f7e0b619bb (patch)
tree1704778351967e7f46eaae83b2e222b1a1fd8a20 /libdimension/prtree.c
parentffb7bc0e1a0529d7c85ea5860070b8fbf7f2b1e0 (diff)
downloaddimension-0149cd51012afe439c1b179a4d1715f7e0b619bb.tar.xz
Make dmnsn_new_prtree() handle empty scenes.
Diffstat (limited to 'libdimension/prtree.c')
-rw-r--r--libdimension/prtree.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libdimension/prtree.c b/libdimension/prtree.c
index a40100c..a4f8b96 100644
--- a/libdimension/prtree.c
+++ b/libdimension/prtree.c
@@ -418,6 +418,12 @@ dmnsn_pseudo_prtree_leaves(const dmnsn_pseudo_prtree *pseudo)
{
dmnsn_list *leaves = dmnsn_new_list(sizeof(dmnsn_prtree *));
dmnsn_pseudo_prtree_leaves_recursive(pseudo, leaves);
+
+ if (dmnsn_list_size(leaves) == 0) {
+ dmnsn_prtree *prnode = dmnsn_new_prtree_node(&pseudo->leaf);
+ dmnsn_list_push(leaves, &prnode);
+ }
+
return leaves;
}