[Bf-blender-cvs] [4e017abc3d2] soc-2019-npr: Cleanup: Fixed some warnings in editor/lanpr.

YimingWu noreply at git.blender.org
Fri Jul 26 11:30:06 CEST 2019


Commit: 4e017abc3d2d43e9174b6249bf8c4613cca5c7e4
Author: YimingWu
Date:   Fri Jul 26 17:29:43 2019 +0800
Branches: soc-2019-npr
https://developer.blender.org/rB4e017abc3d2d43e9174b6249bf8c4613cca5c7e4

Cleanup: Fixed some warnings in editor/lanpr.

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

M	source/blender/editors/include/ED_lanpr.h
M	source/blender/editors/lanpr/lanpr_ops.c

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

diff --git a/source/blender/editors/include/ED_lanpr.h b/source/blender/editors/include/ED_lanpr.h
index c84d7e82245..e583b4bdca5 100644
--- a/source/blender/editors/include/ED_lanpr.h
+++ b/source/blender/editors/include/ED_lanpr.h
@@ -154,26 +154,31 @@ typedef struct LANPR_RenderLine {
   struct LANPR_RenderVert *l, *r;
   struct LANPR_RenderTriangle *tl, *tr;
   ListBase segments;
-  /*  tnsEdge*       Edge;/* should be edge material */
-  /*  tnsRenderTriangle* testing;/* Should Be tRT** testing[NumOfThreads]	struct Materil */
-  /*  *MaterialRef; */
   char min_occ;
-  char flags; /*  also for line type determination on chainning */
+  
+  /**  Also for line type determination on chainning */
+  char flags; 
 
-  /*  still need this entry because culled lines will not add to object reln node */
+  /**  Still need this entry because culled lines will not add to object reln node */
   struct Object *object_ref;
 
-  int edge_idx; /*  for gpencil stroke modifier */
+  /**  For gpencil stroke modifier */
+  int edge_idx;
 } LANPR_RenderLine;
 
 typedef struct LANPR_RenderLineChain {
   struct LANPR_RenderLineChain *next, *prev;
   ListBase chain;
-  /*  int         SegmentCount;  /*  we count before draw cmd. */
-  float length; /*  calculated before draw cmd. */
-  char picked;  /*  used when re-connecting and gp stroke generation */
+
+   /**  Calculated before draw cmd. */
+  float length;
+
+  /**  Used when re-connecting and gp stroke generation */
+  char picked;
   char level;
-  int type; /* Chain now only contains one type of segments */
+
+  /** Chain now only contains one type of segments */
+  int type;
   struct Object *object_ref;
 } LANPR_RenderLineChain;
 
@@ -785,14 +790,6 @@ void tmat_make_rotation_z_matrix_44d(tnsMatrix44d m, real angle_rad);
 void tmat_remove_translation_44d(tnsMatrix44d result, tnsMatrix44d mat);
 void tmat_clear_translation_44d(tnsMatrix44d mat);
 
-real tmat_angle_rad_3d(tnsVector3d from, tnsVector3d to, tnsVector3d PositiveReference);
-real tmat_length_3d(tnsVector3d l);
-void tmat_normalize_2d(tnsVector2d result, tnsVector2d l);
-void tmat_normalize_3d(tnsVector3d result, tnsVector3d l);
-void tmat_normalize_self_3d(tnsVector3d result);
-real tmat_dot_3d(tnsVector3d l, tnsVector3d r, int normalize);
-real tmat_vector_cross_3d(tnsVector3d result, tnsVector3d l, tnsVector3d r);
-void tmat_vector_cross_only_3d(tnsVector3d result, tnsVector3d l, tnsVector3d r);
 
 int lanpr_count_this_line(LANPR_RenderLine *rl, LANPR_LineLayer *ll);
 long lanpr_count_leveled_edge_segment_count(ListBase *LineList, LANPR_LineLayer *ll);
diff --git a/source/blender/editors/lanpr/lanpr_ops.c b/source/blender/editors/lanpr/lanpr_ops.c
index 2d71772ddb5..65bb1e6f772 100644
--- a/source/blender/editors/lanpr/lanpr_ops.c
+++ b/source/blender/editors/lanpr/lanpr_ops.c
@@ -164,7 +164,7 @@ LANPR_LineLayerComponent *ED_lanpr_new_line_component(SceneLANPR *lanpr)
 
   return llc;
 }
-static int lanpr_add_line_layer_exec(struct bContext *C, struct wmOperator *op)
+static int lanpr_add_line_layer_exec(struct bContext *C, struct wmOperator *UNUSED(op))
 {
   Scene *scene = CTX_data_scene(C);
   SceneLANPR *lanpr = &scene->lanpr;
@@ -177,7 +177,7 @@ static int lanpr_add_line_layer_exec(struct bContext *C, struct wmOperator *op)
 
   return OPERATOR_FINISHED;
 }
-static int lanpr_delete_line_layer_exec(struct bContext *C, struct wmOperator *op)
+static int lanpr_delete_line_layer_exec(struct bContext *C, struct wmOperator *UNUSED(op))
 {
   Scene *scene = CTX_data_scene(C);
   SceneLANPR *lanpr = &scene->lanpr;
@@ -238,7 +238,7 @@ static int lanpr_move_line_layer_exec(struct bContext *C, struct wmOperator *op)
 
   return OPERATOR_FINISHED;
 }
-static int lanpr_add_line_component_exec(struct bContext *C, struct wmOperator *op)
+static int lanpr_add_line_component_exec(struct bContext *C, struct wmOperator *UNUSED(op))
 {
   Scene *scene = CTX_data_scene(C);
   SceneLANPR *lanpr = &scene->lanpr;
@@ -276,7 +276,7 @@ static int lanpr_delete_line_component_exec(struct bContext *C, struct wmOperato
   return OPERATOR_FINISHED;
 }
 
-static int lanpr_rebuild_all_commands_exec(struct bContext *C, struct wmOperator *op)
+static int lanpr_rebuild_all_commands_exec(struct bContext *C, struct wmOperator *UNUSED(op))
 {
   Scene *scene = CTX_data_scene(C);
   SceneLANPR *lanpr = &scene->lanpr;
@@ -289,7 +289,7 @@ static int lanpr_rebuild_all_commands_exec(struct bContext *C, struct wmOperator
 
   return OPERATOR_FINISHED;
 }
-static int lanpr_enable_all_line_types_exec(struct bContext *C, struct wmOperator *op)
+static int lanpr_enable_all_line_types_exec(struct bContext *C, struct wmOperator *UNUSED(op))
 {
   Scene *scene = CTX_data_scene(C);
   SceneLANPR *lanpr = &scene->lanpr;
@@ -700,12 +700,10 @@ static void lanpr_calculate_single_line_occlusion(LANPR_RenderBuffer *rb,
 }
 static void lanpr_THREAD_calculate_line_occlusion(TaskPool *__restrict pool,
                                                   LANPR_RenderTaskInfo *rti,
-                                                  int threadid)
+                                                  int UNUSED(threadid))
 {
   LANPR_RenderBuffer *rb = lanpr_share.render_buffer_shared;
-  int thread_id = rti->thread_id;
   LinkData *lip;
-  int count = 0;
 
   while (lanpr_make_next_occlusion_task_info(rb, rti)) {
 
@@ -753,37 +751,13 @@ static void lanpr_THREAD_calculate_line_occlusion_begin(LANPR_RenderBuffer *rb)
 
   for (i = 0; i < thread_count; i++) {
     rti[i].thread_id = i;
-    BLI_task_pool_push(tp, lanpr_THREAD_calculate_line_occlusion, &rti[i], 0, TASK_PRIORITY_HIGH);
+    BLI_task_pool_push(tp, (TaskRunFunction)lanpr_THREAD_calculate_line_occlusion, &rti[i], 0, TASK_PRIORITY_HIGH);
   }
   BLI_task_pool_work_and_wait(tp);
   BLI_task_pool_free(tp);
 
   MEM_freeN(rti);
 }
-static void lanpr_NO_THREAD_calculate_line_occlusion(LANPR_RenderBuffer *rb)
-{
-  LinkData *lip;
-
-  for (lip = rb->contours.first; lip; lip = lip->next) {
-    lanpr_calculate_single_line_occlusion(rb, lip->data, 0);
-  }
-
-  for (lip = rb->crease_lines.first; lip; lip = lip->next) {
-    lanpr_calculate_single_line_occlusion(rb, lip->data, 0);
-  }
-
-  for (lip = rb->intersection_lines.first; lip; lip = lip->next) {
-    lanpr_calculate_single_line_occlusion(rb, lip->data, 0);
-  }
-
-  for (lip = rb->material_lines.first; lip; lip = lip->next) {
-    lanpr_calculate_single_line_occlusion(rb, lip->data, 0);
-  }
-
-  for (lip = rb->edge_marks.first; lip; lip = lip->next) {
-    lanpr_calculate_single_line_occlusion(rb, lip->data, 0);
-  }
-}
 
 int ED_lanpr_point_inside_triangled(tnsVector2d v, tnsVector2d v0, tnsVector2d v1, tnsVector2d v2)
 {
@@ -868,44 +842,6 @@ static int lanpr_point_triangle_relation(tnsVector2d v,
 
   return 2;
 }
-static int lanpr_point_inside_triangle3d(tnsVector3d v,
-                                         tnsVector3d v0,
-                                         tnsVector3d v1,
-                                         tnsVector3d v2)
-{
-  tnsVector3d l, r;
-  tnsVector3d N1, N2;
-
-  tMatVectorMinus3d(l, v1, v0);
-  tMatVectorMinus3d(r, v, v1);
-  tmat_vector_cross_3d(N1, l, r);
-
-  tMatVectorMinus3d(l, v2, v1);
-  tMatVectorMinus3d(r, v, v2);
-  tmat_vector_cross_3d(N2, l, r);
-
-  if (tmat_dot_3d(N1, N2, 0) < 0) {
-    return 0;
-  }
-
-  tMatVectorMinus3d(l, v0, v2);
-  tMatVectorMinus3d(r, v, v0);
-  tmat_vector_cross_3d(N1, l, r);
-
-  if (tmat_dot_3d(N1, N2, 0) < 0) {
-    return 0;
-  }
-
-  tMatVectorMinus3d(l, v1, v0);
-  tMatVectorMinus3d(r, v, v1);
-  tmat_vector_cross_3d(N2, l, r);
-
-  if (tmat_dot_3d(N1, N2, 0) < 0) {
-    return 0;
-  }
-
-  return 1;
-}
 static int lanpr_point_inside_triangle3de(tnsVector3d v,
                                           tnsVector3d v0,
                                           tnsVector3d v1,
@@ -1040,7 +976,6 @@ static void lanpr_cull_triangles(LANPR_RenderBuffer *rb)
   LANPR_RenderVert *rv;
   LANPR_RenderElementLinkNode *reln, *veln, *teln;
   LANPR_RenderLineSegment *rls;
-  real *mv_inverse = rb->vp_inverse;
   real *vp = rb->view_projection;
   int i;
   real a;
@@ -1065,12 +1000,11 @@ static void lanpr_cull_triangles(LANPR_RenderBuffer *rb)
   rt1 = (void *)(((BYTE *)teln->pointer) + rb->triangle_size * t_count);
 
   for (reln = rb->triangle_buffer_pointers.first; reln; reln = reln->next) {
-    i = 0;
     if (reln->additional) {
       continue;
     }
     o = reln->object_ref;
-    for (i; i < reln->element_count; i++) {
+    for (i = 0; i < reln->element_count; i++) {
       int In1 = 0, In2 = 0, In3 = 0;
       rt = (void *)(((BYTE *)reln->pointer) + rb->triangle_size * i);
       if (rt->v[0]->fbcoord[3] < ((Camera *)cam->data)->clip_start) {
@@ -1603,7 +1537,7 @@ static void lanpr_perspective_division(LANPR_RenderBuffer *rb)
 }
 
 static void lanpr_transform_render_vert(
-    BMVert *v, int index, LANPR_RenderVert *RvBuf, real *MvMat, real *MvPMat, Camera *camera)
+    BMVert *v, int index, LANPR_RenderVert *RvBuf, real *MvMat, real *MvPMat, Camera *UNUSED(camera))
 { /*  real HeightMultiply, real clipsta, real clipend) { */
   LANPR_RenderVert *rv = &RvBuf[index];
   /*  rv->v = v; */
@@ -1617,19 +1551,10 @@ static void lanpr_transform_render_vert(
   /*    rv->fbcoord[2] = Camera->clipsta* Camera->clipend / (Camera->clipend - */
   /*    fabs(rv->fbcoord[2]) * (Camera->clipend - Camera->clipsta)); */
 }
-static void lanpr_calculate_render_triangle_normal(LANPR_RenderTriangle *rt)
-{
-  tnsVector3d l, r;
-  tMatVectorMinus3d(l, rt->v[1]->gloc, rt->v[0]->gloc);
-  tMatVectorMinus3d(r, rt->v[2]->gloc, rt->v[0]->gloc);
-  tmat_vector_cross_3d(rt->gn, l, r);
-  tmat_normalize_self_3d(rt->gn);
-}
+
 static void lanpr_make_render_geometry_buffers_object(
     Object *o, real *MvMat, real *MvPMat, LANPR_RenderBuffer *rb, int override_usage)
 {
-  Object *oc;
-  Mesh *mo;
   BMesh *bm;
   BMVert *v;
   BMFace *f;
@@ -1644,7 +1569,6 @@ static void lanpr_make_render_geometry_buffers_object(
   LANPR_RenderElementLinkNode *reln;
   Object *cam_object = rb->scene->camera;
   Camera *c = cam_object->data;
-  Material *m;
   LANPR_RenderVert *orv;
   LANPR_RenderLine *orl;
   LANPR_RenderTriangle *ort;
@@ -1855,9 +1779,6 @@ static 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list