From 84a8cc128fee19f0e4707d2cd16bb2c2e23cd946 Mon Sep 17 00:00:00 2001
From: Cameron Cawley <ccawley2011@gmail.com>
Date: Sun, 21 Jun 2026 23:57:20 +0100
Subject: [PATCH] GUI: Fix bitmap rendering with RGB332 overlays

---
 graphics/VectorRendererSpec.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index bbdcbe585fe7..ec6688300907 100644
--- a/graphics/VectorRendererSpec.cpp
+++ b/graphics/VectorRendererSpec.cpp
@@ -803,7 +803,12 @@ blitManagedSurface(const Graphics::ManagedSurface *source, const Common::Point &
 		np = p;
 	}
 
-	_activeSurface->simpleBlitFrom(*source, drawRect, np, Graphics::FLIP_NONE, alphaType != Graphics::ALPHA_OPAQUE);
+	if (_activeSurface->format.bytesPerPixel == 1 && alphaType != Graphics::ALPHA_OPAQUE) {
+		// simpleBlitFrom doesn't currently support alpha blending to an RGB332 surface.
+		_activeSurface->transBlitFrom(*source, drawRect, np);
+	} else {
+		_activeSurface->simpleBlitFrom(*source, drawRect, np, Graphics::FLIP_NONE, alphaType != Graphics::ALPHA_OPAQUE);
+	}
 }
 
 template<typename PixelType>
