diff options
Diffstat (limited to 'source/blender')
102 files changed, 523 insertions, 491 deletions
diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h index 88035e2b3d9..e4dc8ffae02 100644 --- a/source/blender/blenkernel/BKE_customdata.h +++ b/source/blender/blenkernel/BKE_customdata.h @@ -61,14 +61,18 @@ extern const CustomData_MeshMasks CD_MASK_EVERYTHING; * memory space for totelem elements. mask must be an array of length * CD_NUMTYPES elements, that indicate if a layer can be copied. */ -/* add/copy/merge allocation types */ +/** Add/copy/merge allocation types. */ typedef enum eCDAllocType { - CD_ASSIGN = 0, /* use the data pointer */ - CD_CALLOC = 1, /* allocate blank memory */ - CD_DEFAULT = 2, /* allocate and set to default */ - CD_REFERENCE = 3, /* use data pointers, set layer flag NOFREE */ - CD_DUPLICATE = 4, /* do a full copy of all layers, only allowed if source - * has same number of elements */ + /** Use the data pointer. */ + CD_ASSIGN = 0, + /** Allocate blank memory. */ + CD_CALLOC = 1, + /** Allocate and set to default. */ + CD_DEFAULT = 2, + /** Use data pointers, set layer flag NOFREE. */ + CD_REFERENCE = 3, + /** Do a full copy of all layers, only allowed if source has same number of elements. */ + CD_DUPLICATE = 4, } eCDAllocType; #define CD_TYPE_AS_MASK(_type) (CustomDataMask)((CustomDataMask)1 << (CustomDataMask)(_type)) diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h index 68ef413b198..5b6f3cf17c4 100644 --- a/source/blender/blenkernel/BKE_modifier.h +++ b/source/blender/blenkernel/BKE_modifier.h @@ -110,13 +110,16 @@ typedef void (*TexWalkFunc)(void *userData, const char *propname); typedef enum ModifierApplyFlag { - MOD_APPLY_RENDER = 1 << 0, /* Render time. */ - MOD_APPLY_USECACHE = 1 << 1, /* Result of evaluation will be cached, so modifier might - * want to cache data for quick updates (used by subsurf) */ - MOD_APPLY_ORCO = 1 << 2, /* Modifier evaluated for undeformed texture coordinates */ - MOD_APPLY_IGNORE_SIMPLIFY = 1 << 3, /* Ignore scene simplification flag and use subdivisions - * level set in multires modifier. - */ + /** Render time. */ + MOD_APPLY_RENDER = 1 << 0, + /** Result of evaluation will be cached, so modifier might + * want to cache data for quick updates (used by subsurf) */ + MOD_APPLY_USECACHE = 1 << 1, + /** Modifier evaluated for undeformed texture coordinates */ + MOD_APPLY_ORCO = 1 << 2, + /** Ignore scene simplification flag and use subdivisions + * level set in multires modifier. */ + MOD_APPLY_IGNORE_SIMPLIFY = 1 << 3, } ModifierApplyFlag; typedef struct ModifierUpdateDepsgraphContext { diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index de92077b052..785c3eedcfc 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -3777,10 +3777,10 @@ void BKE_animsys_evaluate_all_animation(Main *main, printf("Evaluate all animation - %f\n", ctime); /* macros for less typing - * - only evaluate animation data for id if it has users (and not just fake ones) - * - whether animdata exists is checked for by the evaluation function, though taking - * this outside of the function may make things slightly faster? - */ + * - only evaluate animation data for id if it has users (and not just fake ones) + * - whether animdata exists is checked for by the evaluation function, though taking + * this outside of the function may make things slightly faster? + */ #define EVAL_ANIM_IDS(first, aflag) \ for (id = first; id; id = id->next) { \ if (ID_REAL_USERS(id) > 0) { \ @@ -3791,11 +3791,11 @@ void BKE_animsys_evaluate_all_animation(Main *main, (void)0 /* another macro for the "embedded" nodetree cases - * - this is like EVAL_ANIM_IDS, but this handles the case "embedded nodetrees" - * (i.e. scene/material/texture->nodetree) which we need a special exception - * for, otherwise they'd get skipped - * - ntp = "node tree parent" = datablock where node tree stuff resides - */ + * - this is like EVAL_ANIM_IDS, but this handles the case "embedded nodetrees" + * (i.e. scene/material/texture->nodetree) which we need a special exception + * for, otherwise they'd get skipped + * - ntp = "node tree parent" = datablock where node tree stuff resides + */ #define EVAL_ANIM_NODETREE_IDS(first, NtId_Type, aflag) \ for (id = first; id; id = id->next) { \ if (ID_REAL_USERS(id) > 0) { \ @@ -3906,9 +3906,9 @@ void BKE_animsys_eval_animdata(Depsgraph *depsgraph, ID *id) { float ctime = DEG_get_ctime(depsgraph); AnimData *adt = BKE_animdata_from_id(id); - Scene *scene = NULL; /* XXX: this is only needed for flushing RNA updates, - * which should get handled as part of the dependency graph instead... - */ + /* XXX: this is only needed for flushing RNA updates, + * which should get handled as part of the dependency graph instead. */ + Scene *scene = NULL; DEG_debug_print_eval_time(depsgraph, __func__, id->name, id, ctime); BKE_animsys_evaluate_animdata(depsgraph, scene, id, adt, ctime, ADT_RECALC_ANIM); } diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index 9f25cd14499..3062c4d52fa 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -713,7 +713,7 @@ static float cloth_shrink_factor(ClothModifierData *clmd, ClothVertex *verts, in float k2 = base + delta * verts[i2].shrink_factor; /* Use geometrical mean to average two factors since it behaves better - for diagonals when a rectangle transforms into a trapezoid. */ + * for diagonals when a rectangle transforms into a trapezoid. */ return sqrtf(k1 * k2); } diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index 67e1f36b222..41dc82cf05f 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -73,8 +73,8 @@ typedef struct SelfColDetectData { } SelfColDetectData; /*********************************** -Collision modifier code start -***********************************/ + * Collision modifier code start + ***********************************/ /* step is limited from 0 (frame start position) to 1 (frame end position) */ void collision_move_object(CollisionModifierData *collmd, float step, float prevstep) @@ -178,9 +178,9 @@ void bvhtree_update_from_mvert(BVHTree *bvhtree, BLI_bvhtree_update_tree(bvhtree); } -/*********************************** -Collision modifier code end -***********************************/ +/* *************************** + * Collision modifier code end + * *************************** */ BLI_INLINE int next_ind(int i) { diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c index 7769f3aff86..c0effb1cb32 100644 --- a/source/blender/blenkernel/intern/deform.c +++ b/source/blender/blenkernel/intern/deform.c @@ -1192,7 +1192,7 @@ static bool data_transfer_layersmapping_vgroups_multisrc_to_dst(ListBase *r_map, } if (r_map) { /* At this stage, we **need** a valid CD_MDEFORMVERT layer on dest! - * use_create is not relevant in this case */ + * use_create is not relevant in this case */ if (!data_dst) { data_dst = CustomData_add_layer(cd_dst, CD_MDEFORMVERT, CD_CALLOC, NULL, num_elem_dst); } diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index 4311402ef42..ffb3bad12e6 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -669,7 +669,7 @@ enum { * And in some cases it is even the same value as FT_Face->bbox.yMax/yMin (font top and bottom respectively). * * The em_height here is relative to FT_Face->bbox. -*/ + */ #define ASCENT(vfd) ((vfd)->ascender * (vfd)->em_height) #define DESCENT(vfd) ((vfd)->em_height - ASCENT(vfd)) diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index c2c8fb78a32..46315e1bc9a 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -852,10 +852,10 @@ static const char *particle_adrcodes_to_paths(int adrcode, int *array_index) return "settings.billboard_tilt"; /* PartDeflect needs to be sorted out properly in rna_object_force; - * If anyone else works on this, but is unfamiliar, these particular - * settings reference the particles of the system themselves - * being used as forces -- it will use the same rna structure - * as the similar object forces */ + * If anyone else works on this, but is unfamiliar, these particular + * settings reference the particles of the system themselves + * being used as forces -- it will use the same rna structure + * as the similar object forces */ #if 0 case PART_PD_FSTR: if (part->pd) diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index ee6faeaee3d..45bade78207 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -2188,10 +2188,10 @@ static bNodeSocket *make_socket_interface(bNodeTree *ntree, BLI_snprintf(sock->identifier, MAX_NAME, "Output_%d", own_index); #ifdef USE_NODE_COMPAT_CUSTOMNODES /* XXX forward compatibility: - * own_index is deprecated, but needs to be set here. - * Node sockets generally use the identifier string instead now, - * but reconstructing own_index in writefile.c would require parsing the identifier string. - */ + * own_index is deprecated, but needs to be set here. + * Node sockets generally use the identifier string instead now, + * but reconstructing own_index in writefile.c would require parsing the identifier string. + */ # if (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 406)) || defined(__clang__) # pragma GCC diagnostic push diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 65ad1c483c3..37b6211916c 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -644,8 +644,8 @@ static void add_2nd_order_roller(Object *ob, float UNUSED(stiffness), int *count v0 = (sb->totpoint - a); for (b = bp->nofsprings; b > 0; b--) { bs = sb->bspring + bp->springs[b - 1]; - /*nasty thing here that springs have two ends - so here we have to make sure we examine the other */ + /* Nasty thing here that springs have two ends + * so here we have to make sure we examine the other */ if (v0 == bs->v1) { bpo = sb->bpoint + bs->v2; notthis = bs->v2; @@ -3289,11 +3289,13 @@ static void softbody_step( /* special case of 2nd order Runge-Kutta type AKA Heun */ int mid_flags = 0; float err = 0; - float forcetimemax = 1.0f; /* set defaults guess we shall do one frame */ - float forcetimemin = 0.01f; /* set defaults guess 1/100 is tight enough */ - float timedone = 0.0; /* how far did we get without violating error condition */ - /* loops = counter for emergency brake - * we don't want to lock up the system if physics fail */ + /* Set defaults guess we shall do one frame */ + float forcetimemax = 1.0f; + /* Set defaults guess 1/100 is tight enough */ + float forcetimemin = 0.01f; + /* How far did we get without violating error condition. */ + float timedone = 0.0; + /* Loops = counter for emergency brake we don't want to lock up the system if physics fail. */ int loops = 0; SoftHeunTol = sb->rklimit; /* humm .. this should be calculated from sb parameters and sizes */ diff --git a/source/blender/blenkernel/intern/tracking_auto.c b/source/blender/blenkernel/intern/tracking_auto.c index e93a5780b81..8a474725b0c 100644 --- a/source/blender/blenkernel/intern/tracking_auto.c +++ b/source/blender/blenkernel/intern/tracking_auto.c @@ -45,8 +45,7 @@ typedef struct AutoTrackOptions { int clip_index; /** Index of the clip this track belogs to. */ int track_index; /* Index of the track in AutoTrack tracks structure. */ MovieTrackingTrack *track; /* Pointer to an original track/ */ - libmv_TrackRegionOptions track_region_options; /* Options for the region - tracker. */ + libmv_TrackRegionOptions track_region_options; /* Options for the region tracker. */ bool use_keyframe_match; /* Keyframe pattern matching. */ /* TODO(sergey): A bit awkward to keep it in here, only used to diff --git a/source/blender/blenlib/BLI_assert.h b/source/blender/blenlib/BLI_assert.h index 44dc4324328..3d3c84d6370 100644 --- a/source/blender/blenlib/BLI_assert.h +++ b/source/blender/blenlib/BLI_assert.h @@ -94,13 +94,13 @@ extern "C" { #else /* older gcc, clang... */ /* Code adapted from http://www.pixelbeat.org/programming/gcc/static_assert.html */ /* Note we need the two concats below because arguments to ## are not expanded, so we need to - * expand __LINE__ with one indirection before doing the actual concatenation. */ + * expand __LINE__ with one indirection before doing the actual concatenation. */ # define _BLI_ASSERT_CONCAT_(a, b) a##b # define _BLI_ASSERT_CONCAT(a, b) _BLI_ASSERT_CONCAT_(a, b) /* This can't be used twice on the same line so ensure if using in headers - * that the headers are not included twice (by wrapping in #ifndef...#endif) - * Note it doesn't cause an issue when used on same line of separate modules - * compiled with gcc -combine -fwhole-program. */ + * that the headers are not included twice (by wrapping in #ifndef...#endif) + * Note it doesn't cause an issue when used on same line of separate modules + * compiled with gcc -combine -fwhole-program. */ # define BLI_STATIC_ASSERT(a, msg) \ ; \ enum { _BLI_ASSERT_CONCAT(assert_line_, __LINE__) = 1 / (int)(!!(a)) }; diff --git a/source/blender/blenlib/PIL_time.h b/source/blender/blenlib/PIL_time.h index 7d8983dea57..21ebc9d4b90 100644 --- a/source/blender/blenlib/PIL_time.h +++ b/source/blender/blenlib/PIL_time.h @@ -31,17 +31,14 @@ extern "C" { extern /** Return an indication of time, expressed as - * seconds since some fixed point. Successive calls - * are guaranteed to generate values greater than or - * equal to the last call. - */ + * seconds since some fixed point. Successive calls + * are guaranteed to generate values greater than or + * equal to the last call. */ double PIL_check_seconds_timer(void); extern - /** - * int version of #PIL_check_seconds_timer - */ + /** `int` version of #PIL_check_seconds_timer. */ long int PIL_check_seconds_timer_i(void); diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index af0a66503f2..668308581e7 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -1899,9 +1899,9 @@ bool isect_ray_tri_watertight_v3(const float ray_origin[3], const float t = (u * a_kz + v * b_kz + w * c_kz) * sz; const float sign_t = xor_fl(t, sign_det); if ((sign_t < 0.0f) - /* differ from Cycles, don't read r_lambda's original value - * otherwise we won't match any of the other intersect functions here... - * which would be confusing */ + /* Differ from Cycles, don't read r_lambda's original value + * otherwise we won't match any of the other intersect functions here... + * which would be confusing. */ #if 0 || (sign_T > *r_lambda * xor_signmask(det, sign_mask)) #endif diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c index 42d0edbcc0c..785e6b4016e 100644 --- a/source/blender/blenloader/intern/versioning_260.c +++ b/source/blender/blenloader/intern/versioning_260.c @@ -797,7 +797,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) for (i = 0; i < 3; i++) { if ((ob->dsize[i] == 0.0f) || /* simple case, user never touched dsize */ (ob->scale[i] == 0.0f)) /* cant scale the dsize to give a non zero result, - * so fallback to 1.0f */ + * so fallback to 1.0f */ { ob->dscale[i] = 1.0f; } diff --git a/source/blender/bmesh/bmesh_class.h b/source/blender/bmesh/bmesh_class.h index 220a5b3a5f5..2cc5b1b8097 100644 --- a/source/blender/bmesh/bmesh_class.h +++ b/source/blender/bmesh/bmesh_class.h @@ -58,23 +58,32 @@ struct BLI_mempool; * 4: some elements for internal record keeping. */ typedef struct BMHeader { - void *data; /* customdata layers */ - int index; /* notes: - * - Use BM_elem_index_get/set macros for index - * - Uninitialized to -1 so we can easily tell its not set. - * - Used for edge/vert/face/loop, check BMesh.elem_index_dirty for valid index values, - * this is abused by various tools which set it dirty. - * - For loops this is used for sorting during tessellation. */ - - char htype; /* element geometric type (verts/edges/loops/faces) */ - char hflag; /* this would be a CD layer, see below */ - - /* internal use only! - * note,.we are very picky about not bloating this struct + /** Customdata layers. */ + void *data; + + /** + * \note + * - Use BM_elem_index_get/set macros for index + * - Uninitialized to -1 so we can easily tell its not set. + * - Used for edge/vert/face/loop, check BMesh.elem_index_dirty for valid index values, + * this is abused by various tools which set it dirty. + * - For loops this is used for sorting during tessellation. + */ + int index; + + /** Element geometric type (verts/edges/loops/faces). */ + char htype; + /** This would be a CD layer, see below. */ + char hflag; + + /** + * Internal use only! + * \note We are very picky about not bloating this struct * but in this case its padded up to 16 bytes anyway, - * so adding a flag here gives no increase in size */ + * so adding a flag here gives no increase in size. + */ char api_flag; - // char _pad; + // char _pad; } BMHeader; BLI_STATIC_ASSERT((sizeof(BMHeader) <= 16), "BMHeader size has grown!"); diff --git a/source/blender/bmesh/intern/bmesh_construct.c b/source/blender/bmesh/intern/bmesh_construct.c index 0528a550be4..4a4ea1e17a7 100644 --- a/source/blender/bmesh/intern/bmesh_construct.c +++ b/source/blender/bmesh/intern/bmesh_construct.c @@ -436,12 +436,12 @@ void BM_verts_sort_radial_plane(BMVert **vert_arr, int len) far_cross_dist = normalize_v3(far_cross_vec); /* more of a weight then a distance */ - far_cross_dist = (/* first we want to have a value close to zero mapped to 1 */ - 1.0f - fabsf(dot_v3v3(far_vec, far_cross_vec)) * - - /* second we multiply by the distance - * so points close to the center are not preferred */ - far_cross_dist); + far_cross_dist = ( + /* First we want to have a value close to zero mapped to 1. */ + 1.0f - fabsf(dot_v3v3(far_vec, far_cross_vec)) * + /* Second we multiply by the distance + * so points close to the center are not preferred. */ + far_cross_dist); if (far_cross_dist > far_cross_best || far_cross == NULL) { far_cross = vert_arr[i]->co; diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c index 3673c299a0c..7a42ee35440 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.c +++ b/source/blender/bmesh/intern/bmesh_mesh.c @@ -1038,7 +1038,7 @@ void BM_mesh_loop_normals_update(BMesh *bm, if (use_split_normals) { /* Tag smooth edges and set lnos from vnos when they might be completely smooth... - * When using custom loop normals, disable the angle feature! */ + * When using custom loop normals, disable the angle feature! */ bm_mesh_edges_sharp_tag(bm, NULL, NULL, has_clnors ? (float)M_PI : split_angle, r_lnos); /* Finish computing lnos by accumulating face normals in each fan of faces defined by sharp edges. */ diff --git a/source/blender/bmesh/intern/bmesh_private.h b/source/blender/bmesh/intern/bmesh_private.h index b77243f7b26..d5cbe947293 100644 --- a/source/blender/bmesh/intern/bmesh_private.h +++ b/source/blender/bmesh/intern/bmesh_private.h @@ -31,8 +31,8 @@ /* returns positive nonzero on error */ #ifdef NDEBUG -/* no error checking for release, - * it can take most of the CPU time when running some tools */ +/* No error checking for release, + * it can take most of the CPU time when running some tools. */ # define BM_CHECK_ELEMENT(el) (void)(el) #else int bmesh_elem_check(void *element, const char htype); diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp index b88b64e7257..826306fa789 100644 --- a/source/blender/collada/AnimationExporter.cpp +++ b/source/blender/collada/AnimationExporter.cpp @@ -184,11 +184,9 @@ void AnimationExporter::export_curve_animation_set(Object *ob, for (it = curves->begin(); it != curves->end(); ++it) { BCAnimationCurve &curve = *it->second; if (curve.get_channel_target() == "rotation_quaternion") { - /* - Can not export Quaternion animation in Collada as far as i know) - Maybe automatically convert to euler rotation? - Discard for now. - */ + /* Can not export Quaternion animation in Collada as far as i know) + * Maybe automatically convert to euler rotation? + * Discard for now. */ continue; } @@ -622,9 +620,9 @@ std::string AnimationExporter::collada_source_from_values( return source_id; } -/* - * Create a collada matrix source for a set of samples -*/ +/** + * Create a collada matrix source for a set of samples. + */ std::string AnimationExporter::collada_source_from_values(BCMatrixSampleMap &samples, const std::string &anim_id) { @@ -802,8 +800,7 @@ std::string AnimationExporter::get_collada_sid(const BCAnimationCurve &curve, #ifdef WITH_MORPH_ANIMATION /* TODO: This function needs to be implemented similar to the material animation export -So we have to update BCSample for this to work. -*/ + * So we have to update BCSample for this to work. */ void AnimationExporter::export_morph_animation(Object *ob, BCAnimationSampler &sampler) { FCurve *fcu; diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp index e7a48ee27da..8a9a8e5eb7b 100644 --- a/source/blender/collada/AnimationImporter.cpp +++ b/source/blender/collada/AnimationImporter.cpp @@ -395,12 +395,11 @@ virtual void AnimationImporter::change_eul_to_quat(Object *ob, bAction *act) // make eul relative to bone rest pose float rot[3][3], rel[3][3], quat[4]; - /*eul_to_mat3(rot, eul); - - mul_m3_m3m3(rel, irest, rot); - - mat3_to_quat(quat, rel); - */ +# if 0 + eul_to_mat3(rot, eul); + mul_m3_m3m3(rel, irest, rot); + mat3_to_quat(quat, rel); +# endif eul_to_quat(quat, eul); diff --git a/source/blender/collada/ArmatureExporter.cpp b/source/blender/collada/ArmatureExporter.cpp index 5abe0998470..0b84f844dbf 100644 --- a/source/blender/collada/ArmatureExporter.cpp +++ b/source/blender/collada/ArmatureExporter.cpp @@ -261,11 +261,13 @@ void ArmatureExporter::add_bone_transform(Object *ob_arm, Bone *bone, COLLADASW: bc_create_restpose_mat(this->export_settings, bone, bone_rest_mat, bone->arm_mat, true); if (bone->parent) { - // get bone-space matrix from parent pose - /*bPoseChannel *parchan = BKE_pose_channel_find_name(ob_arm->pose, bone->parent->name); + /* Get bone-space matrix from parent pose. */ +#if 0 + bPoseChannel *parchan = BKE_pose_channel_find_name(ob_arm->pose, bone->parent->name); float invpar[4][4]; invert_m4_m4(invpar, parchan->pose_mat); - mul_m4_m4m4(mat, invpar, pchan->pose_mat);*/ + mul_m4_m4m4(mat, invpar, pchan->pose_mat); +#endif float invpar[4][4]; bc_create_restpose_mat( this->export_settings, bone->parent, parent_rest_mat, bone->parent->arm_mat, true); diff --git a/source/blender/collada/ArmatureImporter.cpp b/source/blender/collada/ArmatureImporter.cpp index 315ae91e643..70ee3274d14 100644 --- a/source/blender/collada/ArmatureImporter.cpp +++ b/source/blender/collada/ArmatureImporter.cpp @@ -613,10 +613,8 @@ Object *ArmatureImporter::create_armature_bones(Main *bmain, SkinInfo &skin) // bone_direction_row = 1; // TODO: don't default to Y but use asset and based on it decide on default row // create bones - /* - TODO: - check if bones have already been created for a given joint - */ + /* TODO: + * check if bones have already been created for a given joint */ std::vector<COLLADAFW::Node *>::iterator ri; for (ri = root_joints.begin(); ri != root_joints.end(); ri++) { @@ -686,9 +684,11 @@ void ArmatureImporter::set_pose(Object *ob_arm, mul_m4_m4m4(pchan->pose_mat, invObmat, mat); } - //float angle = 0.0f; - ///*mat4_to_axis_angle(ax, &angle, mat); - //pchan->bone->roll = angle;*/ +#if 0 + float angle = 0.0f; + mat4_to_axis_angle(ax, &angle, mat); + pchan->bone->roll = angle; +#endif COLLADAFW::NodePointerArray &children = root_node->getChildNodes(); for (unsigned int i = 0; i < children.getCount(); i++) { diff --git a/source/blender/collada/BCAnimationCurve.cpp b/source/blender/collada/BCAnimationCurve.cpp index 2eb30d6779c..90da5907c6f 100644 --- a/source/blender/collada/BCAnimationCurve.cpp +++ b/source/blender/collada/BCAnimationCurve.cpp @@ -262,10 +262,9 @@ FCurve *BCAnimationCurve::get_edit_fcurve() fcurve = create_fcurve(index, path.c_str()); /* Caution here: - Replacing the pointer here is OK only because the original value - of FCurve was a const pointer into Blender territory. We do not - touch that! We use the local copy to prepare data for export. - */ + * Replacing the pointer here is OK only because the original value + * of FCurve was a const pointer into Blender territory. We do not + * touch that! We use the local copy to prepare data for export. */ curve_is_local_copy = true; } diff --git a/source/blender/collada/BCAnimationSampler.cpp b/source/blender/collada/BCAnimationSampler.cpp index e8b1015e1c3..ee574e2968b 100644 --- a/source/blender/collada/BCAnimationSampler.cpp +++ b/source/blender/collada/BCAnimationSampler.cpp @@ -271,12 +271,11 @@ void BCAnimationSampler::find_depending_animated(std::set<Object *> &animated_ob void BCAnimationSampler::get_animated_from_export_set(std::set<Object *> &animated_objects, LinkNode &export_set) { - /* - Check if this object is animated. That is: Check if it has its own action, or - - - Check if it has constraints to other objects - - at least one of the other objects is animated as well - */ + /* Check if this object is animated. That is: Check if it has its own action, or: + * + * - Check if it has constraints to other objects. + * - at least one of the other objects is animated as well. + */ animated_objects.clear(); std::set<Object *> static_objects; @@ -320,18 +319,17 @@ bool BCAnimationSampler::get_object_samples(BCMatrixSampleMap &samples, Object * } #if 0 -/* - Add sampled values to FCurve - If no FCurve exists, create a temporary FCurve; - Note: The temporary FCurve will later be removed when the - BCAnimationSampler is removed (by its destructor) - - curve: The curve to whioch the data is added - matrices: The set of matrix values from where the data is taken - animation_type BC_ANIMATION_EXPORT_SAMPLES: Use all matrix data - animation_type BC_ANIMATION_EXPORT_KEYS: Only take data from matrices for keyframes -*/ - +/** + * Add sampled values to FCurve + * If no FCurve exists, create a temporary FCurve; + * Note: The temporary FCurve will later be removed when the + * BCAnimationSampler is removed (by its destructor) + * + * curve: The curve to whioch the data is added + * matrices: The set of matrix values from where the data is taken + * animation_type BC_ANIMATION_EXPORT_SAMPLES: Use all matrix data + * animation_type BC_ANIMATION_EXPORT_KEYS: Only take data from matrices for keyframes + */ void BCAnimationSampler::add_value_set(BCAnimationCurve &curve, BCFrameSampleMap &samples, BC_export_animation_type animation_type) diff --git a/source/blender/collada/BCAnimationSampler.h b/source/blender/collada/BCAnimationSampler.h index 6be386682e1..9544c6be916 100644 --- a/source/blender/collada/BCAnimationSampler.h +++ b/source/blender/collada/BCAnimationSampler.h @@ -68,11 +68,9 @@ typedef std::map<Object *, BCAnimation *> BCAnimationObjectMap; class BCSampleFrame { - /* - Each frame on the timeline that needs to be sampled will have - one BCSampleFrame where we collect sample information about all objects - that need to be sampled for that frame. - */ + /* Each frame on the timeline that needs to be sampled will have + * one BCSampleFrame where we collect sample information about all objects + * that need to be sampled for that frame. */ private: BCSampleMap sampleMap; diff --git a/source/blender/collada/BCSampleData.cpp b/source/blender/collada/BCSampleData.cpp index 6e17598469f..868526928b0 100644 --- a/source/blender/collada/BCSampleData.cpp +++ b/source/blender/collada/BCSampleData.cpp @@ -129,10 +129,8 @@ void BCMatrix::unit() unit_m4(matrix); } -/* -We need double here because the OpenCollada API needs it. -precision = -1 indicates to not limit the precision -*/ +/* We need double here because the OpenCollada API needs it. + * precision = -1 indicates to not limit the precision. */ void BCMatrix::get_matrix(double (&mat)[4][4], const bool transposed, const int precision) const { for (int i = 0; i < 4; i++) diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp index 428678180f6..567f215ac04 100644 --- a/source/blender/collada/DocumentImporter.cpp +++ b/source/blender/collada/DocumentImporter.cpp @@ -985,11 +985,14 @@ bool DocumentImporter::writeLight(const COLLADAFW::Light *light) std::string la_id, la_name; ExtraTags *et = getExtraTags(light->getUniqueId()); - /*TagsMap::iterator etit; +#if 0 + TagsMap::iterator etit; ExtraTags *et = 0; etit = uid_tags_map.find(light->getUniqueId().toAscii()); - if (etit != uid_tags_map.end()) - et = etit->second;*/ + if (etit != uid_tags_map.end()) { + et = etit->second; + } +#endif la_id = light->getOriginalId(); la_name = light->getName(); diff --git a/source/blender/collada/SceneExporter.cpp b/source/blender/collada/SceneExporter.cpp index e689cffe470..7cb211c7c35 100644 --- a/source/blender/collada/SceneExporter.cpp +++ b/source/blender/collada/SceneExporter.cpp @@ -81,12 +81,11 @@ void SceneExporter::exportHierarchy() void SceneExporter::writeNodeList(std::vector<Object *> &child_objects, Object *parent) { /* TODO: Handle the case where a parent is not exported - Actually i am not even sure if this can be done at all - in a good way. - I really prefer to enforce the export of hidden - elements in an object hierarchy. When the children of - the hidden elements are exported as well. - */ + * Actually i am not even sure if this can be done at all + * in a good way. + * I really prefer to enforce the export of hidden + * elements in an object hierarchy. When the children of + * the hidden elements are exported as well. */ for (int i = 0; i < child_objects.size(); ++i) { Object *child = child_objects[i]; if (bc_is_marked(child)) { diff --git a/source/blender/collada/collada_utils.cpp b/source/blender/collada/collada_utils.cpp index 9ce6b399daa..c18f70676bc 100644 --- a/source/blender/collada/collada_utils.cpp +++ b/source/blender/collada/collada_utils.cpp @@ -195,8 +195,7 @@ std::vector<bAction *> bc_getSceneActions(const bContext *C, Object *ob, bool al for (id = (ID *)bmain->actions.first; id; id = (ID *)(id->next)) { bAction *act = (bAction *)id; /* XXX This currently creates too many actions. - TODO Need to check if the action is compatible to the given object - */ + * TODO Need to check if the action is compatible to the given object. */ actions.push_back(act); } } @@ -228,10 +227,8 @@ void bc_update_scene(BlenderContext &blender_context, float ctime) Scene *scene = blender_context.get_scene(); Depsgraph *depsgraph = blender_context.get_depsgraph(); - /* - * See remark in physics_fluid.c lines 395...) - * BKE_scene_update_for_newframe(ev_context, bmain, scene, scene->lay); - */ + /* See remark in physics_fluid.c lines 395...) */ + // BKE_scene_update_for_newframe(ev_context, bmain, scene, scene->lay); BKE_scene_frame_set(scene, ctime); ED_update_for_newframe(bmain, depsgraph); } @@ -341,7 +338,7 @@ bool bc_is_in_Export_set(LinkNode *export_set, Object *ob, ViewLayer *view_layer if (!to_export) { /* Mark this object as to_export even if it is not in the - export list, but it contains children to export */ + * export list, but it contains children to export. */ std::vector<Object *> children; bc_get_children(children, ob, view_layer); diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.h b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.h index c913bb0f3f2..b174941e3bb 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.h +++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.h @@ -74,8 +74,7 @@ void deg_free_copy_on_write_datablock(struct ID *id_cow); void deg_evaluate_copy_on_write(struct ::Depsgraph *depsgraph, const struct IDNode *id_node); /* Check that given ID is properly expanded and does not have any shallow - * copies inside. - */ + * copies inside. */ bool deg_validate_copy_on_write_datablock(ID *id_cow); /* Tag given ID block as being copy-on-wtritten. */ diff --git a/source/blender/draw/engines/eevee/eevee_lights.c b/source/blender/draw/engines/eevee/eevee_lights.c index b118d7be3d0..917043d70e7 100644 --- a/source/blender/draw/engines/eevee/eevee_lights.c +++ b/source/blender/draw/engines/eevee/eevee_lights.c @@ -952,7 +952,7 @@ static void frustum_min_bounding_sphere(const float corners[8][3], } /* TODO try to reduce the radius further by moving the center. - * Remember we need a __stable__ solution! */ + * Remember we need a __stable__ solution! */ /* Try to reduce float imprecision leading to shimmering. */ *r_radius = (float)round_to_digits(sqrtf(*r_radius), 3); diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c index 0557fd11995..86a87121683 100644 --- a/source/blender/draw/engines/eevee/eevee_materials.c +++ b/source/blender/draw/engines/eevee/eevee_materials.c @@ -466,7 +466,7 @@ static void eevee_init_util_texture(void) texels_layer += 64 * 64; /* Copy bsdf_split_sum_ggx into 2nd layer red and green channels. - Copy ltc_mag_ggx into 2nd layer blue and alpha channel. */ + * Copy ltc_mag_ggx into 2nd layer blue and alpha channel. */ for (int i = 0; i < 64 * 64; i++) { texels_layer[i][0] = bsdf_split_sum_ggx[i * 2 + 0]; texels_layer[i][1] = bsdf_split_sum_ggx[i * 2 + 1]; diff --git a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c index 76ec0a61b8c..67ffe62f3c6 100644 --- a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c @@ -78,8 +78,8 @@ tGPencilObjectCache *gpencil_object_cache_add(tGPencilObjectCache *cache_array, tGPencilObjectCache *p = NULL; /* By default a cache is created with one block with a predefined number of free slots, - if the size is not enough, the cache is reallocated adding a new block of free slots. - This is done in order to keep cache small */ + * if the size is not enough, the cache is reallocated adding a new block of free slots. + * This is done in order to keep cache small. */ if (*gp_cache_used + 1 > *gp_cache_size) { if ((*gp_cache_size == 0) || (cache_array == NULL)) { p = MEM_callocN(sizeof(struct tGPencilObjectCache) * GP_CACHE_BLOCK_SIZE, @@ -187,8 +187,8 @@ GpencilBatchGroup *gpencil_group_cache_add(GpencilBatchGroup *cache_array, GpencilBatchGroup *p = NULL; /* By default a cache is created with one block with a predefined number of free slots, - if the size is not enough, the cache is reallocated adding a new block of free slots. - This is done in order to keep cache small */ + * if the size is not enough, the cache is reallocated adding a new block of free slots. + * This is done in order to keep cache small. */ if (*grp_used + 1 > *grp_size) { if ((*grp_size == 0) || (cache_array == NULL)) { p = MEM_callocN(sizeof(struct GpencilBatchGroup) * GPENCIL_GROUPS_BLOCK_SIZE, diff --git a/source/blender/draw/engines/gpencil/gpencil_render.c b/source/blender/draw/engines/gpencil/gpencil_render.c index 282c4ca3a77..40937f317ad 100644 --- a/source/blender/draw/engines/gpencil/gpencil_render.c +++ b/source/blender/draw/engines/gpencil/gpencil_render.c @@ -18,7 +18,7 @@ /** \file * \ingroup draw - */ + */ #include "BLI_rect.h" #include "DRW_render.h" @@ -36,9 +36,9 @@ #include "gpencil_engine.h" /* Get pixel size for render - * This function uses the same calculation used for viewport, because if use - * camera pixelsize, the result is not correct. - */ + * This function uses the same calculation used for viewport, because if use + * camera pixelsize, the result is not correct. + */ static float get_render_pixelsize(float persmat[4][4], int winx, int winy) { float v1[3], v2[3]; diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c index 73c68d0d6b9..630cbd20319 100644 --- a/source/blender/draw/intern/draw_cache_impl_mesh.c +++ b/source/blender/draw/intern/draw_cache_impl_mesh.c @@ -1645,7 +1645,7 @@ static void mesh_render_data_edge_flag(const MeshRenderData *rdata, * specular highlights make it hard to see T55456#510873. * * This isn't ideal since it can't be used when mixing edge/face modes - * but it's still better then not being able to see the active face. */ + * but it's still better then not being able to see the active face. */ if (is_face_only_select_mode) { if (rdata->efa_act != NULL) { if (BM_edge_in_face(eed, rdata->efa_act)) { diff --git a/source/blender/draw/modes/edit_mesh_mode_text.c b/source/blender/draw/modes/edit_mesh_mode_text.c index 90396785eb3..f97d1083876 100644 --- a/source/blender/draw/modes/edit_mesh_mode_text.c +++ b/source/blender/draw/modes/edit_mesh_mode_text.c @@ -157,16 +157,17 @@ void DRW_edit_mesh_mode_text_measure_stats(ARegion *ar, BM_ITER_MESH (eed, &iter, em->bm, BM_EDGES_OF_MESH) { BMLoop *l_a, *l_b; if (BM_edge_loop_pair(eed, &l_a, &l_b)) { - /* draw selected edges, or edges next to selected verts while dragging */ + /* Draw selected edges, or edges next to selected verts while dragging. */ if (BM_elem_flag_test(eed, BM_ELEM_SELECT) || - (do_moving && (BM_elem_flag_test(eed->v1, BM_ELEM_SELECT) || - BM_elem_flag_test(eed->v2, BM_ELEM_SELECT) || - /* special case, this is useful to show when verts connected to - * this edge via a face are being transformed */ - BM_elem_flag_test(l_a->next->next->v, BM_ELEM_SELECT) || - BM_elem_flag_test(l_a->prev->v, BM_ELEM_SELECT) || - BM_elem_flag_test(l_b->next->next->v, BM_ELEM_SELECT) || - BM_elem_flag_test(l_b->prev->v, BM_ELEM_SELECT)))) { + (do_moving && + (BM_elem_flag_test(eed->v1, BM_ELEM_SELECT) || + BM_elem_flag_test(eed->v2, BM_ELEM_SELECT) || + /* Special case, this is useful to show when verts connected to this edge + * via a face are being transformed. */ + BM_elem_flag_test(l_a->next->next->v, BM_ELEM_SELECT) || + BM_elem_flag_test(l_a->prev->v, BM_ELEM_SELECT) || + BM_elem_flag_test(l_b->next->next->v, BM_ELEM_SELECT) || + BM_elem_flag_test(l_b->prev->v, BM_ELEM_SELECT)))) { float v1_clip[3], v2_clip[3]; copy_v3_v3(v1, eed->v1->co); diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c index ec49b4dbe51..786146dc2ff 100644 --- a/source/blender/draw/modes/object_mode.c +++ b/source/blender/draw/modes/object_mode.c @@ -3115,11 +3115,10 @@ static void OBJECT_cache_populate(void *vedata, Object *ob) ((DRW_object_is_renderable(ob) && (ob->dt > OB_WIRE)) || (ob->dt == OB_WIRE))); const bool show_relations = ((draw_ctx->v3d->flag & V3D_HIDE_HELPLINES) == 0); - const bool hide_object_extra = ((v3d->overlay.flag & V3D_OVERLAY_HIDE_OBJECT_XTRAS) != 0 && - /* Show if this is the camera we're looking through - * since it's useful for moving the camera. */ - (((rv3d->persp == RV3D_CAMOB) && - ((ID *)v3d->camera == ob->id.orig_id)) == 0)); + const bool hide_object_extra = + ((v3d->overlay.flag & V3D_OVERLAY_HIDE_OBJECT_XTRAS) != 0 && + /* Show if this is the camera we're looking through since it's useful for selecting. */ + (((rv3d->persp == RV3D_CAMOB) && ((ID *)v3d->camera == ob->id.orig_id)) == 0)); if (do_outlines) { if (!BKE_object_is_in_editmode(ob) && diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 67d0e969735..225bad1b35b 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -3667,7 +3667,7 @@ static bAnimChannelType ACF_NLAACTION = { ACHANNEL_ROLE_CHANNEL, /* role */ acf_nlaaction_color, /* backdrop color (NOTE: the backdrop handles this too, - * since it needs special hacks) */ + * since it needs special hacks). */ acf_nlaaction_backdrop, /* backdrop */ acf_generic_indention_flexible, /* indent level */ acf_generic_group_offset, diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index e8c17e10b17..de8e6bb1362 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -567,8 +567,8 @@ void draw_keyframe_shape(float x, size *= 0.85f; break; - case BEZT_KEYTYPE_MOVEHOLD: /* slightly smaller than normal keyframes - * (but by less than for breakdowns) */ + case BEZT_KEYTYPE_MOVEHOLD: /* Slightly smaller than normal keyframes + * (but by less than for breakdowns). */ size *= 0.925f; break; diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c index b64bccdf1ce..aedfc88e43f 100644 --- a/source/blender/editors/gpencil/annotate_paint.c +++ b/source/blender/editors/gpencil/annotate_paint.c @@ -1514,7 +1514,7 @@ static void gpencil_draw_eraser(bContext *UNUSED(C), int x, int y, void *p_ptr) y, p->radius, /* XXX Dashed shader gives bad results with sets of small segments currently, - * temp hack around the issue. :( */ + * temp hack around the issue. :( */ max_ii(8, p->radius / 2)); /* was fixed 40 */ immUnbindProgram(); diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c index ef0ebd06d07..627e05393ff 100644 --- a/source/blender/editors/gpencil/gpencil_brush.c +++ b/source/blender/editors/gpencil/gpencil_brush.c @@ -190,8 +190,7 @@ static void gpsculpt_compute_lock_axis(tGP_BrushEditData *gso, break; } case GP_LOCKAXIS_CURSOR: { - /* compute a plane with cursor normal and position of the point - before do the sculpt */ + /* Compute a plane with cursor normal and position of the point before do the sculpt. */ const float scale[3] = {1.0f, 1.0f, 1.0f}; float plane_normal[3] = {0.0f, 0.0f, 1.0f}; float plane[4]; diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index a12e9a357a7..aba01a6935f 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -2294,7 +2294,7 @@ static void gpencil_draw_eraser(bContext *UNUSED(C), int x, int y, void *p_ptr) y, p->radius, /* XXX Dashed shader gives bad results with sets of small segments currently, - * temp hack around the issue. :( */ + * temp hack around the issue. :( */ max_ii(8, p->radius / 2)); /* was fixed 40 */ immUnbindProgram(); diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index 858415061b1..1dffa901c32 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -1644,7 +1644,7 @@ void ED_gpencil_brush_draw_eraser(Brush *brush, int x, int y) y, radius, /* XXX Dashed shader gives bad results with sets of small segments currently, - * temp hack around the issue. :( */ + * temp hack around the issue. :( */ max_ii(8, radius / 2)); /* was fixed 40 */ immUnbindProgram(); diff --git a/source/blender/editors/include/ED_gpencil.h b/source/blender/editors/include/ED_gpencil.h index ac998cbcb71..6af8197aa8f 100644 --- a/source/blender/editors/include/ED_gpencil.h +++ b/source/blender/editors/include/ED_gpencil.h @@ -268,7 +268,7 @@ void ED_gpencil_update_color_uv(struct Main *bmain, struct Material *mat); * 1 - Hit in point A * 2 - Hit in point B * 3 - Hit in point A and B -*/ + */ int ED_gpencil_select_stroke_segment(struct bGPDlayer *gpl, struct bGPDstroke *gps, struct bGPDspoint *pt, diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index f0d9c7ec069..e9914ce6f24 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1277,8 +1277,8 @@ static int ui_drag_toggle_but_pushed_state(bContext *C, uiBut *but) } else { /* Assume icon identifies a unique state, for buttons that - * work though functions callbacks and don't have an boolean - * value that indicates the state. */ + * work though functions callbacks and don't have an boolean + * value that indicates the state. */ return but->icon + but->iconadd; } } diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index 9269d1139ae..7117115a0a1 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -704,7 +704,7 @@ void ui_draw_aligned_panel(uiStyle *style, const bool show_drag = (!is_subpanel && /* FIXME(campbell): currently no background means floating panel which can't be dragged. - * This may be changed in future. */ + * This may be changed in future. */ show_background); if (panel->paneltab) { diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index a5589fe2a80..32ec7910b36 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -4118,7 +4118,7 @@ static void widget_tab(uiWidgetColors *wcol, rcti *rect, int state, int roundbox const bool is_active = (state & UI_SELECT); /* Draw shaded outline - Disabled for now, - * seems incorrect and also looks nicer without it imho ;) */ + * seems incorrect and also looks nicer without it imho ;) */ //#define USE_TAB_SHADED_HIGHLIGHT uiWidgetBase wtb; diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 79bbf021829..fcad933e3c4 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -5904,19 +5904,28 @@ void MESH_OT_split(wmOperatorType *ot) * \{ */ enum { - SRT_VIEW_ZAXIS = 1, /* Use view Z (deep) axis. */ - SRT_VIEW_XAXIS, /* Use view X (left to right) axis. */ - SRT_CURSOR_DISTANCE, /* Use distance from element to 3D cursor. */ - SRT_MATERIAL, /* Face only: use mat number. */ - SRT_SELECTED, /* Move selected elements in first, without modifying - * relative order of selected and unselected elements. */ - SRT_RANDOMIZE, /* Randomize selected elements. */ - SRT_REVERSE, /* Reverse current order of selected elements. */ + /** Use view Z (deep) axis. */ + SRT_VIEW_ZAXIS = 1, + /** Use view X (left to right) axis. */ + SRT_VIEW_XAXIS, + /** Use distance from element to 3D cursor. */ + SRT_CURSOR_DISTANCE, + /** Face only: use mat number. */ + SRT_MATERIAL, + /** Move selected elements in first, without modifying + * relative order of selected and unselected elements. */ + SRT_SELECTED, + /** Randomize selected elements. */ + SRT_RANDOMIZE, + /** Reverse current order of selected elements. */ + SRT_REVERSE, }; typedef struct BMElemSort { - float srt; /* Sort factor */ - int org_idx; /* Original index of this element _in its mempool_ */ + /** Sort factor */ + float srt; + /** Original index of this element _in its mempool_ */ + int org_idx; } BMElemSort; static int bmelemsort_comp(const void *v1, const void *v2) diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c index 45eb66c228b..54143822b61 100644 --- a/source/blender/editors/metaball/mball_edit.c +++ b/source/blender/editors/metaball/mball_edit.c @@ -15,8 +15,6 @@ * * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. - * - */ /** \file diff --git a/source/blender/editors/object/object_data_transfer.c b/source/blender/editors/object/object_data_transfer.c index 986055dd88c..afa2c342452 100644 --- a/source/blender/editors/object/object_data_transfer.c +++ b/source/blender/editors/object/object_data_transfer.c @@ -67,8 +67,9 @@ static const EnumPropertyItem DT_layer_items[] = { #if 0 /* XXX For now, would like to finish/merge work from 2014 gsoc first. */ {DT_TYPE_SHAPEKEY, "SHAPEKEYS", 0, "Shapekey(s)", "Transfer active or all shape keys"}, #endif -#if 0 /* XXX When SkinModifier is enabled, - * it seems to erase its own CD_MVERT_SKIN layer from final DM :( */ +/* XXX When SkinModifier is enabled, + * it seems to erase its own CD_MVERT_SKIN layer from final DM :( */ +#if 0 {DT_TYPE_SKIN, "SKIN", 0, "Skin Weight", "Transfer skin weights"}, #endif {DT_TYPE_BWEIGHT_VERT, "BEVEL_WEIGHT_VERT", 0, "Bevel Weight", "Transfer bevel weights"}, diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 9af0b64bde2..7ba57801ebe 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -965,7 +965,7 @@ float ED_vgroup_vert_weight(Object *ob, bDeformGroup *dg, int vertnum) void ED_vgroup_select_by_name(Object *ob, const char *name) { /* note: ob->actdef==0 signals on painting to create a new one, - * if a bone in posemode is selected */ + * if a bone in posemode is selected */ ob->actdef = defgroup_name_index(ob, name) + 1; } diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c index 92eed9be2f5..b05dac83716 100644 --- a/source/blender/editors/physics/particle_object.c +++ b/source/blender/editors/physics/particle_object.c @@ -1060,13 +1060,13 @@ static bool copy_particle_systems_to_object(const bContext *C, return false; /* For remapping we need a valid DM. - * Because the modifiers are appended at the end it's safe to use - * the final DM of the object without particles. - * However, when evaluating the DM all the particle modifiers must be valid, - * i.e. have the psys assigned already. - * To break this hen/egg problem we create all psys separately first (to collect required customdata masks), - * then create the DM, then add them to the object and make the psys modifiers ... - */ + * Because the modifiers are appended at the end it's safe to use + * the final DM of the object without particles. + * However, when evaluating the DM all the particle modifiers must be valid, + * i.e. have the psys assigned already. + * To break this hen/egg problem we create all psys separately first (to collect required customdata masks), + * then create the DM, then add them to the object and make the psys modifiers ... + */ #define PSYS_FROM_FIRST (single_psys_from ? single_psys_from : ob_from->particlesystem.first) #define PSYS_FROM_NEXT(cur) (single_psys_from ? NULL : (cur)->next) totpsys = single_psys_from ? 1 : BLI_listbase_count(&ob_from->particlesystem); diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index bfbca07d530..eda8ad4a787 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -607,8 +607,8 @@ static void action_listener(wmWindow *UNUSED(win), break; case NC_OBJECT: switch (wmn->data) { - case ND_BONE_SELECT: /* selection changed, so force refresh to flush - * (needs flag set to do syncing) */ + case ND_BONE_SELECT: /* Selection changed, so force refresh to flush + * (needs flag set to do syncing). */ case ND_BONE_ACTIVE: saction->runtime.flag |= SACTION_RUNTIME_FLAG_NEED_CHAN_SYNC; ED_area_tag_refresh(sa); diff --git a/source/blender/editors/space_clip/tracking_ops_plane.c b/source/blender/editors/space_clip/tracking_ops_plane.c index 238410da5e1..fc6a9ee1478 100644 --- a/source/blender/editors/space_clip/tracking_ops_plane.c +++ b/source/blender/editors/space_clip/tracking_ops_plane.c @@ -293,19 +293,19 @@ static int slide_plane_marker_modal(bContext *C, wmOperator *op, const wmEvent * data->corner[1] = data->previous_corner[1] + dy; /* - prev_edge - (Corner 3, current) <----------------------- (Corner 2, previous) - | ^ - | | - | | - | | - next_edge | | next_diag_edge - | | - | | - | | - v | - (Corner 0, next) -----------------------> (Corner 1, diagonal) - prev_diag_edge + * prev_edge + * (Corner 3, current) <----------------------- (Corner 2, previous) + * | ^ + * | | + * | | + * | | + * next_edge | | next_diag_edge + * | | + * | | + * | | + * v | + * (Corner 0, next) -----------------------> (Corner 1, diagonal) + * prev_diag_edge */ next_corner_index = (data->corner_index + 1) % 4; diff --git a/source/blender/editors/space_clip/tracking_ops_track.c b/source/blender/editors/space_clip/tracking_ops_track.c index d985e82fd1a..e7880331331 100644 --- a/source/blender/editors/space_clip/tracking_ops_track.c +++ b/source/blender/editors/space_clip/tracking_ops_track.c @@ -55,7 +55,7 @@ typedef struct TrackMarkersJob { int backwards; /* Backwards tracking flag */ MovieClip *clip; /* Clip which is tracking */ float delay; /* Delay in milliseconds to allow - * tracking at fixed FPS */ + * tracking at fixed FPS */ struct Main *main; struct Scene *scene; diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 21b0eefddbc..3c3656c97c0 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -2639,7 +2639,7 @@ static void filelist_readjob_do(const bool do_lib, /* Only thing we change in direntry here, so we need to free it first. */ MEM_freeN(entry->relpath); entry->relpath = BLI_strdup(dir + 2); /* + 2 to remove '//' - * added by BLI_path_rel to rel_subdir */ + * added by BLI_path_rel to rel_subdir. */ entry->name = BLI_strdup(fileentry_uiname(root, entry->relpath, entry->typeflag, dir)); /* Here we decide whether current filedirentry is to be listed too, or not. */ diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index f14148abe86..a896968dadf 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -39,7 +39,7 @@ /* Need to include windows.h so _WIN32_IE is defined. */ # include <windows.h> /* For SHGetSpecialFolderPath, has to be done before BLI_winstuff - * because 'near' is disabled through BLI_windstuff. */ + * because 'near' is disabled through BLI_windstuff. */ # include <shlobj.h> # include "BLI_winstuff.h" #endif diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index eb9860bcd8f..36c3ec21d2a 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -320,8 +320,8 @@ static bool draw_fcurve_handles_check(SpaceGraph *sipo, FCurve *fcu) #endif /* group that curve belongs to is not editable */ ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) || - /* do not show handles if there is only 1 keyframe, - * otherwise they all clump together in an ugly ball */ + /* Do not show handles if there is only 1 keyframe, + * otherwise they all clump together in an ugly ball. */ (fcu->totvert <= 1)) { return false; } diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index d03431468d8..8751fe5199d 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -599,8 +599,8 @@ static void graph_listener(wmWindow *UNUSED(win), break; case NC_SCENE: switch (wmn->data) { - case ND_OB_ACTIVE: /* selection changed, so force refresh to flush - * (needs flag set to do syncing) */ + case ND_OB_ACTIVE: /* Selection changed, so force refresh to flush + * (needs flag set to do syncing). */ case ND_OB_SELECT: sipo->runtime.flag |= SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC; ED_area_tag_refresh(sa); @@ -613,8 +613,8 @@ static void graph_listener(wmWindow *UNUSED(win), break; case NC_OBJECT: switch (wmn->data) { - case ND_BONE_SELECT: /* selection changed, so force refresh to flush - * (needs flag set to do syncing) */ + case ND_BONE_SELECT: /* Selection changed, so force refresh to flush + * (needs flag set to do syncing). */ case ND_BONE_ACTIVE: sipo->runtime.flag |= SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC; ED_area_tag_refresh(sa); diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 628d487210a..5842d3b9c0d 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -1186,7 +1186,7 @@ static void sequencer_draw_borders(const SpaceSeq *sseq, const View2D *v2d, cons void sequencer_draw_maskedit(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq) { /* NOTE: sequencer mask editing isnt finished, the draw code is working but editing not, - * for now just disable drawing since the strip frame will likely be offset */ + * for now just disable drawing since the strip frame will likely be offset */ // if (sc->mode == SC_MODE_MASKEDIT) if (0 && sseq->mainb == SEQ_DRAW_IMG_IMBUF) { diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 088b611a0e8..443c7ab9368 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -2037,8 +2037,8 @@ static bool ed_object_select_pick(bContext *C, } /* Set special modes for grease pencil - The grease pencil modes are not real modes, but a hack to make the interface - consistent, so need some tricks to keep UI synchronized */ + * The grease pencil modes are not real modes, but a hack to make the interface + * consistent, so need some tricks to keep UI synchronized */ // XXX: This stuff needs reviewing (Aligorith) if (false && (((oldbasact) && oldbasact->object->type == OB_GPENCIL) || (basact->object->type == OB_GPENCIL))) { diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 0738703d1b0..1b81ccec3ba 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1230,7 +1230,7 @@ static bool view3d_localview_init(const Depsgraph *depsgraph, if (local_view_bit == 0) { /* TODO(dfelinto): We can kick one of the other 3D views out of local view - specially if it is not being used. */ + * specially if it is not being used. */ BKE_report(reports, RPT_ERROR, "No more than 16 local views"); ok = false; } diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index a3b579342fe..3e58cecd42b 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -1186,10 +1186,10 @@ int getConstraintSpaceDimension(TransInfo *t) return n; /* - * Someone willing to do it cryptically could do the following instead: - * - * return t->con & (CON_AXIS0|CON_AXIS1|CON_AXIS2); - * - * Based on the assumptions that the axis flags are one after the other and start at 1 - */ + * Someone willing to do it cryptically could do the following instead: + * + * return t->con & (CON_AXIS0|CON_AXIS1|CON_AXIS2); + * + * Based on the assumptions that the axis flags are one after the other and start at 1 + */ } diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 18730d11091..eebb6382ccd 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -570,7 +570,7 @@ static void recalcData_nla(TransInfo *t) switch (snla->autosnap) { case SACTSNAP_FRAME: /* snap to nearest frame */ case SACTSNAP_STEP: /* frame step - this is basically the same, - * since we don't have any remapping going on */ + * since we don't have any remapping going on */ { tdn->h1[0] = floorf(tdn->h1[0] + 0.5f); tdn->h2[0] = floorf(tdn->h2[0] + 0.5f); @@ -579,7 +579,7 @@ static void recalcData_nla(TransInfo *t) case SACTSNAP_SECOND: /* snap to nearest second */ case SACTSNAP_TSTEP: /* second step - this is basically the same, - * since we don't have any remapping going on */ + * since we don't have any remapping going on */ { /* This case behaves differently from the rest, since lengths of strips * may not be multiples of a second. If we just naively resize adjust diff --git a/source/blender/editors/transform/transform_gizmo_3d.c b/source/blender/editors/transform/transform_gizmo_3d.c index 0bc62b8b962..58762a933c9 100644 --- a/source/blender/editors/transform/transform_gizmo_3d.c +++ b/source/blender/editors/transform/transform_gizmo_3d.c @@ -116,7 +116,7 @@ static struct { /* Regular range */ {0.02f, 0.1f}, /* Use a different range because we flip the dot product, - * also the view aligned planes are harder to see so hiding early is preferred. */ + * also the view aligned planes are harder to see so hiding early is preferred. */ {0.175f, 0.25f}, }; diff --git a/source/blender/editors/undo/ed_undo.c b/source/blender/editors/undo/ed_undo.c index 08f1a13e0c2..a574b353c16 100644 --- a/source/blender/editors/undo/ed_undo.c +++ b/source/blender/editors/undo/ed_undo.c @@ -476,10 +476,10 @@ int ED_undo_operator_repeat(bContext *C, wmOperator *op) if ((WM_operator_repeat_check(C, op)) && (WM_operator_poll(C, op->type)) && /* note, undo/redo cant run if there are jobs active, - * check for screen jobs only so jobs like material/texture/world preview - * (which copy their data), wont stop redo, see [#29579]], - * - * note, - WM_operator_check_ui_enabled() jobs test _must_ stay in sync with this */ + * check for screen jobs only so jobs like material/texture/world preview + * (which copy their data), wont stop redo, see [#29579]], + * + * note, - WM_operator_check_ui_enabled() jobs test _must_ stay in sync with this */ (WM_jobs_test(wm, scene, WM_JOB_TYPE_ANY) == 0)) { int retval; diff --git a/source/blender/freestyle/intern/geometry/matrix_util.h b/source/blender/freestyle/intern/geometry/matrix_util.h index 65e2fee84f3..f42e043ca97 100644 --- a/source/blender/freestyle/intern/geometry/matrix_util.h +++ b/source/blender/freestyle/intern/geometry/matrix_util.h @@ -41,19 +41,19 @@ namespace OGF { namespace MatrixUtil { /** - * computes the eigen values and eigen vectors of a semi definite symmetric matrix - * - * \param mat: The matrix stored in column symmetric storage, i.e. - * matrix = { m11, m12, m22, m13, m23, m33, m14, m24, m34, m44 ... } - * size = n(n+1)/2 - * - * \param eigen_vec: (return) = { v1, v2, v3, ..., vn } - * where vk = vk0, vk1, ..., vkn - * size = n^2, must be allocated by caller - * - * \param eigen_val: (return) are in decreasing order - * size = n, must be allocated by caller - */ + * computes the eigen values and eigen vectors of a semi definite symmetric matrix + * + * \param mat: The matrix stored in column symmetric storage, i.e. + * matrix = { m11, m12, m22, m13, m23, m33, m14, m24, m34, m44 ... } + * size = n(n+1)/2 + * + * \param eigen_vec: (return) = { v1, v2, v3, ..., vn } + * where vk = vk0, vk1, ..., vkn + * size = n^2, must be allocated by caller + * + * \param eigen_val: (return) are in decreasing order + * size = n, must be allocated by caller + */ void semi_definite_symmetric_eigen(const double *mat, int n, double *eigen_vec, double *eigen_val); } // namespace MatrixUtil diff --git a/source/blender/freestyle/intern/stroke/StrokeRep.h b/source/blender/freestyle/intern/stroke/StrokeRep.h index 5d58b10184f..a6d5c20624e 100644 --- a/source/blender/freestyle/intern/stroke/StrokeRep.h +++ b/source/blender/freestyle/intern/stroke/StrokeRep.h @@ -266,11 +266,12 @@ class StrokeRep { { _material = mat; } - /* +#if 0 inline void setMTex(int idx, MTex *mtex_ptr) { _mtex[idx] = mtex_ptr; - }*/ + } +#endif #ifdef WITH_CXX_GUARDEDALLOC MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:StrokeRep") diff --git a/source/blender/gpu/GPU_legacy_stubs.h b/source/blender/gpu/GPU_legacy_stubs.h index f26765a28f0..c666ff73bc6 100644 --- a/source/blender/gpu/GPU_legacy_stubs.h +++ b/source/blender/gpu/GPU_legacy_stubs.h @@ -148,8 +148,8 @@ _GL_VOID DO_NOT_USE_glClientActiveTexture(GLenum texture) _GL_VOID_RET #define DO_NOT_USE_GL_SOURCE2_RGB 0 /** - * Functions - */ + * Functions + */ _GL_VOID DO_NOT_USE_glAccum(GLenum op, GLfloat value) _GL_VOID_RET _GL_VOID DO_NOT_USE_glAlphaFunc(GLenum func, GLclampf ref) _GL_VOID_RET _GL_BOOL DO_NOT_USE_glAreTexturesResident(GLsizei n, diff --git a/source/blender/gpu/intern/gpu_immediate.c b/source/blender/gpu/intern/gpu_immediate.c index a1708fffa9c..3c8b76dd36c 100644 --- a/source/blender/gpu/intern/gpu_immediate.c +++ b/source/blender/gpu/intern/gpu_immediate.c @@ -711,9 +711,9 @@ void immVertex2iv(uint attr_id, const int data[2]) # endif #else /* NOTE: It is possible to have uniform fully optimized out from the shader. - * In this case we can't assert failure or allow NULL-pointer dereference. - * TODO(sergey): How can we detect existing-but-optimized-out uniform but still - * catch typos in uniform names passed to immUniform*() functions? */ + * In this case we can't assert failure or allow NULL-pointer dereference. + * TODO(sergey): How can we detect existing-but-optimized-out uniform but still + * catch typos in uniform names passed to immUniform*() functions? */ # define GET_UNIFORM \ const GPUShaderInput *uniform = GPU_shaderinterface_uniform_ensure(imm.shader_interface, \ name); \ diff --git a/source/blender/gpu/intern/gpu_matrix.c b/source/blender/gpu/intern/gpu_matrix.c index 667ee7f6e47..5d65861c1e2 100644 --- a/source/blender/gpu/intern/gpu_matrix.c +++ b/source/blender/gpu/intern/gpu_matrix.c @@ -330,36 +330,35 @@ static void mat4_frustum_set( static void mat4_look_from_origin(float m[4][4], float lookdir[3], float camup[3]) { /* This function is loosely based on Mesa implementation. - * - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * shall be included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - + * + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ float side[3]; normalize_v3(lookdir); diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h index 27eb6a5eee5..8445c0f8f3a 100644 --- a/source/blender/imbuf/IMB_imbuf.h +++ b/source/blender/imbuf/IMB_imbuf.h @@ -272,18 +272,20 @@ void IMB_rectblend_threaded(struct ImBuf *dbuf, */ typedef enum IMB_Timecode_Type { - IMB_TC_NONE = 0, /* don't use timecode files at all */ - - IMB_TC_RECORD_RUN = 1, /* use images in the order as they are recorded - * (currently, this is the only one implemented - * and is a sane default) */ - - IMB_TC_FREE_RUN = 2, /* use global timestamp written by recording - * device (prosumer camcorders e.g. can do that) */ - IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN = 4, /* interpolate a global timestamp using the - * record date and time written by recording - * device (*every* consumer camcorder can do - * that :) )*/ + /** Don't use timecode files at all. */ + IMB_TC_NONE = 0, + /** use images in the order as they are recorded + * (currently, this is the only one implemented + * and is a sane default) */ + IMB_TC_RECORD_RUN = 1, + /** Use global timestamp written by recording + * device (prosumer camcorders e.g. can do that). */ + IMB_TC_FREE_RUN = 2, + /** Interpolate a global timestamp using the + * record date and time written by recording + * device (*every* consumer camcorder can do + * that :) )*/ + IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN = 4, IMB_TC_RECORD_RUN_NO_GAPS = 8, IMB_TC_MAX_SLOT = 4, } IMB_Timecode_Type; diff --git a/source/blender/imbuf/intern/dds/BlockDXT.cpp b/source/blender/imbuf/intern/dds/BlockDXT.cpp index 9211f6a7ba6..f960faee1ab 100644 --- a/source/blender/imbuf/intern/dds/BlockDXT.cpp +++ b/source/blender/imbuf/intern/dds/BlockDXT.cpp @@ -53,9 +53,9 @@ #include <ColorBlock.h> #include <BlockDXT.h> -/*---------------------------------------------------------------------------- - BlockDXT1 -----------------------------------------------------------------------------*/ +/* --------------------------------------------------------------------------- + * BlockDXT1 + * --------------------------------------------------------------------------*/ uint BlockDXT1::evaluatePalette(Color32 color_array[4]) const { @@ -262,9 +262,9 @@ inline void BlockDXT1::flip2() swap(row[0], row[1]); } -/*---------------------------------------------------------------------------- - BlockDXT3 -----------------------------------------------------------------------------*/ +/* --------------------------------------------------------------------------- + * BlockDXT3 + * ---------------------------------------------------------------------------*/ void BlockDXT3::decodeBlock(ColorBlock *block) const { @@ -328,9 +328,9 @@ void BlockDXT3::flip2() color.flip2(); } -/*---------------------------------------------------------------------------- - BlockDXT5 -----------------------------------------------------------------------------*/ +/* --------------------------------------------------------------------------- + * BlockDXT5 + * ---------------------------------------------------------------------------*/ void AlphaBlockDXT5::evaluatePalette(uint8 alpha[8]) const { diff --git a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp index 3db9b65c461..89fe3bf5f25 100644 --- a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp +++ b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp @@ -721,9 +721,11 @@ void DDSHeader::setPixelFormat(uint bitcount, uint rmask, uint gmask, uint bmask // D3DX functions do not like this: this->pf.fourcc = 0; //findD3D9Format(bitcount, rmask, gmask, bmask, amask); - /*if (this->pf.fourcc) { +#if 0 + if (this->pf.fourcc) { this->pf.flags |= DDPF_FOURCC; - }*/ + } +#endif if (!(bitcount > 0 && bitcount <= 32)) { printf("DDS: bad bit count, pixel format not set\n"); diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c index 106c04f39f6..ccab0164df7 100644 --- a/source/blender/imbuf/intern/indexer.c +++ b/source/blender/imbuf/intern/indexer.c @@ -305,8 +305,8 @@ void IMB_indexer_close(struct anim_index *idx) int IMB_proxy_size_to_array_index(IMB_Proxy_Size pr_size) { switch (pr_size) { - case IMB_PROXY_NONE: /* if we got here, something is broken anyways, - * so sane defaults... */ + case IMB_PROXY_NONE: + /* if we got here, something is broken anyways, so sane defaults... */ return 0; case IMB_PROXY_25: return 0; @@ -981,8 +981,8 @@ static AviMovie *alloc_proxy_output_avi( AviFormat format; double framerate; AviMovie *avi; - short frs_sec = 25; /* it doesn't really matter for proxies, - * but sane defaults help anyways...*/ + /* it doesn't really matter for proxies, but sane defaults help anyways...*/ + short frs_sec = 25; float frs_sec_base = 1.0; IMB_anim_get_fps(anim, &frs_sec, &frs_sec_base, false); diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index d0f550feb0d..4e801c8e3aa 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -1094,7 +1094,7 @@ void IMB_exrtile_write_channels( for (echan = (ExrChannel *)data->channels.first; echan; echan = echan->next) { /* eventually we can make the parts' channels to include - only the current view TODO */ + * only the current view TODO */ if (strcmp(viewname, echan->m->view.c_str()) != 0) continue; diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c index fc5bfe42d60..6341192c40c 100644 --- a/source/blender/imbuf/intern/thumbs.c +++ b/source/blender/imbuf/intern/thumbs.c @@ -60,7 +60,7 @@ # define _WIN32_IE 0x0400 # endif /* For SHGetSpecialFolderPath, has to be done before BLI_winstuff - * because 'near' is disabled through BLI_windstuff */ + * because 'near' is disabled through BLI_windstuff */ # include <shlobj.h> # include <direct.h> /* chdir */ # include "BLI_winstuff.h" diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h index a261ebacc14..abc9b8f7920 100644 --- a/source/blender/makesdna/DNA_brush_types.h +++ b/source/blender/makesdna/DNA_brush_types.h @@ -462,7 +462,7 @@ typedef enum eBrushSculptTool { SCULPT_TOOL_LAYER, \ \ /* These brushes could handle dynamic topology, \ - * but user feedback indicates it's better not to */ \ + * but user feedback indicates it's better not to */ \ SCULPT_TOOL_SMOOTH, \ SCULPT_TOOL_MASK) == 0) diff --git a/source/blender/makesdna/DNA_dynamicpaint_types.h b/source/blender/makesdna/DNA_dynamicpaint_types.h index 73e91996884..5d482024d07 100644 --- a/source/blender/makesdna/DNA_dynamicpaint_types.h +++ b/source/blender/makesdna/DNA_dynamicpaint_types.h @@ -164,7 +164,7 @@ typedef struct DynamicPaintSurface { /* canvas flags */ enum { /* This should not be needed, having a valid WEIGHT_MCOL layer should be enough. - * And if not, should be a general flag. But seems unnecessary for now... */ + * And if not, should be a general flag. But seems unnecessary for now... */ #if 0 /** if viewport preview is ready */ MOD_DPAINT_PREVIEW_READY = 1 << 0, diff --git a/source/blender/makesdna/DNA_light_types.h b/source/blender/makesdna/DNA_light_types.h index d3c98f30352..6bd118b7be9 100644 --- a/source/blender/makesdna/DNA_light_types.h +++ b/source/blender/makesdna/DNA_light_types.h @@ -96,8 +96,8 @@ typedef struct Light { /* flag */ #define LA_DS_EXPAND (1 << 0) /* NOTE: this must have the same value as MA_DS_SHOW_TEXS, - * otherwise anim-editors will not read correctly - */ + * otherwise anim-editors will not read correctly + */ #define LA_DS_SHOW_TEXS (1 << 2) /* type */ diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index eacb19822f9..882653ab73e 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -212,9 +212,9 @@ typedef struct Material { /* for dopesheet */ #define MA_DS_EXPAND (1 << 1) /* for dopesheet (texture stack expander) - * NOTE: this must have the same value as other texture stacks, - * otherwise anim-editors will not read correctly - */ + * NOTE: this must have the same value as other texture stacks, + * otherwise anim-editors will not read correctly + */ #define MA_DS_SHOW_TEXS (1 << 2) /* ramps */ diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index 905cd4764ad..6befb9da522 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -315,22 +315,22 @@ typedef struct bNode { /* node is active texture */ /* note: take care with this flag since its possible it gets - * `stuck` inside/outside the active group - which makes buttons - * window texture not update, we try to avoid it by clearing the - * flag when toggling group editing - Campbell */ + * `stuck` inside/outside the active group - which makes buttons + * window texture not update, we try to avoid it by clearing the + * flag when toggling group editing - Campbell */ #define NODE_ACTIVE_TEXTURE (1 << 14) /* use a custom color for the node */ #define NODE_CUSTOM_COLOR (1 << 15) /* Node has been initialized - * This flag indicates the node->typeinfo->init function has been called. - * In case of undefined type at creation time this can be delayed until - * until the node type is registered. - */ + * This flag indicates the node->typeinfo->init function has been called. + * In case of undefined type at creation time this can be delayed until + * until the node type is registered. + */ #define NODE_INIT (1 << 16) /* do recalc of output, used to skip recalculation of unwanted - * composite out nodes when editing tree - */ + * composite out nodes when editing tree + */ #define NODE_DO_OUTPUT_RECALC (1 << 17) /* node->update */ diff --git a/source/blender/makesdna/DNA_world_types.h b/source/blender/makesdna/DNA_world_types.h index a1771693005..5143f667083 100644 --- a/source/blender/makesdna/DNA_world_types.h +++ b/source/blender/makesdna/DNA_world_types.h @@ -114,8 +114,8 @@ enum { /* flag */ #define WO_DS_EXPAND (1 << 0) /* NOTE: this must have the same value as MA_DS_SHOW_TEXS, - * otherwise anim-editors will not read correctly - */ + * otherwise anim-editors will not read correctly + */ #define WO_DS_SHOW_TEXS (1 << 2) #endif diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c index fa7ead3cd96..5564912335e 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -61,9 +61,8 @@ /* Included the path relative from /source/blender/ here, so we can move */ /* headers around with more freedom. */ static const char *includefiles[] = { - /* if you add files here, please add them at the end - * of makesdna.c (this file) as well */ + * of makesdna.c (this file) as well */ "DNA_listBase.h", "DNA_vec_types.h", "DNA_ID.h", diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 743ad6bfa68..89dd6a308ce 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -173,10 +173,18 @@ const EnumPropertyItem rna_enum_constraint_type_items[] = { ICON_CONSTRAINT, "Pivot", "Change pivot point for transforms (buggy)"}, - /* {CONSTRAINT_TYPE_RIGIDBODYJOINT, "RIGID_BODY_JOINT", ICON_CONSTRAINT_DATA, "Rigid Body Joint", - "Use to define a Rigid Body Constraint (for Game Engine use only)"}, */ - /* {CONSTRAINT_TYPE_PYTHON, "SCRIPT", ICON_CONSTRAINT_DATA, "Script", - "Custom constraint(s) written in Python (Not yet implemented)"}, */ +#if 0 + {CONSTRAINT_TYPE_RIGIDBODYJOINT, + "RIGID_BODY_JOINT", + ICON_CONSTRAINT_DATA, + "Rigid Body Joint", + "Use to define a Rigid Body Constraint (for Game Engine use only)"}, + {CONSTRAINT_TYPE_PYTHON, + "SCRIPT", + ICON_CONSTRAINT_DATA, + "Script", + "Custom constraint(s) written in Python (Not yet implemented)"}, +#endif {CONSTRAINT_TYPE_SHRINKWRAP, "SHRINKWRAP", ICON_CONSTRAINT, diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index bf53d41c484..e73f5841da9 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -1312,7 +1312,6 @@ static void rna_def_charinfo(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_CHINFO_WRAP); RNA_def_property_ui_text(prop, "Wrap", ""); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - * / # endif prop = RNA_def_property(srna, "use_small_caps", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index e9ea8e6c838..c41e1623961 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -881,9 +881,8 @@ void RNA_api_ui_layout(StructRNA *srna) parm = RNA_def_boolean( func, "value", false, "", "Value of the property to call the operator with"); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); - * / - func = RNA_def_function(srna, "operator_int", "uiItemIntO"); + func = RNA_def_function(srna, "operator_int", "uiItemIntO"); api_ui_item_op_common(func); parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in operator"); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); @@ -897,9 +896,8 @@ void RNA_api_ui_layout(StructRNA *srna) INT_MIN, INT_MAX); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); - * / - func = RNA_def_function(srna, "operator_float", "uiItemFloatO"); + func = RNA_def_function(srna, "operator_float", "uiItemFloatO"); api_ui_item_op_common(func); parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in operator"); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); @@ -913,9 +911,8 @@ void RNA_api_ui_layout(StructRNA *srna) -FLT_MAX, FLT_MAX); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); - * / - func = RNA_def_function(srna, "operator_string", "uiItemStringO"); + func = RNA_def_function(srna, "operator_string", "uiItemStringO"); api_ui_item_op_common(func); parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in operator"); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c index 54db5bede8d..8fadfbaff07 100644 --- a/source/blender/modifiers/intern/MOD_screw.c +++ b/source/blender/modifiers/intern/MOD_screw.c @@ -717,26 +717,34 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes /*printf("\t\t\tFlipping 0\n");*/ SWAP(unsigned int, lt_iter.e->v1, lt_iter.e->v2); } - /* else { - printf("\t\t\tFlipping Not 0\n"); - }*/ +#if 0 + else { + printf("\t\t\tFlipping Not 0\n"); + } +#endif } else if (lt_iter.v == lt_iter.e->v2) { if (ed_loop_flip == 1) { /*printf("\t\t\tFlipping 1\n");*/ SWAP(unsigned int, lt_iter.e->v1, lt_iter.e->v2); } - /* else { - printf("\t\t\tFlipping Not 1\n"); - }*/ +#if 0 + else { + printf("\t\t\tFlipping Not 1\n"); + } +#endif } - /* else { - printf("\t\tIncorrect edge topology"); - }*/ +#if 0 + else { + printf("\t\tIncorrect edge topology"); + } +#endif + } +#if 0 + else { + printf("\t\tNo Edge at this point\n"); } - /* else { - printf("\t\tNo Edge at this point\n"); - }*/ +#endif screwvert_iter_step(<_iter); } } diff --git a/source/blender/modifiers/intern/MOD_skin.c b/source/blender/modifiers/intern/MOD_skin.c index 78f628199d3..e114483759e 100644 --- a/source/blender/modifiers/intern/MOD_skin.c +++ b/source/blender/modifiers/intern/MOD_skin.c @@ -1178,7 +1178,7 @@ static BMFace *skin_hole_target_face(BMesh *bm, Frame *frame) f = center_target_face; /* This case is unlikely now, but could still happen. Should look - * into splitting edges to make new faces. */ + * into splitting edges to make new faces. */ #if PRINT_HOLE_INFO if (!f) { printf("no good face found\n"); diff --git a/source/blender/modifiers/intern/MOD_weighted_normal.c b/source/blender/modifiers/intern/MOD_weighted_normal.c index 2162f223b7a..210f67ef07a 100644 --- a/source/blender/modifiers/intern/MOD_weighted_normal.c +++ b/source/blender/modifiers/intern/MOD_weighted_normal.c @@ -566,11 +566,11 @@ MVert *mvert = result->mvert; MLoop *mloop = result->mloop; /* Right now: - * If weight = 50 then all faces are given equal weight. - * If weight > 50 then more weight given to faces with larger vals (face area / corner angle). - * If weight < 50 then more weight given to faces with lesser vals. However current calculation - * does not converge to min/max. - */ + * If weight = 50 then all faces are given equal weight. + * If weight > 50 then more weight given to faces with larger vals (face area / corner angle). + * If weight < 50 then more weight given to faces with lesser vals. However current calculation + * does not converge to min/max. + */ float weight = ((float)wnmd->weight) / 50.0f; if (wnmd->weight == 100) { weight = (float)SHRT_MAX; diff --git a/source/blender/nodes/composite/nodes/node_composite_bokehimage.c b/source/blender/nodes/composite/nodes/node_composite_bokehimage.c index b35d3d73faa..5fa6cf709e6 100644 --- a/source/blender/nodes/composite/nodes/node_composite_bokehimage.c +++ b/source/blender/nodes/composite/nodes/node_composite_bokehimage.c @@ -15,7 +15,6 @@ * * The Original Code is Copyright (C) 2006 Blender Foundation. * All rights reserved. - */ /** \file diff --git a/source/blender/physics/intern/ConstrainedConjugateGradient.h b/source/blender/physics/intern/ConstrainedConjugateGradient.h index c7808c34ecf..8d375d00056 100644 --- a/source/blender/physics/intern/ConstrainedConjugateGradient.h +++ b/source/blender/physics/intern/ConstrainedConjugateGradient.h @@ -27,14 +27,14 @@ namespace Eigen { namespace internal { /** \internal Low-level conjugate gradient algorithm - * \param mat: The matrix A - * \param rhs: The right hand side vector b - * \param x: On input and initial solution, on output the computed solution. - * \param precond: A preconditioner being able to efficiently solve for an - * approximation of Ax=b (regardless of b) - * \param iters: On input the max number of iteration, on output the number of performed iterations. - * \param tol_error: On input the tolerance error, on output an estimation of the relative error. - */ + * \param mat: The matrix A + * \param rhs: The right hand side vector b + * \param x: On input and initial solution, on output the computed solution. + * \param precond: A preconditioner being able to efficiently solve for an + * approximation of Ax=b (regardless of b) + * \param iters: On input the max number of iteration, on output the number of performed iterations. + * \param tol_error: On input the tolerance error, on output an estimation of the relative error. + */ template<typename MatrixType, typename Rhs, typename Dest, @@ -155,53 +155,53 @@ struct traits< } // namespace internal /** \ingroup IterativeLinearSolvers_Module - * \brief A conjugate gradient solver for sparse self-adjoint problems with additional constraints - * - * This class allows to solve for A.x = b sparse linear problems using a conjugate gradient algorithm. - * The sparse matrix A must be selfadjoint. The vectors x and b can be either dense or sparse. - * - * \tparam _MatrixType the type of the sparse matrix A, can be a dense or a sparse matrix. - * \tparam _UpLo the triangular part that will be used for the computations. It can be Lower - * or Upper. Default is Lower. - * \tparam _Preconditioner the type of the preconditioner. Default is DiagonalPreconditioner - * - * The maximal number of iterations and tolerance value can be controlled via the setMaxIterations() - * and setTolerance() methods. The defaults are the size of the problem for the maximal number of iterations - * and NumTraits<Scalar>::epsilon() for the tolerance. - * - * This class can be used as the direct solver classes. Here is a typical usage example: - * \code - * int n = 10000; - * VectorXd x(n), b(n); - * SparseMatrix<double> A(n,n); - * // fill A and b - * ConjugateGradient<SparseMatrix<double> > cg; - * cg.compute(A); - * x = cg.solve(b); - * std::cout << "#iterations: " << cg.iterations() << std::endl; - * std::cout << "estimated error: " << cg.error() << std::endl; - * // update b, and solve again - * x = cg.solve(b); - * \endcode - * - * By default the iterations start with x=0 as an initial guess of the solution. - * One can control the start using the solveWithGuess() method. Here is a step by - * step execution example starting with a random guess and printing the evolution - * of the estimated error: - * * \code - * x = VectorXd::Random(n); - * cg.setMaxIterations(1); - * int i = 0; - * do { - * x = cg.solveWithGuess(b,x); - * std::cout << i << " : " << cg.error() << std::endl; - * ++i; - * } while (cg.info()!=Success && i<100); - * \endcode - * Note that such a step by step execution is slightly slower. - * - * \sa class SimplicialCholesky, DiagonalPreconditioner, IdentityPreconditioner - */ + * \brief A conjugate gradient solver for sparse self-adjoint problems with additional constraints + * + * This class allows to solve for A.x = b sparse linear problems using a conjugate gradient algorithm. + * The sparse matrix A must be selfadjoint. The vectors x and b can be either dense or sparse. + * + * \tparam _MatrixType the type of the sparse matrix A, can be a dense or a sparse matrix. + * \tparam _UpLo the triangular part that will be used for the computations. It can be Lower + * or Upper. Default is Lower. + * \tparam _Preconditioner the type of the preconditioner. Default is DiagonalPreconditioner + * + * The maximal number of iterations and tolerance value can be controlled via the setMaxIterations() + * and setTolerance() methods. The defaults are the size of the problem for the maximal number of iterations + * and NumTraits<Scalar>::epsilon() for the tolerance. + * + * This class can be used as the direct solver classes. Here is a typical usage example: + * \code + * int n = 10000; + * VectorXd x(n), b(n); + * SparseMatrix<double> A(n,n); + * // fill A and b + * ConjugateGradient<SparseMatrix<double> > cg; + * cg.compute(A); + * x = cg.solve(b); + * std::cout << "#iterations: " << cg.iterations() << std::endl; + * std::cout << "estimated error: " << cg.error() << std::endl; + * // update b, and solve again + * x = cg.solve(b); + * \endcode + * + * By default the iterations start with x=0 as an initial guess of the solution. + * One can control the start using the solveWithGuess() method. Here is a step by + * step execution example starting with a random guess and printing the evolution + * of the estimated error: + * * \code + * x = VectorXd::Random(n); + * cg.setMaxIterations(1); + * int i = 0; + * do { + * x = cg.solveWithGuess(b,x); + * std::cout << i << " : " << cg.error() << std::endl; + * ++i; + * } while (cg.info()!=Success && i<100); + * \endcode + * Note that such a step by step execution is slightly slower. + * + * \sa class SimplicialCholesky, DiagonalPreconditioner, IdentityPreconditioner + */ template<typename _MatrixType, int _UpLo, typename _FilterMatrixType, typename _Preconditioner> class ConstrainedConjugateGradient : public IterativeSolverBase< @@ -230,15 +230,15 @@ class ConstrainedConjugateGradient } /** Initialize the solver with matrix \a A for further \c Ax=b solving. - * - * This constructor is a shortcut for the default constructor followed - * by a call to compute(). - * - * \warning this class stores a reference to the matrix A as well as some - * precomputed values that depend on it. Therefore, if \a A is changed - * this class becomes invalid. Call compute() to update it with the new - * matrix A, or modify a copy of A. - */ + * + * This constructor is a shortcut for the default constructor followed + * by a call to compute(). + * + * \warning this class stores a reference to the matrix A as well as some + * precomputed values that depend on it. Therefore, if \a A is changed + * this class becomes invalid. Call compute() to update it with the new + * matrix A, or modify a copy of A. + */ ConstrainedConjugateGradient(const MatrixType &A) : Base(A) { } @@ -257,10 +257,10 @@ class ConstrainedConjugateGradient } /** \returns the solution x of \f$ A x = b \f$ using the current decomposition of A - * \a x0 as an initial solution. - * - * \sa compute() - */ + * \a x0 as an initial solution. + * + * \sa compute() + */ template<typename Rhs, typename Guess> inline const internal::solve_retval_with_guess<ConstrainedConjugateGradient, Rhs, Guess> solveWithGuess(const MatrixBase<Rhs> &b, const Guess &x0) const diff --git a/source/blender/physics/intern/implicit_blender.c b/source/blender/physics/intern/implicit_blender.c index b81dcd70d88..654825e814b 100644 --- a/source/blender/physics/intern/implicit_blender.c +++ b/source/blender/physics/intern/implicit_blender.c @@ -1683,8 +1683,8 @@ bool BPH_mass_spring_force_spring_linear(Implicit_Data *data, spring_length(data, i, j, extent, dir, &length, vel); /* This code computes not only the force, but also its derivative. - Zero derivative effectively disables the spring for the implicit solver. - Thus length > restlen makes cloth unconstrained at the start of simulation. */ + * Zero derivative effectively disables the spring for the implicit solver. + * Thus length > restlen makes cloth unconstrained at the start of simulation. */ if ((length >= restlen && length > 0) || resist_compress) { float stretch_force; diff --git a/source/blender/python/bmesh/bmesh_py_types_meshdata.c b/source/blender/python/bmesh/bmesh_py_types_meshdata.c index 34a4ec3b1ed..0aa01ddb594 100644 --- a/source/blender/python/bmesh/bmesh_py_types_meshdata.c +++ b/source/blender/python/bmesh/bmesh_py_types_meshdata.c @@ -516,7 +516,7 @@ static PySequenceMethods bpy_bmdeformvert_as_sequence = { NULL, /* sq_repeat */ /* note: if this is set PySequence_Check() returns True, - * but in this case we dont want to be treated as a seq */ + * but in this case we dont want to be treated as a seq */ NULL, /* sq_item */ NULL, /* sq_slice */ diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 1f041b4ca48..ed8bbe939af 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -7072,7 +7072,7 @@ static PyObject *pyrna_srna_Subtype(StructRNA *srna) pyrna_subtype_set_rna(newclass, srna); Py_INCREF(newclass); } /* create a new class instance with the C api - * mainly for the purposing of matching the C/rna type hierarchy */ + * mainly for the purposing of matching the C/rna type hierarchy */ else { /* subclass equivalents * - class myClass(myBase): diff --git a/source/blender/python/mathutils/mathutils.h b/source/blender/python/mathutils/mathutils.h index 4ec2c869499..a69d00d10e7 100644 --- a/source/blender/python/mathutils/mathutils.h +++ b/source/blender/python/mathutils/mathutils.h @@ -52,16 +52,17 @@ enum { #define BASE_MATH_FLAG_DEFAULT 0 #define BASE_MATH_MEMBERS(_data) \ - PyObject_VAR_HEAD float \ - *_data; /* array of data (alias), wrapped status depends on wrapped status */ \ - PyObject * \ - cb_user; /* if this vector references another object, otherwise NULL, \ - * *Note* this owns its reference */ \ - unsigned char cb_type; /* which user funcs do we adhere to, RNA, etc */ \ - unsigned char \ - cb_subtype; /* subtype: location, rotation... \ - * to avoid defining many new functions for every attribute of the same type */ \ - unsigned char flag /* wrapped data type? */ + /** Array of data (alias), wrapped status depends on wrapped status. */ \ + PyObject_VAR_HEAD float *_data; \ + /** If this vector references another object, otherwise NULL, *Note* this owns its reference */ \ + PyObject *cb_user; \ + /** Which user funcs do we adhere to, RNA, etc */ \ + unsigned char cb_type; \ + /** Subtype: location, rotation... \ + * to avoid defining many new functions for every attribute of the same type */ \ + unsigned char cb_subtype; \ + /** Wrapped data type. */ \ + unsigned char flag typedef struct { BASE_MATH_MEMBERS(data); diff --git a/source/blender/render/extern/include/RE_pipeline.h b/source/blender/render/extern/include/RE_pipeline.h index 0e7399d4a0d..145508b514e 100644 --- a/source/blender/render/extern/include/RE_pipeline.h +++ b/source/blender/render/extern/include/RE_pipeline.h @@ -95,20 +95,23 @@ typedef struct RenderPass { typedef struct RenderLayer { struct RenderLayer *next, *prev; - /* copy of RenderData */ + /** copy of RenderData */ char name[RE_MAXNAME]; int layflag, passflag, pass_xor; /* MULTIVIEW_TODO: acolrect and scolrect are not supported by multiview at the moment. * If they are really required they should be in RenderView instead */ - float *acolrect; /* 4 float, optional transparent buffer, needs storage for display updates */ - float *scolrect; /* 4 float, optional strand buffer, needs storage for display updates */ - int *display_buffer; /* 4 char, optional color managed display buffer which is used when - * Save Buffer is enabled to display combined pass of the screen. */ + /** 4 float, optional transparent buffer, needs storage for display updates */ + float *acolrect; + /** 4 float, optional strand buffer, needs storage for display updates */ + float *scolrect; + /** 4 char, optional color managed display buffer which is used when + * Save Buffer is enabled to display combined pass of the screen. */ + int *display_buffer; int rectx, recty; - /* optional saved endresult on disk */ + /** Optional saved endresult on disk. */ void *exrhandle; ListBase passes; diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index 69e2ea991dd..63fd3f1d0bd 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -82,9 +82,10 @@ struct Render { * to not conflict with writes, so no lock used for that */ ThreadRWMutex resultmutex; - /* window size, display rect, viewplane */ - int winx, winy; /* buffer width and height with percentage applied - * without border & crop. convert to long before multiplying together to avoid overflow. */ + /** Window size, display rect, viewplane. + * \note Buffer width and height with percentage applied + * without border & crop. convert to long before multiplying together to avoid overflow. */ + int winx, winy; rcti disprect; /* part within winx winy */ rctf viewplane; /* mapped on winx winy */ diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c index a9b06edf558..df114ed9c1d 100644 --- a/source/blender/render/intern/source/imagetexture.c +++ b/source/blender/render/intern/source/imagetexture.c @@ -877,9 +877,12 @@ static void feline_eval(TexResult *texr, ImBuf *ibuf, float fx, float fy, afdata float tc[4]; const float hn = n * 0.5f; const float u = fx + hn * du, v = fy + hn * dv; - /*const float wt = expf(n*n*D); - * can use ewa table here too */ + /* Can use ewa table here too. */ +#if 0 + const float wt = expf(n * n * D); +#else const float wt = EWA_WTS[(int)(n * n * D)]; +#endif /*const int out =*/ibuf_get_color_clip_bilerp( tc, ibuf, ibuf->x * u, ibuf->y * v, AFD->intpol, AFD->extflag); /* TXF alpha: clip |= out; diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 7eee8da1ecf..425853c7a96 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -457,8 +457,8 @@ typedef struct wmEvent { int x, y; /* mouse pointer position, screen coord */ int mval[2]; /* region mouse position, name convention pre 2.5 :) */ char utf8_buf[6]; /* from, ghost if utf8 is enabled for the platform, - * BLI_str_utf8_size() must _always_ be valid, check - * when assigning s we don't need to check on every access after */ + * BLI_str_utf8_size() must _always_ be valid, check + * when assigning s we don't need to check on every access after */ char ascii; /* from ghost, fallback if utf8 isn't set */ char pad; diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 2ac488f0fe5..e55afeb6f4c 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -40,7 +40,7 @@ # define _WIN32_IE 0x0400 # endif /* For SHGetSpecialFolderPath, has to be done before BLI_winstuff - * because 'near' is disabled through BLI_windstuff */ + * because 'near' is disabled through BLI_windstuff */ # include <shlobj.h> # include "BLI_winstuff.h" #endif |