[Scummvm-git-logs] scummvm master -> f25b899e1d76b13475038203a9ef398116278357

bluegr bluegr at gmail.com
Mon May 31 19:27:03 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:
f25b899e1d Revert "TRECISION: Fix drawing of the first Smacker frame in some animations"


Commit: f25b899e1d76b13475038203a9ef398116278357
    https://github.com/scummvm/scummvm/commit/f25b899e1d76b13475038203a9ef398116278357
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2021-05-31T22:26:15+03:00

Commit Message:
Revert "TRECISION: Fix drawing of the first Smacker frame in some animations"

This reverts commit a33b9877c1573cbc636d4a7d23e731805ee34e02.

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


diff --git a/engines/trecision/video.cpp b/engines/trecision/video.cpp
index cd96b5778d..abab5bfef5 100644
--- a/engines/trecision/video.cpp
+++ b/engines/trecision/video.cpp
@@ -121,6 +121,8 @@ AnimManager::AnimManager(TrecisionEngine *vm) : _vm(vm) {
 
 	_curCD = 1;
 	swapCD(_curCD);
+
+	_bgAnimRestarted = false;
 }
 
 AnimManager::~AnimManager() {
@@ -289,6 +291,8 @@ void AnimManager::startSmkAnim(uint16 animation) {
 	// choose how to open
 	if (slot == kSmackerBackground) {
 		openSmkAnim(kSmackerBackground, _animTab[animation]._name);
+		_bgAnimRestarted = false;
+
 		toggleMuteBgAnim(animation);
 	} else if (slot == kSmackerIcon) {
 		openSmkAnim(kSmackerIcon, _animTab[animation]._name);
@@ -434,6 +438,7 @@ void AnimManager::handleEndOfVideo(int animation, int slot) {
 	} else {
 		_smkAnims[slot]->rewind();
 		_vm->_animTypeMgr->init(animation, 0);
+		_bgAnimRestarted = true;
 	}
 }
 
@@ -446,23 +451,27 @@ void AnimManager::drawSmkBackgroundFrame(int animation) {
 	const Common::Rect *lastRect = smkDecoder->getNextDirtyRect();
 	const byte *palette = smkDecoder->getPalette();
 
-	while (lastRect) {
-		bool intersects = false;
-		for (int32 i = 0; i < MAXCHILD; i++) {
-			if (_animTab[animation]._flag & (SMKANIM_OFF1 << i)) {
-				if (_animTab[animation]._lim[i].intersects(*lastRect)) {
-					intersects = true;
-					break;
+	if (smkDecoder->getCurFrame() == 0 && !_bgAnimRestarted) {
+		_vm->_graphicsMgr->blitToScreenBuffer(frame, 0, TOP, palette, true);
+	} else {
+		while (lastRect) {
+			bool intersects = false;
+			for (int32 a = 0; a < MAXCHILD; a++) {
+				if (_animTab[animation]._flag & (SMKANIM_OFF1 << a)) {
+					if (_animTab[animation]._lim[a].intersects(*lastRect)) {
+						intersects = true;
+						break;
+					}
 				}
 			}
-		}
 
-		if (!intersects) {
-			Graphics::Surface anim = frame->getSubArea(*lastRect);
-			_vm->_graphicsMgr->blitToScreenBuffer(&anim, lastRect->left, lastRect->top + TOP, palette, true);
-		}
+			if (smkDecoder->getCurFrame() > 0 && !intersects) {
+				Graphics::Surface anim = frame->getSubArea(*lastRect);
+				_vm->_graphicsMgr->blitToScreenBuffer(&anim, lastRect->left, lastRect->top + TOP, palette, true);
+			}
 
-		lastRect = smkDecoder->getNextDirtyRect();
+			lastRect = smkDecoder->getNextDirtyRect();
+		}
 	}
 }
 
diff --git a/engines/trecision/video.h b/engines/trecision/video.h
index 4807fcfb7e..983fe571da 100644
--- a/engines/trecision/video.h
+++ b/engines/trecision/video.h
@@ -74,6 +74,7 @@ private:
 
 	FastFile _animFile[MAXSMACK]; // nlanim.cd1 / nlanim.cd2 / nlanim.cd3
 	int _curCD;
+	bool _bgAnimRestarted;
 
 	void openSmk(int slot, Common::SeekableReadStream *stream);
 	void openSmkAnim(int slot, const Common::String &name);




More information about the Scummvm-git-logs mailing list