diff options
author | Hans Goudey <h.goudey@me.com> | 2022-10-05 21:44:02 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-10-05 21:48:01 +0300 |
commit | 548a2cbe06b23d90b0e09da49fc854178c270b8a (patch) | |
tree | 8706b5be97ace0ff0ca18d4109586ccb5cf0a666 /source/blender/draw | |
parent | 6306d747b770685f38f95bc57f8681335ddfa506 (diff) |
Cleanup: Clang tidy
Also remove unnecessary struct keywords in C++ files.
Diffstat (limited to 'source/blender/draw')
9 files changed, 72 insertions, 79 deletions
diff --git a/source/blender/draw/engines/eevee_next/eevee_engine.cc b/source/blender/draw/engines/eevee_next/eevee_engine.cc index 214f6a001f0..3ea6ea475d0 100644 --- a/source/blender/draw/engines/eevee_next/eevee_engine.cc +++ b/source/blender/draw/engines/eevee_next/eevee_engine.cc @@ -165,9 +165,7 @@ static void eevee_render_to_image(void *vedata, instance->render_frame(layer, viewname); EEVEE_Data *ved = static_cast<EEVEE_Data *>(vedata); - if (ved->instance) { - delete ved->instance; - } + delete ved->instance; ved->instance = instance; } diff --git a/source/blender/draw/engines/overlay/overlay_antialiasing.cc b/source/blender/draw/engines/overlay/overlay_antialiasing.cc index 2242ad8b609..2eefdce403c 100644 --- a/source/blender/draw/engines/overlay/overlay_antialiasing.cc +++ b/source/blender/draw/engines/overlay/overlay_antialiasing.cc @@ -53,7 +53,7 @@ void OVERLAY_antialiasing_init(OVERLAY_Data *vedata) DefaultTextureList *dtxl = DRW_viewport_texture_list_get(); /* Small texture which will have very small impact on render-time. */ - if (txl->dummy_depth_tx == NULL) { + if (txl->dummy_depth_tx == nullptr) { const float pixel[1] = {1.0f}; txl->dummy_depth_tx = DRW_texture_create_2d( 1, 1, GPU_DEPTH_COMPONENT24, DRWTextureFlag(0), pixel); @@ -68,8 +68,8 @@ void OVERLAY_antialiasing_init(OVERLAY_Data *vedata) pd->antialiasing.enabled = need_wire_expansion || ((U.gpu_flag & USER_GPU_FLAG_OVERLAY_SMOOTH_WIRE) != 0); - GPUTexture *color_tex = NULL; - GPUTexture *line_tex = NULL; + GPUTexture *color_tex = nullptr; + GPUTexture *line_tex = nullptr; if (pd->antialiasing.enabled) { DRW_texture_ensure_fullscreen_2d(&txl->overlay_color_tx, GPU_SRGB8_A8, DRW_TEX_FILTER); @@ -107,7 +107,7 @@ void OVERLAY_antialiasing_cache_init(OVERLAY_Data *vedata) OVERLAY_PrivateData *pd = vedata->stl->pd; OVERLAY_PassList *psl = vedata->psl; DefaultTextureList *dtxl = DRW_viewport_texture_list_get(); - struct GPUShader *sh; + GPUShader *sh; DRWShadingGroup *grp; if (pd->antialiasing.enabled) { @@ -124,7 +124,7 @@ void OVERLAY_antialiasing_cache_init(OVERLAY_Data *vedata) DRW_shgroup_uniform_texture_ref(grp, "depthTex", &dtxl->depth); DRW_shgroup_uniform_texture_ref(grp, "colorTex", &txl->overlay_color_tx); DRW_shgroup_uniform_texture_ref(grp, "lineTex", &txl->overlay_line_tx); - DRW_shgroup_call_procedural_triangles(grp, NULL, 1); + DRW_shgroup_call_procedural_triangles(grp, nullptr, 1); } /* A bit out of place... not related to antialiasing. */ @@ -136,7 +136,7 @@ void OVERLAY_antialiasing_cache_init(OVERLAY_Data *vedata) DRW_shgroup_uniform_texture_ref(grp, "depthTex", &dtxl->depth); DRW_shgroup_uniform_texture_ref(grp, "xrayDepthTex", &txl->temp_depth_tx); DRW_shgroup_uniform_float_copy(grp, "opacity", 1.0f - pd->xray_opacity); - DRW_shgroup_call_procedural_triangles(grp, NULL, 1); + DRW_shgroup_call_procedural_triangles(grp, nullptr, 1); } } @@ -169,10 +169,10 @@ void OVERLAY_antialiasing_cache_finish(OVERLAY_Data *vedata) GPU_ATTACHMENT_TEXTURE(txl->overlay_line_tx)}); } - pd->antialiasing.do_depth_copy = !(psl->wireframe_ps == NULL || + pd->antialiasing.do_depth_copy = !(psl->wireframe_ps == nullptr || DRW_pass_is_empty(psl->wireframe_ps)) || (pd->xray_enabled && pd->xray_opacity > 0.0f); - pd->antialiasing.do_depth_infront_copy = !(psl->wireframe_xray_ps == NULL || + pd->antialiasing.do_depth_infront_copy = !(psl->wireframe_xray_ps == nullptr || DRW_pass_is_empty(psl->wireframe_xray_ps)); const bool do_wireframe = pd->antialiasing.do_depth_copy || diff --git a/source/blender/draw/engines/overlay/overlay_armature.cc b/source/blender/draw/engines/overlay/overlay_armature.cc index 45bdc9cd123..0cf9d91804a 100644 --- a/source/blender/draw/engines/overlay/overlay_armature.cc +++ b/source/blender/draw/engines/overlay/overlay_armature.cc @@ -5,9 +5,9 @@ * \ingroup draw_engine */ -#include <math.h> -#include <stdlib.h> -#include <string.h> +#include <cmath> +#include <cstdlib> +#include <cstring> #include "DNA_armature_types.h" #include "DNA_constraint_types.h" @@ -46,7 +46,7 @@ #define PT_DEFAULT_RAD 0.05f /* radius of the point batch. */ -typedef struct ArmatureDrawContext { +struct ArmatureDrawContext { /* Current armature object */ Object *ob; /* bArmature *arm; */ /* TODO */ @@ -87,7 +87,7 @@ typedef struct ArmatureDrawContext { bool show_relations; const ThemeWireColor *bcolor; /* pchan color */ -} ArmatureDrawContext; +}; bool OVERLAY_armature_is_pose_mode(Object *ob, const DRWContextState *draw_ctx) { @@ -135,7 +135,7 @@ void OVERLAY_armature_cache_init(OVERLAY_Data *vedata) DRW_PASS_CREATE(psl->armature_bone_select_ps, state | pd->clipping_state); float alpha = pd->overlay.xray_alpha_bone; - struct GPUShader *sh = OVERLAY_shader_uniform_color(); + GPUShader *sh = OVERLAY_shader_uniform_color(); DRWShadingGroup *grp; pd->armature_bone_select_act_grp = grp = DRW_shgroup_create(sh, psl->armature_bone_select_ps); @@ -148,8 +148,8 @@ void OVERLAY_armature_cache_init(OVERLAY_Data *vedata) } for (int i = 0; i < 2; i++) { - struct GPUShader *sh; - struct GPUVertFormat *format; + GPUShader *sh; + GPUVertFormat *format; DRWShadingGroup *grp = nullptr; OVERLAY_InstanceFormats *formats = OVERLAY_shader_instance_formats_get(); @@ -620,7 +620,7 @@ extern "C" void drw_batch_cache_generate_requested_delayed(Object *custom); BLI_INLINE DRWCallBuffer *custom_bone_instance_shgroup(ArmatureDrawContext *ctx, DRWShadingGroup *grp, - struct GPUBatch *custom_geom) + GPUBatch *custom_geom) { DRWCallBuffer *buf = static_cast<DRWCallBuffer *>( BLI_ghash_lookup(ctx->custom_shapes_ghash, custom_geom)); @@ -644,9 +644,9 @@ static void drw_shgroup_bone_custom_solid_mesh(ArmatureDrawContext *ctx, * to assure batch cache is valid. */ DRW_mesh_batch_cache_validate(custom, mesh); - struct GPUBatch *surf = DRW_mesh_batch_cache_get_surface(mesh); - struct GPUBatch *edges = DRW_mesh_batch_cache_get_edge_detection(mesh, nullptr); - struct GPUBatch *ledges = DRW_mesh_batch_cache_get_loose_edges(mesh); + GPUBatch *surf = DRW_mesh_batch_cache_get_surface(mesh); + GPUBatch *edges = DRW_mesh_batch_cache_get_edge_detection(mesh, nullptr); + GPUBatch *ledges = DRW_mesh_batch_cache_get_loose_edges(mesh); BoneInstanceData inst_data; DRWCallBuffer *buf; @@ -688,7 +688,7 @@ static void drw_shgroup_bone_custom_mesh_wire(ArmatureDrawContext *ctx, * to assure batch cache is valid. */ DRW_mesh_batch_cache_validate(custom, mesh); - struct GPUBatch *geom = DRW_mesh_batch_cache_get_all_edges(mesh); + GPUBatch *geom = DRW_mesh_batch_cache_get_all_edges(mesh); if (geom) { DRWCallBuffer *buf = custom_bone_instance_shgroup(ctx, ctx->custom_wire, geom); BoneInstanceData inst_data; @@ -714,7 +714,7 @@ static void drw_shgroup_custom_bone_curve(ArmatureDrawContext *ctx, /* This only handles curves without any surface. The other curve types should have been converted * to meshes and rendered in the mesh drawing function. */ - struct GPUBatch *ledges = nullptr; + GPUBatch *ledges = nullptr; if (custom->type == OB_FONT) { ledges = DRW_cache_text_edge_wire_get(custom); } @@ -2066,7 +2066,7 @@ static void draw_bone_name(ArmatureDrawContext *ctx, bArmature *arm, const int boneflag) { - struct DRWTextStore *dt = DRW_text_cache_ensure(); + DRWTextStore *dt = DRW_text_cache_ensure(); uchar color[4]; float vec[3]; @@ -2579,7 +2579,7 @@ void OVERLAY_pose_cache_populate(OVERLAY_Data *vedata, Object *ob) { OVERLAY_PrivateData *pd = vedata->stl->pd; - struct GPUBatch *geom = DRW_cache_object_surface_get(ob); + GPUBatch *geom = DRW_cache_object_surface_get(ob); if (geom) { if (POSE_is_driven_by_active_armature(ob)) { DRW_shgroup_call(pd->armature_bone_select_act_grp, geom, ob); diff --git a/source/blender/draw/engines/overlay/overlay_edit_uv.cc b/source/blender/draw/engines/overlay/overlay_edit_uv.cc index 2b1af67175e..0fcbe5ab07d 100644 --- a/source/blender/draw/engines/overlay/overlay_edit_uv.cc +++ b/source/blender/draw/engines/overlay/overlay_edit_uv.cc @@ -36,11 +36,11 @@ /* Forward declarations. */ static void overlay_edit_uv_cache_populate(OVERLAY_Data *vedata, Object *ob); -typedef struct OVERLAY_StretchingAreaTotals { +struct OVERLAY_StretchingAreaTotals { void *next, *prev; float *total_area; float *total_area_uv; -} OVERLAY_StretchingAreaTotals; +}; static OVERLAY_UVLineStyle edit_uv_line_style_from_space_image(const SpaceImage *sima) { @@ -328,7 +328,7 @@ void OVERLAY_edit_uv_cache_init(OVERLAY_Data *vedata) } if (pd->edit_uv.do_tiled_image_overlay) { - struct DRWTextStore *dt = DRW_text_cache_ensure(); + DRWTextStore *dt = DRW_text_cache_ensure(); uchar color[4]; /* Color Management: Exception here as texts are drawn in sRGB space directly. */ UI_GetThemeColorShade4ubv(TH_BACK, 60, color); diff --git a/source/blender/draw/engines/overlay/overlay_engine.cc b/source/blender/draw/engines/overlay/overlay_engine.cc index c2c4706138f..f1fdfe98fdc 100644 --- a/source/blender/draw/engines/overlay/overlay_engine.cc +++ b/source/blender/draw/engines/overlay/overlay_engine.cc @@ -724,7 +724,7 @@ static void OVERLAY_draw_scene(void *vedata) OVERLAY_antialiasing_end(data); } -static void OVERLAY_engine_free(void) +static void OVERLAY_engine_free() { OVERLAY_shader_free(); } diff --git a/source/blender/draw/engines/overlay/overlay_extra.cc b/source/blender/draw/engines/overlay/overlay_extra.cc index f0665f7e90f..724ebd64e16 100644 --- a/source/blender/draw/engines/overlay/overlay_extra.cc +++ b/source/blender/draw/engines/overlay/overlay_extra.cc @@ -60,8 +60,8 @@ void OVERLAY_extra_cache_init(OVERLAY_Data *vedata) DRW_PASS_CREATE(psl->extra_grid_ps, state | pd->clipping_state); DefaultTextureList *dtxl = DRW_viewport_texture_list_get(); DRWShadingGroup *grp; - struct GPUShader *sh = OVERLAY_shader_extra_grid(); - struct GPUTexture *tex = DRW_state_is_fbo() ? dtxl->depth : txl->dummy_depth_tx; + GPUShader *sh = OVERLAY_shader_extra_grid(); + GPUTexture *tex = DRW_state_is_fbo() ? dtxl->depth : txl->dummy_depth_tx; pd->extra_grid_grp = grp = DRW_shgroup_create(sh, psl->extra_grid_ps); DRW_shgroup_uniform_texture(grp, "depthBuffer", tex); @@ -71,8 +71,8 @@ void OVERLAY_extra_cache_init(OVERLAY_Data *vedata) for (int i = 0; i < 2; i++) { /* Non Meshes Pass (Camera, empties, lights ...) */ - struct GPUShader *sh; - struct GPUVertFormat *format; + GPUShader *sh; + GPUVertFormat *format; DRWShadingGroup *grp, *grp_sub; OVERLAY_InstanceFormats *formats = OVERLAY_shader_instance_formats_get(); @@ -248,7 +248,7 @@ OVERLAY_ExtraCallBuffers *OVERLAY_extra_call_buffer_get(OVERLAY_Data *vedata, Ob } void OVERLAY_extra_loose_points(OVERLAY_ExtraCallBuffers *cb, - struct GPUBatch *geom, + GPUBatch *geom, const float mat[4][4], const float color[4]) { @@ -258,7 +258,7 @@ void OVERLAY_extra_loose_points(OVERLAY_ExtraCallBuffers *cb, } void OVERLAY_extra_wire(OVERLAY_ExtraCallBuffers *cb, - struct GPUBatch *geom, + GPUBatch *geom, const float mat[4][4], const float color[4]) { @@ -806,7 +806,7 @@ void OVERLAY_speaker_cache_populate(OVERLAY_Data *vedata, Object *ob) /** \name Camera * \{ */ -typedef union OVERLAY_CameraInstanceData { +union OVERLAY_CameraInstanceData { /* Pack render data into object matrix and object color. */ struct { float color[4]; @@ -842,7 +842,7 @@ typedef union OVERLAY_CameraInstanceData { float mist_end; }; }; -} OVERLAY_CameraInstanceData; +}; static void camera_view3d_reconstruction( OVERLAY_ExtraCallBuffers *cb, Scene *scene, View3D *v3d, Object *ob, const float color[4]) @@ -946,7 +946,7 @@ static void camera_view3d_reconstruction( } if ((v3d->flag2 & V3D_SHOW_BUNDLENAME) && !is_select) { - struct DRWTextStore *dt = DRW_text_cache_ensure(); + DRWTextStore *dt = DRW_text_cache_ensure(); DRW_text_cache_add(dt, bundle_mat[3], @@ -1333,7 +1333,7 @@ static void OVERLAY_relationship_lines(OVERLAY_ExtraCallBuffers *cb, OVERLAY_extra_line_dashed(cb, ct->matrix[3], ob->obmat[3], constraint_color); } - BKE_constraint_targets_flush(curcon, &targets, 1); + BKE_constraint_targets_flush(curcon, &targets, true); } } } @@ -1507,7 +1507,7 @@ static void OVERLAY_object_center(OVERLAY_ExtraCallBuffers *cb, static void OVERLAY_object_name(Object *ob, int theme_id) { - struct DRWTextStore *dt = DRW_text_cache_ensure(); + DRWTextStore *dt = DRW_text_cache_ensure(); uchar color[4]; /* Color Management: Exception here as texts are drawn in sRGB space directly. */ UI_GetThemeColor4ubv(theme_id, color); diff --git a/source/blender/draw/intern/draw_cache_impl_pointcloud.cc b/source/blender/draw/intern/draw_cache_impl_pointcloud.cc index 9a8f48b33fa..98531637e57 100644 --- a/source/blender/draw/intern/draw_cache_impl_pointcloud.cc +++ b/source/blender/draw/intern/draw_cache_impl_pointcloud.cc @@ -7,7 +7,7 @@ * \brief PointCloud API for render engines */ -#include <string.h> +#include <cstring> #include "MEM_guardedalloc.h" diff --git a/source/blender/draw/intern/draw_manager_data.cc b/source/blender/draw/intern/draw_manager_data.cc index 4ab522952b4..0974f5d14b1 100644 --- a/source/blender/draw/intern/draw_manager_data.cc +++ b/source/blender/draw/intern/draw_manager_data.cc @@ -1009,7 +1009,7 @@ static void drw_command_set_mutable_state(DRWShadingGroup *shgroup, void DRW_shgroup_call_ex(DRWShadingGroup *shgroup, Object *ob, float (*obmat)[4], - struct GPUBatch *geom, + GPUBatch *geom, bool bypass_culling, void *user_data) { @@ -1036,7 +1036,7 @@ void DRW_shgroup_call_ex(DRWShadingGroup *shgroup, } void DRW_shgroup_call_range( - DRWShadingGroup *shgroup, struct Object *ob, GPUBatch *geom, uint v_sta, uint v_num) + DRWShadingGroup *shgroup, Object *ob, GPUBatch *geom, uint v_sta, uint v_num) { BLI_assert(geom != nullptr); if (G.f & G_FLAG_PICKSEL) { @@ -1047,7 +1047,7 @@ void DRW_shgroup_call_range( } void DRW_shgroup_call_instance_range( - DRWShadingGroup *shgroup, Object *ob, struct GPUBatch *geom, uint i_sta, uint i_num) + DRWShadingGroup *shgroup, Object *ob, GPUBatch *geom, uint i_sta, uint i_num) { BLI_assert(geom != nullptr); if (G.f & G_FLAG_PICKSEL) { @@ -1105,19 +1105,19 @@ static void drw_shgroup_call_procedural_add_ex(DRWShadingGroup *shgroup, void DRW_shgroup_call_procedural_points(DRWShadingGroup *shgroup, Object *ob, uint point_count) { - struct GPUBatch *geom = drw_cache_procedural_points_get(); + GPUBatch *geom = drw_cache_procedural_points_get(); drw_shgroup_call_procedural_add_ex(shgroup, geom, ob, point_count); } void DRW_shgroup_call_procedural_lines(DRWShadingGroup *shgroup, Object *ob, uint line_count) { - struct GPUBatch *geom = drw_cache_procedural_lines_get(); + GPUBatch *geom = drw_cache_procedural_lines_get(); drw_shgroup_call_procedural_add_ex(shgroup, geom, ob, line_count * 2); } void DRW_shgroup_call_procedural_triangles(DRWShadingGroup *shgroup, Object *ob, uint tri_count) { - struct GPUBatch *geom = drw_cache_procedural_triangles_get(); + GPUBatch *geom = drw_cache_procedural_triangles_get(); drw_shgroup_call_procedural_add_ex(shgroup, geom, ob, tri_count * 3); } @@ -1126,7 +1126,7 @@ void DRW_shgroup_call_procedural_indirect(DRWShadingGroup *shgroup, Object *ob, GPUStorageBuf *indirect_buf) { - struct GPUBatch *geom = nullptr; + GPUBatch *geom = nullptr; switch (primitive_type) { case GPU_PRIM_POINTS: geom = drw_cache_procedural_points_get(); @@ -1153,10 +1153,7 @@ void DRW_shgroup_call_procedural_indirect(DRWShadingGroup *shgroup, drw_command_draw_indirect(shgroup, geom, handle, indirect_buf); } -void DRW_shgroup_call_instances(DRWShadingGroup *shgroup, - Object *ob, - struct GPUBatch *geom, - uint count) +void DRW_shgroup_call_instances(DRWShadingGroup *shgroup, Object *ob, GPUBatch *geom, uint count) { BLI_assert(geom != nullptr); if (G.f & G_FLAG_PICKSEL) { @@ -1168,8 +1165,8 @@ void DRW_shgroup_call_instances(DRWShadingGroup *shgroup, void DRW_shgroup_call_instances_with_attrs(DRWShadingGroup *shgroup, Object *ob, - struct GPUBatch *geom, - struct GPUBatch *inst_attributes) + GPUBatch *geom, + GPUBatch *inst_attributes) { BLI_assert(geom != nullptr); BLI_assert(inst_attributes != nullptr); @@ -1183,7 +1180,7 @@ void DRW_shgroup_call_instances_with_attrs(DRWShadingGroup *shgroup, } #define SCULPT_DEBUG_BUFFERS (G.debug_value == 889) -typedef struct DRWSculptCallbackData { +struct DRWSculptCallbackData { Object *ob; DRWShadingGroup **shading_groups; int num_shading_groups; @@ -1196,7 +1193,7 @@ typedef struct DRWSculptCallbackData { int debug_node_nr; PBVHAttrReq *attrs; int attrs_num; -} DRWSculptCallbackData; +}; #define SCULPT_DEBUG_COLOR(id) (sculpt_debug_colors[id % 9]) static float sculpt_debug_colors[9][4] = { @@ -1514,7 +1511,7 @@ void DRW_shgroup_call_sculpt_with_materials(DRWShadingGroup **shgroups, static GPUVertFormat inst_select_format = {0}; DRWCallBuffer *DRW_shgroup_call_buffer(DRWShadingGroup *shgroup, - struct GPUVertFormat *format, + GPUVertFormat *format, GPUPrimType prim_type) { BLI_assert(ELEM(prim_type, GPU_PRIM_POINTS, GPU_PRIM_LINES, GPU_PRIM_TRI_FAN)); @@ -1544,7 +1541,7 @@ DRWCallBuffer *DRW_shgroup_call_buffer(DRWShadingGroup *shgroup, } DRWCallBuffer *DRW_shgroup_call_buffer_instance(DRWShadingGroup *shgroup, - struct GPUVertFormat *format, + GPUVertFormat *format, GPUBatch *geom) { BLI_assert(geom != nullptr); @@ -1740,7 +1737,7 @@ static void drw_shgroup_init(DRWShadingGroup *shgroup, GPUShader *shader) BLI_assert(GPU_shader_get_builtin_uniform(shader, GPU_UNIFORM_MVP) == -1); } -static DRWShadingGroup *drw_shgroup_create_ex(struct GPUShader *shader, DRWPass *pass) +static DRWShadingGroup *drw_shgroup_create_ex(GPUShader *shader, DRWPass *pass) { DRWShadingGroup *shgroup = static_cast<DRWShadingGroup *>( BLI_memblock_alloc(DST.vmempool->shgroups)); @@ -1785,7 +1782,7 @@ static void drw_shgroup_material_texture(DRWShadingGroup *grp, GPU_texture_ref(gputex); } -void DRW_shgroup_add_material_resources(DRWShadingGroup *grp, struct GPUMaterial *material) +void DRW_shgroup_add_material_resources(DRWShadingGroup *grp, GPUMaterial *material) { ListBase textures = GPU_material_textures(material); @@ -1849,7 +1846,7 @@ GPUVertFormat *DRW_shgroup_instance_format_array(const DRWInstanceAttrFormat att return format; } -DRWShadingGroup *DRW_shgroup_material_create(struct GPUMaterial *material, DRWPass *pass) +DRWShadingGroup *DRW_shgroup_material_create(GPUMaterial *material, DRWPass *pass) { GPUPass *gpupass = GPU_material_get_pass(material); DRWShadingGroup *shgroup = drw_shgroup_material_create_ex(gpupass, pass); @@ -1861,14 +1858,14 @@ DRWShadingGroup *DRW_shgroup_material_create(struct GPUMaterial *material, DRWPa return shgroup; } -DRWShadingGroup *DRW_shgroup_create(struct GPUShader *shader, DRWPass *pass) +DRWShadingGroup *DRW_shgroup_create(GPUShader *shader, DRWPass *pass) { DRWShadingGroup *shgroup = drw_shgroup_create_ex(shader, pass); drw_shgroup_init(shgroup, shader); return shgroup; } -DRWShadingGroup *DRW_shgroup_transform_feedback_create(struct GPUShader *shader, +DRWShadingGroup *DRW_shgroup_transform_feedback_create(GPUShader *shader, DRWPass *pass, GPUVertBuf *tf_target) { @@ -2220,7 +2217,7 @@ DRWView *DRW_view_create(const float viewmat[4][4], if (DST.draw_ctx.evil_C && DST.draw_ctx.region) { int region_origin[2] = {DST.draw_ctx.region->winrct.xmin, DST.draw_ctx.region->winrct.ymin}; - struct wmWindow *win = CTX_wm_window(DST.draw_ctx.evil_C); + wmWindow *win = CTX_wm_window(DST.draw_ctx.evil_C); wm_cursor_position_get(win, &view->storage.mouse_pixel[0], &view->storage.mouse_pixel[1]); sub_v2_v2v2_int(view->storage.mouse_pixel, view->storage.mouse_pixel, region_origin); } diff --git a/source/blender/draw/intern/draw_pbvh.cc b/source/blender/draw/intern/draw_pbvh.cc index 287270079e5..4170285e1d9 100644 --- a/source/blender/draw/intern/draw_pbvh.cc +++ b/source/blender/draw/intern/draw_pbvh.cc @@ -8,17 +8,24 @@ * Embeds GPU meshes inside of PBVH nodes, used by mesh sculpt mode. */ -#include <limits.h> -#include <stddef.h> -#include <stdlib.h> -#include <string.h> +#include <algorithm> +#include <climits> +#include <cstddef> +#include <cstdlib> +#include <cstring> +#include <string> +#include <vector> #include "MEM_guardedalloc.h" #include "BLI_bitmap.h" #include "BLI_ghash.h" +#include "BLI_index_range.hh" +#include "BLI_map.hh" #include "BLI_math_color.h" +#include "BLI_math_vec_types.hh" #include "BLI_utildefines.h" +#include "BLI_vector.hh" #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" @@ -44,15 +51,6 @@ #define MAX_PBVH_BATCH_KEY 512 #define MAX_PBVH_VBOS 16 -#include "BLI_index_range.hh" -#include "BLI_map.hh" -#include "BLI_math_vec_types.hh" -#include "BLI_vector.hh" -#include <vector> - -#include <algorithm> -#include <string> - using blender::char3; using blender::float2; using blender::float3; |