From 8036342ea8c20ede363d5d3fe5459cc2af58a0f6 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 30 Jan 2009 12:18:08 +0000 Subject: 2.5: UI & Menus * Cleaned up UI_interface.h a bit, and added some comments to organize things a bit and indicate what should be used when. * uiMenu* functions can now be used to create menus for headers too, this is done with a uiDefMenuBut, which takes a pointer to a uiMenuCreateFunc, that will then call uiMenu* functions. * Renamed uiMenuBegin/End to uiPupMenuBegin/End, as these are specific to making popup menus. Will convert the other conformation popup menu functions to use this too so we can remove some code. * Extended uiMenu functions, now there is is also: BooleanO, FloatO, BooleanR, EnumR, LevelEnumR, Separator. * Converted image window headers to use uiMenu functions, simplifies menu code further here. Did not remove the uiDefMenu functions as they are used in sequencer/view3d in some places now (will fix). * Also tried to simplify and fix bounds computation a bit better for popup menus. It tried to find out in advance what the size of the menu was but this is difficult with keymap strings in there, now uiPopupBoundsBlock can figure this out afterwards and ensure the popup is within the window bounds. Will convert some other functions to use this too. --- source/blender/render/intern/source/occlusion.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source/blender/render') diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c index 174a9db4398..c75de189b10 100644 --- a/source/blender/render/intern/source/occlusion.c +++ b/source/blender/render/intern/source/occlusion.c @@ -514,10 +514,6 @@ static void occ_build_recursive(OcclusionTree *tree, OccNode *node, int begin, i OccFace *face; int a, b, totthread=0, offset[TOTCHILD], count[TOTCHILD]; - /* keep track of maximum depth for stack */ - if(depth > tree->maxdepth) - tree->maxdepth= depth; - /* add a new node */ node->occlusion= 1.0f; @@ -552,6 +548,10 @@ static void occ_build_recursive(OcclusionTree *tree, OccNode *node, int begin, i child= BLI_memarena_alloc(tree->arena, sizeof(OccNode)); node->child[b].node= child; + /* keep track of maximum depth for stack */ + if(depth+1 > tree->maxdepth) + tree->maxdepth= depth+1; + if(tree->dothreadedbuild) BLI_unlock_thread(LOCK_CUSTOM1); @@ -679,6 +679,7 @@ static OcclusionTree *occ_tree_build(Render *re) /* recurse */ tree->root= BLI_memarena_alloc(tree->arena, sizeof(OccNode)); + tree->maxdepth= 1; occ_build_recursive(tree, tree->root, 0, totface, 1); #if 0 -- cgit v1.2.3