[Scummvm-git-logs] scummvm master -> 1770c8fc3674be52bebab694c6fbe728b32ea16a

mgerhardy martin.gerhardy at gmail.com
Fri Aug 27 05:35:04 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
1770c8fc36 TWINE: fixed fla video big endian issues


Commit: 1770c8fc3674be52bebab694c6fbe728b32ea16a
    https://github.com/scummvm/scummvm/commit/1770c8fc3674be52bebab694c6fbe728b32ea16a
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-08-27T00:04:54+02:00

Commit Message:
TWINE: fixed fla video big endian issues

Changed paths:
    engines/twine/flamovies.cpp


diff --git a/engines/twine/flamovies.cpp b/engines/twine/flamovies.cpp
index 8837298b60..f9cc6eb858 100644
--- a/engines/twine/flamovies.cpp
+++ b/engines/twine/flamovies.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "twine/flamovies.h"
+#include "common/endian.h"
 #include "common/file.h"
 #include "common/system.h"
 #include "graphics/managed_surface.h"
@@ -162,8 +163,8 @@ void FlaMovies::scaleFla2x() {
 void FlaMovies::processFrame() {
 	FLASampleStruct sample;
 
-	_file.read(&_frameData.videoSize, 2);
-	_file.read(&_frameData.frameVar0, 4);
+	_frameData.videoSize = _file.readSint16LE();
+	_frameData.frameVar0 = _file.readSint32LE();
 	if (_frameData.frameVar0 > _engine->_imageBuffer.w * _engine->_imageBuffer.h) {
 		warning("Skipping video frame - it would exceed the screen buffer: %i", _frameData.frameVar0);
 		return;
@@ -366,7 +367,8 @@ void FlaMovies::playFlaMovie(const char *flaName) {
 		return;
 	}
 
-	_file.read(&_flaHeaderData.version, 6);
+	const uint32 version = _file.readUint32LE();
+	_file.skip(2);
 	_flaHeaderData.numOfFrames = _file.readUint32LE();
 	_flaHeaderData.speed = _file.readByte();
 	_flaHeaderData.var1 = _file.readByte();
@@ -380,7 +382,7 @@ void FlaMovies::playFlaMovie(const char *flaName) {
 
 	_file.skip(4 * _samplesInFla);
 
-	if (!strcmp((const char *)_flaHeaderData.version, "V1.3")) {
+	if (version != MKTAG('V', '1', '.', '3')) {
 		int32 currentFrame = 0;
 
 		debug("Play fla: %s", flaName);




More information about the Scummvm-git-logs mailing list