Cleanup: spelling in comments

Also replace "dm" for evaluated mesh in some comments.
This commit is contained in:
Campbell Barton 2022-10-03 10:24:08 +11:00
parent 55387197a7
commit ea2c41c730
23 changed files with 100 additions and 88 deletions

View File

@ -589,7 +589,7 @@ ccl_device_inline float fast_erfcf(float x)
ccl_device_inline float fast_ierff(float x)
{
/* From: Approximating the `erfinv` function by Mike Giles. */
/* To avoid trouble at the limit, clamp input to 1-eps. */
/* To avoid trouble at the limit, clamp input to 1-epsilon. */
float a = fabsf(x);
if (a > 0.99999994f) {
a = 0.99999994f;

View File

@ -14,7 +14,7 @@
#include "../GHOST_Types.h"
#include "GHOST_System.h"
// For tablets
/* For tablets. */
#ifdef WITH_X11_XINPUT
# include <X11/extensions/XInput.h>

View File

@ -25,18 +25,18 @@
#include "GHOST_ContextEGL.h"
#include "GHOST_ContextGLX.h"
/* for XIWarpPointer */
/* For #XIWarpPointer. */
#ifdef WITH_X11_XINPUT
# include <X11/extensions/XInput2.h>
#endif
// For DPI value
/* For DPI value. */
#include <X11/Xresource.h>
#include <cstdio>
#include <cstring>
/* gethostname */
/* For `gethostname`. */
#include <unistd.h>
#include <algorithm>

View File

@ -11,7 +11,7 @@
#include "GHOST_Window.h"
#include <X11/Xlib.h>
#include <X11/Xutil.h>
// For tablets
/* For tablets. */
#ifdef WITH_X11_XINPUT
# include <X11/extensions/XInput.h>
#endif

View File

@ -85,7 +85,7 @@ class GHOST_XrGraphicsBindingOpenGL : public GHOST_IXrGraphicsBinding {
XrGraphicsRequirementsOpenGLKHR gpu_requirements = {XR_TYPE_GRAPHICS_REQUIREMENTS_OPENGL_KHR};
const XrVersion gl_version = XR_MAKE_VERSION(gl_major_version, gl_minor_version, 0);
/* Although it would seem reasonable that the proc address would not change if the instance was
/* Although it would seem reasonable that the PROC address would not change if the instance was
* the same, in testing, repeated calls to #xrGetInstanceProcAddress() with the same instance
* can still result in changes so the workaround is to simply set the function pointer every
* time (trivializing its 'static' designation). */
@ -343,7 +343,7 @@ class GHOST_XrGraphicsBindingD3D : public GHOST_IXrGraphicsBinding {
// static XrInstance s_instance = XR_NULL_HANDLE;
XrGraphicsRequirementsD3D11KHR gpu_requirements = {XR_TYPE_GRAPHICS_REQUIREMENTS_D3D11_KHR};
/* Although it would seem reasonable that the proc address would not change if the instance was
/* Although it would seem reasonable that the PROC address would not change if the instance was
* the same, in testing, repeated calls to #xrGetInstanceProcAddress() with the same instance
* can still result in changes so the workaround is to simply set the function pointer every
* time (trivializing its 'static' designation). */

View File

@ -59,7 +59,7 @@ BMEditMesh *BKE_editmesh_from_object(Object *ob)
{
BLI_assert(ob->type == OB_MESH);
/* sanity check */
#if 0 /* disable in mutlti-object edit. */
#if 0 /* disable in multi-object edit. */
# ifndef NDEBUG
if (((Mesh *)ob->data)->edit_mesh) {
BLI_assert(((Mesh *)ob->data)->edit_mesh->ob == ob);
@ -85,9 +85,9 @@ static void editmesh_tessface_calc_intern(BMEditMesh *em,
BMLoop *(*looptris)[3];
/* this means no reallocs for quad dominant models, for */
/* This means no reallocations for quad dominant models. */
if ((em->looptris != nullptr) &&
/* (*em->tottri >= looptris_tot)) */
// (*em->tottri >= looptris_tot))
/* Check against allocated size in case we over allocated a little. */
((looptris_tot_prev_alloc >= looptris_tot) &&
(looptris_tot_prev_alloc <= looptris_tot * 2))) {

View File

@ -46,44 +46,52 @@
/* Data types */
typedef struct corner { /* corner of a cube */
int i, j, k; /* (i, j, k) is index within lattice */
float co[3], value; /* location and function value */
/** Corner of a cube. */
typedef struct corner {
int i, j, k; /* (i, j, k) is index within lattice */
float co[3], value; /* location and function value */
struct corner *next;
} CORNER;
typedef struct cube { /* partitioning cell (cube) */
/** Partitioning cell (cube). */
typedef struct cube {
int i, j, k; /* lattice location of cube */
CORNER *corners[8]; /* eight corners */
} CUBE;
typedef struct cubes { /* linked list of cubes acting as stack */
CUBE cube; /* a single cube */
struct cubes *next; /* remaining elements */
/** Linked list of cubes acting as stack. */
typedef struct cubes {
CUBE cube; /* a single cube */
struct cubes *next; /* remaining elements */
} CUBES;
typedef struct centerlist { /* list of cube locations */
int i, j, k; /* cube location */
struct centerlist *next; /* remaining elements */
/** List of cube locations. */
typedef struct centerlist {
int i, j, k; /* cube location */
struct centerlist *next; /* remaining elements */
} CENTERLIST;
typedef struct edgelist { /* list of edges */
/** List of edges. */
typedef struct edgelist {
int i1, j1, k1, i2, j2, k2; /* edge corner ids */
int vid; /* vertex id */
struct edgelist *next; /* remaining elements */
} EDGELIST;
typedef struct intlist { /* list of integers */
int i; /* an integer */
struct intlist *next; /* remaining elements */
/** List of integers. */
typedef struct intlist {
int i; /* an integer */
struct intlist *next; /* remaining elements */
} INTLIST;
typedef struct intlists { /* list of list of integers */
INTLIST *list; /* a list of integers */
struct intlists *next; /* remaining elements */
/** List of list of integers. */
typedef struct intlists {
INTLIST *list; /* a list of integers */
struct intlists *next; /* remaining elements */
} INTLISTS;
typedef struct Box { /* an AABB with pointer to metalelem */
/** An AABB with pointer to metal-elem. */
typedef struct Box {
float min[3], max[3];
const MetaElem *ml;
} Box;
@ -93,16 +101,17 @@ typedef struct MetaballBVHNode { /* BVH node */
struct MetaballBVHNode *child[2];
} MetaballBVHNode;
typedef struct process { /* parameters, storage */
float thresh, size; /* mball threshold, single cube size */
float delta; /* small delta for calculating normals */
uint converge_res; /* converge procedure resolution (more = slower) */
/** Parameters, storage. */
typedef struct process {
float thresh, size; /* mball threshold, single cube size */
float delta; /* small delta for calculating normals */
uint converge_res; /* converge procedure resolution (more = slower) */
MetaElem **mainb; /* array of all metaelems */
uint totelem, mem; /* number of metaelems */
MetaElem **mainb; /* array of all meta-elems. */
uint totelem, mem; /* number of meta-elems. */
MetaballBVHNode metaball_bvh; /* The simplest bvh */
Box allbb; /* Bounding box of all metaelems */
Box allbb; /* Bounding box of all meta-elems */
MetaballBVHNode **bvh_queue; /* Queue used during bvh traversal */
uint bvh_queue_size;
@ -1127,8 +1136,8 @@ static void find_first_points(PROCESS *process, const uint em)
}
/**
* The main polygonization proc.
* Allocates memory, makes cubetable,
* The main polygonization processing function.
* Allocates memory, makes cube-table,
* finds starting surface points
* and processes cubes on the stack until none left.
*/
@ -1341,18 +1350,18 @@ static void init_meta(Depsgraph *depsgraph, PROCESS *process, Scene *scene, Obje
copy_v3_fl3(new_ml->bb->vec[6], +expx, +expy, +expz); /* 6 */
copy_v3_fl3(new_ml->bb->vec[7], -expx, +expy, +expz); /* 7 */
/* transformation of Metalem bb */
/* Transformation of meta-elem bounding-box. */
for (i = 0; i < 8; i++) {
mul_m4_v3((float(*)[4])new_ml->mat, new_ml->bb->vec[i]);
}
/* find max and min of transformed bb */
/* Find max and min of transformed bounding-box. */
INIT_MINMAX(tempmin, tempmax);
for (i = 0; i < 8; i++) {
DO_MINMAX(new_ml->bb->vec[i], tempmin, tempmax);
}
/* set only point 0 and 6 - AABB of Metaelem */
/* Set only point 0 and 6 - AABB of meta-elem. */
copy_v3_v3(new_ml->bb->vec[0], tempmin);
copy_v3_v3(new_ml->bb->vec[6], tempmax);
@ -1370,7 +1379,7 @@ static void init_meta(Depsgraph *depsgraph, PROCESS *process, Scene *scene, Obje
}
}
/* compute AABB of all Metaelems */
/* Compute AABB of all meta-elems. */
if (process->totelem > 0) {
copy_v3_v3(process->allbb.min, process->mainb[0]->bb->vec[0]);
copy_v3_v3(process->allbb.max, process->mainb[0]->bb->vec[6]);
@ -1432,8 +1441,8 @@ Mesh *BKE_mball_polygonize(Depsgraph *depsgraph, Scene *scene, Object *ob)
build_bvh_spatial(&process, &process.metaball_bvh, 0, process.totelem, &process.allbb);
/* Don't polygonize meta-balls with too high resolution (base mball too small)
* NOTE: Eps was 0.0001f but this was giving problems for blood animation for
/* Don't polygonize meta-balls with too high resolution (base meta-ball too small).
* NOTE: Epsilon was 0.0001f but this was giving problems for blood animation for
* the open movie "Sintel", using 0.00001f. */
if (ob->scale[0] < 0.00001f * (process.allbb.max[0] - process.allbb.min[0]) ||
ob->scale[1] < 0.00001f * (process.allbb.max[1] - process.allbb.min[1]) ||

View File

@ -151,9 +151,9 @@ void BKE_mesh_foreach_mapped_loop(Mesh *mesh,
MeshForeachFlag flag)
{
/* We can't use dm->getLoopDataLayout(dm) here,
* we want to always access dm->loopData, EditDerivedBMesh would
* return loop data from bmesh itself. */
/* We can't use `dm->getLoopDataLayout(dm)` here,
* we want to always access `dm->loopData`, `EditDerivedBMesh` would
* return loop data from BMesh itself. */
if (mesh->edit_mesh != nullptr && mesh->runtime.edit_data) {
BMEditMesh *em = mesh->edit_mesh;
BMesh *bm = em->bm;

View File

@ -253,7 +253,7 @@ bool BKE_modifier_is_preview(ModifierData *md)
{
const ModifierTypeInfo *mti = BKE_modifier_get_info(ModifierType(md->type));
/* Constructive modifiers are highly likely to also modify data like vgroups or vcol! */
/* Constructive modifiers are highly likely to also modify data like vgroups or vertex-colors! */
if (!((mti->flags & eModifierTypeFlag_UsesPreview) ||
(mti->type == eModifierTypeType_Constructive))) {
return false;
@ -340,8 +340,8 @@ void BKE_modifier_copydata_generic(const ModifierData *md_src,
{
const ModifierTypeInfo *mti = BKE_modifier_get_info(ModifierType(md_src->type));
/* md_dst may have already be fully initialized with some extra allocated data,
* we need to free it now to avoid memleak. */
/* `md_dst` may have already be fully initialized with some extra allocated data,
* we need to free it now to avoid a memory leak. */
if (mti->freeData) {
mti->freeData(md_dst);
}

View File

@ -1329,8 +1329,8 @@ float BLI_noise_mg_fbm(
float BLI_noise_mg_multi_fractal(
float x, float y, float z, float H, float lacunarity, float octaves, int noisebasis)
{
/* This one is in fact rather confusing,
* there seem to be errors in the original source code (in all three versions of proc.text&mod),
/* This one is in fact rather confusing, there seem to be errors in the original source code
* (in all three versions of `proc.text & mod`),
* I modified it to something that made sense to me, so it might be wrong. */
float (*noisefunc)(float, float, float);

View File

@ -563,7 +563,7 @@ static void bmo_collapsecon_do_layer(BMesh *bm, const int layer, const short ofl
CustomData_data_multiply(type, &max, 0.5f);
CustomData_data_add(type, &min, &max);
/* snap CD (uv, vcol) points to their centroid */
/* Snap custom-data (UV, vertex-colors) points to their centroid. */
while (!BLI_stack_is_empty(block_stack)) {
void *block;
BLI_stack_pop(block_stack, &block);

View File

@ -229,14 +229,15 @@ void BM_mesh_decimate_unsubdivide_ex(BMesh *bm, const int iterations, const bool
#ifdef USE_WALKER
/* Walk over selected elements starting at active */
BMW_init(&walker,
bm,
BMW_CONNECTED_VERTEX,
ELE_VERT_TAG,
BMW_MASK_NOP,
BMW_MASK_NOP,
BMW_FLAG_NOP, /* don't use BMW_FLAG_TEST_HIDDEN here since we want to desel all */
BMW_NIL_LAY);
BMW_init(
&walker,
bm,
BMW_CONNECTED_VERTEX,
ELE_VERT_TAG,
BMW_MASK_NOP,
BMW_MASK_NOP,
BMW_FLAG_NOP, /* don't use #BMW_FLAG_TEST_HIDDEN here since we want to deselect all. */
BMW_NIL_LAY);
BLI_assert(walker.order == BMW_BREADTH_FIRST);
for (v = BMW_begin(&walker, v_first); v != NULL; v = BMW_step(&walker)) {

View File

@ -837,7 +837,7 @@ typedef struct EEVEE_EffectsInfo {
struct GPUTexture *bloom_upsample[MAX_BLOOM_STEP - 1];
struct GPUTexture *unf_source_buffer; /* pointer copy */
struct GPUTexture *unf_base_buffer; /* pointer copy */
/* Not alloced, just a copy of a *GPUtexture in EEVEE_TextureList. */
/* Not allocated, just a copy of a *GPUtexture in EEVEE_TextureList. */
struct GPUTexture *source_buffer; /* latest updated texture */
struct GPUFrameBuffer *target_buffer; /* next target to render to */
struct GPUTexture *final_tx; /* Final color to transform to display color space. */

View File

@ -144,8 +144,8 @@ void OVERLAY_grid_init(OVERLAY_Data *vedata)
zneg_flag = zpos_flag;
/* Persp : If camera is below floor plane, we switch clipping
* Ortho : If eye vector is looking up, we switch clipping */
/* Perspective: If camera is below floor plane, we switch clipping.
* Orthographic: If eye vector is looking up, we switch clipping. */
if (((winmat[3][3] == 0.0f) && (campos[2] > 0.0f)) ||
((winmat[3][3] != 0.0f) && (zvec[2] < 0.0f))) {
zpos_flag |= CLIP_ZPOS;

View File

@ -64,7 +64,7 @@
static void draw_call_sort(DRWCommand *array, DRWCommand *array_tmp, int array_len)
{
/* Count unique batches. Tt's not really important if
/* Count unique batches. It's not really important if
* there is collisions. If there is a lot of different batches,
* the sorting benefit will be negligible.
* So at least sort fast! */
@ -1527,7 +1527,7 @@ DRWCallBuffer *DRW_shgroup_call_buffer(DRWShadingGroup *shgroup,
callbuf->count = 0;
if (G.f & G_FLAG_PICKSEL) {
/* Not actually used for rendering but alloced in one chunk. */
/* Not actually used for rendering but allocated in one chunk. */
if (inst_select_format.attr_len == 0) {
GPU_vertformat_attr_add(&inst_select_format, "selectId", GPU_COMP_I32, 1, GPU_FETCH_INT);
}
@ -1557,7 +1557,7 @@ DRWCallBuffer *DRW_shgroup_call_buffer_instance(DRWShadingGroup *shgroup,
callbuf->count = 0;
if (G.f & G_FLAG_PICKSEL) {
/* Not actually used for rendering but alloced in one chunk. */
/* Not actually used for rendering but allocated in one chunk. */
if (inst_select_format.attr_len == 0) {
GPU_vertformat_attr_add(&inst_select_format, "selectId", GPU_COMP_I32, 1, GPU_FETCH_INT);
}
@ -2177,13 +2177,15 @@ static void draw_view_matrix_state_update(ViewInfos *storage,
}
/**
* If ortho : view_vecs[0] is the near-bottom-left corner of the frustum and
* view_vecs[1] is the vector going from the near-bottom-left corner to
* the far-top-right corner.
* If Persp : view_vecs[0].xy and view_vecs[1].xy are respectively the bottom-left corner
* when Z = 1, and top-left corner if Z = 1.
* view_vecs[0].z the near clip distance and view_vecs[1].z is the (signed)
* distance from the near plane to the far clip plane.
* - When orthographic:
* `view_vecs[0]` is the near-bottom-left corner of the frustum and
* `view_vecs[1]` is the vector going from the near-bottom-left corner to
* the far-top-right corner.
* - When perspective:
* `view_vecs[0].xy` and `view_vecs[1].xy` are respectively the bottom-left corner
* when Z = 1, and top-left corner if `Z = 1`.
* `view_vecs[0].z` the near clip distance and `view_vecs[1].z` is the (signed)
* distance from the near plane to the far clip plane.
*/
copy_v3_v3(storage->viewvecs[0], view_vecs[0]);

View File

@ -473,7 +473,7 @@ static int loopcut_init(bContext *C, wmOperator *op, const wmEvent *event)
static int ringcut_invoke(bContext *C, wmOperator *op, const wmEvent *event)
{
/* When accessed as a tool, get the active edge from the preselection gizmo. */
/* When accessed as a tool, get the active edge from the pre-selection gizmo. */
{
ARegion *region = CTX_wm_region(C);
wmGizmoMap *gzmap = region->gizmo_map;

View File

@ -73,7 +73,7 @@ static void edbm_flag_disable_all_multi(const Scene *scene,
MEM_freeN(objects);
}
/* When accessed as a tool, get the active edge from the preselection gizmo. */
/** When accessed as a tool, get the active edge from the pre-selection gizmo. */
static bool edbm_preselect_or_active(bContext *C, const View3D *v3d, Base **r_base, BMElem **r_ele)
{
ARegion *region = CTX_wm_region(C);

View File

@ -269,7 +269,7 @@ BMVert *EDBM_vert_find_nearest_ex(ViewContext *vc,
uint index;
BMVert *eve;
/* No afterqueue (yet), so we check it now, otherwise the bm_xxxofs indices are bad. */
/* No after-queue (yet), so we check it now, otherwise the bm_xxxofs indices are bad. */
{
DRW_select_buffer_context_create(bases, bases_len, SCE_SELECT_VERTEX);
@ -495,7 +495,7 @@ BMEdge *EDBM_edge_find_nearest_ex(ViewContext *vc,
uint index;
BMEdge *eed;
/* No afterqueue (yet), so we check it now, otherwise the bm_xxxofs indices are bad. */
/* No after-queue (yet), so we check it now, otherwise the bm_xxxofs indices are bad. */
{
DRW_select_buffer_context_create(bases, bases_len, SCE_SELECT_EDGE);
@ -877,7 +877,7 @@ static bool unified_findnearest(ViewContext *vc,
} f, f_zbuf;
} hit = {{nullptr}};
/* no afterqueue (yet), so we check it now, otherwise the em_xxxofs indices are bad */
/* No after-queue (yet), so we check it now, otherwise the em_xxxofs indices are bad. */
if ((dist > 0.0f) && (em->selectmode & SCE_SELECT_FACE)) {
float dist_center = 0.0f;
@ -3225,7 +3225,7 @@ static void select_linked_delimit_begin(BMesh *bm, int delimit)
}
}
/* grr, shouldn't need to alloc BMO flags here */
/* Shouldn't need to allocated BMO flags here (sigh). */
BM_mesh_elem_toolflags_ensure(bm);
{
@ -4199,7 +4199,7 @@ static void walker_deselect_nth(BMEditMesh *em,
break;
}
/* grr, shouldn't need to alloc BMO flags here */
/* Shouldn't need to allocate BMO flags here (sigh). */
BM_mesh_elem_toolflags_ensure(bm);
/* Walker restrictions uses BMO flags, not header flags,
@ -4218,7 +4218,7 @@ static void walker_deselect_nth(BMEditMesh *em,
mask_vert,
mask_edge,
mask_face,
BMW_FLAG_NOP, /* don't use BMW_FLAG_TEST_HIDDEN here since we want to desel all */
BMW_FLAG_NOP, /* Don't use #BMW_FLAG_TEST_HIDDEN here since we want to deselect all. */
BMW_NIL_LAY);
/* use tag to avoid touching the same verts twice */

View File

@ -3,7 +3,7 @@
/** \file
* \ingroup wm
*
* \name Preselection Gizmo
* \name Pre-selection Gizmo
*
* Use for tools to hover over data before activation.
*

View File

@ -279,7 +279,7 @@ typedef struct ParticleSettings {
struct PartDeflect *pd;
struct PartDeflect *pd2;
/* modified dm support */
/* Evaluated mesh support. */
short use_modifier_stack;
char _pad5[2];

View File

@ -916,8 +916,8 @@ StructRNA *RNA_def_struct_ptr(BlenderRNA *brna, const char *identifier, StructRN
DefRNA.laststruct = srna;
if (srnafrom) {
/* copy from struct to derive stuff, a bit clumsy since we can't
* use MEM_dupallocN, data structs may not be alloced but builtin */
/* Copy from struct to derive stuff, a bit clumsy since we can't
* use #MEM_dupallocN, data structs may not be allocated but builtin. */
memcpy(srna, srnafrom, sizeof(StructRNA));
srna->cont.prophash = NULL;
BLI_listbase_clear(&srna->cont.properties);

View File

@ -3431,7 +3431,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Loop Count", "Number of times the keys are looped");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
/* modified dm support */
/* Evaluated mesh support. */
prop = RNA_def_property(srna, "use_modifier_stack", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "use_modifier_stack", 0);
RNA_def_property_ui_text(

View File

@ -123,7 +123,7 @@ static void deformVerts(ModifierData *md,
}
}
/* clear old dm */
/* Clear old evaluated mesh. */
bool had_mesh_final = (psmd->mesh_final != nullptr);
if (psmd->mesh_final) {
BKE_id_free(nullptr, psmd->mesh_final);