diff options
Diffstat (limited to 'source/blender/blenkernel/intern')
55 files changed, 1045 insertions, 1045 deletions
diff --git a/source/blender/blenkernel/intern/BME_Customdata.c b/source/blender/blenkernel/intern/BME_Customdata.c index 736b5e05798..d8a6b66d5bb 100644 --- a/source/blender/blenkernel/intern/BME_Customdata.c +++ b/source/blender/blenkernel/intern/BME_Customdata.c @@ -135,7 +135,7 @@ static void BME_CD_alloc_block(BME_CustomData *data, void **block) } void BME_CD_copy_data(const BME_CustomData *source, BME_CustomData *dest, - void *src_block, void **dest_block) + void *src_block, void **dest_block) { const BME_LayerTypeInfo *typeInfo; int dest_i, src_i; @@ -151,7 +151,7 @@ void BME_CD_copy_data(const BME_CustomData *source, BME_CustomData *dest, * (this should work because layers are ordered by type) */ while(dest_i < dest->totlayer - && dest->layers[dest_i].type < source->layers[src_i].type) + && dest->layers[dest_i].type < source->layers[src_i].type) ++dest_i; /* if there are no more dest layers, we're done */ diff --git a/source/blender/blenkernel/intern/BME_eulers.c b/source/blender/blenkernel/intern/BME_eulers.c index 9c9c71292c2..036cd4a23e2 100644 --- a/source/blender/blenkernel/intern/BME_eulers.c +++ b/source/blender/blenkernel/intern/BME_eulers.c @@ -71,7 +71,7 @@ code. *The term "Euler Operator" is actually a misnomer when referring to a non-manifold - data structure. Its use is in keeping with the convention established by others. + data structure. Its use is in keeping with the convention established by others. TODO: -Finish inserting 'strict' validation in all Eulers diff --git a/source/blender/blenkernel/intern/BME_mesh.c b/source/blender/blenkernel/intern/BME_mesh.c index f616d21c6fd..1bb419937b0 100644 --- a/source/blender/blenkernel/intern/BME_mesh.c +++ b/source/blender/blenkernel/intern/BME_mesh.c @@ -87,7 +87,7 @@ void BME_free_mesh(BME_Mesh *bm) if(bm->ldata.totlayer) BLI_mempool_destroy(bm->ldata.pool); if(bm->pdata.totlayer) BLI_mempool_destroy(bm->pdata.pool); - /*free custom data*/ + /*free custom data*/ CustomData_free(&bm->vdata,0); CustomData_free(&bm->edata,0); CustomData_free(&bm->ldata,0); diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c index eb316c64af4..6778c9eb8ad 100644 --- a/source/blender/blenkernel/intern/CCGSubSurf.c +++ b/source/blender/blenkernel/intern/CCGSubSurf.c @@ -170,7 +170,7 @@ static void *_ehashIterator_getCurrent(EHashIterator *ehi) { static void _ehashIterator_next(EHashIterator *ehi) { if (ehi->curEntry) { - ehi->curEntry = ehi->curEntry->next; + ehi->curEntry = ehi->curEntry->next; while (!ehi->curEntry) { ehi->curBucket++; if (ehi->curBucket==ehi->eh->curSize) diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index e69686eeb00..6908d987a36 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -113,7 +113,7 @@ static MFace *dm_getFaceArray(DerivedMesh *dm) static MVert *dm_dupVertArray(DerivedMesh *dm) { MVert *tmp = MEM_callocN(sizeof(*tmp) * dm->getNumVerts(dm), - "dm_dupVertArray tmp"); + "dm_dupVertArray tmp"); if(tmp) dm->copyVertArray(dm, tmp); @@ -123,7 +123,7 @@ static MVert *dm_dupVertArray(DerivedMesh *dm) static MEdge *dm_dupEdgeArray(DerivedMesh *dm) { MEdge *tmp = MEM_callocN(sizeof(*tmp) * dm->getNumEdges(dm), - "dm_dupEdgeArray tmp"); + "dm_dupEdgeArray tmp"); if(tmp) dm->copyEdgeArray(dm, tmp); @@ -133,7 +133,7 @@ static MEdge *dm_dupEdgeArray(DerivedMesh *dm) static MFace *dm_dupFaceArray(DerivedMesh *dm) { MFace *tmp = MEM_callocN(sizeof(*tmp) * dm->getNumFaces(dm), - "dm_dupFaceArray tmp"); + "dm_dupFaceArray tmp"); if(tmp) dm->copyFaceArray(dm, tmp); @@ -161,7 +161,7 @@ void DM_init_funcs(DerivedMesh *dm) } void DM_init(DerivedMesh *dm, DerivedMeshType type, - int numVerts, int numEdges, int numFaces) + int numVerts, int numEdges, int numFaces) { dm->type = type; dm->numVertData = numVerts; @@ -174,14 +174,14 @@ void DM_init(DerivedMesh *dm, DerivedMeshType type, } void DM_from_template(DerivedMesh *dm, DerivedMesh *source, DerivedMeshType type, - int numVerts, int numEdges, int numFaces) + int numVerts, int numEdges, int numFaces) { CustomData_copy(&source->vertData, &dm->vertData, CD_MASK_DERIVEDMESH, - CD_CALLOC, numVerts); + CD_CALLOC, numVerts); CustomData_copy(&source->edgeData, &dm->edgeData, CD_MASK_DERIVEDMESH, - CD_CALLOC, numEdges); + CD_CALLOC, numEdges); CustomData_copy(&source->faceData, &dm->faceData, CD_MASK_DERIVEDMESH, - CD_CALLOC, numFaces); + CD_CALLOC, numFaces); dm->type = type; dm->numVertData = numVerts; @@ -352,24 +352,24 @@ void DM_set_face_data(DerivedMesh *dm, int index, int type, void *data) } void DM_copy_vert_data(DerivedMesh *source, DerivedMesh *dest, - int source_index, int dest_index, int count) + int source_index, int dest_index, int count) { CustomData_copy_data(&source->vertData, &dest->vertData, - source_index, dest_index, count); + source_index, dest_index, count); } void DM_copy_edge_data(DerivedMesh *source, DerivedMesh *dest, - int source_index, int dest_index, int count) + int source_index, int dest_index, int count) { CustomData_copy_data(&source->edgeData, &dest->edgeData, - source_index, dest_index, count); + source_index, dest_index, count); } void DM_copy_face_data(DerivedMesh *source, DerivedMesh *dest, - int source_index, int dest_index, int count) + int source_index, int dest_index, int count) { CustomData_copy_data(&source->faceData, &dest->faceData, - source_index, dest_index, count); + source_index, dest_index, count); } void DM_free_vert_data(struct DerivedMesh *dm, int index, int count) @@ -388,29 +388,29 @@ void DM_free_face_data(struct DerivedMesh *dm, int index, int count) } void DM_interp_vert_data(DerivedMesh *source, DerivedMesh *dest, - int *src_indices, float *weights, - int count, int dest_index) + int *src_indices, float *weights, + int count, int dest_index) { CustomData_interp(&source->vertData, &dest->vertData, src_indices, - weights, NULL, count, dest_index); + weights, NULL, count, dest_index); } void DM_interp_edge_data(DerivedMesh *source, DerivedMesh *dest, - int *src_indices, - float *weights, EdgeVertWeight *vert_weights, - int count, int dest_index) + int *src_indices, + float *weights, EdgeVertWeight *vert_weights, + int count, int dest_index) { CustomData_interp(&source->edgeData, &dest->edgeData, src_indices, - weights, (float*)vert_weights, count, dest_index); + weights, (float*)vert_weights, count, dest_index); } void DM_interp_face_data(DerivedMesh *source, DerivedMesh *dest, - int *src_indices, - float *weights, FaceVertWeight *vert_weights, - int count, int dest_index) + int *src_indices, + float *weights, FaceVertWeight *vert_weights, + int count, int dest_index) { CustomData_interp(&source->faceData, &dest->faceData, src_indices, - weights, (float*)vert_weights, count, dest_index); + weights, (float*)vert_weights, count, dest_index); } void DM_swap_face_data(DerivedMesh *dm, int index, int *corner_indices) @@ -635,8 +635,8 @@ static void emDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us draw = setDrawOptions==NULL ? 1 : setDrawOptions(userData, i, &drawSmooth); if(draw) { if (draw==2) { /* enabled with stipple */ - glEnable(GL_POLYGON_STIPPLE); - glPolygonStipple(stipple_quarttone); + glEnable(GL_POLYGON_STIPPLE); + glPolygonStipple(stipple_quarttone); } glShadeModel(drawSmooth?GL_SMOOTH:GL_FLAT); @@ -706,9 +706,9 @@ static void emDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us } static void emDM_drawFacesTex_common(DerivedMesh *dm, - int (*drawParams)(MTFace *tface, MCol *mcol, int matnr), - int (*drawParamsMapped)(void *userData, int index), - void *userData) + int (*drawParams)(MTFace *tface, MCol *mcol, int matnr), + int (*drawParamsMapped)(void *userData, int index), + void *userData) { EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; EditMesh *em= emdm->em; @@ -884,8 +884,8 @@ static void emDM_drawMappedFacesTex(DerivedMesh *dm, int (*setDrawOptions)(void } static void emDM_drawMappedFacesGLSL(DerivedMesh *dm, - int (*setMaterial)(int, void *attribs), - int (*setDrawOptions)(void *userData, int index), void *userData) + int (*setMaterial)(int, void *attribs), + int (*setDrawOptions)(void *userData, int index), void *userData) { EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; EditMesh *em= emdm->em; @@ -1034,7 +1034,7 @@ static void emDM_drawMappedFacesGLSL(DerivedMesh *dm, } static void emDM_drawFacesGLSL(DerivedMesh *dm, - int (*setMaterial)(int, void *attribs)) + int (*setMaterial)(int, void *attribs)) { dm->drawMappedFacesGLSL(dm, setMaterial, NULL, NULL); } @@ -1151,7 +1151,7 @@ static void emDM_getFace(DerivedMesh *dm, int index, MFace *face_r) if(!v4) face_r->v4 = 0; for(i = 0, ev = em->verts.first; v1 || v2 || v3 || v4; - i++, ev = ev->next) { + i++, ev = ev->next) { if(ev == v1) { face_r->v1 = i; v1 = NULL; @@ -1297,12 +1297,12 @@ static void emDM_release(DerivedMesh *dm) } static DerivedMesh *getEditMeshDerivedMesh(EditMesh *em, Object *ob, - float (*vertexCos)[3]) + float (*vertexCos)[3]) { EditMeshDerivedMesh *emdm = MEM_callocN(sizeof(*emdm), "emdm"); DM_init(&emdm->dm, DM_TYPE_EDITMESH, BLI_countlist(&em->verts), - BLI_countlist(&em->edges), BLI_countlist(&em->faces)); + BLI_countlist(&em->edges), BLI_countlist(&em->faces)); emdm->dm.getMinMax = emDM_getMinMax; @@ -1345,7 +1345,7 @@ static DerivedMesh *getEditMeshDerivedMesh(EditMesh *em, Object *ob, for(eve = em->verts.first, i = 0; eve; eve = eve->next, ++i) DM_set_vert_data(&emdm->dm, i, CD_MDEFORMVERT, - CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT)); + CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT)); } if(vertexCos) { @@ -1596,9 +1596,9 @@ static void add_weight_mcol_dm(Object *ob, DerivedMesh *dm) * - apply deform modifiers and input vertexco */ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos)[3], - DerivedMesh **deform_r, DerivedMesh **final_r, - int useRenderParams, int useDeform, - int needMapping, CustomDataMask dataMask, int index, int useCache) + DerivedMesh **deform_r, DerivedMesh **final_r, + int useRenderParams, int useDeform, + int needMapping, CustomDataMask dataMask, int index, int useCache) { Mesh *me = ob->data; ModifierData *firstmd, *md; @@ -1716,7 +1716,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos */ numVerts = dm->getNumVerts(dm); deformedVerts = - MEM_mallocN(sizeof(*deformedVerts) * numVerts, "dfmv"); + MEM_mallocN(sizeof(*deformedVerts) * numVerts, "dfmv"); dm->getVertCos(dm, deformedVerts); } else { deformedVerts = mesh_getVertexCos(me, &numVerts); @@ -1891,8 +1891,8 @@ static int editmesh_modifier_is_enabled(Scene *scene, ModifierData *md, DerivedM } static void editmesh_calc_modifiers(Scene *scene, Object *ob, EditMesh *em, DerivedMesh **cage_r, - DerivedMesh **final_r, - CustomDataMask dataMask) + DerivedMesh **final_r, + CustomDataMask dataMask) { ModifierData *md; float (*deformedVerts)[3] = NULL; @@ -1947,7 +1947,7 @@ static void editmesh_calc_modifiers(Scene *scene, Object *ob, EditMesh *em, Deri */ numVerts = dm->getNumVerts(dm); deformedVerts = - MEM_mallocN(sizeof(*deformedVerts) * numVerts, "dfmv"); + MEM_mallocN(sizeof(*deformedVerts) * numVerts, "dfmv"); dm->getVertCos(dm, deformedVerts); } else { deformedVerts = editmesh_getVertexCos(em, &numVerts); @@ -2029,8 +2029,8 @@ static void editmesh_calc_modifiers(Scene *scene, Object *ob, EditMesh *em, Deri *cage_r = dm; } else { *cage_r = - getEditMeshDerivedMesh(em, ob, - deformedVerts ? MEM_dupallocN(deformedVerts) : NULL); + getEditMeshDerivedMesh(em, ob, + deformedVerts ? MEM_dupallocN(deformedVerts) : NULL); } } } @@ -2202,7 +2202,7 @@ DerivedMesh *mesh_create_derived_view(Scene *scene, Object *ob, CustomDataMask d } DerivedMesh *mesh_create_derived_no_deform(Scene *scene, Object *ob, float (*vertCos)[3], - CustomDataMask dataMask) + CustomDataMask dataMask) { DerivedMesh *final; @@ -2212,7 +2212,7 @@ DerivedMesh *mesh_create_derived_no_deform(Scene *scene, Object *ob, float (*ver } DerivedMesh *mesh_create_derived_no_virtual(Scene *scene, Object *ob, float (*vertCos)[3], - CustomDataMask dataMask) + CustomDataMask dataMask) { DerivedMesh *final; @@ -2222,8 +2222,8 @@ DerivedMesh *mesh_create_derived_no_virtual(Scene *scene, Object *ob, float (*ve } DerivedMesh *mesh_create_derived_no_deform_render(Scene *scene, Object *ob, - float (*vertCos)[3], - CustomDataMask dataMask) + float (*vertCos)[3], + CustomDataMask dataMask) { DerivedMesh *final; @@ -2235,7 +2235,7 @@ DerivedMesh *mesh_create_derived_no_deform_render(Scene *scene, Object *ob, /***/ DerivedMesh *editmesh_get_derived_cage_and_final(Scene *scene, Object *obedit, EditMesh *em, DerivedMesh **final_r, - CustomDataMask dataMask) + CustomDataMask dataMask) { /* if there's no derived mesh or the last data mask used doesn't include * the data we need, rebuild the derived mesh diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index cf61de195e5..afd0b3a0f57 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -64,13 +64,13 @@ /* *********************** NOTE ON POSE AND ACTION ********************** - Pose is the local (object level) component of armature. The current - object pose is saved in files, and (will be) is presorted for dependency + object pose is saved in files, and (will be) is presorted for dependency - Actions have fewer (or other) channels, and write data to a Pose - Currently ob->pose data is controlled in where_is_pose only. The (recalc) - event system takes care of calling that + event system takes care of calling that - The NLA system (here too) uses Poses as interpolation format for Actions - Therefore we assume poses to be static, and duplicates of poses have channels in - same order, for quick interpolation reasons + same order, for quick interpolation reasons ****************************** (ton) ************************************ */ @@ -1138,17 +1138,17 @@ static void blend_pose_strides(bPose *dst, bPose *src, float srcweight, short mo bone matching diagram, strips A and B - .------------------------. - | A | - '------------------------' + .------------------------. + | A | + '------------------------' . . b2 - . .-------------v----------. - . | B . | - . '------------------------' - . . . - . . . + . .-------------v----------. + . | B . | + . '------------------------' + . . . + . . . offset: . 0 . A-B . A-b2+B - . . . + . . . */ diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 9eb6c3ad467..b2ac32da138 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -439,7 +439,7 @@ void calc_curvepath(Object *ob) fp= dist+1; maxdist= dist+tot; fac= 1.0f/((float)path->len-1.0f); - fac = fac * path->totdist; + fac = fac * path->totdist; for(a=0; a<path->len; a++) { diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 584f31769ef..a2749a5a457 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -769,7 +769,7 @@ static short animsys_remap_path (AnimMapper *remap, char *path, char **dst) /* Write the given value to a setting using RNA, and return success */ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_index, float value) { - // printf("%p %s %i %f\n", ptr, path, array_index, value); + // printf("%p %s %i %f\n", ptr, path, array_index, value); PropertyRNA *prop; PointerRNA new_ptr; @@ -1740,7 +1740,7 @@ void BKE_animsys_evaluate_animdata (ID *id, AnimData *adt, float ctime, short re */ // TODO: need to double check that this all works correctly if ((recalc & ADT_RECALC_ANIM) || (adt->recalc & ADT_RECALC_ANIM)) - { + { /* evaluate NLA data */ if ((adt->nla_tracks.first) && !(adt->flag & ADT_NLA_EVAL_OFF)) { diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 387b8a1d5b2..668ce9aadac 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -708,7 +708,7 @@ static void pchan_b_bone_defmats(bPoseChannel *pchan, int use_quaternion, int re invert_m4_m4(b_bone_mats[0].mat, bone->arm_mat); /* then we make the b_bone_mats: - - first transform to local bone space + - first transform to local bone space - translate over the curve to the bbone mat space - transform with b_bone matrix - transform back into global space */ @@ -905,7 +905,7 @@ static void pchan_bone_deform(bPoseChannel *pchan, float weight, float *vec, Dua } void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm, - float (*vertexCos)[3], float (*defMats)[3][3], + float (*vertexCos)[3], float (*defMats)[3][3], int numVerts, int deformflag, float (*prevCos)[3], const char *defgrp_name) { @@ -983,9 +983,9 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm, if(use_dverts) { defnrToPC = MEM_callocN(sizeof(*defnrToPC) * numGroups, - "defnrToBone"); + "defnrToBone"); for(i = 0, dg = target->defbase.first; dg; - i++, dg = dg->next) { + i++, dg = dg->next) { defnrToPC[i] = get_pose_channel(armOb->pose, dg->name); /* exclude non-deforming bones */ if(defnrToPC[i]) { @@ -1070,10 +1070,10 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm, if(bone && bone->flag & BONE_MULT_VG_ENV) { weight *= distfactor_to_bone(co, bone->arm_head, - bone->arm_tail, - bone->rad_head, - bone->rad_tail, - bone->dist); + bone->arm_tail, + bone->rad_head, + bone->rad_tail, + bone->dist); } pchan_bone_deform(pchan, weight, vec, dq, smat, co, &contrib); } @@ -1083,7 +1083,7 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm, */ if(deformed == 0 && use_envelope) { for(pchan = armOb->pose->chanbase.first; pchan; - pchan = pchan->next) { + pchan = pchan->next) { if(!(pchan->bone->flag & BONE_NO_DEFORM)) contrib += dist_bone_deform(pchan, vec, dq, smat, co); } @@ -1091,7 +1091,7 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm, } else if(use_envelope) { for(pchan = armOb->pose->chanbase.first; pchan; - pchan = pchan->next) { + pchan = pchan->next) { if(!(pchan->bone->flag & BONE_NO_DEFORM)) contrib += dist_bone_deform(pchan, vec, dq, smat, co); } @@ -1293,10 +1293,10 @@ void pchan_apply_mat4(bPoseChannel *pchan, float mat[][4]) */ void armature_mat_pose_to_delta(float delta_mat[][4], float pose_mat[][4], float arm_mat[][4]) { - float imat[4][4]; + float imat[4][4]; - invert_m4_m4(imat, arm_mat); - mul_m4_m4m4(delta_mat, pose_mat, imat); + invert_m4_m4(imat, arm_mat); + mul_m4_m4m4(delta_mat, pose_mat, imat); } /* **************** Rotation Mode Conversions ****************************** */ @@ -1369,21 +1369,21 @@ void BKE_rotMode_change_values (float quat[4], float eul[3], float axis[3], floa *************************************************************************** */ /* Computes vector and roll based on a rotation. "mat" must - contain only a rotation, and no scaling. */ + contain only a rotation, and no scaling. */ void mat3_to_vec_roll(float mat[][3], float *vec, float *roll) { - if (vec) - copy_v3_v3(vec, mat[1]); + if (vec) + copy_v3_v3(vec, mat[1]); - if (roll) { - float vecmat[3][3], vecmatinv[3][3], rollmat[3][3]; + if (roll) { + float vecmat[3][3], vecmatinv[3][3], rollmat[3][3]; - vec_roll_to_mat3(mat[1], 0.0f, vecmat); - invert_m3_m3(vecmatinv, vecmat); - mul_m3_m3m3(rollmat, vecmatinv, mat); + vec_roll_to_mat3(mat[1], 0.0f, vecmat); + invert_m3_m3(vecmatinv, vecmat); + mul_m3_m3m3(rollmat, vecmatinv, mat); - *roll= (float)atan2(rollmat[2][0], rollmat[2][2]); - } + *roll= (float)atan2(rollmat[2][0], rollmat[2][2]); + } } /* Calculates the rest matrix of a bone based diff --git a/source/blender/blenkernel/intern/bmfont.c b/source/blender/blenkernel/intern/bmfont.c index 5f9b4f11850..5f6a4278549 100644 --- a/source/blender/blenkernel/intern/bmfont.c +++ b/source/blender/blenkernel/intern/bmfont.c @@ -179,7 +179,7 @@ void detectBitmapFont(ImBuf *ibuf) int i; if (ibuf != NULL) { - // bitmap must have an x size that is a power of two + // bitmap must have an x size that is a power of two if (is_power_of_two(ibuf->x)) { rect = (unsigned char *) (ibuf->rect + (ibuf->x * (ibuf->y - 1))); // printf ("starts with: %s %c %c %c %c\n", rect, rect[0], rect[1], rect[2], rect[3]); diff --git a/source/blender/blenkernel/intern/booleanops.c b/source/blender/blenkernel/intern/booleanops.c index 710bbfaf12b..3e43dfbb4d5 100644 --- a/source/blender/blenkernel/intern/booleanops.c +++ b/source/blender/blenkernel/intern/booleanops.c @@ -137,7 +137,7 @@ static void VertexIt_Construct(CSG_VertexIteratorDescriptor *output, DerivedMesh it->pos = 0; - // assign iterator function pointers. + // assign iterator function pointers. output->Step = VertexIt_Step; output->Fill = VertexIt_Fill; output->Done = VertexIt_Done; @@ -353,9 +353,9 @@ static DerivedMesh *ConvertCSGDescriptorsToDerivedMesh( // create a new DerivedMesh result = CDDM_new(vertex_it->num_elements, 0, face_it->num_elements); CustomData_merge(&dm1->faceData, &result->faceData, CD_MASK_DERIVEDMESH, - CD_DEFAULT, face_it->num_elements); + CD_DEFAULT, face_it->num_elements); CustomData_merge(&dm2->faceData, &result->faceData, CD_MASK_DERIVEDMESH, - CD_DEFAULT, face_it->num_elements); + CD_DEFAULT, face_it->num_elements); // step through the vertex iterators: for (i = 0; !vertex_it->Done(vertex_it->it); i++) { @@ -422,7 +422,7 @@ static DerivedMesh *ConvertCSGDescriptorsToDerivedMesh( mface->mat_nr = 0; InterpCSGFace(result, orig_dm, i, orig_index, csgface.vertex_number, - (orig_me == me2)? mapmat: NULL); + (orig_me == me2)? mapmat: NULL); test_index_face(mface, &result->faceData, i, csgface.vertex_number); } @@ -588,7 +588,7 @@ int NewBooleanMesh(Scene *scene, Base *base, Base *base_select, int int_op_type) } DerivedMesh *NewBooleanDerivedMesh(DerivedMesh *dm, struct Object *ob, DerivedMesh *dm_select, struct Object *ob_select, - int int_op_type) + int int_op_type) { return NewBooleanDerivedMesh_intern(dm, ob, dm_select, ob_select, int_op_type, NULL, NULL); } diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index 4aaf95e7037..4b8c3a2a0f4 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -678,7 +678,7 @@ static void brush_painter_refresh_cache(BrushPainter *painter, float *pos) short flt; if ((brush->size != cache->lastsize) || (brush->alpha != cache->lastalpha) - || (brush->jitter != cache->lastjitter)) { + || (brush->jitter != cache->lastjitter)) { if (cache->ibuf) { IMB_freeImBuf(cache->ibuf); cache->ibuf= NULL; @@ -938,7 +938,7 @@ unsigned int *brush_gen_texture_cache(Brush *br, int half_side) */ if(hasrgb & TEX_RGB) texres.tin = (0.35 * texres.tr + 0.45 * - texres.tg + 0.2 * texres.tb); + texres.tg + 0.2 * texres.tb); texres.tin = texres.tin * 255.0; ((char*)texcache)[(iy*side+ix)*4] = (char)texres.tin; diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c index 65fda678ce0..1b7257519b1 100644 --- a/source/blender/blenkernel/intern/bvhutils.c +++ b/source/blender/blenkernel/intern/bvhutils.c @@ -210,7 +210,7 @@ static float nearest_point_in_tri_surface(const float *v0,const float *v1,const } else // Region 0 { - // Minimum at interior lv + // Minimum at interior lv float invDet; if(fabs(Det) > FLT_EPSILON) invDet = 1.0f / Det; diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index 3a415d6564d..cca554b5880 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -178,7 +178,7 @@ static ListBase *cdDM_getFaceMap(Object *ob, DerivedMesh *dm) Mesh *me= ob->data; create_vert_face_map(&cddm->fmap, &cddm->fmap_mem, me->mface, - me->totvert, me->totface); + me->totvert, me->totface); } return cddm->fmap; @@ -193,7 +193,7 @@ static struct PBVH *cdDM_getPBVH(Object *ob, DerivedMesh *dm) cddm->pbvh = BLI_pbvh_new(); BLI_pbvh_build_mesh(cddm->pbvh, me->mface, me->mvert, - me->totface, me->totvert); + me->totface, me->totvert); } return cddm->pbvh; @@ -573,9 +573,9 @@ static void cdDM_drawFacesColored(DerivedMesh *dm, int useTwoSided, unsigned cha } static void cdDM_drawFacesTex_common(DerivedMesh *dm, - int (*drawParams)(MTFace *tface, MCol *mcol, int matnr), - int (*drawParamsMapped)(void *userData, int index), - void *userData) + int (*drawParams)(MTFace *tface, MCol *mcol, int matnr), + int (*drawParamsMapped)(void *userData, int index), + void *userData) { CDDerivedMesh *cddm = (CDDerivedMesh*) dm; MVert *mv = cddm->mvert; @@ -1272,10 +1272,10 @@ static void cdDM_drawMappedEdges(DerivedMesh *dm, int (*setDrawOptions)(void *us } static void cdDM_foreachMappedVert( - DerivedMesh *dm, - void (*func)(void *userData, int index, float *co, - float *no_f, short *no_s), - void *userData) + DerivedMesh *dm, + void (*func)(void *userData, int index, float *co, + float *no_f, short *no_s), + void *userData) { MVert *mv = CDDM_get_verts(dm); int i, orig, *index = DM_get_vert_data_layer(dm, CD_ORIGINDEX); @@ -1292,10 +1292,10 @@ static void cdDM_foreachMappedVert( } static void cdDM_foreachMappedEdge( - DerivedMesh *dm, - void (*func)(void *userData, int index, - float *v0co, float *v1co), - void *userData) + DerivedMesh *dm, + void (*func)(void *userData, int index, + float *v0co, float *v1co), + void *userData) { CDDerivedMesh *cddm = (CDDerivedMesh*) dm; MVert *mv = cddm->mvert; @@ -1314,10 +1314,10 @@ static void cdDM_foreachMappedEdge( } static void cdDM_foreachMappedFaceCenter( - DerivedMesh *dm, - void (*func)(void *userData, int index, - float *cent, float *no), - void *userData) + DerivedMesh *dm, + void (*func)(void *userData, int index, + float *cent, float *no), + void *userData) { CDDerivedMesh *cddm = (CDDerivedMesh*)dm; MVert *mv = cddm->mvert; @@ -1466,11 +1466,11 @@ DerivedMesh *CDDM_from_mesh(Mesh *mesh, Object *ob) alloctype= CD_REFERENCE; CustomData_merge(&mesh->vdata, &dm->vertData, mask, alloctype, - mesh->totvert); + mesh->totvert); CustomData_merge(&mesh->edata, &dm->edgeData, mask, alloctype, - mesh->totedge); + mesh->totedge); CustomData_merge(&mesh->fdata, &dm->faceData, mask, alloctype, - mesh->totface); + mesh->totface); cddm->mvert = CustomData_get_layer(&dm->vertData, CD_MVERT); cddm->medge = CustomData_get_layer(&dm->edgeData, CD_MEDGE); @@ -1482,8 +1482,8 @@ DerivedMesh *CDDM_from_mesh(Mesh *mesh, Object *ob) DerivedMesh *CDDM_from_editmesh(EditMesh *em, Mesh *me) { DerivedMesh *dm = CDDM_new(BLI_countlist(&em->verts), - BLI_countlist(&em->edges), - BLI_countlist(&em->faces)); + BLI_countlist(&em->edges), + BLI_countlist(&em->faces)); CDDerivedMesh *cddm = (CDDerivedMesh*)dm; EditVert *eve; EditEdge *eed; @@ -1496,11 +1496,11 @@ DerivedMesh *CDDM_from_editmesh(EditMesh *em, Mesh *me) dm->deformedOnly = 1; CustomData_merge(&em->vdata, &dm->vertData, CD_MASK_DERIVEDMESH, - CD_CALLOC, dm->numVertData); + CD_CALLOC, dm->numVertData); /* CustomData_merge(&em->edata, &dm->edgeData, CD_MASK_DERIVEDMESH, - CD_CALLOC, dm->numEdgeData); */ + CD_CALLOC, dm->numEdgeData); */ CustomData_merge(&em->fdata, &dm->faceData, CD_MASK_DERIVEDMESH, - CD_CALLOC, dm->numFaceData); + CD_CALLOC, dm->numFaceData); /* set eve->hash to vert index */ for(i = 0, eve = em->verts.first; eve; eve = eve->next, ++i) @@ -1519,7 +1519,7 @@ DerivedMesh *CDDM_from_editmesh(EditMesh *em, Mesh *me) index = dm->getVertDataArray(dm, CD_ORIGINDEX); for(i = 0, eve = em->verts.first; i < dm->numVertData; - i++, eve = eve->next, index++) { + i++, eve = eve->next, index++) { MVert *mv = &mvert[i]; VECCOPY(mv->co, eve->co); @@ -1539,7 +1539,7 @@ DerivedMesh *CDDM_from_editmesh(EditMesh *em, Mesh *me) index = dm->getEdgeDataArray(dm, CD_ORIGINDEX); for(i = 0, eed = em->edges.first; i < dm->numEdgeData; - i++, eed = eed->next, index++) { + i++, eed = eed->next, index++) { MEdge *med = &medge[i]; med->v1 = eed->v1->tmp.l; @@ -1559,7 +1559,7 @@ DerivedMesh *CDDM_from_editmesh(EditMesh *em, Mesh *me) index = dm->getFaceDataArray(dm, CD_ORIGINDEX); for(i = 0, efa = em->faces.first; i < dm->numFaceData; - i++, efa = efa->next, index++) { + i++, efa = efa->next, index++) { MFace *mf = &mface[i]; mf->v1 = efa->v1->tmp.l; @@ -1648,7 +1648,7 @@ DerivedMesh *CDDM_copy(DerivedMesh *source) } DerivedMesh *CDDM_from_template(DerivedMesh *source, - int numVerts, int numEdges, int numFaces) + int numVerts, int numEdges, int numFaces) { CDDerivedMesh *cddm = cdDM_create("CDDM_from_template dest"); DerivedMesh *dm = &cddm->dm; @@ -1718,7 +1718,7 @@ void CDDM_calc_normals(DerivedMesh *dm) if(numVerts == 0) return; temp_nors = MEM_callocN(numVerts * sizeof(*temp_nors), - "CDDM_calc_normals temp_nors"); + "CDDM_calc_normals temp_nors"); /* we don't want to overwrite any referenced layers */ mv = CustomData_duplicate_referenced_layer(&dm->vertData, CD_MVERT); @@ -1728,7 +1728,7 @@ void CDDM_calc_normals(DerivedMesh *dm) face_nors = CustomData_get_layer(&dm->faceData, CD_NORMAL); if(!face_nors) face_nors = CustomData_add_layer(&dm->faceData, CD_NORMAL, CD_CALLOC, - NULL, dm->numFaceData); + NULL, dm->numFaceData); /* calculate face normals and add to vertex normals */ mf = CDDM_get_faces(dm); @@ -1802,7 +1802,7 @@ void CDDM_calc_edges(DerivedMesh *dm) med = CustomData_get_layer(&edgeData, CD_MEDGE); index = CustomData_get_layer(&edgeData, CD_ORIGINDEX); for(i = 0; !BLI_edgehashIterator_isDone(ehi); - BLI_edgehashIterator_step(ehi), ++i, ++med, ++index) { + BLI_edgehashIterator_step(ehi), ++i, ++med, ++index) { BLI_edgehashIterator_getKey(ehi, (int*)&med->v1, (int*)&med->v2); med->flag = ME_EDGEDRAW|ME_EDGERENDER; diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index cf41392e24a..33fe6212cd2 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -75,7 +75,7 @@ double tval() static CM_SOLVER_DEF solvers [] = { { "Implicit", CM_IMPLICIT, implicit_init, implicit_solver, implicit_free }, - // { "Implicit C++", CM_IMPLICITCPP, implicitcpp_init, implicitcpp_solver, implicitcpp_free }, + // { "Implicit C++", CM_IMPLICITCPP, implicitcpp_init, implicitcpp_solver, implicitcpp_free }, }; /* ********** cloth engine ******* */ @@ -745,10 +745,10 @@ static void cloth_apply_vgroup ( ClothModifierData *clmd, DerivedMesh *dm ) verts = clothObj->verts; if (((clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_SCALING ) || - (clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL )) && - ((clmd->sim_parms->vgroup_mass>0) || - (clmd->sim_parms->vgroup_struct>0)|| - (clmd->sim_parms->vgroup_bend>0))) + (clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL )) && + ((clmd->sim_parms->vgroup_mass>0) || + (clmd->sim_parms->vgroup_struct>0)|| + (clmd->sim_parms->vgroup_bend>0))) { for ( i = 0; i < numverts; i++, verts++ ) { @@ -770,7 +770,7 @@ static void cloth_apply_vgroup ( ClothModifierData *clmd, DerivedMesh *dm ) verts->goal = ( float ) pow ( verts->goal , 4.0f ); if ( verts->goal >=SOFTGOALSNAP ) { - verts->flags |= CLOTH_VERT_FLAG_PINNED; + verts->flags |= CLOTH_VERT_FLAG_PINNED; } } diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index 6410d02603d..4c0c10c127a 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -754,10 +754,10 @@ void colorcorrection_do_ibuf(ImBuf *ibuf, const char *profile) cmsErrorAction(LCMS_ERROR_SHOW); hTransform = cmsCreateProofingTransform(imageProfile, TYPE_RGBA_8, imageProfile, TYPE_RGBA_8, - proofingProfile, - INTENT_ABSOLUTE_COLORIMETRIC, - INTENT_ABSOLUTE_COLORIMETRIC, - cmsFLAGS_SOFTPROOFING); + proofingProfile, + INTENT_ABSOLUTE_COLORIMETRIC, + INTENT_ABSOLUTE_COLORIMETRIC, + cmsFLAGS_SOFTPROOFING); cmsDoTransform(hTransform, ibuf->rect, ibuf->crect, ibuf->x * ibuf->y); diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 78f1bb4e469..3ab5e9442b4 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -3054,7 +3054,7 @@ static void rbj_new_data (void *cdata) bRigidBodyJointConstraint *data= (bRigidBodyJointConstraint *)cdata; // removed code which set target of this constraint - data->type=1; + data->type=1; } static void rbj_id_looper (bConstraint *con, ConstraintIDFunc func, void *userdata) diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 06921a0b9af..4fed662b6b4 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -569,7 +569,7 @@ static void calcknots(float *knots, short aantal, short order, short type) float k; int a, t; - t = aantal+order; + t = aantal+order; if(type==0) { for(a=0;a<t;a++) { @@ -624,7 +624,7 @@ static void makecyclicknots(float *knots, short pnts, short order) } b= order; - c=pnts + order + order2; + c=pnts + order + order2; for(a=pnts+order2; a<c; a++) { knots[a]= knots[a-1]+ (knots[b]-knots[b-1]); b--; @@ -671,14 +671,14 @@ static void basisNurb(float t, short order, short pnts, float *knots, float *bas int i, i1 = 0, i2 = 0 ,j, orderpluspnts, opp2, o2; orderpluspnts= order+pnts; - opp2 = orderpluspnts-1; + opp2 = orderpluspnts-1; /* this is for float inaccuracy */ if(t < knots[0]) t= knots[0]; else if(t > knots[opp2]) t= knots[opp2]; /* this part is order '1' */ - o2 = order + 1; + o2 = order + 1; for(i=0;i<opp2;i++) { if(knots[i]!=knots[i+1] && t>= knots[i] && t<=knots[i+1]) { basis[i]= 1.0; @@ -1002,18 +1002,18 @@ void forward_diff_bezier(float q0, float q1, float q2, float q3, float *p, int i f*= it; rt3= (q3-q0+3.0f*(q1-q2))/f; - q0= rt0; + q0= rt0; q1= rt1+rt2+rt3; q2= 2*rt2+6*rt3; q3= 6*rt3; - for(a=0; a<=it; a++) { + for(a=0; a<=it; a++) { *p= q0; p = (float *)(((char *)p)+stride); q0+= q1; - q1+= q2; - q2+= q3; - } + q1+= q2; + q2+= q3; + } } static void forward_diff_bezier_cotangent(float *p0, float *p1, float *p2, float *p3, float *p, int it, int stride) @@ -1023,7 +1023,7 @@ static void forward_diff_bezier_cotangent(float *p0, float *p1, float *p2, float * * This could also be optimized like forward_diff_bezier */ int a; - for(a=0; a<=it; a++) { + for(a=0; a<=it; a++) { float t = (float)a / (float)it; int i; @@ -1032,7 +1032,7 @@ static void forward_diff_bezier_cotangent(float *p0, float *p1, float *p2, float } normalize_v3(p); p = (float *)(((char *)p)+stride); - } + } } /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ @@ -1061,7 +1061,7 @@ float *make_orco_surf(Object *ob) sizev = nu->pntsv*nu->resolv; if (nu->flagu & CU_NURB_CYCLIC) sizeu++; if (nu->flagv & CU_NURB_CYCLIC) sizev++; - if(nu->pntsv>1) tot+= sizeu * sizev; + if(nu->pntsv>1) tot+= sizeu * sizev; nu= nu->next; } @@ -1464,7 +1464,7 @@ static short bevelinside(BevList *bl1,BevList *bl2) /* there's a transition, calc intersection point */ mode= cu_isectLL(prevbevp->vec, bevp->vec, hvec1, hvec2, 0, 1, &lab, &mu, vec); /* if lab==0.0 or lab==1.0 then the edge intersects exactly a transition - only allow for one situation: we choose lab= 1.0 + only allow for one situation: we choose lab= 1.0 */ if(mode>=0 && lab!=0.0) { if(vec[0]<hvec1[0]) links++; @@ -2578,13 +2578,13 @@ void calchandlesNurb(Nurb *nu) /* first, if needed, set handle flags */ void testhandlesNurb(Nurb *nu) { - /* use when something has changed with handles. - it treats all BezTriples with the following rules: - PHASE 1: do types have to be altered? - Auto handles: become aligned when selection status is NOT(000 || 111) - Vector handles: become 'nothing' when (one half selected AND other not) - PHASE 2: recalculate handles - */ + /* use when something has changed with handles. + it treats all BezTriples with the following rules: + PHASE 1: do types have to be altered? + Auto handles: become aligned when selection status is NOT(000 || 111) + Vector handles: become 'nothing' when (one half selected AND other not) + PHASE 2: recalculate handles + */ BezTriple *bezt; short flag, a; diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index a0eef4d666e..a755170aae6 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -82,27 +82,27 @@ typedef struct LayerTypeInfo { * count gives the number of elements in sources */ void (*interp)(void **sources, float *weights, float *sub_weights, - int count, void *dest); + int count, void *dest); - /* a function to swap the data in corners of the element */ + /* a function to swap the data in corners of the element */ void (*swap)(void *data, int *corner_indices); - /* a function to set a layer's data to default values. if NULL, the + /* a function to set a layer's data to default values. if NULL, the default is assumed to be all zeros */ void (*set_default)(void *data, int count); - /* a function to read data from a cdf file */ + /* a function to read data from a cdf file */ int (*read)(CDataFile *cdf, void *data, int count); - /* a function to write data to a cdf file */ + /* a function to write data to a cdf file */ int (*write)(CDataFile *cdf, void *data, int count); - /* a function to determine file size */ + /* a function to determine file size */ size_t (*filesize)(CDataFile *cdf, void *data, int count); } LayerTypeInfo; static void layerCopy_mdeformvert(const void *source, void *dest, - int count) + int count) { int i, size = sizeof(MDeformVert); @@ -144,7 +144,7 @@ static void linklist_free_simple(void *link) } static void layerInterp_mdeformvert(void **sources, float *weights, - float *sub_weights, int count, void *dest) + float *sub_weights, int count, void *dest) { MDeformVert *dvert = dest; LinkNode *dest_dw = NULL; /* a list of lists of MDeformWeight pointers */ @@ -174,7 +174,7 @@ static void layerInterp_mdeformvert(void **sources, float *weights, /* if this def_nr is not in the list, add it */ if(!node) { MDeformWeight *tmp_dw = MEM_callocN(sizeof(*tmp_dw), - "layerInterp_mdeformvert tmp_dw"); + "layerInterp_mdeformvert tmp_dw"); tmp_dw->def_nr = dw->def_nr; tmp_dw->weight = dw->weight * interp_weight; BLI_linklist_prepend(&dest_dw, tmp_dw); @@ -188,7 +188,7 @@ static void layerInterp_mdeformvert(void **sources, float *weights, if(totweight) { dvert->dw = MEM_callocN(sizeof(*dvert->dw) * totweight, - "layerInterp_mdeformvert dvert->dw"); + "layerInterp_mdeformvert dvert->dw"); dvert->totweight = totweight; for(i = 0, node = dest_dw; node; node = node->next, ++i) @@ -202,7 +202,7 @@ static void layerInterp_mdeformvert(void **sources, float *weights, static void layerInterp_msticky(void **sources, float *weights, - float *sub_weights, int count, void *dest) + float *sub_weights, int count, void *dest) { float co[2], w; MSticky *mst; @@ -234,7 +234,7 @@ static void layerCopy_tface(const void *source, void *dest, int count) } static void layerInterp_tface(void **sources, float *weights, - float *sub_weights, int count, void *dest) + float *sub_weights, int count, void *dest) { MTFace *tf = dest; int i, j, k; @@ -278,9 +278,9 @@ static void layerSwap_tface(void *data, int *corner_indices) MTFace *tf = data; float uv[4][2]; static const short pin_flags[4] = - { TF_PIN1, TF_PIN2, TF_PIN3, TF_PIN4 }; + { TF_PIN1, TF_PIN2, TF_PIN3, TF_PIN4 }; static const char sel_flags[4] = - { TF_SEL1, TF_SEL2, TF_SEL3, TF_SEL4 }; + { TF_SEL1, TF_SEL2, TF_SEL3, TF_SEL4 }; short unwrap = tf->unwrap & ~(TF_PIN1 | TF_PIN2 | TF_PIN3 | TF_PIN4); char flag = tf->flag & ~(TF_SEL1 | TF_SEL2 | TF_SEL3 | TF_SEL4); int j; @@ -310,7 +310,7 @@ static void layerSwap_tface(void *data, int *corner_indices) static void layerDefault_tface(void *data, int count) { static MTFace default_tf = {{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, NULL, - 0, 0, TF_DYNAMIC, 0, 0}; + 0, 0, TF_DYNAMIC, 0, 0}; MTFace *tf = (MTFace*)data; int i; @@ -466,7 +466,7 @@ static void layerSwap_mdisps(void *data, int *ci) } static void layerInterp_mdisps(void **sources, float *weights, float *sub_weights, - int count, void *dest) + int count, void *dest) { // XXX #if 0 @@ -680,7 +680,7 @@ static void layerInterp_mloopuv(void **sources, float *weights, } static void layerInterp_mcol(void **sources, float *weights, - float *sub_weights, int count, void *dest) + float *sub_weights, int count, void *dest) { MCol *mc = dest; int i, j, k; @@ -843,7 +843,7 @@ static CustomDataLayer *customData_add_layer__internal(CustomData *data, int type, int alloctype, void *layerdata, int totelem, const char *name); void CustomData_merge(const struct CustomData *source, struct CustomData *dest, - CustomDataMask mask, int alloctype, int totelem) + CustomDataMask mask, int alloctype, int totelem) { const LayerTypeInfo *typeInfo; CustomDataLayer *layer, *newlayer; @@ -887,7 +887,7 @@ void CustomData_merge(const struct CustomData *source, struct CustomData *dest, } void CustomData_copy(const struct CustomData *source, struct CustomData *dest, - CustomDataMask mask, int alloctype, int totelem) + CustomDataMask mask, int alloctype, int totelem) { memset(dest, 0, sizeof(*dest)); @@ -1142,7 +1142,7 @@ void CustomData_set_layer_flag(struct CustomData *data, int type, int flag) static int customData_resize(CustomData *data, int amount) { CustomDataLayer *tmp = MEM_callocN(sizeof(*tmp)*(data->maxlayer + amount), - "CustomData->layers"); + "CustomData->layers"); if(!tmp) return 0; data->maxlayer += amount; @@ -1230,13 +1230,13 @@ static CustomDataLayer *customData_add_layer__internal(CustomData *data, } void *CustomData_add_layer(CustomData *data, int type, int alloctype, - void *layerdata, int totelem) + void *layerdata, int totelem) { CustomDataLayer *layer; const LayerTypeInfo *typeInfo= layerType_getInfo(type); layer = customData_add_layer__internal(data, type, alloctype, layerdata, - totelem, typeInfo->defaultname); + totelem, typeInfo->defaultname); if(layer) return layer->data; @@ -1246,12 +1246,12 @@ void *CustomData_add_layer(CustomData *data, int type, int alloctype, /*same as above but accepts a name*/ void *CustomData_add_layer_named(CustomData *data, int type, int alloctype, - void *layerdata, int totelem, char *name) + void *layerdata, int totelem, char *name) { CustomDataLayer *layer; layer = customData_add_layer__internal(data, type, alloctype, layerdata, - totelem, name); + totelem, name); if(layer) return layer->data; @@ -1345,7 +1345,7 @@ void *CustomData_duplicate_referenced_layer(struct CustomData *data, int type) } void *CustomData_duplicate_referenced_layer_named(struct CustomData *data, - int type, char *name) + int type, char *name) { CustomDataLayer *layer; int layer_index; @@ -1390,7 +1390,7 @@ void CustomData_free_temporary(CustomData *data, int totelem) } void CustomData_set_only_copy(const struct CustomData *data, - CustomDataMask mask) + CustomDataMask mask) { int i; @@ -1400,7 +1400,7 @@ void CustomData_set_only_copy(const struct CustomData *data, } void CustomData_copy_data(const CustomData *source, CustomData *dest, - int source_index, int dest_index, int count) + int source_index, int dest_index, int count) { const LayerTypeInfo *typeInfo; int src_i, dest_i; @@ -1415,7 +1415,7 @@ void CustomData_copy_data(const CustomData *source, CustomData *dest, * (this should work because layers are ordered by type) */ while(dest_i < dest->totlayer - && dest->layers[dest_i].type < source->layers[src_i].type) + && dest->layers[dest_i].type < source->layers[src_i].type) ++dest_i; /* if there are no more dest layers, we're done */ @@ -1433,12 +1433,12 @@ void CustomData_copy_data(const CustomData *source, CustomData *dest, if(typeInfo->copy) typeInfo->copy(src_data + src_offset, - dest_data + dest_offset, - count); + dest_data + dest_offset, + count); else memcpy(dest_data + dest_offset, - src_data + src_offset, - count * typeInfo->size); + src_data + src_offset, + count * typeInfo->size); /* if there are multiple source & dest layers of the same type, * we don't want to copy all source layers to the same dest, so @@ -1462,7 +1462,7 @@ void CustomData_free_elem(CustomData *data, int index, int count) int offset = typeInfo->size * index; typeInfo->free((char *)data->layers[i].data + offset, - count, typeInfo->size); + count, typeInfo->size); } } } @@ -1471,8 +1471,8 @@ void CustomData_free_elem(CustomData *data, int index, int count) #define SOURCE_BUF_SIZE 100 void CustomData_interp(const CustomData *source, CustomData *dest, - int *src_indices, float *weights, float *sub_weights, - int count, int dest_index) + int *src_indices, float *weights, float *sub_weights, + int count, int dest_index) { int src_i, dest_i; int dest_offset; @@ -1485,7 +1485,7 @@ void CustomData_interp(const CustomData *source, CustomData *dest, */ if(count > SOURCE_BUF_SIZE) sources = MEM_callocN(sizeof(*sources) * count, - "CustomData_interp sources"); + "CustomData_interp sources"); /* interpolates a layer at a time */ dest_i = 0; @@ -1497,7 +1497,7 @@ void CustomData_interp(const CustomData *source, CustomData *dest, * (this should work because layers are ordered by type) */ while(dest_i < dest->totlayer - && dest->layers[dest_i].type < source->layers[src_i].type) + && dest->layers[dest_i].type < source->layers[src_i].type) ++dest_i; /* if there are no more dest layers, we're done */ @@ -1577,7 +1577,7 @@ void *CustomData_get_layer_n(const CustomData *data, int type, int n) } void *CustomData_get_layer_named(const struct CustomData *data, int type, - char *name) + char *name) { int layer_index = CustomData_get_named_layer_index(data, type, name); if(layer_index < 0) return NULL; @@ -1625,21 +1625,21 @@ void CustomData_set(const CustomData *data, int index, int type, void *source) void CustomData_em_free_block(CustomData *data, void **block) { - const LayerTypeInfo *typeInfo; - int i; + const LayerTypeInfo *typeInfo; + int i; if(!*block) return; - for(i = 0; i < data->totlayer; ++i) { - if(!(data->layers[i].flag & CD_FLAG_NOFREE)) { - typeInfo = layerType_getInfo(data->layers[i].type); + for(i = 0; i < data->totlayer; ++i) { + if(!(data->layers[i].flag & CD_FLAG_NOFREE)) { + typeInfo = layerType_getInfo(data->layers[i].type); - if(typeInfo->free) { + if(typeInfo->free) { int offset = data->layers[i].offset; - typeInfo->free((char*)*block + offset, 1, typeInfo->size); + typeInfo->free((char*)*block + offset, 1, typeInfo->size); } - } - } + } + } MEM_freeN(*block); *block = NULL; @@ -1659,7 +1659,7 @@ static void CustomData_em_alloc_block(CustomData *data, void **block) } void CustomData_em_copy_data(const CustomData *source, CustomData *dest, - void *src_block, void **dest_block) + void *src_block, void **dest_block) { const LayerTypeInfo *typeInfo; int dest_i, src_i; @@ -1675,7 +1675,7 @@ void CustomData_em_copy_data(const CustomData *source, CustomData *dest, * (this should work because layers are ordered by type) */ while(dest_i < dest->totlayer - && dest->layers[dest_i].type < source->layers[src_i].type) + && dest->layers[dest_i].type < source->layers[src_i].type) ++dest_i; /* if there are no more dest layers, we're done */ @@ -1752,7 +1752,7 @@ void CustomData_em_set_n(CustomData *data, void *block, int type, int n, void *s } void CustomData_em_interp(CustomData *data, void **src_blocks, float *weights, - float *sub_weights, int count, void *dest_block) + float *sub_weights, int count, void *dest_block) { int i, j; void *source_buf[SOURCE_BUF_SIZE]; @@ -1763,7 +1763,7 @@ void CustomData_em_interp(CustomData *data, void **src_blocks, float *weights, */ if(count > SOURCE_BUF_SIZE) sources = MEM_callocN(sizeof(*sources) * count, - "CustomData_interp sources"); + "CustomData_interp sources"); /* interpolates a layer at a time */ for(i = 0; i < data->totlayer; ++i) { @@ -1775,7 +1775,7 @@ void CustomData_em_interp(CustomData *data, void **src_blocks, float *weights, sources[j] = (char *)src_blocks[j] + layer->offset; typeInfo->interp(sources, weights, sub_weights, count, - (char *)dest_block + layer->offset); + (char *)dest_block + layer->offset); } } @@ -1801,7 +1801,7 @@ void CustomData_em_set_default(CustomData *data, void **block) } void CustomData_to_em_block(const CustomData *source, CustomData *dest, - int src_index, void **dest_block) + int src_index, void **dest_block) { const LayerTypeInfo *typeInfo; int dest_i, src_i, src_offset; @@ -1817,7 +1817,7 @@ void CustomData_to_em_block(const CustomData *source, CustomData *dest, * (this should work because layers are ordered by type) */ while(dest_i < dest->totlayer - && dest->layers[dest_i].type < source->layers[src_i].type) + && dest->layers[dest_i].type < source->layers[src_i].type) ++dest_i; /* if there are no more dest layers, we're done */ @@ -1847,7 +1847,7 @@ void CustomData_to_em_block(const CustomData *source, CustomData *dest, } void CustomData_from_em_block(const CustomData *source, CustomData *dest, - void *src_block, int dest_index) + void *src_block, int dest_index) { const LayerTypeInfo *typeInfo; int dest_i, src_i, dest_offset; @@ -1860,7 +1860,7 @@ void CustomData_from_em_block(const CustomData *source, CustomData *dest, * (this should work because layers are ordered by type) */ while(dest_i < dest->totlayer - && dest->layers[dest_i].type < source->layers[src_i].type) + && dest->layers[dest_i].type < source->layers[src_i].type) ++dest_i; /* if there are no more dest layers, we're done */ @@ -1923,20 +1923,20 @@ void CustomData_bmesh_init_pool(CustomData *data, int allocsize){ void CustomData_bmesh_free_block(CustomData *data, void **block) { - const LayerTypeInfo *typeInfo; - int i; + const LayerTypeInfo *typeInfo; + int i; if(!*block) return; - for(i = 0; i < data->totlayer; ++i) { - if(!(data->layers[i].flag & CD_FLAG_NOFREE)) { - typeInfo = layerType_getInfo(data->layers[i].type); + for(i = 0; i < data->totlayer; ++i) { + if(!(data->layers[i].flag & CD_FLAG_NOFREE)) { + typeInfo = layerType_getInfo(data->layers[i].type); - if(typeInfo->free) { + if(typeInfo->free) { int offset = data->layers[i].offset; typeInfo->free((char*)*block + offset, 1, typeInfo->size); } - } - } + } + } BLI_mempool_free(data->pool, *block); *block = NULL; @@ -1955,7 +1955,7 @@ static void CustomData_bmesh_alloc_block(CustomData *data, void **block) } void CustomData_bmesh_copy_data(const CustomData *source, CustomData *dest, - void *src_block, void **dest_block) + void *src_block, void **dest_block) { const LayerTypeInfo *typeInfo; int dest_i, src_i; @@ -1971,7 +1971,7 @@ void CustomData_bmesh_copy_data(const CustomData *source, CustomData *dest, * (this should work because layers are ordered by type) */ while(dest_i < dest->totlayer - && dest->layers[dest_i].type < source->layers[src_i].type) + && dest->layers[dest_i].type < source->layers[src_i].type) ++dest_i; /* if there are no more dest layers, we're done */ @@ -2049,7 +2049,7 @@ void CustomData_bmesh_set_n(CustomData *data, void *block, int type, int n, void } void CustomData_bmesh_interp(CustomData *data, void **src_blocks, float *weights, - float *sub_weights, int count, void *dest_block) + float *sub_weights, int count, void *dest_block) { int i, j; void *source_buf[SOURCE_BUF_SIZE]; @@ -2060,7 +2060,7 @@ void CustomData_bmesh_interp(CustomData *data, void **src_blocks, float *weights */ if(count > SOURCE_BUF_SIZE) sources = MEM_callocN(sizeof(*sources) * count, - "CustomData_interp sources"); + "CustomData_interp sources"); /* interpolates a layer at a time */ for(i = 0; i < data->totlayer; ++i) { @@ -2071,7 +2071,7 @@ void CustomData_bmesh_interp(CustomData *data, void **src_blocks, float *weights sources[j] = (char *)src_blocks[j] + layer->offset; typeInfo->interp(sources, weights, sub_weights, count, - (char *)dest_block + layer->offset); + (char *)dest_block + layer->offset); } } @@ -2097,7 +2097,7 @@ void CustomData_bmesh_set_default(CustomData *data, void **block) } void CustomData_to_bmesh_block(const CustomData *source, CustomData *dest, - int src_index, void **dest_block) + int src_index, void **dest_block) { const LayerTypeInfo *typeInfo; int dest_i, src_i, src_offset; @@ -2113,7 +2113,7 @@ void CustomData_to_bmesh_block(const CustomData *source, CustomData *dest, * (this should work because layers are ordered by type) */ while(dest_i < dest->totlayer - && dest->layers[dest_i].type < source->layers[src_i].type) + && dest->layers[dest_i].type < source->layers[src_i].type) ++dest_i; /* if there are no more dest layers, we're done */ @@ -2143,7 +2143,7 @@ void CustomData_to_bmesh_block(const CustomData *source, CustomData *dest, } void CustomData_from_bmesh_block(const CustomData *source, CustomData *dest, - void *src_block, int dest_index) + void *src_block, int dest_index) { const LayerTypeInfo *typeInfo; int dest_i, src_i, dest_offset; @@ -2156,7 +2156,7 @@ void CustomData_from_bmesh_block(const CustomData *source, CustomData *dest, * (this should work because layers are ordered by type) */ while(dest_i < dest->totlayer - && dest->layers[dest_i].type < source->layers[src_i].type) + && dest->layers[dest_i].type < source->layers[src_i].type) ++dest_i; /* if there are no more dest layers, we're done */ @@ -2296,8 +2296,8 @@ int CustomData_verify_versions(struct CustomData *data, int index) } if (!keeplayer) { - for (i=index+1; i < data->totlayer; ++i) - data->layers[i-1] = data->layers[i]; + for (i=index+1; i < data->totlayer; ++i) + data->layers[i-1] = data->layers[i]; data->totlayer--; } diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 397a0526160..4e0270315ad 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -951,7 +951,7 @@ static void dag_node_print_dependency_cycle(DagForest *dag, DagNode *startnode, { DagNode *node; - for(node = dag->DagNode.first; node; node= node->next) + for(node = dag->DagNode.first; node; node= node->next) node->color= DAG_WHITE; printf(" %s depends on %s through %s.\n", dag_node_name(endnode), dag_node_name(startnode), name); @@ -1533,7 +1533,7 @@ int is_acyclic( DagForest *dag) { void set_node_xy(DagNode *node, float x, float y) { - node->x = x; + node->x = x; node->y = y; } diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index ed7d11872c1..8619b6ec87d 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -490,7 +490,7 @@ static void mesh_create_shadedColors(Render *re, Object *ob, int onlyForMesh, un float *orco, *vnors, *nors, imat[3][3], mat[4][4], vec[3]; int a, i, need_orco, totface, totvert; CustomDataMask dataMask = CD_MASK_BAREMESH | CD_MASK_MCOL - | CD_MASK_MTFACE | CD_MASK_NORMAL; + | CD_MASK_MTFACE | CD_MASK_NORMAL; init_fastshade_for_ob(re, ob, &need_orco, mat, imat); @@ -1784,9 +1784,9 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba if(cu->flag & CU_PATH) calc_curvepath(ob); - if (!forRender) { - tex_space_curve(cu); - } + if (!forRender) { + tex_space_curve(cu); + } if(!forOrco) curve_calc_modifiers_post(scene, ob, dispbase, derivedFinal, forRender, originalVerts, deformedVerts); diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index 14375c23d57..66e7f805f50 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -955,15 +955,15 @@ void do_physical_effector(EffectorCache *eff, EffectorData *efd, EffectedPoint * } /* -------- pdDoEffectors() -------- - generic force/speed system, now used for particles and softbodies - scene = scene where it runs in, for time and stuff + generic force/speed system, now used for particles and softbodies + scene = scene where it runs in, for time and stuff lb = listbase with objects that take part in effecting opco = global coord, as input - force = force accumulator - speed = actual current speed which can be altered + force = force accumulator + speed = actual current speed which can be altered cur_time = "external" time in frames, is constant for static particles loc_time = "local" time in frames, range <0-1> for the lifetime of particle - par_layer = layer the caller is in + par_layer = layer the caller is in flags = only used for softbody wind now guide = old speed of particle diff --git a/source/blender/blenkernel/intern/exotic.c b/source/blender/blenkernel/intern/exotic.c index 772a589f520..91c5a633ff6 100644 --- a/source/blender/blenkernel/intern/exotic.c +++ b/source/blender/blenkernel/intern/exotic.c @@ -129,19 +129,19 @@ static int is_stl(char *str) #define READSTLVERT { \ if (fread(mvert->co, sizeof(float), 3, fpSTL) != 3) { \ - char error_msg[255]; \ - MEM_freeN(vertdata); \ - MEM_freeN(facedata); \ - fclose(fpSTL); \ - sprintf(error_msg, "Problems reading face %d!", i); \ - return; \ + char error_msg[255]; \ + MEM_freeN(vertdata); \ + MEM_freeN(facedata); \ + fclose(fpSTL); \ + sprintf(error_msg, "Problems reading face %d!", i); \ + return; \ } \ else { \ - if (ENDIAN_ORDER==B_ENDIAN) { \ - SWITCH_INT(mvert->co[0]); \ - SWITCH_INT(mvert->co[1]); \ - SWITCH_INT(mvert->co[2]); \ - } \ + if (ENDIAN_ORDER==B_ENDIAN) { \ + SWITCH_INT(mvert->co[0]); \ + SWITCH_INT(mvert->co[1]); \ + SWITCH_INT(mvert->co[2]); \ + } \ } \ } @@ -267,9 +267,9 @@ static void read_stl_mesh_binary(Scene *scene, char *str) me->totvert = totvert; me->totface = totface; me->mvert = CustomData_add_layer(&me->vdata, CD_MVERT, CD_ASSIGN, - vertdata, totvert); + vertdata, totvert); me->mface = CustomData_add_layer(&me->fdata, CD_MFACE, CD_ASSIGN, - facedata, totface); + facedata, totface); mesh_add_normals_flags(me); make_edges(me, 0); @@ -410,9 +410,9 @@ static void read_stl_mesh_ascii(Scene *scene, char *str) me->totface = totface; me->totvert = totvert; me->mvert = CustomData_add_layer(&me->vdata, CD_MVERT, CD_CALLOC, - NULL, totvert); + NULL, totvert); me->mface = CustomData_add_layer(&me->fdata, CD_MFACE, CD_CALLOC, - NULL, totface); + NULL, totface); /* Copy vert coords and create topology */ mvert = me->mvert; @@ -862,7 +862,7 @@ static void read_inventor(Scene *scene, char *str, struct ListBase *listb) /* count the nr of lines */ tot= 0; index= iv->data[0]; - lll = iv->datalen[0]-1; + lll = iv->datalen[0]-1; for(a=0; a<lll; a++) { if(index[0]!= -1 && index[1]!= -1) tot++; index++; @@ -1009,7 +1009,7 @@ static void read_inventor(Scene *scene, char *str, struct ListBase *listb) } /* indices */ - lll = index[0] - 2; + lll = index[0] - 2; for(b=0; b<lll; b++) { idata[0]= first; idata[1]= first+1; @@ -1045,7 +1045,7 @@ static void read_inventor(Scene *scene, char *str, struct ListBase *listb) /* count triangles */ face= 0; index= iv->data[0]; - lll = iv->datalen[0]-2; + lll = iv->datalen[0]-2; for(a=0; a<lll; a++) { if(index[0]!= -1 && index[1]!= -1 && index[2]!= -1) face++; index++; @@ -1123,7 +1123,7 @@ static void read_inventor(Scene *scene, char *str, struct ListBase *listb) /* count triangles */ face= 0; index= iv->data[0]; - lll=iv->datalen[0]-2; + lll=iv->datalen[0]-2; for(a=0; a<lll; a++) { if(index[0]!= -1 && index[1]!= -1 && index[2]!= -1) face++; index++; @@ -1155,7 +1155,7 @@ static void read_inventor(Scene *scene, char *str, struct ListBase *listb) index= iv->data[0]; idata= dl->index; - lll=iv->datalen[0]-2; + lll=iv->datalen[0]-2; for(a=lll; a>0; a--) { if(index[0]!= -1 && index[1]!= -1 && index[2]!= -1) { @@ -1476,9 +1476,9 @@ static void displist_to_mesh(Scene *scene, DispList *dlfirst) me->totvert= totvert; me->totface= totface; me->mvert= CustomData_add_layer(&me->vdata, CD_MVERT, CD_CALLOC, - NULL, me->totvert); + NULL, me->totvert); me->mface= CustomData_add_layer(&me->fdata, CD_MFACE, CD_CALLOC, - NULL, me->totface); + NULL, me->totface); maxvertidx= totvert-1; mvert= me->mvert; @@ -1956,8 +1956,8 @@ void write_stl(Scene *scene, char *str) fseek(fpSTL, 80, SEEK_SET); if (ENDIAN_ORDER==B_ENDIAN) { - SWITCH_INT(numfacets); - } + SWITCH_INT(numfacets); + } fwrite(&numfacets, 4*sizeof(char), 1, fpSTL); fclose(fpSTL); @@ -2574,13 +2574,13 @@ void write_dxf(struct Scene *scene, char *str) /* The header part of the DXF */ write_group(0, "SECTION"); - write_group(2, "HEADER"); + write_group(2, "HEADER"); write_group(0, "ENDSEC"); /* The blocks part of the DXF */ write_group(0, "SECTION"); - write_group(2, "BLOCKS"); + write_group(2, "BLOCKS"); /* only write meshes we're using in this scene */ @@ -2604,7 +2604,7 @@ void write_dxf(struct Scene *scene, char *str) /* The entities part of the DXF */ write_group(0, "SECTION"); - write_group(2, "ENTITIES"); + write_group(2, "ENTITIES"); /* Write all the mesh objects */ base= scene->base.first; @@ -3056,7 +3056,7 @@ static void dxf_read_line(Scene *scene, int noob) { hasbumped=1; } - /* 2D Polyline state vars */ + /* 2D Polyline state vars */ static Object *p2dhold=NULL; static Mesh *p2dmhold=NULL; static char oldplay[32]; @@ -3131,35 +3131,35 @@ static void dxf_read_ellipse(Scene *scene, int noob) read_group(id, val); while(id!=0) { if (id==8) { - BLI_strncpy(layname, val, sizeof(layname)); + BLI_strncpy(layname, val, sizeof(layname)); } else if (id==10) { - center[0]= (float) atof(val); + center[0]= (float) atof(val); } else if (id==20) { - center[1]= (float) atof(val); + center[1]= (float) atof(val); } else if (id==30) { - center[2]= (float) atof(val); + center[2]= (float) atof(val); } else if (id==11) { - axis_endpoint[0]= (float) atof(val); + axis_endpoint[0]= (float) atof(val); } else if (id==21) { - axis_endpoint[1]= (float) atof(val); + axis_endpoint[1]= (float) atof(val); } else if (id==31) { - axis_endpoint[2]= (float) atof(val); + axis_endpoint[2]= (float) atof(val); } else if (id==40) { - axis_ratio = (float) atof(val); + axis_ratio = (float) atof(val); } else if (id==41) { printf("dxf: start = %f", atof(val) * 180/M_PI); - start_angle = -atof(val) + M_PI_2; + start_angle = -atof(val) + M_PI_2; } else if (id==42) { printf("dxf: end = %f", atof(val) * 180/M_PI); end_angle = -atof(val) + M_PI_2; } else if (id==62) { - int colorid= atoi(val); - CLAMP(colorid, 1, 255); - dxf_col_to_rgb(colorid, &color[0], &color[1], &color[2]); + int colorid= atoi(val); + CLAMP(colorid, 1, 255); + dxf_col_to_rgb(colorid, &color[0], &color[1], &color[2]); } else if (id==67) { - vspace= atoi(val); + vspace= atoi(val); } else if (id==100) { - isArc = 1; + isArc = 1; } else if (id==210) { extrusion[0] = atof(val); } else if (id==220) { @@ -3290,28 +3290,28 @@ static void dxf_read_arc(Scene *scene, int noob) read_group(id, val); while(id!=0) { if (id==8) { - BLI_strncpy(layname, val, sizeof(layname)); + BLI_strncpy(layname, val, sizeof(layname)); } else if (id==10) { - center[0]= (float) atof(val); + center[0]= (float) atof(val); } else if (id==20) { - center[1]= (float) atof(val); + center[1]= (float) atof(val); } else if (id==30) { - center[2]= (float) atof(val); + center[2]= (float) atof(val); } else if (id==40) { - dia = (float) atof(val); + dia = (float) atof(val); } else if (id==62) { - int colorid= atoi(val); + int colorid= atoi(val); - CLAMP(colorid, 1, 255); - dxf_col_to_rgb(colorid, &color[0], &color[1], &color[2]); + CLAMP(colorid, 1, 255); + dxf_col_to_rgb(colorid, &color[0], &color[1], &color[2]); } else if (id==67) { - vspace= atoi(val); + vspace= atoi(val); } else if (id==100) { - isArc = 1; + isArc = 1; } else if (id==50) { - start_angle = (90 - atoi(val)) * M_PI/180.0; + start_angle = (90 - atoi(val)) * M_PI/180.0; } else if (id==51) { - end_angle = (90 - atoi(val)) * M_PI/180.0; + end_angle = (90 - atoi(val)) * M_PI/180.0; } else if (id==210) { extrusion[0] = atof(val); } else if (id==220) { diff --git a/source/blender/blenkernel/intern/fluidsim.c b/source/blender/blenkernel/intern/fluidsim.c index 22eb0578f72..fe0f52e9b00 100644 --- a/source/blender/blenkernel/intern/fluidsim.c +++ b/source/blender/blenkernel/intern/fluidsim.c @@ -609,9 +609,9 @@ void fluid_get_bb(MVert *mvert, int totvert, float obmat[][4], //------------------------------------------------------------------------------- void initElbeemMesh(struct Scene *scene, struct Object *ob, - int *numVertices, float **vertices, - int *numTriangles, int **triangles, - int useGlobalCoords, int modifierIndex) + int *numVertices, float **vertices, + int *numTriangles, int **triangles, + int useGlobalCoords, int modifierIndex) { DerivedMesh *dm = NULL; MVert *mvert; diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c index 6c73a3ae64c..d4a5b5b2531 100644 --- a/source/blender/blenkernel/intern/fmodifier.c +++ b/source/blender/blenkernel/intern/fmodifier.c @@ -305,10 +305,10 @@ static void fcm_fn_generator_new_data (void *mdata) */ static double sinc (double x) { - if (fabs(x) < 0.0001) - return 1.0; - else - return sin(M_PI * x) / (M_PI * x); + if (fabs(x) < 0.0001) + return 1.0; + else + return sin(M_PI * x) / (M_PI * x); } static void fcm_fn_generator_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, float evaltime) diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index 1ca39bbaac4..9b8c05ac88c 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -160,7 +160,7 @@ According to RFC 3629 "UTF-8, a transformation format of ISO 10646" (http://tools.ietf.org/html/rfc3629), the valid UTF-8 encoding are: Char. number range | UTF-8 octet sequence - (hexadecimal) | (binary) + (hexadecimal) | (binary) --------------------+--------------------------------------------- 0000 0000-0000 007F | 0xxxxxxx 0000 0080-0000 07FF | 110xxxxx 10xxxxxx @@ -202,7 +202,7 @@ int utf8towchar(wchar_t *w, char *c) *w = '?'; } } else - *w=(c[0] & 0x7f); + *w=(c[0] & 0x7f); c++; w++; @@ -832,8 +832,8 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode) linedata4[lnr]= wsnr; if ( (tb->h != 0.0) && - ((-(yof-(tb->y/cu->fsize))) > ((tb->h/cu->fsize)-(linedist*cu->fsize))) && - (cu->totbox > (curbox+1)) ) { + ((-(yof-(tb->y/cu->fsize))) > ((tb->h/cu->fsize)-(linedist*cu->fsize))) && + (cu->totbox > (curbox+1)) ) { maxlen= 0; tb++; curbox++; @@ -927,13 +927,13 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode) ct++; } } else if((cu->spacemode==CU_FLUSH) && - (cu->tb[0].w != 0.0)) { + (cu->tb[0].w != 0.0)) { for(i=0;i<lnr;i++) if(linedata2[i]>1) linedata[i]= (linedata3[i]-linedata[i])/(linedata2[i]-1); for (i=0; i<=slen; i++) { for (j=i; (mem[j]) && (mem[j]!='\n') && - (mem[j]!='\r') && (chartransdata[j].dobreak==0) && (j<slen); j++); + (mem[j]!='\r') && (chartransdata[j].dobreak==0) && (j<slen); j++); // if ((mem[j]!='\r') && (mem[j]!='\n') && (mem[j])) { ct->xof+= ct->charnr*linedata[ct->linenr]; // } @@ -944,10 +944,10 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode) float curofs= 0.0f; for (i=0; i<=slen; i++) { for (j=i; (mem[j]) && (mem[j]!='\n') && - (mem[j]!='\r') && (chartransdata[j].dobreak==0) && (j<slen); j++); + (mem[j]!='\r') && (chartransdata[j].dobreak==0) && (j<slen); j++); if ((mem[j]!='\r') && (mem[j]!='\n') && - ((chartransdata[j].dobreak!=0))) { - if (mem[i]==' ') curofs += (linedata3[ct->linenr]-linedata[ct->linenr])/linedata4[ct->linenr]; + ((chartransdata[j].dobreak!=0))) { + if (mem[i]==' ') curofs += (linedata3[ct->linenr]-linedata[ct->linenr])/linedata4[ct->linenr]; ct->xof+= curofs; } if (mem[i]=='\n' || mem[i]=='\r' || chartransdata[i].dobreak) curofs= 0; diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c index 7981c66d2f6..98b3522059c 100644 --- a/source/blender/blenkernel/intern/idprop.c +++ b/source/blender/blenkernel/intern/idprop.c @@ -289,12 +289,12 @@ IDProperty *IDP_CopyArray(IDProperty *prop) /*taken from readfile.c*/ #define SWITCH_LONGINT(a) { \ - char s_i, *p_i; \ - p_i= (char *)&(a); \ - s_i=p_i[0]; p_i[0]=p_i[7]; p_i[7]=s_i; \ - s_i=p_i[1]; p_i[1]=p_i[6]; p_i[6]=s_i; \ - s_i=p_i[2]; p_i[2]=p_i[5]; p_i[5]=s_i; \ - s_i=p_i[3]; p_i[3]=p_i[4]; p_i[4]=s_i; } + char s_i, *p_i; \ + p_i= (char *)&(a); \ + s_i=p_i[0]; p_i[0]=p_i[7]; p_i[7]=s_i; \ + s_i=p_i[1]; p_i[1]=p_i[6]; p_i[6]=s_i; \ + s_i=p_i[2]; p_i[2]=p_i[5]; p_i[5]=s_i; \ + s_i=p_i[3]; p_i[3]=p_i[4]; p_i[4]=s_i; } diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 85f15094740..1a3c53e293f 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -446,16 +446,16 @@ static ImBuf *add_ibuf_size(int width, int height, char *name, int floatbuf, sho strcpy(ibuf->name, "//Untitled"); ibuf->userflags |= IB_BITMAPDIRTY; - switch(uvtestgrid) { - case 1: - BKE_image_buf_fill_checker(rect, rect_float, width, height); - break; - case 2: - BKE_image_buf_fill_checker_color(rect, rect_float, width, height); - break; - default: - BKE_image_buf_fill_color(rect, rect_float, width, height, color); - } + switch(uvtestgrid) { + case 1: + BKE_image_buf_fill_checker(rect, rect_float, width, height); + break; + case 2: + BKE_image_buf_fill_checker_color(rect, rect_float, width, height); + break; + default: + BKE_image_buf_fill_color(rect, rect_float, width, height, color); + } return ibuf; } diff --git a/source/blender/blenkernel/intern/image_gen.c b/source/blender/blenkernel/intern/image_gen.c index 2c4851b1835..eb256e3775b 100644 --- a/source/blender/blenkernel/intern/image_gen.c +++ b/source/blender/blenkernel/intern/image_gen.c @@ -73,8 +73,8 @@ 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; + 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; @@ -109,8 +109,8 @@ void BKE_image_buf_fill_checker(unsigned char *rect, float *rect_float, int widt } } - rect= rect_orig; - rect_float= rect_float_orig; + rect= rect_orig; + rect_float= rect_float_orig; /* 2nd pass, colored + */ for(y= 0; y<height; y++) { @@ -179,12 +179,12 @@ static void checker_board_color_fill(unsigned char *rect, float *rect_float, int sat= 1.0; hue_step= larger_pow2(width / 8); - if(hue_step < 8) hue_step= 8; + if(hue_step < 8) hue_step= 8; for(y= 0; y < height; y++) { - val= 0.1 + (y * (0.4 / height)); /* use a number lower then 1.0 else its too bright */ + val= 0.1 + (y * (0.4 / height)); /* use a number lower then 1.0 else its too bright */ for(x= 0; x < width; x++) { hue= (float)((double)(x/hue_step) * 1.0 / width * hue_step); @@ -301,55 +301,55 @@ extern void stamp_font_begin(int size); static void checker_board_text(unsigned char *rect, float *rect_float, int width, int height, int step, int outline) { - int x, y; - int pen_x, pen_y; - char text[3]= {'A', '1', '\0'}; + int x, y; + int pen_x, pen_y; + char text[3]= {'A', '1', '\0'}; - /* hard coded size! */ + /* hard coded size! */ stamp_font_begin(54); - BLF_buffer(rect_float, rect, width, height, 4); + BLF_buffer(rect_float, rect, width, height, 4); for(y= 0; y < height; y+=step) { - text[1]= '1'; + text[1]= '1'; for(x= 0; x < width; x+=step) { - /* hard coded offset */ - pen_x = x + 33; - pen_y = y + 44; + /* hard coded offset */ + pen_x = x + 33; + pen_y = y + 44; - /* terribly crappy outline font! */ - BLF_buffer_col(1.0, 1.0, 1.0, 1.0); - - BLF_position(pen_x-outline, pen_y, 0.0); - BLF_draw_buffer(text); - BLF_position(pen_x+outline, pen_y, 0.0); - BLF_draw_buffer(text); - BLF_position(pen_x, pen_y-outline, 0.0); - BLF_draw_buffer(text); - BLF_position(pen_x, pen_y+outline, 0.0); - BLF_draw_buffer(text); + /* terribly crappy outline font! */ + BLF_buffer_col(1.0, 1.0, 1.0, 1.0); + + BLF_position(pen_x-outline, pen_y, 0.0); + BLF_draw_buffer(text); + BLF_position(pen_x+outline, pen_y, 0.0); + BLF_draw_buffer(text); + BLF_position(pen_x, pen_y-outline, 0.0); + BLF_draw_buffer(text); + BLF_position(pen_x, pen_y+outline, 0.0); + BLF_draw_buffer(text); - BLF_position(pen_x-outline, pen_y-outline, 0.0); - BLF_draw_buffer(text); - BLF_position(pen_x+outline, pen_y+outline, 0.0); - BLF_draw_buffer(text); - BLF_position(pen_x-outline, pen_y+outline, 0.0); - BLF_draw_buffer(text); - BLF_position(pen_x+outline, pen_y-outline, 0.0); - BLF_draw_buffer(text); - - BLF_buffer_col(0.0, 0.0, 0.0, 1.0); - BLF_position(pen_x, pen_y, 0.0); - BLF_draw_buffer(text); + BLF_position(pen_x-outline, pen_y-outline, 0.0); + BLF_draw_buffer(text); + BLF_position(pen_x+outline, pen_y+outline, 0.0); + BLF_draw_buffer(text); + BLF_position(pen_x-outline, pen_y+outline, 0.0); + BLF_draw_buffer(text); + BLF_position(pen_x+outline, pen_y-outline, 0.0); + BLF_draw_buffer(text); + + BLF_buffer_col(0.0, 0.0, 0.0, 1.0); + BLF_position(pen_x, pen_y, 0.0); + BLF_draw_buffer(text); - text[1]++; + text[1]++; } - text[0]++; + text[0]++; } - /* cleanup the buffer. */ + /* cleanup the buffer. */ BLF_buffer(0, 0, 0, 0, 0); } diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 2c0ca0f69f9..cd3326857c7 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -1811,7 +1811,7 @@ void do_versions_ipos_to_animato(Main *main) Sequence * seq; for(seq = scene->ed->seqbasep->first; - seq; seq = seq->next) { + seq; seq = seq->next) { short adrcode = SEQ_FAC1; if (G.f & G_DEBUG) diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c index 9c78742ada0..31b0a809ebe 100644 --- a/source/blender/blenkernel/intern/key.c +++ b/source/blender/blenkernel/intern/key.c @@ -178,11 +178,11 @@ Key *copy_key(Key *key) void make_local_key(Key *key) { - /* - only lib users: do nothing - * - only local users: set flag - * - mixed: make copy - */ - if(key==0) return; + /* - only lib users: do nothing + * - only local users: set flag + * - mixed: make copy + */ + if(key==0) return; key->id.lib= 0; new_id(0, (ID *)key, 0); diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c index 347fd01299f..b7003f45626 100644 --- a/source/blender/blenkernel/intern/lattice.c +++ b/source/blender/blenkernel/intern/lattice.c @@ -714,7 +714,7 @@ void curve_deform_verts(Scene *scene, Object *cuOb, Object *target, DerivedMesh /* find the group (weak loop-in-loop) */ for(index = 0, curdef = target->defbase.first; curdef; - curdef = curdef->next, index++) + curdef = curdef->next, index++) if (!strcmp(curdef->name, vgroup)) break; @@ -746,7 +746,7 @@ void curve_deform_verts(Scene *scene, Object *cuOb, Object *target, DerivedMesh VECCOPY(vec, vertexCos[a]); calc_curve_deform(scene, cuOb, vec, defaxis, &cd, NULL); interp_v3_v3v3(vertexCos[a], vertexCos[a], vec, - dvert->dw[j].weight); + dvert->dw[j].weight); mul_m4_v3(cd.objectspace, vertexCos[a]); break; } @@ -804,7 +804,7 @@ void curve_deform_vector(Scene *scene, Object *cuOb, Object *target, float *orco } void lattice_deform_verts(Object *laOb, Object *target, DerivedMesh *dm, - float (*vertexCos)[3], int numVerts, char *vgroup) + float (*vertexCos)[3], int numVerts, char *vgroup) { int a; int use_vgroups; @@ -834,7 +834,7 @@ void lattice_deform_verts(Object *laOb, Object *target, DerivedMesh *dm, /* find the group (weak loop-in-loop) */ for(curdef = target->defbase.first; curdef; - curdef = curdef->next, index++) + curdef = curdef->next, index++) if(!strcmp(curdef->name, vgroup)) break; if(curdef && (me->dvert || dm)) { @@ -865,7 +865,7 @@ int object_deform_mball(Object *ob) for (dl=ob->disp.first; dl; dl=dl->next) { lattice_deform_verts(ob->parent, ob, NULL, - (float(*)[3]) dl->verts, dl->nr, NULL); + (float(*)[3]) dl->verts, dl->nr, NULL); } return 1; diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 91e53742fea..bea641d2140 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -598,10 +598,10 @@ static ID *alloc_libblock_notest(short type) break; case ID_PA: id = MEM_callocN(sizeof(ParticleSettings), "ParticleSettings"); - break; + break; case ID_WM: id = MEM_callocN(sizeof(wmWindowManager), "Window manager"); - break; + break; case ID_GD: id = MEM_callocN(sizeof(bGPdata), "Grease Pencil"); break; @@ -682,7 +682,7 @@ void *copy_libblock(void *rt) static void free_library(Library *lib) { - /* no freeing needed for libraries yet */ + /* no freeing needed for libraries yet */ } static void (*free_windowmanager_cb)(bContext *, wmWindowManager *)= NULL; @@ -1362,17 +1362,17 @@ void text_idbutton(struct ID *id, char *text) if(id) { if(GS(id->name)==ID_SCE) strcpy(text, "SCE: "); - else if(GS(id->name)==ID_SCE) + else if(GS(id->name)==ID_SCE) strcpy(text, "SCR: "); - else if(GS(id->name)==ID_MA && ((Material*)id)->use_nodes) + else if(GS(id->name)==ID_MA && ((Material*)id)->use_nodes) strcpy(text, "NT: "); - else { + else { text[0]= id->name[0]; text[1]= id->name[1]; text[2]= ':'; text[3]= ' '; text[4]= 0; - } + } } else strcpy(text, ""); diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 2a2d73ca6a0..e877abea7cf 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -244,9 +244,9 @@ void make_local_material(Material *ma) int a, local=0, lib=0; /* - only lib users: do nothing - * - only local users: set flag - * - mixed: make copy - */ + * - only local users: set flag + * - mixed: make copy + */ if(ma->id.lib==0) return; if(ma->id.us==1) { @@ -1064,15 +1064,15 @@ void ramp_blend(int type, float *r, float *g, float *b, float fac, float *col) } break; case MA_RAMP_DARK: - tmp=col[0]+((1-col[0])*facm); - if(tmp < *r) *r= tmp; - if(g) { - tmp=col[1]+((1-col[1])*facm); - if(tmp < *g) *g= tmp; - tmp=col[2]+((1-col[2])*facm); - if(tmp < *b) *b= tmp; - } - break; + tmp=col[0]+((1-col[0])*facm); + if(tmp < *r) *r= tmp; + if(g) { + tmp=col[1]+((1-col[1])*facm); + if(tmp < *g) *g= tmp; + tmp=col[2]+((1-col[2])*facm); + if(tmp < *b) *b= tmp; + } + break; case MA_RAMP_LIGHT: tmp= fac*col[0]; if(tmp > *r) *r= tmp; @@ -1124,7 +1124,7 @@ void ramp_blend(int type, float *r, float *g, float *b, float fac, float *col) if(tmp <= 0.0f) *r = 0.0f; else if (( tmp = (1.0f - (1.0f - (*r)) / tmp )) < 0.0f) - *r = 0.0f; + *r = 0.0f; else if (tmp > 1.0f) *r=1.0f; else @@ -1135,17 +1135,17 @@ void ramp_blend(int type, float *r, float *g, float *b, float fac, float *col) if(tmp <= 0.0f) *g = 0.0f; else if (( tmp = (1.0f - (1.0f - (*g)) / tmp )) < 0.0f ) - *g = 0.0f; + *g = 0.0f; else if(tmp >1.0f) *g=1.0f; else *g = tmp; - tmp = facm + fac*col[2]; - if(tmp <= 0.0f) + tmp = facm + fac*col[2]; + if(tmp <= 0.0f) *b = 0.0f; else if (( tmp = (1.0f - (1.0f - (*b)) / tmp )) < 0.0f ) - *b = 0.0f; + *b = 0.0f; else if(tmp >1.0f) *b= 1.0f; else @@ -1202,36 +1202,36 @@ void ramp_blend(int type, float *r, float *g, float *b, float fac, float *col) } } break; - case MA_RAMP_SOFT: - if (g){ - float scr, scg, scb; + 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); + /* 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)); - } - break; - case MA_RAMP_LINEAR: - if (col[0] > 0.5f) - *r = *r + fac*(2.0f*(col[0]-0.5f)); - else - *r = *r + fac*(2.0f*(col[0]) - 1.0f); - if (g){ - if (col[1] > 0.5f) - *g = *g + fac*(2.0f*(col[1]-0.5f)); - else - *g = *g + fac*(2.0f*(col[1]) -1.0f); - if (col[2] > 0.5f) - *b = *b + fac*(2.0f*(col[2]-0.5f)); - else - *b = *b + fac*(2.0f*(col[2]) - 1.0f); - } - break; + *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)); + } + break; + case MA_RAMP_LINEAR: + if (col[0] > 0.5f) + *r = *r + fac*(2.0f*(col[0]-0.5f)); + else + *r = *r + fac*(2.0f*(col[0]) - 1.0f); + if (g){ + if (col[1] > 0.5f) + *g = *g + fac*(2.0f*(col[1]-0.5f)); + else + *g = *g + fac*(2.0f*(col[1]) -1.0f); + if (col[2] > 0.5f) + *b = *b + fac*(2.0f*(col[2]-0.5f)); + else + *b = *b + fac*(2.0f*(col[2]) - 1.0f); + } + break; } } diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index d65870b71ce..98578312766 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -686,7 +686,7 @@ void *new_pgn_element(int size) if(cur) { if(size+offs < blocksize) { adr= (void *) (cur->data+offs); - offs+= size; + offs+= size; return adr; } } @@ -1091,7 +1091,7 @@ int getedge (EDGELIST *table[], q = table[HASH(i1, j1, k1)+HASH(i2, j2, k2)]; for (; q != NULL; q = q->next) if (q->i1 == i1 && q->j1 == j1 && q->k1 == k1 && - q->i2 == i2 && q->j2 == j2 && q->k2 == k2) + q->i2 == i2 && q->j2 == j2 && q->k2 == k2) return q->vid; return -1; } @@ -1240,7 +1240,7 @@ void converge (MB_POINT *p1, MB_POINT *p2, float v1, float v2, p->z = neg.z; return; } - if((dx == 0.0f) && (dz == 0.0f)){ + if((dx == 0.0f) && (dz == 0.0f)){ p->x = neg.x; p->y = neg.y - negative*dy/(positive-negative); p->z = neg.z; @@ -1272,7 +1272,7 @@ void converge (MB_POINT *p1, MB_POINT *p2, float v1, float v2, p->y = 0.5f*(pos.y + neg.y); if ((function(p->x,p->y,p->z)) > 0.0) pos.y = p->y; else neg.y = p->y; } - } + } if((dx == 0.0f) && (dy == 0.0f)){ p->x = neg.x; @@ -1580,7 +1580,7 @@ float init_meta(Scene *scene, Object *ob) /* return totsize */ if(ml->s > 10.0) ml->s = 10.0; /* Rotation of MetaElem is stored in quat */ - quat_to_mat4( temp3,ml->quat); + quat_to_mat4( temp3,ml->quat); /* Translation of MetaElem */ unit_m4(temp2); @@ -2120,8 +2120,8 @@ void metaball_polygonize(Scene *scene, Object *ob) /* don't polygonize metaballs with too high resolution (base mball to small) */ if(metaball_tree) { if(ob->size[0]<=0.0001f*(metaball_tree->first->x_max - metaball_tree->first->x_min) || - ob->size[1]<=0.0001f*(metaball_tree->first->y_max - metaball_tree->first->y_min) || - ob->size[2]<=0.0001f*(metaball_tree->first->z_max - metaball_tree->first->z_min)) + ob->size[1]<=0.0001f*(metaball_tree->first->y_max - metaball_tree->first->y_min) || + ob->size[2]<=0.0001f*(metaball_tree->first->z_max - metaball_tree->first->z_min)) { MEM_freeN(mainb); return; diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 15f9fc4ac11..543895a5973 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -108,7 +108,7 @@ void unlink_mesh(Mesh *me) } if(me->key) { - me->key->id.us--; + me->key->id.us--; if (me->key->id.us == 0 && me->key->ipo ) me->key->ipo->id.us--; } @@ -274,9 +274,9 @@ void make_local_mesh(Mesh *me) int local=0, lib=0; /* - only lib users: do nothing - * - only local users: set flag - * - mixed: make copy - */ + * - only local users: set flag + * - mixed: make copy + */ if(me->id.lib==0) return; if(me->id.us==1) { diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 7eb967aeb09..ad1fb80801f 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -204,7 +204,7 @@ static int curveModifier_isDisabled(ModifierData *md, int userRenderParams) } static void curveModifier_foreachObjectLink( - ModifierData *md, Object *ob, + ModifierData *md, Object *ob, void (*walk)(void *userData, Object *ob, Object **obpoin), void *userData) { @@ -215,7 +215,7 @@ static void curveModifier_foreachObjectLink( static void curveModifier_updateDepgraph( ModifierData *md, DagForest *forest, Scene *scene, - Object *ob, DagNode *obNode) + Object *ob, DagNode *obNode) { CurveModifierData *cmd = (CurveModifierData*) md; @@ -228,7 +228,7 @@ static void curveModifier_updateDepgraph( } static void curveModifier_deformVerts( - ModifierData *md, Object *ob, DerivedMesh *derivedData, + ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) { CurveModifierData *cmd = (CurveModifierData*) md; @@ -239,7 +239,7 @@ static void curveModifier_deformVerts( static void curveModifier_deformVertsEM( ModifierData *md, Object *ob, EditMesh *editData, - DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) + DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { DerivedMesh *dm = derivedData; @@ -280,7 +280,7 @@ static int latticeModifier_isDisabled(ModifierData *md, int userRenderParams) } static void latticeModifier_foreachObjectLink( - ModifierData *md, Object *ob, + ModifierData *md, Object *ob, void (*walk)(void *userData, Object *ob, Object **obpoin), void *userData) { @@ -317,7 +317,7 @@ static void modifier_vgroup_cache(ModifierData *md, float (*vertexCos)[3]) static void latticeModifier_deformVerts( ModifierData *md, Object *ob, DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) + float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) { LatticeModifierData *lmd = (LatticeModifierData*) md; @@ -325,12 +325,12 @@ static void latticeModifier_deformVerts( modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */ lattice_deform_verts(lmd->object, ob, derivedData, - vertexCos, numVerts, lmd->name); + vertexCos, numVerts, lmd->name); } static void latticeModifier_deformVertsEM( ModifierData *md, Object *ob, EditMesh *editData, - DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) + DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { DerivedMesh *dm = derivedData; @@ -463,22 +463,22 @@ static DerivedMesh *buildModifier_applyModifier(ModifierData *md, Object *ob, maxVerts = dm->getNumVerts(dm); vertMap = MEM_callocN(sizeof(*vertMap) * maxVerts, - "build modifier vertMap"); + "build modifier vertMap"); for(i = 0; i < maxVerts; ++i) vertMap[i] = i; maxEdges = dm->getNumEdges(dm); edgeMap = MEM_callocN(sizeof(*edgeMap) * maxEdges, - "build modifier edgeMap"); + "build modifier edgeMap"); for(i = 0; i < maxEdges; ++i) edgeMap[i] = i; maxFaces = dm->getNumFaces(dm); faceMap = MEM_callocN(sizeof(*faceMap) * maxFaces, - "build modifier faceMap"); + "build modifier faceMap"); for(i = 0; i < maxFaces; ++i) faceMap[i] = i; if (ob) { frac = bsystem_time(md->scene, ob, md->scene->r.cfra, - bmd->start - 1.0f) / bmd->length; + bmd->start - 1.0f) / bmd->length; } else { frac = md->scene->r.cfra - bmd->start / bmd->length; } @@ -493,7 +493,7 @@ static DerivedMesh *buildModifier_applyModifier(ModifierData *md, Object *ob, if(bmd->randomize) BLI_array_randomize(faceMap, sizeof(*faceMap), - maxFaces, bmd->seed); + maxFaces, bmd->seed); /* get the set of all vert indices that will be in the final mesh, * mapped to the new indices @@ -532,7 +532,7 @@ static DerivedMesh *buildModifier_applyModifier(ModifierData *md, Object *ob, } else if(numEdges) { if(bmd->randomize) BLI_array_randomize(edgeMap, sizeof(*edgeMap), - maxEdges, bmd->seed); + maxEdges, bmd->seed); /* get the set of all vert indices that will be in the final mesh, * mapped to the new indices @@ -563,7 +563,7 @@ static DerivedMesh *buildModifier_applyModifier(ModifierData *md, Object *ob, if(bmd->randomize) BLI_array_randomize(vertMap, sizeof(*vertMap), - maxVerts, bmd->seed); + maxVerts, bmd->seed); /* get the set of all vert indices that will be in the final mesh, * mapped to the new indices @@ -576,7 +576,7 @@ static DerivedMesh *buildModifier_applyModifier(ModifierData *md, Object *ob, * the mesh */ result = CDDM_from_template(dm, BLI_ghash_size(vertHash), - BLI_ghash_size(edgeHash), numFaces); + BLI_ghash_size(edgeHash), numFaces); /* copy the vertices across */ for(hashIter = BLI_ghashIterator_new(vertHash); @@ -662,7 +662,7 @@ static CustomDataMask maskModifier_requiredDataMask(Object *ob, ModifierData *md } static void maskModifier_foreachObjectLink( - ModifierData *md, Object *ob, + ModifierData *md, Object *ob, void (*walk)(void *userData, Object *ob, Object **obpoin), void *userData) { @@ -1028,7 +1028,7 @@ static void arrayModifier_copyData(ModifierData *md, ModifierData *target) } static void arrayModifier_foreachObjectLink( - ModifierData *md, Object *ob, + ModifierData *md, Object *ob, void (*walk)(void *userData, Object *ob, Object **obpoin), void *userData) { @@ -1124,13 +1124,13 @@ static int calc_mapping(IndexMapEntry *indexMap, int oldIndex, int copyNum) return indexMap[oldIndex].new; else return calc_mapping(indexMap, indexMap[oldIndex].merge, - copyNum - 1); + copyNum - 1); } } static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, Scene *scene, Object *ob, DerivedMesh *dm, - int initFlags) + int initFlags) { int i, j; /* offset matrix */ @@ -1160,7 +1160,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, unit_m4(offset); indexMap = MEM_callocN(sizeof(*indexMap) * dm->getNumVerts(dm), - "indexmap"); + "indexmap"); src_mvert = dm->getVertArray(dm); @@ -1185,7 +1185,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, mul_serie_m4(result_mat, offset, obinv, amd->offset_ob->obmat, - NULL, NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL); copy_m4_m4(offset, result_mat); } @@ -1542,12 +1542,12 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, mface[numFaces].v4 = vert_map[mface[numFaces].v4]; test_index_face(&mface[numFaces], &result->faceData, - numFaces, 4); + numFaces, 4); } else { test_index_face(&mface[numFaces], &result->faceData, - numFaces, 3); + numFaces, 3); } origindex[numFaces] = ORIGINDEX_NONE; @@ -1643,12 +1643,12 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, mface[numFaces].v4 = vert_map[mface[numFaces].v4]; test_index_face(&mface[numFaces], &result->faceData, - numFaces, 4); + numFaces, 4); } else { test_index_face(&mface[numFaces], &result->faceData, - numFaces, 3); + numFaces, 3); } origindex[numFaces] = ORIGINDEX_NONE; @@ -1714,7 +1714,7 @@ static void mirrorModifier_copyData(ModifierData *md, ModifierData *target) } static void mirrorModifier_foreachObjectLink( - ModifierData *md, Object *ob, + ModifierData *md, Object *ob, void (*walk)(void *userData, Object *ob, Object **obpoin), void *userData) { @@ -1924,7 +1924,7 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd, } static DerivedMesh *mirrorModifier__doMirror(MirrorModifierData *mmd, - Object *ob, DerivedMesh *dm, + Object *ob, DerivedMesh *dm, int initFlags) { DerivedMesh *result = dm; @@ -2198,7 +2198,7 @@ static void smoothmesh_print(SmoothMesh *mesh) dm->getVert(dm, vert->oldIndex, &mv); printf("%3d: ind={%3d, %3d}, pos={% 5.1f, % 5.1f, % 5.1f}", - i, vert->oldIndex, vert->newIndex, + i, vert->oldIndex, vert->newIndex, mv.co[0], mv.co[1], mv.co[2]); printf(", faces={"); for(node = vert->faces; node != NULL; node = node->next) { @@ -2213,7 +2213,7 @@ static void smoothmesh_print(SmoothMesh *mesh) LinkNode *node; printf("%4d: indices={%4d, %4d}, verts={%4d, %4d}", - i, + i, edge->oldIndex, edge->newIndex, edge->verts[0]->newIndex, edge->verts[1]->newIndex); if(edge->verts[0] == edge->verts[1]) printf(" <- DUPLICATE VERTEX"); @@ -2229,7 +2229,7 @@ static void smoothmesh_print(SmoothMesh *mesh) SmoothFace *face = &mesh->faces[i]; printf("%4d: indices={%4d, %4d}, edges={", i, - face->oldIndex, face->newIndex); + face->oldIndex, face->newIndex); for(j = 0; j < SMOOTHFACE_MAX_EDGES && face->edges[j]; j++) { if(face->flip[j]) printf(" -%-2d", face->edges[j]->newIndex); @@ -2257,7 +2257,7 @@ static SmoothMesh *smoothmesh_from_derivedmesh(DerivedMesh *dm) totface = dm->getNumFaces(dm); mesh = smoothmesh_new(totvert, totedge, totface, - totvert, totedge, totface); + totvert, totedge, totface); mesh->dm = dm; @@ -2390,7 +2390,7 @@ static SmoothVert *other_vert(SmoothEdge *edge, SmoothVert *vert) * (this should never happen) */ static SmoothEdge *other_edge(SmoothFace *face, SmoothVert *vert, - SmoothEdge *edge) + SmoothEdge *edge) { int i,j; for(i = 0; i < SMOOTHFACE_MAX_EDGES && face->edges[i]; i++) { @@ -2584,7 +2584,7 @@ static void edge_replace_vert(void *ptr, void *userdata) #ifdef EDGESPLIT_DEBUG_3 printf("replacing vert %4d with %4d in edge %4d", - find->newIndex, replace->newIndex, edge->newIndex); + find->newIndex, replace->newIndex, edge->newIndex); printf(": {%4d, %4d}", edge->verts[0]->newIndex, edge->verts[1]->newIndex); #endif @@ -2620,14 +2620,14 @@ static void face_replace_edge(void *ptr, void *userdata) #ifdef EDGESPLIT_DEBUG_3 printf("replacing edge %4d with %4d in face %4d", - find->newIndex, replace->newIndex, face->newIndex); + find->newIndex, replace->newIndex, face->newIndex); if(face->edges[3]) printf(": {%2d %2d %2d %2d}", - face->edges[0]->newIndex, face->edges[1]->newIndex, + face->edges[0]->newIndex, face->edges[1]->newIndex, face->edges[2]->newIndex, face->edges[3]->newIndex); else printf(": {%2d %2d %2d}", - face->edges[0]->newIndex, face->edges[1]->newIndex, + face->edges[0]->newIndex, face->edges[1]->newIndex, face->edges[2]->newIndex); #endif @@ -2642,11 +2642,11 @@ static void face_replace_edge(void *ptr, void *userdata) #ifdef EDGESPLIT_DEBUG_3 if(face->edges[3]) printf(" -> {%2d %2d %2d %2d}\n", - face->edges[0]->newIndex, face->edges[1]->newIndex, + face->edges[0]->newIndex, face->edges[1]->newIndex, face->edges[2]->newIndex, face->edges[3]->newIndex); else printf(" -> {%2d %2d %2d}\n", - face->edges[0]->newIndex, face->edges[1]->newIndex, + face->edges[0]->newIndex, face->edges[1]->newIndex, face->edges[2]->newIndex); #endif } @@ -2696,7 +2696,7 @@ static SmoothEdge *find_other_sharp_edge(SmoothVert *vert, SmoothEdge *edge, LinkNode *visited_edges = NULL; #ifdef EDGESPLIT_DEBUG_1 printf("=== START === find_other_sharp_edge(edge = %4d, vert = %4d)\n", - edge->newIndex, vert->newIndex); + edge->newIndex, vert->newIndex); #endif /* get a face on which to start */ @@ -2717,10 +2717,10 @@ static SmoothEdge *find_other_sharp_edge(SmoothVert *vert, SmoothEdge *edge, * seen before */ while(face && !edge_is_sharp(edge2, flags, threshold) - && !linklist_contains(visited_edges, edge2)) { + && !linklist_contains(visited_edges, edge2)) { #ifdef EDGESPLIT_DEBUG_3 printf("current face %4d; current edge %4d\n", face->newIndex, - edge2->newIndex); + edge2->newIndex); #endif /* get the next face */ face = other_face(edge2, face); @@ -2738,30 +2738,30 @@ static SmoothEdge *find_other_sharp_edge(SmoothVert *vert, SmoothEdge *edge, edge2 = other_edge(face, vert, edge2); #ifdef EDGESPLIT_DEBUG_3 printf("next face %4d; next edge %4d\n", - face->newIndex, edge2->newIndex); + face->newIndex, edge2->newIndex); } else { printf("loose edge: %4d\n", edge2->newIndex); #endif } - } + } - /* either we came back to the start edge or we found a sharp/loose edge */ - if(linklist_contains(visited_edges, edge2)) - /* we came back to the start edge */ - edge2 = NULL; + /* either we came back to the start edge or we found a sharp/loose edge */ + if(linklist_contains(visited_edges, edge2)) + /* we came back to the start edge */ + edge2 = NULL; - BLI_linklist_free(visited_edges, NULL); + BLI_linklist_free(visited_edges, NULL); #ifdef EDGESPLIT_DEBUG_1 - printf("=== END === find_other_sharp_edge(edge = %4d, vert = %4d), " - "returning edge %d\n", + printf("=== END === find_other_sharp_edge(edge = %4d, vert = %4d), " + "returning edge %d\n", edge->newIndex, vert->newIndex, edge2 ? edge2->newIndex : -1); #endif - return edge2; + return edge2; } static void split_single_vert(SmoothVert *vert, SmoothFace *face, - SmoothMesh *mesh) + SmoothMesh *mesh) { SmoothVert *copy_vert; ReplaceData repdata; @@ -2819,17 +2819,17 @@ static void pop_propagate_stack(SmoothEdge **edge, SmoothVert **vert, SmoothMesh static void split_edge(SmoothEdge *edge, SmoothVert *vert, SmoothMesh *mesh); static void propagate_split(SmoothEdge *edge, SmoothVert *vert, - SmoothMesh *mesh) + SmoothMesh *mesh) { SmoothEdge *edge2; LinkNode *visited_faces = NULL; #ifdef EDGESPLIT_DEBUG_1 printf("=== START === propagate_split(edge = %4d, vert = %4d)\n", - edge->newIndex, vert->newIndex); + edge->newIndex, vert->newIndex); #endif edge2 = find_other_sharp_edge(vert, edge, &visited_faces, - mesh->threshold, mesh->flags); + mesh->threshold, mesh->flags); if(!edge2) { /* didn't find a sharp or loose edge, so we've hit a dead end */ @@ -2871,7 +2871,7 @@ static void propagate_split(SmoothEdge *edge, SmoothVert *vert, BLI_linklist_free(visited_faces, NULL); #ifdef EDGESPLIT_DEBUG_1 printf("=== END === propagate_split(edge = %4d, vert = %4d)\n", - edge->newIndex, vert->newIndex); + edge->newIndex, vert->newIndex); #endif } @@ -2884,11 +2884,11 @@ static void split_edge(SmoothEdge *edge, SmoothVert *vert, SmoothMesh *mesh) LinkNode *visited_faces = NULL; #ifdef EDGESPLIT_DEBUG_1 printf("=== START === split_edge(edge = %4d, vert = %4d)\n", - edge->newIndex, vert->newIndex); + edge->newIndex, vert->newIndex); #endif edge2 = find_other_sharp_edge(vert, edge, &visited_faces, - mesh->threshold, mesh->flags); + mesh->threshold, mesh->flags); if(!edge2) { /* didn't find a sharp or loose edge, so try the other vert */ @@ -2958,12 +2958,12 @@ static void split_edge(SmoothEdge *edge, SmoothVert *vert, SmoothMesh *mesh) BLI_linklist_free(visited_faces, NULL); #ifdef EDGESPLIT_DEBUG_1 printf("=== END === split_edge(edge = %4d, vert = %4d)\n", - edge->newIndex, vert->newIndex); + edge->newIndex, vert->newIndex); #endif } static void tag_and_count_extra_edges(SmoothMesh *mesh, float split_angle, - int flags, int *extra_edges) + int flags, int *extra_edges) { /* if normal1 dot normal2 < threshold, angle is greater, so split */ /* FIXME not sure if this always works */ @@ -3327,7 +3327,7 @@ static int displaceModifier_dependsOnTime(ModifierData *md) } static void displaceModifier_foreachObjectLink(ModifierData *md, Object *ob, - ObjectWalkFunc walk, void *userData) + ObjectWalkFunc walk, void *userData) { DisplaceModifierData *dmd = (DisplaceModifierData*) md; @@ -3352,7 +3352,7 @@ static int displaceModifier_isDisabled(ModifierData *md, int useRenderParams) } static void displaceModifier_updateDepgraph( - ModifierData *md, DagForest *forest, Scene *scene, + ModifierData *md, DagForest *forest, Scene *scene, Object *ob, DagNode *obNode) { DisplaceModifierData *dmd = (DisplaceModifierData*) md; @@ -3385,7 +3385,7 @@ static void validate_layer_name(const CustomData *data, int type, char *name, ch } static void get_texture_coords(DisplaceModifierData *dmd, Object *ob, - DerivedMesh *dm, + DerivedMesh *dm, float (*co)[3], float (*texco)[3], int numVerts) { @@ -3492,7 +3492,7 @@ static void get_texture_value(Tex *texture, float *tex_co, TexResult *texres) /* dm must be a CDDerivedMesh */ static void displaceModifier_do( DisplaceModifierData *dmd, Object *ob, - DerivedMesh *dm, float (*vertexCos)[3], int numVerts) + DerivedMesh *dm, float (*vertexCos)[3], int numVerts) { int i; MVert *mvert; @@ -3509,7 +3509,7 @@ static void displaceModifier_do( dvert = dm->getVertDataArray(dm, CD_MDEFORMVERT); tex_co = MEM_callocN(sizeof(*tex_co) * numVerts, - "displaceModifier_do tex_co"); + "displaceModifier_do tex_co"); get_texture_coords(dmd, ob, dm, vertexCos, tex_co, numVerts); for(i = 0; i < numVerts; ++i) { @@ -3565,12 +3565,12 @@ static void displaceModifier_do( static void displaceModifier_deformVerts( ModifierData *md, Object *ob, DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) + float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) { DerivedMesh *dm= get_cddm(md->scene, ob, NULL, derivedData, vertexCos); displaceModifier_do((DisplaceModifierData *)md, ob, dm, - vertexCos, numVerts); + vertexCos, numVerts); if(dm != derivedData) dm->release(dm); @@ -3583,7 +3583,7 @@ static void displaceModifier_deformVertsEM( DerivedMesh *dm= get_cddm(md->scene, ob, editData, derivedData, vertexCos); displaceModifier_do((DisplaceModifierData *)md, ob, dm, - vertexCos, numVerts); + vertexCos, numVerts); if(dm != derivedData) dm->release(dm); @@ -3642,18 +3642,18 @@ static void uvprojectModifier_foreachObjectLink(ModifierData *md, Object *ob, } static void uvprojectModifier_foreachIDLink(ModifierData *md, Object *ob, - IDWalkFunc walk, void *userData) + IDWalkFunc walk, void *userData) { UVProjectModifierData *umd = (UVProjectModifierData*) md; walk(userData, ob, (ID **)&umd->image); uvprojectModifier_foreachObjectLink(md, ob, (ObjectWalkFunc)walk, - userData); + userData); } static void uvprojectModifier_updateDepgraph(ModifierData *md, - DagForest *forest, Scene *scene, Object *ob, DagNode *obNode) + DagForest *forest, Scene *scene, Object *ob, DagNode *obNode) { UVProjectModifierData *umd = (UVProjectModifierData*) md; int i; @@ -3711,7 +3711,7 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd, numVerts = dm->getNumVerts(dm); coords = MEM_callocN(sizeof(*coords) * numVerts, - "uvprojectModifier_do coords"); + "uvprojectModifier_do coords"); dm->getVertCos(dm, coords); /* convert coords to world space */ @@ -4092,7 +4092,7 @@ static CustomDataMask smoothModifier_requiredDataMask(Object *ob, ModifierData * } static void smoothModifier_do( - SmoothModifierData *smd, Object *ob, DerivedMesh *dm, + SmoothModifierData *smd, Object *ob, DerivedMesh *dm, float (*vertexCos)[3], int numVerts) { MDeformVert *dvert = NULL; @@ -4220,7 +4220,7 @@ static void smoothModifier_do( } static void smoothModifier_deformVerts( - ModifierData *md, Object *ob, DerivedMesh *derivedData, + ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) { DerivedMesh *dm= get_dm(md->scene, ob, NULL, derivedData, NULL, 0); @@ -4234,7 +4234,7 @@ static void smoothModifier_deformVerts( static void smoothModifier_deformVertsEM( ModifierData *md, Object *ob, EditMesh *editData, - DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) + DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { DerivedMesh *dm= get_dm(md->scene, ob, editData, derivedData, NULL, 0); @@ -4302,7 +4302,7 @@ static CustomDataMask castModifier_requiredDataMask(Object *ob, ModifierData *md static void castModifier_foreachObjectLink( ModifierData *md, Object *ob, void (*walk)(void *userData, Object *ob, Object **obpoin), - void *userData) + void *userData) { CastModifierData *cmd = (CastModifierData*) md; @@ -4311,7 +4311,7 @@ static void castModifier_foreachObjectLink( static void castModifier_updateDepgraph( ModifierData *md, DagForest *forest, Scene *scene, Object *ob, - DagNode *obNode) + DagNode *obNode) { CastModifierData *cmd = (CastModifierData*) md; @@ -4325,7 +4325,7 @@ static void castModifier_updateDepgraph( static void castModifier_sphere_do( CastModifierData *cmd, Object *ob, DerivedMesh *dm, - float (*vertexCos)[3], int numVerts) + float (*vertexCos)[3], int numVerts) { MDeformVert *dvert = NULL; @@ -4502,7 +4502,7 @@ static void castModifier_sphere_do( static void castModifier_cuboid_do( CastModifierData *cmd, Object *ob, DerivedMesh *dm, - float (*vertexCos)[3], int numVerts) + float (*vertexCos)[3], int numVerts) { MDeformVert *dvert = NULL; Object *ctrl_ob = NULL; @@ -4772,7 +4772,7 @@ static void castModifier_cuboid_do( } static void castModifier_deformVerts( - ModifierData *md, Object *ob, DerivedMesh *derivedData, + ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) { DerivedMesh *dm = NULL; @@ -4795,7 +4795,7 @@ static void castModifier_deformVerts( } static void castModifier_deformVertsEM( - ModifierData *md, Object *ob, EditMesh *editData, + ModifierData *md, Object *ob, EditMesh *editData, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { DerivedMesh *dm = get_dm(md->scene, ob, editData, derivedData, NULL, 0); @@ -4873,7 +4873,7 @@ static void waveModifier_foreachObjectLink( } static void waveModifier_foreachIDLink(ModifierData *md, Object *ob, - IDWalkFunc walk, void *userData) + IDWalkFunc walk, void *userData) { WaveModifierData *wmd = (WaveModifierData*) md; @@ -4884,7 +4884,7 @@ static void waveModifier_foreachIDLink(ModifierData *md, Object *ob, static void waveModifier_updateDepgraph( ModifierData *md, DagForest *forest, Scene *scene, Object *ob, - DagNode *obNode) + DagNode *obNode) { WaveModifierData *wmd = (WaveModifierData*) md; @@ -4921,7 +4921,7 @@ static CustomDataMask waveModifier_requiredDataMask(Object *ob, ModifierData *md } static void wavemod_get_texture_coords(WaveModifierData *wmd, Object *ob, - DerivedMesh *dm, + DerivedMesh *dm, float (*co)[3], float (*texco)[3], int numVerts) { @@ -5009,7 +5009,7 @@ static void wavemod_get_texture_coords(WaveModifierData *wmd, Object *ob, static void waveModifier_do(WaveModifierData *md, Scene *scene, Object *ob, DerivedMesh *dm, - float (*vertexCos)[3], int numVerts) + float (*vertexCos)[3], int numVerts) { WaveModifierData *wmd = (WaveModifierData*) md; MVert *mvert = NULL; @@ -5057,7 +5057,7 @@ static void waveModifier_do(WaveModifierData *md, if(wmd->texture) { tex_co = MEM_mallocN(sizeof(*tex_co) * numVerts, - "waveModifier_do tex_co"); + "waveModifier_do tex_co"); wavemod_get_texture_coords(wmd, ob, dm, vertexCos, tex_co, numVerts); } @@ -5165,7 +5165,7 @@ static void waveModifier_do(WaveModifierData *md, } static void waveModifier_deformVerts( - ModifierData *md, Object *ob, DerivedMesh *derivedData, + ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) { DerivedMesh *dm= derivedData; @@ -5183,7 +5183,7 @@ static void waveModifier_deformVerts( } static void waveModifier_deformVertsEM( - ModifierData *md, Object *ob, EditMesh *editData, + ModifierData *md, Object *ob, EditMesh *editData, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { DerivedMesh *dm= derivedData; @@ -5237,8 +5237,8 @@ static int armatureModifier_isDisabled(ModifierData *md, int useRenderParams) } static void armatureModifier_foreachObjectLink( - ModifierData *md, Object *ob, - void (*walk)(void *userData, Object *ob, Object **obpoin), + ModifierData *md, Object *ob, + void (*walk)(void *userData, Object *ob, Object **obpoin), void *userData) { ArmatureModifierData *amd = (ArmatureModifierData*) md; @@ -5247,7 +5247,7 @@ static void armatureModifier_foreachObjectLink( } static void armatureModifier_updateDepgraph( - ModifierData *md, DagForest *forest, Scene *scene, Object *ob, + ModifierData *md, DagForest *forest, Scene *scene, Object *ob, DagNode *obNode) { ArmatureModifierData *amd = (ArmatureModifierData*) md; @@ -5262,14 +5262,14 @@ static void armatureModifier_updateDepgraph( static void armatureModifier_deformVerts( ModifierData *md, Object *ob, DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) + float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) { ArmatureModifierData *amd = (ArmatureModifierData*) md; modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */ armature_deform_verts(amd->object, ob, derivedData, vertexCos, NULL, - numVerts, amd->deformflag, + numVerts, amd->deformflag, (float(*)[3])amd->prevCos, amd->defgrp_name); /* free cache */ if(amd->prevCos) { @@ -5288,15 +5288,15 @@ static void armatureModifier_deformVertsEM( if(!derivedData) dm = CDDM_from_editmesh(editData, ob->data); armature_deform_verts(amd->object, ob, dm, vertexCos, NULL, numVerts, - amd->deformflag, NULL, amd->defgrp_name); + amd->deformflag, NULL, amd->defgrp_name); if(!derivedData) dm->release(dm); } static void armatureModifier_deformMatricesEM( - ModifierData *md, Object *ob, EditMesh *editData, + ModifierData *md, Object *ob, EditMesh *editData, DerivedMesh *derivedData, float (*vertexCos)[3], - float (*defMats)[3][3], int numVerts) + float (*defMats)[3][3], int numVerts) { ArmatureModifierData *amd = (ArmatureModifierData*) md; DerivedMesh *dm = derivedData; @@ -5304,7 +5304,7 @@ static void armatureModifier_deformMatricesEM( if(!derivedData) dm = CDDM_from_editmesh(editData, ob->data); armature_deform_verts(amd->object, ob, dm, vertexCos, defMats, numVerts, - amd->deformflag, NULL, amd->defgrp_name); + amd->deformflag, NULL, amd->defgrp_name); if(!derivedData) dm->release(dm); } @@ -5362,7 +5362,7 @@ static int hookModifier_isDisabled(ModifierData *md, int useRenderParams) static void hookModifier_foreachObjectLink( ModifierData *md, Object *ob, void (*walk)(void *userData, Object *ob, Object **obpoin), - void *userData) + void *userData) { HookModifierData *hmd = (HookModifierData*) md; @@ -5385,7 +5385,7 @@ static void hookModifier_updateDepgraph(ModifierData *md, DagForest *forest, Sce } static void hookModifier_deformVerts( - ModifierData *md, Object *ob, DerivedMesh *derivedData, + ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) { HookModifierData *hmd = (HookModifierData*) md; @@ -5405,7 +5405,7 @@ static void hookModifier_deformVerts( } invert_m4_m4(ob->imat, ob->obmat); mul_serie_m4(mat, ob->imat, dmat, hmd->parentinv, - NULL, NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL); /* vertex indices? */ if(hmd->indexar) { @@ -5507,7 +5507,7 @@ static void hookModifier_deformVerts( } static void hookModifier_deformVertsEM( - ModifierData *md, Object *ob, EditMesh *editData, + ModifierData *md, Object *ob, EditMesh *editData, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { DerivedMesh *dm = derivedData; @@ -5523,7 +5523,7 @@ static void hookModifier_deformVertsEM( static void softbodyModifier_deformVerts( ModifierData *md, Object *ob, DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) + float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) { sbObjectStep(md->scene, ob, (float)md->scene->r.cfra, vertexCos, numVerts); } @@ -5984,9 +5984,9 @@ static DerivedMesh *solidifyModifier_applyModifier(ModifierData *md, } static DerivedMesh *solidifyModifier_applyModifierEM(ModifierData *md, - Object *ob, - EditMesh *editData, - DerivedMesh *derivedData) + Object *ob, + EditMesh *editData, + DerivedMesh *derivedData) { return solidifyModifier_applyModifier(md, ob, derivedData, 0, 1); } @@ -6075,8 +6075,8 @@ static void screwModifier_copyData(ModifierData *md, ModifierData *target) } static DerivedMesh *screwModifier_applyModifier(ModifierData *md, Object *ob, - DerivedMesh *derivedData, - int useRenderParams, int isFinalCalc) + DerivedMesh *derivedData, + int useRenderParams, int isFinalCalc) { DerivedMesh *dm= derivedData; DerivedMesh *result; @@ -6766,7 +6766,7 @@ static DerivedMesh *screwModifier_applyModifier(ModifierData *md, Object *ob, static void screwModifier_updateDepgraph( - ModifierData *md, DagForest *forest, + ModifierData *md, DagForest *forest, Scene *scene, Object *ob, DagNode *obNode) { ScrewModifierData *ltmd= (ScrewModifierData*) md; @@ -6775,15 +6775,15 @@ static void screwModifier_updateDepgraph( DagNode *curNode= dag_get_node(forest, ltmd->ob_axis); dag_add_relation(forest, curNode, obNode, - DAG_RL_DATA_DATA | DAG_RL_OB_DATA, - "Screw Modifier"); + DAG_RL_DATA_DATA | DAG_RL_OB_DATA, + "Screw Modifier"); } } static void screwModifier_foreachObjectLink( - ModifierData *md, Object *ob, - void (*walk)(void *userData, Object *ob, Object **obpoin), - void *userData) + ModifierData *md, Object *ob, + void (*walk)(void *userData, Object *ob, Object **obpoin), + void *userData) { ScrewModifierData *ltmd= (ScrewModifierData*) md; @@ -6792,8 +6792,8 @@ static void screwModifier_foreachObjectLink( /* This dosnt work with material*/ static DerivedMesh *screwModifier_applyModifierEM( - ModifierData *md, Object *ob, EditMesh *editData, - DerivedMesh *derivedData) + ModifierData *md, Object *ob, EditMesh *editData, + DerivedMesh *derivedData) { return screwModifier_applyModifier(md, ob, derivedData, 0, 1); } @@ -6826,7 +6826,7 @@ static void smokeModifier_freeData(ModifierData *md) static void smokeModifier_deformVerts( ModifierData *md, Object *ob, DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) + float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) { SmokeModifierData *smd = (SmokeModifierData*) md; DerivedMesh *dm = dm= get_cddm(md->scene, ob, NULL, derivedData, vertexCos); @@ -6844,7 +6844,7 @@ static int smokeModifier_dependsOnTime(ModifierData *md) static void smokeModifier_updateDepgraph( ModifierData *md, DagForest *forest, Scene *scene, Object *ob, - DagNode *obNode) + DagNode *obNode) { /*SmokeModifierData *smd = (SmokeModifierData *) md; if(smd && (smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain) @@ -6916,7 +6916,7 @@ static DerivedMesh *clothModifier_applyModifier(ModifierData *md, Object *ob, static void clothModifier_updateDepgraph( ModifierData *md, DagForest *forest, Scene *scene, Object *ob, - DagNode *obNode) + DagNode *obNode) { ClothModifierData *clmd = (ClothModifierData*) md; @@ -7056,7 +7056,7 @@ static int collisionModifier_dependsOnTime(ModifierData *md) static void collisionModifier_deformVerts( ModifierData *md, Object *ob, DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) + float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) { CollisionModifierData *collmd = (CollisionModifierData*) md; DerivedMesh *dm = NULL; @@ -7225,7 +7225,7 @@ static int surfaceModifier_dependsOnTime(ModifierData *md) static void surfaceModifier_deformVerts( ModifierData *md, Object *ob, DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) + float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) { SurfaceModifierData *surmd = (SurfaceModifierData*) md; unsigned int numverts = 0, i = 0; @@ -7319,7 +7319,7 @@ static int booleanModifier_isDisabled(ModifierData *md, int useRenderParams) } static void booleanModifier_foreachObjectLink( - ModifierData *md, Object *ob, + ModifierData *md, Object *ob, void (*walk)(void *userData, Object *ob, Object **obpoin), void *userData) { @@ -7351,7 +7351,7 @@ static DerivedMesh *booleanModifier_applyModifier( /* we do a quick sanity check */ if(dm && (derivedData->getNumFaces(derivedData) > 3) - && bmd->object && dm->getNumFaces(dm) > 3) { + && bmd->object && dm->getNumFaces(dm) > 3) { DerivedMesh *result = NewBooleanDerivedMesh(dm, bmd->object, derivedData, ob, 1 + bmd->operation); @@ -7454,8 +7454,8 @@ static CustomDataMask particleSystemModifier_requiredDataMask(Object *ob, Modifi /* saves the current emitter state for a particle system and calculates particles */ static void particleSystemModifier_deformVerts( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) + ModifierData *md, Object *ob, DerivedMesh *derivedData, + float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) { DerivedMesh *dm = derivedData; ParticleSystemModifierData *psmd= (ParticleSystemModifierData*) md; @@ -7524,8 +7524,8 @@ static void particleSystemModifier_deformVerts( * updates is coded */ #if 0 static void particleSystemModifier_deformVertsEM( - ModifierData *md, Object *ob, EditMesh *editData, - DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) + ModifierData *md, Object *ob, EditMesh *editData, + DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { DerivedMesh *dm = derivedData; @@ -7844,7 +7844,7 @@ static CustomDataMask explodeModifier_requiredDataMask(Object *ob, ModifierData static void explodeModifier_createFacepa(ExplodeModifierData *emd, ParticleSystemModifierData *psmd, - Object *ob, DerivedMesh *dm) + Object *ob, DerivedMesh *dm) { ParticleSystem *psys=psmd->psys; MFace *fa=0, *mface=0; @@ -8683,7 +8683,7 @@ static DerivedMesh * fluidsimModifier_applyModifier( static void fluidsimModifier_updateDepgraph( ModifierData *md, DagForest *forest, Scene *scene, - Object *ob, DagNode *obNode) + Object *ob, DagNode *obNode) { FluidsimModifierData *fluidmd= (FluidsimModifierData*) md; Base *base; @@ -8774,7 +8774,7 @@ static void meshdeformModifier_foreachObjectLink( } static void meshdeformModifier_updateDepgraph( - ModifierData *md, DagForest *forest, Scene *scene, Object *ob, + ModifierData *md, DagForest *forest, Scene *scene, Object *ob, DagNode *obNode) { MeshDeformModifierData *mmd = (MeshDeformModifierData*) md; @@ -8842,7 +8842,7 @@ static float meshdeform_dynamic_bind(MeshDeformModifierData *mmd, float (*dco)[3 static void meshdeformModifier_do( ModifierData *md, Object *ob, DerivedMesh *dm, - float (*vertexCos)[3], int numVerts) + float (*vertexCos)[3], int numVerts) { MeshDeformModifierData *mmd = (MeshDeformModifierData*) md; Mesh *me= (mmd->object)? mmd->object->data: NULL; @@ -9010,7 +9010,7 @@ static void meshdeformModifier_deformVerts( } static void meshdeformModifier_deformVertsEM( - ModifierData *md, Object *ob, EditMesh *editData, + ModifierData *md, Object *ob, EditMesh *editData, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { DerivedMesh *dm; @@ -9263,7 +9263,7 @@ static void simpledeformModifier_deformVertsEM(ModifierData *md, Object *ob, Edi static void shapekeyModifier_deformVerts( ModifierData *md, Object *ob, DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) + float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) { KeyBlock *kb= ob_get_keyblock(ob); float (*deformedVerts)[3]; @@ -9288,9 +9288,9 @@ static void shapekeyModifier_deformVertsEM( } static void shapekeyModifier_deformMatricesEM( - ModifierData *md, Object *ob, EditMesh *editData, + ModifierData *md, Object *ob, EditMesh *editData, DerivedMesh *derivedData, float (*vertexCos)[3], - float (*defMats)[3][3], int numVerts) + float (*defMats)[3][3], int numVerts) { Key *key= ob_get_key(ob); KeyBlock *kb= ob_get_keyblock(ob); @@ -9738,7 +9738,7 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type) mti = INIT_TYPE(Screw); mti->type = eModifierTypeType_Constructive; mti->flags = eModifierTypeFlag_AcceptsMesh - | eModifierTypeFlag_SupportsEditmode + | eModifierTypeFlag_SupportsEditmode | eModifierTypeFlag_EnableInEditmode | eModifierTypeFlag_AcceptsCVs; diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index 248b7ed407d..0d508a4c4d1 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -650,7 +650,7 @@ void multires_stitch_grids(Object *ob) } DerivedMesh *multires_dm_create_from_derived(MultiresModifierData *mmd, int local_mmd, DerivedMesh *dm, Object *ob, - int useRenderParams, int isFinalCalc) + int useRenderParams, int isFinalCalc) { Mesh *me= ob->data; DerivedMesh *result; @@ -840,7 +840,7 @@ void multires_free(Multires *mr) } static void create_old_vert_face_map(ListBase **map, IndexNode **mem, const MultiresFace *mface, - const int totvert, const int totface) + const int totvert, const int totface) { int i,j; IndexNode *node = NULL; @@ -859,7 +859,7 @@ static void create_old_vert_face_map(ListBase **map, IndexNode **mem, const Mult } static void create_old_vert_edge_map(ListBase **map, IndexNode **mem, const MultiresEdge *medge, - const int totvert, const int totedge) + const int totvert, const int totedge) { int i,j; IndexNode *node = NULL; @@ -925,7 +925,7 @@ static void multires_load_old_edges(ListBase **emap, MultiresLevel *lvl, int *vv } static void multires_load_old_faces(ListBase **fmap, ListBase **emap, MultiresLevel *lvl, int *vvmap, int dst, - int v1, int v2, int v3, int v4, int st2, int st3) + int v1, int v2, int v3, int v4, int st2, int st3) { int fmid; int emid13, emid14, emid23, emid24; diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 10da12753e7..98db81d90d0 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -1048,11 +1048,11 @@ bNodeTree *ntreeAddTree(int type) ntree->alltypes.last = NULL; /* this helps RNA identify ID pointers as nodetree */ - if(ntree->type==NTREE_SHADER) + if(ntree->type==NTREE_SHADER) BLI_strncpy(ntree->id.name, "NTShader Nodetree", sizeof(ntree->id.name)); - else if(ntree->type==NTREE_COMPOSIT) + else if(ntree->type==NTREE_COMPOSIT) BLI_strncpy(ntree->id.name, "NTCompositing Nodetree", sizeof(ntree->id.name)); - else if(ntree->type==NTREE_TEXTURE) + else if(ntree->type==NTREE_TEXTURE) BLI_strncpy(ntree->id.name, "NTTexture Nodetree", sizeof(ntree->id.name)); ntreeInitTypes(ntree); @@ -1354,9 +1354,9 @@ void ntreeMakeLocal(bNodeTree *ntree) int local=0, lib=0; /* - only lib users: do nothing - * - only local users: set flag - * - mixed: make copy - */ + * - only local users: set flag + * - mixed: make copy + */ if(ntree->id.lib==NULL) return; if(ntree->id.us==1) { @@ -1547,7 +1547,7 @@ bNode *nodeGetActiveID(bNodeTree *ntree, short idtype) if(ntree==NULL) return NULL; /* check for group edit */ - for(node= ntree->nodes.first; node; node= node->next) + for(node= ntree->nodes.first; node; node= node->next) if(node->flag & NODE_GROUP_EDIT) break; @@ -1571,7 +1571,7 @@ int nodeSetActiveID(bNodeTree *ntree, short idtype, ID *id) if(ntree==NULL) return ok; /* check for group edit */ - for(node= ntree->nodes.first; node; node= node->next) + for(node= ntree->nodes.first; node; node= node->next) if(node->flag & NODE_GROUP_EDIT) break; @@ -2641,7 +2641,7 @@ static void gpu_from_node_stack(ListBase *sockets, bNodeStack **ns, GPUNodeStack for (sock=sockets->first, i=0; sock; sock=sock->next, i++) { memset(&gs[i], 0, sizeof(gs[i])); - QUATCOPY(gs[i].vec, ns[i]->vec); + QUATCOPY(gs[i].vec, ns[i]->vec); gs[i].link= ns[i]->data; if (sock->type == SOCK_VALUE) @@ -2734,7 +2734,7 @@ void ntreeGPUMaterialNodes(bNodeTree *ntree, GPUMaterial *mat) if(node->typeinfo->gpufunc(mat, node, gpuin, gpuout)) data_from_gpu_stack(&node->outputs, nsout, gpuout); } - else if(node->type==NODE_GROUP && node->id) { + else if(node->type==NODE_GROUP && node->id) { node_get_stack(node, stack, nsin, nsout); gpu_node_group_execute(stack, mat, node, nsin, nsout); } @@ -2994,7 +2994,7 @@ void nodeRegisterType(ListBase *typelist, const bNodeType *ntype) bNodeType *ntypen= MEM_callocN(sizeof(bNodeType), "node type"); *ntypen= *ntype; BLI_addtail(typelist, ntypen); - } + } } static void registerCompositNodes(ListBase *ntypelist) diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index b08754a7a3f..b1cb83c0a51 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -710,9 +710,9 @@ void make_local_camera(Camera *cam) int local=0, lib=0; /* - only lib users: do nothing - * - only local users: set flag - * - mixed: make copy - */ + * - only local users: set flag + * - mixed: make copy + */ if(cam->id.lib==0) return; if(cam->id.us==1) { @@ -858,9 +858,9 @@ void make_local_lamp(Lamp *la) int local=0, lib=0; /* - only lib users: do nothing - * - only local users: set flag - * - mixed: make copy - */ + * - only local users: set flag + * - mixed: make copy + */ if(la->id.lib==0) return; if(la->id.us==1) { @@ -1356,9 +1356,9 @@ void make_local_object(Object *ob) int local=0, lib=0; /* - only lib users: do nothing - * - only local users: set flag - * - mixed: make copy - */ + * - only local users: set flag + * - mixed: make copy + */ if(ob->id.lib==NULL) return; @@ -1766,7 +1766,7 @@ static void ob_parcurve(Scene *scene, Object *ob, Object *par, float mat[][4]) /* vec: 4 items! */ - if( where_on_path(par, ctime, vec, dir, NULL, &radius) ) { + if( where_on_path(par, ctime, vec, dir, NULL, &radius) ) { if(cu->flag & CU_FOLLOW) { vec_to_quat( quat,dir, ob->trackflag, ob->upflag); diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index f228dc5002e..48a5c956cc3 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -3466,9 +3466,9 @@ void make_local_particlesettings(ParticleSettings *part) int local=0, lib=0; /* - only lib users: do nothing - * - only local users: set flag - * - mixed: make copy - */ + * - only local users: set flag + * - mixed: make copy + */ if(part->id.lib==0) return; if(part->id.us==1) { @@ -4238,7 +4238,7 @@ void psys_get_dupli_path_transform(ParticleSimulationData *sim, ParticleData *pa normalize_v3(side); cross_v3_v3v3(nor, vec, side); - unit_m4(mat); + unit_m4(mat); VECCOPY(mat[0], vec); VECCOPY(mat[1], side); VECCOPY(mat[2], nor); diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index c73bd732d85..a99a8affbd3 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -286,7 +286,7 @@ void psys_calc_dmcache(Object *ob, DerivedMesh *dm, ParticleSystem *psys) node: the allocated links - total derived mesh element count nodearray: the array of nodes aligned with the base mesh's elements, so - each original elements can reference its derived elements + each original elements can reference its derived elements */ Mesh *me= (Mesh*)ob->data; PARTICLE_P; @@ -511,18 +511,18 @@ static void distribute_particles_in_grid(DerivedMesh *dm, ParticleSystem *psys) static void hammersley_create(float *out, int n, int seed, float amount) { RNG *rng; - double p, t, offs[2]; - int k, kk; + double p, t, offs[2]; + int k, kk; rng = rng_new(31415926 + n + seed); offs[0]= rng_getDouble(rng) + amount; offs[1]= rng_getDouble(rng) + amount; rng_free(rng); - for (k = 0; k < n; k++) { - t = 0; - for (p = 0.5, kk = k; kk; p *= 0.5, kk >>= 1) - if (kk & 1) /* kk mod 2 = 1 */ + for (k = 0; k < n; k++) { + t = 0; + 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); @@ -545,7 +545,7 @@ static void init_mv_jit(float *jit, int num, int seed2, float amount) rng = rng_new(31415926 + num + seed2); x= 0; - num2 = 2 * num; + num2 = 2 * num; for(i=0; i<num2; i+=2) { jit[i]= x + amount*rad1*(0.5f - rng_getFloat(rng)); diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 77c5a9e2673..9f0c7289350 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -1144,7 +1144,7 @@ static PTCacheFile *ptcache_file_open(PTCacheID *pid, int mode, int cfra) if (!BLI_exists(filename)) { return NULL; } - fp = fopen(filename, "rb"); + fp = fopen(filename, "rb"); } else if (mode==PTCACHE_FILE_WRITE) { BLI_make_existing_file(filename); /* will create the dir if needs be, same as //textures is created */ fp = fopen(filename, "wb"); @@ -1153,13 +1153,13 @@ static PTCacheFile *ptcache_file_open(PTCacheID *pid, int mode, int cfra) fp = fopen(filename, "rb+"); } - if (!fp) - return NULL; + if (!fp) + return NULL; pf= MEM_mallocN(sizeof(PTCacheFile), "PTCacheFile"); pf->fp= fp; - return pf; + return pf; } static void ptcache_file_close(PTCacheFile *pf) diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c index bc66f4d52d3..e32f5aac517 100644 --- a/source/blender/blenkernel/intern/sca.c +++ b/source/blender/blenkernel/intern/sca.c @@ -446,18 +446,18 @@ void init_actuator(bActuator *act) case ACT_VISIBILITY: act->data= MEM_callocN(sizeof(bVisibilityActuator), "visibility act"); break; - case ACT_2DFILTER: - act->data = MEM_callocN(sizeof( bTwoDFilterActuator ), "2d filter act"); - break; - case ACT_PARENT: - act->data = MEM_callocN(sizeof( bParentActuator ), "parent act"); - break; + case ACT_2DFILTER: + act->data = MEM_callocN(sizeof( bTwoDFilterActuator ), "2d filter act"); + break; + case ACT_PARENT: + act->data = MEM_callocN(sizeof( bParentActuator ), "parent act"); + break; case ACT_STATE: - act->data = MEM_callocN(sizeof( bStateActuator ), "state act"); - break; + act->data = MEM_callocN(sizeof( bStateActuator ), "state act"); + break; case ACT_ARMATURE: - act->data = MEM_callocN(sizeof( bArmatureActuator ), "armature act"); - break; + act->data = MEM_callocN(sizeof( bArmatureActuator ), "armature act"); + break; default: ; /* this is very severe... I cannot make any memory for this */ /* logic brick... */ diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index d36043a29ee..44035afc059 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -203,17 +203,17 @@ Scene *copy_scene(Main *bmain, Scene *sce, int type) /* NOTE: part of SCE_COPY_LINK_DATA and SCE_COPY_FULL operations * are done outside of blenkernel with ED_objects_single_users! */ - /* camera */ + /* camera */ if(type == SCE_COPY_LINK_DATA || type == SCE_COPY_FULL) { - ID_NEW(scen->camera); + ID_NEW(scen->camera); } /* world */ if(type == SCE_COPY_FULL) { - if(scen->world) { - id_us_plus((ID *)scen->world); - scen->world= copy_world(scen->world); - } + if(scen->world) { + id_us_plus((ID *)scen->world); + scen->world= copy_world(scen->world); + } } sound_create_scene(scen); @@ -235,9 +235,9 @@ void free_scene(Scene *sce) if(sce->gpd) { #if 0 // removed since this can be invalid memory when freeing everything - // since the grease pencil data is free'd before the scene. - // since grease pencil data is not (yet?), shared between objects - // its probably safe not to do this, some save and reload will free this. + // since the grease pencil data is free'd before the scene. + // since grease pencil data is not (yet?), shared between objects + // its probably safe not to do this, some save and reload will free this. sce->gpd->id.us--; #endif sce->gpd= NULL; @@ -620,7 +620,7 @@ int next_object(Scene *scene, int val, Base **base, Object **ob) fase= F_SCENE; } else { - /* exception: empty scene */ + /* exception: empty scene */ if(scene->set && scene->set->base.first) { *base= scene->set->base.first; *ob= (*base)->object; diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index 7cabb620085..33c90d1a94e 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -230,9 +230,9 @@ static ImBuf * IMB_cast_away_list(ImBuf * i) } static void do_plugin_effect(Scene *scene, Sequence *seq, int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, - struct ImBuf *ibuf3, struct ImBuf *out) + float facf0, float facf1, int x, int y, + struct ImBuf *ibuf1, struct ImBuf *ibuf2, + struct ImBuf *ibuf3, struct ImBuf *out) { char *cp; int float_rendering; @@ -323,7 +323,7 @@ static void do_plugin_effect(Scene *scene, Sequence *seq, int cfra, } static int do_plugin_early_out(struct Sequence *seq, - float facf0, float facf1) + float facf0, float facf1) { return 0; } @@ -348,7 +348,7 @@ static void init_alpha_over_or_under(Sequence * seq) } static void do_alphaover_effect_byte(float facf0, float facf1, int x, int y, - char * rect1, char *rect2, char *out) + char * rect1, char *rect2, char *out) { int fac2, mfac, fac, fac4; int xo, tempc; @@ -414,7 +414,7 @@ static void do_alphaover_effect_byte(float facf0, float facf1, int x, int y, } static void do_alphaover_effect_float(float facf0, float facf1, int x, int y, - float * rect1, float *rect2, float *out) + float * rect1, float *rect2, float *out) { float fac2, mfac, fac, fac4; int xo; @@ -568,8 +568,8 @@ void do_alphaunder_effect_byte( static void do_alphaunder_effect_float(float facf0, float facf1, int x, int y, - float *rect1, float *rect2, - float *out) + float *rect1, float *rect2, + float *out) { float fac2, mfac, fac, fac4; int xo; @@ -763,9 +763,9 @@ void do_cross_effect_float(float facf0, float facf1, int x, int y, /* carefull: also used by speed effect! */ static void do_cross_effect(Scene *scene, Sequence *seq, int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, - struct ImBuf *ibuf3, struct ImBuf *out) + float facf0, float facf1, int x, int y, + struct ImBuf *ibuf1, struct ImBuf *ibuf2, + struct ImBuf *ibuf3, struct ImBuf *out) { if (out->rect_float) { do_cross_effect_float( @@ -854,7 +854,7 @@ static float gammaCorrect(float c) if (i < 0) res = -pow(abs(c), valid_gamma); else if (i >= RE_GAMMA_TABLE_SIZE ) res = pow(c, valid_gamma); else res = gamma_range_table[i] + - ( (c - color_domain_table[i]) * gamfactor_table[i]); + ( (c - color_domain_table[i]) * gamfactor_table[i]); return res; } /* end of float gammaCorrect(float col) */ @@ -871,7 +871,7 @@ static float invGammaCorrect(float col) if (i < 0) res = -pow(abs(col), valid_inv_gamma); else if (i >= RE_GAMMA_TABLE_SIZE) res = pow(col, valid_inv_gamma); else res = inv_gamma_range_table[i] + - ( (col - color_domain_table[i]) * inv_gamfactor_table[i]); + ( (col - color_domain_table[i]) * inv_gamfactor_table[i]); return res; } /* end of float invGammaCorrect(float col) */ @@ -926,10 +926,10 @@ static void free_gammacross(Sequence * seq) } static void do_gammacross_effect_byte(float facf0, float facf1, - int x, int y, - unsigned char *rect1, - unsigned char *rect2, - unsigned char *out) + int x, int y, + unsigned char *rect1, + unsigned char *rect2, + unsigned char *out) { int fac1, fac2, col; int xo; @@ -982,9 +982,9 @@ static void do_gammacross_effect_byte(float facf0, float facf1, } static void do_gammacross_effect_float(float facf0, float facf1, - int x, int y, - float *rect1, float *rect2, - float *out) + int x, int y, + float *rect1, float *rect2, + float *out) { float fac1, fac2; int xo; @@ -1050,8 +1050,8 @@ static void do_gammacross_effect(Scene *scene, Sequence *seq, int cfra, ********************************************************************** */ static void do_add_effect_byte(float facf0, float facf1, int x, int y, - unsigned char *rect1, unsigned char *rect2, - unsigned char *out) + unsigned char *rect1, unsigned char *rect2, + unsigned char *out) { int col, xo, fac1, fac3; char *rt1, *rt2, *rt; @@ -1162,8 +1162,8 @@ static void do_add_effect(Scene *scene, Sequence *seq, int cfra, ********************************************************************** */ static void do_sub_effect_byte(float facf0, float facf1, - int x, int y, - char *rect1, char *rect2, char *out) + int x, int y, + char *rect1, char *rect2, char *out) { int col, xo, fac1, fac3; char *rt1, *rt2, *rt; @@ -1382,8 +1382,8 @@ static void do_drop_effect(Scene *scene, Sequence *seq, int cfra, ********************************************************************** */ static void do_mul_effect_byte(float facf0, float facf1, int x, int y, - unsigned char *rect1, unsigned char *rect2, - unsigned char *out) + unsigned char *rect1, unsigned char *rect2, + unsigned char *out) { int xo, fac1, fac3; char *rt1, *rt2, *rt; @@ -1431,8 +1431,8 @@ static void do_mul_effect_byte(float facf0, float facf1, int x, int y, } static void do_mul_effect_float(float facf0, float facf1, int x, int y, - float *rect1, float *rect2, - float *out) + float *rect1, float *rect2, + float *out) { int xo; float fac1, fac3; @@ -1611,13 +1611,13 @@ float hyp3,hyp4,b4,b5 output = in_band(wipezone,width,hyp,facf0,1,1); else output = in_band(wipezone,width,hyp,facf0,0,1); - } + } else { if(b1 < b2) output = in_band(wipezone,width,hyp,facf0,0,1); else output = in_band(wipezone,width,hyp,facf0,1,1); - } + } break; case DO_DOUBLE_WIPE: @@ -1657,50 +1657,50 @@ float hyp3,hyp4,b4,b5 if( hyp < hwidth && hyp2 > hwidth ) output = in_band(wipezone,hwidth,hyp,facf0,1,1); else if( hyp > hwidth && hyp2 < hwidth ) - output = in_band(wipezone,hwidth,hyp2,facf0,1,1); + output = in_band(wipezone,hwidth,hyp2,facf0,1,1); else - output = in_band(wipezone,hwidth,hyp2,facf0,1,1) * in_band(wipezone,hwidth,hyp,facf0,1,1); + output = in_band(wipezone,hwidth,hyp2,facf0,1,1) * in_band(wipezone,hwidth,hyp,facf0,1,1); } if(!wipe->forward)output = 1-output; - break; - case DO_CLOCK_WIPE: - /* - temp1: angle of effect center in rads - temp2: angle of line through (halfx,halfy) and (x,y) in rads - temp3: angle of low side of blur - temp4: angle of high side of blur - */ - output = 1.0f - facf0; - widthf = wipe->edgeWidth*2.0f*(float)M_PI; - temp1 = 2.0f * (float)M_PI * facf0; + break; + case DO_CLOCK_WIPE: + /* + temp1: angle of effect center in rads + temp2: angle of line through (halfx,halfy) and (x,y) in rads + temp3: angle of low side of blur + temp4: angle of high side of blur + */ + output = 1.0f - facf0; + widthf = wipe->edgeWidth*2.0f*(float)M_PI; + temp1 = 2.0f * (float)M_PI * facf0; - if(wipe->forward){ - temp1 = 2.0f*(float)M_PI - temp1; - } + if(wipe->forward){ + temp1 = 2.0f*(float)M_PI - temp1; + } - x = x - halfx; - y = y - halfy; - - temp2 = asin(abs(y)/sqrt(x*x + y*y)); - if(x <= 0 && y >= 0) temp2 = (float)M_PI - temp2; - else if(x<=0 && y <= 0) temp2 += (float)M_PI; - else if(x >= 0 && y <= 0) temp2 = 2.0f*(float)M_PI - temp2; - - if(wipe->forward){ - temp3 = temp1-(widthf*0.5f)*facf0; - temp4 = temp1+(widthf*0.5f)*(1-facf0); - } else{ - temp3 = temp1-(widthf*0.5f)*(1-facf0); - temp4 = temp1+(widthf*0.5f)*facf0; + x = x - halfx; + y = y - halfy; + + temp2 = asin(abs(y)/sqrt(x*x + y*y)); + if(x <= 0 && y >= 0) temp2 = (float)M_PI - temp2; + else if(x<=0 && y <= 0) temp2 += (float)M_PI; + else if(x >= 0 && y <= 0) temp2 = 2.0f*(float)M_PI - temp2; + + if(wipe->forward){ + temp3 = temp1-(widthf*0.5f)*facf0; + temp4 = temp1+(widthf*0.5f)*(1-facf0); + } else{ + temp3 = temp1-(widthf*0.5f)*(1-facf0); + temp4 = temp1+(widthf*0.5f)*facf0; } - if (temp3 < 0) temp3 = 0; - if (temp4 > 2.0f*(float)M_PI) temp4 = 2.0f*(float)M_PI; + if (temp3 < 0) temp3 = 0; + if (temp4 > 2.0f*(float)M_PI) temp4 = 2.0f*(float)M_PI; - if(temp2 < temp3) output = 0; - else if (temp2 > temp4) output = 1; - else output = (temp2-temp3)/(temp4-temp3); - if(x == 0 && y == 0) output = 1; + if(temp2 < temp3) output = 0; + else if (temp2 > temp4) output = 1; + else output = (temp2-temp3)/(temp4-temp3); + if(x == 0 && y == 0) output = 1; if(output != output) output = 1; if(wipe->forward) output = 1 - output; break; @@ -1735,9 +1735,9 @@ float hyp3,hyp4,b4,b5 if( hyp < hwidth && hyp2 > hwidth ) output = in_band(wipezone,hwidth,hyp,facf0,1,1); else if( hyp > hwidth && hyp2 < hwidth ) - output = in_band(wipezone,hwidth,hyp2,facf0,1,1); + output = in_band(wipezone,hwidth,hyp2,facf0,1,1); else - output = in_band(wipezone,hwidth,hyp2,facf0,1,1) * in_band(wipezone,hwidth,hyp,facf0,1,1); + output = in_band(wipezone,hwidth,hyp2,facf0,1,1) * in_band(wipezone,hwidth,hyp,facf0,1,1); } if(invert)facf0 = 1-facf0; @@ -1776,11 +1776,11 @@ float hyp3,hyp4,b4,b5 hwidth = width*0.5f; temp1 = (halfx-(halfx)*facf0); - pointdist = sqrt(temp1*temp1 + temp1*temp1); + pointdist = sqrt(temp1*temp1 + temp1*temp1); - temp2 = sqrt((halfx-x)*(halfx-x) + (halfy-y)*(halfy-y)); - if(temp2 > pointdist) output = in_band(wipezone,hwidth,fabs(temp2-pointdist),facf0,0,1); - else output = in_band(wipezone,hwidth,fabs(temp2-pointdist),facf0,1,1); + temp2 = sqrt((halfx-x)*(halfx-x) + (halfy-y)*(halfy-y)); + if(temp2 > pointdist) output = in_band(wipezone,hwidth,fabs(temp2-pointdist),facf0,0,1); + else output = in_band(wipezone,hwidth,fabs(temp2-pointdist),facf0,1,1); if(!wipe->forward) output = 1-output; @@ -1936,14 +1936,14 @@ static void do_wipe_effect(Scene *scene, Sequence *seq, int cfra, { if (out->rect_float) { do_wipe_effect_float(seq, - facf0, facf1, x, y, - ibuf1->rect_float, ibuf2->rect_float, - out->rect_float); + facf0, facf1, x, y, + ibuf1->rect_float, ibuf2->rect_float, + out->rect_float); } else { do_wipe_effect_byte(seq, - facf0, facf1, x, y, - (unsigned char*) ibuf1->rect, (unsigned char*) ibuf2->rect, - (unsigned char*) out->rect); + facf0, facf1, x, y, + (unsigned char*) ibuf1->rect, (unsigned char*) ibuf2->rect, + (unsigned char*) out->rect); } } /* ********************************************************************** @@ -2466,8 +2466,8 @@ static void RVAddBitmaps_float (float* a, float* b, float* c, /* For each pixel whose total luminance exceeds the threshold, */ /* Multiply it's value by BOOST and add it to the output map */ static void RVIsolateHighlights_byte (unsigned char* in, unsigned char* out, - int width, int height, int threshold, - float boost, float clamp) + int width, int height, int threshold, + float boost, float clamp) { int x,y,index; int intensity; @@ -2475,7 +2475,7 @@ static void RVIsolateHighlights_byte (unsigned char* in, unsigned char* out, for(y=0;y< height;y++) { for (x=0;x< width;x++) { - index= (x+y*width)*4; + index= (x+y*width)*4; /* Isolate the intensity */ intensity=(in[index+GlowR]+in[index+GlowG]+in[index+GlowB]-threshold); @@ -2495,8 +2495,8 @@ static void RVIsolateHighlights_byte (unsigned char* in, unsigned char* out, } static void RVIsolateHighlights_float (float* in, float* out, - int width, int height, float threshold, - float boost, float clamp) + int width, int height, float threshold, + float boost, float clamp) { int x,y,index; float intensity; @@ -2504,7 +2504,7 @@ static void RVIsolateHighlights_float (float* in, float* out, for(y=0;y< height;y++) { for (x=0;x< width;x++) { - index= (x+y*width)*4; + index= (x+y*width)*4; /* Isolate the intensity */ intensity=(in[index+GlowR]+in[index+GlowG]+in[index+GlowB]-threshold); @@ -2593,14 +2593,14 @@ static void do_glow_effect(Scene *scene, Sequence *seq, int cfra, { if (out->rect_float) { do_glow_effect_float(seq, - facf0, facf1, x, y, - ibuf1->rect_float, ibuf2->rect_float, - out->rect_float); + facf0, facf1, x, y, + ibuf1->rect_float, ibuf2->rect_float, + out->rect_float); } else { do_glow_effect_byte(seq, - facf0, facf1, x, y, - (char*) ibuf1->rect, (char*) ibuf2->rect, - (char*) out->rect); + facf0, facf1, x, y, + (char*) ibuf1->rect, (char*) ibuf2->rect, + (char*) out->rect); } } @@ -2726,7 +2726,7 @@ static void init_speed_effect(Sequence *seq) if(seq->effectdata) MEM_freeN(seq->effectdata); seq->effectdata = MEM_callocN(sizeof(struct SpeedControlVars), - "speedcontrolvars"); + "speedcontrolvars"); v = (SpeedControlVars *)seq->effectdata; v->globalSpeed = 1.0; @@ -2807,7 +2807,7 @@ void sequence_effect_speed_rebuild_map(Scene *scene, Sequence * seq, int force) return; } if (!seq->seq1) { /* make coverity happy and check for (CID 598) - input strip ... */ + input strip ... */ return; } @@ -2854,16 +2854,16 @@ void sequence_effect_speed_rebuild_map(Scene *scene, Sequence * seq, int force) for (cfra = 1; cfra < v->length; cfra++) { if(fcu) { - if((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) { - ctime = seq->startdisp + cfra; - div = 1.0; - } else { - ctime= cfra; - div= v->length / 100.0f; - if(div==0.0) return; - } + if((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) { + ctime = seq->startdisp + cfra; + div = 1.0; + } else { + ctime= cfra; + div= v->length / 100.0f; + if(div==0.0) return; + } - facf = evaluate_fcurve(fcu, ctime/div); + facf = evaluate_fcurve(fcu, ctime/div); } else { facf = fallback_fac; } @@ -2885,19 +2885,19 @@ void sequence_effect_speed_rebuild_map(Scene *scene, Sequence * seq, int force) for (cfra = 0; cfra < v->length; cfra++) { if(fcu) { - if((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) { - ctime = seq->startdisp + cfra; - div = 1.0; - } else { - ctime= cfra; - div= v->length / 100.0f; - if(div==0.0) return; - } + if((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) { + ctime = seq->startdisp + cfra; + div = 1.0; + } else { + ctime= cfra; + div= v->length / 100.0f; + if(div==0.0) return; + } - facf = evaluate_fcurve(fcu, ctime / div); - if (v->flags & SEQ_SPEED_COMPRESS_IPO_Y) { - facf *= v->length; - } + facf = evaluate_fcurve(fcu, ctime / div); + if (v->flags & SEQ_SPEED_COMPRESS_IPO_Y) { + facf *= v->length; + } } if (!fcu) { @@ -3005,16 +3005,16 @@ static void get_default_fac_fade(struct Sequence *seq, int cfra, } static void do_overdrop_effect(Scene *scene, Sequence *seq, int cfra, - float fac, float facf, - int x, int y, struct ImBuf * ibuf1, - struct ImBuf * ibuf2, - struct ImBuf * ibuf3, - struct ImBuf * out) + float fac, float facf, + int x, int y, struct ImBuf * ibuf1, + struct ImBuf * ibuf2, + struct ImBuf * ibuf3, + struct ImBuf * out) { do_drop_effect(scene, seq, cfra, fac, facf, x, y, - ibuf1, ibuf2, ibuf3, out); + ibuf1, ibuf2, ibuf3, out); do_alphaover_effect(scene, seq, cfra, fac, facf, x, y, - ibuf1, ibuf2, ibuf3, out); + ibuf1, ibuf2, ibuf3, out); } static struct SeqEffectHandle get_sequence_effect_impl(int seq_type) diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 1309bdf465b..17f6bd10859 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -426,7 +426,7 @@ void build_seqar(ListBase *seqbase, Sequence ***seqar, int *totseq) } static void do_seq_count_cb(ListBase *seqbase, int *totseq, - int (*test_func)(Sequence * seq)) + int (*test_func)(Sequence * seq)) { Sequence *seq; @@ -444,7 +444,7 @@ static void do_seq_count_cb(ListBase *seqbase, int *totseq, } static void do_build_seqar_cb(ListBase *seqbase, Sequence ***seqar, int depth, - int (*test_func)(Sequence * seq)) + int (*test_func)(Sequence * seq)) { Sequence *seq; @@ -466,7 +466,7 @@ static void do_build_seqar_cb(ListBase *seqbase, Sequence ***seqar, int depth, } void build_seqar_cb(ListBase *seqbase, Sequence ***seqar, int *totseq, - int (*test_func)(Sequence * seq)) + int (*test_func)(Sequence * seq)) { Sequence **tseqar; @@ -581,7 +581,7 @@ void reload_sequence_new_file(Scene *scene, Sequence * seq) new_tstripdata(seq); if (seq->type != SEQ_SCENE && seq->type != SEQ_META && - seq->type != SEQ_IMAGE) { + seq->type != SEQ_IMAGE) { BLI_join_dirfile(str, seq->strip->dir, seq->strip->stripdata->name); BLI_path_abs(str, G.sce); } @@ -939,7 +939,7 @@ static void do_effect(Scene *scene, int cfra, Sequence *seq, TStripElem * se) se3= se->se3; if ( (se1==0 || se2==0 || se3==0) - || (se1->ibuf==0 || se2->ibuf==0 || se3->ibuf==0)) { + || (se1->ibuf==0 || se2->ibuf==0 || se3->ibuf==0)) { make_black_ibuf(se->ibuf); return; } @@ -1056,7 +1056,7 @@ static TStripElem *give_tstripelem(Sequence *seq, int cfra) se = seq->strip->tstripdata; if (se == 0 && seq->len > 0) { se = seq->strip->tstripdata = alloc_tstripdata(seq->len, - "tstripelems"); + "tstripelems"); } nr = give_stripelem_index(seq, cfra); @@ -1074,7 +1074,7 @@ static TStripElem *give_tstripelem(Sequence *seq, int cfra) alpha over mode... */ if (seq->blend_mode != SEQ_BLEND_REPLACE || - (/*seq->ipo && seq->ipo->curve.first &&*/ + (/*seq->ipo && seq->ipo->curve.first &&*/ (!(seq->type & SEQ_EFFECT) || !seq->seq1))) { Strip * s = seq->strip; if (cfra < seq->start) { @@ -1325,7 +1325,7 @@ static struct ImBuf * seq_proxy_fetch(Scene *scene, Sequence * seq, int cfra, in #if 0 static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int cfra, - int build_proxy_run, int render_size); + int build_proxy_run, int render_size); static void seq_proxy_build_frame(Scene *scene, Sequence * seq, int cfra, int render_size) { @@ -1348,7 +1348,7 @@ static void seq_proxy_build_frame(Scene *scene, Sequence * seq, int cfra, int re /* that's why it is called custom... */ if (seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) { return; - } + } if (!seq_proxy_get_fname(scene, seq, cfra, name, render_size)) { return; @@ -1425,7 +1425,7 @@ static void seq_proxy_rebuild(Scene *scene, Sequence * seq) sequential order */ if (seq->flag & SEQ_REVERSE_FRAMES) { for (cfra = seq->enddisp-seq->endstill-1; - cfra >= seq->startdisp + seq->startstill; cfra--) { + cfra >= seq->startdisp + seq->startstill; cfra--) { TStripElem * tse = give_tstripelem(seq, cfra); if (!(tse->flag & STRIPELEM_PREVIEW_DONE)) { @@ -1439,7 +1439,7 @@ static void seq_proxy_rebuild(Scene *scene, Sequence * seq) } } else { for (cfra = seq->startdisp + seq->startstill; - cfra < seq->enddisp - seq->endstill; cfra++) { + cfra < seq->enddisp - seq->endstill; cfra++) { TStripElem * tse = give_tstripelem(seq, cfra); if (!(tse->flag & STRIPELEM_PREVIEW_DONE)) { @@ -1499,12 +1499,12 @@ static StripColorBalance calc_cb(StripColorBalance * cb_) } static void make_cb_table_byte(float lift, float gain, float gamma, - unsigned char * table, float mul) + unsigned char * table, float mul) { int y; for (y = 0; y < 256; y++) { - float v = 1.0 * y / 255; + float v = 1.0 * y / 255; v *= gain; v += lift; v = pow(v, gamma); @@ -1525,7 +1525,7 @@ static void make_cb_table_float(float lift, float gain, float gamma, int y; for (y = 0; y < 256; y++) { - float v = (float) y * 1.0 / 255.0; + float v = (float) y * 1.0 / 255.0; v *= gain; v += lift; v = pow(v, gamma); @@ -1574,7 +1574,7 @@ static void color_balance_byte_float(Sequence * seq, TStripElem* se, float mul) for (c = 0; c < 3; c++) { make_cb_table_float(cb.lift[c], cb.gain[c], cb.gamma[c], - cb_tab[c], mul); + cb_tab[c], mul); } for (i = 0; i < 256; i++) { @@ -1631,8 +1631,8 @@ static void color_balance(Sequence * seq, TStripElem* se, float mul) - Flip X + Flip Y (could be done afterwards, backward compatibility) - Promote image to float data (affects pipeline operations afterwards) - Color balance (is most efficient in the byte -> float - (future: half -> float should also work fine!) - case, if done on load, since we can use lookup tables) + (future: half -> float should also work fine!) + case, if done on load, since we can use lookup tables) - Premultiply */ @@ -1642,13 +1642,13 @@ static int input_have_to_preprocess(Scene *scene, Sequence * seq, TStripElem* se float mul; if ((seq->flag & SEQ_FILTERY) || - (seq->flag & SEQ_USE_CROP) || - (seq->flag & SEQ_USE_TRANSFORM) || - (seq->flag & SEQ_FLIPX) || - (seq->flag & SEQ_FLIPY) || - (seq->flag & SEQ_USE_COLOR_BALANCE) || - (seq->flag & SEQ_MAKE_PREMUL) || - (se->ibuf->x != seqrectx || se->ibuf->y != seqrecty)) { + (seq->flag & SEQ_USE_CROP) || + (seq->flag & SEQ_USE_TRANSFORM) || + (seq->flag & SEQ_FLIPX) || + (seq->flag & SEQ_FLIPY) || + (seq->flag & SEQ_USE_COLOR_BALANCE) || + (seq->flag & SEQ_MAKE_PREMUL) || + (se->ibuf->x != seqrectx || se->ibuf->y != seqrecty)) { return TRUE; } @@ -1703,8 +1703,8 @@ static void input_preprocess(Scene *scene, Sequence *seq, TStripElem *se, int cf } if (c.top + c.bottom >= se->ibuf->y || - c.left + c.right >= se->ibuf->x || - t.xofs >= dx || t.yofs >= dy) { + c.left + c.right >= se->ibuf->x || + t.xofs >= dx || t.yofs >= dy) { make_black_ibuf(se->ibuf); } else { ImBuf * i; @@ -1716,9 +1716,9 @@ static void input_preprocess(Scene *scene, Sequence *seq, TStripElem *se, int cf } IMB_rectcpy(i, se->ibuf, - t.xofs, t.yofs, - c.left, c.bottom, - sx, sy); + t.xofs, t.yofs, + c.left, c.bottom, + sx, sy); IMB_freeImBuf(se->ibuf); @@ -1783,7 +1783,7 @@ static void input_preprocess(Scene *scene, Sequence *seq, TStripElem *se, int cf if(se->ibuf->x != seqrectx || se->ibuf->y != seqrecty ) { if(scene->r.mode & R_OSA) { IMB_scaleImBuf(se->ibuf, - (short)seqrectx, (short)seqrecty); + (short)seqrectx, (short)seqrecty); } else { IMB_scalefastImBuf(se->ibuf, (short)seqrectx, (short)seqrecty); @@ -1818,14 +1818,14 @@ static void test_and_auto_discard_ibuf_stills(Strip * strip) { if (strip->ibuf_startstill) { if (!strip->ibuf_startstill->rect && - !strip->ibuf_startstill->rect_float) { + !strip->ibuf_startstill->rect_float) { IMB_freeImBuf(strip->ibuf_startstill); strip->ibuf_startstill = 0; } } if (strip->ibuf_endstill) { if (!strip->ibuf_endstill->rect && - !strip->ibuf_endstill->rect_float) { + !strip->ibuf_endstill->rect_float) { IMB_freeImBuf(strip->ibuf_endstill); strip->ibuf_endstill = 0; } @@ -1841,8 +1841,8 @@ static void copy_from_ibuf_still(Sequence * seq, TStripElem * se) se->ibuf = IMB_dupImBuf(seq->strip->ibuf_startstill); } if (se->nr == seq->len - 1 - && (seq->len != 1) - && seq->strip->ibuf_endstill) { + && (seq->len != 1) + && seq->strip->ibuf_endstill) { IMB_cache_limiter_touch(seq->strip->ibuf_endstill); se->ibuf = IMB_dupImBuf(seq->strip->ibuf_endstill); @@ -1938,7 +1938,7 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene, ListBase *seqbasep, int cfra, int chanshown, int render_size); static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int cfra, - int build_proxy_run, int render_size) + int build_proxy_run, int render_size) { char name[FILE_MAXDIR+FILE_MAXFILE]; int use_limiter = TRUE; @@ -1973,7 +1973,7 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int se->ibuf = meta_se->ibuf_comp; if(se->ibuf && (!input_have_to_preprocess(scene, seq, se, cfra) || - build_proxy_run)) { + build_proxy_run)) { IMB_refImBuf(se->ibuf); if (build_proxy_run) { IMB_cache_limiter_unref(se->ibuf); @@ -2021,9 +2021,9 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int do_effect(scene, cfra, seq, se); if (input_have_to_preprocess(scene, seq, se, cfra) && - !build_proxy_run) { + !build_proxy_run) { if ((se->se1 && (se->ibuf == se->se1->ibuf)) || - (se->se2 && (se->ibuf == se->se2->ibuf))) { + (se->se2 && (se->ibuf == se->se2->ibuf))) { struct ImBuf * i = IMB_dupImBuf(se->ibuf); @@ -2087,8 +2087,8 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int se->ibuf = IMB_anim_absolute(seq->anim, se->nr + seq->anim_startofs); /* we don't need both (speed reasons)! */ if (se->ibuf - && se->ibuf->rect_float - && se->ibuf->rect) { + && se->ibuf->rect_float + && se->ibuf->rect) { imb_freerectImBuf(se->ibuf); } @@ -2347,7 +2347,7 @@ static TStripElem* do_handle_speed_effect(Scene *scene, Sequence * seq, int cfra } if (cfra_left == cfra_right || - (s->flags & SEQ_SPEED_BLEND) == 0) { + (s->flags & SEQ_SPEED_BLEND) == 0) { test_and_auto_discard_ibuf(se); if (se->ibuf == NULL) { @@ -2458,8 +2458,8 @@ static int seq_must_swap_input_in_blend_mode(Sequence * seq) those two effects */ if (seq->blend_mode == SEQ_ALPHAOVER || - seq->blend_mode == SEQ_ALPHAUNDER || - seq->blend_mode == SEQ_OVERDROP) { + seq->blend_mode == SEQ_ALPHAUNDER || + seq->blend_mode == SEQ_OVERDROP) { swap_input = TRUE; } @@ -2495,7 +2495,7 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene, TStripElem* se = 0; count = get_shown_sequences(seqbasep, cfra, chanshown, - (Sequence **)&seq_arr); + (Sequence **)&seq_arr); if (!count) { return 0; @@ -2519,7 +2519,7 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene, if(count == 1) { se = do_build_seq_recursively(scene, seq_arr[0], - cfra, render_size); + cfra, render_size); if (se->ibuf) { se->ibuf_comp = se->ibuf; IMB_refImBuf(se->ibuf_comp); @@ -2632,7 +2632,7 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene, continue; if (se1->ibuf_comp->rect_float || - se2->ibuf->rect_float) { + se2->ibuf->rect_float) { se2->ibuf_comp = IMB_allocImBuf( (short)seqrectx, (short)seqrecty, 32, IB_rectfloat, 0); @@ -2644,20 +2644,20 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene, if (!se1->ibuf_comp->rect_float && - se2->ibuf_comp->rect_float) { + se2->ibuf_comp->rect_float) { IMB_float_from_rect(se1->ibuf_comp); } if (!se2->ibuf->rect_float && - se2->ibuf_comp->rect_float) { + se2->ibuf_comp->rect_float) { IMB_float_from_rect(se2->ibuf); } if (!se1->ibuf_comp->rect && - !se2->ibuf_comp->rect_float) { + !se2->ibuf_comp->rect_float) { IMB_rect_from_float(se1->ibuf_comp); } if (!se2->ibuf->rect && - !se2->ibuf_comp->rect_float) { + !se2->ibuf_comp->rect_float) { IMB_rect_from_float(se2->ibuf); } @@ -2944,8 +2944,8 @@ static void seq_stop_threads() seq_thread_shutdown = TRUE; - pthread_cond_broadcast(&wakeup_cond); - pthread_mutex_unlock(&wakeup_lock); + pthread_cond_broadcast(&wakeup_cond); + pthread_mutex_unlock(&wakeup_lock); for(tslot = running_threads.first; tslot; tslot= tslot->next) { pthread_join(tslot->pthread, NULL); @@ -3043,10 +3043,10 @@ ImBuf *give_ibuf_seq_threaded(Scene *scene, int rectx, int recty, int cfra, int for (e = prefetch_done.first; e; e = e->next) { if (cfra == e->cfra && - chanshown == e->chanshown && - rectx == e->rectx && - recty == e->recty && - render_size == e->render_size) { + chanshown == e->chanshown && + rectx == e->rectx && + recty == e->recty && + render_size == e->render_size) { success = TRUE; found_something = TRUE; break; @@ -3056,10 +3056,10 @@ ImBuf *give_ibuf_seq_threaded(Scene *scene, int rectx, int recty, int cfra, int if (!e) { for (e = prefetch_wait.first; e; e = e->next) { if (cfra == e->cfra && - chanshown == e->chanshown && - rectx == e->rectx && - recty == e->recty && - render_size == e->render_size) { + chanshown == e->chanshown && + rectx == e->rectx && + recty == e->recty && + render_size == e->render_size) { found_something = TRUE; break; } @@ -3070,13 +3070,13 @@ ImBuf *give_ibuf_seq_threaded(Scene *scene, int rectx, int recty, int cfra, int PrefetchThread *tslot; for(tslot = running_threads.first; - tslot; tslot= tslot->next) { + tslot; tslot= tslot->next) { if (tslot->current && - cfra == tslot->current->cfra && - chanshown == tslot->current->chanshown && - rectx == tslot->current->rectx && - recty == tslot->current->recty && - render_size== tslot->current->render_size){ + cfra == tslot->current->cfra && + chanshown == tslot->current->chanshown && + rectx == tslot->current->rectx && + recty == tslot->current->recty && + render_size== tslot->current->render_size){ found_something = TRUE; break; } @@ -3148,19 +3148,19 @@ static void free_imbuf_seq_except(Scene *scene, int cfra) TStripElem * curelem = give_tstripelem(seq, cfra); for(a = 0, se = seq->strip->tstripdata; - a < seq->strip->len && se; a++, se++) { + a < seq->strip->len && se; a++, se++) { if(se != curelem) { free_imbuf_strip_elem(se); } } for(a = 0, se = seq->strip->tstripdata_startstill; - a < seq->strip->startstill && se; a++, se++) { + a < seq->strip->startstill && se; a++, se++) { if(se != curelem) { free_imbuf_strip_elem(se); } } for(a = 0, se = seq->strip->tstripdata_endstill; - a < seq->strip->endstill && se; a++, se++) { + a < seq->strip->endstill && se; a++, se++) { if(se != curelem) { free_imbuf_strip_elem(se); } @@ -3219,15 +3219,15 @@ void free_imbuf_seq(Scene *scene, ListBase * seqbase, int check_mem_usage) for(seq= seqbase->first; seq; seq= seq->next) { if(seq->strip) { for(a = 0, se = seq->strip->tstripdata; - a < seq->strip->len && se; a++, se++) { + a < seq->strip->len && se; a++, se++) { free_imbuf_strip_elem(se); } for(a = 0, se = seq->strip->tstripdata_startstill; - a < seq->strip->startstill && se; a++, se++) { + a < seq->strip->startstill && se; a++, se++) { free_imbuf_strip_elem(se); } for(a = 0, se = seq->strip->tstripdata_endstill; - a < seq->strip->endstill && se; a++, se++) { + a < seq->strip->endstill && se; a++, se++) { free_imbuf_strip_elem(se); } if(seq->strip->ibuf_startstill) { diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index 129e39ca588..00e81063760 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -1279,11 +1279,11 @@ long long smoke_get_mem_req(int xres, int yres, int zres, int amplify) // print out memory requirements long long int coarseSize = sizeof(float) * totalCells * 22 + - sizeof(unsigned char) * totalCells; + sizeof(unsigned char) * totalCells; long long int fineSize = sizeof(float) * amplifiedCells * 7 + // big grids - sizeof(float) * totalCells * 8 + // small grids - sizeof(float) * 128 * 128 * 128; // noise tile + sizeof(float) * totalCells * 8 + // small grids + sizeof(float) * 128 * 128 * 128; // noise tile long long int totalMB = (coarseSize + fineSize) / (1024 * 1024); @@ -1292,83 +1292,83 @@ long long smoke_get_mem_req(int xres, int yres, int zres, int amplify) static void bresenham_linie_3D(int x1, int y1, int z1, int x2, int y2, int z2, float *tRay, bresenham_callback cb, float *result, float *input, int res[3], float correct) { - int dx, dy, dz, i, l, m, n, x_inc, y_inc, z_inc, err_1, err_2, dx2, dy2, dz2; - int pixel[3]; - - pixel[0] = x1; - pixel[1] = y1; - pixel[2] = z1; - - dx = x2 - x1; - dy = y2 - y1; - dz = z2 - z1; - - x_inc = (dx < 0) ? -1 : 1; - l = abs(dx); - y_inc = (dy < 0) ? -1 : 1; - m = abs(dy); - z_inc = (dz < 0) ? -1 : 1; - n = abs(dz); - dx2 = l << 1; - dy2 = m << 1; - dz2 = n << 1; - - if ((l >= m) && (l >= n)) { - err_1 = dy2 - l; - err_2 = dz2 - l; - for (i = 0; i < l; i++) { - if(cb(result, input, res, pixel, tRay, correct) <= FLT_EPSILON) - break; - if (err_1 > 0) { - pixel[1] += y_inc; - err_1 -= dx2; - } - if (err_2 > 0) { - pixel[2] += z_inc; - err_2 -= dx2; - } - err_1 += dy2; - err_2 += dz2; - pixel[0] += x_inc; - } - } else if ((m >= l) && (m >= n)) { - err_1 = dx2 - m; - err_2 = dz2 - m; - for (i = 0; i < m; i++) { - if(cb(result, input, res, pixel, tRay, correct) <= FLT_EPSILON) - break; - if (err_1 > 0) { - pixel[0] += x_inc; - err_1 -= dy2; - } - if (err_2 > 0) { - pixel[2] += z_inc; - err_2 -= dy2; - } - err_1 += dx2; - err_2 += dz2; - pixel[1] += y_inc; - } - } else { - err_1 = dy2 - n; - err_2 = dx2 - n; - for (i = 0; i < n; i++) { - if(cb(result, input, res, pixel, tRay, correct) <= FLT_EPSILON) - break; - if (err_1 > 0) { - pixel[1] += y_inc; - err_1 -= dz2; - } - if (err_2 > 0) { - pixel[0] += x_inc; - err_2 -= dz2; - } - err_1 += dy2; - err_2 += dx2; - pixel[2] += z_inc; - } - } - cb(result, input, res, pixel, tRay, correct); + int dx, dy, dz, i, l, m, n, x_inc, y_inc, z_inc, err_1, err_2, dx2, dy2, dz2; + int pixel[3]; + + pixel[0] = x1; + pixel[1] = y1; + pixel[2] = z1; + + dx = x2 - x1; + dy = y2 - y1; + dz = z2 - z1; + + x_inc = (dx < 0) ? -1 : 1; + l = abs(dx); + y_inc = (dy < 0) ? -1 : 1; + m = abs(dy); + z_inc = (dz < 0) ? -1 : 1; + n = abs(dz); + dx2 = l << 1; + dy2 = m << 1; + dz2 = n << 1; + + if ((l >= m) && (l >= n)) { + err_1 = dy2 - l; + err_2 = dz2 - l; + for (i = 0; i < l; i++) { + if(cb(result, input, res, pixel, tRay, correct) <= FLT_EPSILON) + break; + if (err_1 > 0) { + pixel[1] += y_inc; + err_1 -= dx2; + } + if (err_2 > 0) { + pixel[2] += z_inc; + err_2 -= dx2; + } + err_1 += dy2; + err_2 += dz2; + pixel[0] += x_inc; + } + } else if ((m >= l) && (m >= n)) { + err_1 = dx2 - m; + err_2 = dz2 - m; + for (i = 0; i < m; i++) { + if(cb(result, input, res, pixel, tRay, correct) <= FLT_EPSILON) + break; + if (err_1 > 0) { + pixel[0] += x_inc; + err_1 -= dy2; + } + if (err_2 > 0) { + pixel[2] += z_inc; + err_2 -= dy2; + } + err_1 += dx2; + err_2 += dz2; + pixel[1] += y_inc; + } + } else { + err_1 = dy2 - n; + err_2 = dx2 - n; + for (i = 0; i < n; i++) { + if(cb(result, input, res, pixel, tRay, correct) <= FLT_EPSILON) + break; + if (err_1 > 0) { + pixel[1] += y_inc; + err_1 -= dz2; + } + if (err_2 > 0) { + pixel[0] += x_inc; + err_2 -= dz2; + } + err_1 += dy2; + err_2 += dx2; + pixel[2] += z_inc; + } + } + cb(result, input, res, pixel, tRay, correct); } static void get_cell(float *p0, int res[3], float dx, float *pos, int *cell, int correct) diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 4b19e71dfca..e6f500aab15 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -123,7 +123,7 @@ typedef struct SBScratch { typedef struct SB_thread_context { Scene *scene; - Object *ob; + Object *ob; float forcetime; float timenow; int ifirst; @@ -191,7 +191,7 @@ static float sb_time_scale(Object *ob) /*hrms .. this could be IPO as well :) estimated range [0.001 sluggish slug - 100.0 very fast (i hope ODE solver can handle that)] 1 approx = a unit 1 pendulum at g = 9.8 [earth conditions] has period 65 frames - theory would give a 50 frames period .. so there must be something inaccurate .. looking for that (BM) + theory would give a 50 frames period .. so there must be something inaccurate .. looking for that (BM) */ } return (1.0f); @@ -280,7 +280,7 @@ typedef struct ccd_Mesh { static ccd_Mesh *ccd_mesh_make(Object *ob, DerivedMesh *dm) { - ccd_Mesh *pccd_M = NULL; + ccd_Mesh *pccd_M = NULL; ccdf_minmax *mima =NULL; MFace *mface=NULL; float v[3],hull; @@ -299,17 +299,17 @@ static ccd_Mesh *ccd_mesh_make(Object *ob, DerivedMesh *dm) pccd_M->mprevvert=NULL; - /* blow it up with forcefield ranges */ + /* blow it up with forcefield ranges */ hull = MAX2(ob->pd->pdef_sbift,ob->pd->pdef_sboft); /* alloc and copy verts*/ pccd_M->mvert = dm->dupVertArray(dm); - /* ah yeah, put the verices to global coords once */ + /* ah yeah, put the verices to global coords once */ /* and determine the ortho BB on the fly */ for(i=0; i < pccd_M->totvert; i++){ mul_m4_v3(ob->obmat, pccd_M->mvert[i].co); - /* evaluate limits */ + /* evaluate limits */ VECCOPY(v,pccd_M->mvert[i].co); pccd_M->bbmin[0] = MIN2(pccd_M->bbmin[0],v[0]-hull); pccd_M->bbmin[1] = MIN2(pccd_M->bbmin[1],v[1]-hull); @@ -321,10 +321,10 @@ static ccd_Mesh *ccd_mesh_make(Object *ob, DerivedMesh *dm) } /* alloc and copy faces*/ - pccd_M->mface = dm->dupFaceArray(dm); + pccd_M->mface = dm->dupFaceArray(dm); /* OBBs for idea1 */ - pccd_M->mima = MEM_mallocN(sizeof(ccdf_minmax)*pccd_M->totface,"ccd_Mesh_Faces_mima"); + pccd_M->mima = MEM_mallocN(sizeof(ccdf_minmax)*pccd_M->totface,"ccd_Mesh_Faces_mima"); mima = pccd_M->mima; mface = pccd_M->mface; @@ -334,7 +334,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob, DerivedMesh *dm) mima->minx=mima->miny=mima->minz=1e30f; mima->maxx=mima->maxy=mima->maxz=-1e30f; - VECCOPY(v,pccd_M->mvert[mface->v1].co); + VECCOPY(v,pccd_M->mvert[mface->v1].co); mima->minx = MIN2(mima->minx,v[0]-hull); mima->miny = MIN2(mima->miny,v[1]-hull); mima->minz = MIN2(mima->minz,v[2]-hull); @@ -342,7 +342,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob, DerivedMesh *dm) mima->maxy = MAX2(mima->maxy,v[1]+hull); mima->maxz = MAX2(mima->maxz,v[2]+hull); - VECCOPY(v,pccd_M->mvert[mface->v2].co); + VECCOPY(v,pccd_M->mvert[mface->v2].co); mima->minx = MIN2(mima->minx,v[0]-hull); mima->miny = MIN2(mima->miny,v[1]-hull); mima->minz = MIN2(mima->minz,v[2]-hull); @@ -377,7 +377,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob, DerivedMesh *dm) } static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm) { - ccdf_minmax *mima =NULL; + ccdf_minmax *mima =NULL; MFace *mface=NULL; float v[3],hull; int i; @@ -393,20 +393,20 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm) pccd_M->bbmax[0]=pccd_M->bbmax[1]=pccd_M->bbmax[2]=-1e30f; - /* blow it up with forcefield ranges */ + /* blow it up with forcefield ranges */ hull = MAX2(ob->pd->pdef_sbift,ob->pd->pdef_sboft); /* rotate current to previous */ if(pccd_M->mprevvert) MEM_freeN(pccd_M->mprevvert); - pccd_M->mprevvert = pccd_M->mvert; + pccd_M->mprevvert = pccd_M->mvert; /* alloc and copy verts*/ - pccd_M->mvert = dm->dupVertArray(dm); - /* ah yeah, put the verices to global coords once */ + pccd_M->mvert = dm->dupVertArray(dm); + /* ah yeah, put the verices to global coords once */ /* and determine the ortho BB on the fly */ for(i=0; i < pccd_M->totvert; i++){ mul_m4_v3(ob->obmat, pccd_M->mvert[i].co); - /* evaluate limits */ + /* evaluate limits */ VECCOPY(v,pccd_M->mvert[i].co); pccd_M->bbmin[0] = MIN2(pccd_M->bbmin[0],v[0]-hull); pccd_M->bbmin[1] = MIN2(pccd_M->bbmin[1],v[1]-hull); @@ -416,7 +416,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm) pccd_M->bbmax[1] = MAX2(pccd_M->bbmax[1],v[1]+hull); pccd_M->bbmax[2] = MAX2(pccd_M->bbmax[2],v[2]+hull); - /* evaluate limits */ + /* evaluate limits */ VECCOPY(v,pccd_M->mprevvert[i].co); pccd_M->bbmin[0] = MIN2(pccd_M->bbmin[0],v[0]-hull); pccd_M->bbmin[1] = MIN2(pccd_M->bbmin[1],v[1]-hull); @@ -437,7 +437,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm) mima->minx=mima->miny=mima->minz=1e30f; mima->maxx=mima->maxy=mima->maxz=-1e30f; - VECCOPY(v,pccd_M->mvert[mface->v1].co); + VECCOPY(v,pccd_M->mvert[mface->v1].co); mima->minx = MIN2(mima->minx,v[0]-hull); mima->miny = MIN2(mima->miny,v[1]-hull); mima->minz = MIN2(mima->minz,v[2]-hull); @@ -445,7 +445,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm) mima->maxy = MAX2(mima->maxy,v[1]+hull); mima->maxz = MAX2(mima->maxz,v[2]+hull); - VECCOPY(v,pccd_M->mvert[mface->v2].co); + VECCOPY(v,pccd_M->mvert[mface->v2].co); mima->minx = MIN2(mima->minx,v[0]-hull); mima->miny = MIN2(mima->miny,v[1]-hull); mima->minz = MIN2(mima->minz,v[2]-hull); @@ -472,7 +472,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm) } - VECCOPY(v,pccd_M->mprevvert[mface->v1].co); + VECCOPY(v,pccd_M->mprevvert[mface->v1].co); mima->minx = MIN2(mima->minx,v[0]-hull); mima->miny = MIN2(mima->miny,v[1]-hull); mima->minz = MIN2(mima->minz,v[2]-hull); @@ -480,7 +480,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm) mima->maxy = MAX2(mima->maxy,v[1]+hull); mima->maxz = MAX2(mima->maxz,v[2]+hull); - VECCOPY(v,pccd_M->mprevvert[mface->v2].co); + VECCOPY(v,pccd_M->mprevvert[mface->v2].co); mima->minx = MIN2(mima->minx,v[0]-hull); mima->miny = MIN2(mima->miny,v[1]-hull); mima->minz = MIN2(mima->minz,v[2]-hull); @@ -667,7 +667,7 @@ static void add_mesh_quad_diag_springs(Object *ob) } } - /* now we can announce new springs */ + /* now we can announce new springs */ ob->soft->totspring += nofquads *2; } } @@ -703,7 +703,7 @@ static void add_2nd_order_roller(Object *ob,float stiffness,int *counter, int ad } else {printf("oops we should not get here - add_2nd_order_springs");} } - if (bpo){/* so now we have a 2nd order humpdidump */ + if (bpo){/* so now we have a 2nd order humpdidump */ for(c=bpo->nofsprings;c>0;c--){ bs2 = sb->bspring + bpo->springs[c-1]; if ((bs2->v1 != notthis) && (bs2->v1 > v0)){ @@ -711,7 +711,7 @@ static void add_2nd_order_roller(Object *ob,float stiffness,int *counter, int ad if (addsprings){ bs3->v1= v0; bs3->v2= bs2->v1; - bs3->springtype =SB_BEND; + bs3->springtype =SB_BEND; bs3++; } } @@ -720,7 +720,7 @@ static void add_2nd_order_roller(Object *ob,float stiffness,int *counter, int ad if (addsprings){ bs3->v1= v0; bs3->v2= bs2->v2; - bs3->springtype =SB_BEND; + bs3->springtype =SB_BEND; bs3++; } @@ -1039,7 +1039,7 @@ static int sb_detect_aabb_collisionCached( float force[3], unsigned int par_laye hash = vertexowner->soft->scratch->colliderhash; ihash = BLI_ghashIterator_new(hash); - while (!BLI_ghashIterator_isDone(ihash) ) { + while (!BLI_ghashIterator_isDone(ihash) ) { ccd_Mesh *ccdm = BLI_ghashIterator_getValue (ihash); ob = BLI_ghashIterator_getKey (ihash); @@ -1068,7 +1068,7 @@ static int sb_detect_aabb_collisionCached( float force[3], unsigned int par_laye } /* so now we have the 2 boxes overlapping */ - /* forces actually not used */ + /* forces actually not used */ deflected = 2; } @@ -1114,7 +1114,7 @@ static int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float fa hash = vertexowner->soft->scratch->colliderhash; ihash = BLI_ghashIterator_new(hash); - while (!BLI_ghashIterator_isDone(ihash) ) { + while (!BLI_ghashIterator_isDone(ihash) ) { ccd_Mesh *ccdm = BLI_ghashIterator_getValue (ihash); ob = BLI_ghashIterator_getKey (ihash); @@ -1205,7 +1205,7 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa hash = vertexowner->soft->scratch->colliderhash; ihash = BLI_ghashIterator_new(hash); - while (!BLI_ghashIterator_isDone(ihash) ) { + while (!BLI_ghashIterator_isDone(ihash) ) { ccd_Mesh *ccdm = BLI_ghashIterator_getValue (ihash); ob = BLI_ghashIterator_getKey (ihash); @@ -1396,11 +1396,11 @@ static void scan_for_ext_face_forces(Object *ob,float timenow) for(a=0; a<sb->scratch->totface; a++, bf++) { if (( bf->flag & BFF_INTERSECT) || ( bf->flag & BFF_CLOSEVERT)) { - sb->bpoint[bf->v1].choke2=MAX2(sb->bpoint[bf->v1].choke2,choke); - sb->bpoint[bf->v2].choke2=MAX2(sb->bpoint[bf->v2].choke2,choke); - sb->bpoint[bf->v3].choke2=MAX2(sb->bpoint[bf->v3].choke2,choke); + sb->bpoint[bf->v1].choke2=MAX2(sb->bpoint[bf->v1].choke2,choke); + sb->bpoint[bf->v2].choke2=MAX2(sb->bpoint[bf->v2].choke2,choke); + sb->bpoint[bf->v3].choke2=MAX2(sb->bpoint[bf->v3].choke2,choke); if (bf->v4){ - sb->bpoint[bf->v2].choke2=MAX2(sb->bpoint[bf->v2].choke2,choke); + sb->bpoint[bf->v2].choke2=MAX2(sb->bpoint[bf->v2].choke2,choke); } } } @@ -1433,7 +1433,7 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa hash = vertexowner->soft->scratch->colliderhash; ihash = BLI_ghashIterator_new(hash); - while (!BLI_ghashIterator_isDone(ihash) ) { + while (!BLI_ghashIterator_isDone(ihash) ) { ccd_Mesh *ccdm = BLI_ghashIterator_getValue (ihash); ob = BLI_ghashIterator_getKey (ihash); @@ -1583,7 +1583,7 @@ static void _scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow, add_v3_v3v3(bs->ext_force,bs->ext_force,feedback); bs->flag |= BSF_INTERSECT; //bs->cf=damp; - bs->cf=sb->choke*0.01f; + bs->cf=sb->choke*0.01f; } } @@ -1690,8 +1690,8 @@ static void sb_sfesf_threads_run(Scene *scene, struct Object *ob, float timenow, } else sb_threads[i].ifirst = 0; - sb_threads[i].do_effector = do_effector; - sb_threads[i].do_deflector = 0;// not used here + sb_threads[i].do_effector = do_effector; + sb_threads[i].do_deflector = 0;// not used here sb_threads[i].fieldfactor = 0.0f;// not used here sb_threads[i].windfactor = 0.0f;// not used here sb_threads[i].nr= i; @@ -1707,7 +1707,7 @@ static void sb_sfesf_threads_run(Scene *scene, struct Object *ob, float timenow, } else exec_scan_for_ext_spring_forces(&sb_threads[0]); - /* clean up */ + /* clean up */ MEM_freeN(sb_threads); pdEndEffectors(&do_effector); @@ -1722,7 +1722,7 @@ static int choose_winner(float*w, float* pos,float*a,float*b,float*c,float*ca,fl int winner =1; mindist = ABS(dot_v3v3(pos,a)); - cp = ABS(dot_v3v3(pos,b)); + cp = ABS(dot_v3v3(pos,b)); if ( mindist < cp ){ mindist = cp; winner =2; @@ -1751,7 +1751,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], GHash *hash; GHashIterator *ihash; float nv1[3], nv2[3], nv3[3], nv4[3], edge1[3], edge2[3],d_nvect[3], dv1[3],ve[3],avel[3]={0.0,0.0,0.0}, - vv1[3], vv2[3], vv3[3], vv4[3], coledge[3]={0.0f, 0.0f, 0.0f}, mindistedge = 1000.0f, + vv1[3], vv2[3], vv3[3], vv4[3], coledge[3]={0.0f, 0.0f, 0.0f}, mindistedge = 1000.0f, outerforceaccu[3],innerforceaccu[3], facedist,n_mag,force_mag_norm,minx,miny,minz,maxx,maxy,maxz, innerfacethickness = -0.5f, outerfacethickness = 0.2f, @@ -1764,7 +1764,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], outerforceaccu[0]=outerforceaccu[1]=outerforceaccu[2]=0.0f; innerforceaccu[0]=innerforceaccu[1]=innerforceaccu[2]=0.0f; /* go */ - while (!BLI_ghashIterator_isDone(ihash) ) { + while (!BLI_ghashIterator_isDone(ihash) ) { ccd_Mesh *ccdm = BLI_ghashIterator_getValue (ihash); ob = BLI_ghashIterator_getKey (ihash); @@ -1815,7 +1815,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], fa = (ff*outerfacethickness-outerfacethickness); fa *= fa; fa = 1.0f/fa; - avel[0]=avel[1]=avel[2]=0.0f; + avel[0]=avel[1]=avel[2]=0.0f; /* use mesh*/ while (a--) { if ( @@ -1938,7 +1938,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], VECADD(avel,avel,ve); cavel ++; } - *intrusion += facedist; + *intrusion += facedist; ci++; } @@ -1948,7 +1948,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], float dist; closest_to_line_segment_v3(ve, opco, nv1, nv2); - VECSUB(ve,opco,ve); + VECSUB(ve,opco,ve); dist = normalize_v3(ve); if ((dist < outerfacethickness)&&(dist < mindistedge )){ VECCOPY(coledge,ve); @@ -1957,7 +1957,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], } closest_to_line_segment_v3(ve, opco, nv2, nv3); - VECSUB(ve,opco,ve); + VECSUB(ve,opco,ve); dist = normalize_v3(ve); if ((dist < outerfacethickness)&&(dist < mindistedge )){ VECCOPY(coledge,ve); @@ -1966,7 +1966,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], } closest_to_line_segment_v3(ve, opco, nv3, nv1); - VECSUB(ve,opco,ve); + VECSUB(ve,opco,ve); dist = normalize_v3(ve); if ((dist < outerfacethickness)&&(dist < mindistedge )){ VECCOPY(coledge,ve); @@ -2181,11 +2181,11 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo /* intitialize */ if (sb) { /* check conditions for various options */ - /* +++ could be done on object level to squeeze out the last bits of it */ + /* +++ could be done on object level to squeeze out the last bits of it */ do_selfcollision=((ob->softflag & OB_SB_EDGES) && (sb->bspring)&& (ob->softflag & OB_SB_SELF)); do_springcollision=do_deflector && (ob->softflag & OB_SB_EDGES) &&(ob->softflag & OB_SB_EDGECOLL); do_aero=((sb->aeroedge)&& (ob->softflag & OB_SB_EDGES)); - /* --- could be done on object level to squeeze out the last bits of it */ + /* --- could be done on object level to squeeze out the last bits of it */ } else { printf("Error expected a SB here \n"); @@ -2207,14 +2207,14 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo /* naive ball self collision */ /* needs to be done if goal snaps or not */ if(do_selfcollision){ - int attached; + int attached; BodyPoint *obp; BodySpring *bs; int c,b; float velcenter[3],dvel[3],def[3]; float distance; float compare; - float bstune = sb->ballstiff; + float bstune = sb->ballstiff; for(c=sb->totpoint, obp= sb->bpoint; c>=ifirst+bb; c--, obp++) { compare = (obp->colball + bp->colball); @@ -2222,7 +2222,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo /* rather check the AABBoxes before ever calulating the real distance */ /* mathematically it is completly nuts, but performace is pretty much (3) times faster */ if ((ABS(def[0]) > compare) || (ABS(def[1]) > compare) || (ABS(def[2]) > compare)) continue; - distance = normalize_v3(def); + distance = normalize_v3(def); if (distance < compare ){ /* exclude body points attached with a spring */ attached = 0; @@ -2363,7 +2363,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo bp->choke = bs->cf; } - // sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float forcetime,int nl_flags) + // sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float forcetime,int nl_flags) sb_spring_force(ob,ilast-bb,bs,iks,forcetime,0); }/* loop springs */ }/* existing spring list */ @@ -2377,7 +2377,7 @@ return 0; /*done fine*/ static void *exec_softbody_calc_forces(void *data) { SB_thread_context *pctx = (SB_thread_context*)data; - _softbody_calc_forces_slice_in_a_thread(pctx->scene, pctx->ob, pctx->forcetime, pctx->timenow, pctx->ifirst, pctx->ilast, NULL, pctx->do_effector,pctx->do_deflector,pctx->fieldfactor,pctx->windfactor); + _softbody_calc_forces_slice_in_a_thread(pctx->scene, pctx->ob, pctx->forcetime, pctx->timenow, pctx->ifirst, pctx->ilast, NULL, pctx->do_effector,pctx->do_deflector,pctx->fieldfactor,pctx->windfactor); return 0; } @@ -2398,7 +2398,7 @@ static void sb_cf_threads_run(Scene *scene, Object *ob, float forcetime, float t totthread--; } - /* printf("sb_cf_threads_run spawning %d threads \n",totthread); */ + /* printf("sb_cf_threads_run spawning %d threads \n",totthread); */ sb_threads= MEM_callocN(sizeof(SB_thread_context)*totthread, "SBThread"); memset(sb_threads, 0, sizeof(SB_thread_context)*totthread); @@ -2416,8 +2416,8 @@ static void sb_cf_threads_run(Scene *scene, Object *ob, float forcetime, float t } else sb_threads[i].ifirst = 0; - sb_threads[i].do_effector = do_effector; - sb_threads[i].do_deflector = do_deflector; + sb_threads[i].do_effector = do_effector; + sb_threads[i].do_deflector = do_deflector; sb_threads[i].fieldfactor = fieldfactor; sb_threads[i].windfactor = windfactor; sb_threads[i].nr= i; @@ -2435,7 +2435,7 @@ static void sb_cf_threads_run(Scene *scene, Object *ob, float forcetime, float t } else exec_softbody_calc_forces(&sb_threads[0]); - /* clean up */ + /* clean up */ MEM_freeN(sb_threads); } @@ -2904,12 +2904,12 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float * float maxerrpos= 0.0f,maxerrvel = 0.0f; int a,fuzzy=0; - forcetime *= sb_time_scale(ob); + forcetime *= sb_time_scale(ob); - aabbmin[0]=aabbmin[1]=aabbmin[2] = 1e20f; - aabbmax[0]=aabbmax[1]=aabbmax[2] = -1e20f; + aabbmin[0]=aabbmin[1]=aabbmin[2] = 1e20f; + aabbmax[0]=aabbmax[1]=aabbmax[2] = -1e20f; - /* old one with homogenous masses */ + /* old one with homogenous masses */ /* claim a minimum mass for vertex */ /* if (sb->nodemass > 0.009999f) timeovermass = forcetime/sb->nodemass; @@ -2920,11 +2920,11 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float * /* now we have individual masses */ /* claim a minimum mass for vertex */ if (_final_mass(ob,bp) > 0.009999f) timeovermass = forcetime/_final_mass(ob,bp); - else timeovermass = forcetime/0.009999f; + else timeovermass = forcetime/0.009999f; if(_final_goal(ob,bp) < SOFTGOALSNAP){ - /* this makes t~ = t */ + /* this makes t~ = t */ if(mid_flags & MID_PRESERVE) VECCOPY(dx,bp->vec); /* so here is (v)' = a(cceleration) = sum(F_springs)/m + gravitation + some friction forces + more forces*/ @@ -2952,7 +2952,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float * } else {VECADD(bp->vec, bp->vec, bp->force);} - /* this makes t~ = t+dt */ + /* this makes t~ = t+dt */ if(!(mid_flags & MID_PRESERVE)) VECCOPY(dx,bp->vec); /* so here is (x)'= v(elocity) */ @@ -2969,7 +2969,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float * bp->frozen =MIN2(bp->frozen*1.05f,1.0f); } mul_v3_fl(dx,bp->frozen); - */ + */ /* again some nasty if's to have heun in here too */ if (mode ==1){ VECCOPY(bp->prevpos,bp->pos); @@ -3102,12 +3102,12 @@ static void softbody_swap_state(Object *ob,float *ppos,float *pvel) VECCOPY(temp, bp->vec); VECCOPY(bp->vec,pv); - VECCOPY(pv,temp); + VECCOPY(pv,temp); pv+=3; VECCOPY(temp, bp->pos); VECCOPY(bp->pos,pp); - VECCOPY(pp,temp); + VECCOPY(pp,temp); pp+=3; } } @@ -3185,7 +3185,7 @@ static void interpolate_exciter(Object *ob, int timescale, int time) /* ************ convertors ********** */ /* for each object type we need; - - xxxx_to_softbody(Object *ob) : a full (new) copy, creates SB geometry + - xxxx_to_softbody(Object *ob) : a full (new) copy, creates SB geometry */ static void get_scalar_from_vertexgroup(Object *ob, int vertID, short groupindex, float *target) @@ -3294,7 +3294,7 @@ static void mesh_to_softbody(Scene *scene, Object *ob) /* this is where '2.5 every thing is animateable' goes wrong in the first place jow_go_for2_5 */ /* 1st coding action to take : move this to frame level */ /* reads: leave the bp->goal as it was read from vertex group / or default .. we will need it at per frame call */ - /* should be fixed for meshes */ + /* should be fixed for meshes */ // bp->goal= sb->mingoal + bp->goal*goalfac; /* do not do here jow_go_for2_5 */ } else{ @@ -3358,7 +3358,7 @@ static void mesh_to_softbody(Scene *scene, Object *ob) build_bps_springlist(ob); /* yes we need to do it again*/ } springs_from_mesh(ob); /* write the 'rest'-lenght of the springs */ - if (ob->softflag & OB_SB_SELF) {calculate_collision_balls(ob);} + if (ob->softflag & OB_SB_SELF) {calculate_collision_balls(ob);} } @@ -3515,7 +3515,7 @@ static void lattice_to_softbody(Scene *scene, Object *ob) if (ob->softflag & OB_SB_EDGES){ totspring = ((lt->pntsu -1) * lt->pntsv - + (lt->pntsv -1) * lt->pntsu) * lt->pntsw + + (lt->pntsv -1) * lt->pntsu) * lt->pntsw +lt->pntsu*lt->pntsv*(lt->pntsw -1); if (ob->softflag & OB_SB_QUADS){ totspring += 4*(lt->pntsu -1) * (lt->pntsv -1) * (lt->pntsw-1); @@ -4110,7 +4110,7 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i if(sb->totpoint==0) { return; } - if(framenr == startframe) { + if(framenr == startframe) { BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED); /* first frame, no simulation to do, just set the positions */ diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index c5c3ae0f022..937351b4992 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -374,7 +374,7 @@ static void set_subsurf_uv(CCGSubSurf *ss, DerivedMesh *dm, DerivedMesh *result, /* face weighting */ static void calc_ss_weights(int gridFaces, - FaceVertWeight **qweight, FaceVertWeight **tweight) + FaceVertWeight **qweight, FaceVertWeight **tweight) { FaceVertWeight *qw, *tw; int x, y, j; @@ -417,7 +417,7 @@ static void calc_ss_weights(int gridFaces, } static void ss_sync_from_derivedmesh(CCGSubSurf *ss, DerivedMesh *dm, - float (*vertexCos)[3], int useFlatSubdiv) + float (*vertexCos)[3], int useFlatSubdiv) { float creaseFactor = (float) ccgSubSurf_getSubdivisionLevels(ss); CCGVertHDL fVerts[4]; @@ -456,10 +456,10 @@ static void ss_sync_from_derivedmesh(CCGSubSurf *ss, DerivedMesh *dm, float crease; crease = useFlatSubdiv ? creaseFactor : - me->crease * creaseFactor / 255.0f; + me->crease * creaseFactor / 255.0f; ccgSubSurf_syncEdge(ss, SET_INT_IN_POINTER(i), SET_INT_IN_POINTER(me->v1), - SET_INT_IN_POINTER(me->v2), crease, &e); + SET_INT_IN_POINTER(me->v2), crease, &e); ((int*)ccgSubSurf_getEdgeUserData(ss, e))[1] = (index)? *index++: i; } @@ -479,7 +479,7 @@ static void ss_sync_from_derivedmesh(CCGSubSurf *ss, DerivedMesh *dm, // other parts of code significantly to handle missing faces. // since this really shouldn't even be possible we just bail. if(ccgSubSurf_syncFace(ss, SET_INT_IN_POINTER(i), fVerts[3] ? 4 : 3, - fVerts, &f) == eCCGError_InvalidValue) { + fVerts, &f) == eCCGError_InvalidValue) { static int hasGivenError = 0; if(!hasGivenError) { @@ -852,7 +852,7 @@ static void ccgDM_copyFinalEdgeArray(DerivedMesh *dm, MEdge *medge) MEdge *med = &medge[i]; if(ccgdm->drawInteriorEdges) - med->flag = ME_EDGEDRAW | ME_EDGERENDER; + med->flag = ME_EDGEDRAW | ME_EDGERENDER; med->v1 = getFaceIndex(ss, f, S, x, 0, edgeSize, gridSize); med->v2 = getFaceIndex(ss, f, S, x + 1, 0, edgeSize, gridSize); i++; @@ -864,20 +864,20 @@ static void ccgDM_copyFinalEdgeArray(DerivedMesh *dm, MEdge *medge) med = &medge[i]; if(ccgdm->drawInteriorEdges) - med->flag = ME_EDGEDRAW | ME_EDGERENDER; + med->flag = ME_EDGEDRAW | ME_EDGERENDER; med->v1 = getFaceIndex(ss, f, S, x, y, - edgeSize, gridSize); + edgeSize, gridSize); med->v2 = getFaceIndex(ss, f, S, x, y + 1, - edgeSize, gridSize); + edgeSize, gridSize); i++; med = &medge[i]; if(ccgdm->drawInteriorEdges) - med->flag = ME_EDGEDRAW | ME_EDGERENDER; + med->flag = ME_EDGEDRAW | ME_EDGERENDER; med->v1 = getFaceIndex(ss, f, S, y, x, - edgeSize, gridSize); + edgeSize, gridSize); med->v2 = getFaceIndex(ss, f, S, y + 1, x, - edgeSize, gridSize); + edgeSize, gridSize); i++; } } @@ -896,7 +896,7 @@ static void ccgDM_copyFinalEdgeArray(DerivedMesh *dm, MEdge *medge) if(edgeFlags) { if(edgeIdx != -1) { flags |= (edgeFlags[index] & (ME_SEAM | ME_SHARP)) - | ME_EDGEDRAW | ME_EDGERENDER; + | ME_EDGEDRAW | ME_EDGERENDER; } } else { flags |= ME_EDGEDRAW | ME_EDGERENDER; @@ -935,13 +935,13 @@ static void ccgDM_copyFinalFaceArray(DerivedMesh *dm, MFace *mface) for(x = 0; x < gridSize - 1; x++) { MFace *mf = &mface[i]; mf->v1 = getFaceIndex(ss, f, S, x + 0, y + 0, - edgeSize, gridSize); + edgeSize, gridSize); mf->v2 = getFaceIndex(ss, f, S, x + 0, y + 1, - edgeSize, gridSize); + edgeSize, gridSize); mf->v3 = getFaceIndex(ss, f, S, x + 1, y + 1, - edgeSize, gridSize); + edgeSize, gridSize); mf->v4 = getFaceIndex(ss, f, S, x + 1, y + 0, - edgeSize, gridSize); + edgeSize, gridSize); mf->mat_nr = mat_nr; mf->flag = flag; @@ -1767,8 +1767,8 @@ static void ccgDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *u if (draw) { if (draw==2) { - glEnable(GL_POLYGON_STIPPLE); - glPolygonStipple(stipple_quarttone); + glEnable(GL_POLYGON_STIPPLE); + glPolygonStipple(stipple_quarttone); } for (S=0; S<numVerts; S++) { @@ -2208,16 +2208,16 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm) ccgdm->pbvh = BLI_pbvh_new(); BLI_pbvh_build_mesh(ccgdm->pbvh, me->mface, me->mvert, - me->totface, me->totvert); + me->totface, me->totvert); } return ccgdm->pbvh; } static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss, - int drawInteriorEdges, - int useSubsurfUv, - DerivedMesh *dm) + int drawInteriorEdges, + int useSubsurfUv, + DerivedMesh *dm) { CCGDerivedMesh *ccgdm = MEM_callocN(sizeof(*ccgdm), "ccgdm"); CCGVertIterator *vi; @@ -2365,7 +2365,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss, } DM_interp_vert_data(dm, &ccgdm->dm, vertIdx, weight[0][0], - numVerts, vertNum); + numVerts, vertNum); ++vertNum; for(S = 0; S < numVerts; S++) { @@ -2379,7 +2379,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss, w[nextS] = weight[x][0][2]; w[otherS] = weight[x][0][3]; DM_interp_vert_data(dm, &ccgdm->dm, vertIdx, w, - numVerts, vertNum); + numVerts, vertNum); ++vertNum; } } @@ -2396,7 +2396,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss, w[nextS] = weight[y * gridFaces + x][0][2]; w[otherS] = weight[y * gridFaces + x][0][3]; DM_interp_vert_data(dm, &ccgdm->dm, vertIdx, w, - numVerts, vertNum); + numVerts, vertNum); ++vertNum; } } @@ -2422,7 +2422,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss, } DM_interp_face_data(dm, &ccgdm->dm, &origIndex, NULL, - &w, 1, faceNum); + &w, 1, faceNum); weight++; ++faceNum; @@ -2505,10 +2505,10 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss, /***/ struct DerivedMesh *subsurf_make_derived_from_derived( - struct DerivedMesh *dm, - struct SubsurfModifierData *smd, - int useRenderParams, float (*vertCos)[3], - int isFinalCalc, int editMode) + struct DerivedMesh *dm, + struct SubsurfModifierData *smd, + int useRenderParams, float (*vertCos)[3], + int isFinalCalc, int editMode) { int useSimple = smd->subdivType == ME_SIMPLE_SUBSURF; int useAging = smd->flags & eSubsurfModifierFlag_DebugIncr; @@ -2520,12 +2520,12 @@ struct DerivedMesh *subsurf_make_derived_from_derived( int levels= (smd->modifier.scene)? get_render_subsurf_level(&smd->modifier.scene->r, smd->levels): smd->levels; smd->emCache = _getSubSurf(smd->emCache, levels, useAging, 0, - useSimple); + useSimple); ss_sync_from_derivedmesh(smd->emCache, dm, vertCos, useSimple); result = getCCGDerivedMesh(smd->emCache, - drawInteriorEdges, - useSubsurfUv, dm); + drawInteriorEdges, + useSubsurfUv, dm); } else if(useRenderParams) { /* Do not use cache in render mode. */ CCGSubSurf *ss; @@ -2563,13 +2563,13 @@ struct DerivedMesh *subsurf_make_derived_from_derived( if(useIncremental && isFinalCalc) { smd->mCache = ss = _getSubSurf(smd->mCache, levels, - useAging, 0, useSimple); + useAging, 0, useSimple); ss_sync_from_derivedmesh(ss, dm, vertCos, useSimple); result = getCCGDerivedMesh(smd->mCache, - drawInteriorEdges, - useSubsurfUv, dm); + drawInteriorEdges, + useSubsurfUv, dm); } else { if (smd->mCache && isFinalCalc) { ccgSubSurf_free(smd->mCache); diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index a0908529a3a..98ff0b2da1a 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -184,7 +184,7 @@ Text *add_empty_text(char *name) ta->name= NULL; - init_undo_text(ta); + init_undo_text(ta); ta->nlines=1; ta->flags= TXT_ISDIRTY | TXT_ISMEM; diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 0a3f46b617e..48f819a7091 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -643,9 +643,9 @@ void make_local_texture(Tex *tex) int a, local=0, lib=0; /* - only lib users: do nothing - * - only local users: set flag - * - mixed: make copy - */ + * - only local users: set flag + * - mixed: make copy + */ if(tex->id.lib==0) return; diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c index 0ac8b14166d..1e1e41a07e7 100644 --- a/source/blender/blenkernel/intern/world.c +++ b/source/blender/blenkernel/intern/world.c @@ -135,9 +135,9 @@ void make_local_world(World *wrld) int local=0, lib=0; /* - only lib users: do nothing - * - only local users: set flag - * - mixed: make copy - */ + * - only local users: set flag + * - mixed: make copy + */ if(wrld->id.lib==0) return; if(wrld->id.us==1) { diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index ccef6832be8..ff6ebcc487f 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -206,7 +206,7 @@ static const char** get_file_extensions(int format) } case FFMPEG_MPEG2: { static const char * rv[] = { ".dvd", ".vob", ".mpg", ".mpeg", - NULL }; + NULL }; return rv; } case FFMPEG_MPEG4: { @@ -271,7 +271,7 @@ static int write_video_frame(RenderData *rd, AVFrame* frame, ReportList *reports } outsize = avcodec_encode_video(c, video_buffer, video_buffersize, - frame); + frame); if (outsize != 0) { AVPacket packet; av_init_packet(&packet); @@ -446,7 +446,7 @@ static void set_ffmpeg_properties(RenderData *rd, AVCodecContext *c, const char /* prepare a video stream for the output file */ static AVStream* alloc_video_stream(RenderData *rd, int codec_id, AVFormatContext* of, - int rectx, int recty) + int rectx, int recty) { AVStream* st; AVCodecContext* c; @@ -552,7 +552,7 @@ static AVStream* alloc_video_stream(RenderData *rd, int codec_id, AVFormatContex video_buffersize = 2000000; video_buffer = (uint8_t*)MEM_mallocN(video_buffersize, - "FFMPEG video buffer"); + "FFMPEG video buffer"); current_frame = alloc_picture(c->pix_fmt, c->width, c->height); @@ -1053,7 +1053,7 @@ IDProperty *ffmpeg_property_add(RenderData *rd, char * type, int opt_index, int /* not all versions of ffmpeg include that, so here we go ... */ static const AVOption *my_av_find_opt(void *v, const char *name, - const char *unit, int mask, int flags){ + const char *unit, int mask, int flags){ AVClass *c= *(AVClass**)v; const AVOption *o= c->option; diff --git a/source/blender/blenkernel/intern/writeframeserver.c b/source/blender/blenkernel/intern/writeframeserver.c index d715d18877d..cf3a36419b4 100644 --- a/source/blender/blenkernel/intern/writeframeserver.c +++ b/source/blender/blenkernel/intern/writeframeserver.c @@ -201,7 +201,7 @@ static int handle_request(RenderData *rd, char * req) *p = 0; if (strcmp(path, "/index.html") == 0 - || strcmp(path, "/") == 0) { + || strcmp(path, "/") == 0) { safe_puts(index_page); return -1; } @@ -287,7 +287,7 @@ int frameserver_loop(RenderData *rd, ReportList *reports) tv.tv_sec = 10; tv.tv_usec = 0; - rval = select(connsock + 1, &readfds, NULL, NULL, &tv); + rval = select(connsock + 1, &readfds, NULL, NULL, &tv); if (rval > 0) { break; } else if (rval == 0) { |