From aec4367226e16912709f43cc777a6afe9ee9e1e9 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Sat, 29 Mar 2014 00:11:35 +0200 Subject: Fix building without openmp continued --- source/blender/editors/sculpt_paint/paint_cursor.c | 11 +++++++++-- source/blender/editors/sculpt_paint/sculpt.c | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index a3e69a1024b..81177dd8199 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 b2f76d7ee3d..7752101c64c 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); -- cgit v1.2.3