diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-04-09 05:48:04 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-04-09 05:52:34 +0400 |
commit | 9de24c82bab8fc6f1b8810979ac492787d32a964 (patch) | |
tree | 3c2466ebd791a52859ce19ffee8ff5ed518a6061 /source/blender/editors/space_view3d/view3d_draw.c | |
parent | b1f97a0cdb1bf6c7e0f80c6edb3182870625b9a6 (diff) |
View3D: disable LOD when game engine is disabled or ifdef'd
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_draw.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 9b455748713..2552be9b83b 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1992,8 +1992,12 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas copy_m4_m4(savedobmat, dob->ob->obmat); copy_m4_m4(dob->ob->obmat, dob->mat); savedlod = dob->ob->currentlod; - BKE_object_lod_update(dob->ob, rv3d->viewinv[3]); - + +#ifdef WITH_GAMEENGINE + if (rv3d->rflag & RV3D_IS_GAME_ENGINE) { + BKE_object_lod_update(dob->ob, rv3d->viewinv[3]); + } +#endif /* extra service: draw the duplicator in drawtype of parent, minimum taken * to allow e.g. boundbox box objects in groups for LOD */ @@ -3208,6 +3212,8 @@ static void view3d_main_area_clear(Scene *scene, View3D *v3d, ARegion *ar) } } + +#ifdef WITH_GAMEENGINE static void update_lods(Scene *scene, float camera_pos[3]) { Scene *sce_iter; @@ -3219,6 +3225,8 @@ static void update_lods(Scene *scene, float camera_pos[3]) BKE_object_lod_update(ob, camera_pos); } } +#endif + /* warning: this function has duplicate drawing in ED_view3d_draw_offscreen() */ static void view3d_main_area_draw_objects(const bContext *C, ARegion *ar, const char **grid_unit) @@ -3242,8 +3250,15 @@ static void view3d_main_area_draw_objects(const bContext *C, ARegion *ar, const /* setup view matrices */ view3d_main_area_setup_view(scene, v3d, ar, NULL, NULL); - /* Make sure LoDs are up to date */ - update_lods(scene, rv3d->viewinv[3]); + rv3d->rflag &= ~RV3D_IS_GAME_ENGINE; +#ifdef WITH_GAMEENGINE + if (STREQ(scene->r.engine, "BLENDER_GAME")) { + rv3d->rflag |= RV3D_IS_GAME_ENGINE; + + /* Make sure LoDs are up to date */ + update_lods(scene, rv3d->viewinv[3]); + } +#endif /* clear the background */ view3d_main_area_clear(scene, v3d, ar); |