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

Helco noreply at scummvm.org
Wed Sep 17 17:25:31 UTC 2025


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

Summary:
ec89d6fbc5 ALCACHOFA: Implement 16-bit mode
f97a63cc00 DOCS: Add GUIO documentation for Alcachofa


Commit: ec89d6fbc51b53d13d9afcde14d6334b3e0a6003
    https://github.com/scummvm/scummvm/commit/ec89d6fbc51b53d13d9afcde14d6334b3e0a6003
Author: Helco (hermann.noll at hotmail.com)
Date: 2025-09-17T19:25:19+02:00

Commit Message:
ALCACHOFA: Implement 16-bit mode

Changed paths:
    engines/alcachofa/graphics-opengl-shaders.cpp
    engines/alcachofa/graphics-tinygl.cpp
    engines/alcachofa/metaengine.cpp


diff --git a/engines/alcachofa/graphics-opengl-shaders.cpp b/engines/alcachofa/graphics-opengl-shaders.cpp
index 90a82b6e8f7..9fb80eaf5e8 100644
--- a/engines/alcachofa/graphics-opengl-shaders.cpp
+++ b/engines/alcachofa/graphics-opengl-shaders.cpp
@@ -19,6 +19,7 @@
  *
  */
 
+#include "alcachofa/alcachofa.h"
 #include "alcachofa/graphics-opengl.h"
 #include "alcachofa/detection.h"
 
@@ -188,6 +189,7 @@ private:
 		setBlendFunc(_currentBlendMode);
 		_shader.setUniform("projection", _projection);
 		_shader.setUniform("blendMode", _currentTexture == nullptr ? 5 : (int)_currentBlendMode);
+		_shader.setUniform("posterize", g_engine->config().highQuality() ? 1 : 0);
 		_shader.setUniform1f("lodBias", _currentLodBias);
 		_shader.setUniform("texture", 0);
 		_batchTexture = _currentTexture;
@@ -198,7 +200,6 @@ private:
 	Array<VBO> _vbos;
 	Array<Vertex> _vertices;
 	uint _curVBO = 0;
-//	uint _usedTextureUnits = 0;
 	bool _needsNewBatch = false;
 	OpenGLTexture *_batchTexture = nullptr;
 	ScopedPtr<OpenGLTexture> _whiteTexture;
@@ -226,6 +227,7 @@ private:
 
 		uniform sampler2D texture;
 		uniform int blendMode;
+		uniform int posterize;
 		uniform float lodBias;
 
 		varying vec2 var_uv;
@@ -245,6 +247,11 @@ private:
 			} else { // Disabled texture
 				gl_FragColor = var_color;
 			}
+
+			if (posterize == 0) {
+				// shave off 3 bits for that 16-bit look
+				gl_FragColor = floor(gl_FragColor * (256 / 8)) / (256 / 8);
+			}
 		})";
 };
 
diff --git a/engines/alcachofa/graphics-tinygl.cpp b/engines/alcachofa/graphics-tinygl.cpp
index 76990e882a5..ff7563ab1ad 100644
--- a/engines/alcachofa/graphics-tinygl.cpp
+++ b/engines/alcachofa/graphics-tinygl.cpp
@@ -19,6 +19,7 @@
  *
  */
 
+#include "alcachofa/alcachofa.h"
 #include "alcachofa/graphics.h"
 #include "alcachofa/detection.h"
 #include "alcachofa/graphics-opengl-base.h"
@@ -71,7 +72,23 @@ protected:
 class TinyGLRenderer : public OpenGLRendererBase {
 public:
 	TinyGLRenderer(Point resolution) : OpenGLRendererBase(resolution) {
-		initGraphics(resolution.x, resolution.y, nullptr);
+		if (g_engine->config().bits32())
+			initGraphics(resolution.x, resolution.y, nullptr);
+		else {
+			// we try to take some 16-bit format and fallback
+			auto formats = g_system->getSupportedFormats();
+			for (auto it = formats.begin(); it != formats.end();) {
+				if (it->bytesPerPixel == 2)
+					++it;
+				else
+					it = formats.erase(it);
+			}
+			if (formats.empty())
+				initGraphics(resolution.x, resolution.y, nullptr);
+			else
+				initGraphics(resolution.x, resolution.y, formats);
+		}
+
 		debug("Using framebuffer format: %s", g_system->getScreenFormat().toString().c_str());
 		if (g_system->getScreenFormat().bytesPerPixel < 2)
 			error("Alcachofa needs at least 16bit colors"); 
diff --git a/engines/alcachofa/metaengine.cpp b/engines/alcachofa/metaengine.cpp
index 0e5641c64b9..60af8263525 100644
--- a/engines/alcachofa/metaengine.cpp
+++ b/engines/alcachofa/metaengine.cpp
@@ -49,7 +49,7 @@ static const ADExtraGuiOptionsMap optionsList[] = {
 		GAMEOPTION_32BITS,
 		{
 			_s("32 Bits"),
-			_s("Uses 32bit textures instead of 16bit ones (currently not implemented)"),
+			_s("Whether to render the game in 16-bit color"),
 			"32_bits",
 			true,
 			0,


Commit: f97a63cc00823a1366cf399eceb6b89155b4d19e
    https://github.com/scummvm/scummvm/commit/f97a63cc00823a1366cf399eceb6b89155b4d19e
Author: Helco (hermann.noll at hotmail.com)
Date: 2025-09-17T19:25:19+02:00

Commit Message:
DOCS: Add GUIO documentation for Alcachofa

Changed paths:
    doc/docportal/settings/game.rst


diff --git a/doc/docportal/settings/game.rst b/doc/docportal/settings/game.rst
index f051926a985..64e05f212ca 100644
--- a/doc/docportal/settings/game.rst
+++ b/doc/docportal/settings/game.rst
@@ -182,6 +182,28 @@ Disable fade-out effects
 
 ,,,,,,
 
+.. _ALCACHOFA:
+
+Alcachofa
+******************
+
+.. _high_quality:
+
+High Quality
+	Toggles some optional graphical effects.
+
+	*high_quality*
+
+.. _32_bits:
+
+32-Bit Mode
+	Toggles between full 32-bit colors or reduced 16-bit color.
+	Might need a restart to take effect.
+
+	*32_bits*
+
+,,,,,,
+
 .. _BLADERUNNER:
 
 Bladerunner




More information about the Scummvm-git-logs mailing list