diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-12-22 07:11:10 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-12-22 07:12:19 +0400 |
commit | c1c26c36f62c3bfdb40b01f33004695a09ce2f4d (patch) | |
tree | 21e738fefe0c7d77af7c1129bcdfef65e1a8f655 /source/blender/blenkernel/intern/dynamicpaint.c | |
parent | 5eb96d4705b93a7049ecabd0827e0e58b28a2838 (diff) |
Style Cleanup: remove preprocessor indentation (updated wiki style guide too)
Diffstat (limited to 'source/blender/blenkernel/intern/dynamicpaint.c')
-rw-r--r-- | source/blender/blenkernel/intern/dynamicpaint.c | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index fe9a96d60cf..e2b752ea352 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -742,14 +742,14 @@ static void surfaceGenerateGrid(struct DynamicPaintSurface *surface) float min_dim; /* calculate canvas dimensions */ - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < sData->total_points; i++) { - #ifdef _OPENMP +#ifdef _OPENMP int id = omp_get_thread_num(); boundInsert(&grid_bounds[id], (bData->realCoord[bData->s_pos[i]].v)); - #else +#else boundInsert(&grid_bounds[0], (bData->realCoord[bData->s_pos[i]].v)); - #endif +#endif } /* get final dimensions */ @@ -802,7 +802,7 @@ static void surfaceGenerateGrid(struct DynamicPaintSurface *surface) if (!error) { /* calculate number of points withing each cell */ - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < sData->total_points; i++) { int co[3], j; for (j = 0; j < 3; j++) { @@ -811,11 +811,11 @@ static void surfaceGenerateGrid(struct DynamicPaintSurface *surface) } temp_t_index[i] = co[0] + co[1] * grid->dim[0] + co[2] * grid->dim[0] * grid->dim[1]; - #ifdef _OPENMP +#ifdef _OPENMP grid->s_num[temp_t_index[i] + omp_get_thread_num() * grid_cells]++; - #else +#else grid->s_num[temp_t_index[i]]++; - #endif +#endif } /* for first cell only calc s_num */ @@ -843,7 +843,7 @@ static void surfaceGenerateGrid(struct DynamicPaintSurface *surface) /* calculate cell bounds */ { int x; - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (x = 0; x < grid->dim[0]; x++) { int y; for (y = 0; y < grid->dim[1]; y++) { @@ -1471,7 +1471,7 @@ static void dynamicPaint_setInitialColor(Scene *scene, DynamicPaintSurface *surf /* Single color */ else if (surface->init_color_type == MOD_DPAINT_INITIAL_COLOR) { /* apply color to every surface point */ - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < sData->total_points; i++) { copy_v3_v3(pPoint[i].color, surface->init_color); pPoint[i].alpha = surface->init_color[3]; @@ -1497,7 +1497,7 @@ static void dynamicPaint_setInitialColor(Scene *scene, DynamicPaintSurface *surf if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX) { struct ImagePool *pool = BKE_image_pool_new(); - #pragma omp parallel for schedule(static) shared(pool) +#pragma omp parallel for schedule(static) shared(pool) for (i = 0; i < numOfFaces; i++) { int numOfVert = (mface[i].v4) ? 4 : 3; float uv[3] = {0.0f}; @@ -1524,7 +1524,7 @@ static void dynamicPaint_setInitialColor(Scene *scene, DynamicPaintSurface *surf ImgSeqFormatData *f_data = (ImgSeqFormatData *)sData->format_data; int samples = (surface->flags & MOD_DPAINT_ANTIALIAS) ? 5 : 1; - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < sData->total_points; i++) { float uv[9] = {0.0f}; float uv_final[3] = {0.0f}; @@ -1562,7 +1562,7 @@ static void dynamicPaint_setInitialColor(Scene *scene, DynamicPaintSurface *surf MCol *col = CustomData_get_layer_named(&dm->loopData, CD_MLOOPCOL, surface->init_layername); if (!col) return; - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < numOfLoops; i++) { pPoint[mloop[i].v].color[0] = 1.0f / 255.f * (float)col[i].b; pPoint[mloop[i].v].color[1] = 1.0f / 255.f * (float)col[i].g; @@ -1576,7 +1576,7 @@ static void dynamicPaint_setInitialColor(Scene *scene, DynamicPaintSurface *surf MCol *col = CustomData_get_layer_named(&dm->faceData, CD_MCOL, surface->init_layername); if (!col) return; - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < sData->total_points; i++) { int face_ind = f_data->uv_p[i].face_index; float colors[3][4] = {{0.0f, 0.0f, 0.0f, 0.0f}}; @@ -1680,7 +1680,7 @@ static void dynamicPaint_applySurfaceDisplace(DynamicPaintSurface *surface, Deri int i; float *value = (float *)sData->type_data; - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < sData->total_points; i++) { float normal[3], val = value[i] * surface->disp_factor; normal_short_to_float_v3(normal, mvert[i].no); @@ -1729,7 +1729,7 @@ static DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData *pmd, /* paint is stored on dry and wet layers, so mix final color first */ float *fcolor = MEM_callocN(sizeof(float) * sData->total_points * 4, "Temp paint color"); - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < sData->total_points; i++) { /* blend dry and wet layer */ blendColors(pPoint[i].color, pPoint[i].alpha, pPoint[i].e_color, pPoint[i].e_alpha, &fcolor[i * 4]); @@ -1757,7 +1757,7 @@ static DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData *pmd, NULL, totloop); if (col) { - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < totpoly; i++) { int j = 0; Material *material = give_current_material(ob, mp[i].mat_nr + 1); @@ -1808,7 +1808,7 @@ static DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData *pmd, col = CustomData_add_layer_named(&result->loopData, CD_MLOOPCOL, CD_CALLOC, NULL, totloop, surface->output_name); /* apply color */ if (col) { - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < totloop; i++) { int index = mloop[i].v * 4; rgb_float_to_uchar((unsigned char *)&col[i].r, &fcolor[index]); @@ -1825,7 +1825,7 @@ static DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData *pmd, col = CustomData_add_layer_named(&result->loopData, CD_MLOOPCOL, CD_CALLOC, NULL, totloop, surface->output_name2); /* apply color */ if (col) { - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < totloop; i++) { int index = mloop[i].v; col[i].r = @@ -1882,7 +1882,7 @@ static DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData *pmd, int i; PaintWavePoint *wPoint = (PaintWavePoint *)sData->type_data; - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < sData->total_points; i++) { float normal[3]; normal_short_to_float_v3(normal, mvert[i].no); @@ -2331,7 +2331,7 @@ int dynamicPaint_createUVSurface(Scene *scene, DynamicPaintSurface *surface) * if pixel is uv-mapped on a canvas face. */ if (!error) { - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (ty = 0; ty < h; ty++) { int tx; for (tx = 0; tx < w; tx++) { @@ -2475,7 +2475,7 @@ int dynamicPaint_createUVSurface(Scene *scene, DynamicPaintSurface *surface) * If so use that polygon as pixel surface. * (To avoid seams on uv island edges) */ - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (ty = 0; ty < h; ty++) { int tx; for (tx = 0; tx < w; tx++) { @@ -2666,7 +2666,7 @@ int dynamicPaint_createUVSurface(Scene *scene, DynamicPaintSurface *surface) /* ----------------------------------------------------------------- * For debug, output pixel statuses to the color map * -----------------------------------------------------------------*/ - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (index = 0; index < sData->total_points; index++) { ImgSeqFormatData *f_data = (ImgSeqFormatData *)sData->format_data; @@ -2707,9 +2707,9 @@ void dynamicPaint_outputSurfaceImage(DynamicPaintSurface *surface, char *filenam return; } /* if selected format is openexr, but current build doesnt support one */ - #ifndef WITH_OPENEXR +#ifndef WITH_OPENEXR if (format == R_IMF_IMTYPE_OPENEXR) format = R_IMF_IMTYPE_PNG; - #endif +#endif BLI_strncpy(output_file, filename, sizeof(output_file)); BKE_add_image_extension_from_type(output_file, format); @@ -2724,7 +2724,7 @@ void dynamicPaint_outputSurfaceImage(DynamicPaintSurface *surface, char *filenam return; } - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (index = 0; index < sData->total_points; index++) { int pos = f_data->uv_p[index].pixel_index * 4; /* image buffer position */ @@ -3220,7 +3220,7 @@ static void dynamicPaint_brushMeshCalculateVelocity(Scene *scene, Object *ob, Dy mvert_p = mvert_c; /* calculate speed */ - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < numOfVerts_c; i++) { float p1[3], p2[3]; @@ -3350,7 +3350,7 @@ static int dynamicPaint_paintMesh(DynamicPaintSurface *surface, continue; /* loop through cell points and process brush */ - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (id = 0; id < grid->s_num[c_index]; id++) { int index = grid->t_index[grid->s_pos[c_index] + id]; int ss, samples = bData->s_num[index]; @@ -3755,7 +3755,7 @@ static int dynamicPaint_paintParticles(DynamicPaintSurface *surface, } /* loop through cell points */ - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (id = 0; id < grid->s_num[c_index]; id++) { int index = grid->t_index[grid->s_pos[c_index] + id]; float disp_intersect = 0.0f; @@ -3929,7 +3929,7 @@ static int dynamicPaint_paintSinglePoint(DynamicPaintSurface *surface, float *po /* * Loop through every surface point */ - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (index = 0; index < sData->total_points; index++) { float distance = len_v3v3(pointCoord, bData->realCoord[bData->s_pos[index]].v); float colorband[4] = {0.0f}; @@ -4043,7 +4043,7 @@ static void dynamicPaint_prepareAdjacencyData(DynamicPaintSurface *surface, int bNeighs = bData->bNeighs = MEM_mallocN(sData->adj_data->total_targets * sizeof(struct BakeAdjPoint), "PaintEffectBake"); if (!bNeighs) return; - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (index = 0; index < sData->total_points; index++) { int i; int numOfNeighs = adj_data->n_num[index]; @@ -4231,7 +4231,7 @@ static int dynamicPaint_prepareEffectStep(DynamicPaintSurface *surface, Scene *s *force = MEM_mallocN(sData->total_points * 4 * sizeof(float), "PaintEffectForces"); if (*force) { - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (index = 0; index < sData->total_points; index++) { float forc[3] = {0}; @@ -4320,7 +4320,7 @@ static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface, float *force /* Copy current surface to the previous points array to read unmodified values */ memcpy(prevPoint, sData->type_data, sData->total_points * sizeof(struct PaintPoint)); - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (index = 0; index < sData->total_points; index++) { int i; int numOfNeighs = sData->adj_data->n_num[index]; @@ -4362,7 +4362,7 @@ static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface, float *force /* Copy current surface to the previous points array to read unmodified values */ memcpy(prevPoint, sData->type_data, sData->total_points * sizeof(struct PaintPoint)); - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (index = 0; index < sData->total_points; index++) { int i; int numOfNeighs = sData->adj_data->n_num[index]; @@ -4507,7 +4507,7 @@ static void dynamicPaint_doWaveStep(DynamicPaintSurface *surface, float timescal /* copy previous frame data */ memcpy(prevPoint, sData->type_data, sData->total_points * sizeof(PaintWavePoint)); - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (index = 0; index < sData->total_points; index++) { PaintWavePoint *wPoint = &((PaintWavePoint *)sData->type_data)[index]; int numOfNeighs = sData->adj_data->n_num[index]; @@ -4571,7 +4571,7 @@ static void dynamicPaint_doWaveStep(DynamicPaintSurface *surface, float timescal } /* reset state */ - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (index = 0; index < sData->total_points; index++) { PaintWavePoint *wPoint = &((PaintWavePoint *)sData->type_data)[index]; /* if there wasnt any brush intersection, clear isect height */ @@ -4590,7 +4590,7 @@ static void dynamicPaint_surfacePreStep(DynamicPaintSurface *surface, float time PaintSurfaceData *sData = surface->data; int index; - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (index = 0; index < sData->total_points; index++) { /* Do drying dissolve effects */ if (surface->type == MOD_DPAINT_SURFACE_T_PAINT) { @@ -4688,7 +4688,7 @@ static int dynamicPaint_surfaceHasMoved(DynamicPaintSurface *surface, Object *ob } /* vertices */ - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (i = 0; i < numOfVerts; i++) { int j; for (j = 0; j < 3; j++) @@ -4806,7 +4806,7 @@ static int dynamicPaint_generateBakeData(DynamicPaintSurface *surface, Scene *sc /* * Prepare each surface point for a new step */ - #pragma omp parallel for schedule(static) +#pragma omp parallel for schedule(static) for (index = 0; index < sData->total_points; index++) { float prev_point[3] = {0.0f, 0.0f, 0.0f}; if (do_velocity_data && !new_bdata) { |