Cleanup: spelling in comments, function name

This commit is contained in:
Campbell Barton 2022-03-04 10:29:53 +11:00
parent fd2519e0b6
commit 8b06c524d2
26 changed files with 69 additions and 62 deletions

View File

@ -466,7 +466,7 @@ void PathTrace::set_denoiser_params(const DenoiseParams &params)
denoiser_ = Denoiser::create(device_, params);
/* Only take into account the "immediate" cancel to have interactive rendering responding to
* navigation as quickly as possible, but allow to run denoiser after user hit Esc button while
* navigation as quickly as possible, but allow to run denoiser after user hit Escape key while
* doing offline rendering. */
denoiser_->is_cancelled_cb = [this]() { return render_cancel_.is_requested; };
}

View File

@ -174,7 +174,7 @@ static void GPENCIL_render_result_z(struct RenderLayer *rl,
int pix_ct = BLI_rcti_size_x(rect) * BLI_rcti_size_y(rect);
/* Convert ogl depth [0..1] to view Z [near..far] */
/* Convert GPU depth [0..1] to view Z [near..far] */
if (DRW_view_is_persp_get(NULL)) {
for (int i = 0; i < pix_ct; i++) {
if (rp->rect[i] == 1.0f) {

View File

@ -401,7 +401,7 @@ template<typename TextureMethod> class ScreenSpaceDrawingMode : public AbstractD
/**
* \brief Ensure that the float buffer of the given image buffer is available.
*
* Returns true when a float buffer was created. Somehow the VSE cache increases the ref
* Returns true when a float buffer was created. Somehow the sequencer cache increases the ref
* counter, but might use a different mechanism for destructing the image, that doesn't free the
* rect_float as the reference-counter isn't 0. To work around this we destruct any created local
* buffers ourself.

View File

@ -110,7 +110,9 @@ static void annotation_draw_stroke_arrow_buffer(uint pos,
immEnd();
}
/* draw stroke defined in buffer (simple ogl lines/points for now, as dotted lines) */
/**
* Draw stroke defined in buffer (simple GPU lines/points for now, as dotted lines).
*/
static void annotation_draw_stroke_buffer(bGPdata *gps,
short thickness,
short dflag,
@ -298,7 +300,9 @@ static void annotation_draw_stroke_point(const bGPDspoint *points,
immUnbindProgram();
}
/* draw a given stroke in 3d (i.e. in 3d-space), using simple ogl lines */
/**
* Draw a given stroke in 3d (i.e. in 3d-space), using simple GPU lines.
*/
static void annotation_draw_stroke_3d(
const bGPDspoint *points, int totpoints, short thickness, const float ink[4], bool cyclic)
{

View File

@ -2466,10 +2466,10 @@ static int annotation_draw_modal(bContext *C, wmOperator *op, const wmEvent *eve
EVT_PAD7,
EVT_PAD8,
EVT_PAD9)) {
/* allow numpad keys so that camera/view manipulations can still take place
* - PAD0 in particular is really important for Grease Pencil drawing,
/* Allow numpad keys so that camera/view manipulations can still take place
* - #EVT_PAD0 in particular is really important for Grease Pencil drawing,
* as animators may be working "to camera", so having this working
* is essential for ensuring that they can quickly return to that view
* is essential for ensuring that they can quickly return to that view.
*/
}
else if ((event->type == EVT_BKEY) && (event->val == KM_RELEASE)) {

View File

@ -3649,10 +3649,10 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
EVT_PAD7,
EVT_PAD8,
EVT_PAD9)) {
/* allow numpad keys so that camera/view manipulations can still take place
* - PAD0 in particular is really important for Grease Pencil drawing,
/* Allow numpad keys so that camera/view manipulations can still take place
* - #EVT_PAD0 in particular is really important for Grease Pencil drawing,
* as animators may be working "to camera", so having this working
* is essential for ensuring that they can quickly return to that view
* is essential for ensuring that they can quickly return to that view.
*/
}
else if ((!ELEM(p->paintmode, GP_PAINTMODE_ERASER, GP_PAINTMODE_SET_CP))) {

View File

@ -66,14 +66,14 @@ struct UnitSettings;
* \{ */
/**
* There are important things to note here for code using numinput:
* There are important things to note here for code using numeric-input:
* - Values passed to #applyNumInput() should be valid and are stored as default ones (val_org),
* if it is not EDITED.
* - bool returned by #applyNumInput should be used to decide whether to apply
* numinput-specific post-process to data.
* - `bool` returned by #applyNumInput should be used to decide whether to apply
* numeric-input-specific post-process to data.
* - Once #applyNumInput has been called,
* #hasNumInput returns a valid value to decide whether to use numinput as drawstr source or not
* (i.e. to call #outputNumInput).
* #hasNumInput returns a valid value to decide whether to use numinput as `drawstr`
* source or not (i.e. to call #outputNumInput).
*
* Those two steps have to be separated
* (so do not use a common call to #hasNumInput() to do both in the same time!).

View File

@ -3903,8 +3903,8 @@ static void ui_do_but_textedit(
char ascii = event->ascii;
const char *utf8_buf = event->utf8_buf;
/* exception that's useful for number buttons, some keyboard
* numpads have a comma instead of a period */
/* Exception that's useful for number buttons, some keyboard
* numpads have a comma instead of a period. */
if (ELEM(but->type, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER)) { /* Could use `data->min`. */
if (event->type == EVT_PADPERIOD && ascii == ',') {
ascii = '.';

View File

@ -3552,7 +3552,7 @@ static int edbm_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmE
return edbm_select_linked_pick_exec(C, op);
}
/* unified_finednearest needs ogl */
/* #unified_findnearest needs OpenGL. */
view3d_operator_needs_opengl(C);
/* setup view context for argument to callbacks */

View File

@ -571,7 +571,7 @@ static int multiresbake_image_exec(bContext *C, wmOperator *op)
/* ****************** render BAKING ********************** */
/* catch esc */
/** Catch escape key to cancel. */
static int objects_bake_render_modal(bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
{
/* no running blender, remove handler and pass through */

View File

@ -123,7 +123,7 @@ static void bake_progress_update(void *bjv, float progress)
}
}
/* catch esc */
/** Catch escape key to cancel. */
static int bake_modal(bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
{
/* no running blender, remove handler and pass through */

View File

@ -818,7 +818,7 @@ static void render_drawlock(void *rjv, bool lock)
}
}
/* catch esc */
/** Catch escape key to cancel. */
static int screen_render_modal(bContext *C, wmOperator *op, const wmEvent *event)
{
Scene *scene = (Scene *)op->customdata;

View File

@ -259,7 +259,7 @@ static bool render_engine_supports_ray_visibility(const Scene *sce)
return !STREQ(sce->r.engine, RE_engine_id_BLENDER_EEVEE);
}
static void switch_preview_collection_visibilty(ViewLayer *view_layer, const ePreviewType pr_type)
static void switch_preview_collection_visibility(ViewLayer *view_layer, const ePreviewType pr_type)
{
/* Set appropriate layer as visible. */
LayerCollection *lc = static_cast<LayerCollection *>(view_layer->layer_collections.first);
@ -329,7 +329,7 @@ static void set_preview_visibility(Main *pr_main,
const ePreviewType pr_type,
const ePreviewRenderMethod pr_method)
{
switch_preview_collection_visibilty(view_layer, pr_type);
switch_preview_collection_visibility(view_layer, pr_type);
switch_preview_floor_visibility(pr_main, scene, view_layer, pr_method);
BKE_layer_collection_sync(scene, view_layer);
}

View File

@ -1141,7 +1141,7 @@ static void light_cache_bake_tag_cache(Scene *scene, wmOperator *op)
}
}
/* catch esc */
/** Catch escape key to cancel. */
static int light_cache_bake_modal(bContext *C, wmOperator *op, const wmEvent *event)
{
Scene *scene = (Scene *)op->customdata;

View File

@ -33,9 +33,8 @@ typedef struct ImageFrame {
} ImageFrame;
/**
* Get a list of frames from the list of image files matching the first file
* name sequence pattern. The files and directory are read from standard
* fileselect operator properties.
* Get a list of frames from the list of image files matching the first file name sequence pattern.
* The files and directory are read from standard file-select operator properties.
*
* The output is a list of frame ranges, each containing a list of frames with matching names.
*/

View File

@ -123,12 +123,12 @@ void initTimeScale(TransInfo *t)
t->flag |= T_NULL_ONE;
t->num.val_flag[0] |= NUM_NULL_ONE;
/* num-input has max of (n-1) */
/* Numeric-input has max of (n-1). */
t->idx_max = 0;
t->num.flag = 0;
t->num.idx_max = t->idx_max;
/* initialize snap like for everything else */
/* Initialize snap like for everything else. */
t->snap[0] = t->snap[1] = 1.0f;
copy_v3_fl(t->num.val_inc, t->snap[0]);

View File

@ -203,17 +203,17 @@ void initTimeSlide(TransInfo *t)
range[1] = max;
}
/* num-input has max of (n-1) */
/* Numeric-input has max of (n-1). */
t->idx_max = 0;
t->num.flag = 0;
t->num.idx_max = t->idx_max;
/* initialize snap like for everything else */
/* Initialize snap like for everything else. */
t->snap[0] = t->snap[1] = 1.0f;
copy_v3_fl(t->num.val_inc, t->snap[0]);
t->num.unit_sys = t->scene->unit.system;
/* No time unit supporting frames currently... */
/* No time unit supporting frames currently. */
t->num.unit_type[0] = B_UNIT_NONE;
}

View File

@ -129,17 +129,17 @@ void initTimeTranslate(TransInfo *t)
initMouseInputMode(t, &t->mouse, INPUT_NONE);
/* num-input has max of (n-1) */
/* Numeric-input has max of (n-1). */
t->idx_max = 0;
t->num.flag = 0;
t->num.idx_max = t->idx_max;
/* initialize snap like for everything else */
/* Initialize snap like for everything else. */
t->snap[0] = t->snap[1] = 1.0f;
copy_v3_fl(t->num.val_inc, t->snap[0]);
t->num.unit_sys = t->scene->unit.system;
/* No time unit supporting frames currently... */
/* No time unit supporting frames currently. */
t->num.unit_type[0] = B_UNIT_NONE;
}

View File

@ -760,7 +760,7 @@ void ED_region_image_metadata_draw(
/* find window pixel coordinates of origin */
GPU_matrix_push();
/* offset and zoom using ogl */
/* Offset and zoom using GPU viewport. */
GPU_matrix_translate_2f(x, y);
GPU_matrix_scale_2f(zoomx, zoomy);

View File

@ -1625,7 +1625,7 @@ static int uv_reveal_exec(bContext *C, wmOperator *op)
/* NOTE: Selecting faces is delayed so that it doesn't select verts/edges and confuse certain
* UV selection checks.
* This creates a temporary state which breaks certain UV selection functions that do face
* visibilty checks internally. Current implementation handles each case separately. */
* visibility checks internally. Current implementation handles each case separately. */
/* call the mesh function if we are in mesh sync sel */
if (ts->uv_flag & UV_SYNC_SELECTION) {
@ -1641,7 +1641,7 @@ static int uv_reveal_exec(bContext *C, wmOperator *op)
}
/* NOTE(@sidd017): Supporting selections in all cases is quite difficult considering there are
* at least 12 cases to look into (3 mesh selectmodes + 4 uv selectmodes + sticky modes).
* at least 12 cases to look into (3 mesh select-modes + 4 uv select-modes + sticky modes).
* For now we select all UV faces as sticky disabled to ensure proper UV selection states (vert
* + edge flags) */
if (use_face_center) {

View File

@ -56,12 +56,12 @@ typedef struct bScreen {
short flag;
/** Winid from WM, starts with 1. */
short winid;
/** User-setting for which editors get redrawn during anim playback. */
/** User-setting for which editors get redrawn during animation playback. */
short redraws_flag;
/** Temp screen in a temp window, don't save (like user prefs). */
/** Temp screen in a temp window, don't save (like user-preferences). */
char temp;
/** Temp screen for image render display or fileselect. */
/** Temp screen for image render display or file-select. */
char state;
/** Notifier for drawing edges. */
char do_draw;

View File

@ -894,10 +894,9 @@ typedef struct SpaceFile {
*/
ListBase folder_histories; /* FileFolderHistory */
/* operator that is invoking fileselect
* op->exec() will be called on the 'Load' button.
* if operator provides op->cancel(), then this will be invoked
* on the cancel button.
/**
* The operator that is invoking file-select `op->exec()` will be called on the 'Load' button.
* if operator provides op->cancel(), then this will be invoked on the cancel button.
*/
struct wmOperator *op;

View File

@ -548,12 +548,14 @@ enum {
OPERATOR_RUNNING_MODAL = (1 << 0),
OPERATOR_CANCELLED = (1 << 1),
OPERATOR_FINISHED = (1 << 2),
/* add this flag if the event should pass through */
/** Add this flag if the event should pass through. */
OPERATOR_PASS_THROUGH = (1 << 3),
/* in case operator got executed outside WM code... like via fileselect */
/** In case operator got executed outside WM code (like via file-select). */
OPERATOR_HANDLED = (1 << 4),
/* used for operators that act indirectly (eg. popup menu)
* NOTE: this isn't great design (using operators to trigger UI) avoid where possible. */
/**
* Used for operators that act indirectly (eg. popup menu).
* \note this isn't great design (using operators to trigger UI) avoid where possible.
*/
OPERATOR_INTERFACE = (1 << 5),
};
#define OPERATOR_FLAGS_ALL \
@ -566,9 +568,10 @@ enum {
/** #wmOperator.flag */
enum {
/** low level flag so exec() operators can tell if they were invoked, use with care.
* Typically this shouldn't make any difference, but it rare cases its needed
* (see smooth-view) */
/**
* Low level flag so exec() operators can tell if they were invoked, use with care.
* Typically this shouldn't make any difference, but it rare cases its needed (see smooth-view).
*/
OP_IS_INVOKE = (1 << 0),
/** So we can detect if an operators exec() call is activated by adjusting the last action. */
OP_IS_REPEAT = (1 << 1),
@ -585,8 +588,10 @@ enum {
/** When the cursor is grabbed */
OP_IS_MODAL_GRAB_CURSOR = (1 << 2),
/** Allow modal operators to have the region under the cursor for their context
* (the regiontype is maintained to prevent errors) */
/**
* Allow modal operators to have the region under the cursor for their context
* (the region-type is maintained to prevent errors).
*/
OP_IS_MODAL_CURSOR_REGION = (1 << 3),
};

View File

@ -481,7 +481,7 @@ void WM_check(bContext *C)
}
if (!G.background) {
/* Case: fileread. */
/* Case: file-read. */
if ((wm->initialized & WM_WINDOW_IS_INIT) == 0) {
WM_keyconfig_init(C);
WM_autosave_init(wm);
@ -491,7 +491,7 @@ void WM_check(bContext *C)
wm_window_ghostwindows_ensure(wm);
}
/* Case: fileread. */
/* Case: file-read. */
/* NOTE: this runs in background mode to set the screen context cb. */
if ((wm->initialized & WM_WINDOW_IS_INIT) == 0) {
ED_screens_init(bmain, wm);

View File

@ -163,15 +163,15 @@ static bool opengl_is_init = false;
void WM_init_opengl(void)
{
/* must be called only once */
/* Must be called only once. */
BLI_assert(opengl_is_init == false);
if (G.background) {
/* Ghost is still not init elsewhere in background mode. */
/* Ghost is still not initialized elsewhere in background mode. */
wm_ghost_init(NULL);
}
/* Needs to be first to have an ogl context bound. */
/* Needs to be first to have an OpenGL context bound. */
DRW_opengl_context_create();
GPU_init();

View File

@ -614,10 +614,10 @@ static void wm_window_ghostwindow_ensure(wmWindowManager *wm, wmWindow *win, boo
}
if (win->ghostwin != NULL) {
/* If we have no ghostwin this is a buggy window that should be removed.
/* If we have no `ghostwin` this is a buggy window that should be removed.
* However we still need to initialize it correctly so the screen doesn't hang. */
/* happens after fileread */
/* Happens after file-read. */
wm_window_ensure_eventstate(win);
WM_window_set_dpi(win);