diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/brush.c | 10 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/colortools.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/deform.c | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/depsgraph.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/exotic.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/image_gen.c | 18 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/material.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mball.c | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 32 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/pointcache.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/report.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sca.c | 12 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 28 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/subsurf_ccg.c | 2 |
16 files changed, 66 insertions, 67 deletions
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index 96b6ec357f9..ac532cca7c6 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -1119,12 +1119,12 @@ float brush_curve_strength_clamp(Brush *br, float p, const float len) * used for sculpt only */ float brush_curve_strength(Brush *br, float p, const float len) { - if(p >= len) - p= 1.0f; - else - p= p/len; + if(p >= len) + p= 1.0f; + else + p= p/len; - return curvemapping_evaluateF(br->curve, 0, p); + return curvemapping_evaluateF(br->curve, 0, p); } /* TODO: should probably be unified with BrushPainter stuff? */ diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index 46f3e124bcc..1d7481b365a 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -793,7 +793,7 @@ void curvemapping_evaluate_premulRGBF(CurveMapping *cumap, float *vecout, const /* basic error handler, if we dont do this blender will exit */ static int ErrorReportingFunction(int ErrorCode, const char *ErrorText) { - fprintf(stderr, "%s:%d\n", ErrorText, ErrorCode); + fprintf(stderr, "%s:%d\n", ErrorText, ErrorCode); return 1; } #endif diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c index a81dcfb990f..884d6313c26 100644 --- a/source/blender/blenkernel/intern/deform.c +++ b/source/blender/blenkernel/intern/deform.c @@ -254,7 +254,6 @@ int defgroup_find_index (Object *ob, bDeformGroup *dg) if (eg == NULL) return -1; return def_nr; - } /* note, must be freed */ diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index ff49c64ebf4..170b4c23446 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -492,7 +492,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O } } } - + /* softbody collision */ if ((ob->type==OB_MESH) || (ob->type==OB_CURVE) || (ob->type==OB_LATTICE)) { if(modifiers_isSoftbodyEnabled(ob) || modifiers_isClothEnabled(ob) || ob->particlesystem.first) diff --git a/source/blender/blenkernel/intern/exotic.c b/source/blender/blenkernel/intern/exotic.c index 7cb3adf96bf..16f47f3cc59 100644 --- a/source/blender/blenkernel/intern/exotic.c +++ b/source/blender/blenkernel/intern/exotic.c @@ -889,7 +889,7 @@ void write_dxf(struct Scene *scene, char *str) write_group(0, "SECTION"); write_group(2, "BLOCKS"); - + /* only write meshes we're using in this scene */ flag_listbase_ids(&G.main->mesh, LIB_DOIT, 0); @@ -1608,7 +1608,7 @@ static void dxf_read_arc(Scene *scene, int noob) dia = (float) atof(val); } else if (id==62) { int colorid= atoi(val); - + CLAMP(colorid, 1, 255); dxf_col_to_rgb(colorid, &color[0], &color[1], &color[2]); } else if (id==67) { diff --git a/source/blender/blenkernel/intern/image_gen.c b/source/blender/blenkernel/intern/image_gen.c index 8f6408f1939..5b237665290 100644 --- a/source/blender/blenkernel/intern/image_gen.c +++ b/source/blender/blenkernel/intern/image_gen.c @@ -80,10 +80,10 @@ void BKE_image_buf_fill_checker(unsigned char *rect, float *rect_float, int widt int checkerwidth= 32, dark= 1; int x, y; - + unsigned char *rect_orig= rect; float *rect_float_orig= rect_float; - + float h=0.0, hoffs=0.0, hue=0.0, s=0.9, v=0.9, r, g, b; @@ -191,7 +191,7 @@ static void checker_board_color_fill(unsigned char *rect, float *rect_float, int for(y= 0; y < height; y++) { - + val= 0.1 + (y * (0.4 / height)); /* use a number lower then 1.0 else its too bright */ for(x= 0; x < width; x++) { @@ -316,17 +316,17 @@ static void checker_board_text(unsigned char *rect, float *rect_float, int width BLF_size(mono, 54, 72); /* hard coded size! */ BLF_buffer(mono, rect_float, rect, width, height, 4); - + for(y= 0; y < height; y+=step) { text[1]= '1'; - + for(x= 0; x < width; x+=step) { /* hard coded offset */ pen_x = x + 33; pen_y = y + 44; - + /* terribly crappy outline font! */ BLF_buffer_col(mono, 1.0, 1.0, 1.0, 1.0); @@ -338,7 +338,7 @@ static void checker_board_text(unsigned char *rect, float *rect_float, int width BLF_draw_buffer(mono, text); BLF_position(mono, pen_x, pen_y+outline, 0.0); BLF_draw_buffer(mono, text); - + BLF_position(mono, pen_x-outline, pen_y-outline, 0.0); BLF_draw_buffer(mono, text); BLF_position(mono, pen_x+outline, pen_y+outline, 0.0); @@ -351,12 +351,12 @@ static void checker_board_text(unsigned char *rect, float *rect_float, int width BLF_buffer_col(mono, 0.0, 0.0, 0.0, 1.0); BLF_position(mono, pen_x, pen_y, 0.0); BLF_draw_buffer(mono, text); - + text[1]++; } text[0]++; } - + /* cleanup the buffer. */ BLF_buffer(mono, NULL, NULL, 0, 0, 0); } diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index fa7709e3b33..130bc798ff1 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -1314,12 +1314,12 @@ void ramp_blend(int type, float *r, float *g, float *b, float fac, float *col) case MA_RAMP_SOFT: if (g){ float scr, scg, scb; - + /* first calculate non-fac based Screen mix */ scr = 1.0f - (1.0f - col[0]) * (1.0f - *r); scg = 1.0f - (1.0f - col[1]) * (1.0f - *g); scb = 1.0f - (1.0f - col[2]) * (1.0f - *b); - + *r = facm*(*r) + fac*(((1.0f - *r) * col[0] * (*r)) + (*r * scr)); *g = facm*(*g) + fac*(((1.0f - *g) * col[1] * (*g)) + (*g * scg)); *b = facm*(*b) + fac*(((1.0f - *b) * col[2] * (*b)) + (*b * scb)); diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index 6fe9e378290..e19a508658e 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -1376,7 +1376,7 @@ void converge (MB_POINT *p1, MB_POINT *p2, float v1, float v2, p->x = 0.5f*(pos.x + neg.x); p->y = 0.5f*(pos.y + neg.y); p->z = 0.5f*(pos.z + neg.z); - + if (i++ == RES) return; if ((function(p->x, p->y, p->z)) > 0.0f){ @@ -1691,11 +1691,11 @@ float init_meta(Scene *scene, Object *ob) /* return totsize */ mul_m4_m4m4(temp2, bob->obmat, obinv); /* MetaBall transformation */ mul_m4_m4m4(mat, temp1, temp2); - + invert_m4_m4(imat,mat); - + mainb[a]->rad2= ml->rad*ml->rad; - + mainb[a]->mat= (float*) mat; mainb[a]->imat= (float*) imat; diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index ebbc18cdce9..532e96f3031 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -1465,7 +1465,7 @@ void create_vert_edge_map(ListBase **map, IndexNode **mem, const MEdge *medge, c (*map) = MEM_callocN(sizeof(ListBase) * totvert, "vert edge map"); (*mem) = MEM_callocN(sizeof(IndexNode) * totedge * 2, "vert edge map mem"); node = *mem; - + /* Find the users */ for(i = 0; i < totedge; ++i){ for(j = 0; j < 2; ++j, ++node) { diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 927f4863e2d..e80289c75ae 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -4424,22 +4424,22 @@ void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3] xvec[0] = 1.0f; xvec[1] = 0.0f; xvec[2] = 0.0f; yvec[0] = 0.0f; yvec[1] = 1.0f; yvec[2] = 0.0f; - /* can happen with bad pointcache or physics calculation - * since this becomes geometry, nan's and inf's crash raytrace code. - * better not allow this. */ - if( !finite(bb->vec[0]) || !finite(bb->vec[1]) || !finite(bb->vec[2]) || - !finite(bb->vel[0]) || !finite(bb->vel[1]) || !finite(bb->vel[2]) ) - { - zero_v3(bb->vec); - zero_v3(bb->vel); - - zero_v3(xvec); - zero_v3(yvec); - zero_v3(zvec); - zero_v3(center); - - return; - } + /* can happen with bad pointcache or physics calculation + * since this becomes geometry, nan's and inf's crash raytrace code. + * better not allow this. */ + if( !finite(bb->vec[0]) || !finite(bb->vec[1]) || !finite(bb->vec[2]) || + !finite(bb->vel[0]) || !finite(bb->vel[1]) || !finite(bb->vel[2]) ) + { + zero_v3(bb->vec); + zero_v3(bb->vel); + + zero_v3(xvec); + zero_v3(yvec); + zero_v3(zvec); + zero_v3(center); + + return; + } if(bb->align < PART_BB_VIEW) onevec[bb->align]=1.0f; diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 1c05b854ef7..666ba31faed 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -644,7 +644,7 @@ static void hammersley_create(float *out, int n, int seed, float amount) for (p = 0.5, kk = k; kk; p *= 0.5, kk >>= 1) if (kk & 1) /* kk mod 2 = 1 */ t += p; - + out[2*k + 0]= fmod((double)k/(double)n + offs[0], 1.0); out[2*k + 1]= fmod(t + offs[1], 1.0); } diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index a8447e2a12a..45cb6254887 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -1308,8 +1308,8 @@ static void ptcache_data_copy(void *from[], void *to[]) { int i; for(i=0; i<BPHYS_TOT_DATA; i++) { - /* note, durian file 03.4b_comp crashes if to[i] is not tested - * its NULL, not sure if this should be fixed elsewhere but for now its needed */ + /* note, durian file 03.4b_comp crashes if to[i] is not tested + * its NULL, not sure if this should be fixed elsewhere but for now its needed */ if(from[i] && to[i]) memcpy(to[i], from[i], ptcache_data_size[i]); } diff --git a/source/blender/blenkernel/intern/report.c b/source/blender/blenkernel/intern/report.c index ed3739e897d..f84d98a31b4 100644 --- a/source/blender/blenkernel/intern/report.c +++ b/source/blender/blenkernel/intern/report.c @@ -101,7 +101,7 @@ void BKE_report(ReportList *reports, ReportType type, const char *message) Report *report; int len; - /* in background mode always print otherwise there are cases the errors wont be displayed, + /* in background mode always print otherwise there are cases the errors wont be displayed, * but still add to the report list since this is used for python exception handling */ if(G.background || !reports || ((reports->flag & RPT_PRINT) && (type >= reports->printlevel))) { printf("%s: %s\n", report_type_str(type), message); diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c index 38dc7fd5106..16cef67ea6d 100644 --- a/source/blender/blenkernel/intern/sca.c +++ b/source/blender/blenkernel/intern/sca.c @@ -333,12 +333,12 @@ void free_actuator(bActuator *act) if(act->data) { switch (act->type) { - case ACT_SOUND: - sa = (bSoundActuator *) act->data; - if(sa->sound) - id_us_min((ID *) sa->sound); - break; - } + case ACT_SOUND: + sa = (bSoundActuator *) act->data; + if(sa->sound) + id_us_min((ID *) sa->sound); + break; + } MEM_freeN(act->data); } diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index c4eefb16348..791d572d385 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -1080,23 +1080,23 @@ float get_render_aosss_error(RenderData *r, float error) /* helper function for the SETLOOPER macro */ Base *_setlooper_base_step(Scene **sce_iter, Base *base) { - if(base && base->next) { - /* common case, step to the next */ - return base->next; - } + if(base && base->next) { + /* common case, step to the next */ + return base->next; + } else if(base==NULL && (*sce_iter)->base.first) { - /* first time looping, return the scenes first base */ + /* first time looping, return the scenes first base */ return (Base *)(*sce_iter)->base.first; - } - else { - /* reached the end, get the next base in the set */ + } + else { + /* reached the end, get the next base in the set */ while((*sce_iter= (*sce_iter)->set)) { base= (Base *)(*sce_iter)->base.first; - if(base) { - return base; - } - } - } + if(base) { + return base; + } + } + } - return NULL; + return NULL; } diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 3041a4c59e6..b9bf10bdf39 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -2696,7 +2696,7 @@ void subsurf_calculate_limit_positions(Mesh *me, float (*positions_r)[3]) int numFaces = ccgSubSurf_getVertNumFaces(v); float *co; int i; - + edge_sum[0]= edge_sum[1]= edge_sum[2]= 0.0; face_sum[0]= face_sum[1]= face_sum[2]= 0.0; |