From a90504303e78030d5be2c039848d7134a829942f Mon Sep 17 00:00:00 2001 From: Howard Trickey Date: Sun, 6 Dec 2020 10:58:14 -0500 Subject: Reorder fields in boolean's ITT_value to save memory. --- source/blender/blenlib/intern/mesh_intersect.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'source/blender/blenlib') diff --git a/source/blender/blenlib/intern/mesh_intersect.cc b/source/blender/blenlib/intern/mesh_intersect.cc index ab956c5c735..85a6ab42013 100644 --- a/source/blender/blenlib/intern/mesh_intersect.cc +++ b/source/blender/blenlib/intern/mesh_intersect.cc @@ -1055,36 +1055,36 @@ static std::ostream &operator<<(std::ostream &os, const CoplanarClusterInfo &cli enum ITT_value_kind { INONE, IPOINT, ISEGMENT, ICOPLANAR }; struct ITT_value { - enum ITT_value_kind kind; mpq3 p1; /* Only relevant for IPOINT and ISEGMENT kind. */ mpq3 p2; /* Only relevant for ISEGMENT kind. */ int t_source; /* Index of the source triangle that intersected the target one. */ + enum ITT_value_kind kind; - ITT_value() : kind(INONE), t_source(-1) + ITT_value() : t_source(-1), kind(INONE) { } - ITT_value(ITT_value_kind k) : kind(k), t_source(-1) + ITT_value(ITT_value_kind k) : t_source(-1), kind(k) { } - ITT_value(ITT_value_kind k, int tsrc) : kind(k), t_source(tsrc) + ITT_value(ITT_value_kind k, int tsrc) : t_source(tsrc), kind(k) { } - ITT_value(ITT_value_kind k, const mpq3 &p1) : kind(k), p1(p1), t_source(-1) + ITT_value(ITT_value_kind k, const mpq3 &p1) : p1(p1), t_source(-1), kind(k) { } ITT_value(ITT_value_kind k, const mpq3 &p1, const mpq3 &p2) - : kind(k), p1(p1), p2(p2), t_source(-1) + : p1(p1), p2(p2), t_source(-1), kind(k) { } ITT_value(const ITT_value &other) - : kind(other.kind), p1(other.p1), p2(other.p2), t_source(other.t_source) + : p1(other.p1), p2(other.p2), t_source(other.t_source), kind(other.kind) { } ITT_value(ITT_value &&other) noexcept - : kind(other.kind), - p1(std::move(other.p1)), + : p1(std::move(other.p1)), p2(std::move(other.p2)), - t_source(other.t_source) + t_source(other.t_source), + kind(other.kind) { } ~ITT_value() -- cgit v1.2.3