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

AReim1982 noreply at scummvm.org
Fri Oct 16 09:08:59 UTC 2026


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

Summary:
e561f5c467 WII: Fix CLUT8 texture format handling


Commit: e561f5c467f7966988b0d1784687dae5df3ee28a
    https://github.com/scummvm/scummvm/commit/e561f5c467f7966988b0d1784687dae5df3ee28a
Author: Alexander Reim (alexander at areim.de)
Date: 2026-10-16T11:07:55+02:00

Commit Message:
WII: Fix CLUT8 texture format handling

Reset _pfGameTexture when switching back to CLUT8 modes.
Without this, the backend could incorrectly keep the previous RGB565 texture format and use an invalid conversion path, resulting in black screens.
Also avoid a possible double free when _gamePixelsTexture and _gamePixels point to the same buffer.

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 c3582a8942e..e654d467ac1 100644
--- a/backends/platform/wii/osystem_gfx.cpp
+++ b/backends/platform/wii/osystem_gfx.cpp
@@ -108,10 +108,12 @@ void OSystem_Wii::deinitGfx() {
 	free(_cursorPalette);
 	_cursorPalette = NULL;
 
+	if(_gamePixels != _gamePixelsTexture)
+		free(_gamePixelsTexture);
+
 	free(_gamePixels);
-	_gamePixels = NULL;
 
-	free(_gamePixelsTexture);
+	_gamePixels = NULL;
 	_gamePixelsTexture = NULL;
 
 	free(_overlayPixels);
@@ -280,12 +282,13 @@ void OSystem_Wii::initSize(uint width, uint height,
 			free(_gamePixels);
 		free(_gamePixelsTexture);
 
-		tex_format = GFX_TF_PALETTE_RGB565;
-
 		if (_pfGame.bytesPerPixel > 1) {
 			// TODO: Support other texture formats?
 			tex_format = GFX_TF_RGB565;
 			_pfGameTexture = _pfRGB565;
+		} else {
+			tex_format = GFX_TF_PALETTE_RGB565;
+			_pfGameTexture = Graphics::PixelFormat::createFormatCLUT8();
 		}
 
 		printf("initSize %u*%u*%u (%s -> %s match: %d)\n",




More information about the Scummvm-git-logs mailing list