[Scummvm-cvs-logs] scummvm master -> 6d2e7228b5b8df4a9e16e36475196d2e16b4c634
sev-
sev at scummvm.org
Thu Nov 3 02:19:00 CET 2011
This automated email contains information about 11 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
3bd615ae9b LASTEXPRESS: Fix incorrect read() call
a95820956e CGE: Fix array bounds check
558a499a02 CGE: Fix warning
07163c76c9 HUGO: Fix warnings
b3cad04450 LURE: Fix warnings
86ba940bc8 M4: Fix warnings
e1a311a236 PARALLACTION: Fix warnings. Fix nasty out-of-scope bug in parallaction_br.cpp
3da2e8662a SAGA: Fix copy/paste error
c5fa1cabd8 SAGA: Fix warnings
7e298f13a1 SCI: Fix copy/paste error
6d2e7228b5 SCI: Add fixme comment to a weird comparison
Commit: 3bd615ae9b78ded9a51b7320a602f1c46c9f57ef
https://github.com/scummvm/scummvm/commit/3bd615ae9b78ded9a51b7320a602f1c46c9f57ef
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2011-11-02T16:54:48-07:00
Commit Message:
LASTEXPRESS: Fix incorrect read() call
Changed paths:
engines/lastexpress/game/savegame.cpp
diff --git a/engines/lastexpress/game/savegame.cpp b/engines/lastexpress/game/savegame.cpp
index 57c18b5..e5b84ea 100644
--- a/engines/lastexpress/game/savegame.cpp
+++ b/engines/lastexpress/game/savegame.cpp
@@ -158,7 +158,7 @@ void SaveLoad::loadStream(GameId id) {
while (!save->eos() && !save->err()) {
_engine->pollEvents();
- uint32 count = save->read(buf, sizeof(buf));
+ uint32 count = save->read(buf, sizeof(*buf));
if (count) {
uint32 w = _savegame->write(buf, count);
assert (w == count);
Commit: a95820956e046c13249bc75f6e1fa26bcddc9d52
https://github.com/scummvm/scummvm/commit/a95820956e046c13249bc75f6e1fa26bcddc9d52
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2011-11-02T16:58:29-07:00
Commit Message:
CGE: Fix array bounds check
Changed paths:
engines/cge/snail.cpp
diff --git a/engines/cge/snail.cpp b/engines/cge/snail.cpp
index cbc463c..5ab8f63 100644
--- a/engines/cge/snail.cpp
+++ b/engines/cge/snail.cpp
@@ -406,7 +406,7 @@ void CGEEngine::snGame(Sprite *spr, int num) {
Stage++;
if (hand && Stage > kDressed)
++hand;
- if (i >= 0 || (dup[i] == spr && newRandom(3) == 0)) {
+ if (i >= 0 && (dup[i] == spr && newRandom(3) == 0)) {
_commandHandler->addCommand(kCmdSeq, -1, 3, dup[0]); // Yes
_commandHandler->addCommand(kCmdSeq, -1, 3, dup[1]); // Yes
_commandHandler->addCommand(kCmdSeq, -1, 3, dup[2]); // Yes
Commit: 558a499a02d7f9e5ff772ad65d18044b6a35486d
https://github.com/scummvm/scummvm/commit/558a499a02d7f9e5ff772ad65d18044b6a35486d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2011-11-02T17:03:04-07:00
Commit Message:
CGE: Fix warning
Changed paths:
engines/cge/cge_main.cpp
diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp
index 1c2759b..8798a7f 100644
--- a/engines/cge/cge_main.cpp
+++ b/engines/cge/cge_main.cpp
@@ -185,7 +185,7 @@ void CGEEngine::syncHeader(Common::Serializer &s) {
s.syncAsUint16LE(checksum);
} else {
// Read checksum and validate it
- uint16 checksum;
+ uint16 checksum = 0;
s.syncAsUint16LE(checksum);
if (checksum != kSavegameCheckSum)
error("%s", _text->getText(kBadSVG));
Commit: 07163c76c938b40dc19212e7bfa19b1d63699d2d
https://github.com/scummvm/scummvm/commit/07163c76c938b40dc19212e7bfa19b1d63699d2d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2011-11-02T17:16:25-07:00
Commit Message:
HUGO: Fix warnings
Changed paths:
engines/hugo/route.cpp
diff --git a/engines/hugo/route.cpp b/engines/hugo/route.cpp
index 57c5148..281aacf 100644
--- a/engines/hugo/route.cpp
+++ b/engines/hugo/route.cpp
@@ -231,48 +231,48 @@ void Route::segment(int16 x, int16 y) {
if (_vm->_hero->x < x1) {
// Hero x not in segment, search x1..x2
// Find all segments above current
- for (x = x1; !(_routeFoundFl | _fullStackFl | _fullSegmentFl) && x <= x2; x++) {
+ for (x = x1; !(_routeFoundFl || _fullStackFl || _fullSegmentFl) && x <= x2; x++) {
if (_boundaryMap[y - 1][x] == 0)
segment(x, y - 1);
}
// Find all segments below current
- for (x = x1; !(_routeFoundFl | _fullStackFl | _fullSegmentFl) && x <= x2; x++) {
+ for (x = x1; !(_routeFoundFl || _fullStackFl || _fullSegmentFl) && x <= x2; x++) {
if (_boundaryMap[y + 1][x] == 0)
segment(x, y + 1);
}
} else if (_vm->_hero->x + kHeroMaxWidth > x2) {
// Hero x not in segment, search x1..x2
// Find all segments above current
- for (x = x2; !(_routeFoundFl | _fullStackFl | _fullSegmentFl) && x >= x1; x--) {
+ for (x = x2; !(_routeFoundFl || _fullStackFl || _fullSegmentFl) && x >= x1; x--) {
if (_boundaryMap[y - 1][x] == 0)
segment(x, y - 1);
}
// Find all segments below current
- for (x = x2; !(_routeFoundFl | _fullStackFl | _fullSegmentFl) && x >= x1; x--) {
+ for (x = x2; !(_routeFoundFl || _fullStackFl || _fullSegmentFl) && x >= x1; x--) {
if (_boundaryMap[y + 1][x] == 0)
segment(x, y + 1);
}
} else {
// Organize search around hero x position - this gives
// better chance for more direct route.
- for (x = _vm->_hero->x; !(_routeFoundFl | _fullStackFl | _fullSegmentFl) && x <= x2; x++) {
+ for (x = _vm->_hero->x; !(_routeFoundFl || _fullStackFl || _fullSegmentFl) && x <= x2; x++) {
if (_boundaryMap[y - 1][x] == 0)
segment(x, y - 1);
}
- for (x = x1; !(_routeFoundFl | _fullStackFl | _fullSegmentFl) && x < _vm->_hero->x; x++) {
+ for (x = x1; !(_routeFoundFl || _fullStackFl || _fullSegmentFl) && x < _vm->_hero->x; x++) {
if (_boundaryMap[y - 1][x] == 0)
segment(x, y - 1);
}
- for (x = _vm->_hero->x; !(_routeFoundFl | _fullStackFl | _fullSegmentFl) && x <= x2; x++) {
+ for (x = _vm->_hero->x; !(_routeFoundFl || _fullStackFl || _fullSegmentFl) && x <= x2; x++) {
if (_boundaryMap[y + 1][x] == 0)
segment(x, y + 1);
}
- for (x = x1; !(_routeFoundFl | _fullStackFl | _fullSegmentFl) && x < _vm->_hero->x; x++) {
+ for (x = x1; !(_routeFoundFl || _fullStackFl || _fullSegmentFl) && x < _vm->_hero->x; x++) {
if (_boundaryMap[y + 1][x] == 0)
segment(x, y + 1);
}
Commit: b3cad044500c816c6a7a84dd94a2beb15530cb9c
https://github.com/scummvm/scummvm/commit/b3cad044500c816c6a7a84dd94a2beb15530cb9c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2011-11-02T17:20:10-07:00
Commit Message:
LURE: Fix warnings
Changed paths:
engines/lure/hotspots.cpp
engines/lure/scripts.cpp
diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp
index 96e5e08..207c125 100644
--- a/engines/lure/hotspots.cpp
+++ b/engines/lure/hotspots.cpp
@@ -179,7 +179,6 @@ Hotspot::Hotspot(): _pathFinder(NULL) {
_walkFlag = false;
_skipFlag = false;
_roomNumber = 0;
- _destHotspotId = 0;
_startX = 0;
_startY = 0;
_destX = 0;
diff --git a/engines/lure/scripts.cpp b/engines/lure/scripts.cpp
index 22656dd..df2f06d 100644
--- a/engines/lure/scripts.cpp
+++ b/engines/lure/scripts.cpp
@@ -499,7 +499,7 @@ void Script::fixGoewin(uint16 v1, uint16 v2, uint16 v3) {
hotspot->currentActions().clear();
hotspot->currentActions().addFront(DISPATCH_ACTION, entry, hotspot->roomNumber());
- hotspot->setActions(hotspot->resource()->actions & !(1 << (TELL - 1)));
+ hotspot->setActions(hotspot->resource()->actions & ~(1 << (TELL - 1)));
hotspot->setActionCtr(0);
hotspot->setDelayCtr(0);
hotspot->setCharacterMode(CHARMODE_NONE);
Commit: 86ba940bc804ecae014fff37fcca03b6840ea6c8
https://github.com/scummvm/scummvm/commit/86ba940bc804ecae014fff37fcca03b6840ea6c8
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2011-11-02T17:31:55-07:00
Commit Message:
M4: Fix warnings
Changed paths:
engines/m4/converse.cpp
engines/m4/dialogs.cpp
engines/m4/hotspot.cpp
engines/m4/mads_logic.cpp
engines/m4/mads_scene.cpp
engines/m4/mads_views.cpp
diff --git a/engines/m4/converse.cpp b/engines/m4/converse.cpp
index bdce792..299fafb 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 2b2c479..e9c7414 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 a585a9a..a424d9f 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 3351273..cafddb2 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 5f160aa..73d9f57 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 0521903..d21bfc1 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;
Commit: e1a311a236131b909d29f1e5cc6f5a369682bd07
https://github.com/scummvm/scummvm/commit/e1a311a236131b909d29f1e5cc6f5a369682bd07
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2011-11-02T17:48:14-07:00
Commit Message:
PARALLACTION: Fix warnings. Fix nasty out-of-scope bug in parallaction_br.cpp
Changed paths:
engines/parallaction/graphics.cpp
engines/parallaction/parallaction_br.cpp
engines/parallaction/saveload.cpp
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp
index 1da61b6..a006edf 100644
--- a/engines/parallaction/graphics.cpp
+++ b/engines/parallaction/graphics.cpp
@@ -596,20 +596,22 @@ void Gfx::updateFloatingLabel() {
Common::Rect r;
_floatingLabel->getRect(0, r);
+ FloatingLabelTraits traits_NS = {
+ Common::Point(16 - r.width()/2, 34),
+ Common::Point(8 - r.width()/2, 21),
+ 0, 0, _vm->_screenWidth - r.width(), 190
+ };
+
+ // FIXME: _maxY for BRA is not constant (390), but depends on _vm->_subtitleY
+ FloatingLabelTraits traits_BR = {
+ Common::Point(34 - r.width()/2, 70),
+ Common::Point(16 - r.width()/2, 37),
+ 0, 0, _vm->_screenWidth - r.width(), 390
+ };
+
if (_gameType == GType_Nippon) {
- FloatingLabelTraits traits_NS = {
- Common::Point(16 - r.width()/2, 34),
- Common::Point(8 - r.width()/2, 21),
- 0, 0, _vm->_screenWidth - r.width(), 190
- };
traits = &traits_NS;
} else {
- // FIXME: _maxY for BRA is not constant (390), but depends on _vm->_subtitleY
- FloatingLabelTraits traits_BR = {
- Common::Point(34 - r.width()/2, 70),
- Common::Point(16 - r.width()/2, 37),
- 0, 0, _vm->_screenWidth - r.width(), 390
- };
traits = &traits_BR;
}
diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp
index 44a8899..d850d40 100644
--- a/engines/parallaction/parallaction_br.cpp
+++ b/engines/parallaction/parallaction_br.cpp
@@ -289,7 +289,7 @@ void Parallaction_br::changeLocation() {
_disk->selectArchive(_partNames[_part]);
- memset(_counters, 0, ARRAYSIZE(_counters));
+ memset(_counters, 0, sizeof(*_counters));
_globalFlagsNames = _disk->loadTable("global");
_objectsNames = _disk->loadTable("objects");
diff --git a/engines/parallaction/saveload.cpp b/engines/parallaction/saveload.cpp
index 5a1daa2..3ab25f2 100644
--- a/engines/parallaction/saveload.cpp
+++ b/engines/parallaction/saveload.cpp
@@ -49,7 +49,7 @@ Common::String SaveLoad::genSaveFileName(uint slot) {
assert(slot < NUM_SAVESLOTS || slot == SPECIAL_SAVESLOT);
char s[20];
- sprintf(s, "%s.%.3d", _saveFilePrefix.c_str(), slot);
+ sprintf(s, "%s.%.3u", _saveFilePrefix.c_str(), slot);
return Common::String(s);
}
Commit: 3da2e8662a236f78c9a4e33d31b6b55810e545f1
https://github.com/scummvm/scummvm/commit/3da2e8662a236f78c9a4e33d31b6b55810e545f1
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2011-11-02T18:03:10-07:00
Commit Message:
SAGA: Fix copy/paste error
Changed paths:
engines/saga/isomap.cpp
diff --git a/engines/saga/isomap.cpp b/engines/saga/isomap.cpp
index e886f0d..ec6b13f 100644
--- a/engines/saga/isomap.cpp
+++ b/engines/saga/isomap.cpp
@@ -95,7 +95,7 @@ static const int16 directions[8][2] = {
IsoMap::IsoMap(SagaEngine *vm) : _vm(vm) {
_viewScroll.x = (128 - 8) * 16;
- _viewScroll.x = (128 - 8) * 16 - 64;
+ _viewScroll.y = (128 - 8) * 16 - 64;
_viewDiff = 1;
}
Commit: c5fa1cabd8070df6b669c36d995566f27358301c
https://github.com/scummvm/scummvm/commit/c5fa1cabd8070df6b669c36d995566f27358301c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2011-11-02T18:05:03-07:00
Commit Message:
SAGA: Fix warnings
Changed paths:
engines/saga/gfx.cpp
engines/saga/saveload.cpp
diff --git a/engines/saga/gfx.cpp b/engines/saga/gfx.cpp
index ab0c0f3..8e98f0f 100644
--- a/engines/saga/gfx.cpp
+++ b/engines/saga/gfx.cpp
@@ -123,7 +123,7 @@ void Surface::drawPolyLine(const Point *points, int count, int color) {
drawLine(points[i].x, points[i].y, points[i - 1].x, points[i - 1].y, color);
}
- drawLine(points[count - 1].x, points[count - 1].y, points->x, points->y, color);
+ drawLine(points[count - 1].x, points[count - 1].y, points[0].x, points[0].y, color);
}
}
diff --git a/engines/saga/saveload.cpp b/engines/saga/saveload.cpp
index 9e0789f..6a5a7d8 100644
--- a/engines/saga/saveload.cpp
+++ b/engines/saga/saveload.cpp
@@ -44,7 +44,7 @@ static SaveFileData emptySlot = {
char* SagaEngine::calcSaveFileName(uint slotNumber) {
static char name[MAX_FILE_NAME];
- sprintf(name, "%s.s%02d", _targetName.c_str(), slotNumber);
+ sprintf(name, "%s.s%02u", _targetName.c_str(), slotNumber);
return name;
}
Commit: 7e298f13a163dc2dfd18a654eaf059744b6dea75
https://github.com/scummvm/scummvm/commit/7e298f13a163dc2dfd18a654eaf059744b6dea75
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2011-11-02T18:06:56-07:00
Commit Message:
SCI: Fix copy/paste error
Changed paths:
engines/sci/engine/klists.cpp
diff --git a/engines/sci/engine/klists.cpp b/engines/sci/engine/klists.cpp
index 8500f08..83e59c9 100644
--- a/engines/sci/engine/klists.cpp
+++ b/engines/sci/engine/klists.cpp
@@ -409,7 +409,7 @@ int sort_temp_cmp(const void *p1, const void *p2) {
const sort_temp_t *st1 = (const sort_temp_t *)p1;
const sort_temp_t *st2 = (const sort_temp_t *)p2;
- if (st1->order.segment < st1->order.segment || (st1->order.segment == st1->order.segment && st1->order.offset < st2->order.offset))
+ if (st1->order.segment < st2->order.segment || (st1->order.segment == st2->order.segment && st1->order.offset < st2->order.offset))
return -1;
if (st1->order.segment > st2->order.segment || (st1->order.segment == st2->order.segment && st1->order.offset > st2->order.offset))
Commit: 6d2e7228b5b8df4a9e16e36475196d2e16b4c634
https://github.com/scummvm/scummvm/commit/6d2e7228b5b8df4a9e16e36475196d2e16b4c634
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2011-11-02T18:17:46-07:00
Commit Message:
SCI: Add fixme comment to a weird comparison
Changed paths:
engines/sci/engine/segment.cpp
diff --git a/engines/sci/engine/segment.cpp b/engines/sci/engine/segment.cpp
index 3f11d6f..8bf6e83 100644
--- a/engines/sci/engine/segment.cpp
+++ b/engines/sci/engine/segment.cpp
@@ -143,6 +143,7 @@ SegmentRef LocalVariables::dereference(reg_t pointer) {
if (ret.maxSize > 0) {
ret.reg = &_locals[pointer.offset / 2];
} else {
+ // FIXME: Second 660 has to be either fixed or removed
if ((g_sci->getEngineState()->currentRoomNumber() == 660 || g_sci->getEngineState()->currentRoomNumber() == 660)
&& g_sci->getGameId() == GID_LAURABOW2) {
// Happens in two places during the intro of LB2CD, both from kMemory(peek):
More information about the Scummvm-git-logs
mailing list