[Scummvm-git-logs] scummvm master -> 7f3705e0b7a899d840f8d73d35411f368661f0a9
aquadran
noreply at scummvm.org
Fri Oct 3 11:49:44 UTC 2025
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:
7f3705e0b7 WINTERMUTE: Skip shadow volume rendering if not supported in upper layer.
Commit: 7f3705e0b7a899d840f8d73d35411f368661f0a9
https://github.com/scummvm/scummvm/commit/7f3705e0b7a899d840f8d73d35411f368661f0a9
Author: PaweÅ KoÅodziejski (aquadran at gmail.com)
Date: 2025-10-03T13:49:29+02:00
Commit Message:
WINTERMUTE: Skip shadow volume rendering if not supported in upper layer.
At this moment it does not try flat shadows if engine not trying.
Changed paths:
engines/wintermute/ad/ad_actor_3dx.cpp
engines/wintermute/base/base_game.cpp
engines/wintermute/base/gfx/base_renderer3d.h
engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp
engines/wintermute/base/gfx/opengl/base_render_opengl3d.h
engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.cpp
engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.h
engines/wintermute/base/gfx/tinygl/base_render_tinygl.cpp
engines/wintermute/base/gfx/tinygl/base_render_tinygl.h
engines/wintermute/base/gfx/tinygl/shadow_volume_tinygl.cpp
diff --git a/engines/wintermute/ad/ad_actor_3dx.cpp b/engines/wintermute/ad/ad_actor_3dx.cpp
index 1f8d0817c82..56cb575ffd3 100644
--- a/engines/wintermute/ad/ad_actor_3dx.cpp
+++ b/engines/wintermute/ad/ad_actor_3dx.cpp
@@ -410,7 +410,10 @@ bool AdActor3DX::display() {
TShadowType shadowType = _game->getMaxShadowType(this);
if (shadowType == SHADOW_STENCIL) {
- displayShadowVolume();
+ // Skip shadow volume rendering if not supported
+ if (_game->_renderer3D->shadowVolumeSupported()) {
+ displayShadowVolume();
+ }
} else if (shadowType > SHADOW_NONE) {
if (_game->_maxShadowType > SHADOW_NONE) {
bool simpleShadow = shadowType <= SHADOW_SIMPLE;
diff --git a/engines/wintermute/base/base_game.cpp b/engines/wintermute/base/base_game.cpp
index d4061dc25b3..000a2ddd91a 100644
--- a/engines/wintermute/base/base_game.cpp
+++ b/engines/wintermute/base/base_game.cpp
@@ -2650,7 +2650,7 @@ bool BaseGame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack
break;
case SHADOW_STENCIL:
- stack->pushBool(_renderer3D->stencilSupported());
+ stack->pushBool(_renderer3D->shadowVolumeSupported());
break;
default:
diff --git a/engines/wintermute/base/gfx/base_renderer3d.h b/engines/wintermute/base/gfx/base_renderer3d.h
index 100a14ae959..c0fcadaf84b 100644
--- a/engines/wintermute/base/gfx/base_renderer3d.h
+++ b/engines/wintermute/base/gfx/base_renderer3d.h
@@ -76,7 +76,7 @@ public:
bool setup3DCustom(DXMatrix &viewMat, DXMatrix &projMat);
virtual bool enableShadows() = 0;
virtual bool disableShadows() = 0;
- virtual bool stencilSupported() = 0;
+ virtual bool shadowVolumeSupported() = 0;
virtual bool invalidateTexture(BaseSurface *texture) = 0;
virtual void setSpriteBlendMode(Graphics::TSpriteBlendMode blendMode, bool forceChange = false) = 0;
diff --git a/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp b/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp
index 500dd53032a..946da1769dd 100644
--- a/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp
+++ b/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp
@@ -765,8 +765,7 @@ void BaseRenderOpenGL3D::setSpriteBlendMode(Graphics::TSpriteBlendMode blendMode
}
}
-bool BaseRenderOpenGL3D::stencilSupported() {
- // assume that we have a stencil buffer
+bool BaseRenderOpenGL3D::shadowVolumeSupported() {
return true;
}
diff --git a/engines/wintermute/base/gfx/opengl/base_render_opengl3d.h b/engines/wintermute/base/gfx/opengl/base_render_opengl3d.h
index 8e2e4af61f9..937d7bc622b 100644
--- a/engines/wintermute/base/gfx/opengl/base_render_opengl3d.h
+++ b/engines/wintermute/base/gfx/opengl/base_render_opengl3d.h
@@ -94,7 +94,7 @@ public:
bool enableShadows() override;
bool disableShadows() override;
- bool stencilSupported() override;
+ bool shadowVolumeSupported() override;
BaseImage *takeScreenshot(int newWidth = 0, int newHeight = 0) override;
bool fadeToColor(byte r, byte g, byte b, byte a) override;
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 422c47d7325..717af96d2ce 100644
--- a/engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.cpp
+++ b/engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.cpp
@@ -863,8 +863,7 @@ void BaseRenderOpenGL3DShader::setSpriteBlendMode(Graphics::TSpriteBlendMode ble
}
}
-bool BaseRenderOpenGL3DShader::stencilSupported() {
- // assume that we have a stencil buffer
+bool BaseRenderOpenGL3DShader::shadowVolumeSupported() {
return true;
}
diff --git a/engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.h b/engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.h
index 5dc422f2812..4aa7632121c 100644
--- a/engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.h
+++ b/engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.h
@@ -96,7 +96,7 @@ public:
bool enableShadows() override;
bool disableShadows() override;
- bool stencilSupported() override;
+ bool shadowVolumeSupported() override;
BaseImage *takeScreenshot(int newWidth = 0, int newHeight = 0) override;
bool fadeToColor(byte r, byte g, byte b, byte a) override;
diff --git a/engines/wintermute/base/gfx/tinygl/base_render_tinygl.cpp b/engines/wintermute/base/gfx/tinygl/base_render_tinygl.cpp
index 975e1589755..a7aaa9e778d 100644
--- a/engines/wintermute/base/gfx/tinygl/base_render_tinygl.cpp
+++ b/engines/wintermute/base/gfx/tinygl/base_render_tinygl.cpp
@@ -756,7 +756,7 @@ void BaseRenderTinyGL::setSpriteBlendMode(Graphics::TSpriteBlendMode blendMode,
}
}
-bool BaseRenderTinyGL::stencilSupported() {
+bool BaseRenderTinyGL::shadowVolumeSupported() {
return _shadowVolumesSupported;
}
diff --git a/engines/wintermute/base/gfx/tinygl/base_render_tinygl.h b/engines/wintermute/base/gfx/tinygl/base_render_tinygl.h
index eec0eafc54b..94a73e2fd8f 100644
--- a/engines/wintermute/base/gfx/tinygl/base_render_tinygl.h
+++ b/engines/wintermute/base/gfx/tinygl/base_render_tinygl.h
@@ -93,7 +93,7 @@ public:
bool enableShadows() override;
bool disableShadows() override;
- bool stencilSupported() override;
+ bool shadowVolumeSupported() override;
BaseImage *takeScreenshot(int newWidth = 0, int newHeight = 0) override;
bool fadeToColor(byte r, byte g, byte b, byte a) override;
diff --git a/engines/wintermute/base/gfx/tinygl/shadow_volume_tinygl.cpp b/engines/wintermute/base/gfx/tinygl/shadow_volume_tinygl.cpp
index 22c62a0bf36..134793ad8f0 100644
--- a/engines/wintermute/base/gfx/tinygl/shadow_volume_tinygl.cpp
+++ b/engines/wintermute/base/gfx/tinygl/shadow_volume_tinygl.cpp
@@ -59,9 +59,6 @@ bool ShadowVolumeTinyGL::render() {
//////////////////////////////////////////////////////////////////////////
bool ShadowVolumeTinyGL::renderToStencilBuffer() {
- if (!dynamic_cast<BaseRenderTinyGL *>(_game->_renderer3D)->stencilSupported()) {
- return false;
- }
// Disable z-buffer/color writes (note: z-testing still occurs), and enable the
// stencil-buffer
tglDepthMask(TGL_FALSE);
@@ -106,9 +103,6 @@ bool ShadowVolumeTinyGL::renderToStencilBuffer() {
//////////////////////////////////////////////////////////////////////////
bool ShadowVolumeTinyGL::renderToScene() {
- if (!dynamic_cast<BaseRenderTinyGL *>(_game->_renderer3D)->stencilSupported()) {
- return false;
- }
initMask();
tglDisable(TGL_DEPTH_TEST);
More information about the Scummvm-git-logs
mailing list