From a2a6e52feb846e0c84f0ec24fafe939690b5ded3 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Wed, 25 Dec 2024 21:24:53 +0100 Subject: [PATCH] Replace some more stricmp with SDL_strcasecmp --- .../legoomni/src/build/legocarbuildpresenter.cpp | 12 ++++++------ .../legoomni/src/common/legoanimationmanager.cpp | 2 +- .../lego/legoomni/src/entity/legojetskiraceactor.cpp | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/LEGO1/lego/legoomni/src/build/legocarbuildpresenter.cpp b/LEGO1/lego/legoomni/src/build/legocarbuildpresenter.cpp index 138507ae..602eb746 100644 --- a/LEGO1/lego/legoomni/src/build/legocarbuildpresenter.cpp +++ b/LEGO1/lego/legoomni/src/build/legocarbuildpresenter.cpp @@ -103,7 +103,7 @@ inline void LegoCarBuildAnimPresenter::Beta10Inline0x100733d0() if (roi) { const LegoChar* name = roi->GetName(); - if (name && stricmp(wiredName, name) == 0) { + if (name && SDL_strcasecmp(wiredName, name) == 0) { if (bvar5) { roi->SetVisibility(TRUE); } @@ -310,7 +310,7 @@ void LegoCarBuildAnimPresenter::SwapNodesByName(LegoChar* p_name1, LegoChar* p_n { char buffer[40]; - if (stricmp(p_name1, p_name2) != 0) { + if (SDL_strcasecmp(p_name1, p_name2) != 0) { LegoAnimNodeData* node1 = FindNodeDataByName(m_anim->GetRoot(), p_name1); LegoAnimNodeData* node2 = FindNodeDataByName(m_anim->GetRoot(), p_name2); @@ -468,7 +468,7 @@ LegoAnimNodeData* LegoCarBuildAnimPresenter::FindNodeDataByName(LegoTreeNode* p_ if (p_treeNode) { data = (LegoAnimNodeData*) p_treeNode->GetData(); - if (stricmp(data->GetName(), p_name) == 0) { + if (SDL_strcasecmp(data->GetName(), p_name) == 0) { return data; } @@ -494,7 +494,7 @@ LegoTreeNode* LegoCarBuildAnimPresenter::FindNodeByName(LegoTreeNode* p_treeNode if (p_treeNode) { data = (LegoAnimNodeData*) p_treeNode->GetData(); - if (stricmp(data->GetName(), p_name) == 0) { + if (SDL_strcasecmp(data->GetName(), p_name) == 0) { return p_treeNode; } @@ -519,7 +519,7 @@ void LegoCarBuildAnimPresenter::FUN_10079790(const LegoChar* p_name) if (SDL_strcasecmp(m_parts[m_placedPartCount].m_name, p_name) != 0) { for (i = m_placedPartCount + 1; i < m_numberOfParts; i++) { - if (stricmp(m_parts[i].m_name, p_name) == 0) { + if (SDL_strcasecmp(m_parts[i].m_name, p_name) == 0) { break; } } @@ -595,7 +595,7 @@ void LegoCarBuildAnimPresenter::FUN_10079a90() // FUNCTION: BETA10 0x100724fa MxBool LegoCarBuildAnimPresenter::StringEqualsPlatform(const LegoChar* p_string) { - return stricmp(p_string, "PLATFORM") == 0; + return SDL_strcasecmp(p_string, "PLATFORM") == 0; } // FUNCTION: LEGO1 0x10079b40 diff --git a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp index 1829c8cc..2379b2d1 100644 --- a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp @@ -887,7 +887,7 @@ void LegoAnimationManager::FUN_10060480(const LegoChar* p_characterNames[], MxU3 { for (MxS32 i = 0; i < p_numCharacterNames; i++) { for (MxS32 j = 0; j < sizeOfArray(g_characters); j++) { - if (!stricmp(g_characters[j].m_name, p_characterNames[i])) { + if (!SDL_strcasecmp(g_characters[j].m_name, p_characterNames[i])) { g_characters[j].m_unk0x08 = TRUE; } } diff --git a/LEGO1/lego/legoomni/src/entity/legojetskiraceactor.cpp b/LEGO1/lego/legoomni/src/entity/legojetskiraceactor.cpp index af3dd04c..52e58567 100644 --- a/LEGO1/lego/legoomni/src/entity/legojetskiraceactor.cpp +++ b/LEGO1/lego/legoomni/src/entity/legojetskiraceactor.cpp @@ -6,6 +6,7 @@ #include "mxmisc.h" #include "mxvariabletable.h" +#include #include DECOMP_SIZE_ASSERT(LegoJetskiRaceActor, 0x1a8) @@ -123,7 +124,7 @@ void LegoJetskiRaceActor::Animate(float p_time) { if (m_unk0x0c == 0) { const LegoChar* raceState = VariableTable()->GetVariable(g_raceState); - if (!stricmp(raceState, g_racing)) { + if (!SDL_strcasecmp(raceState, g_racing)) { m_unk0x0c = 1; m_lastTime = p_time - 1.0f; m_unk0x1c = p_time;