diff --git a/CMakeLists.txt b/CMakeLists.txt index 96ad9343..6b01bda5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -542,6 +542,7 @@ if (MSVC_FOR_DECOMP) # They ensure a recompilation that can be byte/instruction accurate to the original binaries. if (ISLE_BUILD_APP) target_link_options(isle PRIVATE "/OPT:REF") + target_link_options(lego1 PRIVATE "/OPT:REF") set_property(TARGET isle ${lego1_targets} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") endif() diff --git a/LEGO1/omni/include/mxstring.h b/LEGO1/omni/include/mxstring.h index 31b5e949..3c268839 100644 --- a/LEGO1/omni/include/mxstring.h +++ b/LEGO1/omni/include/mxstring.h @@ -8,19 +8,20 @@ // SIZE 0x10 class MxString : public MxCore { public: - MxString(const MxString& p_str); - ~MxString() override; - const MxString& operator=(const char* p_data); - MxString(); - MxString(const char*); - MxString(const char*, MxU16); + MxString(const MxString& p_str); + MxString(const char* p_str); + MxString(const char* p_str, MxU16 p_maxlen); + ~MxString() override; + void Reverse(); void ToUpperCase(); void ToLowerCase(); + MxString& operator=(const MxString& p_str); - MxString operator+(const MxString& p_str); - MxString operator+(const char* p_str); + const MxString& operator=(const char* p_str); + const MxString operator+(const MxString& p_str); + const MxString operator+(const char* p_str); MxString& operator+=(const char* p_str); static void CharSwap(char* p_a, char* p_b); diff --git a/LEGO1/omni/src/common/mxstring.cpp b/LEGO1/omni/src/common/mxstring.cpp index 2598f67c..07e77514 100644 --- a/LEGO1/omni/src/common/mxstring.cpp +++ b/LEGO1/omni/src/common/mxstring.cpp @@ -115,20 +115,20 @@ MxString& MxString::operator=(const MxString& p_str) // FUNCTION: LEGO1 0x100ae510 // FUNCTION: BETA10 0x1012c606 -const MxString& MxString::operator=(const char* p_data) +const MxString& MxString::operator=(const char* p_str) { - if (this->m_data != p_data) { + if (this->m_data != p_str) { delete[] this->m_data; - this->m_length = strlen(p_data); + this->m_length = strlen(p_str); this->m_data = new char[this->m_length + 1]; - strcpy(this->m_data, p_data); + strcpy(this->m_data, p_str); } return *this; } // FUNCTION: BETA10 0x1012c68a -MxString MxString::operator+(const MxString& p_str) +const MxString MxString::operator+(const MxString& p_str) { MxString tmp; delete[] tmp.m_data; @@ -146,7 +146,7 @@ MxString MxString::operator+(const MxString& p_str) // This forces MSVC to add $ReturnUdt$ to the stack for 100% match. // FUNCTION: LEGO1 0x100ae580 // FUNCTION: BETA10 0x1012c78d -MxString MxString::operator+(const char* p_str) +const MxString MxString::operator+(const char* p_str) { // MxString constructor allocates 1 byte for m_data, so free that first MxString tmp;