DNA: remove View3D.flag3

Having 'flag, flag2, flag3' is getting out of hand especially
when we support increasing the size of types.

Make flag2 into an int.

Note, this looses the 'show world' option,
but it's not such an important setting.
This commit is contained in:
Campbell Barton
2018-08-01 08:08:59 +10:00
parent d5724bfaa7
commit e8d58080df
4 changed files with 11 additions and 12 deletions

View File

@@ -1238,7 +1238,7 @@ static void space_view3d_listener(bScreen *UNUSED(sc), ScrArea *sa, struct wmNot
switch (wmn->data) {
case ND_WORLD_DRAW:
case ND_WORLD:
if (v3d->flag3 & V3D_SHOW_WORLD)
if (v3d->flag2 & V3D_SHOW_WORLD)
ED_area_tag_redraw_regiontype(sa, RGN_TYPE_WINDOW);
break;
}

View File

@@ -3091,7 +3091,7 @@ void ED_view3d_draw_offscreen_init(Main *bmain, Scene *scene, View3D *v3d)
*/
static void view3d_main_region_clear(Scene *scene, View3D *v3d, ARegion *ar)
{
if (scene->world && (v3d->flag3 & V3D_SHOW_WORLD)) {
if (scene->world && (v3d->flag2 & V3D_SHOW_WORLD)) {
RegionView3D *rv3d = ar->regiondata;
GPUMaterial *gpumat = GPU_material_world(scene, scene->world);
@@ -3497,7 +3497,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf_simple(
v3d.flag2 |= V3D_SOLID_TEX;
}
if (draw_flags & V3D_OFSDRAW_USE_BACKGROUND) {
v3d.flag3 |= V3D_SHOW_WORLD;
v3d.flag2 |= V3D_SHOW_WORLD;
}
if (draw_flags & V3D_OFSDRAW_USE_CAMERA_DOF) {
if (camera->type == OB_CAMERA) {

View File

@@ -182,10 +182,11 @@ typedef struct View3D {
/**
* The drawing mode for the 3d display. Set to OB_BOUNDBOX, OB_WIRE, OB_SOLID,
* OB_TEXTURE, OB_MATERIAL or OB_RENDER */
short drawtype;
short ob_centre_cursor; /* optional bool for 3d cursor to define center */
char drawtype;
char ob_centre_cursor; /* optional bool for 3d cursor to define center */
short scenelock, around;
short flag, flag2;
short flag;
int flag2;
float lens, grid;
float near, far;
@@ -201,7 +202,7 @@ typedef struct View3D {
/* transform widget info */
char twtype, twmode, twflag;
short flag3;
short _pad1;
/* afterdraw, for xray & transparent */
struct ListBase afterdraw_transp;
@@ -297,7 +298,7 @@ typedef struct View3D {
#define RV3D_VIEW_IS_AXIS(view) \
(((view) >= RV3D_VIEW_FRONT) && ((view) <= RV3D_VIEW_BOTTOM))
/* View3d->flag2 (short) */
/* View3d->flag2 (int) */
#define V3D_RENDER_OVERRIDE (1 << 2)
#define V3D_SOLID_TEX (1 << 3)
#define V3D_SHOW_GPENCIL (1 << 4)
@@ -312,11 +313,9 @@ typedef struct View3D {
#define V3D_SHOW_SOLID_MATCAP (1 << 13) /* runtime flag */
#define V3D_OCCLUDE_WIRE (1 << 14)
#define V3D_SHADELESS_TEX (1 << 15)
#define V3D_SHOW_WORLD (1 << 16)
/* View3d->flag3 (short) */
#define V3D_SHOW_WORLD (1 << 0)
/* View3D->around */
enum {
/* center of the bounding box */

View File

@@ -2621,7 +2621,7 @@ static void rna_def_space_view3d(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
prop = RNA_def_property(srna, "show_world", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag3", V3D_SHOW_WORLD);
RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_WORLD);
RNA_def_property_ui_text(prop, "World Background", "Display world colors in the background");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);