Cleanup: spelling in comments

This commit is contained in:
Campbell Barton 2023-01-20 15:19:32 +11:00
parent 06c836c911
commit 844cca9984
22 changed files with 43 additions and 44 deletions

View File

@ -836,8 +836,8 @@ void LightManager::device_update_background(Device *device,
if (sun_average_radiance > 0.0f) {
/* The weighting here is just a heuristic that was empirically determined.
* The sun's average radiance is much higher than the map's average radiance,
* but we don't want to weight the background light too much becaused
* visibility is not accounted for anyways. */
* but we don't want to weight the background light too much because
* visibility is not accounted for anyway. */
background_light->set_average_radiance(0.8f * map_average_radiance +
0.2f * sun_average_radiance);
}

View File

@ -298,7 +298,7 @@ void BKE_nlastrip_recalculate_bounds(struct NlaStrip *strip);
void BKE_nlastrip_recalculate_bounds_sync_action(struct NlaStrip *strip);
/**
* Recalculate the Blendin and Blendout values after a strip transform update.
* Recalculate the blend-in and blend-out values after a strip transform update.
*/
void BKE_nlastrip_recalculate_blend(struct NlaStrip *strip);

View File

@ -360,7 +360,7 @@ typedef struct bNodeType {
ExtensionRNA rna_ext;
} bNodeType;
/* nodetype->nclass, for add-menu and themes */
/** #bNodeType.nclass (for add-menu and themes). */
#define NODE_CLASS_INPUT 0
#define NODE_CLASS_OUTPUT 1
#define NODE_CLASS_OP_COLOR 3

View File

@ -1220,11 +1220,12 @@ static void editbmesh_calc_modifier_final_normals(Mesh *mesh_final,
}
}
else {
/* Same as mesh_calc_modifiers. If using loop normals, poly nors have already been computed. */
/* Same as #mesh_calc_modifiers.
* If using loop normals, poly normals have already been computed. */
BKE_mesh_ensure_normals_for_display(mesh_final);
/* Some modifiers, like data-transfer, may generate those data, we do not want to keep them,
* as they are used by display code when available (i.e. even if autosmooth is disabled). */
* as they are used by display code when available (i.e. even if auto-smooth is disabled). */
if (CustomData_has_layer(&mesh_final->ldata, CD_NORMAL)) {
CustomData_free_layers(&mesh_final->ldata, CD_NORMAL, mesh_final->totloop);
}

View File

@ -922,7 +922,7 @@ static void surface_freeUnusedData(DynamicPaintSurface *surface)
return;
}
/* free bakedata if not active or surface is baked */
/* Free bake-data if not active or surface is baked. */
if (!(surface->flags & MOD_DPAINT_ACTIVE) ||
(surface->pointcache && surface->pointcache->flag & PTCACHE_BAKED)) {
free_bakeData(surface->data);
@ -1071,7 +1071,7 @@ DynamicPaintSurface *dynamicPaint_createNewSurface(DynamicPaintCanvasSettings *c
BKE_modifier_path_init(
surface->image_output_path, sizeof(surface->image_output_path), "cache_dynamicpaint");
/* Using ID_BRUSH i18n context, as we have no physics/dpaint one for now... */
/* Using ID_BRUSH i18n context, as we have no physics/dynamic-paint one for now. */
dynamicPaintSurface_setUniqueName(surface, CTX_DATA_(BLT_I18NCONTEXT_ID_BRUSH, "Surface"));
surface->effector_weights = BKE_effector_add_weights(NULL);
@ -5067,7 +5067,7 @@ static void dynamic_paint_prepare_effect_cb(void *__restrict userdata,
/* if global gravity is enabled, add it too */
if (scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) {
/* also divide by 10 to about match default grav
/* also divide by 10 to about match default gravity
* with default force strength (1.0). */
madd_v3_v3fl(forc,
scene->physics_settings.gravity,
@ -5139,9 +5139,9 @@ static int dynamicPaint_prepareEffectStep(struct Depsgraph *depsgraph,
}
/* Get number of required steps using average point distance
* so that just a few ultra close pixels won't increase substeps to max. */
* so that just a few ultra close pixels won't increase sub-steps to max. */
/* adjust number of required substep by fastest active effect */
/* Adjust number of required sub-step by fastest active effect. */
if (surface->effect & MOD_DPAINT_EFFECT_DO_SPREAD) {
spread_speed = surface->spread_speed;
}
@ -5811,7 +5811,7 @@ static void dynamic_paint_surface_pre_step_cb(void *__restrict userdata,
pPoint->state = DPAINT_PAINT_WET;
}
/* in case of just dryed paint, just mix it to the dry layer and mark it empty */
/* In case of just dried paint, just mix it to the dry layer and mark it empty. */
else if (pPoint->state > 0) {
float f_color[4];
blendColors(pPoint->color, pPoint->color[3], pPoint->e_color, pPoint->e_color[3], f_color);

View File

@ -3513,7 +3513,8 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra, const bool use_re
}
}
/* lattices have to be calculated separately to avoid mixups between effector calculations */
/* Lattices have to be calculated separately to avoid mix-ups between effector calculations.
*/
if (psys->lattice_deform_data) {
for (k = 0, ca = cache[p]; k <= segments; k++, ca++) {
BKE_lattice_deform_data_eval_co(

View File

@ -2550,11 +2550,12 @@ static void softbody_swap_state(Object *ob, float *ppos, float *pvel)
}
#endif
/* care for bodypoints taken out of the 'ordinary' solver step
/**
* Care for body-points taken out of the 'ordinary' solver step
* because they are screwed to goal by bolts
* they just need to move along with the goal in time
* we need to adjust them on sub frame timing in solver
* so now when frame is done .. put 'em to the position at the end of frame
* so now when frame is done .. put them to the position at the end of frame.
*/
static void softbody_apply_goalsnap(Object *ob)
{

View File

@ -70,7 +70,7 @@ template<typename T> class OffsetIndices {
}
/**
* Return a subset of the offsets desribing the specified range of source elements.
* Return a subset of the offsets describing the specified range of source elements.
* This is a slice into the source ranges rather than the indexed elements described by the
* offset values.
*/

View File

@ -875,8 +875,8 @@ void BM_uv_map_ensure_select_and_pin_attrs(BMesh *bm)
{
const int nr_uv_layers = CustomData_number_of_layers(&bm->ldata, CD_PROP_FLOAT2);
for (int l = 0; l < nr_uv_layers; l++) {
/* NOTE: you can't re-use the returnvalue of CustomData_get_layer_name() because adding layers
* can invalidate that. */
/* NOTE: you can't re-use the return-value of #CustomData_get_layer_name()
* because adding layers can invalidate that. */
char name[MAX_CUSTOMDATA_LAYER_NAME];
BM_data_layer_ensure_named(
bm,

View File

@ -2246,7 +2246,7 @@ void DRW_draw_render_loop_2d_ex(struct Depsgraph *depsgraph,
drw_engines_draw_scene();
/* Fix 3D view being "laggy" on macos and win+nvidia. (See T56996, T61474) */
/* Fix 3D view being "laggy" on MACOS and MS-Windows+NVIDIA. (See T56996, T61474) */
if (GPU_type_matches_ex(GPU_DEVICE_ANY, GPU_OS_ANY, GPU_DRIVER_ANY, GPU_BACKEND_OPENGL)) {
GPU_flush();
}

View File

@ -75,7 +75,8 @@ typedef struct ViewContext {
typedef struct ViewDepths {
unsigned short w, h;
short x, y; /* only for temp use for sub-rects, added to region->winx/y */
/* only for temp use for sub-rectangles, added to `region->winx/winy`. */
short x, y;
float *depths;
double depth_range[2];
} ViewDepths;

View File

@ -394,7 +394,7 @@ typedef enum {
UI_BTYPE_SEPR_LINE = 55 << 9,
/** Dynamically fill available space. */
UI_BTYPE_SEPR_SPACER = 56 << 9,
/** Resize handle (resize uilist). */
/** Resize handle (resize UI-list). */
UI_BTYPE_GRIP = 57 << 9,
UI_BTYPE_DECORATOR = 58 << 9,
/* An item a view (see #ui::AbstractViewItem). */
@ -459,7 +459,7 @@ void UI_draw_safe_areas(uint pos,
const float title_aspect[2],
const float action_aspect[2]);
/** State for scrolldrawing. */
/** State for scroll-drawing. */
enum {
UI_SCROLL_PRESSED = 1 << 0,
UI_SCROLL_ARROWS = 1 << 1,

View File

@ -887,7 +887,7 @@ static void bm_uv_build_islands(UvElementMap *element_map,
MEM_SAFE_FREE(map);
}
/* return true if `loop` has UV co-ordinates which match `luv_a` and `luv_b` */
/** Return true if `loop` has UV co-ordinates which match `luv_a` and `luv_b`. */
static bool loop_uv_match(BMLoop *loop,
const float luv_a[2],
const float luv_b[2],

View File

@ -415,7 +415,7 @@ void PARTICLE_OT_dupliob_refresh(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/************************ move up particle dupliweight operator *********************/
/************************ move up particle dupli-weight operator *********************/
static int dupliob_move_up_exec(bContext *C, wmOperator *UNUSED(op))
{

View File

@ -3876,7 +3876,7 @@ static void filelist_readjob_all_asset_library(FileListReadJob *job_params,
filelist_readjob_main_assets_add_items(job_params, stop, do_update, progress);
/* When only doing partialy reload for main data, we're done. */
/* When only doing partially reload for main data, we're done. */
if (job_params->only_main_data) {
return;
}

View File

@ -864,7 +864,7 @@ static void createTransPose(bContext *UNUSED(C), TransInfo *t)
}
}
/* initialize initial auto=ik chainlen's? */
/* Initialize initial auto=IK chain-length's? */
if (t->flag & T_AUTOIK) {
transform_autoik_update(t, 0);
}

View File

@ -336,14 +336,13 @@ static bool bm_loop_uv_shared_edge_check(const BMLoop *l_a, const BMLoop *l_b, v
}
/**
* returns true if `BMFace *efa` is able to be affected by a packing operation, given various
* parameters.
* Returns true if `efa` is able to be affected by a packing operation, given various parameters.
*
* Checks if it's (not) hidden, and optionally selected, and/or UV selected.
*
* Will eventually be superseded by `BM_uv_element_map_create()`.
*
* Loosely based on`uvedit_is_face_affected`, but "bug-compatible" with previous code.
* Loosely based on `uvedit_is_face_affected`, but "bug-compatible" with previous code.
*/
static bool uvedit_is_face_affected_for_calc_uv_islands(const Scene *scene,
BMFace *efa,
@ -462,8 +461,7 @@ static float pack_islands_margin_fraction(const blender::Vector<FaceIsland *> &i
* First, use a robust search procedure to bracket the root within a factor of 10.
* Then, use a modified-secant method to converge.
*
* This is a specialized solver using domain knowledge to accelerate convergence.
*/
* This is a specialized solver using domain knowledge to accelerate convergence. */
float scale_low = 0.0f;
float value_low = 0.0f;
@ -570,11 +568,8 @@ static float calc_margin_from_aabb_length_sum(const blender::Vector<FaceIsland *
const struct UVPackIsland_Params &params)
{
/* Logic matches behavior from #GEO_uv_parametrizer_pack.
* Attempt to give predictable results
* not dependent on current UV scale by using
* `aabb_length_sum` (was "`area`") to multiply
* the margin by the length (was "area").
*/
* Attempt to give predictable results not dependent on current UV scale by using
* `aabb_length_sum` (was "`area`") to multiply the margin by the length (was "area"). */
double aabb_length_sum = 0.0f;
for (FaceIsland *island : island_vector) {
float w = BLI_rctf_size_x(&island->bounds_rect);

View File

@ -4399,13 +4399,13 @@ static int uv_select_overlap(bContext *C, const bool extend)
copy_v2_v2(uv_verts[vert_index], luv);
}
/* The winding order of the coordinates is not guaranteed, determine it automatically. */
/* The UV coordinates winding could be positive of negative,
* determine it automatically. */
const int coords_sign = 0;
BLI_polyfill_calc_arena(uv_verts, face_len, coords_sign, indices, arena);
/* A beauty fill is necessary to remove degenerate triangles that may be produced from the
* above polyfill (see T103913), otherwise the overlap tests can fail.
*/
* above poly-fill (see T103913), otherwise the overlap tests can fail. */
BLI_polyfill_beautify(uv_verts, face_len, indices, arena, heap);
for (int t = 0; t < tri_len; t++) {

View File

@ -949,7 +949,7 @@ static int stitch_process_data(StitchStateContainer *ssc,
bool is_active_state = (state == ssc->states[ssc->active_object_index]);
char stitch_midpoints = ssc->midpoints;
/* used to map uv indices to uvaverage indices for selection */
/* Used to map UV indices to UV-average indices for selection. */
uint *uvfinal_map = NULL;
/* per face preview position in preview buffer */
PreviewPosition *preview_position = NULL;

View File

@ -595,10 +595,10 @@ static ParamHandle *construct_param_handle_subsurfed(const Scene *scene,
/* Modifier initialization data, will control what type of subdivision will happen. */
SubsurfModifierData smd = {{NULL}};
/* holds a map to editfaces for every subsurfed MFace.
/* Holds a map to edit-faces for every subdivision-surface polygon.
* These will be used to get hidden/ selected flags etc. */
BMFace **faceMap;
/* similar to the above, we need a way to map edges to their original ones */
/* Similar to the above, we need a way to map edges to their original ones. */
BMEdge **edgeMap;
const BMUVOffsets offsets = BM_uv_map_get_offsets(em->bm);

View File

@ -527,7 +527,7 @@ static void sample_interval_bezier(const Span<float3> src_positions,
start_point_insert.position,
parameter);
/* Update startpoint handle. */
/* Update start-point handle. */
dst_handles_l[dst_range.first()] = end_point_insert.handle_next;
}
else {

View File

@ -5591,7 +5591,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, void
}
else if (event.keymodifier == EVT_UNKNOWNKEY) {
/* This case happens with an external number-pad, and also when using 'dead keys'
* (to compose complex latin characters e.g.), it's not really clear why.
* (to compose complex Latin characters e.g.), it's not really clear why.
* Since it's impossible to map a key modifier to an unknown key,
* it shouldn't harm to clear it. */
event_state->keymodifier = event.keymodifier = 0;