[Scummvm-git-logs] scummvm master -> 4496f009ab20f8f203b6d66961efe93ef231d02a

npjg nathanael.gentrydb8 at gmail.com
Tue Aug 4 04:29:39 UTC 2020


This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
f2fe352c00 DIRECTOR: Gracefully exit on bad EXE
97cbcaa4fe DIRECTOR: Read D3 palettes for Windows platform
6b830e2051 DIRECTOR: Replace hardcoded base palette ID
4496f009ab DIRECTOR: Improve D3 Mac palette channel loading


Commit: f2fe352c0030136bf2d54beb8deec14bf1e39ccf
    https://github.com/scummvm/scummvm/commit/f2fe352c0030136bf2d54beb8deec14bf1e39ccf
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-08-04T00:28:00-04:00

Commit Message:
DIRECTOR: Gracefully exit on bad EXE

Changed paths:
    engines/director/resource.cpp


diff --git a/engines/director/resource.cpp b/engines/director/resource.cpp
index a898af5eee..a723a29e90 100644
--- a/engines/director/resource.cpp
+++ b/engines/director/resource.cpp
@@ -192,6 +192,9 @@ void Stage::loadEXE(const Common::String movie) {
 			error("Failed to load RIFF");
 	} else {
 		Common::WinResources *exe = Common::WinResources::createFromEXE(movie);
+		if (!exe)
+			error("Failed to open EXE '%s'", g_director->getEXEName().c_str());
+
 		const Common::Array<Common::WinResourceID> versions = exe->getIDList(Common::kWinVersion);
 		for (uint i = 0; i < versions.size(); i++) {
 			Common::SeekableReadStream *res = exe->getResource(Common::kWinVersion, versions[i]);


Commit: 97cbcaa4fe5e4a496b1f99e4169755d73cf72e3e
    https://github.com/scummvm/scummvm/commit/97cbcaa4fe5e4a496b1f99e4169755d73cf72e3e
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-08-04T00:28:00-04:00

Commit Message:
DIRECTOR: Read D3 palettes for Windows platform

Changed paths:
    engines/director/frame.cpp


diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index ad1b673a6d..b359e2ee6e 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -163,14 +163,23 @@ void Frame::readChannels(Common::ReadStreamEndian *stream) {
 		}
 
 		// palette
-		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->readByte();
+		if (_vm->getPlatform() == Common::kPlatformWindows) {
+			_palette.paletteId = stream->readUint16();
+			_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();
+		} else {
+			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->readByte();
+		}
 
 		stream->read(unk, 6);
 


Commit: 6b830e2051e8e99496ccbfdb9e15a6a11e6737e4
    https://github.com/scummvm/scummvm/commit/6b830e2051e8e99496ccbfdb9e15a6a11e6737e4
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-08-04T00:28:00-04:00

Commit Message:
DIRECTOR: Replace hardcoded base palette ID

It seems that not all movies do have the palette ID starting at 1025, so we'll
just load them by iterating through the hashmap.

Changed paths:
    engines/director/cast.cpp
    engines/director/director.h


diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index e6785b0fcc..f435aebd2d 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -443,7 +443,7 @@ void Cast::loadCastChildren() {
 	debugC(1, kDebugLoading, "****** Preloading sprite palettes and images");
 
 	Cast *sharedCast = _movie ? _movie->getSharedCast() : nullptr;
-	int defaultId = 1025;
+	Common::HashMap<int, PaletteV4>::iterator p = _vm->getLoadedPalettes().find(0);
 
 	for (Common::HashMap<int, CastMember *>::iterator c = _loadedCast->begin(); c != _loadedCast->end(); ++c) {
 		if (!c->_value)
@@ -458,7 +458,7 @@ void Cast::loadCastChildren() {
 				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++);
+				member->_palette = g_director->getPalette((++p)->_value.id);
 			} else {
 				warning("Cast::loadSpriteChildren(): Expected 1 child for palette cast, got %d", member->_children.size());
 			}
diff --git a/engines/director/director.h b/engines/director/director.h
index 647ec3cf91..920a10a4db 100644
--- a/engines/director/director.h
+++ b/engines/director/director.h
@@ -199,6 +199,8 @@ public:
 	PaletteV4 *getPalette(int id);
 	void loadDefaultPalettes();
 
+	const Common::HashMap<int, PaletteV4> &getLoadedPalettes() { return _loadedPalettes; }
+
 	const byte *getPalette() const { return _currentPalette; }
 	uint16 getPaletteColorCount() const { return _currentPaletteLength; }
 


Commit: 4496f009ab20f8f203b6d66961efe93ef231d02a
    https://github.com/scummvm/scummvm/commit/4496f009ab20f8f203b6d66961efe93ef231d02a
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-08-04T00:28:00-04:00

Commit Message:
DIRECTOR: Improve D3 Mac palette channel loading

Changed paths:
    engines/director/frame.cpp
    engines/director/frame.h


diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index b359e2ee6e..c28840b736 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -171,17 +171,22 @@ void Frame::readChannels(Common::ReadStreamEndian *stream) {
 			_palette.speed = stream->readByte();
 			_palette.frameCount = stream->readUint16();
 			_palette.cycleCount = stream->readUint16();
+
+			stream->read(unk, 6);
 		} else {
 			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.cycleCount = stream->readByte();
 			_palette.speed = stream->readByte();
 			_palette.frameCount = stream->readByte();
-		}
+			_palette.cycleLength = stream->readByte();
 
-		stream->read(unk, 6);
+			stream->read(unk, 4);
+		}
 
 		debugC(8, kDebugLoading, "Frame::readChannels(): %d %d %d %d %d %d %d %d %d %d %d", _actionId, _soundType1, _transDuration, _transChunkSize, _tempo, _transType, _sound1, _skipFrameFlag, _blend, _sound2, _soundType2);
 
diff --git a/engines/director/frame.h b/engines/director/frame.h
index 2813d82576..75d3ba7e38 100644
--- a/engines/director/frame.h
+++ b/engines/director/frame.h
@@ -55,6 +55,7 @@ struct PaletteInfo {
 	byte speed;
 	uint16 frameCount;
 	uint16 cycleCount;
+	uint16 cycleLength;
 	byte fade;
 	byte delay;
 	byte style;
@@ -64,7 +65,7 @@ struct PaletteInfo {
 		paletteId = 0;
 		firstColor = lastColor = 0;
 		flags = 0; speed = 0;
-		frameCount = cycleCount = 0;
+		frameCount = cycleCount = cycleLength = 0;
 		fade = delay = style = colorCode = 0;
 	}
 };




More information about the Scummvm-git-logs mailing list