[Scummvm-git-logs] scummvm master -> a25b068b6a3d1ace1e8be53d155cdb5dbcf80a74
athrxx
noreply at scummvm.org
Fri Aug 25 11:39:51 UTC 2023
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
c23d43bc16 KYRA: fix some Coverity warnings
a25b068b6a SCUMM: (SCUMM4-6) - fix actor turning direction
Commit: c23d43bc1617f6cf2ff8df9649554c74cb0beb70
https://github.com/scummvm/scummvm/commit/c23d43bc1617f6cf2ff8df9649554c74cb0beb70
Author: athrxx (athrxx at scummvm.org)
Date: 2023-08-25T13:37:49+02:00
Commit Message:
KYRA: fix some Coverity warnings
Changed paths:
engines/kyra/gui/gui.cpp
engines/kyra/gui/saveload_eob.cpp
engines/kyra/kyra_v1.h
engines/kyra/sound/sound.cpp
engines/kyra/sound/sound_pc_v1.cpp
diff --git a/engines/kyra/gui/gui.cpp b/engines/kyra/gui/gui.cpp
index ba74570a42f..6f5d080f9a3 100644
--- a/engines/kyra/gui/gui.cpp
+++ b/engines/kyra/gui/gui.cpp
@@ -30,7 +30,7 @@
namespace Kyra {
-GUI::GUI(KyraEngine_v1 *kyra) : _vm(kyra), _screen(kyra->screen()) {
+GUI::GUI(KyraEngine_v1 *kyra) : _vm(kyra), _screen(kyra ? kyra->screen() : nullptr) {
_saveSlotsListUpdateNeeded = true;
_savegameListSize = 0;
_savegameList = nullptr;
diff --git a/engines/kyra/gui/saveload_eob.cpp b/engines/kyra/gui/saveload_eob.cpp
index 5da0b35fb4e..2889edb084f 100644
--- a/engines/kyra/gui/saveload_eob.cpp
+++ b/engines/kyra/gui/saveload_eob.cpp
@@ -1291,7 +1291,7 @@ bool EoBCoreEngine::saveAsOriginalSaveFile(int slot) {
Common::String curBlockFile = _curBlockFile;
_curBlockFile = getBlockFileName(i + 1, 0);
const uint8 *p = getBlockFileData(i + 1);
- _curBlockFile = curBlockFile;
+ _curBlockFile = Common::move(curBlockFile);
uint16 len = READ_LE_UINT16(p + 4);
p += 6;
diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h
index aee91f8483d..0270af6a70c 100644
--- a/engines/kyra/kyra_v1.h
+++ b/engines/kyra/kyra_v1.h
@@ -234,8 +234,8 @@ protected:
bool causedSkip;
Event() : event(), causedSkip(false) {}
- Event(Common::Event e) : event(e), causedSkip(false) {}
- Event(Common::Event e, bool skip) : event(e), causedSkip(skip) {}
+ Event(Common::Event e) : event(Common::move(e)), causedSkip(false) {}
+ Event(Common::Event e, bool skip) : event(Common::move(e)), causedSkip(skip) {}
operator Common::Event() const { return event; }
};
diff --git a/engines/kyra/sound/sound.cpp b/engines/kyra/sound/sound.cpp
index ca57239cf08..21412256b54 100644
--- a/engines/kyra/sound/sound.cpp
+++ b/engines/kyra/sound/sound.cpp
@@ -215,11 +215,11 @@ void MixedSoundDriver::loadSoundFile(uint file) {
void MixedSoundDriver::loadSoundFile(Common::String file) {
_music->loadSoundFile(file);
- _sfx->loadSoundFile(file);
+ _sfx->loadSoundFile(Common::move(file));
}
void MixedSoundDriver::loadSfxFile(Common::String file) {
- _sfx->loadSoundFile(file);
+ _sfx->loadSoundFile(Common::move(file));
}
void MixedSoundDriver::playTrack(uint8 track) {
diff --git a/engines/kyra/sound/sound_pc_v1.cpp b/engines/kyra/sound/sound_pc_v1.cpp
index 1890440cf6b..adc6a5e8e8e 100644
--- a/engines/kyra/sound/sound_pc_v1.cpp
+++ b/engines/kyra/sound/sound_pc_v1.cpp
@@ -212,7 +212,7 @@ void SoundPC_v1::loadSoundFile(uint file) {
}
void SoundPC_v1::loadSoundFile(Common::String file) {
- internalLoadFile(file);
+ internalLoadFile(Common::move(file));
}
void SoundPC_v1::internalLoadFile(Common::String file) {
Commit: a25b068b6a3d1ace1e8be53d155cdb5dbcf80a74
https://github.com/scummvm/scummvm/commit/a25b068b6a3d1ace1e8be53d155cdb5dbcf80a74
Author: athrxx (athrxx at scummvm.org)
Date: 2023-08-25T13:38:56+02:00
Commit Message:
SCUMM: (SCUMM4-6) - fix actor turning direction
This is the same thing that already got fixed for v1-3. Turns
out that the code for v4-6 is exactly the same.
Changed paths:
engines/scumm/actor.cpp
diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index 5051e767106..a6edf10a462 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -1494,7 +1494,7 @@ int Actor::updateActorDirection(bool is_walking) {
dir &= 1023;
if (shouldInterpolate) {
- if (_vm->_game.version <= 3) {
+ if (_vm->_game.version <= 6) {
static const uint8 tbl[] = { 0, 2, 2, 3, 2, 1, 2, 3, 0, 1, 2, 1, 0, 1, 0, 3 };
dir = oldDirToNewDir(tbl[newDirToOldDir(dir) | (newDirToOldDir(_facing) << 2)]);
} else {
More information about the Scummvm-git-logs
mailing list