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

lephilousophe noreply at scummvm.org
Thu Feb 23 18:10:50 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:
bd8c8802b7 GRAPHICS: Make rawBlitFrom take a ManagedSurface


Commit: bd8c8802b73eb46bc4c01215a3c2ee3a9912f1c0
    https://github.com/scummvm/scummvm/commit/bd8c8802b73eb46bc4c01215a3c2ee3a9912f1c0
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-02-23T19:10:45+01:00

Commit Message:
GRAPHICS: Make rawBlitFrom take a ManagedSurface

This allows to remove the palette argument and removes the need for
getPalette

Changed paths:
    engines/ags/shared/gfx/image.cpp
    engines/mtropolis/debug.cpp
    graphics/managed_surface.h


diff --git a/engines/ags/shared/gfx/image.cpp b/engines/ags/shared/gfx/image.cpp
index 35d4e381e4b..3e944cb0b15 100644
--- a/engines/ags/shared/gfx/image.cpp
+++ b/engines/ags/shared/gfx/image.cpp
@@ -153,14 +153,14 @@ int save_bitmap(Common::WriteStream &out, BITMAP *bmp, const RGB *pal) {
 		}
 
 		surface.rawBlitFrom(temp, Common::Rect(0, 0, src.w, src.h),
-			Common::Point(0, 0), temp.getPalette());
+			Common::Point(0, 0));
 	} else {
 		// Copy from the source surface without alpha transparency
 		Graphics::ManagedSurface temp = src;
 		temp.format.aLoss = 8;
 
 		surface.rawBlitFrom(temp, Common::Rect(0, 0, src.w, src.h),
-			Common::Point(0, 0), nullptr);
+			Common::Point(0, 0));
 	}
 
 	// Write out the bitmap
diff --git a/engines/mtropolis/debug.cpp b/engines/mtropolis/debug.cpp
index 2390f7995d3..9dc9a0b5486 100644
--- a/engines/mtropolis/debug.cpp
+++ b/engines/mtropolis/debug.cpp
@@ -293,7 +293,7 @@ void DebugToolWindowBase::render() {
 				return;
 
 			getSurface()->fillRect(Common::Rect(0, kTopBarHeight, renderWidth, getHeight()), getSurface()->format.RGBToColor(255, 255, 255));
-			getSurface()->rawBlitFrom(*_toolSurface.get(), Common::Rect(srcLeft, srcTop, srcRight, srcBottom), Common::Point(destLeft, destTop + kTopBarHeight), nullptr);
+			getSurface()->rawBlitFrom(*_toolSurface.get(), Common::Rect(srcLeft, srcTop, srcRight, srcBottom), Common::Point(destLeft, destTop + kTopBarHeight));
 		} else {
 			_haveScrollBar = false;
 			cancelScrolling();
diff --git a/graphics/managed_surface.h b/graphics/managed_surface.h
index 0145685a45a..02652fdebef 100644
--- a/graphics/managed_surface.h
+++ b/graphics/managed_surface.h
@@ -499,10 +499,10 @@ public:
 	/**
 	 * Does a blitFrom ignoring any transparency settings
 	 */
-	void rawBlitFrom(const Surface &src, const Common::Rect &srcRect,
-			const Common::Point &destPos, const uint32 *palette) {
-		blitFromInner(src, srcRect, Common::Rect(destPos.x, destPos.y,
-			destPos.x + srcRect.width(), destPos.y + srcRect.height()), palette);
+	void rawBlitFrom(const ManagedSurface &src, const Common::Rect &srcRect,
+			const Common::Point &destPos) {
+		blitFromInner(src._innerSurface, srcRect, Common::Rect(destPos.x, destPos.y, destPos.x + srcRect.width(),
+			destPos.y + srcRect.height()), src._paletteSet ? src._palette : nullptr);
 	}
 
 	/**
@@ -680,14 +680,6 @@ public:
 	 */
 	void grabPalette(byte *colors, uint start, uint num) const;
 
-	/**
-	 * Get the palette array.
-	 */
-	WARN_DEPRECATED("Use grabPalette instead")
-	const uint32 *getPalette() const {
-		return _palette;
-	}
-
 	/**
 	 * Set the palette using RGB tuples.
 	 */




More information about the Scummvm-git-logs mailing list