Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Eagar <joeedh@gmail.com>2009-11-02 19:01:24 +0300
committerJoseph Eagar <joeedh@gmail.com>2009-11-02 19:01:24 +0300
commit55c1d9d4bc0d6662cbe2d4baa3e9a48e255d51e6 (patch)
tree0ef89137b2ce13974304349ef75b23b0d48235d0 /source/blender/editors/util/editmode_undo.c
parent7225c078b716f44fe0f482d56e88fabd5f635518 (diff)
shapekey bugfixes
Diffstat (limited to 'source/blender/editors/util/editmode_undo.c')
-rw-r--r--source/blender/editors/util/editmode_undo.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c
index 2d73a9f1d25..93d36805f0c 100644
--- a/source/blender/editors/util/editmode_undo.c
+++ b/source/blender/editors/util/editmode_undo.c
@@ -95,8 +95,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;
@@ -106,10 +106,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);
}
}
@@ -117,8 +117,8 @@ static void undo_restore(UndoElem *undo, void *editdata)
void undo_editmode_push(bContext *C, 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;
@@ -167,7 +167,7 @@ void undo_editmode_push(bContext *C, 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;
@@ -240,12 +240,13 @@ static void undo_clean_stack(bContext *C)
/* 1= an undo, -1 is a redo. we have to make sure 'curundo' remains at current situation */
void undo_editmode_step(bContext *C, int step)
{
-
+ Object *ob = CTX_data_edit_object(C);
+
/* prevent undo to happen on wrong object, stack can be a mix */
undo_clean_stack(C);
if(step==0) {
- undo_restore(curundo, curundo->getdata(C));
+ undo_restore(curundo, curundo->getdata(C), ob->data);
}
else if(step==1) {
@@ -253,7 +254,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), ob->data);
}
}
else {
@@ -261,7 +262,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), ob->data);
curundo= curundo->next;
if(G.f & G_DEBUG) printf("redo %s\n", curundo->name);
}