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

phcoder noreply at scummvm.org
Wed Jan 11 18:16:29 UTC 2023


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

Summary:
d4111a2f0b GRAPHICS: Use correct pixel size in Normal1x with CLUT8


Commit: d4111a2f0b061f357437d1a2947d12f0bb00a72d
    https://github.com/scummvm/scummvm/commit/d4111a2f0b061f357437d1a2947d12f0bb00a72d
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2023-01-11T19:15:48+01:00

Commit Message:
GRAPHICS: Use correct pixel size in Normal1x with CLUT8

Changed paths:
    graphics/scalerplugin.cpp


diff --git a/graphics/scalerplugin.cpp b/graphics/scalerplugin.cpp
index 1ad61c336d1..e7f316571e7 100644
--- a/graphics/scalerplugin.cpp
+++ b/graphics/scalerplugin.cpp
@@ -29,7 +29,7 @@ template<typename Pixel>
 void Normal1x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
 							int width, int height) {
 	// Spot the case when it can all be done in 1 hit
-	int BytesPerPixel = sizeof(Pixel);
+	const int BytesPerPixel = sizeof(Pixel);
 	if ((srcPitch == BytesPerPixel * (uint)width) && (dstPitch == BytesPerPixel * (uint)width)) {
 		memcpy(dstPtr, srcPtr, BytesPerPixel * width * height);
 		return;
@@ -45,7 +45,9 @@ void Normal1x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPit
 void Scaler::scale(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr,
 	                           uint32 dstPitch, int width, int height, int x, int y) {
 	if (_factor == 1) {
-		if (_format.bytesPerPixel == 2) {
+		if (_format.bytesPerPixel == 1) {
+			Normal1x<uint8>(srcPtr, srcPitch, dstPtr, dstPitch, width, height);
+		} else if (_format.bytesPerPixel == 2) {
 			Normal1x<uint16>(srcPtr, srcPitch, dstPtr, dstPitch, width, height);
 		} else {
 			Normal1x<uint32>(srcPtr, srcPitch, dstPtr, dstPitch, width, height);




More information about the Scummvm-git-logs mailing list