diff options
Diffstat (limited to 'source/blender/draw/engines/overlay')
8 files changed, 22 insertions, 22 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_armature.cc b/source/blender/draw/engines/overlay/overlay_armature.cc index 494fd3739d7..903bcbb911e 100644 --- a/source/blender/draw/engines/overlay/overlay_armature.cc +++ b/source/blender/draw/engines/overlay/overlay_armature.cc @@ -416,7 +416,7 @@ static float encode_2f_to_float(float a, float b) { CLAMP(a, 0.0f, 1.0f); CLAMP(b, 0.0f, 2.0f); /* Can go up to 2. Needed for wire size. */ - return (float)((int)(a * 255) | ((int)(b * 255) << 8)); + return float(int(a * 255) | (int(b * 255) << 8)); } void OVERLAY_bone_instance_data_set_color_hint(BoneInstanceData *data, const float hint_color[4]) @@ -941,11 +941,11 @@ static void cp_shade_color3ub(uchar cp[3], const int offset) { int r, g, b; - r = offset + (int)cp[0]; + r = offset + int(cp[0]); CLAMP(r, 0, 255); - g = offset + (int)cp[1]; + g = offset + int(cp[1]); CLAMP(g, 0, 255); - b = offset + (int)cp[2]; + b = offset + int(cp[2]); CLAMP(b, 0, 255); cp[0] = r; diff --git a/source/blender/draw/engines/overlay/overlay_edit_uv.cc b/source/blender/draw/engines/overlay/overlay_edit_uv.cc index dd29a128255..2b1af67175e 100644 --- a/source/blender/draw/engines/overlay/overlay_edit_uv.cc +++ b/source/blender/draw/engines/overlay/overlay_edit_uv.cc @@ -68,7 +68,7 @@ static OVERLAY_UVLineStyle edit_uv_line_style_from_space_image(const SpaceImage static GPUTexture *edit_uv_mask_texture( Mask *mask, const int width, const int height_, const float aspx, const float aspy) { - const int height = (float)height_ * (aspy / aspx); + const int height = float(height_) * (aspy / aspx); MaskRasterHandle *handle; float *buffer = static_cast<float *>(MEM_mallocN(sizeof(float) * height * width, __func__)); @@ -308,8 +308,8 @@ void OVERLAY_edit_uv_cache_init(OVERLAY_Data *vedata) LISTBASE_FOREACH (ImageTile *, tile, &image->tiles) { const int tile_x = ((tile->tile_number - 1001) % 10); const int tile_y = ((tile->tile_number - 1001) / 10); - obmat[3][1] = (float)tile_y; - obmat[3][0] = (float)tile_x; + obmat[3][1] = float(tile_y); + obmat[3][0] = float(tile_x); DRW_shgroup_call_obmat(grp, geom, obmat); } /* Only mark active border when overlays are enabled. */ @@ -318,8 +318,8 @@ void OVERLAY_edit_uv_cache_init(OVERLAY_Data *vedata) ImageTile *active_tile = static_cast<ImageTile *>( BLI_findlink(&image->tiles, image->active_tile_index)); if (active_tile) { - obmat[3][0] = (float)((active_tile->tile_number - 1001) % 10); - obmat[3][1] = (float)((active_tile->tile_number - 1001) / 10); + obmat[3][0] = float((active_tile->tile_number - 1001) % 10); + obmat[3][1] = float((active_tile->tile_number - 1001) / 10); grp = DRW_shgroup_create(sh, psl->edit_uv_tiled_image_borders_ps); DRW_shgroup_uniform_vec4_copy(grp, "color", selected_color); DRW_shgroup_call_obmat(grp, geom, obmat); diff --git a/source/blender/draw/engines/overlay/overlay_engine.cc b/source/blender/draw/engines/overlay/overlay_engine.cc index bb9f2e3a8ce..bbcae92561d 100644 --- a/source/blender/draw/engines/overlay/overlay_engine.cc +++ b/source/blender/draw/engines/overlay/overlay_engine.cc @@ -50,7 +50,7 @@ static void OVERLAY_engine_init(void *vedata) } OVERLAY_PrivateData *pd = stl->pd; - pd->space_type = v3d != nullptr ? (int)SPACE_VIEW3D : draw_ctx->space_data->spacetype; + pd->space_type = v3d != nullptr ? int(SPACE_VIEW3D) : draw_ctx->space_data->spacetype; if (pd->space_type == SPACE_IMAGE) { const SpaceImage *sima = (SpaceImage *)draw_ctx->space_data; diff --git a/source/blender/draw/engines/overlay/overlay_grid.cc b/source/blender/draw/engines/overlay/overlay_grid.cc index d1958205a10..0cffa528219 100644 --- a/source/blender/draw/engines/overlay/overlay_grid.cc +++ b/source/blender/draw/engines/overlay/overlay_grid.cc @@ -67,8 +67,8 @@ void OVERLAY_grid_init(OVERLAY_Data *vedata) grid->distance = 1.0f; copy_v3_fl3(grid->size, 1.0f, 1.0f, 1.0f); if (is_uv_edit) { - grid->size[0] = (float)sima->tile_grid_shape[0]; - grid->size[1] = (float)sima->tile_grid_shape[1]; + grid->size[0] = float(sima->tile_grid_shape[0]); + grid->size[1] = float(sima->tile_grid_shape[1]); } grid->zoom_factor = ED_space_image_zoom_level(v2d, SI_GRID_STEPS_LEN); @@ -122,9 +122,9 @@ void OVERLAY_grid_init(OVERLAY_Data *vedata) } } - grid_axes[0] = (float)((grid_flag & (PLANE_XZ | PLANE_XY)) != 0); - grid_axes[1] = (float)((grid_flag & (PLANE_YZ | PLANE_XY)) != 0); - grid_axes[2] = (float)((grid_flag & (PLANE_YZ | PLANE_XZ)) != 0); + grid_axes[0] = float((grid_flag & (PLANE_XZ | PLANE_XY)) != 0); + grid_axes[1] = float((grid_flag & (PLANE_YZ | PLANE_XY)) != 0); + grid_axes[2] = float((grid_flag & (PLANE_YZ | PLANE_XZ)) != 0); /* Z axis if needed */ if (((rv3d->view == RV3D_VIEW_USER) || (rv3d->persp != RV3D_ORTHO)) && show_axis_z) { @@ -156,9 +156,9 @@ void OVERLAY_grid_init(OVERLAY_Data *vedata) zneg_flag |= CLIP_ZPOS; } - zplane_axes[0] = (float)((zpos_flag & (PLANE_XZ | PLANE_XY)) != 0); - zplane_axes[1] = (float)((zpos_flag & (PLANE_YZ | PLANE_XY)) != 0); - zplane_axes[2] = (float)((zpos_flag & (PLANE_YZ | PLANE_XZ)) != 0); + zplane_axes[0] = float((zpos_flag & (PLANE_XZ | PLANE_XY)) != 0); + zplane_axes[1] = float((zpos_flag & (PLANE_YZ | PLANE_XY)) != 0); + zplane_axes[2] = float((zpos_flag & (PLANE_YZ | PLANE_XZ)) != 0); } else { zneg_flag = zpos_flag = CLIP_ZNEG | CLIP_ZPOS; diff --git a/source/blender/draw/engines/overlay/overlay_image.cc b/source/blender/draw/engines/overlay/overlay_image.cc index 47587319098..f42867622e4 100644 --- a/source/blender/draw/engines/overlay/overlay_image.cc +++ b/source/blender/draw/engines/overlay/overlay_image.cc @@ -135,7 +135,7 @@ static struct GPUTexture *image_camera_background_texture_get(CameraBGImage *bgp Scene *scene = draw_ctx->scene; float aspect_x, aspect_y; int width, height; - int ctime = (int)DEG_get_ctime(draw_ctx->depsgraph); + int ctime = int(DEG_get_ctime(draw_ctx->depsgraph)); *r_use_alpha_premult = false; *r_use_view_transform = false; diff --git a/source/blender/draw/engines/overlay/overlay_metaball.cc b/source/blender/draw/engines/overlay/overlay_metaball.cc index 38de273028b..2fc6910fe44 100644 --- a/source/blender/draw/engines/overlay/overlay_metaball.cc +++ b/source/blender/draw/engines/overlay/overlay_metaball.cc @@ -74,7 +74,7 @@ void OVERLAY_edit_metaball_cache_populate(OVERLAY_Data *vedata, Object *ob) LISTBASE_FOREACH (MetaElem *, ml, mb->editelems) { const bool is_selected = (ml->flag & SELECT) != 0; const bool is_scale_radius = (ml->flag & MB_SCALE_RAD) != 0; - float stiffness_radius = ml->rad * atanf(ml->s) / (float)M_PI_2; + float stiffness_radius = ml->rad * atanf(ml->s) / float(M_PI_2); BoneInstanceData instdata; if (is_select) { diff --git a/source/blender/draw/engines/overlay/overlay_motion_path.cc b/source/blender/draw/engines/overlay/overlay_motion_path.cc index 00b2a8665fd..3f6954f821b 100644 --- a/source/blender/draw/engines/overlay/overlay_motion_path.cc +++ b/source/blender/draw/engines/overlay/overlay_motion_path.cc @@ -116,7 +116,7 @@ static void motion_path_cache(OVERLAY_Data *vedata, const DRWContextState *draw_ctx = DRW_context_state_get(); struct DRWTextStore *dt = DRW_text_cache_ensure(); int txt_flag = DRW_TEXT_CACHE_GLOBALSPACE; - int cfra = (int)DEG_get_ctime(draw_ctx->depsgraph); + int cfra = int(DEG_get_ctime(draw_ctx->depsgraph)); bool selected = (pchan) ? (pchan->bone->flag & BONE_SELECTED) : (ob->base_flag & BASE_SELECTED); bool show_keyframes = (avs->path_viewflag & MOTIONPATH_VIEW_KFRAS) != 0; bool show_keyframes_no = (avs->path_viewflag & MOTIONPATH_VIEW_KFNOS) != 0; diff --git a/source/blender/draw/engines/overlay/overlay_outline.cc b/source/blender/draw/engines/overlay/overlay_outline.cc index e308775dc6e..af348ae3c3e 100644 --- a/source/blender/draw/engines/overlay/overlay_outline.cc +++ b/source/blender/draw/engines/overlay/overlay_outline.cc @@ -192,7 +192,7 @@ static void gpencil_layer_cache_populate(bGPDlayer *gpl, DRWShadingGroup *grp = iter->stroke_grp = DRW_shgroup_create_sub(iter->stroke_grp); DRW_shgroup_uniform_bool_copy(grp, "gpStrokeOrder3d", is_stroke_order_3d); DRW_shgroup_uniform_float_copy(grp, "gpThicknessScale", object_scale); - DRW_shgroup_uniform_float_copy(grp, "gpThicknessOffset", (float)gpl->line_change); + DRW_shgroup_uniform_float_copy(grp, "gpThicknessOffset", float(gpl->line_change)); DRW_shgroup_uniform_float_copy(grp, "gpThicknessWorldScale", thickness_scale); DRW_shgroup_uniform_vec4_copy(grp, "gpDepthPlane", iter->plane); } |