diff --git a/LEGO1/lego/legoomni/include/legocarbuildpresenter.h b/LEGO1/lego/legoomni/include/legocarbuildpresenter.h index e6239bf5..f7e12c07 100644 --- a/LEGO1/lego/legoomni/include/legocarbuildpresenter.h +++ b/LEGO1/lego/legoomni/include/legocarbuildpresenter.h @@ -78,7 +78,7 @@ class LegoCarBuildAnimPresenter : public LegoAnimPresenter { MxBool StringEqualsPlatform(const LegoChar* p_string); MxBool StringEqualsShelf(const LegoChar* p_string); MxBool StringEndsOnY(const LegoChar* p_string); - MxBool StringEndsOnZero(const LegoChar* p_string); + MxBool StringDoesNotEndOnZero(const LegoChar* p_string); const LegoChar* GetWiredNameByPartName(const LegoChar* p_name); void SetPartObjectIdByName(const LegoChar* p_name, MxS16 p_objectId); diff --git a/LEGO1/lego/legoomni/src/build/legocarbuild.cpp b/LEGO1/lego/legoomni/src/build/legocarbuild.cpp index c904718c..a0db3713 100644 --- a/LEGO1/lego/legoomni/src/build/legocarbuild.cpp +++ b/LEGO1/lego/legoomni/src/build/legocarbuild.cpp @@ -1312,7 +1312,7 @@ void LegoCarBuild::TogglePresentersEnabled() // FUNCTION: BETA10 0x1006e124 void LegoCarBuild::FUN_100250e0(MxBool p_enabled) { - if (m_unk0x258->StringEndsOnZero(m_unk0x110->GetName()) && m_Decals_Ctl) { + if (m_unk0x258->StringDoesNotEndOnZero(m_unk0x110->GetName()) && m_Decals_Ctl) { if (strnicmp(m_unk0x110->GetName(), "JSFRNT", strlen("JSFRNT")) == 0) { m_Decal_Bitmap->Enable(p_enabled); m_Decals_Ctl->Enable(p_enabled); diff --git a/LEGO1/lego/legoomni/src/build/legocarbuildpresenter.cpp b/LEGO1/lego/legoomni/src/build/legocarbuildpresenter.cpp index 951d1fb3..7e0486ee 100644 --- a/LEGO1/lego/legoomni/src/build/legocarbuildpresenter.cpp +++ b/LEGO1/lego/legoomni/src/build/legocarbuildpresenter.cpp @@ -9,6 +9,7 @@ #include "legovideomanager.h" #include "legoworld.h" #include "misc.h" +#include "misc/legoutil.h" #include "mxautolock.h" #include "mxcompositepresenter.h" #include "mxmisc.h" @@ -507,14 +508,6 @@ LegoTreeNode* LegoCarBuildAnimPresenter::FindNodeByName(LegoTreeNode* p_treeNode return NULL; } -// FUNCTION: BETA10 0x10073c20 -inline void Exchange(MxS16* p_value1, MxS16* p_value2) -{ - MxS16 temp = *p_value1; - *p_value1 = *p_value2; - *p_value2 = temp; -} - // FUNCTION: LEGO1 0x10079790 // FUNCTION: BETA10 0x100720a3 void LegoCarBuildAnimPresenter::FUN_10079790(const LegoChar* p_name) @@ -523,7 +516,6 @@ void LegoCarBuildAnimPresenter::FUN_10079790(const LegoChar* p_name) LegoChar buffer[40]; if (strcmpi(m_parts[m_placedPartCount].m_name, p_name) != 0) { - // Something is still of by 1 here for (i = m_placedPartCount + 1; i < m_numberOfParts; i++) { if (stricmp(m_parts[i].m_name, p_name) == 0) { break; @@ -533,12 +525,12 @@ void LegoCarBuildAnimPresenter::FUN_10079790(const LegoChar* p_name) strcpy(buffer, m_parts[m_placedPartCount].m_name); strcpy(m_parts[m_placedPartCount].m_name, m_parts[i].m_name); strcpy(m_parts[i].m_name, buffer); - Exchange(&m_parts[m_placedPartCount].m_objectId, &m_parts[i].m_objectId); + Swap(m_parts[m_placedPartCount].m_objectId, m_parts[i].m_objectId); } FUN_10079050(m_placedPartCount); m_placedPartCount++; - ((LegoCarBuild*)m_currentWorld)->SetPlacedPartCount(m_placedPartCount); + ((LegoCarBuild*) m_currentWorld)->SetPlacedPartCount(m_placedPartCount); if (m_placedPartCount < m_numberOfParts) { FUN_10079680(m_parts[m_placedPartCount].m_wiredName); @@ -660,7 +652,7 @@ MxBool LegoCarBuildAnimPresenter::StringEndsOnY(const LegoChar* p_string) // FUNCTION: LEGO1 0x10079d30 // FUNCTION: BETA10 0x1007280e -MxBool LegoCarBuildAnimPresenter::StringEndsOnZero(const LegoChar* p_string) +MxBool LegoCarBuildAnimPresenter::StringDoesNotEndOnZero(const LegoChar* p_string) { return (p_string[strlen(p_string) - 1] != '0'); } diff --git a/LEGO1/lego/sources/misc/legoutil.h b/LEGO1/lego/sources/misc/legoutil.h index 92bb84c2..fc42d462 100644 --- a/LEGO1/lego/sources/misc/legoutil.h +++ b/LEGO1/lego/sources/misc/legoutil.h @@ -39,6 +39,9 @@ inline void Swap(T& p_t1, T& p_t2) p_t2 = t; } +// TEMPLATE: BETA10 0x10073c20 +// Swap + template inline T DToR(T p_d) {