From 84bf3e48c098d6971bab0ac55b4f413adc04708e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 6 Jul 2012 23:56:59 +0000 Subject: style cleanup: use c style comments in C code --- source/blender/blenkernel/intern/DerivedMesh.c | 38 +++++++------- source/blender/blenkernel/intern/action.c | 16 +++--- source/blender/blenkernel/intern/anim.c | 52 ++++++++++---------- source/blender/blenkernel/intern/anim_sys.c | 58 +++++++++++----------- source/blender/blenkernel/intern/blender.c | 4 +- source/blender/blenkernel/intern/bmfont.c | 52 ++++++++++---------- source/blender/blenkernel/intern/bvhutils.c | 4 +- source/blender/blenkernel/intern/cloth.c | 54 ++++++++++---------- source/blender/blenkernel/intern/collision.c | 68 +++++++++++++------------- source/blender/blenkernel/intern/constraint.c | 6 +-- source/blender/blenkernel/intern/depsgraph.c | 4 +- source/blender/blenkernel/intern/fcurve.c | 10 ++-- source/blender/blenkernel/intern/fmodifier.c | 6 +-- source/blender/blenkernel/intern/image.c | 4 +- source/blender/blenkernel/intern/implicit.c | 18 +++---- source/blender/blenkernel/intern/ipo.c | 8 +-- source/blender/blenkernel/intern/material.c | 26 +++++----- source/blender/blenkernel/intern/nla.c | 12 ++--- source/blender/blenkernel/intern/object.c | 10 ++-- source/blender/blenkernel/intern/scene.c | 4 +- source/blender/blenkernel/intern/shrinkwrap.c | 4 +- 21 files changed, 230 insertions(+), 228 deletions(-) (limited to 'source/blender/blenkernel/intern') diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 3f28a4afe8d..120a0b2ba27 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -74,7 +74,7 @@ static DerivedMesh *navmesh_dm_createNavMeshForVisualization(DerivedMesh *dm); #endif -#include "BLO_sys_types.h" // for intptr_t support +#include "BLO_sys_types.h" /* for intptr_t support */ #include "GL/glew.h" @@ -956,22 +956,22 @@ void weight_to_rgb(float r_rgb[3], const float weight) { const float blend = ((weight / 2.0f) + 0.5f); - if (weight <= 0.25f) { // blue->cyan + if (weight <= 0.25f) { /* blue->cyan */ r_rgb[0] = 0.0f; r_rgb[1] = blend * weight * 4.0f; r_rgb[2] = blend; } - else if (weight <= 0.50f) { // cyan->green + else if (weight <= 0.50f) { /* cyan->green */ r_rgb[0] = 0.0f; r_rgb[1] = blend; r_rgb[2] = blend * (1.0f - ((weight - 0.25f) * 4.0f)); } - else if (weight <= 0.75f) { // green->yellow + else if (weight <= 0.75f) { /* green->yellow */ r_rgb[0] = blend * ((weight - 0.50f) * 4.0f); r_rgb[1] = blend; r_rgb[2] = 0.0f; } - else if (weight <= 1.0f) { // yellow->red + else if (weight <= 1.0f) { /* yellow->red */ r_rgb[0] = blend; r_rgb[1] = blend * (1.0f - ((weight - 0.75f) * 4.0f)); r_rgb[2] = 0.0f; @@ -2379,16 +2379,16 @@ float *mesh_get_mapped_verts_nors(Scene *scene, Object *ob) typedef struct { float *precomputedFaceNormals; - MTFace *mtface; // texture coordinates - MFace *mface; // indices - MVert *mvert; // vertices & normals + MTFace *mtface; /* texture coordinates */ + MFace *mface; /* indices */ + MVert *mvert; /* vertices & normals */ float (*orco)[3]; - float (*tangent)[4]; // destination + float (*tangent)[4]; /* destination */ int numTessFaces; } SGLSLMeshToTangent; -// interface +/* interface */ #include "mikktspace.h" static int GetNumFaces(const SMikkTSpaceContext *pContext) @@ -2508,7 +2508,7 @@ void DM_add_tangent_layer(DerivedMesh *dm) BLI_memarena_use_calloc(arena); vtangents = MEM_callocN(sizeof(VertexTangent *) * totvert, "VertexTangent"); - // new computation method + /* new computation method */ iCalcNewMethod = 1; if (iCalcNewMethod != 0) { SGLSLMeshToTangent mesh2tangent = {0}; @@ -2532,7 +2532,7 @@ void DM_add_tangent_layer(DerivedMesh *dm) sInterface.m_getNormal = GetNormal; sInterface.m_setTSpaceBasic = SetTSpace; - // 0 if failed + /* 0 if failed */ iCalcNewMethod = genTangSpaceDefault(&sContext); } @@ -2638,7 +2638,7 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm) tex_coords[3] = mtface[f].uv[3]; } - // discard degenerate faces + /* discard degenerate faces */ is_degenerate = 0; if (equals_v3v3(verts[0], verts[1]) || equals_v3v3(verts[0], verts[2]) || equals_v3v3(verts[1], verts[2]) || equals_v2v2(tex_coords[0], tex_coords[1]) || equals_v2v2(tex_coords[0], tex_coords[2]) || equals_v2v2(tex_coords[1], tex_coords[2])) @@ -2646,7 +2646,7 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm) is_degenerate = 1; } - // verify last vertex as well if this is a quad + /* verify last vertex as well if this is a quad */ if (is_degenerate == 0 && nr_verts == 4) { if (equals_v3v3(verts[3], verts[0]) || equals_v3v3(verts[3], verts[1]) || equals_v3v3(verts[3], verts[2]) || equals_v2v2(tex_coords[3], tex_coords[0]) || equals_v2v2(tex_coords[3], tex_coords[1]) || equals_v2v2(tex_coords[3], tex_coords[2])) @@ -2654,7 +2654,7 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm) is_degenerate = 1; } - // verify the winding is consistent + /* verify the winding is consistent */ if (is_degenerate == 0) { float prev_edge[2]; int is_signed = 0; @@ -2681,11 +2681,11 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm) } } - // proceed if not a degenerate face + /* proceed if not a degenerate face */ if (is_degenerate == 0) { int nr_tris_to_pile = 0; - // quads split at shortest diagonal - int offs = 0; // initial triangulation is 0,1,2 and 0, 2, 3 + /* quads split at shortest diagonal */ + int offs = 0; /* initial triangulation is 0,1,2 and 0, 2, 3 */ if (nr_verts == 4) { float pos_len_diag0, pos_len_diag1; float vtmp[3]; @@ -2743,7 +2743,7 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm) } } - // finalize + /* finalize */ { const float avg_area_ratio = (nr_accumulated > 0) ? ((float)(dsum / nr_accumulated)) : 1.0f; const float use_as_render_bump_scale = sqrtf(avg_area_ratio); // use width of average surface ratio as your bump scale diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 8d1707725b5..af6583fd726 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -134,7 +134,7 @@ void BKE_action_make_local(bAction *act) if (act->id.lib == NULL) return; - // XXX: double-check this; it used to be just single-user check, but that was when fake-users were still default + /* XXX: double-check this; it used to be just single-user check, but that was when fake-users were still default */ if ((act->id.flag & LIB_FAKEUSER) && (act->id.us <= 1)) { id_clear_lib_data(bmain, &act->id); return; @@ -547,7 +547,7 @@ void BKE_pose_copy_data(bPose **dst, bPose *src, int copycon) outPose->ikparam = MEM_dupallocN(src->ikparam); for (pchan = outPose->chanbase.first; pchan; pchan = pchan->next) { - // TODO: rename this argument... + /* TODO: rename this argument... */ if (copycon) { copy_constraints(&listb, &pchan->constraints, TRUE); // copy_constraints NULLs listb pchan->constraints = listb; @@ -807,7 +807,7 @@ void framechange_poses_clear_unkeyed(void) bPoseChannel *pchan; /* This needs to be done for each object that has a pose */ - // TODO: proxies may/may not be correctly handled here... (this needs checking) + /* TODO: proxies may/may not be correctly handled here... (this needs checking) */ for (ob = G.main->object.first; ob; ob = ob->id.next) { /* we only need to do this on objects with a pose */ if ( (pose = ob->pose) ) { @@ -907,7 +907,7 @@ void calc_action_range(const bAction *act, float *start, float *end, short incl_ float nmin, nmax; /* get extents for this curve */ - // TODO: allow enabling/disabling this? + /* TODO: allow enabling/disabling this? */ calc_fcurve_range(fcu, &nmin, &nmax, FALSE, TRUE); /* compare to the running tally */ @@ -949,7 +949,7 @@ void calc_action_range(const bAction *act, float *start, float *end, short incl_ } break; - // TODO: function modifier may need some special limits + /* TODO: function modifier may need some special limits */ default: /* all other standard modifiers are on the infinite range... */ min = MINAFRAMEF; @@ -1129,7 +1129,7 @@ void BKE_pose_copy_result(bPose *to, bPose *from) bPoseChannel *pchanto, *pchanfrom; if (to == NULL || from == NULL) { - printf("pose result copy error to:%p from:%p\n", (void *)to, (void *)from); // debug temp + printf("pose result copy error to:%p from:%p\n", (void *)to, (void *)from); /* debug temp */ return; } @@ -1378,12 +1378,12 @@ static float stridechannel_frame(Object *ob, float sizecorr, bActionStrip *strip /* now we need to go pdist further (or less) on cu path */ where_on_path(ob, (pathdist) / path->totdist, vec1, dir); /* vec needs size 4 */ if (pdistNewNormalized <= 1) { - // search for correction in positive path-direction + /* search for correction in positive path-direction */ where_on_path(ob, pdistNewNormalized, vec2, dir); /* vec needs size 4 */ sub_v3_v3v3(stride_offset, vec2, vec1); } else { - // we reached the end of the path, search backwards instead + /* we reached the end of the path, search backwards instead */ where_on_path(ob, (pathdist - pdist) / path->totdist, vec2, dir); /* vec needs size 4 */ sub_v3_v3v3(stride_offset, vec1, vec2); } diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 52399801691..16ff1646f43 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -86,24 +86,24 @@ void animviz_settings_init(bAnimVizSettings *avs) /* sanity check */ if (avs == NULL) return; - + /* ghosting settings */ avs->ghost_bc = avs->ghost_ac = 10; - - avs->ghost_sf = 1; // xxx - take from scene instead? - avs->ghost_ef = 250; // xxx - take from scene instead? - + + avs->ghost_sf = 1; /* xxx - take from scene instead? */ + avs->ghost_ef = 250; /* xxx - take from scene instead? */ + avs->ghost_step = 1; - - + + /* path settings */ avs->path_bc = avs->path_ac = 10; - - avs->path_sf = 1; // xxx - take from scene instead? - avs->path_ef = 250; // xxx - take from scene instead? - + + avs->path_sf = 1; /* xxx - take from scene instead? */ + avs->path_ef = 250; /* xxx - take from scene instead? */ + avs->path_viewflag = (MOTIONPATH_VIEW_KFRAS | MOTIONPATH_VIEW_KFNOS); - + avs->path_step = 1; } @@ -246,7 +246,7 @@ typedef struct MPathTarget { /* get list of motion paths to be baked for the given object * - assumes the given list is ready to be used */ -// TODO: it would be nice in future to be able to update objects dependent on these bones too? +/* TODO: it would be nice in future to be able to update objects dependent on these bones too? */ void animviz_get_object_motionpaths(Object *ob, ListBase *targets) { MPathTarget *mpt; @@ -309,7 +309,9 @@ static void motionpaths_calc_optimise_depsgraph(Scene *scene, ListBase *targets) BLI_addhead(&scene->base, base); mpt->ob->flag |= BA_TEMP_TAG; - break; // we really don't need to continue anymore once this happens, but this line might really 'break' + + /* we really don't need to continue anymore once this happens, but this line might really 'break' */ + break; } } } @@ -328,17 +330,17 @@ static void motionpaths_calc_update_scene(Scene *scene) DAG_scene_update_flags(G.main, scene, scene->lay, TRUE); /* find the last object with the tag - * - all those afterwards are assumed to not be relevant for our calculations + * - all those afterwards are assumed to not be relevant for our calculations */ - // optimize further by moving out... + /* optimize further by moving out... */ for (base = scene->base.first; base; base = base->next) { if (base->object->flag & BA_TEMP_TAG) last = base; } /* perform updates for tagged objects */ - // XXX: this will break if rigs depend on scene or other data that - // is animated but not attached to/updatable from objects + /* XXX: this will break if rigs depend on scene or other data that + * is animated but not attached to/updatable from objects */ for (base = scene->base.first; base; base = base->next) { /* update this object */ BKE_object_handle_update(scene, base->object); @@ -353,7 +355,7 @@ static void motionpaths_calc_update_scene(Scene *scene) * that doesn't force complete update, but for now, this is the * most accurate way! */ - BKE_scene_update_for_newframe(G.main, scene, scene->lay); // XXX this is the best way we can get anything moving + BKE_scene_update_for_newframe(G.main, scene, scene->lay); /* XXX this is the best way we can get anything moving */ #endif } @@ -401,9 +403,9 @@ static void motionpaths_calc_bake_targets(Scene *scene, ListBase *targets) /* Perform baking of the given object's and/or its bones' transforms to motion paths * - scene: current scene * - ob: object whose flagged motionpaths should get calculated - * - recalc: whether we need to + * - recalc: whether we need to */ -// TODO: include reports pointer? +/* TODO: include reports pointer? */ void animviz_calc_motionpaths(Scene *scene, ListBase *targets) { MPathTarget *mpt; @@ -418,9 +420,9 @@ void animviz_calc_motionpaths(Scene *scene, ListBase *targets) cfra = CFRA; sfra = efra = cfra; - // TODO: this method could be improved... - // 1) max range for standard baking - // 2) minimum range for recalc baking (i.e. between keyframes, but how?) + /* TODO: this method could be improved... + * 1) max range for standard baking + * 2) minimum range for recalc baking (i.e. between keyframes, but how?) */ for (mpt = targets->first; mpt; mpt = mpt->next) { /* try to increase area to do (only as much as needed) */ sfra = MIN2(sfra, mpt->mpath->start_frame); @@ -429,7 +431,7 @@ void animviz_calc_motionpaths(Scene *scene, ListBase *targets) if (efra <= sfra) return; /* optimize the depsgraph for faster updates */ - // TODO: whether this is used should depend on some setting for the level of optimisations used + /* TODO: whether this is used should depend on some setting for the level of optimisations used */ motionpaths_calc_optimise_depsgraph(scene, targets); /* calculate path over requested range */ diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 943bad35cf2..f7b18ce557a 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -76,9 +76,9 @@ short id_type_can_have_animdata(ID *id) /* sanity check */ if (id == NULL) return 0; - + /* Only some ID-blocks have this info for now */ - // TODO: finish adding this for the other blocktypes + /* TODO: finish adding this for the other blocktypes */ switch (GS(id->name)) { /* has AnimData */ case ID_OB: @@ -231,7 +231,7 @@ void BKE_free_animdata(ID *id) free_fcurves(&adt->drivers); /* free overrides */ - // TODO... + /* TODO... */ /* free animdata now */ MEM_freeN(adt); @@ -334,7 +334,7 @@ void BKE_animdata_make_local(AnimData *adt) if (adt->remap && adt->remap->target) BKE_action_make_local(adt->remap->target); /* Drivers */ - // TODO: need to remap the ID-targets too? + /* TODO: need to remap the ID-targets too? */ /* NLA Data */ for (nlt = adt->nla_tracks.first; nlt; nlt = nlt->next) @@ -505,8 +505,8 @@ void BKE_animdata_separate_by_basepath(ID *srcID, ID *dstID, ListBase *basepaths else if (dstAdt->action == srcAdt->action) { printf("Argh! Source and Destination share animation! ('%s' and '%s' both use '%s') Making new empty action\n", srcID->name, dstID->name, srcAdt->action->id.name); - - // TODO: review this... + + /* TODO: review this... */ id_us_min(&dstAdt->action->id); dstAdt->action = add_empty_action(dstAdt->action->id.name + 2); } @@ -534,9 +534,9 @@ void BKE_animdata_separate_by_basepath(ID *srcID, ID *dstID, ListBase *basepaths /* just need to change lists */ BLI_remlink(&srcAdt->drivers, fcu); BLI_addtail(&dstAdt->drivers, fcu); - - // TODO: add depsgraph flushing calls? - + + /* TODO: add depsgraph flushing calls? */ + /* can stop now, as moved already */ break; } @@ -603,7 +603,7 @@ static char *rna_path_rename_fix(ID *owner_id, const char *prefix, const char *o BLI_dynstr_free(ds); /* check if the new path will solve our problems */ - // TODO: will need to check whether this step really helps in practice + /* TODO: will need to check whether this step really helps in practice */ if (!verify_paths || check_rna_path_is_valid(owner_id, newPath)) { /* free the old path, and return the new one, since we've solved the issues */ MEM_freeN(oldpath); @@ -907,7 +907,7 @@ void BKE_all_animdata_fix_paths_rename(ID *ref_id, const char *prefix, const cha /* Finding Tools --------------------------- */ /* Find the first path that matches the given criteria */ -// TODO: do we want some method to perform partial matches too? +/* TODO: do we want some method to perform partial matches too? */ KS_Path *BKE_keyingset_find_path(KeyingSet *ks, ID *id, const char group_name[], const char rna_path[], int array_index, int UNUSED(group_mode)) { KS_Path *ksp; @@ -1019,7 +1019,7 @@ KS_Path *BKE_keyingset_add_path(KeyingSet *ks, ID *id, const char group_name[], ksp->idtype = GS(id->name); /* just copy path info */ - // TODO: should array index be checked too? + /* TODO: should array index be checked too? */ ksp->rna_path = BLI_strdupn(rna_path, strlen(rna_path)); ksp->array_index = array_index; @@ -1216,8 +1216,8 @@ static short animsys_write_rna_setting(PointerRNA *ptr, char *path, int array_in } else { /* failed to get path */ - // XXX don't tag as failed yet though, as there are some legit situations (Action Constraint) - // where some channels will not exist, but shouldn't lock up Action + /* XXX don't tag as failed yet though, as there are some legit situations (Action Constraint) + * where some channels will not exist, but shouldn't lock up Action */ if (G.debug & G_DEBUG) { printf("Animato: Invalid path. ID = '%s', '%s[%d]'\n", (ptr && ptr->id.data) ? (((ID *)ptr->id.data)->name + 2) : "", @@ -1425,11 +1425,11 @@ static void nlastrip_evaluate_controls(NlaStrip *strip, float ctime) animsys_evaluate_fcurves(&strip_ptr, &strip->fcurves, NULL, ctime); } - /* if user can control the evaluation time (using F-Curves), consider the option which allows this time to be clamped + /* if user can control the evaluation time (using F-Curves), consider the option which allows this time to be clamped * to lie within extents of the action-clip, so that a steady changing rate of progress through several cycles of the clip * can be achieved easily */ - // NOTE: if we add any more of these special cases, we better group them up nicely... + /* NOTE: if we add any more of these special cases, we better group them up nicely... */ if ((strip->flag & NLASTRIP_FLAG_USR_TIME) && (strip->flag & NLASTRIP_FLAG_USR_TIME_CYCLIC)) strip->strip_time = fmod(strip->strip_time - strip->actstart, strip->actend - strip->actstart); } @@ -1511,7 +1511,7 @@ NlaEvalStrip *nlastrips_ctime_get_strip(ListBase *list, ListBase *strips, short * - skip if no influence (i.e. same effect as muting the strip) * - negative influence is not supported yet... how would that be defined? */ - // TODO: this sounds a bit hacky having a few isolated F-Curves stuck on some data it operates on... + /* TODO: this sounds a bit hacky having a few isolated F-Curves stuck on some data it operates on... */ nlastrip_evaluate_controls(estrip, ctime); if (estrip->influence <= 0.0f) return NULL; @@ -1668,7 +1668,7 @@ static void nlaevalchan_accumulate(NlaEvalChannel *nec, NlaEvalStrip *nes, short break; case NLASTRIP_MODE_REPLACE: - default: // TODO: do we really want to blend by default? it seems more uses might prefer add... + default: /* TODO: do we really want to blend by default? it seems more uses might prefer add... */ /* do linear interpolation * - the influence of the accumulated data (elsewhere, that is called dstweight) * is 1 - influence, since the strip's influence is srcweight @@ -1864,7 +1864,7 @@ static void nlastrip_evaluate_transition(PointerRNA *ptr, ListBase *channels, Li tmp_nes = *nes; /* evaluate these strips into a temp-buffer (tmp_channels) */ - // FIXME: modifier evalation here needs some work... + /* FIXME: modifier evalation here needs some work... */ /* first strip */ tmp_nes.strip_mode = NES_TIME_TRANSITION_START; tmp_nes.strip = s1; @@ -1928,11 +1928,11 @@ static void nlastrip_evaluate_meta(PointerRNA *ptr, ListBase *channels, ListBase void nlastrip_evaluate(PointerRNA *ptr, ListBase *channels, ListBase *modifiers, NlaEvalStrip *nes) { NlaStrip *strip = nes->strip; - + /* to prevent potential infinite recursion problems (i.e. transition strip, beside meta strip containing a transition * several levels deep inside it), we tag the current strip as being evaluated, and clear this when we leave */ - // TODO: be careful with this flag, since some edit tools may be running and have set this while animplayback was running + /* TODO: be careful with this flag, since some edit tools may be running and have set this while animplayback was running */ if (strip->flag & NLASTRIP_FLAG_EDIT_TOUCHED) return; strip->flag |= NLASTRIP_FLAG_EDIT_TOUCHED; @@ -2081,7 +2081,7 @@ static void animsys_evaluate_nla(ListBase *echannels, PointerRNA *ptr, AnimData } else { /* special case - evaluate as if there isn't any NLA data */ - // TODO: this is really just a stop-gap measure... + /* TODO: this is really just a stop-gap measure... */ animsys_evaluate_action(ptr, adt->action, adt->remap, ctime); return; } @@ -2107,10 +2107,10 @@ static void animsys_evaluate_nla(ListBase *echannels, PointerRNA *ptr, AnimData static void animsys_calculate_nla(PointerRNA *ptr, AnimData *adt, float ctime) { ListBase echannels = {NULL, NULL}; - - // TODO: need to zero out all channels used, otherwise we have problems with threadsafety - // and also when the user jumps between different times instead of moving sequentially... - + + /* TODO: need to zero out all channels used, otherwise we have problems with threadsafety + * and also when the user jumps between different times instead of moving sequentially... */ + /* evaluate the NLA stack, obtaining a set of values to flush */ animsys_evaluate_nla(&echannels, ptr, adt, ctime); @@ -2130,9 +2130,9 @@ static void animsys_calculate_nla(PointerRNA *ptr, AnimData *adt, float ctime) #if 0 AnimOverride *BKE_animsys_validate_override(PointerRNA *UNUSED(ptr), char *UNUSED(path), int UNUSED(array_index)) { - // FIXME: need to define how to get overrides + /* FIXME: need to define how to get overrides */ return NULL; -} +} #endif /* -------------------- */ @@ -2202,7 +2202,7 @@ void BKE_animsys_evaluate_animdata(Scene *scene, ID *id, AnimData *adt, float ct * - NLA before Active Action, as Active Action behaves as 'tweaking track' * that overrides 'rough' work in NLA */ - // TODO: need to double check that this all works correctly + /* 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/blender.c b/source/blender/blenkernel/intern/blender.c index 0def299c24a..9e222307aa9 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -301,8 +301,8 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filepath //setscreen(G.curscreen); } - // FIXME: this version patching should really be part of the file-reading code, - // but we still get too many unrelated data-corruption crashes otherwise... + /* FIXME: this version patching should really be part of the file-reading code, + * but we still get too many unrelated data-corruption crashes otherwise... */ if (G.main->versionfile < 250) do_versions_ipos_to_animato(G.main); diff --git a/source/blender/blenkernel/intern/bmfont.c b/source/blender/blenkernel/intern/bmfont.c index e1f4e45e9c3..e85fe83b752 100644 --- a/source/blender/blenkernel/intern/bmfont.c +++ b/source/blender/blenkernel/intern/bmfont.c @@ -96,9 +96,9 @@ void readBitmapFontVersion0(ImBuf * ibuf, unsigned char * rect, int step) ysize = (bytes + (ibuf->x - 1)) / ibuf->x; if (ysize < ibuf->y) { - // we're first going to copy all data into a liniar buffer. - // step can be 4 or 1 bytes, and the data is not sequential because - // the bitmap was flipped vertically. + /* we're first going to copy all data into a liniar buffer. + * step can be 4 or 1 bytes, and the data is not sequential because + * the bitmap was flipped vertically. */ buffer = MEM_mallocN(bytes, "readBitmapFontVersion0:buffer"); @@ -113,7 +113,7 @@ void readBitmapFontVersion0(ImBuf * ibuf, unsigned char * rect, int step) } } - // we're now going to endian convert the data + /* we're now going to endian convert the data */ bmfont = MEM_mallocN(bytes, "readBitmapFontVersion0:bmfont"); index = 0; @@ -151,16 +151,16 @@ void readBitmapFontVersion0(ImBuf * ibuf, unsigned char * rect, int step) printf("bytes = %d\n", bytes); } - // we've read the data from the image. Now we're going - // to crop the image vertically so only the bitmap data - // remains visible - + /* we've read the data from the image. Now we're going + * to crop the image vertically so only the bitmap data + * remains visible */ + ibuf->y -= ysize; ibuf->userdata = bmfont; ibuf->userflags |= IB_BITMAPFONT; if (ibuf->planes < 32) { - // we're going to fake alpha here: + /* we're going to fake alpha here: */ calcAlpha(ibuf); } } @@ -176,32 +176,32 @@ void detectBitmapFont(ImBuf *ibuf) int i; if (ibuf != NULL && ibuf->rect != 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]); + /* printf ("starts with: %s %c %c %c %c\n", rect, rect[0], rect[1], rect[2], rect[3]); */ if (rect[0] == 'B' && rect[1] == 'F' && rect[2] == 'N' && rect[3] == 'T') { - // printf("found 8bit font !\n"); - // round y size down - // do the 8 bit font stuff. (not yet) + /* printf("found 8bit font !\n"); + * round y size down + * do the 8 bit font stuff. (not yet) */ } else { - // we try all 4 possible combinations + /* we try all 4 possible combinations */ for (i = 0; i < 4; i++) { if (rect[0] == 'B' && rect[4] == 'F' && rect[8] == 'N' && rect[12] == 'T') { - // printf("found 24bit font !\n"); - // We're going to parse the file: - + /* printf("found 24bit font !\n"); + * We're going to parse the file: */ + version = (rect[16] << 8) | rect[20]; - + if (version == 0) { readBitmapFontVersion0(ibuf, rect, 4); } else { printf("detectBitmapFont :Unsupported version %d\n", version); } - - // on succes ibuf->userdata points to the bitmapfont + + /* on succes ibuf->userdata points to the bitmapfont */ if (ibuf->userdata) { break; } @@ -221,23 +221,23 @@ int locateGlyph(bmFont *bmfont, unsigned short unicode) min = 0; max = bmfont->glyphcount; while (1) { - // look halfway for glyph + /* look halfway for glyph */ current = (min + max) >> 1; if (bmfont->glyphs[current].unicode == unicode) { break; } else if (bmfont->glyphs[current].unicode < unicode) { - // have to move up + /* have to move up */ min = current; } else { - // have to move down + /* have to move down */ max = current; } - + if (max - min <= 1) { - // unable to locate glyph + /* unable to locate glyph */ current = 0; break; } diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c index 752bdab2c00..32ae6d04934 100644 --- a/source/blender/blenkernel/intern/bvhutils.c +++ b/source/blender/blenkernel/intern/bvhutils.c @@ -330,7 +330,7 @@ float nearest_point_in_tri_surface(const float v0[3], const float v1[3], const f } } - // Account for numerical round-off error + /* Account for numerical round-off error */ if (sqrDist < FLT_EPSILON) sqrDist = 0.0f; @@ -345,7 +345,7 @@ float nearest_point_in_tri_surface(const float v0[3], const float v1[3], const f add_v3_v3v3(z, z, y); //sub_v3_v3v3(d, p, z); copy_v3_v3(nearest, z); - // d = p - ( v0 + S * e0 + T * e1 ); + //d = p - ( v0 + S * e0 + T * e1 ); } *v = lv; *e = le; diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index f9e72be4fc1..74bfa0d60fc 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -224,26 +224,26 @@ static BVHTree *bvhtree_build_from_cloth (ClothModifierData *clmd, float epsilon verts = cloth->verts; mfaces = cloth->mfaces; - // in the moment, return zero if no faces there + /* in the moment, return zero if no faces there */ if (!cloth->numfaces) return NULL; - - // create quadtree with k=26 + + /* create quadtree with k=26 */ bvhtree = BLI_bvhtree_new(cloth->numfaces, epsilon, 4, 26); - - // fill tree + + /* fill tree */ for (i = 0; i < cloth->numfaces; i++, mfaces++) { copy_v3_v3(&co[0*3], verts[mfaces->v1].xold); copy_v3_v3(&co[1*3], verts[mfaces->v2].xold); copy_v3_v3(&co[2*3], verts[mfaces->v3].xold); - + if (mfaces->v4) copy_v3_v3(&co[3*3], verts[mfaces->v4].xold); - + BLI_bvhtree_insert(bvhtree, i, co, (mfaces->v4 ? 4 : 3)); } - - // balance tree + + /* balance tree */ BLI_bvhtree_balance(bvhtree); return bvhtree; @@ -313,23 +313,23 @@ void bvhselftree_update_from_cloth(ClothModifierData *clmd, int moving) return; mfaces = cloth->mfaces; - + // update vertex position in bvh tree if (verts && mfaces) { for (i = 0; i < cloth->numverts; i++, verts++) { copy_v3_v3(&co[0*3], verts->txold); - + // copy new locations into array if (moving) { // update moving positions copy_v3_v3(&co_moving[0*3], verts->tx); - + ret = BLI_bvhtree_update_node(bvhtree, i, co, co_moving, 1); } else { ret = BLI_bvhtree_update_node(bvhtree, i, co, NULL, 1); } - + // check if tree is already full if (!ret) break; @@ -673,7 +673,7 @@ void cloth_free_modifier_extern(ClothModifierData *clmd ) if ( cloth ) { if (G.rt > 0) printf("cloth_free_modifier_extern in\n"); - + // If our solver provides a free function, call it if ( solvers [clmd->sim_parms->solver_type].free ) { solvers [clmd->sim_parms->solver_type].free ( clmd ); @@ -691,12 +691,12 @@ void cloth_free_modifier_extern(ClothModifierData *clmd ) LinkNode *search = cloth->springs; while (search) { ClothSpring *spring = search->link; - + MEM_freeN ( spring ); search = search->next; } BLI_linklist_free(cloth->springs, NULL); - + cloth->springs = NULL; } @@ -713,11 +713,11 @@ void cloth_free_modifier_extern(ClothModifierData *clmd ) // we save our faces for collision objects if ( cloth->mfaces ) MEM_freeN ( cloth->mfaces ); - + if (cloth->edgehash) BLI_edgehash_free ( cloth->edgehash, NULL ); - - + + /* if (clmd->clothObject->facemarks) MEM_freeN(clmd->clothObject->facemarks); @@ -875,10 +875,10 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d cloth_from_mesh ( clmd, dm ); - // create springs + // create springs clmd->clothObject->springs = NULL; clmd->clothObject->numsprings = -1; - + if ( clmd->sim_parms->shapekey_rest ) shapekey_rest = dm->getVertDataArray ( dm, CD_CLOTH_ORCO ); @@ -1127,13 +1127,13 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm ) for (i = 0; i < numverts; i++) { cloth->verts[i].avg_spring_len = cloth->verts[i].avg_spring_len * 0.49f / ((float)cloth->verts[i].spring_count); } - + // shear springs for ( i = 0; i < numfaces; i++ ) { // triangle faces already have shear springs due to structural geometry if ( !mface[i].v4 ) - continue; - + continue; + spring = ( ClothSpring *) MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" ); if (!spring) { @@ -1174,7 +1174,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm ) BLI_linklist_prepend ( &cloth->springs, spring ); } - + if (numfaces) { // bending springs search2 = cloth->springs; @@ -1187,14 +1187,14 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm ) while ( search ) { tspring = search->link; index2 = ( ( tspring->ij==tspring2->kl ) ? ( tspring->kl ) : ( tspring->ij ) ); - + // check for existing spring // check also if startpoint is equal to endpoint if (!BLI_edgehash_haskey(edgehash, MIN2(tspring2->ij, index2), MAX2(tspring2->ij, index2)) && (index2 != tspring2->ij)) { spring = (ClothSpring *)MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" ); - + if (!spring) { cloth_free_errorsprings(cloth, edgehash, edgelist); return 0; diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index 7acbcbf6c93..516de35fab3 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -226,69 +226,69 @@ static int cloth_collision_response_static ( ClothModifierData *clmd, CollisionM zero_v3(i2); zero_v3(i3); - // only handle static collisions here + /* only handle static collisions here */ if ( collpair->flag & COLLISION_IN_FUTURE ) continue; - // compute barycentric coordinates for both collision points + /* compute barycentric coordinates for both collision points */ collision_compute_barycentric ( collpair->pa, cloth1->verts[collpair->ap1].txold, cloth1->verts[collpair->ap2].txold, cloth1->verts[collpair->ap3].txold, &w1, &w2, &w3 ); - // was: txold + /* was: txold */ collision_compute_barycentric ( collpair->pb, collmd->current_x[collpair->bp1].co, collmd->current_x[collpair->bp2].co, collmd->current_x[collpair->bp3].co, &u1, &u2, &u3 ); - // Calculate relative "velocity". + /* Calculate relative "velocity". */ collision_interpolateOnTriangle ( v1, cloth1->verts[collpair->ap1].tv, cloth1->verts[collpair->ap2].tv, cloth1->verts[collpair->ap3].tv, w1, w2, w3 ); collision_interpolateOnTriangle ( v2, collmd->current_v[collpair->bp1].co, collmd->current_v[collpair->bp2].co, collmd->current_v[collpair->bp3].co, u1, u2, u3 ); sub_v3_v3v3(relativeVelocity, v2, v1); - // Calculate the normal component of the relative velocity (actually only the magnitude - the direction is stored in 'normal'). + /* Calculate the normal component of the relative velocity (actually only the magnitude - the direction is stored in 'normal'). */ magrelVel = dot_v3v3(relativeVelocity, collpair->normal); - // printf("magrelVel: %f\n", magrelVel); + /* printf("magrelVel: %f\n", magrelVel); */ - // Calculate masses of points. - // TODO + /* Calculate masses of points. + * TODO */ - // If v_n_mag < 0 the edges are approaching each other. + /* If v_n_mag < 0 the edges are approaching each other. */ if ( magrelVel > ALMOST_ZERO ) { - // Calculate Impulse magnitude to stop all motion in normal direction. + /* Calculate Impulse magnitude to stop all motion in normal direction. */ float magtangent = 0, repulse = 0, d = 0; double impulse = 0.0; float vrel_t_pre[3]; float temp[3], spf; - // calculate tangential velocity + /* calculate tangential velocity */ copy_v3_v3 ( temp, collpair->normal ); mul_v3_fl(temp, magrelVel); sub_v3_v3v3(vrel_t_pre, relativeVelocity, temp); - // Decrease in magnitude of relative tangential velocity due to coulomb friction - // in original formula "magrelVel" should be the "change of relative velocity in normal direction" + /* Decrease in magnitude of relative tangential velocity due to coulomb friction + * in original formula "magrelVel" should be the "change of relative velocity in normal direction" */ magtangent = minf(clmd->coll_parms->friction * 0.01f * magrelVel, sqrtf(dot_v3v3(vrel_t_pre, vrel_t_pre))); - // Apply friction impulse. + /* Apply friction impulse. */ if ( magtangent > ALMOST_ZERO ) { normalize_v3(vrel_t_pre); - impulse = magtangent / ( 1.0f + w1*w1 + w2*w2 + w3*w3 ); // 2.0 * + impulse = magtangent / ( 1.0f + w1*w1 + w2*w2 + w3*w3 ); /* 2.0 * */ VECADDMUL ( i1, vrel_t_pre, w1 * impulse ); VECADDMUL ( i2, vrel_t_pre, w2 * impulse ); VECADDMUL ( i3, vrel_t_pre, w3 * impulse ); } - // Apply velocity stopping impulse - // I_c = m * v_N / 2.0 - // no 2.0 * magrelVel normally, but looks nicer DG + /* Apply velocity stopping impulse + * I_c = m * v_N / 2.0 + * no 2.0 * magrelVel normally, but looks nicer DG */ impulse = magrelVel / ( 1.0 + w1*w1 + w2*w2 + w3*w3 ); VECADDMUL ( i1, collpair->normal, w1 * impulse ); @@ -300,24 +300,24 @@ static int cloth_collision_response_static ( ClothModifierData *clmd, CollisionM VECADDMUL ( i3, collpair->normal, w3 * impulse ); cloth1->verts[collpair->ap3].impulse_count++; - // Apply repulse impulse if distance too short - // I_r = -min(dt*kd, m(0, 1d/dt - v_n)) - // DG: this formula ineeds to be changed for this code since we apply impulses/repulses like this: - // v += impulse; x_new = x + v; - // We don't use dt!! - // DG TODO: Fix usage of dt here! + /* Apply repulse impulse if distance too short + * I_r = -min(dt*kd, m(0, 1d/dt - v_n)) + * DG: this formula ineeds to be changed for this code since we apply impulses/repulses like this: + * v += impulse; x_new = x + v; + * We don't use dt!! + * DG TODO: Fix usage of dt here! */ spf = (float)clmd->sim_parms->stepsPerFrame / clmd->sim_parms->timescale; d = clmd->coll_parms->epsilon*8.0f/9.0f + epsilon2*8.0f/9.0f - collpair->distance; if ( ( magrelVel < 0.1f*d*spf ) && ( d > ALMOST_ZERO ) ) { repulse = MIN2 ( d*1.0f/spf, 0.1f*d*spf - magrelVel ); - // stay on the safe side and clamp repulse + /* stay on the safe side and clamp repulse */ if ( impulse > ALMOST_ZERO ) repulse = MIN2 ( repulse, 5.0*impulse ); repulse = MAX2 ( impulse, repulse ); - impulse = repulse / ( 1.0f + w1*w1 + w2*w2 + w3*w3 ); // original 2.0 / 0.25 + impulse = repulse / ( 1.0f + w1*w1 + w2*w2 + w3*w3 ); /* original 2.0 / 0.25 */ VECADDMUL ( i1, collpair->normal, impulse ); VECADDMUL ( i2, collpair->normal, impulse ); VECADDMUL ( i3, collpair->normal, impulse ); @@ -326,19 +326,19 @@ static int cloth_collision_response_static ( ClothModifierData *clmd, CollisionM result = 1; } else { - // Apply repulse impulse if distance too short - // I_r = -min(dt*kd, max(0, 1d/dt - v_n)) - // DG: this formula ineeds to be changed for this code since we apply impulses/repulses like this: - // v += impulse; x_new = x + v; - // We don't use dt!! + /* Apply repulse impulse if distance too short + * I_r = -min(dt*kd, max(0, 1d/dt - v_n)) + * DG: this formula ineeds to be changed for this code since we apply impulses/repulses like this: + * v += impulse; x_new = x + v; + * We don't use dt!! */ float spf = (float)clmd->sim_parms->stepsPerFrame / clmd->sim_parms->timescale; float d = clmd->coll_parms->epsilon*8.0f/9.0f + epsilon2*8.0f/9.0f - collpair->distance; if ( d > ALMOST_ZERO) { - // stay on the safe side and clamp repulse + /* stay on the safe side and clamp repulse */ float repulse = d*1.0f/spf; - float impulse = repulse / ( 3.0 * ( 1.0f + w1*w1 + w2*w2 + w3*w3 )); // original 2.0 / 0.25 + float impulse = repulse / ( 3.0 * ( 1.0f + w1*w1 + w2*w2 + w3*w3 )); /* original 2.0 / 0.25 */ VECADDMUL ( i1, collpair->normal, impulse ); VECADDMUL ( i2, collpair->normal, impulse ); @@ -805,7 +805,7 @@ int cloth_bvh_objcollision(Object *ob, ClothModifierData * clmd, float step, flo //////////////////////////////////////////////////////////// if ( clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_SELF ) { for (l = 0; l < (unsigned int)clmd->coll_parms->self_loop_count; l++) { - // TODO: add coll quality rounds again + /* TODO: add coll quality rounds again */ BVHTreeOverlap *overlap = NULL; unsigned int result = 0; diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index c12e740958c..93c9ea06084 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -1316,7 +1316,7 @@ static void followpath_evaluate(bConstraint *con, bConstraintOb *cob, ListBase * bFollowPathConstraint *data = con->data; /* get Object transform (loc/rot/size) to determine transformation from path */ - // TODO: this used to be local at one point, but is probably more useful as-is + /* TODO: this used to be local at one point, but is probably more useful as-is */ copy_m4_m4(obmat, cob->matrix); /* get scaling of object before applying constraint */ @@ -4435,9 +4435,9 @@ static bConstraint *add_new_constraint(Object *ob, bPoseChannel *pchan, const ch /* make this constraint the active one */ constraints_set_active(list, con); } - + /* set type+owner specific immutable settings */ - // TODO: does action constraint need anything here - i.e. spaceonce? + /* TODO: does action constraint need anything here - i.e. spaceonce? */ switch (type) { case CONSTRAINT_TYPE_CHILDOF: { diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 05a2cfee8e6..a64cab5d2fc 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -383,11 +383,11 @@ static void dag_add_material_driver_relations(DagForest *dag, DagNode *node, Mat if (ma->adt) { dag_add_driver_relation(ma->adt, dag, node, 1); } - + /* textures */ // TODO... //dag_add_texture_driver_relations(DagForest *dag, DagNode *node, ID *id); - + /* material's nodetree */ if (ma->nodetree) { dag_add_material_nodetree_driver_relations(dag, node, ma->nodetree, ma); diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index d072ffb72ec..2da8c22e28b 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -634,9 +634,9 @@ short fcurve_are_keyframes_usable(FCurve *fcu) /* if it has modifiers, none of these should "drastically" alter the curve */ if (fcu->modifiers.first) { FModifier *fcm; - + /* check modifiers from last to first, as last will be more influential */ - // TODO: optionally, only check modifier if it is the active one... + /* TODO: optionally, only check modifier if it is the active one... */ for (fcm = fcu->modifiers.last; fcm; fcm = fcm->prev) { /* ignore if muted/disabled */ if (fcm->flag & (FMODIFIER_FLAG_DISABLED | FMODIFIER_FLAG_MUTED)) @@ -748,7 +748,7 @@ void fcurve_store_samples(FCurve *fcu, void *data, int start, int end, FcuSample int cfra; /* sanity checks */ - // TODO: make these tests report errors using reports not printf's + /* TODO: make these tests report errors using reports not printf's */ if (ELEM(NULL, fcu, sample_cb)) { printf("Error: No F-Curve with F-Curve Modifiers to Bake\n"); return; @@ -1018,7 +1018,7 @@ static float dtar_get_prop_val(ChannelDriver *driver, DriverTarget *dtar) id = dtar_id_ensure_proxy_from(dtar->id); /* error check for missing pointer... */ - // TODO: tag the specific target too as having issues + /* TODO: tag the specific target too as having issues */ if (id == NULL) { printf("Error: driver has an invalid target to use\n"); if (G.debug & G_DEBUG) printf("\tpath = %s\n", dtar->rna_path); @@ -1152,7 +1152,7 @@ static float dvar_eval_rotDiff(ChannelDriver *driver, DriverVar *dvar) } /* evaluate 'location difference' driver variable */ -// TODO: this needs to take into account space conversions... +/* TODO: this needs to take into account space conversions... */ static float dvar_eval_locDiff(ChannelDriver *driver, DriverVar *dvar) { float loc1[3] = {0.0f, 0.0f, 0.0f}; diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c index f981ecaf810..d95bbf94b58 100644 --- a/source/blender/blenkernel/intern/fmodifier.c +++ b/source/blender/blenkernel/intern/fmodifier.c @@ -463,7 +463,7 @@ static void fcm_envelope_evaluate(FCurve *UNUSED(fcu), FModifier *fcm, float *cv } else { /* evaltime occurs somewhere between segments */ - // TODO: implement binary search for this to make it faster? + /* TODO: implement binary search for this to make it faster? */ for (a = 0; prevfed && fed && (a < env->totvert - 1); a++, prevfed = fed, fed++) { /* evaltime occurs within the interval defined by these two envelope points */ if ((prevfed->time <= evaltime) && (fed->time >= evaltime)) { @@ -1005,7 +1005,7 @@ FModifier *add_fmodifier(ListBase *modifiers, int type) /* special checks for whether modifier can be added */ if ((modifiers->first) && (type == FMODIFIER_TYPE_CYCLES)) { /* cycles modifier must be first in stack, so for now, don't add if it can't be */ - // TODO: perhaps there is some better way, but for now, + /* TODO: perhaps there is some better way, but for now, */ printf("Error: Cannot add 'Cycles' modifier to F-Curve, as 'Cycles' modifier can only be first in stack.\n"); return NULL; } @@ -1343,7 +1343,7 @@ void fcurve_bake_modifiers(FCurve *fcu, int start, int end) ChannelDriver *driver; /* sanity checks */ - // TODO: make these tests report errors using reports not printf's + /* TODO: make these tests report errors using reports not printf's */ if (ELEM(NULL, fcu, fcu->modifiers.first)) { printf("Error: No F-Curve with F-Curve Modifiers to Bake\n"); return; diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index d2a2412843a..61cfc8e747b 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1216,7 +1216,7 @@ void BKE_imbuf_to_image_format(struct ImageFormatData *im_format, const ImBuf *i { BKE_imformat_defaults(im_format); - // file type + /* file type */ if (imbuf->ftype == IMAGIC) im_format->imtype = R_IMF_IMTYPE_IRIS; @@ -1297,7 +1297,7 @@ void BKE_imbuf_to_image_format(struct ImageFormatData *im_format, const ImBuf *i im_format->quality = imbuf->ftype & ~JPG_MSK; } - // planes + /* planes */ switch (imbuf->channels) { case 0: case 4: im_format->planes = R_IMF_PLANES_RGBA; diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c index 4755fccff99..5b3e823f050 100644 --- a/source/blender/blenkernel/intern/implicit.c +++ b/source/blender/blenkernel/intern/implicit.c @@ -185,7 +185,7 @@ DO_INLINE void print_lfvector(float (*fLongVector)[3], unsigned int verts) /* create long vector */ DO_INLINE lfVector *create_lfvector(unsigned int verts) { - // TODO: check if memory allocation was successfull */ + /* TODO: check if memory allocation was successfull */ return (lfVector *)MEM_callocN(verts * sizeof(lfVector), "cloth_implicit_alloc_vector"); // return (lfVector *)cloth_aligned_malloc(&MEMORY_BASE, verts * sizeof(lfVector)); } @@ -529,8 +529,8 @@ DO_INLINE void del_bfmatrix(fmatrix3x3 *matrix) /* copy big matrix */ DO_INLINE void cp_bfmatrix(fmatrix3x3 *to, fmatrix3x3 *from) -{ - // TODO bounds checking +{ + // TODO bounds checking memcpy(to, from, sizeof(fmatrix3x3) * (from[0].vcount+from[0].scount)); } @@ -1239,13 +1239,13 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s, s->flags |= CLOTH_SPRING_FLAG_NEEDED; k = clmd->sim_parms->structural; - + scaling = k + s->stiffness * ABS(clmd->sim_parms->max_struct-k); - + k = scaling / (clmd->sim_parms->avg_spring_len + FLT_EPSILON); - + // TODO: verify, half verified (couldn't see error) - mul_fvector_S(stretch_force, dir, k*(length-L)); + mul_fvector_S(stretch_force, dir, k*(length-L)); VECADD(s->f, s->f, stretch_force); @@ -1833,11 +1833,11 @@ int implicit_solver(Object *ob, float frame, ClothModifierData *clmd, ListBase * for (i=0, cv=cloth->verts; inumverts; i++, cv++) { copy_v3_v3(initial_cos[i], cv->tx); } - + // call collision function // TODO: check if "step" or "step+dt" is correct - dg do_extra_solve = cloth_bvh_objcollision(ob, clmd, step/clmd->sim_parms->timescale, dt/clmd->sim_parms->timescale); - + // copy corrected positions back to simulation for (i = 0; i < numverts; i++) { // correct velocity again, just to be sure we had to change it due to adaptive collisions diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index f51fee674cf..2fe567cc9bf 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -895,7 +895,7 @@ static char *get_rna_access(int blocktype, int adrcode, char actname[], char con /* special case for rotdiff drivers... we don't need a property for this... */ break; - // TODO... add other blocktypes... + /* TODO... add other blocktypes... */ default: printf("IPO2ANIMATO WARNING: No path for blocktype %d, adrcode %d yet\n", blocktype, adrcode); break; @@ -1588,9 +1588,9 @@ static void action_to_animdata(ID *id, bAction *act) /* ------------------------- */ -// TODO: -// - NLA group duplicators info -// - NLA curve/stride modifiers... +/* TODO: + * - NLA group duplicators info + * - NLA curve/stride modifiers... */ /* Convert NLA-Strip to new system */ static void nlastrips_to_animdata(ID *id, ListBase *strips) diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index de2b99fcbf9..c605f33b98f 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -1618,13 +1618,13 @@ static void decode_tfaceflag(Material *ma, int flag, int convertall) /* boolean check to see if the mesh needs a material */ static int check_tfaceneedmaterial(int flag) { - // check if the flags we have are not deprecated != than default material options - // also if only flags are visible and collision see if all objects using this mesh have this option in physics + /* check if the flags we have are not deprecated != than default material options + * also if only flags are visible and collision see if all objects using this mesh have this option in physics */ /* flag is shifted in 1 to make 0 != no flag yet (see encode_tfaceflag) */ flag -= 1; - // deprecated flags + /* deprecated flags */ flag &= ~TF_OBCOL; flag &= ~TF_SHAREDVERT; flag &= ~TF_SHAREDCOL; @@ -1632,12 +1632,12 @@ static int check_tfaceneedmaterial(int flag) /* light tface flag is ignored in GLSL mode */ flag &= ~TF_LIGHT; - // automatic detected if tex image has alpha + /* automatic detected if tex image has alpha */ flag &= ~(TF_ALPHA << 15); - // automatic detected if using texture + /* automatic detected if using texture */ flag &= ~TF_TEX; - // settings for the default NoMaterial + /* settings for the default NoMaterial */ if (flag == TF_DYNAMIC) return 0; @@ -1646,7 +1646,7 @@ static int check_tfaceneedmaterial(int flag) } /* return number of digits of an integer */ -// XXX to be optmized or replaced by an equivalent blender internal function +/* XXX to be optmized or replaced by an equivalent blender internal function */ static int integer_getdigits(int number) { int i = 0; @@ -1661,9 +1661,9 @@ static int integer_getdigits(int number) static void calculate_tface_materialname(char *matname, char *newname, int flag) { - // if flag has only light and collision and material matches those values - // you can do strcpy(name, mat_name); - // otherwise do: + /* if flag has only light and collision and material matches those values + * you can do strcpy(name, mat_name); + * otherwise do: */ int digits = integer_getdigits(flag); /* clamp the old name, remove the MA prefix and add the .TF.flag suffix * e.g. matname = "MALoooooooooooooongName"; newname = "Loooooooooooooon.TF.2" */ @@ -1736,9 +1736,9 @@ static short convert_tfacenomaterial(Main *main, Mesh *me, MTFace *tf, int flag) set_facetexture_flags(ma, tf->tpage); decode_tfaceflag(ma, flag, 1); - // the final decoding will happen after, outside the main loop - // for now store the flag into the material and change light/tex/collision - // store the flag as a negative number + /* the final decoding will happen after, outside the main loop + * for now store the flag into the material and change light/tex/collision + * store the flag as a negative number */ ma->game.flag = -flag; id_us_min((ID *)ma); } diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index fb15aa82fa2..84943172cbc 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -1469,20 +1469,20 @@ void BKE_nla_validate_state(AnimData *adt) * for normal editing only (i.e. not in editmode for some strip's action), * so no checks for this are performed. */ -// TODO: maybe we should have checks for this too... +/* TODO: maybe we should have checks for this too... */ void BKE_nla_action_pushdown(AnimData *adt) { NlaStrip *strip; - + /* sanity checks */ - // TODO: need to report the error for this + /* TODO: need to report the error for this */ if (ELEM(NULL, adt, adt->action)) return; - - /* if the action is empty, we also shouldn't try to add to stack, + + /* if the action is empty, we also shouldn't try to add to stack, * as that will cause us grief down the track */ - // TODO: what about modifiers? + /* TODO: what about modifiers? */ if (action_has_motion(adt->action) == 0) { printf("BKE_nla_action_pushdown(): action has no data\n"); return; diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index f0d47791374..a7a6dd1d5cd 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -223,7 +223,7 @@ void BKE_object_link_modifiers(struct Object *ob, struct Object *from) BKE_object_copy_particlesystems(ob, from); BKE_object_copy_softbody(ob, from); - // TODO: smoke?, cloth? + /* TODO: smoke?, cloth? */ } /* here we will collect all local displist stuff */ @@ -376,7 +376,7 @@ void BKE_object_unlink(Object *ob) unlink_actuators(&ob->actuators); /* check all objects: parents en bevels and fields, also from libraries */ - // FIXME: need to check all animation blocks (drivers) + /* FIXME: need to check all animation blocks (drivers) */ obt = bmain->object.first; while (obt) { if (obt->proxy == ob) @@ -1376,7 +1376,7 @@ void BKE_object_make_proxy(Object *ob, Object *target, Object *gob) BKE_object_copy_proxy_drivers(ob, target); /* skip constraints? */ - // FIXME: this is considered by many as a bug + /* FIXME: this is considered by many as a bug */ /* set object type and link to data */ ob->type = target->type; @@ -1971,7 +1971,7 @@ static void solve_parenting(Scene *scene, Object *ob, Object *par, float obmat[] // external usable originmat copy_m3_m4(originmat, tmat); - // origin, voor help line + /* origin, for help line */ if ((ob->partype & PARTYPE) == PARSKEL) { copy_v3_v3(ob->orig, par->obmat[3]); } @@ -1987,7 +1987,7 @@ static int where_is_object_parslow(Object *ob, float obmat[4][4], float slowmat[ float fac1, fac2; int a; - // include framerate + /* include framerate */ fac1 = (1.0f / (1.0f + fabsf(ob->sf)) ); if (fac1 >= 1.0f) return 0; fac2 = 1.0f - fac1; diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 1113555e3bf..3d81275bb06 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -952,9 +952,9 @@ static void scene_update_drivers(Main *UNUSED(bmain), Scene *scene) if (scene->adt && scene->adt->drivers.first) { BKE_animsys_evaluate_animdata(scene, &scene->id, scene->adt, ctime, ADT_RECALC_DRIVERS); } - + /* world */ - // TODO: what about world textures? but then those have nodes too... + /* TODO: what about world textures? but then those have nodes too... */ if (scene->world) { ID *wid = (ID *)scene->world; AnimData *adt = BKE_animdata_from_id(wid); diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 464b7fda51d..f9399946570 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -120,13 +120,13 @@ void space_transform_invert(const SpaceTransform *data, float co[3]) static void space_transform_apply_normal(const SpaceTransform *data, float no[3]) { mul_mat3_m4_v3(((SpaceTransform *)data)->local2target, no); - normalize_v3(no); // TODO: could we just determine de scale value from the matrix? + normalize_v3(no); /* TODO: could we just determine de scale value from the matrix? */ } static void space_transform_invert_normal(const SpaceTransform *data, float no[3]) { mul_mat3_m4_v3(((SpaceTransform *)data)->target2local, no); - normalize_v3(no); // TODO: could we just determine de scale value from the matrix? + normalize_v3(no); /* TODO: could we just determine de scale value from the matrix? */ } /* -- cgit v1.2.3