diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-01-12 14:43:40 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-01-12 14:44:26 +0300 |
commit | e5766752d04794c2693dedad75baeb8c7d68f4cf (patch) | |
tree | 7f5354d1272612a32c28bfda4c03259970c402b7 /source/blender/io | |
parent | b2ccd8546c7249a5ce279210d45ddbb5e90cd10d (diff) |
Revert "BLI: Refactor vector types & functions to use templates"
Reverted because the commit removes a lot of commits.
This reverts commit a2c1c368af48644fa8995ecbe7138cc0d7900c30.
Diffstat (limited to 'source/blender/io')
9 files changed, 14 insertions, 31 deletions
diff --git a/source/blender/io/alembic/intern/abc_reader_object.cc b/source/blender/io/alembic/intern/abc_reader_object.cc index 4a359c49d26..86fa580bf1f 100644 --- a/source/blender/io/alembic/intern/abc_reader_object.cc +++ b/source/blender/io/alembic/intern/abc_reader_object.cc @@ -120,29 +120,10 @@ static Imath::M44d blend_matrices(const Imath::M44d &m0, const Imath::M44d &m1, * the matrices manually. */ - for (int i = 0; i < 4; i++) { - for (int j = 0; j < 4; j++) { - mat0[i][j] = static_cast<float>(m0[i][j]); - } - } - - for (int i = 0; i < 4; i++) { - for (int j = 0; j < 4; j++) { - mat1[i][j] = static_cast<float>(m1[i][j]); - } - } - + convert_matrix_datatype(m0, mat0); + convert_matrix_datatype(m1, mat1); interp_m4_m4m4(ret, mat0, mat1, weight); - - Imath::M44d m; - - for (int i = 0; i < 4; i++) { - for (int j = 0; j < 4; j++) { - m[i][j] = ret[i][j]; - } - } - - return m; + return convert_matrix_datatype(ret); } Imath::M44d get_matrix(const IXformSchema &schema, const float time) diff --git a/source/blender/io/gpencil/intern/gpencil_io_base.cc b/source/blender/io/gpencil/intern/gpencil_io_base.cc index 7868bade8c1..f031648d2ed 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_base.cc +++ b/source/blender/io/gpencil/intern/gpencil_io_base.cc @@ -23,8 +23,9 @@ * \ingroup bgpencil */ +#include "BLI_float2.hh" +#include "BLI_float3.hh" #include "BLI_float4x4.hh" -#include "BLI_math_vec_types.hh" #include "BLI_path_util.h" #include "BLI_span.hh" @@ -282,7 +283,7 @@ float GpencilIO::stroke_point_radius_get(bGPDlayer *gpl, bGPDstroke *gps) const float2 screen_ex = gpencil_3D_point_to_2D(&pt->x); const float2 v1 = screen_co - screen_ex; - float radius = math::length(v1); + float radius = v1.length(); BKE_gpencil_free_stroke(gps_perimeter); return MAX2(radius, 1.0f); diff --git a/source/blender/io/gpencil/intern/gpencil_io_base.hh b/source/blender/io/gpencil/intern/gpencil_io_base.hh index ae54d5056dc..09557cd7a4d 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_base.hh +++ b/source/blender/io/gpencil/intern/gpencil_io_base.hh @@ -22,8 +22,9 @@ * \ingroup bgpencil */ +#include "BLI_float2.hh" +#include "BLI_float3.hh" #include "BLI_float4x4.hh" -#include "BLI_math_vec_types.hh" #include "BLI_vector.hh" #include "DNA_space_types.h" /* for FILE_MAX */ diff --git a/source/blender/io/gpencil/intern/gpencil_io_import_svg.cc b/source/blender/io/gpencil/intern/gpencil_io_import_svg.cc index 455ebb7c3cb..941d1137f4d 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_import_svg.cc +++ b/source/blender/io/gpencil/intern/gpencil_io_import_svg.cc @@ -21,8 +21,8 @@ * \ingroup bgpencil */ +#include "BLI_float3.hh" #include "BLI_math.h" -#include "BLI_math_vec_types.hh" #include "BLI_span.hh" #include "DNA_gpencil_types.h" diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_mesh.hh b/source/blender/io/wavefront_obj/exporter/obj_export_mesh.hh index e6d2853d040..9a4dfe3efe3 100644 --- a/source/blender/io/wavefront_obj/exporter/obj_export_mesh.hh +++ b/source/blender/io/wavefront_obj/exporter/obj_export_mesh.hh @@ -22,7 +22,7 @@ #include <optional> -#include "BLI_math_vec_types.hh" +#include "BLI_float3.hh" #include "BLI_utility_mixins.hh" #include "BLI_vector.hh" diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_mtl.cc b/source/blender/io/wavefront_obj/exporter/obj_export_mtl.cc index 5b710939e00..b99d41e0c72 100644 --- a/source/blender/io/wavefront_obj/exporter/obj_export_mtl.cc +++ b/source/blender/io/wavefront_obj/exporter/obj_export_mtl.cc @@ -21,8 +21,8 @@ #include "BKE_image.h" #include "BKE_node.h" +#include "BLI_float3.hh" #include "BLI_map.hh" -#include "BLI_math_vec_types.hh" #include "BLI_path_util.h" #include "DNA_material_types.h" diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_mtl.hh b/source/blender/io/wavefront_obj/exporter/obj_export_mtl.hh index a84dcb80a48..2f62d189bd1 100644 --- a/source/blender/io/wavefront_obj/exporter/obj_export_mtl.hh +++ b/source/blender/io/wavefront_obj/exporter/obj_export_mtl.hh @@ -20,8 +20,8 @@ #pragma once +#include "BLI_float3.hh" #include "BLI_map.hh" -#include "BLI_math_vec_types.hh" #include "BLI_string_ref.hh" #include "BLI_vector.hh" diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_nurbs.cc b/source/blender/io/wavefront_obj/exporter/obj_export_nurbs.cc index ec690115115..91aabd8fa76 100644 --- a/source/blender/io/wavefront_obj/exporter/obj_export_nurbs.cc +++ b/source/blender/io/wavefront_obj/exporter/obj_export_nurbs.cc @@ -18,9 +18,9 @@ * \ingroup obj */ +#include "BLI_float3.hh" #include "BLI_listbase.h" #include "BLI_math.h" -#include "BLI_math_vec_types.hh" #include "DEG_depsgraph.h" #include "DEG_depsgraph_query.h" diff --git a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc index 0feca806f35..f9151bb97f8 100644 --- a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc +++ b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc @@ -236,7 +236,7 @@ TEST(obj_exporter_writer, mtllib) static bool strings_equal_after_first_lines(const std::string &a, const std::string &b) { /* If `dbg_level > 0` then a failing test will print context around the first mismatch. */ - const bool dbg_level = 0; + const int dbg_level = 0; const size_t a_len = a.size(); const size_t b_len = b.size(); const size_t a_next = a.find_first_of('\n'); |