diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-14 15:30:20 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-14 15:31:06 +0300 |
commit | 69a04c61402cf4e09927640d2588764bcfd2a357 (patch) | |
tree | cd9c5e1270b4a375265c8e66614ee57a410aa825 | |
parent | 69a9bcc2067bfc975ad3e9aa2e61eb7b76c2b187 (diff) |
Cleanup: correct flag comparisons
Also use smaller types for shading data.
4 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 2049856cfa6..9521c05f7f0 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -1809,7 +1809,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (!DNA_struct_elem_find(fd->filesdna, "View3DShadeing", "short", "background_type")) { + if (!DNA_struct_elem_find(fd->filesdna, "View3DShadeing", "char", "background_type")) { for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { diff --git a/source/blender/draw/engines/workbench/workbench_data.c b/source/blender/draw/engines/workbench/workbench_data.c index 29a3249782d..aa99883bb6b 100644 --- a/source/blender/draw/engines/workbench/workbench_data.c +++ b/source/blender/draw/engines/workbench/workbench_data.c @@ -55,13 +55,13 @@ void workbench_private_data_init(WORKBENCH_PrivateData *wpd) wd->matcap_orientation = (wpd->shading.flag & V3D_SHADING_MATCAP_FLIP_X) != 0; wd->background_alpha = (DRW_state_is_image_render() && scene->r.alphamode == R_ALPHAPREMUL) ? 0.0f : 1.0f; - if (!v3d || ((v3d->shading.background_type & V3D_SHADING_BACKGROUND_WORLD) && + if (!v3d || ((v3d->shading.background_type == V3D_SHADING_BACKGROUND_WORLD) && (scene->world != NULL))) { copy_v3_v3(wd->background_color_low, &scene->world->horr); copy_v3_v3(wd->background_color_high, &scene->world->horr); } - else if (v3d->shading.background_type & V3D_SHADING_BACKGROUND_VIEWPORT) { + else if (v3d->shading.background_type == V3D_SHADING_BACKGROUND_VIEWPORT) { copy_v3_v3(wd->background_color_low, v3d->shading.background_color); copy_v3_v3(wd->background_color_high, v3d->shading.background_color); } diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 044cb56d367..4fe2fe08fc9 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -1333,8 +1333,9 @@ static void space_view3d_listener( switch (wmn->data) { case ND_WORLD_DRAW: case ND_WORLD: - if (v3d->shading.background_type & V3D_SHADING_BACKGROUND_WORLD) + if (v3d->shading.background_type == V3D_SHADING_BACKGROUND_WORLD) { ED_area_tag_redraw_regiontype(sa, RGN_TYPE_WINDOW); + } break; } break; diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index 6796c9d4d00..d0880b0af9a 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -139,11 +139,11 @@ typedef struct View3DShading { short prev_type; /* Runtime, for toggle between rendered viewport. */ short flag; - short color_type; + char color_type; + char _pad0[7]; - short light; - short background_type; - short pad2[2]; + char light; + char background_type; char studio_light[256]; /* FILE_MAXFILE */ char matcap[256]; /* FILE_MAXFILE */ |