From 3ac775d9708fd9181f37c9c82df59207a3f27a67 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Fri, 3 Jan 2025 11:43:20 -0700 Subject: [PATCH] Fix operators --- LEGO1/realtime/vector.h | 26 ++------------------------ LEGO1/realtime/vector2d.h | 4 ++-- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/LEGO1/realtime/vector.h b/LEGO1/realtime/vector.h index 8b6a7230..2fbe5ddc 100644 --- a/LEGO1/realtime/vector.h +++ b/LEGO1/realtime/vector.h @@ -46,24 +46,8 @@ class Vector2 { inline virtual void operator*=(const Vector2& p_other); // vtable+0x60 inline virtual void operator*=(const float& p_value); // vtable+0x5c inline virtual void operator/=(const float& p_value); // vtable+0x68 - inline virtual void SetVector(const float* p_other); // vtable+0x70 - inline virtual void SetVector(const Vector2& p_other); // vtable+0x6c - - // Note: it's unclear whether Vector3::operator= has been defined explicitly - // with the same function body as Vector2& operator=. The BETA indicates that; - // however, it makes LEGO1 0x10010be0 disappear and worsens matches in - // at least these functions: - // LEGO1 0x100109b0 - // LEGO1 0x10023130 - // LEGO1 0x1002de10 - // LEGO1 0x10050a80 - // LEGO1 0x10053980 - // LEGO1 0x100648f0 - // LEGO1 0x10064b50 - // LEGO1 0x10084030 - // LEGO1 0x100a9410 - // However, defining it as in the BETA improves at least these functions: - // LEGO1 0x10042300 + inline virtual void operator=(const float* p_other); // vtable+0x70 + inline virtual void operator=(const Vector2& p_other); // vtable+0x6c // SYNTHETIC: LEGO1 0x10010be0 // SYNTHETIC: BETA10 0x100121e0 @@ -72,12 +56,6 @@ class Vector2 { // SYNTHETIC: BETA10 0x1004af40 // Vector4::operator= - Vector2& operator=(const Vector2& p_other) - { - Vector2::SetVector(p_other); - return *this; - } - // FUNCTION: BETA10 0x1001d140 float& operator[](int idx) { return m_data[idx]; } diff --git a/LEGO1/realtime/vector2d.h b/LEGO1/realtime/vector2d.h index d80e767c..d3b5316d 100644 --- a/LEGO1/realtime/vector2d.h +++ b/LEGO1/realtime/vector2d.h @@ -189,14 +189,14 @@ void Vector2::operator/=(const float& p_value) } // FUNCTION: LEGO1 0x10002250 -void Vector2::SetVector(const float* p_other) +void Vector2::operator=(const float* p_other) { EqualsImpl(p_other); } // FUNCTION: LEGO1 0x10002260 // FUNCTION: BETA10 0x100110c0 -void Vector2::SetVector(const Vector2& p_other) +void Vector2::operator=(const Vector2& p_other) { EqualsImpl(p_other.m_data); }