diff options
Diffstat (limited to 'source/blender/editors/util/editmode_undo.c')
-rw-r--r-- | source/blender/editors/util/editmode_undo.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c index 34dffc11d94..4776cf0af53 100644 --- a/source/blender/editors/util/editmode_undo.c +++ b/source/blender/editors/util/editmode_undo.c @@ -96,8 +96,8 @@ typedef struct UndoElem { char name[MAXUNDONAME]; void * (*getdata)(bContext *C); void (*freedata)(void *); - void (*to_editmode)(void *, void *); - void * (*from_editmode)(void *); + void (*to_editmode)(void *, void *, void *); + void * (*from_editmode)(void *, void *); int (*validate_undo)(void *, void *); } UndoElem; @@ -107,10 +107,10 @@ static UndoElem *curundo= NULL; /* ********************* xtern api calls ************* */ -static void undo_restore(UndoElem *undo, void *editdata) +static void undo_restore(UndoElem *undo, void *editdata, void *obdata) { if(undo) { - undo->to_editmode(undo->undodata, editdata); + undo->to_editmode(undo->undodata, editdata, obdata); } } @@ -118,8 +118,8 @@ static void undo_restore(UndoElem *undo, void *editdata) void undo_editmode_push(bContext *C, const char *name, void * (*getdata)(bContext *C), void (*freedata)(void *), - void (*to_editmode)(void *, void *), - void *(*from_editmode)(void *), + void (*to_editmode)(void *, void *, void *), + void *(*from_editmode)(void *, void *), int (*validate_undo)(void *, void *)) { UndoElem *uel; @@ -168,7 +168,7 @@ void undo_editmode_push(bContext *C, const char *name, /* copy */ memused= MEM_get_memory_in_use(); editdata= getdata(C); - curundo->undodata= curundo->from_editmode(editdata); + curundo->undodata= curundo->from_editmode(editdata, obedit->data); curundo->undosize= MEM_get_memory_in_use() - memused; curundo->ob= obedit; curundo->id= obedit->id; @@ -248,7 +248,7 @@ void undo_editmode_step(bContext *C, int step) undo_clean_stack(C); if(step==0) { - undo_restore(curundo, curundo->getdata(C)); + undo_restore(curundo, curundo->getdata(C), obedit->data); } else if(step==1) { @@ -256,7 +256,7 @@ void undo_editmode_step(bContext *C, int step) else { if(G.f & G_DEBUG) printf("undo %s\n", curundo->name); curundo= curundo->prev; - undo_restore(curundo, curundo->getdata(C)); + undo_restore(curundo, curundo->getdata(C), obedit->data); } } else { @@ -264,7 +264,7 @@ void undo_editmode_step(bContext *C, int step) if(curundo==NULL || curundo->next==NULL) error("No more steps to redo"); else { - undo_restore(curundo->next, curundo->getdata(C)); + undo_restore(curundo->next, curundo->getdata(C), obedit->data); curundo= curundo->next; if(G.f & G_DEBUG) printf("redo %s\n", curundo->name); } @@ -272,7 +272,7 @@ void undo_editmode_step(bContext *C, int step) /* special case for editmesh, mode must be copied back to the scene */ if(obedit->type == OB_MESH) { - EM_selectmode_to_scene(CTX_data_scene(C), obedit); + EDBM_selectmode_to_scene(C); } DAG_id_tag_update(&obedit->id, OB_RECALC_DATA); |