diff options
-rw-r--r-- | engines/m4/converse.cpp | 8 | ||||
-rw-r--r-- | engines/m4/dialogs.cpp | 2 | ||||
-rw-r--r-- | engines/m4/hotspot.cpp | 2 | ||||
-rw-r--r-- | engines/m4/mads_logic.cpp | 2 | ||||
-rw-r--r-- | engines/m4/mads_scene.cpp | 2 | ||||
-rw-r--r-- | engines/m4/mads_views.cpp | 2 |
6 files changed, 8 insertions, 10 deletions
diff --git a/engines/m4/converse.cpp b/engines/m4/converse.cpp index bdce7928ac..299fafb282 100644 --- a/engines/m4/converse.cpp +++ b/engines/m4/converse.cpp @@ -116,7 +116,7 @@ void ConversationView::setNode(int32 nodeIndex) { // Add node to active items list _activeItems.push_back(node->entries[i]); - if (node->entries[i]->autoSelect || strlen(node->entries[i]->text) == 0) { + if (node->entries[i]->autoSelect || node->entries[i]->text[0] == '\0') { //warning(kDebugConversations, "Auto selecting entry %i of node %i\n", i, nodeIndex); selectEntry(i); return; @@ -217,7 +217,7 @@ void ConversationView::selectEntry(int entryIndex) { _highlightedIndex = entryIndex; // Play the selected entry's voice - if (strlen(_activeItems[entryIndex]->voiceFile) > 0) { + if (_activeItems[entryIndex]->voiceFile[0] != '\0') { _currentHandle = _vm->_sound->getHandle(); _vm->_sound->playVoice(buffer, 255); } else { @@ -273,7 +273,7 @@ void ConversationView::playNextReply() { if (currentEntry->entryType != kWeightedReply) { sprintf(buffer, "%s.raw", currentEntry->voiceFile); - if (strlen(currentEntry->voiceFile) > 0) { + if (currentEntry->voiceFile[0] != '\0') { _currentHandle = _vm->_sound->getHandle(); _vm->_sound->playVoice(buffer, 255); // Remove reply from the list of replies @@ -293,7 +293,7 @@ void ConversationView::playNextReply() { currentWeight += currentEntry->entries[j]->weight; if (selectedWeight >= previousWeight && selectedWeight <= currentWeight) { sprintf(buffer, "%s.raw", currentEntry->entries[j]->voiceFile); - if (strlen(currentEntry->entries[j]->voiceFile) > 0) { + if (currentEntry->entries[j]->voiceFile[0] != '\0') { _currentHandle = _vm->_sound->getHandle(); _vm->_sound->playVoice(buffer, 255); // Remove reply from the list of replies diff --git a/engines/m4/dialogs.cpp b/engines/m4/dialogs.cpp index 2b2c479673..e9c7414845 100644 --- a/engines/m4/dialogs.cpp +++ b/engines/m4/dialogs.cpp @@ -117,8 +117,6 @@ void Dialog::writeChars(const char *srcLine) { destP = &wordStr[0]; *destP = '\0'; - lineLen = strlen(wordStr); - strcpy(line, ""); if (_lineX > 0) strcat(line, " "); diff --git a/engines/m4/hotspot.cpp b/engines/m4/hotspot.cpp index a585a9af3d..a424d9fa23 100644 --- a/engines/m4/hotspot.cpp +++ b/engines/m4/hotspot.cpp @@ -258,7 +258,7 @@ void HotSpotList::loadHotSpots(Common::SeekableReadStream* hotspotStream, int ho hotspotStream->read(buffer, strLength); // prep str_upper(buffer); - if (strlen(buffer) > 0 && strcmp(buffer, "--") != 0 && strcmp(buffer, "ON") != 0) + if (buffer[0] != '\0' && strcmp(buffer, "--") != 0 && strcmp(buffer, "ON") != 0) currentHotSpot->setPrep(buffer); else currentHotSpot->setPrep(currentHotSpot->getVocab()); diff --git a/engines/m4/mads_logic.cpp b/engines/m4/mads_logic.cpp index 335127393e..cafddb2d53 100644 --- a/engines/m4/mads_logic.cpp +++ b/engines/m4/mads_logic.cpp @@ -751,7 +751,7 @@ void MadsSceneLogic::execute(uint32 subOffset) { if (gDebugLevel > 0) { if (param != UNUSED_VAL) - sprintf(opcodeBuffer + strlen(opcodeBuffer), "\t%d", param); + sprintf(opcodeBuffer + strlen(opcodeBuffer), "\t%u", param); debugC(2, kDebugScript, "%s", opcodeBuffer); } } diff --git a/engines/m4/mads_scene.cpp b/engines/m4/mads_scene.cpp index 5f160aa300..73d9f57124 100644 --- a/engines/m4/mads_scene.cpp +++ b/engines/m4/mads_scene.cpp @@ -176,7 +176,7 @@ void MadsScene::loadScene(int sceneNumber) { _sceneLogic.doEnterScene(); // Miscellaneous player setup - _madsVm->_player._destPos = _madsVm->_player._destPos; + //_madsVm->_player._destPos = _madsVm->_player._destPos; _madsVm->_player._newDirection = _madsVm->_player._direction; _madsVm->_player.setupFrame(); _madsVm->_player.updateFrame(); diff --git a/engines/m4/mads_views.cpp b/engines/m4/mads_views.cpp index 0521903c95..d21bfc1cf2 100644 --- a/engines/m4/mads_views.cpp +++ b/engines/m4/mads_views.cpp @@ -228,7 +228,7 @@ void MadsAction::refresh() { _statusTextIndex = -1; } - if (strlen(_statusText) != 0) { + if (_statusText[0] != '\0') { if ((_owner._screenObjects._v832EC == 0) || (_owner._screenObjects._v832EC == 2)) { Font *font = _madsVm->_font->getFont(FONT_MAIN_MADS); int textSpacing = -1; |