[Scummvm-git-logs] scummvm master -> 4d2889fb611f05c0a628df91762d7911e184a28f
whiterandrek
whiterandrek at gmail.com
Sun Oct 4 21:20:32 UTC 2020
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
4f1e5edd8d PETKA: workaround for broken flics
bf9b6c8e89 PETKA: updated engine status
4d2889fb61 PETKA: original bug fix
Commit: 4f1e5edd8dcc18150705da9a8e81c7d6c1fdee7a
https://github.com/scummvm/scummvm/commit/4f1e5edd8dcc18150705da9a8e81c7d6c1fdee7a
Author: Andrei Prykhodko (whiterandrek at gmail.com)
Date: 2020-10-05T00:14:45+03:00
Commit Message:
PETKA: workaround for broken flics
Changed paths:
engines/petka/flc.cpp
engines/petka/flc.h
diff --git a/engines/petka/flc.cpp b/engines/petka/flc.cpp
index 02b457e0a2..f11825f064 100644
--- a/engines/petka/flc.cpp
+++ b/engines/petka/flc.cpp
@@ -178,4 +178,44 @@ uint FlicDecoder::FlicVideoTrack::getDelay() const {
return _frameDelay;
}
+#define FRAME_TYPE 0xF1FA
+#define FLC_FILE_HEADER 0xAF12
+#define FLC_FILE_HEADER_SIZE 0x80
+
+const Graphics::Surface *FlicDecoder::FlicVideoTrack::decodeNextFrame() {
+ // attempt to fix broken flics
+ while (true) {
+ /*uint32 frameSize = */_fileStream->readUint32LE();
+ uint16 frameType = _fileStream->readUint16LE();
+
+ bool processed = true;
+ switch (frameType) {
+ case FRAME_TYPE:
+ handleFrame();
+ break;
+ case FLC_FILE_HEADER:
+ // Skip 0x80 bytes of file header subtracting 6 bytes of header
+ _fileStream->skip(FLC_FILE_HEADER_SIZE - 6);
+ break;
+ default:
+ processed = false;
+ _fileStream->seek(-5, SEEK_CUR);
+ break;
+ }
+ if (processed)
+ break;
+ }
+
+ _curFrame++;
+ _nextFrameStartTime += _frameDelay;
+
+ if (_atRingFrame) {
+ // If we decoded the ring frame, seek to the second frame
+ _atRingFrame = false;
+ _fileStream->seek(_offsetFrame2);
+ }
+
+ return _surface;
+}
+
} // End of namespace Petka
diff --git a/engines/petka/flc.h b/engines/petka/flc.h
index 17b88c6492..9f5bad92fd 100644
--- a/engines/petka/flc.h
+++ b/engines/petka/flc.h
@@ -44,6 +44,8 @@ protected:
public:
FlicVideoTrack(Common::SeekableReadStream *stream, uint16 frameCount, uint16 width, uint16 height, bool skipHeader = false);
+ const Graphics::Surface *decodeNextFrame() override;
+
bool loadMsk(Common::SeekableReadStream &stream);
uint getDelay() const;
Commit: bf9b6c8e89ad04ec9c1c334ec4fca4c509321e41
https://github.com/scummvm/scummvm/commit/bf9b6c8e89ad04ec9c1c334ec4fca4c509321e41
Author: Andrei Prykhodko (whiterandrek at gmail.com)
Date: 2020-10-05T00:14:45+03:00
Commit Message:
PETKA: updated engine status
The first game can now be completed
Changed paths:
engines/petka/petka.h
diff --git a/engines/petka/petka.h b/engines/petka/petka.h
index 25aabb8772..1d4be76c3d 100644
--- a/engines/petka/petka.h
+++ b/engines/petka/petka.h
@@ -39,11 +39,8 @@
*
* Games using this engine:
* - Red Comrades Demo
- * - Red Comrades Save the Galaxy
- * - Part 1: can be completed
- * - Part 2: error: unsupported flc
- * - Part 3: script bug
- * - Red Comrades 2: For the Great Justice
+ * - Red Comrades Save the Galaxy - Fully playable
+ * - Red Comrades 2: For the Great Justice - Not tested
*/
struct ADGameDescription;
Commit: 4d2889fb611f05c0a628df91762d7911e184a28f
https://github.com/scummvm/scummvm/commit/4d2889fb611f05c0a628df91762d7911e184a28f
Author: Andrei Prykhodko (whiterandrek at gmail.com)
Date: 2020-10-05T00:14:45+03:00
Commit Message:
PETKA: original bug fix
Changed paths:
engines/petka/interfaces/sequence.cpp
diff --git a/engines/petka/interfaces/sequence.cpp b/engines/petka/interfaces/sequence.cpp
index 5d1bbf106e..30dedb6fe8 100644
--- a/engines/petka/interfaces/sequence.cpp
+++ b/engines/petka/interfaces/sequence.cpp
@@ -66,8 +66,12 @@ void InterfaceSequence::start(int id) {
void InterfaceSequence::stop() {
removeObjects();
- g_vm->soundMgr()->removeSound(g_vm->resMgr()->findSoundName(_fxId));
- g_vm->soundMgr()->removeSound(g_vm->resMgr()->findSoundName(_musicId));
+ // original bug fix
+ QObjectBG *room = g_vm->getQSystem()->_room;
+ if (!room || room->_fxId != _fxId)
+ g_vm->soundMgr()->removeSound(g_vm->resMgr()->findSoundName(_fxId));
+ if (!room || room->_musicId != _musicId)
+ g_vm->soundMgr()->removeSound(g_vm->resMgr()->findSoundName(_musicId));
_fxId = 0;
_musicId = 0;
More information about the Scummvm-git-logs
mailing list