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

mduggan noreply at scummvm.org
Tue Nov 5 21:10:16 UTC 2024


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:
bd1489efb2 DGDS: Also define "finished" as not running for HoC+


Commit: bd1489efb2b0232cf644f0d475af8750f6ab5a3c
    https://github.com/scummvm/scummvm/commit/bd1489efb2b0232cf644f0d475af8750f6ab5a3c
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2024-11-06T08:09:42+11:00

Commit Message:
DGDS: Also define "finished" as not running for HoC+

Although RotD only checks against a sequence being Stopped for IF_NOT_RUNNING,
from HoC onward the check also included Finished as not running.

This fixes flashing characters in Willy Beamish.

Changed paths:
    engines/dgds/ads.cpp


diff --git a/engines/dgds/ads.cpp b/engines/dgds/ads.cpp
index 5d6fe10a59c..c8450d89e90 100644
--- a/engines/dgds/ads.cpp
+++ b/engines/dgds/ads.cpp
@@ -365,9 +365,12 @@ bool ADSInterpreter::logicOpResult(uint16 code, const TTMEnviro *env, const TTMS
 		debugN(10, "ADS 0x%04x: %s finished env %d seq %d (%s)", code, optype, envNum, seqNum, tag);
 		return seq->_runFlag == kRunTypeFinished;
 	case 0x1060: // WHILE NOT RUNNING
-	case 0x1360: // IF_NOT_RUNNING, 2 params
+	case 0x1360: { // IF_NOT_RUNNING, 2 params
 		debugN(10, "ADS 0x%04x: %s not running env %d seq %d (%s)", code, optype, envNum, seqNum, tag);
-		return seq->_runFlag == kRunTypeStopped;
+		// Dragon only checks kRunTypeStopped, HoC onward also check for kRunTypeFinished
+		bool isDragon = _vm->getGameId() == GID_DRAGON;
+		return seq->_runFlag == kRunTypeStopped || (!isDragon && seq->_runFlag == kRunTypeFinished);
+	}
 	case 0x1070: // WHILE RUNNING
 	case 0x1370: // IF_RUNNING, 2 params
 		debugN(10, "ADS 0x%04x: %s running env %d seq %d (%s)", code, optype, envNum, seqNum, tag);
@@ -788,9 +791,14 @@ bool ADSInterpreter::run() {
 		int16 flag = _adsData->_state[idx] & 0xfff7;
 		for (auto seq : _adsData->_usedSeqs[idx]) {
 			if (flag == 3) {
+				debug(10, "ADS: Segment idx %d, Reset seq %d", idx, seq->_seqNum);
 				seq->reset();
 			} else {
-				seq->_scriptFlag = flag;
+				if (flag != seq->_scriptFlag) {
+					//debug(10, "ADS: Segment idx %d, update seq %d scriptflag %d -> %d",
+					//	idx, seq->_seqNum, seq->_scriptFlag, flag);
+					seq->_scriptFlag = flag;
+				}
 			}
 		}
 	}




More information about the Scummvm-git-logs mailing list