[Bf-blender-cvs] [316e6ee7616] temp-lanpr-staging: Cleanup: comments.

YimingWu noreply at git.blender.org
Thu Aug 15 03:38:27 CEST 2019


Commit: 316e6ee7616a7a626fa345c24582ded59ba91edb
Author: YimingWu
Date:   Thu Aug 15 09:37:59 2019 +0800
Branches: temp-lanpr-staging
https://developer.blender.org/rB316e6ee7616a7a626fa345c24582ded59ba91edb

Cleanup: comments.

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

M	source/blender/editors/include/ED_lanpr.h
M	source/blender/editors/lanpr/lanpr_chain.c
M	source/blender/editors/lanpr/lanpr_cpu.c
M	source/blender/editors/lanpr/lanpr_util.c

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

diff --git a/source/blender/editors/include/ED_lanpr.h b/source/blender/editors/include/ED_lanpr.h
index dffbd5b7eee..496d463726a 100644
--- a/source/blender/editors/include/ED_lanpr.h
+++ b/source/blender/editors/include/ED_lanpr.h
@@ -456,26 +456,6 @@ typedef struct LANPR_BoundingArea {
 #define TNS_IN_TILE(RenderTile, Fx, Fy) \
   (TNS_IN_TILE_X(RenderTile, Fx) && TNS_IN_TILE_Y(RenderTile, Fy))
 
-BLI_INLINE void tMatConvert44df(tnsMatrix44d from, tnsMatrix44f to)
-{
-  to[0] = from[0];
-  to[1] = from[1];
-  to[2] = from[2];
-  to[3] = from[3];
-  to[4] = from[4];
-  to[5] = from[5];
-  to[6] = from[6];
-  to[7] = from[7];
-  to[8] = from[8];
-  to[9] = from[9];
-  to[10] = from[10];
-  to[11] = from[11];
-  to[12] = from[12];
-  to[13] = from[13];
-  to[14] = from[14];
-  to[15] = from[15];
-}
-
 BLI_INLINE int lanpr_TrangleLineBoundBoxTest(LANPR_RenderTriangle *rt, LANPR_RenderLine *rl)
 {
   if (MAX3(rt->v[0]->fbcoord[2], rt->v[1]->fbcoord[2], rt->v[2]->fbcoord[2]) >
@@ -581,44 +561,14 @@ void *list_push_pointer_static_sized(ListBase *h, LANPR_StaticMemPool *smp, void
 
 void *list_append_pointer_static_pool(LANPR_StaticMemPool *mph, ListBase *h, void *p);
 void *list_pop_pointer_no_free(ListBase *h);
-void list_remove_pointer_item_no_free(ListBase *h, LinkData *lip);
 
 LANPR_StaticMemPoolNode *mem_new_static_pool(LANPR_StaticMemPool *smp);
 void *mem_static_aquire(LANPR_StaticMemPool *smp, int size);
 void *mem_static_aquire_thread(LANPR_StaticMemPool *smp, int size);
 void *mem_static_destroy(LANPR_StaticMemPool *smp);
 
-void tmat_obmat_to_16d(float obmat[4][4], tnsMatrix44d out);
-
-real tmat_vector_cross_3d(tnsVector3d result, tnsVector3d l, tnsVector3d r);
-void tmat_vector_cross_only_3d(tnsVector3d result, tnsVector3d l, tnsVector3d r);
-real tmat_angle_rad_3d(tnsVector3d from, tnsVector3d to, tnsVector3d PositiveReference);
-void tmat_apply_rotation_33d(tnsVector3d result, tnsMatrix44d mat, tnsVector3d v);
-void tmat_apply_rotation_43d(tnsVector3d result, tnsMatrix44d mat, tnsVector3d v);
-void tmat_apply_transform_43d(tnsVector3d result, tnsMatrix44d mat, tnsVector3d v);
-void tmat_apply_transform_43dfND(tnsVector4d result, tnsMatrix44d mat, tnsVector3f v);
-void tmat_apply_normal_transform_43d(tnsVector3d result, tnsMatrix44d mat, tnsVector3d v);
-void tmat_apply_normal_transform_43df(tnsVector3d result, tnsMatrix44d mat, tnsVector3f v);
-void tmat_apply_transform_44d(tnsVector4d result, tnsMatrix44d mat, tnsVector4d v);
-void tmat_apply_transform_43df(tnsVector4d result, tnsMatrix44d mat, tnsVector3f v);
-void tmat_apply_transform_44dTrue(tnsVector4d result, tnsMatrix44d mat, tnsVector4d v);
-
-void tmat_load_identity_44d(tnsMatrix44d m);
-void tmat_make_ortho_matrix_44d(
-    tnsMatrix44d mProjection, real xMin, real xMax, real yMin, real yMax, real zMin, real zMax);
 void tmat_make_perspective_matrix_44f(
     float (*mProjection)[4], float fFov_rad, float fAspect, float zMin, float zMax);
-void tmat_make_translation_matrix_44d(tnsMatrix44d mTrans, real x, real y, real z);
-void tmat_make_rotation_matrix_44d(tnsMatrix44d m, real angle_rad, real x, real y, real z);
-void tmat_make_scale_matrix_44d(tnsMatrix44d m, real x, real y, real z);
-void tmat_make_viewport_matrix_44d(tnsMatrix44d m, real w, real h, real Far, real Near);
-void tmat_multiply_44d(tnsMatrix44d result, tnsMatrix44d l, tnsMatrix44d r);
-void tmat_inverse_44d(tnsMatrix44d inverse, tnsMatrix44d mat);
-void tmat_make_rotation_x_matrix_44d(tnsMatrix44d m, real angle_rad);
-void tmat_make_rotation_y_matrix_44d(tnsMatrix44d m, real angle_rad);
-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);
 
 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_chain.c b/source/blender/editors/lanpr/lanpr_chain.c
index 66c621283c7..ebd8b3d28cc 100644
--- a/source/blender/editors/lanpr/lanpr_chain.c
+++ b/source/blender/editors/lanpr/lanpr_chain.c
@@ -40,7 +40,6 @@ static LANPR_RenderLine *lanpr_get_connected_render_line(LANPR_BoundingArea *ba,
 
     /*  always chain connected lines for now. */
     /*  simplification will take care of the sharp points. */
-    /*  if(cosine whatever) continue; */
 
     if (rv != nrl->l && rv != nrl->r) {
       if (nrl->flags & LANPR_EDGE_FLAG_INTERSECTION) {
@@ -243,14 +242,10 @@ void ED_lanpr_NO_THREAD_chain_feature_lines(LANPR_RenderBuffer *rb)
       if (new_rl->tl || new_rl->tr) {
         zero_v3(N);
         if (new_rl->tl) {
-          N[0] += new_rl->tl->gn[0];
-          N[1] += new_rl->tl->gn[1];
-          N[2] += new_rl->tl->gn[2];
+          add_v3_v3(N,new_rl->tl->gn);
         }
         if (new_rl->tr) {
-          N[0] += new_rl->tr->gn[0];
-          N[1] += new_rl->tr->gn[1];
-          N[2] += new_rl->tr->gn[2];
+          add_v3_v3(N,new_rl->tr->gn);
         }
         normalize_v3(N);
       }
@@ -311,14 +306,10 @@ void ED_lanpr_NO_THREAD_chain_feature_lines(LANPR_RenderBuffer *rb)
     if (rl->tl || rl->tr) {
       zero_v3(N);
       if (rl->tl) {
-        N[0] += rl->tl->gn[0];
-        N[1] += rl->tl->gn[1];
-        N[2] += rl->tl->gn[2];
+        add_v3_v3(N,rl->tl->gn);
       }
       if (rl->tr) {
-        N[0] += rl->tr->gn[0];
-        N[1] += rl->tr->gn[1];
-        N[2] += rl->tr->gn[2];
+        add_v3_v3(N,rl->tr->gn);
       }
       normalize_v3(N);
     }
@@ -356,14 +347,10 @@ void ED_lanpr_NO_THREAD_chain_feature_lines(LANPR_RenderBuffer *rb)
       if (new_rl->tl || new_rl->tr) {
         zero_v3(N);
         if (new_rl->tl) {
-          N[0] += new_rl->tl->gn[0];
-          N[1] += new_rl->tl->gn[1];
-          N[2] += new_rl->tl->gn[2];
+          add_v3_v3(N,new_rl->tl->gn);
         }
         if (new_rl->tr) {
-          N[0] += new_rl->tr->gn[0];
-          N[1] += new_rl->tr->gn[1];
-          N[2] += new_rl->tr->gn[2];
+          add_v3_v3(N,new_rl->tr->gn);
         }
         normalize_v3(N);
       }
@@ -601,12 +588,6 @@ static void lanpr_connect_two_chains(LANPR_RenderBuffer *UNUSED(rb),
     ((LANPR_RenderLineChainItem *)onto->chain.first)->prev = sub->chain.last;
     onto->chain.first = sub->chain.first;
   }
-  /* ((LANPR_RenderLineChainItem*)sub->chain.first)->occlusion = */
-  /* ((LANPR_RenderLineChainItem*)onto->chain.first)->occlusion; */
-  /* ((LANPR_RenderLineChainItem*)onto->chain.last)->occlusion = */
-  /* ((LANPR_RenderLineChainItem*)onto->chain.first)->occlusion; */
-  /* ((LANPR_RenderLineChainItem*)sub->chain.last)->occlusion = */
-  /* ((LANPR_RenderLineChainItem*)onto->chain.first)->occlusion; */
 }
 
 /*  this only does head-tail connection. */
diff --git a/source/blender/editors/lanpr/lanpr_cpu.c b/source/blender/editors/lanpr/lanpr_cpu.c
index c624da73fdf..4a4437e2fa3 100644
--- a/source/blender/editors/lanpr/lanpr_cpu.c
+++ b/source/blender/editors/lanpr/lanpr_cpu.c
@@ -2971,7 +2971,7 @@ static void lanpr_connect_new_bounding_areas(LANPR_RenderBuffer *rb, LANPR_Bound
       next_lip = lip2->next;
       tba = lip2->data;
       if (tba == Root) {
-        list_remove_pointer_item_no_free(&((LANPR_BoundingArea *)lip->data)->rp, lip2);
+        BLI_remlink(&((LANPR_BoundingArea *)lip->data)->rp, lip2);
         if (ba[1].u > tba->b && ba[1].b < tba->u) {
           list_append_pointer_static_pool(mph, &tba->rp, &ba[1]);
         }
@@ -2986,7 +2986,7 @@ static void lanpr_connect_new_bounding_areas(LANPR_RenderBuffer *rb, LANPR_Bound
       next_lip = lip2->next;
       tba = lip2->data;
       if (tba == Root) {
-        list_remove_pointer_item_no_free(&((LANPR_BoundingArea *)lip->data)->lp, lip2);
+        BLI_remlink(&((LANPR_BoundingArea *)lip->data)->lp, lip2);
         if (ba[0].u > tba->b && ba[0].b < tba->u) {
           list_append_pointer_static_pool(mph, &tba->lp, &ba[0]);
         }
@@ -3001,7 +3001,7 @@ static void lanpr_connect_new_bounding_areas(LANPR_RenderBuffer *rb, LANPR_Bound
       next_lip = lip2->next;
       tba = lip2->data;
       if (tba == Root) {
-        list_remove_pointer_item_no_free(&((LANPR_BoundingArea *)lip->data)->bp, lip2);
+        BLI_remlink(&((LANPR_BoundingArea *)lip->data)->bp, lip2);
         if (ba[0].r > tba->l && ba[0].l < tba->r) {
           list_append_pointer_static_pool(mph, &tba->up, &ba[0]);
         }
@@ -3016,7 +3016,7 @@ static void lanpr_connect_new_bounding_areas(LANPR_RenderBuffer *rb, LANPR_Bound
       next_lip = lip2->next;
       tba = lip2->data;
       if (tba == Root) {
-        list_remove_pointer_item_no_free(&((LANPR_BoundingArea *)lip->data)->up, lip2);
+        BLI_remlink(&((LANPR_BoundingArea *)lip->data)->up, lip2);
         if (ba[2].r > tba->l && ba[2].l < tba->r) {
           list_append_pointer_static_pool(mph, &tba->bp, &ba[2]);
         }
diff --git a/source/blender/editors/lanpr/lanpr_util.c b/source/blender/editors/lanpr/lanpr_util.c
index 72e2ecf7dba..7db1ed7e0de 100644
--- a/source/blender/editors/lanpr/lanpr_util.c
+++ b/source/blender/editors/lanpr/lanpr_util.c
@@ -54,10 +54,6 @@ void *list_pop_pointer_no_free(ListBase *h)
   rev = lip ? lip->data : 0;
   return rev;
 }
-void list_remove_pointer_item_no_free(ListBase *h, LinkData *lip)
-{
-  BLI_remlink(h, (void *)lip);
-}
 
 LANPR_StaticMemPoolNode *mem_new_static_pool(LANPR_StaticMemPool *smp)
 {
@@ -114,190 +110,6 @@ void *mem_static_destroy(LANPR_StaticMemPool *smp)
   return ret;
 }
 
-/* =======================================================================[str] */
-
-void tmat_load_identity_44d(tnsMatrix44d m)
-{
-  memset(m, 0, sizeof(tnsMatrix44d));
-  m[0] = 1.0f;
-  m[5] = 1.0f;
-  m[10] = 1.0f;
-  m[15] = 1.0f;
-};
-
-real tmat_length_3d(tnsVector3d l)
-{
-  return (sqrt(l[0] * l[0] + l[1] * l[1] + l[2] * l[2]));
-}
-real tmat_vector_cross_3d(tnsVector3d result, tnsVector3d l, tnsVector3d r)
-{
-  result[0] = l[1] * r[2] - l[2] * r[1];
-  result[1] = l[2] * r[0] - l[0] * r[2];
-  result[2] = l[0] * r[1] - l[1] * r[0];
-  return tmat_length_3d(result);
-}
-void tmat_apply_rotation_43d(tnsVector3d result, tnsMatrix44d mat, t

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list