Use strcasecmp, strncasecmp, strlwr, strupr and itoa from SDL

This commit is contained in:
Anonymous Maarten 2024-12-23 21:32:55 +01:00
parent 9db0e795f4
commit 92945a581b
40 changed files with 187 additions and 129 deletions

View File

@ -6,6 +6,8 @@
#include "mxstl/stlcompat.h"
#include "mxtypes.h"
#include <SDL3/SDL_stdinc.h>
#pragma warning(disable : 4237)
// SIZE 0x08
@ -38,7 +40,7 @@ struct LegoCacheSoundEntry {
struct Set100d6b4cComparator {
bool operator()(const LegoCacheSoundEntry& p_a, const LegoCacheSoundEntry& p_b) const
{
return strcmpi(p_a.m_name, p_b.m_name) > 0;
return SDL_strcasecmp(p_a.m_name, p_b.m_name) > 0;
}
};

View File

@ -6,6 +6,8 @@
#include "mxtypes.h"
#include "roi/legoroi.h"
#include <SDL3/SDL_stdinc.h>
class CustomizeAnimFileVariable;
class LegoActor;
class LegoExtraActor;
@ -15,7 +17,7 @@ class LegoROI;
#pragma warning(disable : 4237)
struct LegoCharacterComparator {
MxBool operator()(const char* const& p_a, const char* const& p_b) const { return strcmpi(p_a, p_b) < 0; }
MxBool operator()(const char* const& p_a, const char* const& p_b) const { return SDL_strcasecmp(p_a, p_b) < 0; }
};
// SIZE 0x08

View File

@ -24,6 +24,7 @@
#include "scripts.h"
#include <stdio.h>
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(Ambulance, 0x184)
DECOMP_SIZE_ASSERT(AmbulanceMissionState, 0x24)
@ -251,14 +252,14 @@ MxLong Ambulance::HandleButtonDown(LegoControlManagerNotificationParam& p_param)
if (m_unk0x170 == 1) {
LegoROI* roi = PickROI(p_param.GetX(), p_param.GetY());
if (roi != NULL && !strcmpi(roi->GetName(), "ps-gate")) {
if (roi != NULL && !SDL_strcasecmp(roi->GetName(), "ps-gate")) {
m_unk0x170 = 3;
return 1;
}
roi = PickRootROI(p_param.GetX(), p_param.GetY());
if (roi != NULL && !strcmpi(roi->GetName(), "gd")) {
if (roi != NULL && !SDL_strcasecmp(roi->GetName(), "gd")) {
m_unk0x170 = 3;
return 1;
}

View File

@ -7,6 +7,7 @@
#include "tgl/tglvector.h"
#include <assert.h>
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(Doors, 0x1f8)
@ -129,10 +130,10 @@ void Doors::ParseAction(char* p_extra)
for (CompoundObject::const_iterator it = comp->begin(); it != comp->end(); it++) {
LegoROI* roi = (LegoROI*) *it;
if (roi && (!strnicmp(roi->GetName(), "dor-lt", 6) || !strnicmp(roi->GetName(), "dor-sl", 6))) {
if (roi && (!SDL_strncasecmp(roi->GetName(), "dor-lt", 6) || !SDL_strncasecmp(roi->GetName(), "dor-sl", 6))) {
m_ltDoor = roi;
}
else if (roi && (!strnicmp(roi->GetName(), "dor-rt", 6) || !strnicmp(roi->GetName(), "dor-sr", 6))) {
else if (roi && (!SDL_strncasecmp(roi->GetName(), "dor-rt", 6) || !SDL_strncasecmp(roi->GetName(), "dor-sr", 6))) {
m_rtDoor = roi;
}
}

View File

@ -19,6 +19,7 @@
#include "mxvariabletable.h"
#include <stdio.h>
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(DuneBuggy, 0x16c)
@ -164,20 +165,20 @@ MxS32 DuneBuggy::GetColorOffset(const char* p_variable)
MxS32 offset = 1;
const char* colorName = VariableTable()->GetVariable(p_variable);
if (strcmpi(colorName, "lego green")) {
if (!strcmpi(colorName, "lego red")) {
if (SDL_strcasecmp(colorName, "lego green")) {
if (!SDL_strcasecmp(colorName, "lego red")) {
offset = 2;
}
else if (!strcmpi(colorName, "lego yellow")) {
else if (!SDL_strcasecmp(colorName, "lego yellow")) {
offset = 3;
}
else if (!strcmpi(colorName, "lego black")) {
else if (!SDL_strcasecmp(colorName, "lego black")) {
offset = 4;
}
else if (!strcmpi(colorName, "lego blue")) {
else if (!SDL_strcasecmp(colorName, "lego blue")) {
offset = 5;
}
else if (!strcmpi(colorName, "lego white")) {
else if (!SDL_strcasecmp(colorName, "lego white")) {
offset = 6;
}
}

View File

@ -34,6 +34,8 @@
#include <stdio.h>
#include <vec.h>
#include <SDL3/SDL_stdinc.h>
// Names and values verified by BETA10 0x1006d742.
// Note that these were probably hard-coded numbers in the original.
#define Helicopter_Actor CopterScript::c_Helicopter_Actor
@ -1316,30 +1318,30 @@ void LegoCarBuild::TogglePresentersEnabled()
void LegoCarBuild::FUN_100250e0(MxBool p_enabled)
{
if (m_unk0x258->StringDoesNotEndOnZero(m_unk0x110->GetName()) && m_Decals_Ctl) {
if (strnicmp(m_unk0x110->GetName(), "JSFRNT", strlen("JSFRNT")) == 0) {
if (SDL_strncasecmp(m_unk0x110->GetName(), "JSFRNT", strlen("JSFRNT")) == 0) {
m_Decal_Bitmap->Enable(p_enabled);
m_Decals_Ctl->Enable(p_enabled);
m_Decals_Ctl1->Enable(p_enabled);
m_Decals_Ctl2->Enable(p_enabled);
m_Decals_Ctl3->Enable(p_enabled);
}
else if (strnicmp(m_unk0x110->GetName(), "JSWNSH", strlen("JSWNSH")) == 0) {
else if (SDL_strncasecmp(m_unk0x110->GetName(), "JSWNSH", strlen("JSWNSH")) == 0) {
m_Decal_Bitmap->Enable(p_enabled);
m_Decals_Ctl4->Enable(p_enabled);
m_Decals_Ctl5->Enable(p_enabled);
m_Decals_Ctl6->Enable(p_enabled);
m_Decals_Ctl7->Enable(p_enabled);
}
else if (strnicmp(m_unk0x110->GetName(), "RCBACK", strlen("RCBACK")) == 0) {
else if (SDL_strncasecmp(m_unk0x110->GetName(), "RCBACK", strlen("RCBACK")) == 0) {
m_Decals_Ctl1->Enable(p_enabled);
}
else if (strnicmp(m_unk0x110->GetName(), "RCTAIL", strlen("RCTAIL")) == 0) {
else if (SDL_strncasecmp(m_unk0x110->GetName(), "RCTAIL", strlen("RCTAIL")) == 0) {
m_Decals_Ctl2->Enable(p_enabled);
}
else if (m_Decals_Ctl1 && strnicmp(m_unk0x110->GetName(), "chljety", strlen("chljety")) == 0) {
else if (m_Decals_Ctl1 && SDL_strncasecmp(m_unk0x110->GetName(), "chljety", strlen("chljety")) == 0) {
m_Decals_Ctl1->Enable(p_enabled);
}
else if (m_Decals_Ctl2 && strnicmp(m_unk0x110->GetName(), "chrjety", strlen("chrjety")) == 0) {
else if (m_Decals_Ctl2 && SDL_strncasecmp(m_unk0x110->GetName(), "chrjety", strlen("chrjety")) == 0) {
m_Decals_Ctl2->Enable(p_enabled);
}
else if (m_Decals_Ctl) {

View File

@ -16,6 +16,8 @@
#include "mxtimer.h"
#include "realtime/realtime.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(LegoCarBuildAnimPresenter::UnknownListEntry, 0x0c)
DECOMP_SIZE_ASSERT(LegoCarBuildAnimPresenter, 0x150)
@ -225,7 +227,7 @@ void LegoCarBuildAnimPresenter::StreamingTickle()
for (MxS32 j = 0; j <= m_roiMapSize; j++) {
LegoROI* roi = m_roiMap[j];
if (roi && roi->GetName() && (strcmpi(name, roi->GetName()) == 0)) {
if (roi && roi->GetName() && (SDL_strcasecmp(name, roi->GetName()) == 0)) {
roi->FUN_100a9dd0();
roi->FUN_100a9350("lego red");
}
@ -247,7 +249,7 @@ void LegoCarBuildAnimPresenter::StreamingTickle()
for (i = 0; i < totalNodes; i++) {
LegoAnimNodeData* animNodeData = (LegoAnimNodeData*) GetTreeNode(m_anim->GetRoot(), i)->GetData();
if (strnicmp(animNodeData->GetName(), "CAM", strlen("CAM")) == 0) {
if (SDL_strncasecmp(animNodeData->GetName(), "CAM", strlen("CAM")) == 0) {
camera = local60->FindChildROI(animNodeData->GetName(), local60);
fov = atof(&animNodeData->GetName()[strlen(animNodeData->GetName()) - 2]);
break;
@ -367,7 +369,7 @@ void LegoCarBuildAnimPresenter::FUN_10079160()
for (i = 0; i < totalNodes; i++) {
name = ((LegoAnimNodeData*) GetTreeNode(m_anim->GetRoot(), i)->GetData())->GetName();
strupr(name);
SDL_strupr(name);
if (StringEndsOnW(name)) {
m_parts[name[strlen(name) - 1] - 'A'].m_wiredName = new LegoChar[strlen(name) + 1];
@ -386,7 +388,7 @@ void LegoCarBuildAnimPresenter::FUN_10079160()
name = ((LegoAnimNodeData*) GetTreeNode(m_anim->GetRoot(), i)->GetData())->GetName();
if (StringEndsOnYOrN(name)) {
for (MxS16 ii = 0; ii < m_numberOfParts; ii++) {
if (strnicmp(m_parts[ii].m_wiredName, name, strlen(name) - 2) == 0) {
if (SDL_strncasecmp(m_parts[ii].m_wiredName, name, strlen(name) - 2) == 0) {
m_parts[ii].m_name = new LegoChar[strlen(name) + 1];
assert(m_parts[ii].m_name);
strcpy(m_parts[ii].m_name, name);
@ -515,7 +517,7 @@ void LegoCarBuildAnimPresenter::FUN_10079790(const LegoChar* p_name)
MxS16 i;
LegoChar buffer[40];
if (strcmpi(m_parts[m_placedPartCount].m_name, p_name) != 0) {
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) {
break;
@ -615,7 +617,7 @@ MxBool LegoCarBuildAnimPresenter::StringEndsOnYOrN(const LegoChar* p_string)
// FUNCTION: BETA10 0x10072624
MxBool LegoCarBuildAnimPresenter::StringEqualsShelf(const LegoChar* p_string)
{
return strnicmp(p_string, "SHELF", strlen("SHELF")) == 0;
return SDL_strncasecmp(p_string, "SHELF", strlen("SHELF")) == 0;
}
// FUNCTION: LEGO1 0x10079c30
@ -627,7 +629,7 @@ MxBool LegoCarBuildAnimPresenter::FUN_10079c30(const LegoChar* p_name)
}
return m_placedPartCount < m_numberOfParts &&
strnicmp(p_name, m_parts[m_placedPartCount].m_name, strlen(p_name) - 3) == 0;
SDL_strncasecmp(p_name, m_parts[m_placedPartCount].m_name, strlen(p_name) - 3) == 0;
}
// FUNCTION: LEGO1 0x10079ca0
@ -635,7 +637,7 @@ MxBool LegoCarBuildAnimPresenter::FUN_10079c30(const LegoChar* p_name)
MxBool LegoCarBuildAnimPresenter::PartIsPlaced(const LegoChar* p_name)
{
for (MxS16 i = 0; i < m_placedPartCount; i++) {
if (strcmpi(p_name, m_parts[i].m_name) == 0) {
if (SDL_strcasecmp(p_name, m_parts[i].m_name) == 0) {
return TRUE;
}
}
@ -662,7 +664,7 @@ MxBool LegoCarBuildAnimPresenter::StringDoesNotEndOnZero(const LegoChar* p_strin
const LegoChar* LegoCarBuildAnimPresenter::GetWiredNameByPartName(const LegoChar* p_name)
{
for (MxS16 i = 0; i < m_numberOfParts; i++) {
if (strcmpi(p_name, m_parts[i].m_name) == 0) {
if (SDL_strcasecmp(p_name, m_parts[i].m_name) == 0) {
return m_parts[i].m_wiredName;
}
}
@ -675,7 +677,7 @@ const LegoChar* LegoCarBuildAnimPresenter::GetWiredNameByPartName(const LegoChar
void LegoCarBuildAnimPresenter::SetPartObjectIdByName(const LegoChar* p_name, MxS16 p_objectId)
{
for (MxS16 i = 0; i < m_numberOfParts; i++) {
if (strcmpi(p_name, m_parts[i].m_name) == 0) {
if (SDL_strcasecmp(p_name, m_parts[i].m_name) == 0) {
m_parts[i].m_objectId = p_objectId;
return;
}

View File

@ -30,6 +30,7 @@
#include <io.h>
#include <stdio.h>
#include <SDL3/SDL_stdinc.h>
#include <vec.h>
DECOMP_SIZE_ASSERT(LegoAnimationManager, 0x500)
@ -745,7 +746,7 @@ MxResult LegoAnimationManager::LoadWorldInfo(LegoOmni::World p_worldId)
MxBool LegoAnimationManager::FindVehicle(const char* p_name, MxU32& p_index)
{
for (MxS32 i = 0; i < sizeOfArray(g_vehicles); i++) {
if (!strcmpi(p_name, g_vehicles[i].m_name)) {
if (!SDL_strcasecmp(p_name, g_vehicles[i].m_name)) {
p_index = i;
return TRUE;
}
@ -1662,7 +1663,7 @@ MxS8 LegoAnimationManager::GetCharacterIndex(const char* p_name)
MxS8 i;
for (i = 0; i < sizeOfArray(g_characters); i++) {
if (!strnicmp(p_name, g_characters[i].m_name, 2)) {
if (!SDL_strncasecmp(p_name, g_characters[i].m_name, 2)) {
return i;
}
}
@ -1713,7 +1714,7 @@ MxBool LegoAnimationManager::ModelExists(AnimInfo& p_info, const char* p_name)
if (models != NULL && modelCount) {
for (MxU8 i = 0; i < modelCount; i++) {
if (!strcmpi(models[i].m_name, p_name)) {
if (!SDL_strcasecmp(models[i].m_name, p_name)) {
return TRUE;
}
}
@ -2076,7 +2077,7 @@ MxBool LegoAnimationManager::FUN_10062e20(LegoROI* p_roi, LegoAnimPresenter* p_p
MxS32 i;
for (i = 0; i < (MxS32) sizeOfArray(g_characters); i++) {
if (!strcmpi(name, g_characters[i].m_name)) {
if (!SDL_strcasecmp(name, g_characters[i].m_name)) {
characterId = i;
break;
}
@ -2621,7 +2622,7 @@ MxResult LegoAnimationManager::FUN_10064380(
extraIndex = i;
}
if (roi != NULL && !strcmpi(roi->GetName(), p_name)) {
if (roi != NULL && !SDL_strcasecmp(roi->GetName(), p_name)) {
actor = CharacterManager()->GetExtraActor(p_name);
if (actor != NULL && actor->GetController() != NULL) {
@ -2639,7 +2640,7 @@ MxResult LegoAnimationManager::FUN_10064380(
MxS32 characterId;
for (characterId = 0; characterId < (MxS32) sizeOfArray(g_characters); characterId++) {
if (!strcmpi(g_characters[characterId].m_name, p_name)) {
if (!SDL_strcasecmp(g_characters[characterId].m_name, p_name)) {
break;
}
}
@ -2759,7 +2760,7 @@ MxResult LegoAnimationManager::FUN_10064880(const char* p_name, MxS32 p_unk0x0c,
LegoROI* roi = m_extras[i].m_roi;
if (roi != NULL) {
if (!strcmpi(roi->GetName(), p_name)) {
if (!SDL_strcasecmp(roi->GetName(), p_name)) {
g_characters[m_extras[i].m_characterId].m_unk0x0c = p_unk0x0c;
g_characters[m_extras[i].m_characterId].m_unk0x10 = p_unk0x10;
return SUCCESS;

View File

@ -17,6 +17,7 @@
#include "viewmanager/viewmanager.h"
#include <stdio.h>
#include <SDL3/SDL_stdinc.h>
#include <vec.h>
DECOMP_SIZE_ASSERT(LegoCharacter, 0x08)
@ -474,7 +475,7 @@ LegoROI* LegoCharacterManager::CreateActorROI(const char* p_key)
goto done;
}
if (!strcmpi(p_key, "pep")) {
if (!SDL_strcasecmp(p_key, "pep")) {
LegoActorInfo* pepper = GetActorInfo("pepper");
info->m_sound = pepper->m_sound;
@ -652,7 +653,7 @@ MxBool LegoCharacterManager::FUN_100849a0(LegoROI* p_roi, LegoTextureInfo* p_tex
MxBool LegoCharacterManager::IsActor(const char* p_name)
{
for (MxU32 i = 0; i < sizeOfArray(g_actorInfo); i++) {
if (!strcmpi(g_actorInfo[i].m_name, p_name)) {
if (!SDL_strcasecmp(g_actorInfo[i].m_name, p_name)) {
return TRUE;
}
}
@ -678,7 +679,7 @@ LegoActorInfo* LegoCharacterManager::GetActorInfo(const char* p_name)
MxU32 i;
for (i = 0; i < sizeOfArray(g_actorInfo); i++) {
if (!strcmpi(g_actorInfo[i].m_name, p_name)) {
if (!SDL_strcasecmp(g_actorInfo[i].m_name, p_name)) {
break;
}
}
@ -721,7 +722,7 @@ LegoROI* LegoCharacterManager::FindChildROI(LegoROI* p_roi, const char* p_name)
#endif
LegoROI* roi = (LegoROI*) *it;
if (!strcmpi(p_name, roi->GetName())) {
if (!SDL_strcasecmp(p_name, roi->GetName())) {
return roi;
}
}

View File

@ -63,6 +63,7 @@
#include <assert.h>
#include <stdio.h>
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(LegoGameState::Username, 0x0e)
DECOMP_SIZE_ASSERT(LegoGameState::ScoreItem, 0x2c)
@ -1022,8 +1023,8 @@ void LegoGameState::SetROIHandlerFunction()
MxBool ROIHandlerFunction(const char* p_input, char* p_output, MxU32 p_copyLen)
{
if (p_output != NULL && p_copyLen != 0 &&
(strnicmp(p_input, "INDIR-F-", strlen("INDIR-F-")) == 0 ||
strnicmp(p_input, "INDIR-G-", strlen("INDIR-F-")) == 0)) {
(SDL_strncasecmp(p_input, "INDIR-F-", strlen("INDIR-F-")) == 0 ||
SDL_strncasecmp(p_input, "INDIR-G-", strlen("INDIR-F-")) == 0)) {
char buf[256];
sprintf(buf, "c_%s", &p_input[strlen("INDIR-F-")]);

View File

@ -31,6 +31,7 @@
#include "scripts.h"
#include <SDL3/SDL_events.h>
#include <SDL3/SDL_stdinc.h>
#include <process.h>
#include <stdio.h>
#include <string.h>
@ -191,11 +192,11 @@ void FUN_1003e050(LegoAnimPresenter* p_presenter)
LegoAnimNodeData* data = (LegoAnimNodeData*) GetTreeNode(rootNode, i)->GetData();
if (!strnicmp(data->GetName(), "CAM", strlen("CAM"))) {
if (!SDL_strncasecmp(data->GetName(), "CAM", strlen("CAM"))) {
camData = data;
cam = atof(&data->GetName()[strlen(data->GetName()) - 2]);
}
else if (!strcmpi(data->GetName(), "TARGET")) {
else if (!SDL_strcasecmp(data->GetName(), "TARGET")) {
targetData = data;
}
}
@ -231,34 +232,34 @@ Extra::ActionType MatchActionString(const char* p_str)
{
Extra::ActionType result = Extra::ActionType::e_unknown;
if (!strcmpi("openram", p_str)) {
if (!SDL_strcasecmp("openram", p_str)) {
result = Extra::ActionType::e_openram;
}
else if (!strcmpi("opendisk", p_str)) {
else if (!SDL_strcasecmp("opendisk", p_str)) {
result = Extra::ActionType::e_opendisk;
}
else if (!strcmpi("close", p_str)) {
else if (!SDL_strcasecmp("close", p_str)) {
result = Extra::ActionType::e_close;
}
else if (!strcmpi("start", p_str)) {
else if (!SDL_strcasecmp("start", p_str)) {
result = Extra::ActionType::e_start;
}
else if (!strcmpi("stop", p_str)) {
else if (!SDL_strcasecmp("stop", p_str)) {
result = Extra::ActionType::e_stop;
}
else if (!strcmpi("run", p_str)) {
else if (!SDL_strcasecmp("run", p_str)) {
result = Extra::ActionType::e_run;
}
else if (!strcmpi("exit", p_str)) {
else if (!SDL_strcasecmp("exit", p_str)) {
result = Extra::ActionType::e_exit;
}
else if (!strcmpi("enable", p_str)) {
else if (!SDL_strcasecmp("enable", p_str)) {
result = Extra::ActionType::e_enable;
}
else if (!strcmpi("disable", p_str)) {
else if (!SDL_strcasecmp("disable", p_str)) {
result = Extra::ActionType::e_disable;
}
else if (!strcmpi("notify", p_str)) {
else if (!SDL_strcasecmp("notify", p_str)) {
result = Extra::ActionType::e_notify;
}

View File

@ -10,6 +10,8 @@
#include "misc.h"
#include "roi/legoroi.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(VisibilityVariable, 0x24)
DECOMP_SIZE_ASSERT(CameraLocationVariable, 0x24)
DECOMP_SIZE_ASSERT(CursorVariable, 0x24)
@ -115,10 +117,10 @@ void VisibilityVariable::SetValue(const char* p_value)
char* name = strtok(NULL, g_delimiter2);
MxBool show;
if (!strcmpi(instruction, g_varHIDE)) {
if (!SDL_strcasecmp(instruction, g_varHIDE)) {
show = FALSE;
}
else if (!strcmpi(instruction, g_varSHOW)) {
else if (!SDL_strcasecmp(instruction, g_varSHOW)) {
show = TRUE;
}
else {
@ -160,19 +162,19 @@ void WhoAmIVariable::SetValue(const char* p_value)
{
MxVariable::SetValue(p_value);
if (!strcmpi(p_value, g_papa)) {
if (!SDL_strcasecmp(p_value, g_papa)) {
GameState()->SetActorId(3);
}
else if (!strcmpi(p_value, g_mama)) {
else if (!SDL_strcasecmp(p_value, g_mama)) {
GameState()->SetActorId(2);
}
else if (!strcmpi(p_value, g_pepper)) {
else if (!SDL_strcasecmp(p_value, g_pepper)) {
GameState()->SetActorId(1);
}
else if (!strcmpi(p_value, g_nick)) {
else if (!SDL_strcasecmp(p_value, g_nick)) {
GameState()->SetActorId(4);
}
else if (!strcmpi(p_value, g_laura)) {
else if (!SDL_strcasecmp(p_value, g_laura)) {
GameState()->SetActorId(5);
}
}

View File

@ -9,6 +9,8 @@
#include "mxutilities.h"
#include "mxvideopresenter.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(MxControlPresenter, 0x5c)
// FUNCTION: LEGO1 0x10043f50
@ -253,15 +255,15 @@ void MxControlPresenter::ParseExtra()
if (KeyValueStringParse(output, g_strSTYLE, extraCopy)) {
char* str = strtok(output, g_parseExtraTokens);
if (!strcmpi(str, g_strTOGGLE)) {
if (!SDL_strcasecmp(str, g_strTOGGLE)) {
m_unk0x4c = 1;
}
else if (!strcmpi(str, g_strGRID)) {
else if (!SDL_strcasecmp(str, g_strGRID)) {
m_unk0x4c = 2;
m_unk0x52 = atoi(strtok(NULL, g_parseExtraTokens));
m_unk0x54 = atoi(strtok(NULL, g_parseExtraTokens));
}
else if (!strcmpi(str, g_strMAP)) {
else if (!SDL_strcasecmp(str, g_strMAP)) {
m_unk0x4c = 3;
str = strtok(NULL, g_parseExtraTokens);
@ -281,7 +283,7 @@ void MxControlPresenter::ParseExtra()
}
if (KeyValueStringParse(output, g_strVISIBILITY, extraCopy)) {
if (!strcmpi(output, "FALSE")) {
if (!SDL_strcasecmp(output, "FALSE")) {
Enable(FALSE);
}
}

View File

@ -9,6 +9,7 @@
#include "mxvariabletable.h"
#include <assert.h>
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(LegoMeterPresenter, 0x94)
@ -47,16 +48,16 @@ void LegoMeterPresenter::ParseExtra()
char output[256];
if (KeyValueStringParse(output, g_strTYPE, extraCopy)) {
if (!strcmpi(output, g_strLEFT_TO_RIGHT)) {
if (!SDL_strcasecmp(output, g_strLEFT_TO_RIGHT)) {
m_layout = e_leftToRight;
}
else if (!strcmpi(output, g_strRIGHT_TO_LEFT)) {
else if (!SDL_strcasecmp(output, g_strRIGHT_TO_LEFT)) {
m_layout = e_rightToLeft;
}
else if (!strcmpi(output, g_strBOTTOM_TO_TOP)) {
else if (!SDL_strcasecmp(output, g_strBOTTOM_TO_TOP)) {
m_layout = e_bottomToTop;
}
else if (!strcmpi(output, g_strTOP_TO_BOTTOM)) {
else if (!SDL_strcasecmp(output, g_strTOP_TO_BOTTOM)) {
m_layout = e_topToBottom;
}
}

View File

@ -7,6 +7,8 @@
#include "mxutilities.h"
#include "roi/legoroi.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(LegoActor, 0x78)
// GLOBAL: LEGO1 0x100f32d0
@ -111,7 +113,7 @@ void LegoActor::ParseAction(char* p_extra)
}
if (KeyValueStringParse(value, g_strVISIBILITY, p_extra)) {
GetROI()->SetVisibility(strcmpi(value, "FALSE") != 0);
GetROI()->SetVisibility(SDL_strcasecmp(value, "FALSE") != 0);
}
}
@ -128,7 +130,7 @@ void LegoActor::SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2)
const char* name = p_roi->GetName();
for (MxU32 i = 1; i <= sizeOfArray(g_actorNames) - 1; i++) {
if (!strcmpi(name, g_actorNames[i])) {
if (!SDL_strcasecmp(name, g_actorNames[i])) {
m_type = e_actor;
m_actorId = i;
break;

View File

@ -26,6 +26,7 @@
#include "realtime/realtimeview.h"
#include "viewmanager/viewmanager.h"
#include <SDL3/SDL_stdinc.h>
#include <vec.h>
DECOMP_SIZE_ASSERT(LegoNavController, 0x70)
@ -427,7 +428,7 @@ MxResult LegoNavController::UpdateLocation(const char* p_location)
MxResult result = FAILURE;
for (MxS32 i = 0; i < (MxS32) sizeOfArray(g_locations); i++) {
if (!strcmpi(p_location, g_locations[i].m_name)) {
if (!SDL_strcasecmp(p_location, g_locations[i].m_name)) {
MxMatrix mat;
LegoROI* viewROI = VideoManager()->GetViewROI();

View File

@ -27,6 +27,8 @@
#include "mxutilities.h"
#include "viewmanager/viewmanager.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(LegoWorld, 0xf8)
DECOMP_SIZE_ASSERT(LegoEntityList, 0x18)
DECOMP_SIZE_ASSERT(LegoEntityListCursor, 0x10)
@ -422,7 +424,7 @@ void LegoWorld::Add(MxCore* p_object)
if (p_object->IsA("LegoAnimPresenter")) {
LegoAnimPresenter* animPresenter = (LegoAnimPresenter*) p_object;
if (!strcmpi(animPresenter->GetAction()->GetObjectName(), "ConfigAnimation")) {
if (!SDL_strcasecmp(animPresenter->GetAction()->GetObjectName(), "ConfigAnimation")) {
FUN_1003e050(animPresenter);
animPresenter->GetAction()->SetDuration(animPresenter->GetAnimation()->GetDuration());
}
@ -572,7 +574,7 @@ MxCore* LegoWorld::Find(const char* p_class, const char* p_name)
}
LegoROI* roi = entity->GetROI();
if (roi && !strcmpi(roi->GetName(), p_name)) {
if (roi && !SDL_strcasecmp(roi->GetName(), p_name)) {
return entity;
}
}
@ -584,7 +586,7 @@ MxCore* LegoWorld::Find(const char* p_class, const char* p_name)
MxPresenter* presenter;
while (cursor.Next(presenter)) {
if (!strcmpi(((LegoAnimPresenter*) presenter)->GetActionObjectName(), p_name)) {
if (!SDL_strcasecmp(((LegoAnimPresenter*) presenter)->GetActionObjectName(), p_name)) {
return presenter;
}
}

View File

@ -28,6 +28,7 @@
#include "mxutilities.h"
#include <stdio.h>
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(LegoWorldPresenter, 0x54)
@ -198,7 +199,7 @@ MxResult LegoWorldPresenter::LoadWorld(char* p_worldName, LegoWorld* p_world)
ReadModelDbWorlds(wdbFile, worlds, numWorlds);
for (i = 0; i < numWorlds; i++) {
if (!strcmpi(worlds[i].m_worldName, p_worldName)) {
if (!SDL_strcasecmp(worlds[i].m_worldName, p_worldName)) {
break;
}
}
@ -266,25 +267,25 @@ MxResult LegoWorldPresenter::LoadWorld(char* p_worldName, LegoWorld* p_world)
}
for (j = 0; j < worlds[i].m_numModels; j++) {
if (!strnicmp(worlds[i].m_models[j].m_modelName, "isle", 4)) {
if (!SDL_strncasecmp(worlds[i].m_models[j].m_modelName, "isle", 4)) {
switch (g_legoWorldPresenterQuality) {
case 0:
if (strcmpi(worlds[i].m_models[j].m_modelName, "isle_lo")) {
if (SDL_strcasecmp(worlds[i].m_models[j].m_modelName, "isle_lo")) {
continue;
}
break;
case 1:
if (strcmpi(worlds[i].m_models[j].m_modelName, "isle")) {
if (SDL_strcasecmp(worlds[i].m_models[j].m_modelName, "isle")) {
continue;
}
break;
case 2:
if (strcmpi(worlds[i].m_models[j].m_modelName, "isle_hi")) {
if (SDL_strcasecmp(worlds[i].m_models[j].m_modelName, "isle_hi")) {
continue;
}
}
}
else if (g_legoWorldPresenterQuality <= 1 && !strnicmp(worlds[i].m_models[j].m_modelName, "haus", 4)) {
else if (g_legoWorldPresenterQuality <= 1 && !SDL_strncasecmp(worlds[i].m_models[j].m_modelName, "haus", 4)) {
if (worlds[i].m_models[j].m_modelName[4] == '3') {
if (FUN_100674b0(worlds[i].m_models[j], wdbFile, p_world) != SUCCESS) {
return FAILURE;

View File

@ -33,6 +33,8 @@
#include "scripts.h"
#include "viewmanager/viewmanager.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(LegoOmni, 0x140)
DECOMP_SIZE_ASSERT(LegoOmni::WorldContainer, 0x1c)
DECOMP_SIZE_ASSERT(LegoWorldList, 0x18)
@ -417,7 +419,7 @@ LegoROI* LegoOmni::FindROI(const char* p_name)
const char* name = roi->GetName();
if (name != NULL) {
if (!strcmpi(name, p_name)) {
if (!SDL_strcasecmp(name, p_name)) {
return roi;
}
}
@ -432,7 +434,7 @@ MxEntity* LegoOmni::AddToWorld(const char* p_id, MxS32 p_entityId, MxPresenter*
{
LegoWorld* world = NULL;
if (strcmpi(p_id, g_current)) {
if (SDL_strcasecmp(p_id, g_current)) {
world = FindWorld(MxAtomId(p_id, e_lowerCase2), p_entityId);
}
else {
@ -507,7 +509,7 @@ LegoOmni::World LegoOmni::GetWorldId(const char* p_key)
{
for (MxS32 i = 0; i < e_numWorlds; i++) {
// FIXME: this looks very fishy. Is this guarding against out-of-bounds access?
if ((MxS32*) &m_worlds[i] != (MxS32*) -4 && !strcmpi(m_worlds[i].GetKey(), p_key)) {
if ((MxS32*) &m_worlds[i] != (MxS32*) -4 && !SDL_strcasecmp(m_worlds[i].GetKey(), p_key)) {
return m_worlds[i].GetId();
}
}

View File

@ -7,6 +7,8 @@
#include "mxticklemanager.h"
#include "mxtimer.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(LegoPathController, 0x40)
DECOMP_SIZE_ASSERT(LegoPathCtrlEdge, 0x40)
DECOMP_SIZE_ASSERT(LegoPathController::CtrlBoundary, 0x08)
@ -103,7 +105,7 @@ MxResult LegoPathController::Create(MxU8* p_data, const Vector3& p_location, con
MxS32 j;
for (j = 0; j < sizeOfArray(g_unk0x100f42f0); j++) {
if (!strcmpi(g_unk0x100f42f0[j], boundary.GetName())) {
if (!SDL_strcasecmp(g_unk0x100f42f0[j], boundary.GetName())) {
g_ctrlBoundariesA[j].m_controller = this;
g_ctrlBoundariesA[j].m_boundary = &boundary;
@ -114,7 +116,7 @@ MxResult LegoPathController::Create(MxU8* p_data, const Vector3& p_location, con
}
for (j = 0; j < sizeOfArray(g_unk0x100f4330); j++) {
if (!strcmpi(g_unk0x100f4330[j], boundary.GetName())) {
if (!SDL_strcasecmp(g_unk0x100f4330[j], boundary.GetName())) {
g_ctrlBoundariesB[j].m_controller = this;
g_ctrlBoundariesB[j].m_boundary = &boundary;
g_ctrlEdgesB[j].m_controller = this;
@ -386,7 +388,7 @@ MxResult LegoPathController::FUN_10046b30(LegoPathBoundary*& p_boundaries, MxS32
LegoPathBoundary* LegoPathController::GetPathBoundary(const char* p_name)
{
for (MxS32 i = 0; i < m_numL; i++) {
if (!strcmpi(m_boundaries[i].GetName(), p_name)) {
if (!SDL_strcasecmp(m_boundaries[i].GetName(), p_name)) {
return &m_boundaries[i];
}
}

View File

@ -127,7 +127,7 @@ void LegoPathPresenter::ParseExtra()
memcpy(extraCopy, extraData, extraLength);
extraCopy[extraLength] = '\0';
strupr(extraCopy);
SDL_strupr(extraCopy);
if (KeyValueStringParse(output, g_strTRIGGERS_SOURCE, extraCopy) != FALSE) {
m_trigger = MxAtomId(output, e_lowerCase2);

View File

@ -19,6 +19,7 @@
#include "mxvariabletable.h"
#include "raceskel.h"
#include <SDL3/SDL_stdinc.h>
#include <stdio.h>
DECOMP_SIZE_ASSERT(EdgeReference, 0x08)
@ -476,8 +477,8 @@ MxResult LegoRaceCar::HitActor(LegoPathActor* p_actor, MxBool p_bool)
}
if (m_userNavFlag) {
MxBool actorIsStuds = strcmpi(p_actor->GetROI()->GetName(), "studs") == 0;
MxBool actorIsRhoda = strcmpi(p_actor->GetROI()->GetName(), "rhoda") == 0;
MxBool actorIsStuds = SDL_strcasecmp(p_actor->GetROI()->GetName(), "studs") == 0;
MxBool actorIsRhoda = SDL_strcasecmp(p_actor->GetROI()->GetName(), "rhoda") == 0;
MxLong time = Timer()->GetTime();
const char* soundKey = NULL;
@ -692,8 +693,8 @@ MxResult LegoJetski::HitActor(LegoPathActor* p_actor, MxBool p_bool)
}
if (m_userNavFlag) {
MxBool actorIsSnap = strcmpi(p_actor->GetROI()->GetName(), "snap") == 0;
MxBool actorIsValerie = strcmpi(p_actor->GetROI()->GetName(), "valerie") == 0;
MxBool actorIsSnap = SDL_strcasecmp(p_actor->GetROI()->GetName(), "snap") == 0;
MxBool actorIsValerie = SDL_strcasecmp(p_actor->GetROI()->GetName(), "valerie") == 0;
MxLong time = Timer()->GetTime();
const char* soundKey = NULL;

View File

@ -8,6 +8,7 @@
#include "mxmisc.h"
#include "mxvariabletable.h"
#include <SDL3/SDL_stdinc.h>
#include <vec.h>
// File name verified by BETA10 0x100cedf7
@ -220,7 +221,7 @@ void LegoCarRaceActor::Animate(float p_time)
if (m_unk0x0c == 0) {
const char* value = VariableTable()->GetVariable(g_raceState);
if (strcmpi(value, g_racing) == 0) {
if (SDL_strcasecmp(value, g_racing) == 0) {
m_unk0x0c = 1;
m_lastTime = p_time - 1.0f;
m_unk0x1c = p_time;

View File

@ -26,6 +26,7 @@
#include "realtime/realtime.h"
#include "viewmanager/viewmanager.h"
#include <SDL3/SDL_stdinc.h>
#include <stdio.h>
DECOMP_SIZE_ASSERT(LegoAnimPresenter, 0xbc)
@ -244,7 +245,7 @@ void LegoAnimPresenter::FUN_100692b0()
else if (unk0x04 == 4) {
LegoChar* baseName = new LegoChar[strlen(str)];
strcpy(baseName, str + 1);
strlwr(baseName);
SDL_strlwr(baseName);
LegoChar* und = FUN_10069150(str);
roi = CharacterManager()->FUN_10085a80(und, baseName, TRUE);
@ -268,7 +269,7 @@ void LegoAnimPresenter::FUN_100692b0()
*i = '\0';
}
strlwr(lodName);
SDL_strlwr(lodName);
LegoChar* und = FUN_10069150(str);
roi = CharacterManager()->CreateAutoROI(und, lodName, TRUE);
@ -315,7 +316,7 @@ void LegoAnimPresenter::FUN_100695c0()
*i = '\0';
}
strlwr(lodName);
SDL_strlwr(lodName);
CharacterManager()->CreateAutoROI(actorName, lodName, FALSE);
FUN_100698b0(rois, actorName);
@ -370,7 +371,7 @@ LegoBool LegoAnimPresenter::FUN_100698b0(const CompoundObject& p_rois, const Leg
const char* name = roi->GetName();
if (name != NULL) {
if (!strcmpi(name, str)) {
if (!SDL_strcasecmp(name, str)) {
m_unk0x70->Append(roi);
result = TRUE;
break;
@ -392,7 +393,7 @@ LegoROI* LegoAnimPresenter::FUN_100699e0(const LegoChar* p_und)
while (cursor.Next(roi)) {
LegoChar* und = FUN_100697c0(roi->GetName(), NULL);
if (und != NULL && !strcmpi(und, p_und)) {
if (und != NULL && !SDL_strcasecmp(und, p_und)) {
delete[] und;
return roi;
}
@ -430,7 +431,7 @@ void LegoAnimPresenter::FUN_10069b10()
if (m_roiMap[index]->GetName() != NULL) {
for (MxS32 i = 0; i < m_unk0x94; i++) {
if (m_unk0x8c[i] == NULL && m_unk0x90[i] != NULL) {
if (!strcmpi(m_unk0x90[i], m_roiMap[index]->GetName())) {
if (!SDL_strcasecmp(m_unk0x90[i], m_roiMap[index]->GetName())) {
m_unk0x8c[i] = m_roiMap[index];
break;
}

View File

@ -19,6 +19,8 @@
#include "realtime/realtime.h"
#include "roi/legoroi.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(LegoModelPresenter, 0x6c)
// GLOBAL: LEGO1 0x100f7ae0
@ -98,7 +100,7 @@ MxResult LegoModelPresenter::CreateROI(MxDSChunk* p_chunk)
storage.Read(textureName, textureNameLength);
textureName[textureNameLength] = '\0';
strlwr(textureName);
SDL_strlwr(textureName);
if (textureName[0] == '^') {
strcpy(textureName, textureName + 1);
@ -316,7 +318,7 @@ void LegoModelPresenter::ParseExtra()
list<LegoROI*>& roiList = currentWorld->GetROIList();
for (list<LegoROI*>::iterator it = roiList.begin(); it != roiList.end(); it++) {
if (!strcmpi((*it)->GetName(), output)) {
if (!SDL_strcasecmp((*it)->GetName(), output)) {
m_roi = *it;
roiList.erase(it);

View File

@ -10,6 +10,8 @@
#include "mxdssubscriber.h"
#include "viewmanager/viewlodlist.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(LegoLODList, 0x18)
DECOMP_SIZE_ASSERT(LegoNamedPart, 0x14)
DECOMP_SIZE_ASSERT(LegoNamedPartList, 0x18)
@ -92,7 +94,7 @@ MxResult LegoPartPresenter::Read(MxDSChunk& p_chunk)
storage.Read(textureName, textureNameLength);
textureName[textureNameLength] = '\0';
strlwr(textureName);
SDL_strlwr(textureName);
if (textureName[0] == '^') {
strcpy(textureName, textureName + 1);
@ -166,7 +168,7 @@ MxResult LegoPartPresenter::Read(MxDSChunk& p_chunk)
}
roiName[roiNameLength] = '\0';
strlwr(roiName);
SDL_strlwr(roiName);
if (storage.Read(&numLODs, sizeof(numLODs)) != SUCCESS) {
goto done;

View File

@ -9,6 +9,8 @@
#include "mxdirectx/mxdirect3d.h"
#include "mxdssubscriber.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(LegoTexturePresenter, 0x54)
DECOMP_SIZE_ASSERT(LegoNamedTexture, 0x14)
DECOMP_SIZE_ASSERT(LegoNamedTextureList, 0x18)
@ -57,7 +59,7 @@ MxResult LegoTexturePresenter::Read(MxDSChunk& p_chunk)
}
textureName[textureNameLength] = '\0';
strlwr(textureName);
SDL_strlwr(textureName);
texture = new LegoTexture();
if (texture->Read(&storage, hardwareMode) != SUCCESS) {

View File

@ -19,6 +19,7 @@
#include "tgl/d3drm/impl.h"
#include "viewmanager/viewroi.h"
#include <SDL3/SDL_stdinc.h>
#include <stdio.h>
DECOMP_SIZE_ASSERT(LegoVideoManager, 0x590)
@ -544,7 +545,7 @@ MxPresenter* LegoVideoManager::GetPresenterByActionObjectName(const char* p_acti
continue;
}
if (strcmpi(presenter->GetAction()->GetObjectName(), p_actionObjectName) == 0) {
if (SDL_strcasecmp(presenter->GetAction()->GetObjectName(), p_actionObjectName) == 0) {
return presenter;
}
}

View File

@ -22,6 +22,8 @@
#include "radio.h"
#include "scripts.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(GasStation, 0x128)
DECOMP_SIZE_ASSERT(GasStationState, 0x24)
@ -374,7 +376,7 @@ MxLong GasStation::HandleButtonDown(LegoControlManagerNotificationParam& p_param
LegoROI* roi = PickROI(p_param.GetX(), p_param.GetY());
if (roi != NULL) {
if (!strnicmp(roi->GetName(), "capdb", 5) || !strnicmp(roi->GetName(), "*capdb", 6)) {
if (!SDL_strncasecmp(roi->GetName(), "capdb", 5) || !SDL_strncasecmp(roi->GetName(), "*capdb", 6)) {
m_unk0x104 = 3;
m_unk0x114 = FALSE;

View File

@ -20,6 +20,8 @@
#include "mxtransitionmanager.h"
#include "scripts.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(Hospital, 0x12c)
DECOMP_SIZE_ASSERT(HospitalState, 0x18)
@ -409,7 +411,7 @@ MxLong Hospital::HandleButtonDown(LegoControlManagerNotificationParam& p_param)
roiName += 1;
}
if (!strcmpi("actor_ha", roiName)) {
if (!SDL_strcasecmp("actor_ha", roiName)) {
LegoInputManager* inputManager = InputManager();
inputManager->SetUnknown88(TRUE);
inputManager->SetUnknown336(FALSE);

View File

@ -7,6 +7,8 @@
#include "shape/legomesh.h"
#include "tgl/d3drm/impl.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(LODObject, 0x04)
DECOMP_SIZE_ASSERT(ViewLOD, 0x0c)
DECOMP_SIZE_ASSERT(LegoLOD, 0x20)
@ -380,7 +382,7 @@ LegoResult LegoLOD::GetTexture(LegoTextureInfo*& p_textureInfo)
LegoBool LegoLOD::FUN_100aae20(const LegoChar* p_name)
{
if (p_name != NULL) {
if (!strnicmp(p_name, g_unk0x101013dc, strlen(g_unk0x101013dc))) {
if (!SDL_strncasecmp(p_name, g_unk0x101013dc, strlen(g_unk0x101013dc))) {
return TRUE;
}
}

View File

@ -11,6 +11,8 @@
#include <string.h>
#include <vec.h>
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(LegoROI, 0x108)
DECOMP_SIZE_ASSERT(TimeROI, 0x10c)
@ -135,7 +137,7 @@ LegoResult LegoROI::Read(
goto done;
}
m_name[length] = '\0';
strlwr(m_name);
SDL_strlwr(m_name);
if (sphere.Read(p_storage) != SUCCESS) {
goto done;
@ -162,7 +164,7 @@ LegoResult LegoROI::Read(
goto done;
}
textureName[length] = '\0';
strlwr(textureName);
SDL_strlwr(textureName);
}
else {
textureName = NULL;
@ -216,7 +218,7 @@ LegoResult LegoROI::Read(
if (g_roiConfig <= 2) {
for (i = 0; g_unk0x10101380[i] != NULL; i++) {
if (!strnicmp(m_name, g_unk0x10101380[i], 4)) {
if (!SDL_strncasecmp(m_name, g_unk0x10101380[i], 4)) {
roiName = g_unk0x10101380[i];
break;
}
@ -224,7 +226,7 @@ LegoResult LegoROI::Read(
}
else {
for (i = 0; g_unk0x10101370[i] != NULL; i++) {
if (!strnicmp(m_name, g_unk0x10101370[i], 4)) {
if (!SDL_strncasecmp(m_name, g_unk0x10101370[i], 4)) {
roiName = g_unk0x10101370[i];
break;
}
@ -233,7 +235,7 @@ LegoResult LegoROI::Read(
if ((lodList = p_viewLODListManager->Lookup(roiName))) {
for (j = 0; g_unk0x10101390[j] != NULL; j++) {
if (!strcmpi(g_unk0x10101390[j], roiName)) {
if (!SDL_strcasecmp(g_unk0x10101390[j], roiName)) {
break;
}
}
@ -291,7 +293,7 @@ LegoResult LegoROI::Read(
}
if (textureName != NULL) {
if (!strnicmp(textureName, "t_", 2)) {
if (!SDL_strncasecmp(textureName, "t_", 2)) {
textureInfo = p_textureContainer->Get(textureName + 2);
if (textureInfo == NULL) {
@ -350,7 +352,7 @@ LegoROI* LegoROI::FindChildROI(const LegoChar* p_name, LegoROI* p_roi)
CompoundObject::iterator it;
const LegoChar* name = p_roi->GetName();
if (name != NULL && *name != '\0' && !strcmpi(name, p_name)) {
if (name != NULL && *name != '\0' && !SDL_strcasecmp(name, p_name)) {
return p_roi;
}
@ -360,7 +362,7 @@ LegoROI* LegoROI::FindChildROI(const LegoChar* p_name, LegoROI* p_roi)
LegoROI* roi = (LegoROI*) *it;
name = roi->GetName();
if (name != NULL && *name != '\0' && !strcmpi(name, p_name)) {
if (name != NULL && *name != '\0' && !SDL_strcasecmp(name, p_name)) {
return roi;
}
}
@ -774,7 +776,7 @@ LegoBool LegoROI::FUN_100a9bf0(const LegoChar* p_param, float& p_red, float& p_g
LegoBool LegoROI::ColorAliasLookup(const LegoChar* p_param, float& p_red, float& p_green, float& p_blue, float& p_alpha)
{
for (LegoU32 i = 0; i < sizeOfArray(g_roiColorAliases); i++) {
if (strcmpi(g_roiColorAliases[i].m_name, p_param) == 0) {
if (SDL_strcasecmp(g_roiColorAliases[i].m_name, p_param) == 0) {
p_red = g_roiColorAliases[i].m_red / 255.0;
p_green = g_roiColorAliases[i].m_green / 255.0;
p_blue = g_roiColorAliases[i].m_blue / 255.0;
@ -817,7 +819,7 @@ void LegoROI::SetName(const LegoChar* p_name)
if (p_name != NULL) {
m_name = new LegoChar[strlen(p_name) + 1];
strcpy(m_name, p_name);
strlwr(m_name);
SDL_strlwr(m_name);
}
else {
m_name = NULL;

View File

@ -2,6 +2,8 @@
#include "misc/legostorage.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(LegoMeshUnkComponent, 0x1c)
DECOMP_SIZE_ASSERT(LegoMesh, 0x24)
@ -70,7 +72,7 @@ LegoResult LegoMesh::Read(LegoStorage* p_storage)
}
m_textureName[textureLength] = '\0';
strlwr(m_textureName);
SDL_strlwr(m_textureName);
}
if ((result = p_storage->Read(&materialLength, sizeof(materialLength))) != SUCCESS) {
@ -84,7 +86,7 @@ LegoResult LegoMesh::Read(LegoStorage* p_storage)
}
m_materialName[materialLength] = '\0';
strlwr(m_materialName);
SDL_strlwr(m_materialName);
}
return SUCCESS;

View File

@ -7,6 +7,7 @@
#include "mxtypes.h"
#include <SDL3/SDL_iostream.h>
#include <SDL3/SDL_stdinc.h>
// SIZE 0x18
struct ModelDbPart {
@ -32,7 +33,7 @@ class ModelDbPartList : public MxList<ModelDbPart*> {
// FUNCTION: LEGO1 0x10027c40
MxS8 Compare(ModelDbPart* p_a, ModelDbPart* p_b) override
{
MxS32 compare = strcmpi(p_a->m_roiName.GetData(), p_b->m_roiName.GetData());
MxS32 compare = SDL_strcasecmp(p_a->m_roiName.GetData(), p_b->m_roiName.GetData());
if (compare == 0) {
p_b->m_partDataLength = p_a->m_partDataLength;

View File

@ -14,7 +14,7 @@ class MxPalette;
class MxVideoParam {
public:
MxVideoParam();
__declspec(dllexport)
DLL_EXPORT_SYMBOL
MxVideoParam(MxRect32& p_rect, MxPalette* p_palette, MxULong p_backBuffers, MxVideoParamFlags& p_flags);
MxVideoParam(MxVideoParam& p_videoParam);
~MxVideoParam();

View File

@ -4,6 +4,8 @@
#include "mxtimer.h"
#include "mxvariabletable.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(MxDSSelectAction, 0xb0)
DECOMP_SIZE_ASSERT(MxStringList, 0x18)
DECOMP_SIZE_ASSERT(MxStringListCursor, 0x10)
@ -94,13 +96,13 @@ void MxDSSelectAction::Deserialize(MxU8*& p_source, MxS16 p_unk0x24)
this->m_unk0x9c = (char*) p_source;
if (!strnicmp(this->m_unk0x9c.GetData(), "RANDOM_", strlen("RANDOM_"))) {
if (!SDL_strncasecmp(this->m_unk0x9c.GetData(), "RANDOM_", strlen("RANDOM_"))) {
char buffer[10];
MxS16 value = atoi(&this->m_unk0x9c.GetData()[strlen("RANDOM_")]);
srand(Timer()->GetTime());
MxS32 random = rand() % value;
string = itoa((MxS16) random, buffer, 10);
string = SDL_itoa((MxS16) random, buffer, 10);
}
else {
string = VariableTable()->GetVariable((char*) p_source);

View File

@ -11,6 +11,7 @@
#include "mxutilities.h"
#include <assert.h>
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(MxWavePresenter, 0x6c);
DECOMP_SIZE_ASSERT(MxWavePresenter::WaveFormat, 0x18);
@ -326,7 +327,7 @@ void MxWavePresenter::ParseExtra()
char soundValue[512];
if (KeyValueStringParse(soundValue, g_strSOUND, extraCopy)) {
if (!strcmpi(soundValue, "FALSE")) {
if (!SDL_strcasecmp(soundValue, "FALSE")) {
Enable(FALSE);
}
}

View File

@ -3,6 +3,7 @@
#include "decomp.h"
#include <SDL3/SDL_platform_defines.h>
#include <SDL3/SDL_stdinc.h>
#include <stdlib.h>
#include <string.h>
@ -90,14 +91,14 @@ void MxString::Reverse()
// FUNCTION: BETA10 0x1012c537
void MxString::ToUpperCase()
{
strupr(this->m_data);
SDL_strupr(this->m_data);
}
// FUNCTION: LEGO1 0x100ae4a0
// FUNCTION: BETA10 0x1012c55c
void MxString::ToLowerCase()
{
strlwr(this->m_data);
SDL_strlwr(this->m_data);
}
// FUNCTION: LEGO1 0x100ae4b0

View File

@ -10,6 +10,7 @@
#include "mxrect32.h"
#include <assert.h>
#include <SDL3/SDL_stdinc.h>
// GLOBAL: LEGO1 0x101020e8
void (*g_omniUserMessage)(const char*, MxS32) = NULL;
@ -71,7 +72,7 @@ void MakeSourceName(char* p_output, const char* p_input)
strcpy(p_output, p_input);
strlwr(p_output);
SDL_strlwr(p_output);
char* extLoc = strstr(p_output, ".si");
if (extLoc) {
@ -94,7 +95,7 @@ MxBool KeyValueStringParse(char* p_output, const char* p_command, const char* p_
for (char* token = strtok(string, ", \t\r\n:"); token; token = strtok(NULL, ", \t\r\n:")) {
len -= (strlen(token) + 1);
if (strcmpi(token, p_command) == 0) {
if (SDL_strcasecmp(token, p_command) == 0) {
if (p_output && len > 0) {
char* output = p_output;
char* cur = &token[strlen(p_command)];

View File

@ -12,6 +12,8 @@
#include "mxutilities.h"
#include "mxvideomanager.h"
#include <SDL3/SDL_stdinc.h>
DECOMP_SIZE_ASSERT(MxStillPresenter, 0x6c);
// FUNCTION: LEGO1 0x100b9c70
@ -209,7 +211,7 @@ void MxStillPresenter::ParseExtra()
char output[512];
if (KeyValueStringParse(output, g_strVISIBILITY, extraCopy)) {
if (strcmpi(output, "FALSE") == 0) {
if (SDL_strcasecmp(output, "FALSE") == 0) {
Enable(FALSE);
}
}