diff options
Diffstat (limited to 'source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_uv.cc')
-rw-r--r-- | source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_uv.cc | 14 |
1 files changed, 7 insertions, 7 deletions
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..b0d95b003a5 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 @@ -17,7 +17,7 @@ namespace blender::draw { struct MeshExtract_FdotUV_Data { float (*vbo_data)[2]; - const MLoopUV *uv_data; + const float (*uv_data)[2]; int cd_ofs; }; @@ -46,10 +46,10 @@ static void extract_fdots_uv_init(const MeshRenderData *mr, data->vbo_data = (float(*)[2])GPU_vertbuf_get_data(vbo); if (mr->extract_type == MR_EXTRACT_BMESH) { - data->cd_ofs = CustomData_get_offset(&mr->bm->ldata, CD_MLOOPUV); + data->cd_ofs = CustomData_get_offset(&mr->bm->ldata, CD_PROP_FLOAT2); } else { - data->uv_data = (const MLoopUV *)CustomData_get_layer(&mr->me->ldata, CD_MLOOPUV); + data->uv_data = (const float(*)[2])CustomData_get_layer(&mr->me->ldata, CD_PROP_FLOAT2); } } @@ -63,8 +63,8 @@ static void extract_fdots_uv_iter_poly_bm(const MeshRenderData *UNUSED(mr), l_iter = l_first = BM_FACE_FIRST_LOOP(f); do { 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); + const float *luv = BM_ELEM_CD_GET_FLOAT_P(l_iter, data->cd_ofs); + madd_v2_v2fl(data->vbo_data[BM_elem_index_get(f)], luv, w); } while ((l_iter = l_iter->next) != l_first); } @@ -82,12 +82,12 @@ static void extract_fdots_uv_iter_poly_mesh(const MeshRenderData *mr, const MLoop *ml = &mloop[ml_index]; if (mr->use_subsurf_fdots) { if (BLI_BITMAP_TEST(facedot_tags, ml->v)) { - copy_v2_v2(data->vbo_data[mp_index], data->uv_data[ml_index].uv); + copy_v2_v2(data->vbo_data[mp_index], data->uv_data[ml_index]); } } else { float w = 1.0f / (float)mp->totloop; - madd_v2_v2fl(data->vbo_data[mp_index], data->uv_data[ml_index].uv, w); + madd_v2_v2fl(data->vbo_data[mp_index], data->uv_data[ml_index], w); } } } |