Cleanup: correct flag comparisons
Also use smaller types for shading data.
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user