remove v3d.modeselect, reduce size of other vars in v3d.

This commit is contained in:
Campbell Barton
2013-05-23 21:14:17 +00:00
parent 326c90d41a
commit ab2cfd87e0
2 changed files with 12 additions and 23 deletions

View File

@@ -72,18 +72,6 @@
#include "view3d_intern.h"
/* View3d->modeselect
* This is a bit of a dodgy hack to enable a 'mode' menu with icons+labels
* rather than those buttons.
* I know the implementation's not good - it's an experiment to see if this
* approach would work well
*
* This can be cleaned when I make some new 'mode' icons.
*/
/* end XXX ************* */
static void do_view3d_header_buttons(bContext *C, void *arg, int event);
#define B_SEL_VERT 110
@@ -311,7 +299,8 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
Object *obedit = CTX_data_edit_object(C);
uiBlock *block;
uiLayout *row;
int is_paint = 0;
bool is_paint = false;
int modeselect;
RNA_pointer_create(&screen->id, &RNA_SpaceView3D, v3d, &v3dptr);
RNA_pointer_create(&scene->id, &RNA_ToolSettings, ts, &toolsptr);
@@ -325,11 +314,11 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
/* mode */
if (ob) {
v3d->modeselect = ob->mode;
modeselect = ob->mode;
is_paint = ELEM4(ob->mode, OB_MODE_SCULPT, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, OB_MODE_TEXTURE_PAINT);
}
else {
v3d->modeselect = OB_MODE_OBJECT;
modeselect = OB_MODE_OBJECT;
}
row = uiLayoutRow(layout, FALSE);
@@ -339,7 +328,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
int icon = ICON_OBJECT_DATAMODE;
while (item->identifier) {
if (item->value == v3d->modeselect && item->identifier[0]) {
if (item->value == modeselect && item->identifier[0]) {
name = IFACE_(item->name);
icon = item->icon;
break;

View File

@@ -162,10 +162,9 @@ typedef struct View3D {
float dist DNA_DEPRECATED;
float bundle_size; /* size of bundles in reconstructed data */
short bundle_drawtype; /* display style for bundle */
short pad;
int matcap_icon; /* icon id */
char bundle_drawtype; /* display style for bundle */
char pad[7];
unsigned int lay_used; /* used while drawing */
short persp DNA_DEPRECATED;
@@ -197,7 +196,8 @@ typedef struct View3D {
float ofs[3] DNA_DEPRECATED; /* XXX deprecated */
float cursor[3];
short modeselect;
short matcap_icon; /* icon id */
short gridlines;
short gridsubdiv; /* Number of subdivisions in the grid between each highlighted grid line */
char gridflag;
@@ -211,8 +211,8 @@ typedef struct View3D {
struct ListBase afterdraw_xraytransp;
/* drawflags, denoting state */
short zbuf, transp, xray;
char pad3[2];
char zbuf, transp, xray;
char pad3[5];
void *properties_storage; /* Nkey panel stores stuff here (runtime only!) */
struct Material *defmaterial; /* used by matcap now */