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

ysj1173886760 42030331+ysj1173886760 at users.noreply.github.com
Sat Jul 10 06:11:59 UTC 2021


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:
cbb52814f0 DIRECTOR: pop unused arguments in b_setCallBack
c77f2e33cb DIRECTOR: amend version check in loadCast and BITD decoder


Commit: cbb52814f089ab03c2108a2976c255e47878d91a
    https://github.com/scummvm/scummvm/commit/cbb52814f089ab03c2108a2976c255e47878d91a
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-07-10T14:11:19+08:00

Commit Message:
DIRECTOR: pop unused arguments in b_setCallBack

Changed paths:
    engines/director/lingo/lingo-builtins.cpp


diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index 1a631622a1..e6f22378f6 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -1143,6 +1143,8 @@ void LB::b_saveMovie(int nargs) {
 }
 
 void LB::b_setCallBack(int nargs) {
+	for (int i = 0; i < nargs; i++)
+		g_lingo->pop();
 	warning("STUB: b_setCallBack");
 }
 


Commit: c77f2e33cb765b27fe8980643077c3d076c585d1
    https://github.com/scummvm/scummvm/commit/c77f2e33cb765b27fe8980643077c3d076c585d1
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-07-10T14:11:19+08:00

Commit Message:
DIRECTOR: amend version check in loadCast and BITD decoder

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


diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index 6b36410ba2..6cfae51ad9 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -324,7 +324,7 @@ void Cast::loadCast() {
 			PaletteV4 p = loadPalette(*pal);
 
 			// for D2, we are using palette cast member id to resolve palette Id, so we are using lowest 1 bit to represent cast id. see Also loadCastChildren
-			if (g_director->getVersion() == 200)
+			if (_version < kFileVer300)
 				g_director->addPalette(clutList[i] & 0xff, p.palette, p.length);
 			else
 				g_director->addPalette(clutList[i], p.palette, p.length);
@@ -579,7 +579,7 @@ void Cast::loadCastChildren() {
 
 			if (w > 0 && h > 0) {
 				if (_version < kFileVer600) {
-					img = new BITDDecoder(w, h, bitmapCast->_bitsPerPixel, bitmapCast->_pitch, _vm->getPalette());
+					img = new BITDDecoder(w, h, bitmapCast->_bitsPerPixel, bitmapCast->_pitch, _vm->getPalette(), static_cast<FileVersion>(_version));
 				} else {
 					img = new Image::BitmapDecoder();
 				}
diff --git a/engines/director/images.cpp b/engines/director/images.cpp
index 807b3d1102..db61dd265e 100644
--- a/engines/director/images.cpp
+++ b/engines/director/images.cpp
@@ -104,9 +104,10 @@ bool DIBDecoder::loadStream(Common::SeekableReadStream &stream) {
 * BITD
 ****************************/
 
-BITDDecoder::BITDDecoder(int w, int h, uint16 bitsPerPixel, uint16 pitch, const byte *palette) {
+BITDDecoder::BITDDecoder(int w, int h, uint16 bitsPerPixel, uint16 pitch, const byte *palette, FileVersion version) {
 	_surface = new Graphics::Surface();
 	_pitch = pitch;
+	_version = version;
 
 	if (_pitch < w) {
 		warning("BITDDecoder: pitch is too small: %d < %d", _pitch, w);
@@ -183,7 +184,7 @@ bool BITDDecoder::loadStream(Common::SeekableReadStream &stream) {
 	// If the stream has exactly the required number of bits for this image,
 	// we assume it is uncompressed.
 	// logic above does not fit the situation when _bitsPerPixel == 1, need to fix.
-	if ((stream.size() == _pitch * _surface->h * _bitsPerPixel / 8) || (_bitsPerPixel != 1 && g_director->getVersion() == 200 && stream.size() >= _surface->h * _surface->w * _bitsPerPixel / 8)) {
+	if ((stream.size() == _pitch * _surface->h * _bitsPerPixel / 8) || (_bitsPerPixel != 1 && _version < kFileVer300 && stream.size() >= _surface->h * _surface->w * _bitsPerPixel / 8)) {
 		debugC(6, kDebugImages, "Skipping compression");
 		for (int i = 0; i < stream.size(); i++) {
 			pixels.push_back((int)stream.readByte());
diff --git a/engines/director/images.h b/engines/director/images.h
index 456dd255e1..3b2b082a77 100644
--- a/engines/director/images.h
+++ b/engines/director/images.h
@@ -61,7 +61,7 @@ private:
 
 class BITDDecoder : public Image::ImageDecoder {
 public:
-	BITDDecoder(int w, int h, uint16 bitsPerPixel, uint16 pitch, const byte *palette);
+	BITDDecoder(int w, int h, uint16 bitsPerPixel, uint16 pitch, const byte *palette, FileVersion version);
 	~BITDDecoder() override;
 
 	// ImageDecoder API
@@ -71,13 +71,14 @@ public:
 	const byte *getPalette() const override { return _palette; }
 	void loadPalette(Common::SeekableReadStream &stream);
 	uint16 getPaletteColorCount() const override { return _paletteColorCount; }
-	void convertPixelIntoSurface(void* surfacePointer, uint fromBpp, uint toBpp, int red, int green, int blue);
+	void convertPixelIntoSurface(void *surfacePointer, uint fromBpp, uint toBpp, int red, int green, int blue);
 
 private:
 	Graphics::Surface *_surface;
 	const byte *_palette;
 	uint8 _paletteColorCount;
 	uint16 _bitsPerPixel;
+	FileVersion _version;
 	uint16 _pitch;
 };
 




More information about the Scummvm-git-logs mailing list