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

npjg nathanael.gentrydb8 at gmail.com
Mon Aug 3 15:06:17 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:
580f8b7fd0 DIRECTOR: Read D3 palette channel info
68d2852e90 DIRECTOR: Permit reassigning palette IDs
acf93352b3 DIRECTOR: Properly activate D3 palette castmembers


Commit: 580f8b7fd0cd99ea213b9ad129966d8cc0e320de
    https://github.com/scummvm/scummvm/commit/580f8b7fd0cd99ea213b9ad129966d8cc0e320de
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-08-03T11:01:49-04:00

Commit Message:
DIRECTOR: Read D3 palette channel info

Changed paths:
    engines/director/frame.cpp


diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index 8506c0e665..ad1b673a6d 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -163,13 +163,14 @@ void Frame::readChannels(Common::ReadStreamEndian *stream) {
 		}
 
 		// palette
-		_palette.paletteId = stream->readUint16();
+		stream->read(unk, 4);
+
+		_palette.paletteId = stream->readByte();
 		_palette.firstColor = stream->readByte(); // for cycles. note: these start at 0x80 (for pal entry 0)!
 		_palette.lastColor = stream->readByte();
 		_palette.flags = stream->readByte();
 		_palette.speed = stream->readByte();
-		_palette.frameCount = stream->readUint16();
-		_palette.cycleCount = stream->readUint16();
+		_palette.frameCount = stream->readByte();
 
 		stream->read(unk, 6);
 


Commit: 68d2852e90ef51f87d0f9011d43be8b259157b16
    https://github.com/scummvm/scummvm/commit/68d2852e90ef51f87d0f9011d43be8b259157b16
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-08-03T11:01:49-04:00

Commit Message:
DIRECTOR: Permit reassigning palette IDs

Changed paths:
    engines/director/graphics.cpp


diff --git a/engines/director/graphics.cpp b/engines/director/graphics.cpp
index 173bcd0b5c..65053b2907 100644
--- a/engines/director/graphics.cpp
+++ b/engines/director/graphics.cpp
@@ -766,9 +766,7 @@ void DirectorEngine::addPalette(int id, byte *palette, int length) {
 		warning("DirectorEngine::addPalette(): Negative palette ids reserved for default palettes");
 		return;
 	} else if (_loadedPalettes.contains(id)) {
-		// TODO: Can castmember palettes conflict with those in the cast config?
-		warning("DirectorEngine::addPalette(): Attempting to replace palette %d", id);
-		return;
+		delete[] _loadedPalettes[id].palette;
 	}
 
 	_loadedPalettes[id] = PaletteV4(id, palette, length);


Commit: acf93352b34cb1b11d82a1a0a0aef6a2fb10f966
    https://github.com/scummvm/scummvm/commit/acf93352b34cb1b11d82a1a0a0aef6a2fb10f966
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-08-03T11:05:58-04:00

Commit Message:
DIRECTOR: Properly activate D3 palette castmembers

Changed paths:
    engines/director/cast.cpp


diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index ef1dd73120..e6785b0fcc 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -443,6 +443,7 @@ void Cast::loadCastChildren() {
 	debugC(1, kDebugLoading, "****** Preloading sprite palettes and images");
 
 	Cast *sharedCast = _movie ? _movie->getSharedCast() : nullptr;
+	int defaultId = 1025;
 
 	for (Common::HashMap<int, CastMember *>::iterator c = _loadedCast->begin(); c != _loadedCast->end(); ++c) {
 		if (!c->_value)
@@ -451,8 +452,13 @@ void Cast::loadCastChildren() {
 		// First, handle palettes
 		if (c->_value->_type == kCastPalette) {
 			PaletteCastMember *member = ((PaletteCastMember *)c->_value);
-			if (member->_children.size() == 1) {
+
+			// TODO: Verify how palettes work in >D4 versions
+			if (_vm->getVersion() == 4 && member->_children.size() == 1) {
 				member->_palette = g_director->getPalette(member->_children[0].index);
+			} else if (_vm->getVersion() < 4) {
+				// D3 palettes are always kept in this ascending order
+				member->_palette = g_director->getPalette(defaultId++);
 			} else {
 				warning("Cast::loadSpriteChildren(): Expected 1 child for palette cast, got %d", member->_children.size());
 			}
@@ -725,6 +731,10 @@ void Cast::loadCastDataVWCR(Common::SeekableSubReadStreamEndian &stream) {
 			debugC(3, kDebugLoading, "Cast::loadCastDataVWCR(): CastTypes id: %d(%s) DigitalVideoCastMember", id, numToCastNum(id));
 			_loadedCast->setVal(id, new DigitalVideoCastMember(this, id, stream, _vm->getVersion()));
 			break;
+		case kCastPalette:
+			debugC(3, kDebugLoading, "Cast::loadCastDataVWCR(): CastTypes id: %d(%s) PaletteCastMember", id, numToCastNum(id));
+			_loadedCast->setVal(id, new PaletteCastMember(this, id, stream, _vm->getVersion()));
+			break;
 		default:
 			warning("Cast::loadCastDataVWCR(): Unhandled cast id: %d(%s), type: %d, %d bytes", id, numToCastNum(id), castType, size);
 			break;




More information about the Scummvm-git-logs mailing list