=bmesh= merge from trunk at r36529
[blender.git] / source / blender / editors / space_image / space_image.c
index 409ab4b2fc6785ce4f26d6b613aca66c63bdda40..ece0169cf59b33e95494055ef52f7a4f48e0392e 100644 (file)
@@ -51,6 +51,7 @@
 #include "BKE_image.h"
 #include "BKE_mesh.h"
 #include "BKE_screen.h"
+#include "BKE_tessmesh.h"
 
 #include "IMB_imbuf_types.h"
 
@@ -276,12 +277,11 @@ int ED_space_image_show_uvedit(SpaceImage *sima, Object *obedit)
                return 0;
 
        if(obedit && obedit->type == OB_MESH) {
-               EditMesh *em = BKE_mesh_get_editmesh(obedit->data);
+               BMEditMesh *em = ((Mesh*)obedit->data)->edit_btmesh;
                int ret;
                
-               ret = EM_texFaceCheck(em);
+               ret = EDBM_texFaceCheck(em);
                
-               BKE_mesh_end_editmesh(obedit->data, em);
                return ret;
        }
        
@@ -295,12 +295,11 @@ int ED_space_image_show_uvshadow(SpaceImage *sima, Object *obedit)
        
        if(ED_space_image_show_paint(sima))
                if(obedit && obedit->type == OB_MESH) {
-                       EditMesh *em = BKE_mesh_get_editmesh(obedit->data);
+                       BMEditMesh *em = ((Mesh*)obedit->data)->edit_btmesh;
                        int ret;
                        
-                       ret = EM_texFaceCheck(em);
+                       ret = EDBM_texFaceCheck(em);
                        
-                       BKE_mesh_end_editmesh(obedit->data, em);
                        return ret;
                }
        
@@ -589,13 +588,13 @@ static void image_refresh(const bContext *C, ScrArea *UNUSED(sa))
        if(ima && (ima->source==IMA_SRC_VIEWER || sima->pin));
        else if(obedit && obedit->type == OB_MESH) {
                Mesh *me= (Mesh*)obedit->data;
-               EditMesh *em= BKE_mesh_get_editmesh(me);
-               MTFace *tf;
+               BMEditMesh *em= me->edit_btmesh;
+               MTexPoly *tf;
                
-               if(em && EM_texFaceCheck(em)) {
+               if(em && EDBM_texFaceCheck(em)) {
                        sima->image= NULL;
                        
-                       tf = EM_get_active_mtface(em, NULL, NULL, 1); /* partially selected face is ok */
+                       tf = EDBM_get_active_mtexpoly(em, NULL, 1); /* partially selected face is ok */
                        
                        if(tf && (tf->mode & TF_TEX)) {
                                /* don't need to check for pin here, see above */
@@ -605,8 +604,6 @@ static void image_refresh(const bContext *C, ScrArea *UNUSED(sa))
                                else sima->curtile= tf->tile;
                        }
                }
-
-               BKE_mesh_end_editmesh(obedit->data, em);
        }
 }
 
@@ -1011,4 +1008,3 @@ void ED_spacetype_image(void)
        
        BKE_spacetype_register(st);
 }
-