mirror of
https://github.com/kevinbentley/Descent3.git
synced 2025-01-22 11:28:56 +00:00
Replace strcmpi
with stricmp
This commit is contained in:
parent
a77fdd7426
commit
76e86fed8c
@ -5756,7 +5756,7 @@ char *LocalizeLevelName(char *level) {
|
||||
|
||||
// Now search for the correct level
|
||||
for (int i = 0; i < num_english_names; i++) {
|
||||
if (0 == strcmpi(level, english_names[i])) {
|
||||
if (0 == stricmp(level, english_names[i])) {
|
||||
// Ok, we found a match. So return the local text.
|
||||
strcpy(local_name, local_names[i]);
|
||||
DestroyStringTable(english_names, num_english_names);
|
||||
|
@ -704,7 +704,7 @@ static inline bool IS_MN3_FILE(const char *fname) {
|
||||
char name[PSFILENAME_LEN + 1];
|
||||
char ext[PSFILENAME_LEN + 1];
|
||||
ddio_SplitPath(fname, NULL, name, ext);
|
||||
return (strcmpi(ext, ".mn3") == 0) ? true : false;
|
||||
return (stricmp(ext, ".mn3") == 0) ? true : false;
|
||||
}
|
||||
|
||||
static inline char *MN3_TO_MSN_NAME(const char *mn3name, char *msnname) {
|
||||
@ -884,20 +884,20 @@ bool LoadMission(const char *mssn) {
|
||||
// ShowProgressScreen(TXT_LOADINGLEVEL);
|
||||
#if (defined(OEM) || defined(DEMO))
|
||||
#ifdef OEM
|
||||
if (strcmpi(mssn, "d3oem.mn3") == 0)
|
||||
if (stricmp(mssn, "d3oem.mn3") == 0)
|
||||
return DemoMission(0);
|
||||
#elif defined(DEMO)
|
||||
if (strcmpi(mssn, "d3demo.mn3") == 0)
|
||||
if (stricmp(mssn, "d3demo.mn3") == 0)
|
||||
return DemoMission(0);
|
||||
#endif
|
||||
else if (strcmpi(mssn, "polaris.d3l") == 0)
|
||||
else if (stricmp(mssn, "polaris.d3l") == 0)
|
||||
return DemoMission(1);
|
||||
else if (strcmpi(mssn, "thecore.d3l") == 0)
|
||||
else if (stricmp(mssn, "thecore.d3l") == 0)
|
||||
return DemoMission(2);
|
||||
else if (strcmpi(mssn, "taurus.d3l") == 0)
|
||||
else if (stricmp(mssn, "taurus.d3l") == 0)
|
||||
return DemoMission(3);
|
||||
#ifdef OEM
|
||||
else if (strcmpi(mssn, "training.mn3") == 0)
|
||||
else if (stricmp(mssn, "training.mn3") == 0)
|
||||
return DemoMission(4);
|
||||
#endif
|
||||
#else
|
||||
@ -921,11 +921,11 @@ bool LoadMission(const char *mssn) {
|
||||
|
||||
// Correct for mission split hack
|
||||
|
||||
if (strcmpi(mssn, "d3_2.mn3") == 0) {
|
||||
if (stricmp(mssn, "d3_2.mn3") == 0) {
|
||||
strcpy(mission, "d3_2.mn3");
|
||||
strcpy(pathname, "d3_2.mn3");
|
||||
|
||||
} else if (strcmpi(mssn, "d3.mn3") == 0) {
|
||||
} else if (stricmp(mssn, "d3.mn3") == 0) {
|
||||
strcpy(mission, "d3.mn3");
|
||||
strcpy(pathname, "d3.mn3");
|
||||
|
||||
@ -980,33 +980,33 @@ bool LoadMission(const char *mssn) {
|
||||
CleanupStr(operand, srcline + strlen(command) + 1, sizeof(operand));
|
||||
if (strlen(command) && indesc)
|
||||
indesc = 0;
|
||||
if (!strcmpi(command, "NAME")) {
|
||||
if (!stricmp(command, "NAME")) {
|
||||
strncpy(msn->name, operand, MSN_NAMELEN - 1);
|
||||
} else if (!strcmpi(command, "MULTI")) {
|
||||
if (strcmpi("no", operand) == 0)
|
||||
} else if (!stricmp(command, "MULTI")) {
|
||||
if (stricmp("no", operand) == 0)
|
||||
msn->multiplayable = false;
|
||||
} else if (!strcmpi(command, "SINGLE")) {
|
||||
if (strcmpi("no", operand) == 0)
|
||||
} else if (!stricmp(command, "SINGLE")) {
|
||||
if (stricmp("no", operand) == 0)
|
||||
msn->singleplayable = false;
|
||||
} else if (!strcmpi(command, "TRAINER")) {
|
||||
} else if (!stricmp(command, "TRAINER")) {
|
||||
if (curlvlnum == 0) {
|
||||
msn->training_mission = true;
|
||||
} else {
|
||||
strcpy(errtext, TXT_MSN_MSNCOMMAND);
|
||||
goto msnfile_error;
|
||||
}
|
||||
} else if (!strcmpi(command, "AUTHOR")) {
|
||||
} else if (!stricmp(command, "AUTHOR")) {
|
||||
strncpy(msn->author, operand, MSN_NAMELEN - 1);
|
||||
} else if (!strcmpi(command, "KEYWORDS")) {
|
||||
} else if (!stricmp(command, "KEYWORDS")) {
|
||||
// Don't do anything with this
|
||||
} else if (!strcmpi(command, "DESCRIPTION") || indesc) {
|
||||
} else if (!stricmp(command, "DESCRIPTION") || indesc) {
|
||||
// multi-line descriptions require the strcat. the initial
|
||||
// strings should be empty for this to work.
|
||||
strcat(msn->desc, operand);
|
||||
if (indesc)
|
||||
strcat(msn->desc, "\n");
|
||||
indesc = 1; // this is a multiline command
|
||||
} else if (!strcmpi(command, "URL")) {
|
||||
} else if (!stricmp(command, "URL")) {
|
||||
if (curlvlnum != 0) {
|
||||
strcpy(errtext, TXT_MSN_LVLCOMMAND);
|
||||
goto msnfile_error;
|
||||
@ -1020,7 +1020,7 @@ bool LoadMission(const char *mssn) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (!strcmpi(command, "SHIP")) {
|
||||
} else if (!stricmp(command, "SHIP")) {
|
||||
// there is a different default ship
|
||||
if (curlvlnum != 0) {
|
||||
strcpy(errtext, TXT_MSN_LVLCOMMAND);
|
||||
@ -1036,13 +1036,13 @@ bool LoadMission(const char *mssn) {
|
||||
Int3();
|
||||
}
|
||||
}
|
||||
} else if (!strcmpi(command, "EMAIL")) {
|
||||
} else if (!stricmp(command, "EMAIL")) {
|
||||
if (curlvlnum != 0) {
|
||||
strcpy(errtext, TXT_MSN_LVLCOMMAND);
|
||||
goto msnfile_error;
|
||||
} else
|
||||
strncpy(msn->email, operand, MSN_URLLEN - 1);
|
||||
} else if (!strcmpi(command, "SCORE")) {
|
||||
} else if (!stricmp(command, "SCORE")) {
|
||||
if (curlvlnum == 0) {
|
||||
strcpy(errtext, TXT_MSN_LVLCOMMAND);
|
||||
goto msnfile_error;
|
||||
@ -1052,7 +1052,7 @@ bool LoadMission(const char *mssn) {
|
||||
if (!lvls[curlvlnum - 1].score)
|
||||
goto fatal_error;
|
||||
}
|
||||
} else if (!strcmpi(command, "PROGRESS")) {
|
||||
} else if (!stricmp(command, "PROGRESS")) {
|
||||
if (curlvlnum == 0) {
|
||||
strcpy(errtext, TXT_MSN_LVLCOMMAND);
|
||||
goto msnfile_error;
|
||||
@ -1061,7 +1061,7 @@ bool LoadMission(const char *mssn) {
|
||||
if (!lvls[curlvlnum - 1].progress)
|
||||
goto fatal_error;
|
||||
}
|
||||
} else if (!strcmpi(command, "HOG")) {
|
||||
} else if (!stricmp(command, "HOG")) {
|
||||
if (curlvlnum == 0) {
|
||||
msn->hog = mem_strdup(operand);
|
||||
if (!msn->hog)
|
||||
@ -1071,7 +1071,7 @@ bool LoadMission(const char *mssn) {
|
||||
if (!(lvls[curlvlnum - 1].hog = mem_strdup(operand)))
|
||||
goto fatal_error;
|
||||
}
|
||||
} else if (!strcmpi(command, "NUMLEVELS")) {
|
||||
} else if (!stricmp(command, "NUMLEVELS")) {
|
||||
if (curlvlnum != 0) {
|
||||
strcpy(errtext, TXT_MSN_LVLCOMMAND);
|
||||
goto msnfile_error;
|
||||
@ -1086,7 +1086,7 @@ bool LoadMission(const char *mssn) {
|
||||
memset(lvls, 0, sizeof(tLevelNode) * value);
|
||||
numlevels = value;
|
||||
}
|
||||
} else if (!strcmpi(command, "LEVEL")) {
|
||||
} else if (!stricmp(command, "LEVEL")) {
|
||||
// first check if number of level is greater than num_levels
|
||||
if ((curlvlnum == numlevels) && (numlevels != -1)) {
|
||||
strcpy(errtext, TXT_MSN_NUMLVLSINVALID);
|
||||
@ -1100,7 +1100,7 @@ bool LoadMission(const char *mssn) {
|
||||
strcpy(errtext, TXT_MSN_LVLNUMINVALID);
|
||||
goto msnfile_error;
|
||||
}
|
||||
} else if (!strcmpi(command, "INTROMOVIE")) {
|
||||
} else if (!stricmp(command, "INTROMOVIE")) {
|
||||
if (curlvlnum == 0) {
|
||||
strcpy(errtext, TXT_MSN_LVLCOMMAND);
|
||||
goto msnfile_error;
|
||||
@ -1109,7 +1109,7 @@ bool LoadMission(const char *mssn) {
|
||||
if (!(lvls[curlvlnum - 1].moviename = mem_strdup(operand)))
|
||||
goto fatal_error;
|
||||
}
|
||||
} else if (!strcmpi(command, "INTRODEFAULT")) {
|
||||
} else if (!stricmp(command, "INTRODEFAULT")) {
|
||||
if (curlvlnum == 0) {
|
||||
strcpy(errtext, TXT_MSN_LVLCOMMAND);
|
||||
goto msnfile_error;
|
||||
@ -1118,7 +1118,7 @@ bool LoadMission(const char *mssn) {
|
||||
if (!(lvls[curlvlnum - 1].moviename = mem_strdup(operand)))
|
||||
goto fatal_error;
|
||||
}
|
||||
} else if (!strcmpi(command, "ENDMOVIE")) {
|
||||
} else if (!stricmp(command, "ENDMOVIE")) {
|
||||
if (curlvlnum == 0) {
|
||||
strcpy(errtext, TXT_MSN_LVLCOMMAND);
|
||||
goto msnfile_error;
|
||||
@ -1127,7 +1127,7 @@ bool LoadMission(const char *mssn) {
|
||||
if (!(lvls[curlvlnum - 1].endmovie = mem_strdup(operand)))
|
||||
goto fatal_error;
|
||||
}
|
||||
} else if (!strcmpi(command, "MINE")) {
|
||||
} else if (!stricmp(command, "MINE")) {
|
||||
if (curlvlnum == 0) {
|
||||
strcpy(errtext, TXT_MSN_LVLCOMMAND);
|
||||
goto msnfile_error;
|
||||
@ -1135,7 +1135,7 @@ bool LoadMission(const char *mssn) {
|
||||
if (!(lvls[curlvlnum - 1].filename = mem_strdup(operand)))
|
||||
goto fatal_error;
|
||||
}
|
||||
} else if (!strcmpi(command, "SECRET")) {
|
||||
} else if (!stricmp(command, "SECRET")) {
|
||||
if (curlvlnum == 0) {
|
||||
strcpy(errtext, TXT_MSN_LVLCOMMAND);
|
||||
goto msnfile_error;
|
||||
@ -1143,7 +1143,7 @@ bool LoadMission(const char *mssn) {
|
||||
lvls[curlvlnum - 1].flags |= LVLFLAG_SPAWNSECRET;
|
||||
lvls[curlvlnum - 1].secretlvl = atoi(operand);
|
||||
}
|
||||
} else if (!strcmpi(command, "BRIEFING")) {
|
||||
} else if (!stricmp(command, "BRIEFING")) {
|
||||
if (curlvlnum == 0) {
|
||||
strcpy(errtext, TXT_MSN_LVLCOMMAND);
|
||||
goto msnfile_error;
|
||||
@ -1152,7 +1152,7 @@ bool LoadMission(const char *mssn) {
|
||||
if (!(lvls[curlvlnum - 1].briefname = mem_strdup(operand)))
|
||||
goto fatal_error;
|
||||
}
|
||||
} else if (!strcmpi(command, "BRANCH")) {
|
||||
} else if (!stricmp(command, "BRANCH")) {
|
||||
// first check if number of level is greater than num_levels
|
||||
int lvlnum;
|
||||
if (curlvlnum == 0) {
|
||||
@ -1166,7 +1166,7 @@ bool LoadMission(const char *mssn) {
|
||||
}
|
||||
lvls[curlvlnum - 1].flags |= LVLFLAG_BRANCH;
|
||||
lvls[curlvlnum - 1].lvlbranch0 = lvlnum;
|
||||
} else if (!strcmpi(command, "ENDMISSION")) {
|
||||
} else if (!stricmp(command, "ENDMISSION")) {
|
||||
if (curlvlnum == 0) {
|
||||
strcpy(errtext, TXT_MSN_LVLCOMMAND);
|
||||
goto msnfile_error;
|
||||
@ -1760,32 +1760,32 @@ bool GetMissionInfo(const char *msnfile, tMissionInfo *msn) {
|
||||
CleanupStr(operand, srcline + strlen(command) + 1, sizeof(operand));
|
||||
if (strlen(command) && indesc)
|
||||
indesc = false;
|
||||
if (!strcmpi(command, "NAME")) {
|
||||
if (!stricmp(command, "NAME")) {
|
||||
strncpy(msn->name, operand, MSN_NAMELEN - 1);
|
||||
} else if (!strcmpi(command, "MULTI")) {
|
||||
if (strcmpi("no", operand) == 0)
|
||||
} else if (!stricmp(command, "MULTI")) {
|
||||
if (stricmp("no", operand) == 0)
|
||||
msn->multi = false;
|
||||
} else if (!strcmpi(command, "SINGLE")) {
|
||||
if (strcmpi("no", operand) == 0)
|
||||
} else if (!stricmp(command, "SINGLE")) {
|
||||
if (stricmp("no", operand) == 0)
|
||||
msn->single = false;
|
||||
} else if (!strcmpi(command, "TRAINER")) {
|
||||
} else if (!stricmp(command, "TRAINER")) {
|
||||
msn->training = true;
|
||||
} else if (!strcmpi(command, "AUTHOR")) {
|
||||
} else if (!stricmp(command, "AUTHOR")) {
|
||||
strncpy(msn->author, operand, MSN_NAMELEN - 1);
|
||||
} else if (!strcmpi(command, "DESCRIPTION") || indesc) {
|
||||
} else if (!stricmp(command, "DESCRIPTION") || indesc) {
|
||||
// multi-line descriptions require the strcat. the initial
|
||||
// strings should be empty for this to work.
|
||||
strcat(msn->desc, operand);
|
||||
if (indesc)
|
||||
strcat(msn->desc, "\n");
|
||||
indesc = true; // this is a multiline command
|
||||
} else if (!strcmpi(command, "NUMLEVELS")) {
|
||||
} else if (!stricmp(command, "NUMLEVELS")) {
|
||||
// get number of levels
|
||||
int value = atoi(operand);
|
||||
msn->n_levels = value;
|
||||
} else if (!strcmpi(command, "LEVEL")) {
|
||||
} else if (!stricmp(command, "LEVEL")) {
|
||||
break;
|
||||
} else if (!strcmpi(command, "KEYWORDS")) {
|
||||
} else if (!stricmp(command, "KEYWORDS")) {
|
||||
// Read in all the keywords
|
||||
strncpy(msn->keywords, operand, MAX_KEYWORDLEN);
|
||||
}
|
||||
@ -1853,12 +1853,12 @@ bool mn3_Open(const char *mn3file) {
|
||||
ddio_SplitPath(mn3file, NULL, filename, ext);
|
||||
|
||||
// char voice_hog[_MAX_PATH*2];
|
||||
if ((strcmpi(filename, "d3") == 0) || (strcmpi(filename, "training") == 0)) {
|
||||
if ((stricmp(filename, "d3") == 0) || (stricmp(filename, "training") == 0)) {
|
||||
// Open audio hog file
|
||||
// ddio_MakePath(voice_hog, D3MissionsDir, "d3voice1.hog", NULL);//Audio for levels 1-4
|
||||
const char *v = GetMultiCDPath("d3voice1.hog");
|
||||
Mission_voice_hog_handle = cf_OpenLibrary(v);
|
||||
} else if (strcmpi(filename, "d3_2") == 0) {
|
||||
} else if (stricmp(filename, "d3_2") == 0) {
|
||||
// Open audio hog file
|
||||
// ddio_MakePath(voice_hog, D3MissionsDir, "d3voice2.hog", NULL);//Audio for levels 5-17
|
||||
const char *v = GetMultiCDPath("d3voice2.hog");
|
||||
@ -1876,7 +1876,7 @@ bool mn3_GetInfo(const char *mn3file, tMissionInfo *msn) {
|
||||
char pathname[PSPATHNAME_LEN];
|
||||
char filename[PSFILENAME_LEN + 1];
|
||||
|
||||
if (strcmpi(mn3file, "d3.mn3") == 0) {
|
||||
if (stricmp(mn3file, "d3.mn3") == 0) {
|
||||
const char *p = GetMultiCDPath((char *)mn3file);
|
||||
if (!p)
|
||||
return false;
|
||||
@ -1981,7 +1981,7 @@ int MissionGetKeywords(const char *mission, char *keywords) {
|
||||
}
|
||||
if (strnicmp(mod_keywords[i], MODMINGOALS, MODMINGOALSLEN) == 0) {
|
||||
goalsneeded = atoi(mod_keywords[i] + MODMINGOALSLEN);
|
||||
} else if (strcmpi("GOALPERTEAM", mod_keywords[i]) == 0) {
|
||||
} else if (stricmp("GOALPERTEAM", mod_keywords[i]) == 0) {
|
||||
goal_per_team = true;
|
||||
} else {
|
||||
bool found_keyword = false;
|
||||
@ -1990,7 +1990,7 @@ int MissionGetKeywords(const char *mission, char *keywords) {
|
||||
if (msn_keywords[a][0] == 0) {
|
||||
continue;
|
||||
}
|
||||
if (strcmpi(msn_keywords[a], mod_keywords[i]) == 0) {
|
||||
if (stricmp(msn_keywords[a], mod_keywords[i]) == 0) {
|
||||
// Woohoo! it's found
|
||||
found_keyword = true;
|
||||
break;
|
||||
|
@ -330,7 +330,7 @@ bool CockpitFileParse(const char *command, const char *operand, void *data) {
|
||||
int i;
|
||||
for (i = 0; i < NUM_SHIELD_GAUGE_FRAMES; i++) {
|
||||
snprintf(buf, sizeof(buf), "shieldimg%d", i);
|
||||
if (!strcmpi(command, buf)) {
|
||||
if (!stricmp(command, buf)) {
|
||||
if (cfginf)
|
||||
strcpy(cfginf->shieldrings[i], operand);
|
||||
break;
|
||||
|
@ -256,11 +256,11 @@ int RunServerConfigs() {
|
||||
|
||||
// Put in the correct mission names for the oem builds
|
||||
#if (defined(OEM) || defined(DEMO))
|
||||
if (strcmpi("polaris.d3l", Netgame.mission) == 0) {
|
||||
if (stricmp("polaris.d3l", Netgame.mission) == 0) {
|
||||
strcpy(Netgame.mission_name, "Polaris");
|
||||
} else if (strcmpi("taurus.d3l", Netgame.mission) == 0) {
|
||||
} else if (stricmp("taurus.d3l", Netgame.mission) == 0) {
|
||||
strcpy(Netgame.mission_name, "Taurus");
|
||||
} else if (strcmpi("thecore.d3l", Netgame.mission) == 0) {
|
||||
} else if (stricmp("thecore.d3l", Netgame.mission) == 0) {
|
||||
strcpy(Netgame.mission_name, "The Core");
|
||||
}
|
||||
#else
|
||||
|
@ -355,7 +355,7 @@ void DemoToggleRecording() {
|
||||
// hand coded 128 because long filenames were failing in cfopen(which called fopen, which failed on very
|
||||
// long filenames. instead of printing a message out to the user, just don't allow filenames that long)
|
||||
if (DoEditDialog(TXT_DEMOFILENAME, szfile, 128)) {
|
||||
if (strcmpi(szfile + (strlen(szfile) - 4), ".dem") != 0) {
|
||||
if (stricmp(szfile + (strlen(szfile) - 4), ".dem") != 0) {
|
||||
strcat(szfile, ".dem");
|
||||
}
|
||||
ddio_MakePath(Demo_fname, Base_directory, "demo", szfile, NULL);
|
||||
@ -392,7 +392,7 @@ void DemoWriteHeader() {
|
||||
// Next is the version
|
||||
cf_WriteShort(Demo_cfp, GAMESAVE_VERSION);
|
||||
// Write the mission filename
|
||||
if (Current_mission.filename && (strcmpi("d3_2.mn3", Current_mission.filename) == 0)) {
|
||||
if (Current_mission.filename && (stricmp("d3_2.mn3", Current_mission.filename) == 0)) {
|
||||
cf_WriteString(Demo_cfp, "d3.mn3");
|
||||
} else {
|
||||
cf_WriteString(Demo_cfp, Current_mission.filename ? Current_mission.filename : "");
|
||||
|
@ -866,7 +866,7 @@ const char *GetMultiCDPath(const char *file) {
|
||||
vol_filename = temp_filename;
|
||||
}
|
||||
|
||||
if (strcmpi(vol_filename, file) == 0) {
|
||||
if (stricmp(vol_filename, file) == 0) {
|
||||
volume = file_volumes[i].volume;
|
||||
ddio_MakePath(fullpath, LocalD3Dir, file_volumes[i].localpath, file, NULL);
|
||||
// See if the file is in the local dir already.
|
||||
@ -874,7 +874,7 @@ const char *GetMultiCDPath(const char *file) {
|
||||
return fullpath;
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
else if (strcmpi(file_volumes[i].localpath, "movies") == 0) {
|
||||
else if (stricmp(file_volumes[i].localpath, "movies") == 0) {
|
||||
// if one specified a directory where the movies are located.
|
||||
int arg = FindArg("-moviedir");
|
||||
if (arg) {
|
||||
|
@ -473,7 +473,7 @@ void SaveGameDialog() {
|
||||
hot = (newuiHotspot *)sheet->GetGadget(SAVE_HOTSPOT_ID + i);
|
||||
hot_desc = hot->GetTitle();
|
||||
|
||||
if (occupied_slot[i] && strcmpi(hot_desc, desc) == 0 && slot != i) {
|
||||
if (occupied_slot[i] && stricmp(hot_desc, desc) == 0 && slot != i) {
|
||||
DoMessageBox("", TXT_SAVEGAMEDUP, MSGBOX_OK);
|
||||
goto reenter_save;
|
||||
}
|
||||
@ -750,7 +750,7 @@ bool SaveGameState(const char *pathname, const char *description) {
|
||||
// write out mission level information
|
||||
cf_WriteShort(fp, (int16_t)Current_mission.cur_level);
|
||||
|
||||
if (Current_mission.filename && (strcmpi("d3_2.mn3", Current_mission.filename) == 0)) {
|
||||
if (Current_mission.filename && (stricmp("d3_2.mn3", Current_mission.filename) == 0)) {
|
||||
cf_WriteString(fp, "d3.mn3");
|
||||
} else {
|
||||
cf_WriteString(fp, Current_mission.filename ? Current_mission.filename : "");
|
||||
|
@ -1305,7 +1305,7 @@ void CheckHogfile() {
|
||||
char hogpath[_MAX_PATH * 2];
|
||||
mprintf((0, "Checking to see if we need to open another hog off of disk or CDROM\n"));
|
||||
|
||||
if (Current_mission.filename && (strcmpi(Current_mission.filename, "d3.mn3") == 0) &&
|
||||
if (Current_mission.filename && (stricmp(Current_mission.filename, "d3.mn3") == 0) &&
|
||||
(Current_mission.cur_level > 4)) {
|
||||
// close the mission hog file and open d3_2.mn3
|
||||
mn3_Close();
|
||||
@ -1318,7 +1318,7 @@ void CheckHogfile() {
|
||||
} else {
|
||||
SetFunctionMode(MENU_MODE);
|
||||
}
|
||||
} else if (Current_mission.filename && (strcmpi(Current_mission.filename, "d3_2.mn3") == 0) &&
|
||||
} else if (Current_mission.filename && (stricmp(Current_mission.filename, "d3_2.mn3") == 0) &&
|
||||
(Current_mission.cur_level <= 4)) {
|
||||
// Part 2 of the mission is d3_2.mn3
|
||||
// close the mission hog file and open d3.mn3
|
||||
@ -1640,7 +1640,7 @@ bool LoadAndStartCurrentLevel() {
|
||||
char hogpath[_MAX_PATH * 2];
|
||||
// This is a bit redundant because we just did it in most cases, but we need to be sure that it always happens,
|
||||
// and this code is here for weird systems, like save/load and demo, etc.
|
||||
if (Current_mission.filename && (strcmpi(Current_mission.filename, "d3.mn3") == 0) &&
|
||||
if (Current_mission.filename && (stricmp(Current_mission.filename, "d3.mn3") == 0) &&
|
||||
(Current_mission.cur_level > 4)) {
|
||||
// close the mission hog file and open d3_2.mn3
|
||||
mn3_Close();
|
||||
@ -1653,7 +1653,7 @@ bool LoadAndStartCurrentLevel() {
|
||||
} else {
|
||||
SetFunctionMode(MENU_MODE);
|
||||
}
|
||||
} else if (Current_mission.filename && (strcmpi(Current_mission.filename, "d3_2.mn3") == 0) &&
|
||||
} else if (Current_mission.filename && (stricmp(Current_mission.filename, "d3_2.mn3") == 0) &&
|
||||
(Current_mission.cur_level <= 4)) {
|
||||
// Part 2 of the mission is d3_2.mn3
|
||||
// close the mission hog file and open d3.mn3
|
||||
@ -2114,7 +2114,7 @@ void RunGameMenu() {
|
||||
int ret = 0;
|
||||
ui_ShowCursor();
|
||||
// Weird code for the training mission and the first time you play...
|
||||
if (Current_mission.filename && (strcmpi(Current_mission.filename, "training.mn3") == 0) && (FirstGame)) {
|
||||
if (Current_mission.filename && (stricmp(Current_mission.filename, "training.mn3") == 0) && (FirstGame)) {
|
||||
ret = DoMessageBoxAdvanced(TXT_TRAININGABORTTITLE, TXT_TRAININGABORTTEXT, TXT_SKIP, KEY_S, TXT_ABORT, KEY_A,
|
||||
TXT_CANCEL, KEY_ESC, NULL);
|
||||
if (ret == 2) {
|
||||
|
@ -1081,7 +1081,7 @@ void LoadHUDConfig(const char *filename, bool (*fn)(const char *, const char *,
|
||||
// check if valid cockpit file
|
||||
cf_ReadString(srcline, sizeof(srcline), fp);
|
||||
|
||||
if (strcmpi(srcline, "[hud file]") == 0) {
|
||||
if (stricmp(srcline, "[hud file]") == 0) {
|
||||
tHUDItem hud_item;
|
||||
|
||||
memset(&hud_item, 0, sizeof(hud_item));
|
||||
@ -1108,54 +1108,54 @@ void LoadHUDConfig(const char *filename, bool (*fn)(const char *, const char *,
|
||||
continue;
|
||||
|
||||
// find command,
|
||||
if (!strcmpi(command, "type")) {
|
||||
if (!stricmp(command, "type")) {
|
||||
// get operand.
|
||||
hud_item.type = atoi(operand);
|
||||
} else if (!strcmpi(command, "pos")) {
|
||||
} else if (!stricmp(command, "pos")) {
|
||||
// get two numbers from line
|
||||
int ix, iy;
|
||||
sscanf(operand, "%d,%d", &ix, &iy);
|
||||
hud_item.x = ix;
|
||||
hud_item.y = iy;
|
||||
} else if (!strcmpi(command, "posA")) {
|
||||
} else if (!stricmp(command, "posA")) {
|
||||
// get two numbers from line
|
||||
int ix, iy;
|
||||
sscanf(operand, "%d,%d", &ix, &iy);
|
||||
hud_item.xa = ix;
|
||||
hud_item.ya = iy;
|
||||
} else if (!strcmpi(command, "posB")) {
|
||||
} else if (!stricmp(command, "posB")) {
|
||||
// get two numbers from line
|
||||
int ix, iy;
|
||||
sscanf(operand, "%d,%d", &ix, &iy);
|
||||
hud_item.xb = ix;
|
||||
hud_item.yb = iy;
|
||||
} else if (!strcmpi(command, "grscale")) {
|
||||
} else if (!stricmp(command, "grscale")) {
|
||||
sscanf(operand, "%f,%f", &hud_item.grscalex, &hud_item.grscaley);
|
||||
} else if (!strcmpi(command, "textpos")) {
|
||||
} else if (!stricmp(command, "textpos")) {
|
||||
// get two numbers from line
|
||||
int ix, iy;
|
||||
sscanf(operand, "%d,%d", &ix, &iy);
|
||||
hud_item.tx = ix;
|
||||
hud_item.ty = iy;
|
||||
text_pos = true;
|
||||
} else if (!strcmpi(command, "alpha")) {
|
||||
} else if (!stricmp(command, "alpha")) {
|
||||
// get alpha value.
|
||||
hud_item.alpha = atoi(operand);
|
||||
} else if (!strcmpi(command, "sat")) {
|
||||
} else if (!stricmp(command, "sat")) {
|
||||
// saturation count
|
||||
hud_item.saturation_count = atoi(operand);
|
||||
} else if (!strcmpi(command, "rgb")) {
|
||||
} else if (!stricmp(command, "rgb")) {
|
||||
// saturation count
|
||||
int r, g, b;
|
||||
sscanf(operand, "%d,%d,%d", &r, &g, &b);
|
||||
hud_item.color = GR_RGB(r, g, b);
|
||||
} else if (!strcmpi(command, "textrgb")) {
|
||||
} else if (!stricmp(command, "textrgb")) {
|
||||
int r, g, b;
|
||||
sscanf(operand, "%d,%d,%d", &r, &g, &b);
|
||||
hud_item.tcolor = GR_RGB(r, g, b);
|
||||
} else if (!strcmpi(command, "special")) {
|
||||
} else if (!stricmp(command, "special")) {
|
||||
hud_item.stat |= STAT_SPECIAL;
|
||||
} else if (!strcmpi(command, "create")) {
|
||||
} else if (!stricmp(command, "create")) {
|
||||
// create hud item.
|
||||
if (!text_pos) {
|
||||
hud_item.tx = hud_item.x;
|
||||
@ -1170,10 +1170,10 @@ void LoadHUDConfig(const char *filename, bool (*fn)(const char *, const char *,
|
||||
hud_item.color = HUD_COLOR;
|
||||
hud_item.tcolor = HUD_COLOR;
|
||||
text_pos = false;
|
||||
} else if (!strcmpi(command, "reticleprefix")) {
|
||||
} else if (!stricmp(command, "reticleprefix")) {
|
||||
// copy prefix of reticle bitmaps.
|
||||
strcpy(Reticle_prefix, operand);
|
||||
} else if (!strcmpi(command, "reticleoffset")) {
|
||||
} else if (!stricmp(command, "reticleoffset")) {
|
||||
int x, y;
|
||||
sscanf(operand, "%d,%d", &x, &y);
|
||||
Ret_x_off = (int16_t)x;
|
||||
|
@ -1272,9 +1272,9 @@ void LoadGameSettings() {
|
||||
ddio_SetKeyboardLanguage(KBLANG_AMERICAN);
|
||||
|
||||
if (Database->read("KeyboardType", tempbuffer, &templen)) {
|
||||
if (strcmpi(tempbuffer, "French") == 0) {
|
||||
if (stricmp(tempbuffer, "French") == 0) {
|
||||
ddio_SetKeyboardLanguage(KBLANG_FRENCH);
|
||||
} else if (strcmpi(tempbuffer, "German") == 0) {
|
||||
} else if (stricmp(tempbuffer, "German") == 0) {
|
||||
ddio_SetKeyboardLanguage(KBLANG_GERMAN);
|
||||
}
|
||||
}
|
||||
|
@ -306,7 +306,7 @@ int LoadGameState(const char *pathname) {
|
||||
curlevel = (uint16_t)cf_ReadShort(fp);
|
||||
cf_ReadString(path, sizeof(path), fp);
|
||||
|
||||
if ((curlevel > 4) && (strcmpi(path, "d3.mn3") == 0)) {
|
||||
if ((curlevel > 4) && (stricmp(path, "d3.mn3") == 0)) {
|
||||
strcpy(path, "d3_2.mn3");
|
||||
}
|
||||
|
||||
|
@ -1872,7 +1872,7 @@ int FindMatcenIndex(const char *name) {
|
||||
for (i = 0; i < Num_matcens; i++) {
|
||||
Matcen[i]->GetName(temp);
|
||||
|
||||
if (!(strcmpi(temp, name))) {
|
||||
if (!(stricmp(temp, name))) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
@ -933,18 +933,18 @@ bool ProcessCommandLine() {
|
||||
#ifdef DEMO
|
||||
szurl[strlen("d3demo2://") - 1] = '\0'; // Should make the string "d3demo:/"
|
||||
p = szurl + strlen("d3demo2://"); // pointer to the first character of the url after the //
|
||||
if (strcmpi(szurl, "d3demo2:/") == 0) {
|
||||
if (stricmp(szurl, "d3demo2:/") == 0) {
|
||||
mprintf((0, "Got a url passed: %s\n", p));
|
||||
}
|
||||
#else
|
||||
szurl[strlen("descent3://") - 1] = '\0'; // Should make the string "descent3:/"
|
||||
p = szurl + strlen("descent3://"); // pointer to the first character of the url after the //
|
||||
if (strcmpi(szurl, "descent3:/") == 0) {
|
||||
if (stricmp(szurl, "descent3:/") == 0) {
|
||||
mprintf((0, "Got a url passed: %s\n", p));
|
||||
}
|
||||
#endif
|
||||
tokp = strtok(p, "/");
|
||||
if (strcmpi(tokp, "ip") == 0) {
|
||||
if (stricmp(tokp, "ip") == 0) {
|
||||
tokp = strtok(NULL, "/");
|
||||
Auto_login_port[0] = '\0';
|
||||
strcpy(Auto_login_addr, tokp);
|
||||
@ -961,7 +961,7 @@ bool ProcessCommandLine() {
|
||||
} else {
|
||||
mprintf((0, "Couldn't load DLL.\n"));
|
||||
}
|
||||
} else if (strcmpi(tokp, "pxo") == 0) {
|
||||
} else if (stricmp(tokp, "pxo") == 0) {
|
||||
tokp = strtok(NULL, "/");
|
||||
Auto_login_port[0] = '\0';
|
||||
strcpy(Auto_login_addr, tokp);
|
||||
@ -1077,7 +1077,7 @@ static inline int count_missions(const char *pathname, const char *wildcard) {
|
||||
const char *name;
|
||||
ddio_MakePath(fullpath, pathname, filename, NULL);
|
||||
|
||||
if (strcmpi("d3_2.mn3", filename) == 0)
|
||||
if (stricmp("d3_2.mn3", filename) == 0)
|
||||
continue;
|
||||
mprintf((0, "Mission path:%s\n", fullpath));
|
||||
name = GetMissionName(filename);
|
||||
@ -1108,7 +1108,7 @@ static inline int generate_mission_listbox(newuiListBox *lb, int n_maxfiles, cha
|
||||
tMissionInfo msninfo;
|
||||
if (n_maxfiles > c) {
|
||||
ddio_MakePath(fullpath, pathname, filename, NULL);
|
||||
if (strcmpi("d3_2.mn3", filename) == 0)
|
||||
if (stricmp("d3_2.mn3", filename) == 0)
|
||||
continue;
|
||||
if (GetMissionInfo(filename, &msninfo) && msninfo.name[0] && msninfo.single) {
|
||||
// if (!msninfo.training || (msninfo.training && Current_pilot.find_mission_data(TRAINING_MISSION_NAME)!= -1))
|
||||
@ -1236,7 +1236,7 @@ bool MenuNewGame() {
|
||||
for (k = 0; k < n_missions; k++) {
|
||||
if (!filelist[k])
|
||||
continue;
|
||||
if (strcmpi(filelist[k], "d3.mn3") == 0) {
|
||||
if (stricmp(filelist[k], "d3.mn3") == 0) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
@ -601,7 +601,7 @@ int msn_CheckGetMission(network_address *net_addr, char *filename) {
|
||||
#ifdef OEM
|
||||
return 1;
|
||||
#else
|
||||
if ((strcmpi(filename, "d3_2.mn3") == 0) || (strcmpi(filename, "d3.mn3") == 0)) {
|
||||
if ((stricmp(filename, "d3_2.mn3") == 0) || (stricmp(filename, "d3.mn3") == 0)) {
|
||||
const char *p = GetMultiCDPath(filename);
|
||||
return p ? 1 : 0;
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ int MultiLoadSettings(const char *filename) {
|
||||
if (!tokval) {
|
||||
continue;
|
||||
}
|
||||
if (strcmpi(toklabel, "NAME") == 0) {
|
||||
if (stricmp(toklabel, "NAME") == 0) {
|
||||
strcpy(Netgame.name, tokval);
|
||||
// Do this so the name can still have spaces
|
||||
tokval = strtok(NULL, seps);
|
||||
@ -163,7 +163,7 @@ int MultiLoadSettings(const char *filename) {
|
||||
strcat(Netgame.name, tokval);
|
||||
tokval = strtok(NULL, seps);
|
||||
}
|
||||
} else if (strcmpi(toklabel, "MISSION") == 0) {
|
||||
} else if (stricmp(toklabel, "MISSION") == 0) {
|
||||
strcpy(Netgame.mission, tokval);
|
||||
// Do this so the mission can still have spaces
|
||||
tokval = strtok(NULL, seps);
|
||||
@ -172,7 +172,7 @@ int MultiLoadSettings(const char *filename) {
|
||||
strcat(Netgame.mission, tokval);
|
||||
tokval = strtok(NULL, seps);
|
||||
}
|
||||
} else if (strcmpi(toklabel, "SCRIPT") == 0) {
|
||||
} else if (stricmp(toklabel, "SCRIPT") == 0) {
|
||||
strcpy(Netgame.scriptname, tokval);
|
||||
// Do this so the script can still have spaces
|
||||
tokval = strtok(NULL, seps);
|
||||
@ -181,66 +181,66 @@ int MultiLoadSettings(const char *filename) {
|
||||
strcat(Netgame.scriptname, tokval);
|
||||
tokval = strtok(NULL, seps);
|
||||
}
|
||||
} else if (strcmpi(toklabel, "PPS") == 0) {
|
||||
} else if (stricmp(toklabel, "PPS") == 0) {
|
||||
Netgame.packets_per_second = atoi(tokval);
|
||||
} else if (strcmpi(toklabel, "PEERPEER") == 0) {
|
||||
if (strcmpi(tokval, "true") == 0)
|
||||
} else if (stricmp(toklabel, "PEERPEER") == 0) {
|
||||
if (stricmp(tokval, "true") == 0)
|
||||
Netgame.flags |= NF_PEER_PEER;
|
||||
else
|
||||
Netgame.flags &= ~NF_PEER_PEER;
|
||||
} else if (strcmpi(toklabel, "PERMISSABLE") == 0) {
|
||||
if (strcmpi(tokval, "true") == 0)
|
||||
} else if (stricmp(toklabel, "PERMISSABLE") == 0) {
|
||||
if (stricmp(tokval, "true") == 0)
|
||||
Netgame.flags |= NF_PERMISSABLE;
|
||||
else
|
||||
Netgame.flags &= ~NF_PERMISSABLE;
|
||||
} else if (strcmpi(toklabel, "RANDOMIZERESPAWN") == 0) {
|
||||
if (strcmpi(tokval, "true") == 0)
|
||||
} else if (stricmp(toklabel, "RANDOMIZERESPAWN") == 0) {
|
||||
if (stricmp(tokval, "true") == 0)
|
||||
Netgame.flags |= NF_RANDOMIZE_RESPAWN;
|
||||
else
|
||||
Netgame.flags &= ~NF_RANDOMIZE_RESPAWN;
|
||||
} else if (strcmpi(toklabel, "ACCWEAP") == 0) {
|
||||
if (strcmpi(tokval, "true") == 0)
|
||||
} else if (stricmp(toklabel, "ACCWEAP") == 0) {
|
||||
if (stricmp(tokval, "true") == 0)
|
||||
Netgame.flags |= NF_USE_ACC_WEAP;
|
||||
else
|
||||
Netgame.flags &= ~NF_USE_ACC_WEAP;
|
||||
} else if (strcmpi(toklabel, "ROTVEL") == 0) {
|
||||
if (strcmpi(tokval, "true") == 0)
|
||||
} else if (stricmp(toklabel, "ROTVEL") == 0) {
|
||||
if (stricmp(tokval, "true") == 0)
|
||||
Netgame.flags |= NF_SENDROTVEL;
|
||||
else
|
||||
Netgame.flags &= ~NF_SENDROTVEL;
|
||||
} else if (strcmpi(toklabel, "USESMOOTHING") == 0) {
|
||||
if (strcmpi(tokval, "true") == 0)
|
||||
} else if (stricmp(toklabel, "USESMOOTHING") == 0) {
|
||||
if (stricmp(tokval, "true") == 0)
|
||||
Netgame.flags |= NF_USE_SMOOTHING;
|
||||
else
|
||||
Netgame.flags &= ~NF_USE_SMOOTHING;
|
||||
} else if (strcmpi(toklabel, "BRIGHTPLAYERS") == 0) {
|
||||
if (strcmpi(tokval, "true") == 0)
|
||||
} else if (stricmp(toklabel, "BRIGHTPLAYERS") == 0) {
|
||||
if (stricmp(tokval, "true") == 0)
|
||||
Netgame.flags |= NF_BRIGHT_PLAYERS;
|
||||
else
|
||||
Netgame.flags &= ~NF_BRIGHT_PLAYERS;
|
||||
} else if (strcmpi(toklabel, "MAXPLAYERS") == 0) {
|
||||
} else if (stricmp(toklabel, "MAXPLAYERS") == 0) {
|
||||
Netgame.max_players = atoi(tokval);
|
||||
} else if (strcmpi(toklabel, "RESPAWNTIME") == 0) {
|
||||
} else if (stricmp(toklabel, "RESPAWNTIME") == 0) {
|
||||
Netgame.respawn_time = atoi(tokval);
|
||||
} else if (strcmpi(toklabel, "KILLGOAL") == 0) {
|
||||
} else if (stricmp(toklabel, "KILLGOAL") == 0) {
|
||||
Netgame.killgoal = atoi(tokval);
|
||||
if (Netgame.killgoal)
|
||||
Netgame.flags |= NF_KILLGOAL;
|
||||
else
|
||||
Netgame.flags &= ~NF_KILLGOAL;
|
||||
|
||||
} else if (strcmpi(toklabel, "TIMELIMIT") == 0) {
|
||||
} else if (stricmp(toklabel, "TIMELIMIT") == 0) {
|
||||
Netgame.timelimit = atoi(tokval);
|
||||
if (Netgame.timelimit)
|
||||
Netgame.flags |= NF_TIMER;
|
||||
else
|
||||
Netgame.flags &= ~NF_TIMER;
|
||||
} else if (strcmpi(toklabel, "OBJBAN") == 0) {
|
||||
} else if (stricmp(toklabel, "OBJBAN") == 0) {
|
||||
objid = FindObjectIDName(tokval);
|
||||
if (objid != -1) {
|
||||
Object_info[objid].multi_allowed = 0;
|
||||
}
|
||||
} else if (strcmpi(toklabel, "SHIPBAN") == 0) {
|
||||
} else if (stricmp(toklabel, "SHIPBAN") == 0) {
|
||||
// Do this so the name can have spaces
|
||||
char buf[100];
|
||||
strcpy(buf, tokval);
|
||||
@ -251,12 +251,12 @@ int MultiLoadSettings(const char *filename) {
|
||||
tokval = strtok(NULL, seps);
|
||||
}
|
||||
PlayerSetShipPermission(-1, buf, 0);
|
||||
} else if (strcmpi(toklabel, "MLOOK") == 0) {
|
||||
if (strcmpi(tokval, "true") == 0)
|
||||
} else if (stricmp(toklabel, "MLOOK") == 0) {
|
||||
if (stricmp(tokval, "true") == 0)
|
||||
Netgame.flags |= NF_ALLOW_MLOOK;
|
||||
else
|
||||
Netgame.flags &= ~NF_ALLOW_MLOOK;
|
||||
} else if (strcmpi(toklabel, "DIFFICULTY") == 0) {
|
||||
} else if (stricmp(toklabel, "DIFFICULTY") == 0) {
|
||||
Netgame.difficulty = atoi(tokval);
|
||||
if ((Netgame.difficulty > 4) || (Netgame.difficulty < 0))
|
||||
Netgame.difficulty = 0;
|
||||
|
@ -400,7 +400,7 @@ int MainMultiplayerMenu() {
|
||||
if (Ships[i].used) {
|
||||
|
||||
#ifdef DEMO
|
||||
if (strcmpi(Ships[i].name, "pyro-gl") == 0)
|
||||
if (stricmp(Ships[i].name, "pyro-gl") == 0)
|
||||
#endif
|
||||
PlayerSetShipPermission(-1, Ships[i].name, 1);
|
||||
#ifdef DEMO
|
||||
@ -1068,7 +1068,7 @@ void MultiDoConfigSave(void) {
|
||||
|
||||
ddio_MakePath(file, Base_directory, "custom", "settings", NULL);
|
||||
if (DoPathFileDialog(true, file, TXT_MULTISAVESET, "*.mps", 0)) {
|
||||
if (strcmpi(file + (strlen(file) - 4), ".mps") != 0)
|
||||
if (stricmp(file + (strlen(file) - 4), ".mps") != 0)
|
||||
strcat(file, ".mps");
|
||||
MultiSaveSettings(file);
|
||||
}
|
||||
|
@ -730,7 +730,7 @@ UIBitmapItem *newuiResources::Load(const char *filename) {
|
||||
free_slot = i;
|
||||
}
|
||||
} else {
|
||||
if (strcmpi(filename, m_list[i].filename) == 0) {
|
||||
if (stricmp(filename, m_list[i].filename) == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2892,7 +2892,7 @@ void newuiListBox::RemoveItem(const char *name) {
|
||||
|
||||
for (i = 0; i < m_NumItems; i++) {
|
||||
int res;
|
||||
res = (m_Flags & UILB_CASESENSITIVE) ? strcmpi(m_ItemList[i], name) : strcmp(m_ItemList[i], name);
|
||||
res = (m_Flags & UILB_CASESENSITIVE) ? stricmp(m_ItemList[i], name) : strcmp(m_ItemList[i], name);
|
||||
if (res == 0) {
|
||||
found = i;
|
||||
mem_free(m_ItemList[found]);
|
||||
@ -3049,7 +3049,7 @@ bool newuiListBox::SetCurrentItem(const char *name) {
|
||||
int i, found = 0;
|
||||
|
||||
for (i = 0; i < m_NumItems; i++) {
|
||||
int res = (m_Flags & UILB_CASESENSITIVE) ? strcmpi(m_ItemList[i], name) : strcmp(m_ItemList[i], name);
|
||||
int res = (m_Flags & UILB_CASESENSITIVE) ? stricmp(m_ItemList[i], name) : strcmp(m_ItemList[i], name);
|
||||
if (res == 0) {
|
||||
SetCurrentIndex(m_Real2Virt[i]);
|
||||
found = 1;
|
||||
@ -3632,7 +3632,7 @@ void newuiComboBox::RemoveItem(const char *name) {
|
||||
|
||||
for (i = 0; i < m_NumItems; i++) {
|
||||
int res;
|
||||
res = (m_Flags & UILB_CASESENSITIVE) ? strcmpi(m_ItemList[i], name) : strcmp(m_ItemList[i], name);
|
||||
res = (m_Flags & UILB_CASESENSITIVE) ? stricmp(m_ItemList[i], name) : strcmp(m_ItemList[i], name);
|
||||
if (res == 0) {
|
||||
found = i;
|
||||
mem_free(m_ItemList[found]);
|
||||
@ -3759,7 +3759,7 @@ bool newuiComboBox::SetCurrentItem(const char *name) {
|
||||
int i, found = 0;
|
||||
|
||||
for (i = 0; i < m_NumItems; i++) {
|
||||
int res = (m_Flags & UILB_CASESENSITIVE) ? strcmpi(m_ItemList[i], name) : strcmp(m_ItemList[i], name);
|
||||
int res = (m_Flags & UILB_CASESENSITIVE) ? stricmp(m_ItemList[i], name) : strcmp(m_ItemList[i], name);
|
||||
if (res == 0) {
|
||||
SetCurrentIndex(m_Real2Virt[i]);
|
||||
found = 1;
|
||||
|
@ -2906,7 +2906,7 @@ bool PltSelectShip(pilot *Pilot) {
|
||||
if (Ships[i].used) {
|
||||
ship_info.idlist[count] = i;
|
||||
#ifdef DEMO
|
||||
if (strcmpi(Ships[i].name, DEFAULT_SHIP) == 0) {
|
||||
if (stricmp(Ships[i].name, DEFAULT_SHIP) == 0) {
|
||||
#endif
|
||||
// make sure they have mercenary in order to play with Black Pyro
|
||||
if (!stricmp(Ships[i].name, "Black Pyro")) {
|
||||
|
@ -630,7 +630,7 @@ void PE_Debug::DumpSymbolInfo(DumpBuffer &dumpBuffer, DWORD relativeAddress) {
|
||||
// Microsoft uses sections that only _begin_ with .text
|
||||
const char *symName = GetSymbolName(currentSym);
|
||||
|
||||
if (strnicmp(symName, ".text", 5) == 0 || strcmpi(symName, "CODE") == 0) {
|
||||
if (strnicmp(symName, ".text", 5) == 0 || stricmp(symName, "CODE") == 0) {
|
||||
if (currentSym->Value <= relativeAddress) {
|
||||
PIMAGE_AUX_SYMBOL auxSym = (PIMAGE_AUX_SYMBOL)(currentSym + 1);
|
||||
if (currentSym->Value + auxSym->Section.Length >= relativeAddress) {
|
||||
@ -694,7 +694,7 @@ void PE_Debug::DumpSymbolInfo(DumpBuffer &dumpBuffer, DWORD relativeAddress) {
|
||||
if (fileSymbol) {
|
||||
const char *auxSym = (const char *)(fileSymbol + 1);
|
||||
|
||||
if (strcmpi(latestFile, auxSym)) {
|
||||
if (stricmp(latestFile, auxSym)) {
|
||||
strcpy(latestFile, auxSym);
|
||||
// JAS dumpBuffer.Printf( " file: %s\r\n", auxSym ) ;
|
||||
}
|
||||
@ -810,7 +810,7 @@ int PE_Debug::DumpDebugInfo(DumpBuffer &dumpBuffer, const BYTE *caller, HINSTANC
|
||||
GetModuleFileName(hInstance, module, MAX_MODULENAME_LEN);
|
||||
|
||||
// New module
|
||||
if (strcmpi(latestModule, module)) {
|
||||
if (stricmp(latestModule, module)) {
|
||||
strcpy(latestModule, module);
|
||||
// JAS dumpBuffer.Printf( "Module: %s\r\n", module );
|
||||
MapFileInMemory(module);
|
||||
|
@ -589,7 +589,7 @@ const char *ddio_GetCDDrive(const char *vol) {
|
||||
mprintf((0, "Call to GetVolumeInformation() failed. Last error = %d\n", GetLastError()));
|
||||
}
|
||||
|
||||
if (strcmpi(volume, vol) == 0) {
|
||||
if (stricmp(volume, vol) == 0) {
|
||||
return drivepath;
|
||||
}
|
||||
}
|
||||
|
@ -745,9 +745,9 @@ void GenerateScriptListFromAllFiles(int mask)
|
||||
while (filename)
|
||||
{
|
||||
// compile script first. if we failed, then display a messagebox giving the warning
|
||||
if (!strcmpi(filename, DEFAULT_SCRIPT_NAME) && (mask & DEFAULT_SCRIPT_MASK))
|
||||
if (!stricmp(filename, DEFAULT_SCRIPT_NAME) && (mask & DEFAULT_SCRIPT_MASK))
|
||||
GenerateScriptListFromFile(filename);
|
||||
else if ((mask & CUSTOM_SCRIPT_MASK) && strcmpi(filename, DEFAULT_SCRIPT_NAME))
|
||||
else if ((mask & CUSTOM_SCRIPT_MASK) && stricmp(filename, DEFAULT_SCRIPT_NAME))
|
||||
GenerateScriptListFromFile(filename);
|
||||
|
||||
filename = GetNextScriptFile();
|
||||
@ -764,7 +764,7 @@ void GenerateScriptListFromFile(const char *fname)
|
||||
char *script;
|
||||
script = LoadScript(fname);
|
||||
if (script) {
|
||||
if (strcmpi(fname, DEFAULT_SCRIPT_NAME) == 0)
|
||||
if (stricmp(fname, DEFAULT_SCRIPT_NAME) == 0)
|
||||
GenerateScriptWizardInfo(script, false);
|
||||
else
|
||||
GenerateScriptWizardInfo(script, true);
|
||||
|
@ -795,7 +795,7 @@ void CObjectDialog::OnSelchangeComboObjID()
|
||||
box->GetLBText(box->GetCurSel(), text);
|
||||
j = 0;
|
||||
for (i=0;i<MAX_SHIPS;i++)
|
||||
if (Ships[i].used && (strcmpi(text, Ships[i].name) == 0)) {
|
||||
if (Ships[i].used && (stricmp(text, Ships[i].name) == 0)) {
|
||||
j++;
|
||||
break;
|
||||
}
|
||||
@ -1004,13 +1004,13 @@ void CObjectDialog::OnSelChangeCoordSysSelect()
|
||||
|
||||
cbox->GetLBText(cbox->GetCurSel(), seltext);
|
||||
|
||||
if (strcmpi(seltext, "local") == 0) {
|
||||
if (stricmp(seltext, "local") == 0) {
|
||||
D3EditState.object_move_mode = REL_OBJECT;
|
||||
}
|
||||
else if (strcmpi(seltext, "viewer") == 0) {
|
||||
else if (stricmp(seltext, "viewer") == 0) {
|
||||
D3EditState.object_move_mode = REL_VIEWER;
|
||||
}
|
||||
else if (strcmpi(seltext, "world") == 0) {
|
||||
else if (stricmp(seltext, "world") == 0) {
|
||||
D3EditState.object_move_mode = REL_VIEWER;
|
||||
}
|
||||
}
|
||||
|
@ -363,7 +363,7 @@ void CScriptWizard::OnEditScript()
|
||||
|
||||
// rebuild list of scripts from changes in source code that may have happened.
|
||||
ResetScriptList();
|
||||
if (strcmpi(ScriptFileName, DEFAULT_SCRIPT_NAME) == 0)
|
||||
if (stricmp(ScriptFileName, DEFAULT_SCRIPT_NAME) == 0)
|
||||
GenerateScriptWizardInfo(m_ScriptSource, false);
|
||||
else
|
||||
GenerateScriptWizardInfo(m_ScriptSource, true);
|
||||
@ -562,7 +562,7 @@ void CScriptWizard::LoadCurrentModule()
|
||||
// compile and generate list of script names.
|
||||
ResetScriptList();
|
||||
if (m_ScriptSource) {
|
||||
if (strcmpi(ScriptFileName, DEFAULT_SCRIPT_NAME) == 0)
|
||||
if (stricmp(ScriptFileName, DEFAULT_SCRIPT_NAME) == 0)
|
||||
GenerateScriptWizardInfo(m_ScriptSource, false);
|
||||
else
|
||||
GenerateScriptWizardInfo(m_ScriptSource, true);
|
||||
@ -582,9 +582,9 @@ void CScriptWizard::UpdateScriptListbox()
|
||||
for (i = 0; i < MAX_SCRIPTS; i++)
|
||||
{
|
||||
if (Script_names[i].used)
|
||||
if (!strcmpi(ScriptFileName, DEFAULT_SCRIPT_NAME) && !Script_names[i].iscustom)
|
||||
if (!stricmp(ScriptFileName, DEFAULT_SCRIPT_NAME) && !Script_names[i].iscustom)
|
||||
scrlistbox->AddString(Script_names[i].name);
|
||||
else if (strcmpi(ScriptFileName, DEFAULT_SCRIPT_NAME) && Script_names[i].iscustom)
|
||||
else if (stricmp(ScriptFileName, DEFAULT_SCRIPT_NAME) && Script_names[i].iscustom)
|
||||
scrlistbox->AddString(Script_names[i].name);
|
||||
}
|
||||
|
||||
@ -645,7 +645,7 @@ void CScriptWizard::UpdateDialogButtons()
|
||||
char str[128];
|
||||
|
||||
// take care of script locking and unlocking buttons
|
||||
if (strcmpi(ScriptFileName, DEFAULT_SCRIPT_NAME) == 0)
|
||||
if (stricmp(ScriptFileName, DEFAULT_SCRIPT_NAME) == 0)
|
||||
n = FindGamefileName(ScriptFileName);
|
||||
else
|
||||
n = -1;
|
||||
|
@ -191,7 +191,7 @@ int CHogEditDoc::LoadDocument(CString& name)
|
||||
_splitpath(ascii_name, NULL, NULL, NULL, ext);
|
||||
|
||||
// load either .rib or .hog file
|
||||
if (strcmpi(ext, ".rib") == 0) {
|
||||
if (stricmp(ext, ".rib") == 0) {
|
||||
res=LoadRib(ascii_name);
|
||||
if(res) m_StaticHog = false;
|
||||
}
|
||||
@ -219,7 +219,7 @@ int CHogEditDoc::SaveDocument(CString& name)
|
||||
_splitpath(ascii_name, NULL, NULL, NULL, ext);
|
||||
|
||||
// load either .rib or .hog file
|
||||
if (strcmpi(ext, ".rib") == 0) {
|
||||
if (stricmp(ext, ".rib") == 0) {
|
||||
res=SaveRib(ascii_name);
|
||||
if(res) m_StaticHog = false;
|
||||
}
|
||||
@ -492,7 +492,7 @@ int CHogEditDoc::AddFile(const char *pathname, hog_library_entry *entry)
|
||||
while (pos)
|
||||
{
|
||||
temp_entry = Library.filelist.GetNext(pos);
|
||||
if (!strcmpi(temp_entry.name, filename) /*&& !strcmpi(temp_entry.path, newpath)*/)
|
||||
if (!stricmp(temp_entry.name, filename) /*&& !stricmp(temp_entry.path, newpath)*/)
|
||||
return ADDFILE_DUP_FILE_ERROR;
|
||||
}
|
||||
|
||||
@ -738,7 +738,7 @@ FILE *CHogEditDoc::FindFileInHog(char *hog_fname,tHogFileEntry *table_entry)
|
||||
while (pos!=NULL)
|
||||
{
|
||||
entry = Library.filelist.GetNext(pos);
|
||||
if (!strcmpi(entry.name, table_entry->name)) {
|
||||
if (!stricmp(entry.name, table_entry->name)) {
|
||||
found_in_hog=TRUE;
|
||||
break;
|
||||
}
|
||||
|
@ -641,7 +641,7 @@ void CHogEditView::OnActionDelete()
|
||||
{
|
||||
last_pos=pos;
|
||||
entry = doc->Library.filelist.GetNext(pos);
|
||||
if (!strcmpi(entry.name, name) && !strcmpi(entry.path, path)) {
|
||||
if (!stricmp(entry.name, name) && !stricmp(entry.path, path)) {
|
||||
doc->Library.filelist.RemoveAt(last_pos);
|
||||
break;
|
||||
}
|
||||
@ -725,7 +725,7 @@ void CHogEditView::OnActionCreate()
|
||||
CWaitCursor wc;
|
||||
|
||||
if(check_name) {
|
||||
if(strcmpi(doc->Library.filename,hog_name.GetBuffer(0))!=0) {
|
||||
if(stricmp(doc->Library.filename,hog_name.GetBuffer(0))!=0) {
|
||||
DocModified=TRUE;
|
||||
UpdateTitle(doc->m_DocumentName,DocModified);
|
||||
}
|
||||
@ -1008,7 +1008,7 @@ void CHogEditView::OnActionExtract()
|
||||
while (pos!=NULL)
|
||||
{
|
||||
entry = doc->Library.filelist.GetNext(pos);
|
||||
if (!strcmpi(entry.name, name)) {
|
||||
if (!stricmp(entry.name, name)) {
|
||||
|
||||
if(!doc->ExtractFile(entry.offset,entry.length,entry.name)) {
|
||||
if(num_errors==0) {
|
||||
|
@ -371,7 +371,7 @@ char * SendChatString(char *line,int raw)
|
||||
|
||||
//Start off by getting the command
|
||||
strcpy(szCmd,GetWordNum(0,line+1));
|
||||
if(strcmpi(szCmd,"msg")==0)
|
||||
if(stricmp(szCmd,"msg")==0)
|
||||
{
|
||||
strcpy(szTarget,GetWordNum(1,line+1));
|
||||
sprintf(szCmd,"PRIVMSG %s :%s\n\r",szTarget,line+strlen("/msg ")+strlen(szTarget)+1);
|
||||
@ -380,7 +380,7 @@ char * SendChatString(char *line,int raw)
|
||||
return ParseIRCMessage(szCmd,MSG_LOCAL);
|
||||
|
||||
}
|
||||
if(strcmpi(szCmd,"me")==0)
|
||||
if(stricmp(szCmd,"me")==0)
|
||||
{
|
||||
sprintf(szCmd,"PRIVMSG %s :\001ACTION %s\001\n\r",szChat_channel,line+strlen("/me "));
|
||||
send(Chatsock,szCmd,strlen(szCmd),0);
|
||||
@ -388,14 +388,14 @@ char * SendChatString(char *line,int raw)
|
||||
return ParseIRCMessage(szCmd,MSG_LOCAL);
|
||||
|
||||
}
|
||||
if(strcmpi(szCmd,"xyz")==0)
|
||||
if(stricmp(szCmd,"xyz")==0)
|
||||
{
|
||||
//Special command to send raw irc commands
|
||||
sprintf(szCmd,"%s\n\r",line+strlen("/xyz "));
|
||||
send(Chatsock,szCmd,strlen(szCmd),0);
|
||||
return NULL;
|
||||
}
|
||||
if(strcmpi(szCmd,"list")==0)
|
||||
if(stricmp(szCmd,"list")==0)
|
||||
{
|
||||
sprintf(szCmd,"%s\n\r",line+1);
|
||||
send(Chatsock,szCmd,strlen(szCmd),0);
|
||||
@ -611,7 +611,7 @@ int AddChatUser(char *nickname)
|
||||
Curruser = Firstuser;
|
||||
while(Curruser)
|
||||
{
|
||||
if(strcmpi(nickname,Curruser->nick_name)==0) return 0;
|
||||
if(stricmp(nickname,Curruser->nick_name)==0) return 0;
|
||||
Curruser = Curruser->next;
|
||||
}
|
||||
|
||||
@ -649,7 +649,7 @@ int RemoveChatUser(char *nickname)
|
||||
Curruser = Firstuser;
|
||||
while(Curruser)
|
||||
{
|
||||
if(strcmpi(nickname,Curruser->nick_name)==0)
|
||||
if(stricmp(nickname,Curruser->nick_name)==0)
|
||||
{
|
||||
if(prv_user)
|
||||
{
|
||||
@ -891,10 +891,10 @@ char * ParseIRCMessage(char *Line, int iMode)
|
||||
if(stricmp(Nick_name,szNick)==0)
|
||||
{
|
||||
//Yup, it's me!
|
||||
//if(strcmpi(szChat_channel,GetWordNum(0,szRemLine))==0)
|
||||
//if(stricmp(szChat_channel,GetWordNum(0,szRemLine))==0)
|
||||
//{
|
||||
Joined_channel = 1;
|
||||
//if(strcmpi(szChat_channel,"#autoselect")==0)
|
||||
//if(stricmp(szChat_channel,"#autoselect")==0)
|
||||
//{
|
||||
strcpy(szChat_channel,GetWordNum(0,szRemLine));
|
||||
AddChatCommandToQueue(CC_YOURCHANNEL,szChat_channel,strlen(szChat_channel)+1);
|
||||
@ -1003,7 +1003,7 @@ char * ParseIRCMessage(char *Line, int iMode)
|
||||
char szWhoisUser[33];
|
||||
strcpy(szWhoisUser,GetWordNum(1,szRemLine));
|
||||
//This is whois user info, we can get their tracker info from here. -5
|
||||
//if(strcmpi(Getting_user_tracker_info_for,szWhoisUser)==0)
|
||||
//if(stricmp(Getting_user_tracker_info_for,szWhoisUser)==0)
|
||||
//{
|
||||
strcpy(User_req_tracker_id,GetWordNum(5,szRemLine));
|
||||
//}
|
||||
@ -1014,7 +1014,7 @@ char * ParseIRCMessage(char *Line, int iMode)
|
||||
char szWhoisUser[33];
|
||||
strcpy(szWhoisUser,GetWordNum(1,szRemLine));
|
||||
//This is whois channel info -- what channel they are on -2
|
||||
//if(strcmpi(Getting_user_channel_info_for,szWhoisUser)==0)
|
||||
//if(stricmp(Getting_user_channel_info_for,szWhoisUser)==0)
|
||||
//{
|
||||
strcpy(User_req_channel,GetWordNum(2,szRemLine));
|
||||
//}
|
||||
|
@ -2383,7 +2383,7 @@ void CheckPXOForAnomalies(void)
|
||||
continue;
|
||||
if(i==j)
|
||||
continue;
|
||||
if(strcmpi(DLLMPlayers[i].tracker_id,DLLMPlayers[j].tracker_id)==0)
|
||||
if(stricmp(DLLMPlayers[i].tracker_id,DLLMPlayers[j].tracker_id)==0)
|
||||
{
|
||||
//Ok, what we have here is multiple users with the same tracker ID.
|
||||
//This is bad. It could be user error, but it could be something worse.
|
||||
|
@ -562,7 +562,7 @@ void HandlePilotData(uint8_t *data,int len, network_address *from)
|
||||
{
|
||||
d3_pilot = (vmt_descent3_struct *)&inpacket.data;
|
||||
xorcode(d3_pilot,DESCENT3_BLOCK_SIZE,inpacket.security);
|
||||
if(strcmpi(ProccesingPilot,d3_pilot->pilot_name)==0)
|
||||
if(stricmp(ProccesingPilot,d3_pilot->pilot_name)==0)
|
||||
{
|
||||
//Copy the data
|
||||
memcpy(ReadD3Pilot,&inpacket.data,DESCENT3_BLOCK_SIZE);
|
||||
|
@ -48,7 +48,6 @@ char *strupr(char *string);
|
||||
#endif
|
||||
|
||||
#define strnicmp(a, b, c) strncasecmp(a, b, c)
|
||||
#define strcmpi(a, b) stricmp(a, b)
|
||||
#define _chmod(a, b) chmod(a, b)
|
||||
#if defined(__aarch64__)
|
||||
#define _finite(a) isfinite(a)
|
||||
|
@ -1068,7 +1068,7 @@ int StartMultiplayerGameMenu() {
|
||||
if (DLLddio_FindFileStart(search, buffer)) {
|
||||
// DLLddio_MakePath(mn3_path,DLLLocalD3Dir,"missions",buffer,NULL);
|
||||
|
||||
if (DLLIsMissionMultiPlayable(buffer) && (strcmpi("d3_2.mn3", buffer) != 0)) {
|
||||
if (DLLIsMissionMultiPlayable(buffer) && (stricmp("d3_2.mn3", buffer) != 0)) {
|
||||
DLLmprintf((0, "Found a mission: %s\n", buffer));
|
||||
mi = (_msn_list *)DLLmem_malloc(sizeof(msn_list));
|
||||
strcpy(mi->msn_name, DLLGetMissionName(buffer));
|
||||
@ -1078,7 +1078,7 @@ int StartMultiplayerGameMenu() {
|
||||
DLLListAddItem(list_1, mi->ti);
|
||||
}
|
||||
while (DLLddio_FindNextFile(buffer)) {
|
||||
if (strcmpi("d3_2.mn3", buffer) == 0)
|
||||
if (stricmp("d3_2.mn3", buffer) == 0)
|
||||
continue;
|
||||
// DLLddio_MakePath(mn3_path,DLLLocalD3Dir,"missions",buffer,NULL);
|
||||
if (DLLIsMissionMultiPlayable(buffer)) {
|
||||
@ -1296,7 +1296,7 @@ int StartMultiplayerGameMenu() {
|
||||
DLLListSelectItem(list_1, mi->ti);
|
||||
#endif
|
||||
for (index = 0; index < dllcount; index++) {
|
||||
if (strcmpi(dll_text[index], DLLNetgame->scriptname) == 0) {
|
||||
if (stricmp(dll_text[index], DLLNetgame->scriptname) == 0) {
|
||||
DLLListSelectItem(script_list, dll_txt_items[index]);
|
||||
break;
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ int dp_SelectDirectPlayConnection(char *name) {
|
||||
mem_free(lpAddress);
|
||||
lpAddress = NULL;
|
||||
for (i = 0; i < MAX_DIRECTPLAY_CONNECTIONS; i++) {
|
||||
if (strcmpi(dpconns[i].name, name) == 0) {
|
||||
if (stricmp(dpconns[i].name, name) == 0) {
|
||||
mprintf((0, "Found DirectPlay connection: %s\n", name));
|
||||
connection = dpconns[i].conn;
|
||||
break;
|
||||
@ -851,7 +851,7 @@ int dp_GetModemChoices(char *buffer, LPDWORD size) {
|
||||
lpTempDP4->EnumConnections(&DPD3_GUID, DirectPlayEnumConnectionsCallback, 0, 0);
|
||||
|
||||
for (i = 0; i < MAX_DIRECTPLAY_CONNECTIONS; i++) {
|
||||
if (strcmpi(dpconns[i].name, "Modem Connection For DirectPlay") == 0) {
|
||||
if (stricmp(dpconns[i].name, "Modem Connection For DirectPlay") == 0) {
|
||||
// mprintf((0,"Found DirectPlay connection: %s\n",name));
|
||||
connection = dpconns[i].conn;
|
||||
break;
|
||||
|
@ -587,7 +587,7 @@ void nw_InitNetworking(int iReadBufSizeOverride) {
|
||||
int parmlen;
|
||||
int len = 99;
|
||||
Database->read("NetworkConnection", szconntype, &len);
|
||||
if (strcmpi(szconntype, "DIALUP") == 0) {
|
||||
if (stricmp(szconntype, "DIALUP") == 0) {
|
||||
Dialup_connection = 1;
|
||||
} else {
|
||||
Dialup_connection = 0;
|
||||
@ -2269,17 +2269,17 @@ int nw_ReccomendPPS() {
|
||||
int len = 99;
|
||||
strcpy(szconnspeed, "");
|
||||
Database->read("ConnectionSpeed", szconnspeed, &len);
|
||||
if (strcmpi(szconnspeed, "28K") == 0)
|
||||
if (stricmp(szconnspeed, "28K") == 0)
|
||||
return 5;
|
||||
else if (strcmpi(szconnspeed, "33K") == 0)
|
||||
else if (stricmp(szconnspeed, "33K") == 0)
|
||||
return 6;
|
||||
else if (strcmpi(szconnspeed, "56K") == 0)
|
||||
else if (stricmp(szconnspeed, "56K") == 0)
|
||||
return 7;
|
||||
else if (strcmpi(szconnspeed, "ISDN") == 0)
|
||||
else if (stricmp(szconnspeed, "ISDN") == 0)
|
||||
return 8;
|
||||
else if (strcmpi(szconnspeed, "Cable") == 0)
|
||||
else if (stricmp(szconnspeed, "Cable") == 0)
|
||||
return 9;
|
||||
else if (strcmpi(szconnspeed, "Fast") == 0)
|
||||
else if (stricmp(szconnspeed, "Fast") == 0)
|
||||
return 12;
|
||||
else
|
||||
return 7;
|
||||
|
Loading…
Reference in New Issue
Block a user