fix invalid *= on an un-initialized value when adding primitives.

This commit is contained in:
Campbell Barton
2012-03-28 22:11:19 +00:00
parent b8bb3f2e3c
commit 5591d03f21

View File

@@ -101,7 +101,7 @@ static void make_prim_init(bContext *C, const char *idname,
*state = 1;
}
*dia *= new_primitive_matrix(C, loc, rot, mat);
*dia = new_primitive_matrix(C, loc, rot, mat);
}
static void make_prim_finish(bContext *C, int *state, int enter_editmode)
@@ -127,7 +127,7 @@ static int add_primitive_plane_exec(bContext *C, wmOperator *op)
Object *obedit;
Mesh *me;
BMEditMesh *em;
float loc[3], rot[3], mat[4][4], dia = 1.0f;
float loc[3], rot[3], mat[4][4], dia;
int enter_editmode;
int state;
unsigned int layer;
@@ -185,7 +185,7 @@ static int add_primitive_cube_exec(bContext *C, wmOperator *op)
me = obedit->data;
em = me->edit_btmesh;
if (!EDBM_op_call_and_selectf(em, op, "vertout", "create_cube mat=%m4 size=%f", mat, 2.0f)) {
if (!EDBM_op_call_and_selectf(em, op, "vertout", "create_cube mat=%m4 size=%f", mat, dia * 2.0f)) {
return OPERATOR_CANCELLED;
}
@@ -412,7 +412,7 @@ static int add_primitive_grid_exec(bContext *C, wmOperator *op)
Object *obedit;
Mesh *me;
BMEditMesh *em;
float loc[3], rot[3], mat[4][4], dia = 1.0f;
float loc[3], rot[3], mat[4][4], dia;
int enter_editmode;
int state;
unsigned int layer;