strcasecmp->scumm_stricmp

This commit is contained in:
Pawel Kolodziejski 2011-05-01 18:39:28 +02:00
parent a02ae4bc5d
commit 74796a5de7
9 changed files with 51 additions and 51 deletions

View File

@ -1012,7 +1012,7 @@ void Actor::setScale(float scale) {
Costume *Actor::findCostume(const char *n) {
for (Common::List<Costume *>::iterator i = _costumeStack.begin(); i != _costumeStack.end(); ++i) {
if (strcasecmp((*i)->getFilename(), n) == 0)
if (scumm_stricmp((*i)->getFilename(), n) == 0)
return *i;
}

View File

@ -175,7 +175,7 @@ ImuseSndMgr::SoundDesc *ImuseSndMgr::openSound(const char *soundName, int volGro
strcpy(sound->name, soundName);
sound->volGroupId = volGroupId;
if (!(g_grim->getGameFlags() & GF_DEMO) && strcasecmp(extension, "imu") == 0) {
if (!(g_grim->getGameFlags() & GF_DEMO) && scumm_stricmp(extension, "imu") == 0) {
sound->blockRes = g_resourceloader->getFileBlock(soundName);
if (sound->blockRes) {
ptr = (byte *)sound->blockRes->data();
@ -186,8 +186,8 @@ ImuseSndMgr::SoundDesc *ImuseSndMgr::openSound(const char *soundName, int volGro
closeSound(sound);
return NULL;
}
} else if (strcasecmp(extension, "wav") == 0 || strcasecmp(extension, "imc") == 0 ||
(g_grim->getGameFlags() & GF_DEMO && strcasecmp(extension, "imu") == 0)) {
} else if (scumm_stricmp(extension, "wav") == 0 || scumm_stricmp(extension, "imc") == 0 ||
(g_grim->getGameFlags() & GF_DEMO && scumm_stricmp(extension, "imu") == 0)) {
sound->mcmpMgr = new McmpMgr();
if (!sound->mcmpMgr->openSound(soundName, &ptr, headerSize)) {
closeSound(sound);

View File

@ -82,7 +82,7 @@ bool Imuse::startSound(const char *soundName, int volGroupId, int hookId, int vo
// instead of starting a new copy of the track
for (i = 0; i < MAX_IMUSE_TRACKS + MAX_IMUSE_FADETRACKS; i++) {
// Filenames are case insensitive, see findTrack
if (!strcasecmp(_track[i]->soundName, soundName)) {
if (!scumm_stricmp(_track[i]->soundName, soundName)) {
if (gDebugLevel == DEBUG_IMUSE || gDebugLevel == DEBUG_NORMAL || gDebugLevel == DEBUG_ALL)
printf("Imuse::startSound(): Track '%s' already playing.\n", soundName);
return true;
@ -156,7 +156,7 @@ Track *Imuse::findTrack(const char *soundName) {
// two ways: keyboard.IMU and keyboard.imu, make a case insensitive
// search for the track to make sure we can find it
if (track->used && !track->toBeRemoved
&& strlen(track->soundName) != 0 && strcasecmp(track->soundName, soundName) == 0) {
&& strlen(track->soundName) != 0 && scumm_stricmp(track->soundName, soundName) == 0) {
return track;
}
}
@ -231,7 +231,7 @@ int Imuse::getCountPlayedTracks(const char *soundName) {
for (int l = 0; l < MAX_IMUSE_TRACKS; l++) {
Track *track = _track[l];
if (track->used && !track->toBeRemoved && (strcasecmp(track->soundName, soundName) == 0)) {
if (track->used && !track->toBeRemoved && (scumm_stricmp(track->soundName, soundName) == 0)) {
count++;
}
}

View File

@ -113,7 +113,7 @@ void KeyframeAnim::loadText(TextSplitter &ts) {
ts.scanString("fps %f", 1, &_fps);
ts.scanString("joints %d", 1, &_numJoints);
if (strcasecmp(ts.currentLine(), "section: markers") == 0) {
if (scumm_stricmp(ts.currentLine(), "section: markers") == 0) {
ts.nextLine();
ts.scanString("markers %d", 1, &_numMarkers);
_markers = new Marker[_numMarkers];

View File

@ -36,7 +36,7 @@ namespace Grim {
Localizer *g_localizer = NULL;
static int sortCallback(const void *entry1, const void *entry2) {
return strcasecmp(((Localizer::LocaleEntry *)entry1)->text, ((Localizer::LocaleEntry *)entry2)->text);
return scumm_stricmp(((Localizer::LocaleEntry *)entry1)->text, ((Localizer::LocaleEntry *)entry2)->text);
}
Localizer::Localizer() {

View File

@ -76,43 +76,43 @@ Registry::Registry() : _dirty(true) {
}
const char *Registry::get(const char *key, const char *defval) const {
if (strcasecmp("good_times", key) == 0 || strcasecmp("GrimDeveloper", key) == 0) {
if (scumm_stricmp("good_times", key) == 0 || scumm_stricmp("GrimDeveloper", key) == 0) {
return _develMode.c_str();
} else if (strcasecmp("GrimDataDir", key) == 0) {
} else if (scumm_stricmp("GrimDataDir", key) == 0) {
return _dataPath.c_str();
} else if (strcasecmp("savepath", key) == 0) {
} else if (scumm_stricmp("savepath", key) == 0) {
return _savePath.c_str();
} else if (strcasecmp("GrimLastSet", key) == 0) {
} else if (scumm_stricmp("GrimLastSet", key) == 0) {
return _lastSet.c_str();
} else if (strcasecmp("MusicVolume", key) == 0) {
} else if (scumm_stricmp("MusicVolume", key) == 0) {
return _musicVolume.c_str();
} else if (strcasecmp("SfxVolume", key) == 0) {
} else if (scumm_stricmp("SfxVolume", key) == 0) {
return _sfxVolume.c_str();
} else if (strcasecmp("VoiceVolume", key) == 0) {
} else if (scumm_stricmp("VoiceVolume", key) == 0) {
return _voiceVolume.c_str();
} else if (strcasecmp("LastSavedGame", key) == 0) {
} else if (scumm_stricmp("LastSavedGame", key) == 0) {
return _lastSavedGame.c_str();
} else if (strcasecmp("Gamma", key) == 0 || strcasecmp("GammaCorrection", key) == 0) {
} else if (scumm_stricmp("Gamma", key) == 0 || scumm_stricmp("GammaCorrection", key) == 0) {
return "";//_gamma.c_str();
} else if (strcasecmp("VoiceEffects", key) == 0) {
} else if (scumm_stricmp("VoiceEffects", key) == 0) {
return _voiceEffects.c_str();
} else if (strcasecmp("TextSpeed", key) == 0) {
} else if (scumm_stricmp("TextSpeed", key) == 0) {
return _textSpeed.c_str();
} else if (strcasecmp("TextMode", key) == 0) {
} else if (scumm_stricmp("TextMode", key) == 0) {
return _speechMode.c_str();
} else if (strcasecmp("MovementMode", key) == 0) {
} else if (scumm_stricmp("MovementMode", key) == 0) {
return _movement.c_str();
} else if (strcasecmp("JoystickEnabled", key) == 0) {
} else if (scumm_stricmp("JoystickEnabled", key) == 0) {
return _joystick.c_str();
} else if (strcasecmp("SpewOnError", key) == 0) {
} else if (scumm_stricmp("SpewOnError", key) == 0) {
return _spewOnError.c_str();
} else if (strcasecmp("show_fps", key) == 0) {
} else if (scumm_stricmp("show_fps", key) == 0) {
return _showFps.c_str();
} else if (strcasecmp("soft_renderer", key) == 0) {
} else if (scumm_stricmp("soft_renderer", key) == 0) {
return _softRenderer.c_str();
} else if (strcasecmp("fullscreen", key) == 0) {
} else if (scumm_stricmp("fullscreen", key) == 0) {
return _fullscreen.c_str();
} else if (strcasecmp("engine_speed", key) == 0) {
} else if (scumm_stricmp("engine_speed", key) == 0) {
return _engineSpeed.c_str();
}
@ -123,61 +123,61 @@ void Registry::set(const char *key, const char *val) {
_dirty = true;
assert(val);
if (strcasecmp("good_times", key) == 0 || strcasecmp("GrimDeveloper", key) == 0) {
if (scumm_stricmp("good_times", key) == 0 || scumm_stricmp("GrimDeveloper", key) == 0) {
_develMode = val;
return;
} else if (strcasecmp("GrimDataDir", key) == 0) {
} else if (scumm_stricmp("GrimDataDir", key) == 0) {
_dataPath = val;
return;
} else if (strcasecmp("savepath", key) == 0) {
} else if (scumm_stricmp("savepath", key) == 0) {
_savePath = val;
return;
} else if (strcasecmp("GrimLastSet", key) == 0) {
} else if (scumm_stricmp("GrimLastSet", key) == 0) {
_lastSet = val;
return;
} else if (strcasecmp("MusicVolume", key) == 0) {
} else if (scumm_stricmp("MusicVolume", key) == 0) {
_musicVolume = val;
return;
} else if (strcasecmp("SfxVolume", key) == 0) {
} else if (scumm_stricmp("SfxVolume", key) == 0) {
_sfxVolume = val;
return;
} else if (strcasecmp("VoiceVolume", key) == 0) {
} else if (scumm_stricmp("VoiceVolume", key) == 0) {
_voiceVolume = val;
return;
} else if (strcasecmp("LastSavedGame", key) == 0) {
} else if (scumm_stricmp("LastSavedGame", key) == 0) {
_lastSavedGame = val;
return;
} else if (strcasecmp("Gamma", key) == 0 || strcasecmp("GammaCorrection", key) == 0) {
} else if (scumm_stricmp("Gamma", key) == 0 || scumm_stricmp("GammaCorrection", key) == 0) {
_gamma = "";//val;
return;
} else if (strcasecmp("VoiceEffects", key) == 0) {
} else if (scumm_stricmp("VoiceEffects", key) == 0) {
_voiceEffects = val;
return;
} else if (strcasecmp("TextSpeed", key) == 0) {
} else if (scumm_stricmp("TextSpeed", key) == 0) {
_textSpeed = val;
return;
} else if (strcasecmp("TextMode", key) == 0) {
} else if (scumm_stricmp("TextMode", key) == 0) {
_speechMode = val;
return;
} else if (strcasecmp("MovementMode", key) == 0) {
} else if (scumm_stricmp("MovementMode", key) == 0) {
_movement = val;
return;
} else if (strcasecmp("JoystickEnabled", key) == 0) {
} else if (scumm_stricmp("JoystickEnabled", key) == 0) {
_joystick = val;
return;
} else if (strcasecmp("SpewOnError", key) == 0) {
} else if (scumm_stricmp("SpewOnError", key) == 0) {
_spewOnError = val;
return;
} else if (strcasecmp("show_fps", key) == 0) {
} else if (scumm_stricmp("show_fps", key) == 0) {
_showFps = val;
return;
} else if (strcasecmp("soft_renderer", key) == 0) {
} else if (scumm_stricmp("soft_renderer", key) == 0) {
_softRenderer = val;
return;
} else if (strcasecmp("fullscreen", key) == 0) {
} else if (scumm_stricmp("fullscreen", key) == 0) {
_fullscreen = val;
return;
} else if (strcasecmp("engine_speed", key) == 0) {
} else if (scumm_stricmp("engine_speed", key) == 0) {
_engineSpeed = val;
return;
}

View File

@ -100,7 +100,7 @@ const Lab *ResourceLoader::getLab(const char *filename) const {
}
static int sortCallback(const void *entry1, const void *entry2) {
return strcasecmp(((ResourceLoader::ResourceCache *)entry1)->fname, ((ResourceLoader::ResourceCache *)entry2)->fname);
return scumm_stricmp(((ResourceLoader::ResourceCache *)entry1)->fname, ((ResourceLoader::ResourceCache *)entry2)->fname);
}
Block *ResourceLoader::getFileFromCache(const char *filename) {

View File

@ -100,7 +100,7 @@ Scene::Scene(const char *sceneName, const char *buf, int len) :
// cases where they count up, see hh.set for example)
while (!ts.eof()) {
ts.scanString(" %s", 1, tempBuf);
if (!strcasecmp(tempBuf, "sector"))
if (!scumm_stricmp(tempBuf, "sector"))
_numSectors++;
}
// Allocate and fill an array of sector info
@ -465,7 +465,7 @@ ObjectState *Scene::findState(const char *filename) {
if (strcmp(file, filename) == 0)
return *i;
if (strcasecmp(file, filename) == 0) {
if (scumm_stricmp(file, filename) == 0) {
if (gDebugLevel == DEBUG_WARN || gDebugLevel == DEBUG_ALL)
warning("State object request '%s' matches object '%s' but is the wrong case", filename, file);
return *i;

View File

@ -105,7 +105,7 @@ bool TextSplitter::checkString(const char *needle) {
void TextSplitter::expectString(const char *expected) {
if (!_currLine)
error("Expected `%s', got EOF", expected);
if (strcasecmp(currentLine(), expected) != 0)
if (scumm_stricmp(currentLine(), expected) != 0)
error("Expected `%s', got '%s'", expected, currentLine());
nextLine();
}