[Scummvm-git-logs] scummvm master -> 7bd7dbc8a4a2e6bae9ac2ba9ca5aacc4053ffaaf

sev- noreply at scummvm.org
Sat Oct 28 23:02:25 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:
7bd7dbc8a4 NGI: Replace use of TransparentSurface with ManagedSurface


Commit: 7bd7dbc8a4a2e6bae9ac2ba9ca5aacc4053ffaaf
    https://github.com/scummvm/scummvm/commit/7bd7dbc8a4a2e6bae9ac2ba9ca5aacc4053ffaaf
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2023-10-29T01:02:22+02:00

Commit Message:
NGI: Replace use of TransparentSurface with ManagedSurface

Changed paths:
    engines/ngi/gfx.cpp
    engines/ngi/gfx.h


diff --git a/engines/ngi/gfx.cpp b/engines/ngi/gfx.cpp
index 9d1106078a4..5858761232e 100644
--- a/engines/ngi/gfx.cpp
+++ b/engines/ngi/gfx.cpp
@@ -29,7 +29,7 @@
 #include "ngi/gameloader.h"
 
 #include "common/memstream.h"
-#include "graphics/transparent_surface.h"
+#include "graphics/managed_surface.h"
 
 namespace NGI {
 
@@ -712,7 +712,7 @@ Bitmap::Bitmap(const Bitmap &src) {
 	_width = src._width;
 	_height = src._height;
 	_flipping = src._flipping;
-	_surface = new Graphics::TransparentSurface, Graphics::SurfaceDeleter();
+	_surface = new Graphics::ManagedSurface();
 	_surface->create(_width, _height, Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0));
 	_surface->copyFrom(*src._surface);
 }
@@ -749,7 +749,7 @@ bool Bitmap::isPixelHitAtPos(int x, int y) {
 }
 
 void Bitmap::decode(byte *pixels, const Palette &palette) {
-	_surface = new Graphics::TransparentSurface, Graphics::SurfaceDeleter();
+	_surface = new Graphics::ManagedSurface();
 	_surface->create(_width, _height, Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0));
 
 	if (_type == MKTAG('R', 'B', '\0', '\0'))
@@ -781,9 +781,9 @@ void Bitmap::putDib(int x, int y, const Palette &palette, byte alpha) {
 	if (y1 < 0)
 		y1 = 0;
 
-	int alphac = MS_ARGB(alpha, 0xff, 0xff, 0xff);
+	uint32 alphac = MS_ARGB(alpha, 0xff, 0xff, 0xff);
 
-	_surface->blit(g_nmi->_backgroundSurface, x1, y1, _flipping, &sub, alphac);
+	_surface->blendBlitTo(g_nmi->_backgroundSurface, x1, y1, _flipping, &sub, alphac);
 	g_nmi->_system->copyRectToScreen(g_nmi->_backgroundSurface.getBasePtr(x1, y1), g_nmi->_backgroundSurface.pitch, x1, y1, sub.width(), sub.height());
 }
 
diff --git a/engines/ngi/gfx.h b/engines/ngi/gfx.h
index f35d6049a19..522b2b08e24 100644
--- a/engines/ngi/gfx.h
+++ b/engines/ngi/gfx.h
@@ -26,7 +26,7 @@
 
 namespace Graphics {
 	struct Surface;
-	struct TransparentSurface;
+	class ManagedSurface;
 }
 
 namespace NGI {
@@ -46,7 +46,7 @@ struct Bitmap {
 	int _dataSize;
 	int _flags;
 	int _flipping;
-	Graphics::TransparentSurface *_surface;
+	Graphics::ManagedSurface *_surface;
 
 	Bitmap();
 	Bitmap(const Bitmap &src);




More information about the Scummvm-git-logs mailing list