[Bf-blender-cvs] [aec4367] master: Fix building without openmp continued

Antony Riakiotakis noreply at git.blender.org
Fri Mar 28 23:11:42 CET 2014


Commit: aec4367226e16912709f43cc777a6afe9ee9e1e9
Author: Antony Riakiotakis
Date:   Sat Mar 29 00:11:35 2014 +0200
https://developer.blender.org/rBaec4367226e16912709f43cc777a6afe9ee9e1e9

Fix building without openmp continued

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

M	source/blender/editors/sculpt_paint/paint_cursor.c
M	source/blender/editors/sculpt_paint/sculpt.c

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

diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index a3e69a1..81177dd 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -210,6 +210,13 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima
 			int i;
 			float y;
 			float len;
+			int thread_num;
+
+#ifdef _OPENMP
+			thread_num = omp_get_thread_num();
+#else
+			thread_num = 0;
+#endif
 
 			for (i = 0; i < size; i++) {
 
@@ -249,7 +256,7 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima
 					if (col) {
 						float rgba[4];
 
-						paint_get_tex_pixel_col(mtex, x, y, rgba, pool, omp_get_thread_num());
+						paint_get_tex_pixel_col(mtex, x, y, rgba, pool, thread_num);
 
 						buffer[index * 4]     = rgba[0] * 255;
 						buffer[index * 4 + 1] = rgba[1] * 255;
@@ -257,7 +264,7 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima
 						buffer[index * 4 + 3] = rgba[3] * 255;
 					}
 					else {
-						float avg = paint_get_tex_pixel(mtex, x, y, pool, omp_get_thread_num());
+						float avg = paint_get_tex_pixel(mtex, x, y, pool, thread_num);
 
 						avg += br->texture_sample_bias;
 
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index b2f76d7..7752101 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -988,9 +988,10 @@ static float tex_strength(SculptSession *ss, Brush *br,
 			x += br->mtex.ofs[0];
 			y += br->mtex.ofs[1];
 
-			thread_num = 0;
 #ifdef _OPENMP
 			thread_num = omp_get_thread_num();
+#else
+			thread_num = 0;
 #endif
 			avg = paint_get_tex_pixel(&br->mtex, x, y, ss->tex_pool, thread_num);




More information about the Bf-blender-cvs mailing list