From e1491ae407cef349d76fa4ba75f5b715397c7cc9 Mon Sep 17 00:00:00 2001 From: jonschz Date: Sun, 6 Oct 2024 13:58:12 +0200 Subject: [PATCH] Add weird index operator for `FUN_1002ddc0` --- LEGO1/lego/sources/geom/legounkown100db7f4.h | 6 +++--- LEGO1/mxgeometry/mxgeometry3d.h | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/LEGO1/lego/sources/geom/legounkown100db7f4.h b/LEGO1/lego/sources/geom/legounkown100db7f4.h index 68f4c9f2..ae877b58 100644 --- a/LEGO1/lego/sources/geom/legounkown100db7f4.h +++ b/LEGO1/lego/sources/geom/legounkown100db7f4.h @@ -25,9 +25,9 @@ struct LegoUnknown100db7f4 : public LegoEdge { LegoResult FUN_1002ddc0(LegoWEEdge& p_f, Vector3& p_point) { if (p_f.IsEqual(*m_faceA)) { - p_point[0] = -m_unk0x28[0]; - p_point[1] = -m_unk0x28[1]; - p_point[2] = -m_unk0x28[2]; + p_point[0] = -m_unk0x28.index_operator(0); + p_point[1] = -m_unk0x28.index_operator(1); + p_point[2] = -m_unk0x28.index_operator(2); } else { // clang-format off diff --git a/LEGO1/mxgeometry/mxgeometry3d.h b/LEGO1/mxgeometry/mxgeometry3d.h index a4768a6d..58d36198 100644 --- a/LEGO1/mxgeometry/mxgeometry3d.h +++ b/LEGO1/mxgeometry/mxgeometry3d.h @@ -35,8 +35,12 @@ class Mx3DPointFloat : public Vector3 { // FUNCTION: BETA10 0x10013460 float& operator[](int idx) { return m_data[idx]; } + // According to the PDB, BETA10 will not link this one if it is never used + // const float& operator[](int idx) const { return m_data[idx]; } + + // only used by LegoUnknown100db7f4::FUN_1002ddc0() for some unknown reason // FUNCTION: BETA10 0x100373c0 - const float& operator[](int idx) const { return m_data[idx]; } + float& index_operator(int idx) { return m_data[idx]; } // SYNTHETIC: LEGO1 0x10010c00 // Mx3DPointFloat::operator=