[Scummvm-git-logs] scummvm master -> 5050713fd93a995d12e65cae1cc6b67cb406d7a8

mduggan noreply at scummvm.org
Wed Jul 17 11:37:34 UTC 2024


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:
e2d57aa6b2 DGDS: Fix swap button after loading of HoC game
5050713fd9 DGDS: Add support for flood fill opcode


Commit: e2d57aa6b2768011951b5a8f420f796e3205632b
    https://github.com/scummvm/scummvm/commit/e2d57aa6b2768011951b5a8f420f796e3205632b
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2024-07-17T21:37:24+10:00

Commit Message:
DGDS: Fix swap button after loading of HoC game

Changed paths:
    engines/dgds/dgds.cpp


diff --git a/engines/dgds/dgds.cpp b/engines/dgds/dgds.cpp
index 90b4ef4881d..2a70a3eed5d 100644
--- a/engines/dgds/dgds.cpp
+++ b/engines/dgds/dgds.cpp
@@ -701,8 +701,6 @@ Common::Error DgdsEngine::syncGame(Common::Serializer &s) {
 		_scene->unload();
 		_adsInterp->unload();
 		_scene->load(sceneFile, _resource, _decompressor);
-		if (!_isDemo)
-			_scene->addInvButtonToHotAreaList();
 	}
 
 	result = _scene->syncState(s);
@@ -717,6 +715,11 @@ Common::Error DgdsEngine::syncGame(Common::Serializer &s) {
 	result = _inventory->syncState(s);
 	if (result.getCode() != Common::kNoError) return result;
 
+	// Add inv button - we deferred this to now to make sure globals etc
+	// are in the right state.
+	if (s.isLoading())
+		_scene->addInvButtonToHotAreaList();
+
 	if (s.getVersion() < 4) {
 		result = _gamePals->syncState(s);
 		if (result.getCode() != Common::kNoError) return result;


Commit: 5050713fd93a995d12e65cae1cc6b67cb406d7a8
    https://github.com/scummvm/scummvm/commit/5050713fd93a995d12e65cae1cc6b67cb406d7a8
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2024-07-17T21:37:24+10:00

Commit Message:
DGDS: Add support for flood fill opcode

Changed paths:
    engines/dgds/globals.cpp
    engines/dgds/ttm.cpp


diff --git a/engines/dgds/globals.cpp b/engines/dgds/globals.cpp
index 69f5be95fea..1e02239eed6 100644
--- a/engines/dgds/globals.cpp
+++ b/engines/dgds/globals.cpp
@@ -92,7 +92,12 @@ int16 Globals::getGlobal(uint16 num) {
 			return global->get();
 	}
 
-	error("getGlobal: requested non-existing global %d", num);
+	if (num)
+		error("getGlobal: requested non-existing global %d", num);
+
+	// Bug in HoC?
+	warning("getGlobal: requested global 0");
+	return 0;
 }
 
 int16 Globals::setGlobal(uint16 num, int16 val) {
diff --git a/engines/dgds/ttm.cpp b/engines/dgds/ttm.cpp
index 1ce5b273b1f..9eb36798d34 100644
--- a/engines/dgds/ttm.cpp
+++ b/engines/dgds/ttm.cpp
@@ -199,10 +199,13 @@ static const char *ttmOpName(uint16 op) {
 	case 0xa520: return "DRAW SPRITE FLIPH";
 	case 0xa530: return "DRAW SPRITE FLIPHV";
 	case 0xa600: return "DRAW GETPUT";
+	case 0xaf00: return "DRAW FLOOD FILL";
 	case 0xaf10: return "DRAW EMPTY POLY";
 	case 0xaf20: return "DRAW FILLED POLY";
 	case 0xb000: return "INIT CREDITS SCROLL";
 	case 0xb010: return "DRAW CREDITS SCROLL";
+	case 0xb600: return "COPY BUFFER";
+
 	case 0xf010: return "LOAD SCR";
 	case 0xf020: return "LOAD BMP";
 	case 0xf040: return "LOAD FONT";
@@ -223,13 +226,14 @@ static const char *ttmOpName(uint16 op) {
 	case 0x00C0: return "FREE BACKGROUND";
 	case 0x0230: return "reset current music?";
 	case 0x1310: return "STOP SFX";
-	case 0xb600: return "COPY BUFFER";
 	case 0xc020: return "LOAD_SAMPLE";
 	case 0xc030: return "SELECT_SAMPLE";
 	case 0xc040: return "DESELECT_SAMPLE";
 	case 0xc050: return "PLAY_SAMPLE";
 	case 0xc060: return "STOP_SAMPLE";
 	case 0xc0e0: return "FADE SONG";
+	case 0xc210: return "LOAD RAW SFX";
+	case 0xc220: return "PLAY RAW SFX ??";
 
 	default: return "UNKNOWN!!";
 	}
@@ -489,6 +493,7 @@ void TTMInterpreter::handleOperation(TTMEnviro &env, TTMSeq &seq, uint16 op, byt
 		seq._currentPalId = 0;
 		break;
 	case 0x0080: // FREE SHAPE
+		//debug("0x0080: Free from slot %d for seq %d env %d", seq._currentBmpId, seq._seqNum, env._enviro);
 		env._scriptShapes[seq._currentBmpId].reset();
 		break;
 	case 0x0090: // FREE FONT
@@ -533,6 +538,7 @@ void TTMInterpreter::handleOperation(TTMEnviro &env, TTMSeq &seq, uint16 op, byt
 		seq._brushNum = ivals[0];
 		break;
 	case 0x1050: // SELECT BMP:	    id:int [0:n]
+		//debug("0x1051: Select bmp %d for seq %d from env %d", ivals[0], seq._seqNum, env._enviro);
 		seq._currentBmpId = ivals[0];
 		break;
 	case 0x1060: // SELECT PAL:  id:int [0]
@@ -801,6 +807,11 @@ void TTMInterpreter::handleOperation(TTMEnviro &env, TTMSeq &seq, uint16 op, byt
 						Common::Point(r.left, r.top));
 		break;
 	}
+	case 0xaf00: { // FLOOD FILL x,y
+		Graphics::FloodFill f(_vm->_compositionBuffer.surfacePtr(), 0, seq._drawColFG);
+		f.addSeed(ivals[0], ivals[1]);
+		f.fill();
+	}
 	case 0xaf10: { // DRAW EMPTY POLY
 		ClipSurface clipSurf(seq._drawWin, _vm->_compositionBuffer.surfacePtr());
 		for (uint i = 1; i < pts.size(); i++) {
@@ -884,6 +895,7 @@ void TTMInterpreter::handleOperation(TTMEnviro &env, TTMSeq &seq, uint16 op, byt
 	case 0xf020: // LOAD BMP:	filename:str
 		if (seq._executed) // this is a one-shot op
 			break;
+		//debug("0xf020: Load bitmap %s to slot %d for env %d", sval.c_str(), env._enviro, seq._currentBmpId);
 		env._scriptShapes[seq._currentBmpId].reset(new Image(_vm->getResourceManager(), _vm->getDecompressor()));
 		env._scriptShapes[seq._currentBmpId]->loadBitmap(sval);
 		break;
@@ -1076,8 +1088,8 @@ void TTMInterpreter::findAndAddSequences(TTMEnviro &env, Common::Array<TTMSeq> &
 						ch[0] = env.scr->readByte();
 						ch[1] = env.scr->readByte();
 					} while (ch[0] != 0 && ch[1] != 0);
-					break;
 				}
+				break;
 			}
 			default:
 				env.scr->skip((op & 0xf) * 2);




More information about the Scummvm-git-logs mailing list