Commit: 93113d9b771e624fc3f6736e2996a02af0b5f419
Author: Nick Wu
Date:   Wed Jul 11 22:51:36 2018 +0800
Branches: soc-2018-npr
https://developer.blender.org/rB93113d9b771e624fc3f6736e2996a02af0b5f419

modify the code to adapt VC and some API changes.

===================================================================

M       source/blender/draw/engines/lanpr/lanpr_dpix.c
M       source/blender/draw/engines/lanpr/lanpr_engine.c
M       source/blender/draw/engines/lanpr/lanpr_ops.c
M       source/blender/draw/engines/lanpr/lanpr_snake.c
M       source/blender/modifiers/intern/MOD_mybmesh.c

===================================================================

diff --git a/source/blender/draw/engines/lanpr/lanpr_dpix.c 
b/source/blender/draw/engines/lanpr/lanpr_dpix.c
index 00542b174bb..2812af9e3d5 100644
--- a/source/blender/draw/engines/lanpr/lanpr_dpix.c
+++ b/source/blender/draw/engines/lanpr/lanpr_dpix.c
@@ -283,13 +283,13 @@ int lanpr_feed_atlas_trigger_preview_obj(void *vedata, 
Object *ob, int BeginInde
 
        static Gwn_VertFormat format = { 0 };
        static struct { uint pos, uvs; } attr_id;
-       if (format.attrib_ct == 0) {
+       if (format.attr_len == 0) {
                attr_id.pos = GWN_vertformat_attr_add(&format, "pos", 
GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
        }
 
        static Gwn_VertFormat format2 = { 0 };
        static struct { uint pos, uvs; } attr_id2;
-       if (format2.attrib_ct == 0) {
+       if (format2.attr_len == 0) {
                attr_id2.pos = GWN_vertformat_attr_add(&format2, "pos", 
GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
        }
 
@@ -335,12 +335,12 @@ void lanpr_create_atlas_intersection_preview(void 
*vedata, int BeginIndex) {
 
        static Gwn_VertFormat format = { 0 };
        static struct { uint pos, uvs; } attr_id;
-       if (format.attrib_ct == 0) {
+       if (format.attr_len == 0) {
                attr_id.pos = GWN_vertformat_attr_add(&format, "pos", 
GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
        }
        static Gwn_VertFormat format2 = { 0 };
        static struct { uint pos, uvs; } attr_id2;
-       if (format2.attrib_ct == 0) {
+       if (format2.attr_len == 0) {
                attr_id2.pos = GWN_vertformat_attr_add(&format2, "pos", 
GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
        }
 
diff --git a/source/blender/draw/engines/lanpr/lanpr_engine.c 
b/source/blender/draw/engines/lanpr/lanpr_engine.c
index 2b3e3a2d782..af64aeee070 100644
--- a/source/blender/draw/engines/lanpr/lanpr_engine.c
+++ b/source/blender/draw/engines/lanpr/lanpr_engine.c
@@ -419,11 +419,11 @@ static void lanpr_cache_finish(void *vedata){
                        lanpr_create_atlas_intersection_preview(vedata, 
pd->begin_index);
                }
 
-               GPU_texture_update(txl->dpix_in_pl, pd->atlas_pl);
-               GPU_texture_update(txl->dpix_in_pr, pd->atlas_pr);
-               GPU_texture_update(txl->dpix_in_nl, pd->atlas_nl);
-               GPU_texture_update(txl->dpix_in_nr, pd->atlas_nr);
-               GPU_texture_update(txl->dpix_in_edge_mask, pd->atlas_edge_mask);
+               GPU_texture_update(txl->dpix_in_pl, GPU_DATA_FLOAT, 
pd->atlas_pl);
+               GPU_texture_update(txl->dpix_in_pr, GPU_DATA_FLOAT, 
pd->atlas_pr);
+               GPU_texture_update(txl->dpix_in_nl, GPU_DATA_FLOAT, 
pd->atlas_nl);
+               GPU_texture_update(txl->dpix_in_nr, GPU_DATA_FLOAT, 
pd->atlas_nr);
+               GPU_texture_update(txl->dpix_in_edge_mask, GPU_DATA_FLOAT, 
pd->atlas_edge_mask);
 
                MEM_freeN(pd->atlas_pl);
                MEM_freeN(pd->atlas_pr);
diff --git a/source/blender/draw/engines/lanpr/lanpr_ops.c 
b/source/blender/draw/engines/lanpr/lanpr_ops.c
index 567deb8f964..5c413bb31fc 100644
--- a/source/blender/draw/engines/lanpr/lanpr_ops.c
+++ b/source/blender/draw/engines/lanpr/lanpr_ops.c
@@ -2800,7 +2800,7 @@ void lanpr_RebuildRenderDrawCommand(LANPR_RenderBuffer 
*rb, LANPR_LineLayer *ll)
        if (ll->type == TNS_COMMAND_LINE) {
                static Gwn_VertFormat format = { 0 };
                static struct { uint pos, uvs; } attr_id;
-               if (format.attrib_ct == 0) {
+               if (format.attr_len == 0) {
                        attr_id.pos = GWN_vertformat_attr_add(&format, "pos", 
GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
                }
 
diff --git a/source/blender/draw/engines/lanpr/lanpr_snake.c 
b/source/blender/draw/engines/lanpr/lanpr_snake.c
index 72ba4218d98..d33b0462844 100644
--- a/source/blender/draw/engines/lanpr/lanpr_snake.c
+++ b/source/blender/draw/engines/lanpr/lanpr_snake.c
@@ -283,7 +283,7 @@ Gwn_Batch *lanpr_get_snake_batch(LANPR_PrivateData *pd){
 
        static Gwn_VertFormat format = { 0 };
        static struct { uint pos, uvs; } attr_id;
-       if (format.attrib_ct == 0) {
+       if (format.attr_len == 0) {
                attr_id.pos = GWN_vertformat_attr_add(&format, "pos", 
GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
                attr_id.uvs = GWN_vertformat_attr_add(&format, "uvs", 
GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
        }
diff --git a/source/blender/modifiers/intern/MOD_mybmesh.c 
b/source/blender/modifiers/intern/MOD_mybmesh.c
index 6464fd40581..c9be071e06d 100644
--- a/source/blender/modifiers/intern/MOD_mybmesh.c
+++ b/source/blender/modifiers/intern/MOD_mybmesh.c
@@ -1448,22 +1448,22 @@ static void contour_insertion( MeshData *m_d ) {
        }
 }
 
+bool sign_cross(const bool bool_arr[3]) {
+       int i;
+       bool temp = bool_arr[0];
+       for (i = 1; i < 3; i++) {
+               if (temp != bool_arr[i]) {
+                       return true;
+               }
+       }
+       return false;
+}
+
 static bool cusp_triangle(struct OpenSubdiv_EvaluatorDescr *eval, const float 
cam_loc[3], const int face_index, Cusp_triang *c_tri, Cusp *cusp){
 
                GSQueue *tri_que = BLI_gsqueue_new(sizeof(Cusp_triang));
         BLI_gsqueue_push_back(tri_que, c_tri);
 
-               bool sign_cross(const bool bool_arr[3]){
-                       int i;
-                       bool temp = bool_arr[0];
-                       for(i = 1; i < 3; i++){
-                               if(temp != bool_arr[i]){
-                                       return true;
-                               }
-                       }
-                       return false;
-               }
-
                //Add this because it seems to get stuck sometimes because the 
triangles never becomes small enough
                //TODO maybe find a better end condition?
                int iteration = 0;
@@ -1527,8 +1527,8 @@ static bool cusp_triangle(struct 
OpenSubdiv_EvaluatorDescr *eval, const float ca
 
                        for( int i = 0; i < 2; i++ ){
                                Cusp_triang new_tri;
-                               copy_v3_v3(new_tri.b_arr, cur_tri.b_arr);
-                               copy_v3_v3(new_tri.kr_arr, cur_tri.kr_arr);
+                               copy_v3_v3((float*)new_tri.b_arr, 
(float*)cur_tri.b_arr);
+                               copy_v3_v3((float*)new_tri.kr_arr, 
(float*)cur_tri.kr_arr);
                                copy_v3_v3(new_tri.u_arr, cur_tri.u_arr);
                                copy_v3_v3(new_tri.v_arr, cur_tri.v_arr);
                                copy_v3_v3(new_tri.co_arr[0], 
cur_tri.co_arr[0]);
@@ -1591,7 +1591,7 @@ static BMFace *get_orig_face(int orig_verts, const BMVert 
*vert_arr_in[3], float
                                }
 
                                edge_arr[i] = v_buf.orig_edge;
-                               edge_face_arr[i] = v_buf.orig_face;
+                               edge_face_arr[i] = (void*)v_buf.orig_face;
                        }
                } else {
                        vert_arr[i] = temp_v;
@@ -1609,7 +1609,7 @@ static BMFace *get_orig_face(int orig_verts, const BMVert 
*vert_arr_in[3], float
 
                if(edge_arr[i] != NULL){
                        //Make use we have the correct uv coords
-                       convert_uv_to_new_face( edge_arr[i], edge_face_arr[i], 
orig_face, &u_arr[i], &v_arr[i]);
+                       convert_uv_to_new_face((void*)edge_arr[i], 
(void*)edge_face_arr[i], (void*)orig_face, &u_arr[i], &v_arr[i]);
                } else {
                        get_uv_coord(vert_arr[i], orig_face, &u_arr[i], 
&v_arr[i]);
                }
@@ -1719,7 +1719,7 @@ static void cusp_detection( MeshData *m_d ){
                                        Cusp_triang c_tri;
                                        cusp.orig_face = orig_face;
 
-                    copy_v3_v3(c_tri.b_arr, b_arr);
+                    copy_v3_v3((void*)c_tri.b_arr, (void*)b_arr);
                     copy_v3_v3(c_tri.u_arr, u_arr);
                     copy_v3_v3(c_tri.v_arr, v_arr);
                     copy_v3_v3(c_tri.co_arr[0], co_arr[0]);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to