diff options
author | Tavian Barnes <tavianator@gmail.com> | 2010-05-04 10:50:38 -0600 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2010-05-05 22:33:28 -0600 |
commit | 0149cd51012afe439c1b179a4d1715f7e0b619bb (patch) | |
tree | 1704778351967e7f46eaae83b2e222b1a1fd8a20 /libdimension | |
parent | ffb7bc0e1a0529d7c85ea5860070b8fbf7f2b1e0 (diff) | |
download | dimension-0149cd51012afe439c1b179a4d1715f7e0b619bb.tar.xz |
Make dmnsn_new_prtree() handle empty scenes.
Diffstat (limited to 'libdimension')
-rw-r--r-- | libdimension/prtree.c | 6 |
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; } |