Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Yurkovich <deadpin>2021-10-15 12:42:21 +0300
committerClément Foucault <foucault.clem@gmail.com>2021-10-15 12:42:44 +0300
commit93a8fd1249ffc64ee089b8c3192908dec247fc07 (patch)
tree7bb64d08dbf1ff2f20894675628a758ba2549e4b /source/blender/editors/space_view3d
parent30bed8761dfb0c6ddb5ecd4b7c31c2e721a57535 (diff)
Cleanup: Commonize code for checking scene lights/world settings
There were several places attempting to check to see if scene lights and world were enabled for display. This tries to find a common place for both of these to reduce duplication. Honestly, I couldn't find a really good spot for these and settled on DRW_engine. It's not the best spot since they're not strictly drawing related, but let's start here. Reviewed By: fclem Differential Revision: https://developer.blender.org/D12658
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index bda6fa05a63..787cf529483 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -30,6 +30,7 @@
#include "DNA_material_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
+#include "DNA_view3d_types.h"
#include "MEM_guardedalloc.h"
@@ -1569,10 +1570,7 @@ static void space_view3d_listener(const wmSpaceTypeListenerParams *params)
case NC_SCENE:
switch (wmn->data) {
case ND_WORLD: {
- const bool use_scene_world = ((v3d->shading.type == OB_MATERIAL) &&
- (v3d->shading.flag & V3D_SHADING_SCENE_WORLD)) ||
- ((v3d->shading.type == OB_RENDER) &&
- (v3d->shading.flag & V3D_SHADING_SCENE_WORLD_RENDER));
+ const bool use_scene_world = V3D_USES_SCENE_WORLD(v3d);
if (v3d->flag2 & V3D_HIDE_OVERLAYS || use_scene_world) {
ED_area_tag_redraw_regiontype(area, RGN_TYPE_WINDOW);
}