[Scummvm-git-logs] scummvm master -> 1b9b911ad1985b18cc3617120316559a9c1fe6f9

aquadran noreply at scummvm.org
Sat Jan 31 15:32:58 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:
1b9b911ad1 WINTERMUTE: fix culling in Setup2D


Commit: 1b9b911ad1985b18cc3617120316559a9c1fe6f9
    https://github.com/scummvm/scummvm/commit/1b9b911ad1985b18cc3617120316559a9c1fe6f9
Author: Dario Scarpa (3518552+darioscarpa at users.noreply.github.com)
Date: 2026-01-31T16:32:54+01:00

Commit Message:
WINTERMUTE: fix culling in Setup2D

The WME `Setup2D()` implementation calls
`m_Device->SetRenderState(D3DRS_CULLMODE, D3DCULL_CCW)`,
which in OpenGL must be mapped to
`glFrontFace(GL_CW); glEnable(GL_CULL_FACE)` to preserve semantics.
Other instances of `glFrontFace(X)` replacing a
`SetRenderState(D3DRS_CULLMODE, Y)` do the CCW/CW flip as expected,
but not this one.
This was found investigating a `FadeOut` call which didn't darken the
screen, because only in some cases, depending on the OpenGL state, the
fader quad got culled.

Changed paths:
    engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp
    engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.cpp
    engines/wintermute/base/gfx/tinygl/base_render_tinygl.cpp


diff --git a/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp b/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp
index 5af4e0d1f06..1ac5a1b480b 100644
--- a/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp
+++ b/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp
@@ -186,7 +186,7 @@ bool BaseRenderOpenGL3D::setup2D(bool force) {
 		glEnable(GL_ALPHA_TEST);
 		glAlphaFunc(GL_GEQUAL, 0.0f);
 
-		glFrontFace(GL_CCW);  // WME DX have CW
+		glFrontFace(GL_CW);  // WME DX have CCW
 		glEnable(GL_CULL_FACE);
 		glDisable(GL_STENCIL_TEST);
 
diff --git a/engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.cpp b/engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.cpp
index e2e427b83de..cbcbd46a9d9 100644
--- a/engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.cpp
+++ b/engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.cpp
@@ -263,7 +263,7 @@ bool BaseRenderOpenGL3DShader::setup2D(bool force) {
 
 		_alphaRef = 0.0f;
 
-		glFrontFace(GL_CCW);  // WME DX have CW
+		glFrontFace(GL_CW);  // WME DX have CCW
 		glEnable(GL_CULL_FACE);
 		glDisable(GL_STENCIL_TEST);
 	}
diff --git a/engines/wintermute/base/gfx/tinygl/base_render_tinygl.cpp b/engines/wintermute/base/gfx/tinygl/base_render_tinygl.cpp
index 5b51dace277..4114d8f4fd6 100644
--- a/engines/wintermute/base/gfx/tinygl/base_render_tinygl.cpp
+++ b/engines/wintermute/base/gfx/tinygl/base_render_tinygl.cpp
@@ -188,7 +188,7 @@ bool BaseRenderTinyGL::setup2D(bool force) {
 		tglEnable(TGL_ALPHA_TEST);
 		tglAlphaFunc(TGL_GEQUAL, 0.0f);
 
-		tglFrontFace(TGL_CCW);  // WME DX have CW
+		tglFrontFace(TGL_CW);  // WME DX have CCW
 		tglEnable(TGL_CULL_FACE);
 		tglDisable(TGL_STENCIL_TEST);
 




More information about the Scummvm-git-logs mailing list