[Scummvm-git-logs] scummvm master -> 9ab9c38f7a4fbb61638c8aee34ae7e86a9af3352

SupSuper supsuper at gmail.com
Mon Jun 7 22:55:23 UTC 2021


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:
89819274af TRECISION: Workaround for background video loops
9ab9c38f7a Revert "VIDEO: Allow endOfVideo() to be overriden"


Commit: 89819274af0df501f1d143dc2cde02e85dde398c
    https://github.com/scummvm/scummvm/commit/89819274af0df501f1d143dc2cde02e85dde398c
Author: SupSuper (supsuper at gmail.com)
Date: 2021-06-07T23:45:42+01:00

Commit Message:
TRECISION: Workaround for background video loops

Changed paths:
    engines/trecision/video.cpp
    engines/trecision/video.h


diff --git a/engines/trecision/video.cpp b/engines/trecision/video.cpp
index 47de1642ec..d642d72886 100644
--- a/engines/trecision/video.cpp
+++ b/engines/trecision/video.cpp
@@ -110,6 +110,12 @@ bool NightlongSmackerDecoder::forceSeekToFrame(uint frame) {
 	return true;
 }
 
+// TODO: Background videos only loop smoothly like this,
+// possibly an audio track bug?
+bool NightlongSmackerDecoder::endOfFrames() const {
+	return getCurFrame() >= (int32)getFrameCount() - 1;
+}
+
 AnimManager::AnimManager(TrecisionEngine *vm) : _vm(vm) {
 	for (int i = 0; i < MAXSMACK; ++i) {
 		_smkAnims[i] = nullptr;
@@ -440,7 +446,7 @@ void AnimManager::handleEndOfVideo(int animation, int slot) {
 		smkStop(slot);
 		return;
 	}
-	if (!_smkAnims[slot]->endOfVideo())
+	if (!_smkAnims[slot]->endOfFrames())
 		return;
 	
 	if (!(_animTab[animation]._flag & SMKANIM_LOOP) && !(_animTab[animation]._flag & SMKANIM_BKG)) {
diff --git a/engines/trecision/video.h b/engines/trecision/video.h
index 02f4cd73d4..5efcdd3b66 100644
--- a/engines/trecision/video.h
+++ b/engines/trecision/video.h
@@ -59,7 +59,7 @@ public:
 	void muteTrack(uint track, bool mute);
 	void setMute(bool mute);
 	bool forceSeekToFrame(uint frame);
-	bool endOfVideo() const override { return !hasFramesLeft(); }
+	bool endOfFrames() const;
 };
 
 class AnimManager {


Commit: 9ab9c38f7a4fbb61638c8aee34ae7e86a9af3352
    https://github.com/scummvm/scummvm/commit/9ab9c38f7a4fbb61638c8aee34ae7e86a9af3352
Author: SupSuper (supsuper at gmail.com)
Date: 2021-06-07T23:45:49+01:00

Commit Message:
Revert "VIDEO: Allow endOfVideo() to be overriden"

This reverts commit ba007cfd2bea82d35d1ca3da9a36f3ecd8ef5981.

Changed paths:
    video/video_decoder.h


diff --git a/video/video_decoder.h b/video/video_decoder.h
index 8ba23f57d2..ec0804ce86 100644
--- a/video/video_decoder.h
+++ b/video/video_decoder.h
@@ -238,7 +238,7 @@ public:
 	 * Returns if the video has reached the end or not.
 	 * @return true if the video has finished playing or if none is loaded, false otherwise
 	 */
-	virtual bool endOfVideo() const;
+	bool endOfVideo() const;
 
 	/**
 	 * Returns the current frame number of the video.




More information about the Scummvm-git-logs mailing list