[Scummvm-git-logs] scummvm branch-2-2 -> 553539a2694812af42abdf9cd22e64291c730ae6

AReim1982 alexander at areim.de
Sun Oct 11 09:58:02 UTC 2020


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

Summary:
c7b02dae60 WII: Fix transparency of RGB cursors
553539a269 WII: Return to the system menu instead of a black screen on exit


Commit: c7b02dae602f74f5bda7d9352d4ecaa86d52329c
    https://github.com/scummvm/scummvm/commit/c7b02dae602f74f5bda7d9352d4ecaa86d52329c
Author: Alexander Reim (alexander at areim.de)
Date: 2020-10-11T11:54:46+02:00

Commit Message:
WII: Fix transparency of RGB cursors

Changed paths:
    backends/platform/wii/osystem_gfx.cpp


diff --git a/backends/platform/wii/osystem_gfx.cpp b/backends/platform/wii/osystem_gfx.cpp
index 40b4512774..f425222f99 100644
--- a/backends/platform/wii/osystem_gfx.cpp
+++ b/backends/platform/wii/osystem_gfx.cpp
@@ -651,7 +651,6 @@ void OSystem_Wii::setMouseCursor(const void *buf, uint w, uint h, int hotspotX,
 									const Graphics::PixelFormat *format) {
 	gfx_tex_format_t tex_format = GFX_TF_PALETTE_RGB5A3;
 	uint tw, th;
-	bool tmpBuf = false;
 	uint32 oldKeycolor = _mouseKeyColor;
 
 #ifdef USE_RGB_COLOR
@@ -666,8 +665,6 @@ void OSystem_Wii::setMouseCursor(const void *buf, uint w, uint h, int hotspotX,
 		tw = ROUNDUP(w, 4);
 		th = ROUNDUP(h, 4);
 
-		if (_pfCursor != _pfRGB3444)
-			tmpBuf = true;
 	} else {
 #endif
 		_mouseKeyColor = keycolor & 0xff;
@@ -684,64 +681,60 @@ void OSystem_Wii::setMouseCursor(const void *buf, uint w, uint h, int hotspotX,
 
 	gfx_tex_set_bilinear_filter(&_texMouse, _bilinearFilter);
 
-	if ((tw != w) || (th != h))
-		tmpBuf = true;
+	u8 bpp = _texMouse.bpp >> 3;
+	byte *tmp = (byte *) malloc(tw * th * bpp);
 
-	if (!tmpBuf) {
-		gfx_tex_convert(&_texMouse, (const byte *)buf);
-	} else {
-		u8 bpp = _texMouse.bpp >> 3;
-		byte *tmp = (byte *) malloc(tw * th * bpp);
+	if (!tmp) {
+		printf("could not alloc temp cursor buffer\n");
+		::abort();
+	}
+
+	if (bpp > 1)
+		memset(tmp, 0, tw * th * bpp);
+	else
+		memset(tmp, _mouseKeyColor, tw * th);
+
+#ifdef USE_RGB_COLOR
+	if (bpp > 1) {
 
-		if (!tmp) {
-			printf("could not alloc temp cursor buffer\n");
+		if (!Graphics::crossBlit(tmp, (const byte *)buf,
+									tw * _pfRGB3444.bytesPerPixel,
+									w * _pfCursor.bytesPerPixel,
+									tw, th, _pfRGB3444, _pfCursor)) {
+			printf("crossBlit failed (cursor)\n");
 			::abort();
 		}
 
-		if (bpp > 1)
-			memset(tmp, 0, tw * th * bpp);
-		else
-			memset(tmp, _mouseKeyColor, tw * th);
-
-#ifdef USE_RGB_COLOR
-		if (bpp > 1) {
-			if (!Graphics::crossBlit(tmp, (const byte *)buf,
-										tw * _pfRGB3444.bytesPerPixel,
-										w * _pfCursor.bytesPerPixel,
-										tw, th, _pfRGB3444, _pfCursor)) {
-				printf("crossBlit failed (cursor)\n");
-				::abort();
+		// nasty, shouldn't the frontend set the alpha channel?
+		const u16 *s = (const u16 *) buf;
+		u16 *d = (u16 *) tmp;
+		for (u16 y = 0; y < h; ++y) {
+			for (u16 x = 0; x < w; ++x) {
+				if (*s++ == _mouseKeyColor)
+					*d++ &= ~(7 << 12);
+				else
+					d++;
 			}
 
-			// nasty, shouldn't the frontend set the alpha channel?
-			const u16 *s = (const u16 *) buf;
-			u16 *d = (u16 *) tmp;
-			for (u16 y = 0; y < h; ++y) {
-				for (u16 x = 0; x < w; ++x) {
-					if (*s++ == _mouseKeyColor)
-						*d++ &= ~(7 << 12);
-					else
-						d++;
-				}
-
-				d += tw - w;
-			}
-		} else {
-#endif
-			byte *dst = tmp;
-			const byte *src = (const byte *)buf;
-			do {
-				memcpy(dst, src, w * bpp);
-				src += w * bpp;
-				dst += tw * bpp;
-			} while (--h);
-#ifdef USE_RGB_COLOR
+			d += tw - w;
 		}
+	} else {
 #endif
+		const byte *s = (const byte *)buf;
+		byte *d = (byte *) tmp;
+		for (u16 y = 0; y < h; ++y) {
+			for (u16 x = 0; x < w; ++x)
+				*d++ = *s++;
 
-		gfx_tex_convert(&_texMouse, tmp);
-		free(tmp);
+			d += tw - w;
+		}
+
+#ifdef USE_RGB_COLOR
 	}
+#endif
+
+	gfx_tex_convert(&_texMouse, tmp);
+	free(tmp);
 
 	_mouseHotspotX = hotspotX;
 	_mouseHotspotY = hotspotY;


Commit: 553539a2694812af42abdf9cd22e64291c730ae6
    https://github.com/scummvm/scummvm/commit/553539a2694812af42abdf9cd22e64291c730ae6
Author: Alexander Reim (alexander at areim.de)
Date: 2020-10-11T11:56:40+02:00

Commit Message:
WII: Return to the system menu instead of a black screen on exit

Changed paths:
    backends/platform/wii/main.cpp


diff --git a/backends/platform/wii/main.cpp b/backends/platform/wii/main.cpp
index e5d3e74c3a..72d2514d90 100644
--- a/backends/platform/wii/main.cpp
+++ b/backends/platform/wii/main.cpp
@@ -253,6 +253,8 @@ int main(int argc, char *argv[]) {
 	gfx_deinit();
 	gfx_video_deinit();
 
+	SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
+
 	return res;
 }
 




More information about the Scummvm-git-logs mailing list