diff options
Diffstat (limited to 'source/blender/draw/intern/mesh_extractors')
9 files changed, 21 insertions, 21 deletions
diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines_adjacency.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines_adjacency.cc index d6c246c51a9..32a262e4533 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines_adjacency.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines_adjacency.cc @@ -71,7 +71,7 @@ BLI_INLINE void lines_adjacency_triangle( if (!value_is_init || v_data == NO_EDGE) { /* Save the winding order inside the sign bit. Because the * Edge-hash sort the keys and we need to compare winding later. */ - int value = (int)l1 + 1; /* 0 cannot be signed so add one. */ + int value = int(l1) + 1; /* 0 cannot be signed so add one. */ *pval = POINTER_FROM_INT((inv_indices) ? -value : value); /* Store loop indices for remaining non-manifold edges. */ data->vert_to_loop[v2] = l2; @@ -81,7 +81,7 @@ BLI_INLINE void lines_adjacency_triangle( /* HACK Tag as not used. Prevent overhead of BLI_edgehash_remove. */ *pval = POINTER_FROM_INT(NO_EDGE); bool inv_opposite = (v_data < 0); - uint l_opposite = (uint)abs(v_data) - 1; + uint l_opposite = uint(abs(v_data)) - 1; /* TODO: Make this part thread-safe. */ if (inv_opposite == inv_indices) { /* Don't share edge if triangles have non matching winding. */ @@ -146,7 +146,7 @@ static void extract_lines_adjacency_finish(const MeshRenderData *UNUSED(mr), int v_data = POINTER_AS_INT(BLI_edgehashIterator_getValue(ehi)); if (v_data != NO_EDGE) { BLI_edgehashIterator_getKey(ehi, &v2, &v3); - l1 = (uint)abs(v_data) - 1; + l1 = uint(abs(v_data)) - 1; if (v_data < 0) { /* `inv_opposite`. */ SWAP(uint, v2, v3); } diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines_paint_mask.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines_paint_mask.cc index 9fbbfc3d705..3977ba492ca 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines_paint_mask.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines_paint_mask.cc @@ -115,8 +115,8 @@ static void extract_lines_paint_mask_iter_subdiv_mesh(const DRWSubdivCache *subd uint start_loop_idx = subdiv_quad_index * 4; uint end_loop_idx = (subdiv_quad_index + 1) * 4; for (uint loop_idx = start_loop_idx; loop_idx < end_loop_idx; loop_idx++) { - const uint coarse_edge_index = (uint)subdiv_loop_edge_index[loop_idx]; - const uint subdiv_edge_index = (uint)subdiv_loop_subdiv_edge_index[loop_idx]; + const uint coarse_edge_index = uint(subdiv_loop_edge_index[loop_idx]); + const uint subdiv_edge_index = uint(subdiv_loop_subdiv_edge_index[loop_idx]); if (coarse_edge_index == -1u) { GPU_indexbuf_set_line_restart(&data->elb, subdiv_edge_index); diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edit_data.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edit_data.cc index 27fd6546b8c..12e3d4afd5d 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edit_data.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edit_data.cc @@ -60,14 +60,14 @@ static void mesh_render_data_edge_flag(const MeshRenderData *mr, if (mr->edge_crease_ofs != -1) { float crease = BM_ELEM_CD_GET_FLOAT(eed, mr->edge_crease_ofs); if (crease > 0) { - eattr->crease = (uchar)ceil(crease * 15.0f); + eattr->crease = uchar(ceil(crease * 15.0f)); } } /* Use a byte for value range */ if (mr->bweight_ofs != -1) { float bweight = BM_ELEM_CD_GET_FLOAT(eed, mr->bweight_ofs); if (bweight > 0) { - eattr->bweight = (uchar)(bweight * 255.0f); + eattr->bweight = uchar(bweight * 255.0f); } } #ifdef WITH_FREESTYLE @@ -95,7 +95,7 @@ static void mesh_render_data_vert_flag(const MeshRenderData *mr, if (mr->vert_crease_ofs != -1) { float crease = BM_ELEM_CD_GET_FLOAT(eve, mr->vert_crease_ofs); if (crease > 0) { - eattr->crease |= (uchar)ceil(crease * 15.0f) << 4; + eattr->crease |= uchar(ceil(crease * 15.0f)) << 4; } } } diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edituv_stretch_angle.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edituv_stretch_angle.cc index e4714aabf34..683abf24f03 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edituv_stretch_angle.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edituv_stretch_angle.cc @@ -52,7 +52,7 @@ static void compute_normalize_edge_vectors(float auv[2][2], static short v2_to_short_angle(const float v[2]) { - return atan2f(v[1], v[0]) * (float)M_1_PI * SHRT_MAX; + return atan2f(v[1], v[0]) * float(M_1_PI) * SHRT_MAX; } static void edituv_get_edituv_stretch_angle(float auv[2][2], @@ -63,7 +63,7 @@ static void edituv_get_edituv_stretch_angle(float auv[2][2], r_stretch->uv_angles[0] = v2_to_short_angle(auv[0]); r_stretch->uv_angles[1] = v2_to_short_angle(auv[1]); /* Compute 3D angle here. */ - r_stretch->angle = angle_normalized_v3v3(av[0], av[1]) * (float)M_1_PI * SHRT_MAX; + r_stretch->angle = angle_normalized_v3v3(av[0], av[1]) * float(M_1_PI) * SHRT_MAX; #if 0 /* here for reference, this is done in shader now. */ float uvang = angle_normalized_v2v2(auv0, auv1); diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_pos.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_pos.cc index c391cb6ca5a..8bc4d7fe7c7 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_pos.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_pos.cc @@ -63,7 +63,7 @@ static void extract_fdots_pos_iter_poly_bm(const MeshRenderData *mr, do { add_v3_v3(co, bm_vert_co_get(mr, l_iter->v)); } while ((l_iter = l_iter->next) != l_first); - mul_v3_fl(co, 1.0f / (float)f->len); + mul_v3_fl(co, 1.0f / float(f->len)); } static void extract_fdots_pos_iter_poly_mesh(const MeshRenderData *mr, @@ -95,7 +95,7 @@ static void extract_fdots_pos_iter_poly_mesh(const MeshRenderData *mr, } if (!mr->use_subsurf_fdots) { - mul_v3_fl(co, 1.0f / (float)mp->totloop); + mul_v3_fl(co, 1.0f / float(mp->totloop)); } } diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_uv.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_uv.cc index b0403cf7c4c..0c1b58a035f 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_uv.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_uv.cc @@ -62,7 +62,7 @@ static void extract_fdots_uv_iter_poly_bm(const MeshRenderData *UNUSED(mr), BMLoop *l_iter, *l_first; l_iter = l_first = BM_FACE_FIRST_LOOP(f); do { - float w = 1.0f / (float)f->len; + float w = 1.0f / float(f->len); const MLoopUV *luv = (const MLoopUV *)BM_ELEM_CD_GET_VOID_P(l_iter, data->cd_ofs); madd_v2_v2fl(data->vbo_data[BM_elem_index_get(f)], luv->uv, w); } while ((l_iter = l_iter->next) != l_first); @@ -86,7 +86,7 @@ static void extract_fdots_uv_iter_poly_mesh(const MeshRenderData *mr, } } else { - float w = 1.0f / (float)mp->totloop; + float w = 1.0f / float(mp->totloop); madd_v2_v2fl(data->vbo_data[mp_index], data->uv_data[ml_index].uv, w); } } diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_mesh_analysis.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_mesh_analysis.cc index fe2a02b6b63..a803fcaac1c 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_mesh_analysis.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_mesh_analysis.cc @@ -67,8 +67,8 @@ BLI_INLINE float overhang_remap(float fac, float min, float max, float minmax_ir static void statvis_calc_overhang(const MeshRenderData *mr, float *r_overhang) { const MeshStatVis *statvis = &mr->toolsettings->statvis; - const float min = statvis->overhang_min / (float)M_PI; - const float max = statvis->overhang_max / (float)M_PI; + const float min = statvis->overhang_min / float(M_PI); + const float max = statvis->overhang_max / float(M_PI); const char axis = statvis->overhang_axis; BMEditMesh *em = mr->edit_bmesh; BMIter iter; @@ -88,7 +88,7 @@ static void statvis_calc_overhang(const MeshRenderData *mr, float *r_overhang) if (mr->extract_type == MR_EXTRACT_BMESH) { int l_index = 0; BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) { - float fac = angle_normalized_v3v3(bm_face_no_get(mr, f), dir) / (float)M_PI; + float fac = angle_normalized_v3v3(bm_face_no_get(mr, f), dir) / float(M_PI); fac = overhang_remap(fac, min, max, minmax_irange); for (int i = 0; i < f->len; i++, l_index++) { r_overhang[l_index] = fac; @@ -98,7 +98,7 @@ static void statvis_calc_overhang(const MeshRenderData *mr, float *r_overhang) else { const MPoly *mp = mr->mpoly; for (int mp_index = 0, l_index = 0; mp_index < mr->poly_len; mp_index++, mp++) { - float fac = angle_normalized_v3v3(mr->poly_normals[mp_index], dir) / (float)M_PI; + float fac = angle_normalized_v3v3(mr->poly_normals[mp_index], dir) / float(M_PI); fac = overhang_remap(fac, min, max, minmax_irange); for (int i = 0; i < mp->totloop; i++, l_index++) { r_overhang[l_index] = fac; diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_tan.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_tan.cc index 049fa416523..60ade9daadc 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_tan.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_tan.cc @@ -302,7 +302,7 @@ static void extract_tan_init_subdiv(const DRWSubdivCache *subdiv_cache, /* Ensure data is uploaded properly. */ GPU_vertbuf_tag_dirty(coarse_vbo); /* Include stride in offset. */ - const int dst_offset = (int)subdiv_cache->num_subdiv_loops * 4 * pack_layer_index++; + const int dst_offset = int(subdiv_cache->num_subdiv_loops) * 4 * pack_layer_index++; draw_subdiv_interp_custom_data(subdiv_cache, coarse_vbo, dst_buffer, 4, dst_offset, false); } if (use_orco_tan) { @@ -317,7 +317,7 @@ static void extract_tan_init_subdiv(const DRWSubdivCache *subdiv_cache, /* Ensure data is uploaded properly. */ GPU_vertbuf_tag_dirty(coarse_vbo); /* Include stride in offset. */ - const int dst_offset = (int)subdiv_cache->num_subdiv_loops * 4 * pack_layer_index++; + const int dst_offset = int(subdiv_cache->num_subdiv_loops) * 4 * pack_layer_index++; draw_subdiv_interp_custom_data(subdiv_cache, coarse_vbo, dst_buffer, 4, dst_offset, false); } diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_uv.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_uv.cc index 6606912850d..cbade20dd03 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_uv.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_uv.cc @@ -146,7 +146,7 @@ static void extract_uv_init_subdiv(const DRWSubdivCache *subdiv_cache, int pack_layer_index = 0; for (int i = 0; i < MAX_MTFACE; i++) { if (uv_layers & (1 << i)) { - const int offset = (int)subdiv_cache->num_subdiv_loops * pack_layer_index++; + const int offset = int(subdiv_cache->num_subdiv_loops) * pack_layer_index++; draw_subdiv_extract_uvs(subdiv_cache, vbo, i, offset); } } |