[Bf-blender-cvs] [ab0a52a] cycles-ptex-06: Small code cleanups

Nicholas Bishop noreply at git.blender.org
Thu Jan 15 20:13:13 CET 2015


Commit: ab0a52a45ab9da7531474125cf23ccf7e2046446
Author: Nicholas Bishop
Date:   Fri Jan 9 14:40:29 2015 +0100
Branches: cycles-ptex-06
https://developer.blender.org/rBab0a52a45ab9da7531474125cf23ccf7e2046446

Small code cleanups

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

M	source/blender/blenkernel/intern/subsurf_ccg.c

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

diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index e6db037..faf0718 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -3085,7 +3085,6 @@ static void *ccgDM_get_tessface_data_layer(DerivedMesh *dm, int type)
 	return DM_get_tessface_data_layer(dm, type);
 }
 
-/* TODO: Probably too many degrees of freedom here, but eases testing for now */
 static void ccgDM_ptex_update_grid(MLoopUV (*output)[4],
                                    const int gridFaces,
                                    const float origin[2],
@@ -3124,23 +3123,19 @@ static void ccgDM_ptex_update_grid(MLoopUV (*output)[4],
 static void ccgDM_ptex_update_quad_loops(MLoopUV (*output)[4],
                                          const int gridFaces) {
 	const float f = 0.5f / ((float)(gridFaces));
-	float origin[4][2] = {
-		{0.5, 0.5},
-		{0.5, 0.5},
-		{0.5, 0.5},
-		{0.5, 0.5},
-	};
-	float step[4][2] = {
+	const float origin[2] = {0.5, 0.5};
+	const float step[4][2] = {
 		{f, -f},
 		{f, f},
 		{-f, f},
 		{-f, -f},
 	};
-	bool swp[4] = {true, false, true, false};
+	const bool swp[4] = {true, false, true, false};
 	int output_index = 0;
 	int s;
 	for (s = 0; s < 4; s++) {
-		ccgDM_ptex_update_grid(output + output_index, gridFaces, origin[s], step[s], swp[s]);
+		ccgDM_ptex_update_grid(output + output_index, gridFaces, origin,
+		                       step[s], swp[s]);
 		output_index += gridFaces * gridFaces;
 	}
 }
@@ -3155,7 +3150,8 @@ static void ccgDM_ptex_update_subface_loops(MLoopUV (*output)[4],
 		float origin[2] = {0, 1};
 		float step[2] = {f, -f};
 		bool swp = true;
-		ccgDM_ptex_update_grid(output + output_index, gridFaces, origin, step, swp);
+		ccgDM_ptex_update_grid(output + output_index, gridFaces, origin,
+		                       step, swp);
 		output_index += gridFaces * gridFaces;
 	}
 }




More information about the Bf-blender-cvs mailing list