Cleanup: spelling in comments

This commit is contained in:
Campbell Barton 2021-10-18 11:16:24 +11:00
parent 452c78757f
commit c5a13ffcb4
32 changed files with 53 additions and 52 deletions

View File

@ -344,7 +344,7 @@ bool PathTraceWorkGPU::enqueue_path_iteration()
/* Finish shadows before potentially adding more shadow rays. We can only
* store one shadow ray in the integrator state.
*
* When there is a shadow catcher in the scene finish shadow rays before invoking interesect
* When there is a shadow catcher in the scene finish shadow rays before invoking intersect
* closest kernel since so that the shadow paths are writing to the pre-split state. */
if (kernel == DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE ||
kernel == DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE_RAYTRACE ||

View File

@ -538,7 +538,7 @@ typedef struct SculptSession {
float cursor_sampled_normal[3];
float cursor_view_normal[3];
/* For Sculpt trimming gesture tools, initial raycast data from the position of the mouse when
/* For Sculpt trimming gesture tools, initial ray-cast data from the position of the mouse when
* the gesture starts (intersection with the surface and if they ray hit the surface or not). */
float gesture_initial_location[3];
float gesture_initial_normal[3];

View File

@ -128,8 +128,8 @@ void BKE_pbvh_build_bmesh(PBVH *pbvh,
void BKE_pbvh_free(PBVH *pbvh);
/* Hierarchical Search in the BVH, two methods:
* - for each hit calling a callback
* - gather nodes in an array (easy to multithread) */
* - For each hit calling a callback.
* - Gather nodes in an array (easy to multi-thread). */
void BKE_pbvh_search_callback(PBVH *pbvh,
BKE_pbvh_SearchCallback scb,
@ -140,7 +140,7 @@ void BKE_pbvh_search_callback(PBVH *pbvh,
void BKE_pbvh_search_gather(
PBVH *pbvh, BKE_pbvh_SearchCallback scb, void *search_data, PBVHNode ***array, int *tot);
/* Raycast
/* Ray-cast
* the hit callback is called for all leaf nodes intersecting the ray;
* it's up to the callback to find the primitive within the leaves that is
* hit first */

View File

@ -1211,7 +1211,7 @@ void BKE_pose_channel_copy_data(bPoseChannel *pchan, const bPoseChannel *pchan_f
/* copy bone group */
pchan->agrp_index = pchan_from->agrp_index;
/* ik (dof) settings */
/* IK (DOF) settings. */
pchan->ikflag = pchan_from->ikflag;
copy_v3_v3(pchan->limitmin, pchan_from->limitmin);
copy_v3_v3(pchan->limitmax, pchan_from->limitmax);

View File

@ -2763,7 +2763,7 @@ void BKE_pose_where_is_bone(struct Depsgraph *depsgraph,
float ctime,
bool do_extra)
{
/* This gives a chan_mat with actions (ipos) results. */
/* This gives a chan_mat with actions (F-curve) results. */
if (do_extra) {
BKE_pchan_calc_mat(pchan);
}

View File

@ -251,7 +251,7 @@ static void setup_app_data(bContext *C,
* replace it with 'curscene' if its needed */
}
/* and we enforce curscene to be in current screen */
else if (win) { /* can run in bgmode */
else if (win) { /* The window may be NULL in background-mode. */
win->scene = curscene;
}

View File

@ -112,7 +112,7 @@ static int neighStraightY[8] = {0, 1, 0, -1, 1, 1, -1, -1};
#define SUBFRAME_RECURSION 5
/* surface_getBrushFlags() return vals */
#define BRUSH_USES_VELOCITY (1 << 0)
/* brush mesh raycast status */
/* Brush mesh ray-cast status. */
#define HIT_VOLUME 1
#define HIT_PROXIMITY 2
/* dynamicPaint_findNeighborPixel() return codes */
@ -3436,7 +3436,7 @@ void dynamicPaint_outputSurfaceImage(DynamicPaintSurface *surface,
/***************************** Ray / Nearest Point Utils ******************************/
/* A modified callback to bvh tree raycast.
/* A modified callback to bvh tree ray-cast.
* The tree must have been built using bvhtree_from_mesh_looptri.
* userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree.
*
@ -4107,7 +4107,7 @@ static void dynamic_paint_paint_mesh_cell_point_cb_ex(
hit.index = -1;
hit.dist = brush_radius;
/* Do a face normal directional raycast, and use that distance */
/* Do a face normal directional ray-cast, and use that distance. */
BLI_bvhtree_ray_cast(
treeData->tree, ray_start, proj_ray, 0.0f, &hit, mesh_tris_spherecast_dp, treeData);
if (hit.index != -1) {
@ -4597,7 +4597,7 @@ static bool dynamicPaint_paintParticles(DynamicPaintSurface *surface,
}
/*
* Build a kd-tree to optimize distance search
* Build a KD-tree to optimize distance search
*/
tree = BLI_kdtree_3d_new(psys->totpart);

View File

@ -1379,7 +1379,7 @@ static int pbvh_flush_bb(PBVH *pbvh, PBVHNode *node, int flag)
{
int update = 0;
/* difficult to multithread well, we just do single threaded recursive */
/* Difficult to multi-thread well, we just do single threaded recursive. */
if (node->flag & PBVH_Leaf) {
if (flag & PBVH_UpdateBB) {
update |= (node->flag & PBVH_UpdateBB);
@ -1977,7 +1977,7 @@ bool BKE_pbvh_node_vert_update_check_any(PBVH *pbvh, PBVHNode *node)
return false;
}
/********************************* Raycast ***********************************/
/********************************* Ray-cast ***********************************/
typedef struct {
struct IsectRayAABB_Precalc ray;

View File

@ -644,7 +644,7 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc)
/* Options about projection direction */
float proj_axis[3] = {0.0f, 0.0f, 0.0f};
/* Raycast and tree stuff */
/* Ray-cast and tree stuff. */
/** \note 'hit.dist' is kept in the targets space, this is only used
* for finding the best hit, to get the real dist,

View File

@ -480,7 +480,7 @@ Text *BKE_text_load_ex(Main *bmain, const char *file, const char *relpath, const
BLI_stat_t st;
BLI_strncpy(filepath_abs, file, FILE_MAX);
if (relpath) { /* can be NULL (bg mode) */
if (relpath) { /* Can be NULL (background mode). */
BLI_path_abs(filepath_abs, relpath);
}

View File

@ -59,9 +59,9 @@ typedef struct FileReader {
/* Functions for opening the various types of FileReader.
* They either succeed and return a valid FileReader, or fail and return NULL.
*
* If a FileReader is created, it has to be cleaned up and freed by calling
* its close() function unless another FileReader has taken ownership - for example,
* Zstd and Gzip take over the base FileReader and will clean it up when their clean() is called.
* If a FileReader is created, it has to be cleaned up and freed by calling its close()
* function unless another FileReader has taken ownership - for example, `Zstd` & `Gzip`
* take over the base FileReader and will clean it up when their clean() is called.
*/
/* Create FileReader from raw file descriptor. */
@ -71,9 +71,9 @@ FileReader *BLI_filereader_new_mmap(int filedes) ATTR_WARN_UNUSED_RESULT;
/* Create FileReader from a region of memory. */
FileReader *BLI_filereader_new_memory(const void *data, size_t len) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL();
/* Create FileReader from applying Zstd decompression on an underlying file. */
/* Create FileReader from applying `Zstd` decompression on an underlying file. */
FileReader *BLI_filereader_new_zstd(FileReader *base) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
/* Create FileReader from applying Gzip decompression on an underlying file. */
/* Create FileReader from applying `Gzip` decompression on an underlying file. */
FileReader *BLI_filereader_new_gzip(FileReader *base) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
#ifdef __cplusplus

View File

@ -438,9 +438,9 @@ bool isect_tri_tri_v2(const float p1[2],
const float q2[2],
const float r2[2]);
/* water-tight raycast (requires pre-calculation) */
/* water-tight ray-cast (requires pre-calculation). */
struct IsectRayPrecalc {
/* Maximal dimension kz, and orthogonal dimensions. */
/* Maximal dimension `kz`, and orthogonal dimensions. */
int kx, ky, kz;
/* Shear constants. */

View File

@ -89,7 +89,7 @@ size_t BLI_file_zstd_from_mem_at_pos(
total_written += output.pos;
}
/* Finalize the Zstd frame. */
/* Finalize the `Zstd` frame. */
size_t ret = 1;
while (ret != 0) {
ZSTD_outBuffer output = {out_buf, out_len, 0};

View File

@ -1162,7 +1162,7 @@ static int filter_plane_side(const double3 &p,
}
/*
* interesect_tri_tri and helper functions.
* #intersect_tri_tri and helper functions.
* This code uses the algorithm of Guigue and Devillers, as described
* in "Faster Triangle-Triangle Intersection Tests".
* Adapted from code by Eric Haines:

View File

@ -1230,13 +1230,13 @@ static FileData *blo_filedata_from_file_descriptor(const char *filepath,
else if (BLI_file_magic_is_gzip(header)) {
file = BLI_filereader_new_gzip(rawfile);
if (file != NULL) {
rawfile = NULL; /* The Gzip FileReader takes ownership of `rawfile`. */
rawfile = NULL; /* The `Gzip` #FileReader takes ownership of `rawfile`. */
}
}
else if (BLI_file_magic_is_zstd(header)) {
file = BLI_filereader_new_zstd(rawfile);
if (file != NULL) {
rawfile = NULL; /* The Zstd FileReader takes ownership of `rawfile`. */
rawfile = NULL; /* The `Zstd` #FileReader takes ownership of `rawfile`. */
}
}

View File

@ -1770,7 +1770,7 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
{
/* Keep this block, even when empty. */
/* Update the idnames for renamed geo and function nodes */
/* Update the `idnames` for renamed geometry and function nodes. */
LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
if (ntree->type != NTREE_GEOMETRY) {
continue;

View File

@ -488,7 +488,7 @@ void EEVEE_draw_effects(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
EEVEE_depth_of_field_draw(vedata);
/* NOTE: Lookdev drawing happens before TAA but after
* motion blur and dof to avoid distortions.
* motion blur and DOF to avoid distortions.
* Velocity resolve use a hack to exclude lookdev
* spheres from creating shimmering re-projection vectors. */
EEVEE_lookdev_draw(vedata);
@ -500,7 +500,7 @@ void EEVEE_draw_effects(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
* the swapping of the buffers. */
EEVEE_renderpasses_output_accumulate(sldata, vedata, true);
/* Save the final texture and framebuffer for final transformation or read. */
/* Save the final texture and frame-buffer for final transformation or read. */
effects->final_tx = effects->source_buffer;
effects->final_fb = (effects->target_buffer != fbl->main_color_fb) ? fbl->main_fb :
fbl->effect_fb;

View File

@ -645,7 +645,7 @@ void ED_screen_refresh(wmWindowManager *wm, wmWindow *win)
{
bScreen *screen = WM_window_get_active_screen(win);
/* exception for bg mode, we only need the screen context */
/* Exception for background mode, we only need the screen context. */
if (!G.background) {
/* header size depends on DPI, let's verify */
WM_window_set_dpi(win);

View File

@ -311,7 +311,7 @@ static int sculpt_set_pivot_position_exec(bContext *C, wmOperator *op)
else if (mode == SCULPT_PIVOT_POSITION_ACTIVE_VERTEX) {
copy_v3_v3(ss->pivot_pos, SCULPT_active_vertex_co_get(ss));
}
/* Pivot to raycast surface. */
/* Pivot to ray-cast surface. */
else if (mode == SCULPT_PIVOT_POSITION_CURSOR_SURFACE) {
float stroke_location[3];
float mouse[2];

View File

@ -709,7 +709,7 @@ static int txtfmt_pov_find_bool(const char *string)
/* Keep aligned args for readability. */
/* clang-format off */
/* Built-in Constants */
/* Built-in Constants. */
if (STR_LITERAL_STARTSWITH(string, "unofficial", len)) { i = len;
} else if (STR_LITERAL_STARTSWITH(string, "false", len)) { i = len;
} else if (STR_LITERAL_STARTSWITH(string, "no", len)) { i = len;
@ -719,7 +719,7 @@ static int txtfmt_pov_find_bool(const char *string)
} else if (STR_LITERAL_STARTSWITH(string, "on", len)) { i = len;
} else if (STR_LITERAL_STARTSWITH(string, "pi", len)) { i = len;
} else if (STR_LITERAL_STARTSWITH(string, "tau", len)) { i = len;
/* Encodings */
/* Encodings. */
} else if (STR_LITERAL_STARTSWITH(string, "sint16be", len)) { i = len;
} else if (STR_LITERAL_STARTSWITH(string, "sint16le", len)) { i = len;
} else if (STR_LITERAL_STARTSWITH(string, "sint32be", len)) { i = len;
@ -732,7 +732,7 @@ static int txtfmt_pov_find_bool(const char *string)
} else if (STR_LITERAL_STARTSWITH(string, "uint8", len)) { i = len;
} else if (STR_LITERAL_STARTSWITH(string, "ascii", len)) { i = len;
} else if (STR_LITERAL_STARTSWITH(string, "utf8", len)) { i = len;
/* Filetypes */
/* File-types. */
} else if (STR_LITERAL_STARTSWITH(string, "tiff", len)) { i = len;
} else if (STR_LITERAL_STARTSWITH(string, "df3", len)) { i = len;
} else if (STR_LITERAL_STARTSWITH(string, "exr", len)) { i = len;

View File

@ -279,7 +279,7 @@ static int txtfmt_ini_find_reserved(const char *string)
} else if (STR_LITERAL_STARTSWITH(string, "Dither", len)) { i = len;
} else if (STR_LITERAL_STARTSWITH(string, "Flags", len)) { i = len;
} else if (STR_LITERAL_STARTSWITH(string, "Font", len)) { i = len;
/* Filetypes */
/* File-types. */
} else if (STR_LITERAL_STARTSWITH(string, "df3", len)) { i = len;
} else if (STR_LITERAL_STARTSWITH(string, "exr", len)) { i = len;
} else if (STR_LITERAL_STARTSWITH(string, "gif", len)) { i = len;
@ -292,7 +292,7 @@ static int txtfmt_ini_find_reserved(const char *string)
} else if (STR_LITERAL_STARTSWITH(string, "sys", len)) { i = len;
} else if (STR_LITERAL_STARTSWITH(string, "tga", len)) { i = len;
} else if (STR_LITERAL_STARTSWITH(string, "tiff", len)) { i = len;
/* Encodings */
/* Encodings. */
} else if (STR_LITERAL_STARTSWITH(string, "ascii", len)) { i = len;
} else if (STR_LITERAL_STARTSWITH(string, "utf8", len)) { i = len;
} else if (STR_LITERAL_STARTSWITH(string, "uint8", len)) { i = len;

View File

@ -1325,7 +1325,7 @@ bool peelObjectsTransform(TransInfo *t,
}
}
}
/* in this case has only one hit. treat as raycast */
/* In this case has only one hit. treat as ray-cast. */
if (hit_max == NULL) {
hit_max = hit_min;
}

View File

@ -472,8 +472,7 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
return true;
case EVT_PADPERIOD:
case EVT_PERIODKEY:
/* Force numdot, some OSs/countries generate a comma char in this case,
* sic... (T37992) */
/* Force number-pad "." since some OS's/countries generate a comma char, see: T37992 */
ascii[0] = '.';
utf8_buf = ascii;
break;

View File

@ -939,7 +939,7 @@ typedef enum eTrackToAxis_Modes {
/* Shrinkwrap flags */
typedef enum eShrinkwrap_Flags {
/* Also raycast in the opposite direction. */
/* Also ray-cast in the opposite direction. */
CON_SHRINKWRAP_PROJECT_OPPOSITE = (1 << 0),
/* Invert the cull mode when projecting opposite. */
CON_SHRINKWRAP_PROJECT_INVERT_CULL = (1 << 1),

View File

@ -28,7 +28,7 @@ extern "C" {
#endif
/* Keep for 'Camera' versioning. */
/** Properties for dof effect. */
/** Properties for DOF effect. */
typedef struct GPUDOFSettings {
/** Focal distance for depth of field. */
float focus_distance;

View File

@ -34,7 +34,7 @@
#include "DNA_ID.h"
#include "DNA_color_types.h" /* color management */
#include "DNA_customdata_types.h" /* Scene's runtime cddata masks. */
#include "DNA_customdata_types.h" /* Scene's runtime custom-data masks. */
#include "DNA_layer_types.h"
#include "DNA_listBase.h"
#include "DNA_vec_types.h"

View File

@ -772,7 +772,7 @@ typedef struct FileSelectParams {
const ID *rename_id;
void *_pad3;
/** List of filetypes to filter (FILE_MAXFILE). */
/** List of file-types to filter (#FILE_MAXFILE). */
char filter_glob[256];
/** Text items name must match to be shown. */

View File

@ -1800,7 +1800,7 @@ static void sdna_expand_names(SDNA *sdna)
int names_expand_index = 0;
for (int struct_nr = 0; struct_nr < sdna->structs_len; struct_nr++) {
/* We can't edit this memory 'sdna->structs' points to (readonly datatoc file). */
/* We can't edit this memory 'sdna->structs' points to (read-only `datatoc` file). */
const SDNA_Struct *struct_old = sdna->structs[struct_nr];
const int array_size = sizeof(short) * 2 + sizeof(SDNA_StructMember) * struct_old->members_len;

View File

@ -495,7 +495,7 @@ class NearestTransferFunction : public fn::MultiFunction {
Array<int> mesh_indices;
Array<float> mesh_distances;
/* If there is a pointcloud, find the closest points. */
/* If there is a point-cloud, find the closest points. */
if (use_points_) {
point_indices.reinitialize(tot_samples);
if (use_mesh_) {
@ -594,7 +594,7 @@ static const GeometryComponent *find_best_match_component(const GeometrySet &geo
/* If there is no component of the same type, choose the other component based on a consistent
* order, rather than some more complicated heuristic. This is the same order visible in the
* spreadsheet and used in the raycast node. */
* spreadsheet and used in the ray-cast node. */
static const Array<GeometryComponentType> supported_types = {
GEO_COMPONENT_TYPE_MESH, GEO_COMPONENT_TYPE_POINT_CLOUD, GEO_COMPONENT_TYPE_CURVE};
for (const GeometryComponentType src_type : supported_types) {
@ -607,8 +607,8 @@ static const GeometryComponent *find_best_match_component(const GeometrySet &geo
}
/**
* Use a FieldInput because it's necessary to know the field context in order to choose the
* corresponding component type from the input geometry, and only a FieldInput receives the
* Use a #FieldInput because it's necessary to know the field context in order to choose the
* corresponding component type from the input geometry, and only a #FieldInput receives the
* evaluation context to provide its data.
*
* The index-based transfer theoretically does not need realized data when there is only one

View File

@ -3837,7 +3837,7 @@ void WM_event_fileselect_event(wmWindowManager *wm, void *ophandle, int eventval
}
/* Operator is supposed to have a filled "path" property. */
/* Optional property: filetype (XXX enum?) */
/* Optional property: file-type (XXX enum?) */
/**
* The idea here is to keep a handler alive on window queue, owning the operator.

View File

@ -526,7 +526,7 @@ static int wm_read_exotic(const char *name)
/* check for compressed .blend */
FileReader *compressed_file = NULL;
if (BLI_file_magic_is_gzip(header)) {
/* In earlier versions of Blender (before 3.0), compressed files used Gzip instead of Zstd.
/* In earlier versions of Blender (before 3.0), compressed files used `Gzip` instead of `Zstd`.
* While these files will no longer be written, there still needs to be reading support. */
compressed_file = BLI_filereader_new_gzip(rawfile);
}

View File

@ -258,7 +258,9 @@ void main_signal_setup_background(void)
BLI_assert(G.background);
# if !defined(WITH_HEADLESS)
signal(SIGINT, sig_handle_blender_esc); /* ctrl c out bg render */
/* Support pressing `Ctrl-C` to close Blender in background-mode.
* Useful to be able to cancel a render operation. */
signal(SIGINT, sig_handle_blender_esc);
# endif
}