From ddaf80dfe35e72348a6d1bcbac237f9886006aeb Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Fri, 27 Dec 2024 09:49:02 -0700 Subject: [PATCH 1/2] Use virtual operators in vector.h --- LEGO1/realtime/vector.h | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/LEGO1/realtime/vector.h b/LEGO1/realtime/vector.h index c6d0150c3b..d483206ed6 100644 --- a/LEGO1/realtime/vector.h +++ b/LEGO1/realtime/vector.h @@ -121,33 +121,32 @@ class Vector2 { return -1; } // vtable+0x44 -private: // FUNCTION: LEGO1 0x100021c0 - virtual void Add(float p_value) { AddImpl(p_value); } // vtable+0x50 + virtual void operator+=(float p_value) { AddImpl(p_value); } // vtable+0x50 // FUNCTION: LEGO1 0x100021d0 - virtual void Add(const float* p_other) { AddImpl(p_other); } // vtable+0x4c + virtual void operator+=(const float* p_other) { AddImpl(p_other); } // vtable+0x4c // FUNCTION: LEGO1 0x100021e0 - virtual void Add(const Vector2& p_other) { AddImpl(p_other.m_data); } // vtable+0x48 + virtual void operator+=(const Vector2& p_other) { AddImpl(p_other.m_data); } // vtable+0x48 // FUNCTION: LEGO1 0x100021f0 - virtual void Sub(const float* p_other) { SubImpl(p_other); } // vtable+0x58 + virtual void operator-=(const float* p_other) { SubImpl(p_other); } // vtable+0x58 // FUNCTION: LEGO1 0x10002200 - virtual void Sub(const Vector2& p_other) { SubImpl(p_other.m_data); } // vtable+0x54 + virtual void operator-=(const Vector2& p_other) { SubImpl(p_other.m_data); } // vtable+0x54 // FUNCTION: LEGO1 0x10002210 - virtual void Mul(const float* p_other) { MulImpl(p_other); } // vtable+0x64 + virtual void operator*=(const float* p_other) { MulImpl(p_other); } // vtable+0x64 // FUNCTION: LEGO1 0x10002220 - virtual void Mul(const Vector2& p_other) { MulImpl(p_other.m_data); } // vtable+0x60 + virtual void operator*=(const Vector2& p_other) { MulImpl(p_other.m_data); } // vtable+0x60 // FUNCTION: LEGO1 0x10002230 - virtual void Mul(const float& p_value) { MulImpl(p_value); } // vtable+0x5c + virtual void operator*=(const float& p_value) { MulImpl(p_value); } // vtable+0x5c // FUNCTION: LEGO1 0x10002240 - virtual void Div(const float& p_value) { DivImpl(p_value); } // vtable+0x68 + virtual void operator/=(const float& p_value) { DivImpl(p_value); } // vtable+0x68 public: // FUNCTION: LEGO1 0x10002250 @@ -192,19 +191,6 @@ class Vector2 { // FUNCTION: BETA10 0x1001d170 const float& operator[](int idx) const { return m_data[idx]; } - void operator+=(float p_value) { Add(p_value); } - void operator+=(const float* p_other) { Add(p_other); } - void operator+=(const Vector2& p_other) { Add(p_other); } - - void operator-=(const float* p_other) { Sub(p_other); } - void operator-=(const Vector2& p_other) { Sub(p_other); } - - void operator*=(const float* p_other) { Mul(p_other); } - void operator*=(const Vector2& p_other) { Mul(p_other); } - void operator*=(const float& p_value) { Mul(p_value); } - - void operator/=(const float& p_value) { Div(p_value); } - protected: float* m_data; // 0x04 }; From 2450f627c7431825983c0e931329befb7c7fa939 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Fri, 27 Dec 2024 09:53:32 -0700 Subject: [PATCH 2/2] Remove public --- LEGO1/realtime/vector.h | 1 - 1 file changed, 1 deletion(-) diff --git a/LEGO1/realtime/vector.h b/LEGO1/realtime/vector.h index d483206ed6..e3e71476ba 100644 --- a/LEGO1/realtime/vector.h +++ b/LEGO1/realtime/vector.h @@ -148,7 +148,6 @@ class Vector2 { // FUNCTION: LEGO1 0x10002240 virtual void operator/=(const float& p_value) { DivImpl(p_value); } // vtable+0x68 -public: // FUNCTION: LEGO1 0x10002250 virtual void SetVector(const float* p_other) { EqualsImpl(p_other); } // vtable+0x70