[Scummvm-git-logs] scummvm master -> f1abf7d007a3acb337b1c773292f62da220bc61f
antoniou79
a.antoniou79 at gmail.com
Wed Dec 9 09:59:24 UTC 2020
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:
168731e788 MOHAWK: Fix Myst regression (bug #11954)
f1abf7d007 MOHAWK: Remove unnecessary string trimming
Commit: 168731e788250b87edf0cef5560bf607ee9d1ac1
https://github.com/scummvm/scummvm/commit/168731e788250b87edf0cef5560bf607ee9d1ac1
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2020-12-09T11:59:19+02:00
Commit Message:
MOHAWK: Fix Myst regression (bug #11954)
Apparently, when reading a movie file name the engine needs to read
an even number of bytes, so if the length of the file name is even
(not counting the terminating 0) it has to read an extra byte. This
was already done, but apparently the String class used to allow you
to add terminators to a string, and these were then counted into
the length of it. Not adding the terminator avoids this disambiguity.
Changed paths:
engines/mohawk/myst_areas.cpp
diff --git a/engines/mohawk/myst_areas.cpp b/engines/mohawk/myst_areas.cpp
index a572b14958..dd859ff5cb 100644
--- a/engines/mohawk/myst_areas.cpp
+++ b/engines/mohawk/myst_areas.cpp
@@ -184,12 +184,13 @@ MystAreaVideo::MystAreaVideo(MohawkEngine_Myst *vm, ResourceType type, Common::S
MystAreaAction(vm, type, rlstStream, parent) {
char c = 0;
- do {
- c = rlstStream->readByte();
+ while ((c = rlstStream->readByte()) != 0) {
_videoFile += c;
- } while (c);
+ }
- rlstStream->skip(_videoFile.size() & 1);
+ if ((_videoFile.size() & 1) == 0) {
+ rlstStream->skip(1);
+ }
// Trim method does not remove extra trailing nulls
while (_videoFile.size() != 0 && _videoFile.lastChar() == 0)
Commit: f1abf7d007a3acb337b1c773292f62da220bc61f
https://github.com/scummvm/scummvm/commit/f1abf7d007a3acb337b1c773292f62da220bc61f
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2020-12-09T11:59:19+02:00
Commit Message:
MOHAWK: Remove unnecessary string trimming
Since terminators are no longer added, there should be no need to
trim them afterwards.
Changed paths:
engines/mohawk/myst_areas.cpp
diff --git a/engines/mohawk/myst_areas.cpp b/engines/mohawk/myst_areas.cpp
index dd859ff5cb..9e2934ed26 100644
--- a/engines/mohawk/myst_areas.cpp
+++ b/engines/mohawk/myst_areas.cpp
@@ -192,10 +192,6 @@ MystAreaVideo::MystAreaVideo(MohawkEngine_Myst *vm, ResourceType type, Common::S
rlstStream->skip(1);
}
- // Trim method does not remove extra trailing nulls
- while (_videoFile.size() != 0 && _videoFile.lastChar() == 0)
- _videoFile.deleteLastChar();
-
_videoFile = convertMystVideoName(_videoFile);
_videoFile = _vm->selectLocalizedMovieFilename(_videoFile);
More information about the Scummvm-git-logs
mailing list