svn merge ^/trunk/blender -r41226:41227 .
[blender.git] / source / blender / editors / sculpt_paint / sculpt_undo.c
index cd93ae6f77b292d689b94172ba09acc07ef9a2bd..014cbff3e222fa8d618bc9080933431d8f83a760 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id$
- *
  * ***** BEGIN GPL LICENSE BLOCK *****
  *
  * This program is free software; you can redistribute it and/or
@@ -39,6 +37,8 @@
 
 #include "BLI_math.h"
 #include "BLI_utildefines.h"
+#include "BLI_string.h"
+#include "BLI_listbase.h"
 #include "BLI_ghash.h"
 #include "BLI_threads.h"
 
@@ -193,13 +193,13 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb)
                if((mmd=sculpt_multires_active(scene, ob)))
                        multires_mark_as_modified(ob);
 
-               tag_update= ((Mesh*)ob->data)->id.us > 1 || !mmd;
+               tag_update= ((Mesh*)ob->data)->id.us > 1;
 
                if(ss->modifiers_active) {
                        Mesh *mesh= ob->data;
                        mesh_calc_normals(mesh->mvert, mesh->totvert, mesh->mloop, mesh->mpoly, mesh->totloop, mesh->totpoly, NULL, NULL, 0, NULL, NULL);
 
-                       sculpt_free_deformMats(ss);
+                       free_sculptsession_deformMats(ss);
                        tag_update|= 1;
                }
 
@@ -262,7 +262,7 @@ SculptUndoNode *sculpt_undo_push_node(Object *ob, PBVHNode *node)
        }
 
        unode= MEM_callocN(sizeof(SculptUndoNode), "SculptUndoNode");
-       strcpy(unode->idname, ob->id.name);
+       BLI_strncpy(unode->idname, ob->id.name, sizeof(unode->idname));
        unode->node= node;
 
        BLI_pbvh_node_num_verts(ss->pbvh, node, &totvert, &allvert);
@@ -300,7 +300,7 @@ SculptUndoNode *sculpt_undo_push_node(Object *ob, PBVHNode *node)
 
                BLI_pbvh_vertex_iter_begin(ss->pbvh, node, vd, PBVH_ITER_ALL) {
                        copy_v3_v3(unode->co[vd.i], vd.co);
-                       if(vd.no) VECCOPY(unode->no[vd.i], vd.no)
+                       if(vd.no) copy_v3_v3_short(unode->no[vd.i], vd.no);
                        else normal_float_to_short_v3(unode->no[vd.i], vd.fno);
                        if(vd.vert_indices) unode->index[vd.i]= vd.vert_indices[vd.i];