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

digitall noreply at scummvm.org
Mon Aug 28 23:27:36 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:
bef992a940 WII: Add Debug Output to OSystem Graphics API for Mouse Cursor


Commit: bef992a940bbe4c5ea77869b7659454ba75aa353
    https://github.com/scummvm/scummvm/commit/bef992a940bbe4c5ea77869b7659454ba75aa353
Author: D G Turner (digitall at scummvm.org)
Date: 2023-08-29T00:24:36+01:00

Commit Message:
WII: Add Debug Output to OSystem Graphics API for Mouse Cursor

This indicates that the cause of the vanishing mouse cursors appears to
be the loss of the palette data from a CLUT8 game cursor when the GMM
cursor which is ARGB is switched in. The SetMouseCursor implementation
currently does not setup the game cursor palette so the cursor is drawn
as all transparent i.e. default palette contents.

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 8c93754316e..4c32bf7d000 100644
--- a/backends/platform/wii/osystem_gfx.cpp
+++ b/backends/platform/wii/osystem_gfx.cpp
@@ -32,6 +32,9 @@
 
 #include "osystem.h"
 
+// Uncomment this to enable debug output to console
+//#define PLATFORM_WII_OSYSTEM_GFX_DEBUG
+
 #define ROUNDUP(x,n) (-(-(x) & -(n)))
 #define MAX_FPS 30
 #define TLUT_GAME GX_TLUT0
@@ -327,6 +330,10 @@ int16 OSystem_Wii::getHeight() {
 }
 
 void OSystem_Wii::updateMousePalette() {
+#ifdef PLATFORM_WII_OSYSTEM_GFX_DEBUG
+	printf("%s() _cursorPaletteDisabled:%d\n", __func__, _cursorPaletteDisabled);
+#endif
+
 	if (_texMouse.palette && _cursorPaletteDisabled) {
 		memcpy(_texMouse.palette, _cursorPalette, 256 * 2);
 		_cursorPaletteDirty = true;
@@ -334,6 +341,10 @@ void OSystem_Wii::updateMousePalette() {
 }
 
 void OSystem_Wii::setPalette(const byte *colors, uint start, uint num) {
+#ifdef PLATFORM_WII_OSYSTEM_GFX_DEBUG
+	printf("%s(%p, %d, %d) _cursorPaletteDisabled:%d\n", __func__, colors, start, num, _cursorPaletteDisabled);
+#endif
+
 #ifdef USE_RGB_COLOR
 	assert(_pfGame.bytesPerPixel == 1);
 #endif
@@ -356,8 +367,7 @@ void OSystem_Wii::setPalette(const byte *colors, uint start, uint num) {
 	if (_cursorPaletteDisabled) {
 		assert(_texMouse.palette);
 
-		memcpy((u8 *)_texMouse.palette + start * 2,
-			(u8 *)_cursorPalette + start * 2, num * 2);
+		memcpy((u8 *)_texMouse.palette + start * 2, (u8 *)_cursorPalette + start * 2, num * 2);
 
 		_cursorPaletteDirty = true;
 	}
@@ -381,6 +391,10 @@ void OSystem_Wii::grabPalette(byte *colors, uint start, uint num) const {
 }
 
 void OSystem_Wii::setCursorPalette(const byte *colors, uint start, uint num) {
+#ifdef PLATFORM_WII_OSYSTEM_GFX_DEBUG
+	printf("%s(%p,%u,%u) _cursorPaletteDisabled:%d\n", __func__, colors, start, num, _cursorPaletteDisabled);
+#endif
+
 	if (!_texMouse.palette) {
 		printf("switching to palette based cursor\n");
 
@@ -527,6 +541,10 @@ void OSystem_Wii::updateScreen() {
 			_cursorPaletteDirty = false;
 		}
 
+#ifdef PLATFORM_WII_OSYSTEM_GFX_DEBUG
+		//printf("%s() cc.x:%f cc.y:%f cc.w:%f cc.h:%f xscale:%f yscale:%f\n", __func__, cc.x, cc.y, cc.w, cc.h, _currentXScale, _currentYScale);
+#endif
+
 		gfx_draw_tex(&_texMouse, &cc);
 	}
 
@@ -653,6 +671,12 @@ bool OSystem_Wii::showMouse(bool visible) {
 	bool last = _mouseVisible;
 	_mouseVisible = visible;
 
+#ifdef PLATFORM_WII_OSYSTEM_GFX_DEBUG
+	if (_mouseVisible != last) {
+		printf("%s(%d)\n", __func__, _mouseVisible);
+	}
+#endif
+
 	return last;
 }
 
@@ -665,6 +689,9 @@ void OSystem_Wii::setMouseCursor(const void *buf, uint w, uint h, int hotspotX,
 									int hotspotY, uint32 keycolor,
 									bool dontScale,
 									const Graphics::PixelFormat *format, const byte *mask) {
+#ifdef PLATFORM_WII_OSYSTEM_GFX_DEBUG
+	printf("%s(%p, w:%u, h:%u, hsX:%d, hsY:%d, kc:%u, dontScale:%d, %p, %p)\n", __func__, buf, w, h, hotspotX, hotspotY, keycolor, dontScale, format, mask);
+#endif
 
 	if (mask)
 		printf("OSystem_Wii::setMouseCursor: Masks are not supported\n");




More information about the Scummvm-git-logs mailing list