diff options
Diffstat (limited to 'source/blender')
10 files changed, 55 insertions, 45 deletions
diff --git a/source/blender/blenkernel/intern/crazyspace.cc b/source/blender/blenkernel/intern/crazyspace.cc index 978606ef1fa..8d4b64da817 100644 --- a/source/blender/blenkernel/intern/crazyspace.cc +++ b/source/blender/blenkernel/intern/crazyspace.cc @@ -96,7 +96,7 @@ float (*BKE_crazyspace_get_mapped_editverts(struct Depsgraph *depsgraph, Object /* disable subsurf temporal, get mapped cos, and enable it */ if (modifiers_disable_subsurf_temporary(scene_eval, obedit_eval)) { - /* need to make new derivemesh */ + /* Need to make new derived-mesh. */ makeDerivedMesh(depsgraph, scene_eval, obedit_eval, &CD_MASK_BAREMESH); } diff --git a/source/blender/blenlib/intern/mesh_boolean.cc b/source/blender/blenlib/intern/mesh_boolean.cc index d4586f95fe0..357dba154af 100644 --- a/source/blender/blenlib/intern/mesh_boolean.cc +++ b/source/blender/blenlib/intern/mesh_boolean.cc @@ -2966,10 +2966,10 @@ static std::ostream &operator<<(std::ostream &os, const FaceMergeState &fms) * \a tris all have the same original face. * Find the 2d edge/triangle topology for these triangles, but only the ones facing in the * norm direction, and whether each edge is dissolvable or not. - * If we did the initial triangulation properly, and any Delaunay triangulations of interections + * If we did the initial triangulation properly, and any Delaunay triangulations of intersections * properly, then each triangle edge should have at most one neighbor. - * However, there can be anonalies. For example, if an input face is self-intersecting, we fall - * back on the floating poing polyfill triangulation, which, after which all bets are off. + * However, there can be anomalies. For example, if an input face is self-intersecting, we fall + * back on the floating point poly-fill triangulation, which, after which all bets are off. * Hence, try to be tolerant of such unexpected topology. */ static void init_face_merge_state(FaceMergeState *fms, diff --git a/source/blender/depsgraph/intern/eval/deg_eval.cc b/source/blender/depsgraph/intern/eval/deg_eval.cc index 426e04a5cf9..89e1f1add18 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval.cc @@ -70,7 +70,7 @@ enum class EvaluationStage { * involved. */ COPY_ON_WRITE, - /* Evaluate actual ID nodes visiblity based on the current state of animation and drivers. */ + /* Evaluate actual ID nodes visibility based on the current state of animation and drivers. */ DYNAMIC_VISIBILITY, /* Threaded evaluation of all possible operations. */ @@ -136,7 +136,7 @@ bool check_operation_node_visible(const DepsgraphEvalState *state, OperationNode return true; } - /* Special case for dynamic visiblity pass: the actual visibility is not yet known, so limit to + /* Special case for dynamic visibility pass: the actual visibility is not yet known, so limit to * only operations which affects visibility. */ if (state->stage == EvaluationStage::DYNAMIC_VISIBILITY) { return op_node->flag & OperationFlag::DEPSOP_FLAG_AFFECTS_VISIBILITY; diff --git a/source/blender/draw/engines/eevee_next/eevee_view.cc b/source/blender/draw/engines/eevee_next/eevee_view.cc index 8052ea76def..55741bee4df 100644 --- a/source/blender/draw/engines/eevee_next/eevee_view.cc +++ b/source/blender/draw/engines/eevee_next/eevee_view.cc @@ -95,7 +95,7 @@ void ShadingView::render() return; } - /* Query temp textures and create framebuffers. */ + /* Query temp textures and create frame-buffers. */ /* HACK: View name should be unique and static. * With this, we can reuse the same texture across views. */ DrawEngineType *owner = (DrawEngineType *)name_; diff --git a/source/blender/draw/intern/draw_manager.h b/source/blender/draw/intern/draw_manager.h index 6d384c599d8..419b13edf1f 100644 --- a/source/blender/draw/intern/draw_manager.h +++ b/source/blender/draw/intern/draw_manager.h @@ -533,10 +533,12 @@ typedef struct DRWData { void *volume_grids_ubos; /* VolumeUniformBufPool */ /** List of smoke textures to free after drawing. */ ListBase smoke_textures; - /** Texture pool to reuse temp texture across engines. */ - /* TODO(@fclem): The pool could be shared even between view-ports. */ + /** + * Texture pool to reuse temp texture across engines. + * TODO(@fclem): The pool could be shared even between view-ports. + */ struct DRWTexturePool *texture_pool; - /** Per stereo view data. Contains engine data and default framebuffers. */ + /** Per stereo view data. Contains engine data and default frame-buffers. */ struct DRWViewData *view_data[2]; /** Per draw-call curves object data. */ struct CurvesUniformBufPool *curves_ubos; diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_density.cc b/source/blender/editors/sculpt_paint/curves_sculpt_density.cc index 6ad3d0e4aad..907c2c29c42 100644 --- a/source/blender/editors/sculpt_paint/curves_sculpt_density.cc +++ b/source/blender/editors/sculpt_paint/curves_sculpt_density.cc @@ -595,7 +595,7 @@ struct DensitySubtractOperationExecutor { return curves_to_delete[curve_i]; }); - /* Remove deleted curves fromt he stored deformed root positions. */ + /* Remove deleted curves from the stored deformed root positions. */ const Vector<IndexRange> ranges_to_keep = mask_to_delete.extract_ranges_invert( curves_->curves_range()); BLI_assert(curves_->curves_num() == self_->deformed_root_positions_.size()); diff --git a/source/blender/editors/space_image/image_undo.cc b/source/blender/editors/space_image/image_undo.cc index 986265afee0..0fe0414c177 100644 --- a/source/blender/editors/space_image/image_undo.cc +++ b/source/blender/editors/space_image/image_undo.cc @@ -22,10 +22,10 @@ #include "MEM_guardedalloc.h" #include "BLI_blenlib.h" +#include "BLI_map.hh" #include "BLI_math.h" #include "BLI_threads.h" #include "BLI_utildefines.h" -#include "BLI_map.hh" #include "DNA_image_types.h" #include "DNA_object_types.h" @@ -178,8 +178,8 @@ void *ED_image_paint_tile_find(PaintTileMap *paint_tile_map, if (r_mask) { /* allocate mask if requested. */ if (!ptile->mask) { - ptile->mask = static_cast<uint16_t *>(MEM_callocN(sizeof(uint16_t) * square_i(ED_IMAGE_UNDO_TILE_SIZE), - "UndoImageTile.mask")); + ptile->mask = static_cast<uint16_t *>( + MEM_callocN(sizeof(uint16_t) * square_i(ED_IMAGE_UNDO_TILE_SIZE), "UndoImageTile.mask")); } *r_mask = ptile->mask; } @@ -224,7 +224,7 @@ void *ED_image_paint_tile_push(PaintTileMap *paint_tile_map, *tmpibuf = imbuf_alloc_temp_tile(); } - PaintTile *ptile = static_cast<PaintTile*>(MEM_callocN(sizeof(PaintTile), "PaintTile")); + PaintTile *ptile = static_cast<PaintTile *>(MEM_callocN(sizeof(PaintTile), "PaintTile")); ptile->image = image; ptile->ibuf = ibuf; @@ -236,8 +236,8 @@ void *ED_image_paint_tile_push(PaintTileMap *paint_tile_map, /* add mask explicitly here */ if (r_mask) { - *r_mask = ptile->mask = static_cast<uint16_t*>(MEM_callocN(sizeof(uint16_t) * square_i(ED_IMAGE_UNDO_TILE_SIZE), - "PaintTile.mask")); + *r_mask = ptile->mask = static_cast<uint16_t *>( + MEM_callocN(sizeof(uint16_t) * square_i(ED_IMAGE_UNDO_TILE_SIZE), "PaintTile.mask")); } ptile->rect.pt = MEM_callocN((ibuf->rect_float ? sizeof(float[4]) : sizeof(char[4])) * @@ -361,12 +361,15 @@ struct UndoImageTile { static UndoImageTile *utile_alloc(bool has_float) { - UndoImageTile *utile = static_cast<UndoImageTile *>(MEM_callocN(sizeof(*utile), "ImageUndoTile")); + UndoImageTile *utile = static_cast<UndoImageTile *>( + MEM_callocN(sizeof(*utile), "ImageUndoTile")); if (has_float) { - utile->rect.fp = static_cast<float*>(MEM_mallocN(sizeof(float[4]) * square_i(ED_IMAGE_UNDO_TILE_SIZE), __func__)); + utile->rect.fp = static_cast<float *>( + MEM_mallocN(sizeof(float[4]) * square_i(ED_IMAGE_UNDO_TILE_SIZE), __func__)); } else { - utile->rect.uint_ptr = static_cast<uint32_t*>(MEM_mallocN(sizeof(uint32_t) * square_i(ED_IMAGE_UNDO_TILE_SIZE), __func__)); + utile->rect.uint_ptr = static_cast<uint32_t *>( + MEM_mallocN(sizeof(uint32_t) * square_i(ED_IMAGE_UNDO_TILE_SIZE), __func__)); } return utile; } @@ -458,7 +461,7 @@ typedef struct UndoImageBuf { static UndoImageBuf *ubuf_from_image_no_tiles(Image *image, const ImBuf *ibuf) { - UndoImageBuf *ubuf = static_cast<UndoImageBuf*>(MEM_callocN(sizeof(*ubuf), __func__)); + UndoImageBuf *ubuf = static_cast<UndoImageBuf *>(MEM_callocN(sizeof(*ubuf), __func__)); ubuf->image_dims[0] = ibuf->x; ubuf->image_dims[1] = ibuf->y; @@ -467,7 +470,8 @@ static UndoImageBuf *ubuf_from_image_no_tiles(Image *image, const ImBuf *ibuf) ubuf->tiles_dims[1] = ED_IMAGE_UNDO_TILE_NUMBER(ubuf->image_dims[1]); ubuf->tiles_len = ubuf->tiles_dims[0] * ubuf->tiles_dims[1]; - ubuf->tiles = static_cast<UndoImageTile**>(MEM_callocN(sizeof(*ubuf->tiles) * ubuf->tiles_len, __func__)); + ubuf->tiles = static_cast<UndoImageTile **>( + MEM_callocN(sizeof(*ubuf->tiles) * ubuf->tiles_len, __func__)); BLI_strncpy(ubuf->ibuf_name, ibuf->name, sizeof(ubuf->ibuf_name)); ubuf->image_state.gen_type = image->gen_type; @@ -598,14 +602,14 @@ static void uhandle_restore_list(ListBase *undo_handles, bool use_init) if (changed) { BKE_image_mark_dirty(image, ibuf); - /* TODO(jbakker): only mark areas that are actually updated to improve performance. */ + /* TODO(@jbakker): only mark areas that are actually updated to improve performance. */ BKE_image_partial_update_mark_full_update(image); if (ibuf->rect_float) { - ibuf->userflags |= IB_RECT_INVALID; /* force recreate of char rect */ + ibuf->userflags |= IB_RECT_INVALID; /* Force recreate of char `rect` */ } if (ibuf->mipmap[0]) { - ibuf->userflags |= IB_MIPMAP_INVALID; /* force mip-map recreation. */ + ibuf->userflags |= IB_MIPMAP_INVALID; /* Force MIP-MAP recreation. */ } ibuf->userflags |= IB_DISPLAY_BUFFER_INVALID; @@ -693,7 +697,7 @@ static UndoImageHandle *uhandle_lookup(ListBase *undo_handles, const Image *imag static UndoImageHandle *uhandle_add(ListBase *undo_handles, Image *image, ImageUser *iuser) { BLI_assert(uhandle_lookup(undo_handles, image, iuser->tile) == nullptr); - UndoImageHandle *uh = static_cast<UndoImageHandle*>(MEM_callocN(sizeof(*uh), __func__)); + UndoImageHandle *uh = static_cast<UndoImageHandle *>(MEM_callocN(sizeof(*uh), __func__)); uh->image_ref.ptr = image; uh->iuser = *iuser; uh->iuser.scene = nullptr; @@ -726,7 +730,7 @@ struct ImageUndoStep { * #PaintTile * Run-time only data (active during a paint stroke). */ - PaintTileMap* paint_tile_map; + PaintTileMap *paint_tile_map; bool is_encode_init; ePaintMode paint_mode; @@ -801,7 +805,8 @@ static bool image_undosys_step_encode(struct bContext *C, ImBuf *tmpibuf = imbuf_alloc_temp_tile(); - ImageUndoStep *us_reference = reinterpret_cast<ImageUndoStep *>(ED_undo_stack_get()->step_active); + ImageUndoStep *us_reference = reinterpret_cast<ImageUndoStep *>( + ED_undo_stack_get()->step_active); while (us_reference && us_reference->step.type != BKE_UNDOSYS_TYPE_IMAGE) { us_reference = reinterpret_cast<ImageUndoStep *>(us_reference->step.prev); } @@ -812,7 +817,8 @@ static bool image_undosys_step_encode(struct bContext *C, UndoImageHandle *uh = uhandle_ensure(&us->handles, ptile->image, &ptile->iuser); UndoImageBuf *ubuf_pre = uhandle_ensure_ubuf(uh, ptile->image, ptile->ibuf); - UndoImageTile *utile = static_cast<UndoImageTile *>(MEM_callocN(sizeof(*utile), "UndoImageTile")); + UndoImageTile *utile = static_cast<UndoImageTile *>( + MEM_callocN(sizeof(*utile), "UndoImageTile")); utile->users = 1; utile->rect.pt = ptile->rect.pt; ptile->rect.pt = nullptr; @@ -853,10 +859,11 @@ static bool image_undosys_step_encode(struct bContext *C, for (uint x_tile = 0; x_tile < ubuf_pre->tiles_dims[0]; x_tile += 1) { uint x = x_tile << ED_IMAGE_UNDO_TILE_BITS; - if ((ubuf_reference != nullptr) && ((ubuf_pre->tiles[i] == nullptr) || - /* In this case the paint stroke as has added a tile - * which we have a duplicate reference available. */ - (ubuf_pre->tiles[i]->users == 1))) { + if ((ubuf_reference != nullptr) && + ((ubuf_pre->tiles[i] == nullptr) || + /* In this case the paint stroke as has added a tile + * which we have a duplicate reference available. */ + (ubuf_pre->tiles[i]->users == 1))) { if (ubuf_pre->tiles[i] != nullptr) { /* If we have a reference, re-use this single use tile for the post state. */ BLI_assert(ubuf_pre->tiles[i]->users == 1); @@ -1102,7 +1109,8 @@ void ED_image_undo_push_begin_with_image(const char *name, UndoImageBuf *ubuf_pre = uhandle_ensure_ubuf(uh, image, ibuf); BLI_assert(ubuf_pre->post == nullptr); - ImageUndoStep *us_reference = reinterpret_cast<ImageUndoStep *>(ED_undo_stack_get()->step_active); + ImageUndoStep *us_reference = reinterpret_cast<ImageUndoStep *>( + ED_undo_stack_get()->step_active); while (us_reference && us_reference->step.type != BKE_UNDOSYS_TYPE_IMAGE) { us_reference = reinterpret_cast<ImageUndoStep *>(us_reference->step.prev); } diff --git a/source/blender/editors/space_outliner/outliner_tools.cc b/source/blender/editors/space_outliner/outliner_tools.cc index 80ee3bbb6a1..87604818ee1 100644 --- a/source/blender/editors/space_outliner/outliner_tools.cc +++ b/source/blender/editors/space_outliner/outliner_tools.cc @@ -790,11 +790,11 @@ struct OutlinerLiboverrideDataIDRoot { * known/created. */ ID *id_hierarchy_root_override; - /** The ID that was detected as being a good candidate as instanciation hint for newly overridden + /** The ID that was detected as being a good candidate as instantiation hint for newly overridden * objects, may be null. * * \note Typically currently only used when the root ID to override is a collection instanced by - * an emtpy object. */ + * an empty object. */ ID *id_instance_hint; /** If this override comes from an instancing object (which would be `id_instance_hint` then). */ diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index 66ed36b373d..1bb405d1abc 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -957,7 +957,7 @@ static void wm_draw_window_offscreen(bContext *C, wmWindow *win, bool stereo) GPU_debug_group_end(); } - /* Draw menus into their own framebuffer. */ + /* Draw menus into their own frame-buffer. */ LISTBASE_FOREACH (ARegion *, region, &screen->regionbase) { if (!region->visible) { continue; @@ -994,7 +994,7 @@ static void wm_draw_window_onscreen(bContext *C, wmWindow *win, int view) GPU_debug_group_begin("Window Redraw"); - /* Draw into the window framebuffer, in full window coordinates. */ + /* Draw into the window frame-buffer, in full window coordinates. */ wmWindowViewport(win); /* We draw on all pixels of the windows so we don't need to clear them before. @@ -1106,17 +1106,17 @@ static void wm_draw_window(bContext *C, wmWindow *win) /* Avoid any BGL call issued before this to alter the window drawin. */ GPU_bgl_end(); - /* Draw area regions into their own framebuffer. This way we can redraw - * the areas that need it, and blit the rest from existing framebuffers. */ + /* Draw area regions into their own frame-buffer. This way we can redraw + * the areas that need it, and blit the rest from existing frame-buffers. */ wm_draw_window_offscreen(C, win, stereo); - /* Now we draw into the window framebuffer, in full window coordinates. */ + /* Now we draw into the window frame-buffer, in full window coordinates. */ if (!stereo) { /* Regular mono drawing. */ wm_draw_window_onscreen(C, win, -1); } else if (win->stereo3d_format->display_mode == S3D_DISPLAY_PAGEFLIP) { - /* For pageflip we simply draw to both back buffers. */ + /* For page-flip we simply draw to both back buffers. */ GPU_backbuffer_bind(GPU_BACKBUFFER_RIGHT); wm_draw_window_onscreen(C, win, 1); @@ -1125,12 +1125,12 @@ static void wm_draw_window(bContext *C, wmWindow *win) } else if (ELEM(win->stereo3d_format->display_mode, S3D_DISPLAY_ANAGLYPH, S3D_DISPLAY_INTERLACE)) { /* For anaglyph and interlace, we draw individual regions with - * stereo framebuffers using different shaders. */ + * stereo frame-buffers using different shaders. */ wm_draw_window_onscreen(C, win, -1); } else { /* For side-by-side and top-bottom, we need to render each view to an - * an offscreen texture and then draw it. This used to happen for all + * an off-screen texture and then draw it. This used to happen for all * stereo methods, but it's less efficient than drawing directly. */ const int width = WM_window_pixels_x(win); const int height = WM_window_pixels_y(win); diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index d2182f759e5..a1ebe1fc76f 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -510,7 +510,7 @@ static void wm_window_ghostwindow_add(wmWindowManager *wm, wmWindow *win, bool is_dialog) { - /* a new window is created when pageflip mode is required for a window */ + /* A new window is created when page-flip mode is required for a window. */ GHOST_GLSettings glSettings = {0}; if (win->stereo3d_format->display_mode == S3D_DISPLAY_PAGEFLIP) { glSettings.flags |= GHOST_glStereoVisual; |