From f1e49038543cf75766f4a220f62cdc6cdbc0e27d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 26 Jun 2021 21:35:18 +1000 Subject: Cleanup: full sentences in comments, improve comment formatting --- .../editors/sculpt_paint/paint_image_proj.c | 26 +++++++++++----------- source/blender/editors/sculpt_paint/paint_ops.c | 6 ++--- source/blender/editors/sculpt_paint/paint_vertex.c | 4 ++-- .../blender/editors/sculpt_paint/sculpt_intern.h | 2 +- source/blender/editors/sculpt_paint/sculpt_uv.c | 6 ++--- 5 files changed, 22 insertions(+), 22 deletions(-) (limited to 'source/blender/editors/sculpt_paint') diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index fc08b7cd1b4..88140460f5b 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -391,7 +391,7 @@ typedef struct ProjPaintState { float *cavities; #ifndef PROJ_DEBUG_NOSEAMBLEED - /** store info about faces, if they are initialized etc*/ + /** Store info about faces, if they are initialized etc. */ ushort *faceSeamFlags; /** save the winding of the face in uv space, * helps as an extra validation step for seam detection. */ @@ -1073,7 +1073,7 @@ static bool pixel_bounds_uv(const float uv_quad[4][2], bounds_px->xmax = (int)(ibuf_x * max_uv[0]) + 1; bounds_px->ymax = (int)(ibuf_y * max_uv[1]) + 1; - /*printf("%d %d %d %d\n", min_px[0], min_px[1], max_px[0], max_px[1]);*/ + // printf("%d %d %d %d\n", min_px[0], min_px[1], max_px[0], max_px[1]); /* face uses no UV area when quantized to pixels? */ return (bounds_px->xmin == bounds_px->xmax || bounds_px->ymin == bounds_px->ymax) ? false : true; @@ -1103,7 +1103,7 @@ static bool pixel_bounds_array( bounds_px->xmax = (int)(ibuf_x * max_uv[0]) + 1; bounds_px->ymax = (int)(ibuf_y * max_uv[1]) + 1; - /*printf("%d %d %d %d\n", min_px[0], min_px[1], max_px[0], max_px[1]);*/ + // printf("%d %d %d %d\n", min_px[0], min_px[1], max_px[0], max_px[1]); /* face uses no UV area when quantized to pixels? */ return (bounds_px->xmin == bounds_px->xmax || bounds_px->ymin == bounds_px->ymax) ? false : true; @@ -1774,7 +1774,7 @@ static float project_paint_uvpixel_mask(const ProjPaintState *ps, } if (angle_cos <= ps->normal_angle__cos) { - /* outsize the normal limit*/ + /* Outsize the normal limit. */ return 0.0f; } if (angle_cos < ps->normal_angle_inner__cos) { @@ -1878,7 +1878,7 @@ static ProjPixel *project_paint_uvpixel_init(const ProjPaintState *ps, int x_tile, y_tile; int x_round, y_round; int tile_offset; - /* volatile is important here to ensure pending check is not optimized away by compiler*/ + /* Volatile is important here to ensure pending check is not optimized away by compiler. */ volatile int tile_index; ProjPaintImage *projima = tinf->pjima; @@ -2063,7 +2063,7 @@ static bool line_clip_rect2f(const rctf *cliprect, return false; } - /* this is a single point (or close to)*/ + /* This is a single point (or close to). */ if (fabsf(l1[0] - l2[0]) < PROJ_PIXEL_TOLERANCE) { if (BLI_rctf_isect_pt_v(rect, l1)) { copy_v2_v2(l1_clip, l1); @@ -2090,7 +2090,7 @@ static bool line_clip_rect2f(const rctf *cliprect, return false; } - /* this is a single point (or close to)*/ + /* This is a single point (or close to). */ if (fabsf(l1[1] - l2[1]) < PROJ_PIXEL_TOLERANCE) { if (BLI_rctf_isect_pt_v(rect, l1)) { copy_v2_v2(l1_clip, l1); @@ -2678,7 +2678,7 @@ static void project_bucket_clip_face(const bool is_ortho, /* calc center */ float cent[2] = {0.0f, 0.0f}; - /*float up[2] = {0.0f, 1.0f};*/ + // float up[2] = {0.0f, 1.0f}; bool doubles; (*tot) = 0; @@ -3065,7 +3065,7 @@ static void project_paint_face_init(const ProjPaintState *ps, v2coSS = ps->screenCoords[lt_vtri[1]]; v3coSS = ps->screenCoords[lt_vtri[2]]; - /* This function gives is a concave polyline in UV space from the clipped tri*/ + /* This function gives is a concave polyline in UV space from the clipped tri. */ project_bucket_clip_face(is_ortho, is_flip_object, clip_rect, @@ -4430,7 +4430,7 @@ static void project_paint_prepare_all_faces(ProjPaintState *ps, } } - /* build an array of images we use*/ + /* Build an array of images we use. */ if (ps->is_shared_user == false) { project_paint_build_proj_ima(ps, arena, &used_images); } @@ -4770,7 +4770,7 @@ static bool project_bucket_iter_next(ProjPaintState *ps, BLI_assert(bucket_y >= ps->bucketMin[1] && bucket_y < ps->bucketMax[1]); if (bucket_x >= ps->bucketMin[0] && bucket_x < ps->bucketMax[0]) { - /* use bucket_bounds for project_bucket_isect_circle and project_bucket_init*/ + /* Use bucket_bounds for #project_bucket_isect_circle and #project_bucket_init. */ project_bucket_bounds(ps, bucket_x, bucket_y, bucket_bounds); if ((ps->source != PROJ_SRC_VIEW) || @@ -5356,7 +5356,7 @@ static void do_projectpaint_thread(TaskPool *__restrict UNUSED(pool), void *ph_v dist_sq = len_squared_v2v2(projPixel->projCoSS, pos); - /*if (dist < radius) {*/ /* correct but uses a sqrtf */ + /* Faster alternative to `dist < radius` without a #sqrtf. */ if (dist_sq <= brush_radius_sq) { dist = sqrtf(dist_sq); @@ -5814,7 +5814,7 @@ static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps, int ps->is_maskbrush = (brush->mask_mtex.tex) ? true : false; } else { - /* brush may be NULL*/ + /* Brush may be NULL. */ ps->do_masking = false; ps->is_texbrush = false; ps->is_maskbrush = false; diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index fed89e02e8f..e2b21145c2d 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -62,7 +62,7 @@ /* Brush operators */ static int brush_add_exec(bContext *C, wmOperator *UNUSED(op)) { - /*int type = RNA_enum_get(op->ptr, "type");*/ + // int type = RNA_enum_get(op->ptr, "type"); Paint *paint = BKE_paint_get_active_from_context(C); Brush *br = BKE_paint_brush(paint); Main *bmain = CTX_data_main(C); @@ -97,7 +97,7 @@ static void BRUSH_OT_add(wmOperatorType *ot) static int brush_add_gpencil_exec(bContext *C, wmOperator *UNUSED(op)) { - /*int type = RNA_enum_get(op->ptr, "type");*/ + // int type = RNA_enum_get(op->ptr, "type"); ToolSettings *ts = CTX_data_tool_settings(C); Paint *paint = &ts->gp_paint->paint; Brush *br = BKE_paint_brush(paint); @@ -1385,7 +1385,7 @@ void ED_keymap_paint(wmKeyConfig *keyconf) keymap = WM_keymap_ensure(keyconf, "Weight Paint", 0, 0); keymap->poll = weight_paint_mode_poll; - /*Weight paint's Vertex Selection Mode */ + /* Weight paint's Vertex Selection Mode. */ keymap = WM_keymap_ensure(keyconf, "Paint Vertex Selection (Weight, Vertex)", 0, 0); keymap->poll = vert_paint_poll; diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 0a5f1975361..fe36d62b832 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -2750,11 +2750,11 @@ static bool vpaint_stroke_test_start(bContext *C, struct wmOperator *op, const f * if not we can skip face map trickiness */ if (vertex_paint_use_fast_update_check(ob)) { vpd->use_fast_update = true; - /* printf("Fast update!\n");*/ + // printf("Fast update!\n"); } else { vpd->use_fast_update = false; - /* printf("No fast update!\n");*/ + // printf("No fast update!\n"); } /* to keep tracked of modified loops for shared vertex color blending */ diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h index b39fbe5ba1a..43704c73faf 100644 --- a/source/blender/editors/sculpt_paint/sculpt_intern.h +++ b/source/blender/editors/sculpt_paint/sculpt_intern.h @@ -623,7 +623,7 @@ typedef struct SculptUndoNode { SculptUndoType type; - char idname[MAX_ID_NAME]; /* name instead of pointer*/ + char idname[MAX_ID_NAME]; /* Name instead of pointer. */ void *node; /* only during push, not valid afterwards! */ float (*co)[3]; diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c index 2825639bb3d..771e0e1e47b 100644 --- a/source/blender/editors/sculpt_paint/sculpt_uv.c +++ b/source/blender/editors/sculpt_paint/sculpt_uv.c @@ -92,7 +92,7 @@ typedef struct UVInitialStroke { /* Initial Selection,for grab brushes for instance */ UVInitialStrokeElement *initialSelection; - /* total initially selected UVs*/ + /* Total initially selected UV's. */ int totalInitialSelected; /* initial mouse coordinates */ @@ -505,7 +505,7 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, const wm bool do_island_optimization = !(ts->uv_sculpt_settings & UV_SCULPT_ALL_ISLANDS); int island_index = 0; - /* Holds, for each UvElement in elementMap, a pointer to its unique uv.*/ + /* Holds, for each UvElement in elementMap, a pointer to its unique UV. */ int *uniqueUv; data->tool = (RNA_enum_get(op->ptr, "mode") == BRUSH_STROKE_SMOOTH) ? UV_SCULPT_TOOL_RELAX : @@ -603,7 +603,7 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, const wm data->uv[counter].flag = 0; data->uv[counter].uv = luv->uv; } - /* pointer arithmetic to the rescue, as always :)*/ + /* Pointer arithmetic to the rescue, as always :). */ uniqueUv[element - data->elementMap->buf] = counter; } } -- cgit v1.2.3