diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-04 05:15:04 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-04 05:15:04 +0400 |
commit | 2d787e6e015e54e760086266415d66cad5d1edec (patch) | |
tree | 61371a53d945e133aba83063e7f32f47b8637e89 /source/blender/editors/object/object_bake.c | |
parent | 29575c9ac8c08ae264f06b6ce34fa606bb09bdab (diff) |
utility function to find the biggest area: BKE_screen_find_big_area(...), was being done with static functions that were copied about.
Diffstat (limited to 'source/blender/editors/object/object_bake.c')
-rw-r--r-- | source/blender/editors/object/object_bake.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index e29dfaa0a23..5487cbdadb2 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -54,6 +54,7 @@ #include "BLI_math_geom.h" #include "BKE_blender.h" +#include "BKE_screen.h" #include "BKE_context.h" #include "BKE_global.h" #include "BKE_image.h" @@ -1202,24 +1203,6 @@ static int thread_break(void *UNUSED(arg)) return G.afbreek; } -static ScrArea *biggest_image_area(bScreen *screen) -{ - ScrArea *sa, *big= NULL; - int size, maxsize= 0; - - for(sa= screen->areabase.first; sa; sa= sa->next) { - if(sa->spacetype==SPACE_IMAGE) { - size= sa->winx*sa->winy; - if(sa->winx > 10 && sa->winy > 10 && size > maxsize) { - maxsize= size; - big= sa; - } - } - } - return big; -} - - typedef struct BakeRender { Render *re; Main *main; @@ -1270,7 +1253,7 @@ static void init_bake_internal(BakeRender *bkr, bContext *C) /* get editmode results */ ED_object_exit_editmode(C, 0); /* 0 = does not exit editmode */ - bkr->sa= biggest_image_area(CTX_wm_screen(C)); /* can be NULL */ + bkr->sa= BKE_screen_find_big_area(CTX_wm_screen(C), SPACE_IMAGE, 10); /* can be NULL */ bkr->main= CTX_data_main(C); bkr->scene= scene; bkr->actob= (scene->r.bake_flag & R_BAKE_TO_ACTIVE) ? OBACT : NULL; |