utility function to find the biggest area: BKE_screen_find_big_area(...), was being...
[blender.git] / source / blender / windowmanager / intern / wm_init_exit.c
index f32e2afa3e08c6cc601a40187603c51b89ee832d..0795bc8deee8c4448e615d05926164d22a4690d9 100644 (file)
@@ -212,24 +212,6 @@ void WM_init_splash(bContext *C)
        }
 }
 
-static ScrArea *biggest_view3d(bContext *C)
-{
-       bScreen *sc= CTX_wm_screen(C);
-       ScrArea *sa, *big= NULL;
-       int size, maxsize= 0;
-
-       for(sa= sc->areabase.first; sa; sa= sa->next) {
-               if(sa->spacetype==SPACE_VIEW3D) {
-                       size= sa->winx * sa->winy;
-                       if(size > maxsize) {
-                               maxsize= size;
-                               big= sa;
-                       }
-               }
-       }
-       return big;
-}
-
 int WM_init_game(bContext *C)
 {
        wmWindowManager *wm= CTX_wm_manager(C);
@@ -252,7 +234,7 @@ int WM_init_game(bContext *C)
        if(win)
                CTX_wm_window_set(C, win);
 
-       sa = biggest_view3d(C);
+       sa = BKE_screen_find_big_area(CTX_wm_screen(C), SPACE_VIEW3D, 0);
        ar= BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
 
        // if we have a valid 3D view