[Scummvm-git-logs] scummvm master -> 10417b7cab78fc6e259cdfa84ec7581be9a3f221

sev- noreply at scummvm.org
Fri Oct 10 17:56:21 UTC 2025


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

Summary:
c7a4ea2a74 DIRECTOR: Better processing for looped Moa sounds
3e5ea69a6b IMAGE: Pass optional paletteCount to writePNG() and add wrapper with Graphics::Palette
de0acc6b75 DIRECTOR: Prevent crash when dumping bitmaps with palette <256 entries
10417b7cab DIRECTOR: Proper naming for the behavior scripts when dumping


Commit: c7a4ea2a749d7940748a35727622e3aed0c55618
    https://github.com/scummvm/scummvm/commit/c7a4ea2a749d7940748a35727622e3aed0c55618
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-10-10T18:42:53+02:00

Commit Message:
DIRECTOR: Better processing for looped Moa sounds

Changed paths:
    engines/director/sound.cpp


diff --git a/engines/director/sound.cpp b/engines/director/sound.cpp
index ef55dbe3a16..76ba577ab6f 100644
--- a/engines/director/sound.cpp
+++ b/engines/director/sound.cpp
@@ -1052,7 +1052,7 @@ Audio::AudioStream *MoaSoundFormatDecoder::getAudioStream(bool looping, bool for
 			disposeAfterUse);
 
 	if (looping) {
-		if (_format.loopEndFrame < _format.loopStartFrame) {
+		if (_format.loopEndFrame <= _format.loopStartFrame) {
 			return new Audio::LoopingAudioStream(stream, 0);
 		} else {
 			return new Audio::SubLoopingAudioStream(stream, 0, Audio::Timestamp(0, _format.loopStartFrame, _format.frameRate), Audio::Timestamp(0, _format.loopEndFrame, _format.frameRate));


Commit: 3e5ea69a6bfb1c9ad547891f143bbee3468397fa
    https://github.com/scummvm/scummvm/commit/3e5ea69a6bfb1c9ad547891f143bbee3468397fa
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-10-10T19:00:37+02:00

Commit Message:
IMAGE: Pass optional paletteCount to writePNG() and add wrapper with Graphics::Palette

Changed paths:
    image/png.cpp
    image/png.h


diff --git a/image/png.cpp b/image/png.cpp
index 2e4b0e88a32..169037577c0 100644
--- a/image/png.cpp
+++ b/image/png.cpp
@@ -293,7 +293,11 @@ bool PNGDecoder::loadStream(Common::SeekableReadStream &stream) {
 #endif
 }
 
-bool writePNG(Common::WriteStream &out, const Graphics::Surface &input, const byte *palette) {
+bool writePNG(Common::WriteStream &out, const Graphics::Surface &input, const Graphics::Palette &palette) {
+	return writePNG(out, input, palette.data(), palette.size());
+}
+
+bool writePNG(Common::WriteStream &out, const Graphics::Surface &input, const byte *palette, uint paletteCount) {
 #ifdef USE_PNG
 	const Graphics::PixelFormat requiredFormat_3byte = Graphics::PixelFormat::createFormatRGB24();
 	const Graphics::PixelFormat requiredFormat_4byte = Graphics::PixelFormat::createFormatRGBA32();
@@ -309,7 +313,7 @@ bool writePNG(Common::WriteStream &out, const Graphics::Surface &input, const by
 		if (input.format == requiredFormat_4byte) {
 			surface = &input;
 		} else {
-			surface = tmp = input.convertTo(requiredFormat_4byte, palette);
+			surface = tmp = input.convertTo(requiredFormat_4byte, palette, paletteCount);
 		}
 		colorType = PNG_COLOR_TYPE_RGB_ALPHA;
 	}
diff --git a/image/png.h b/image/png.h
index 460bd40d1fe..ef2defc68ba 100644
--- a/image/png.h
+++ b/image/png.h
@@ -85,12 +85,22 @@ private:
 
 /**
  * Outputs a compressed PNG stream of the given input surface.
-  *
+ *
  *  @param out  Stream to which to write the PNG image.
  *  @param input The surface to save as a PNG image..
  *  @param palette    The palette (in RGB888), if the source format has a bpp of 1.
+ *  @param paletteCount Number of colors in the palette (default: 256).
+ */
+bool writePNG(Common::WriteStream &out, const Graphics::Surface &input, const byte *palette = nullptr, uint paletteCount = 256);
+
+/**
+ * Outputs a compressed PNG stream of the given input surface.
+ *
+ *  @param out  Stream to which to write the PNG image.
+ *  @param input The surface to save as a PNG image..
+ *  @param palette    The palette if the source format has a bpp of 1.
  */
-bool writePNG(Common::WriteStream &out, const Graphics::Surface &input, const byte *palette = nullptr);
+bool writePNG(Common::WriteStream &out, const Graphics::Surface &input, const Graphics::Palette &palette);
 /** @} */
 } // End of namespace Image
 


Commit: de0acc6b75ff63d59b1589b429a648ed74c3c78b
    https://github.com/scummvm/scummvm/commit/de0acc6b75ff63d59b1589b429a648ed74c3c78b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-10-10T19:03:33+02:00

Commit Message:
DIRECTOR: Prevent crash when dumping bitmaps with palette <256 entries

Changed paths:
    engines/director/castmember/bitmap.cpp


diff --git a/engines/director/castmember/bitmap.cpp b/engines/director/castmember/bitmap.cpp
index 97128181a31..e06cc8d51f9 100644
--- a/engines/director/castmember/bitmap.cpp
+++ b/engines/director/castmember/bitmap.cpp
@@ -814,7 +814,7 @@ void BitmapCastMember::load() {
 		Common::DumpFile bitmapFile;
 
 		bitmapFile.open(Common::Path(filename), true);
-		Image::writePNG(bitmapFile, *img->getSurface(), img->getPalette().data());
+		Image::writePNG(bitmapFile, *img->getSurface(), img->getPalette());
 
 		bitmapFile.close();
 	}


Commit: 10417b7cab78fc6e259cdfa84ec7581be9a3f221
    https://github.com/scummvm/scummvm/commit/10417b7cab78fc6e259cdfa84ec7581be9a3f221
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-10-10T19:11:04+02:00

Commit Message:
DIRECTOR: Proper naming for the behavior scripts when dumping

Changed paths:
    engines/director/util.cpp


diff --git a/engines/director/util.cpp b/engines/director/util.cpp
index c6e9bb2a0de..5cb44392ebd 100644
--- a/engines/director/util.cpp
+++ b/engines/director/util.cpp
@@ -1178,7 +1178,10 @@ Common::Path dumpScriptName(const char *prefix, int type, int id, const char *ex
 		typeName = "EventScript";
 		break;
 	case kScoreScript:
-		typeName = "ScoreScript";
+		if (g_director->getVersion() >= 600)
+			typeName = "BehaviorScript";
+		else
+			typeName = "ScoreScript";
 		break;
 	case kParentScript:
 		typeName = "ParentScript";




More information about the Scummvm-git-logs mailing list