[Scummvm-git-logs] scummvm master -> cb1475c17eb5adec4cc75f9374c8f7542151aa30
neuromancer
noreply at scummvm.org
Sun Nov 29 08:25:35 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:
cb1475c17e COLONY: Spacecraft door bleeds through hull from opposite side
Commit: cb1475c17eb5adec4cc75f9374c8f7542151aa30
https://github.com/scummvm/scummvm/commit/cb1475c17eb5adec4cc75f9374c8f7542151aa30
Author: Onkar-Raskar (onkarraskar030 at gmail.com)
Date: 2026-11-29T09:25:31+01:00
Commit Message:
COLONY: Spacecraft door bleeds through hull from opposite side
Changed paths:
engines/colony/battle.cpp
engines/colony/renderer.h
engines/colony/renderer_opengl.cpp
engines/colony/renderer_opengl_shaders.cpp
diff --git a/engines/colony/battle.cpp b/engines/colony/battle.cpp
index e55c974619f..e0979309e47 100644
--- a/engines/colony/battle.cpp
+++ b/engines/colony/battle.cpp
@@ -309,6 +309,10 @@ const int kSDoorSurf[1][8] = {
};
const ColonyEngine::PrismPartDef kSDoorDef = {4, kSDoorPts, 1, kSDoorSurf};
+const ColonyEngine::PrismPartDef kEntHostDef = {8, kEntPts, 1, kEntSurf};
+const ColonyEngine::PrismPartDef kEntRestDef = {8, kEntPts, ARRAYSIZE(kEntSurf) - 1, kEntSurf + 1};
+const ColonyEngine::PrismPartDef kSBodyHostDef = {12, kSBodyPts, 1, kSBodySurf};
+const ColonyEngine::PrismPartDef kSBodyRestDef = {12, kSBodyPts, ARRAYSIZE(kSBodySurf) - 1, kSBodySurf + 1};
// =====================================================================
// 3D Model Data - Projectile
// =====================================================================
@@ -808,17 +812,22 @@ void ColonyEngine::battleDrawTanks() {
_battleEnter.xloc, _battleEnter.yloc, _battleEnter.ang, -kFloor,
_me.look, _me.lookY, _sint, _cost, _me.xloc, _me.yloc);
_battleEnter.dist = forward;
- draw3DBattlePrism(kEntDef, _battleEnter.xloc, _battleEnter.yloc,
+ // rest of the body
+ draw3DBattlePrism(kEntRestDef, _battleEnter.xloc, _battleEnter.yloc,
_battleEnter.ang, -kFloor);
- // Draw door with depth test disabled so it renders fully
- // on top of the coplanar entrance wall (same fill color,
- // but the black outline becomes clearly visible).
_gfx->setDepthState(true, false);
- _gfx->setDepthRange(0.0f, 0.999f);
+ // host face
+ draw3DBattlePrism(kEntHostDef, _battleEnter.xloc, _battleEnter.yloc,
+ _battleEnter.ang, -kFloor);
+ // door
draw3DBattlePrism(kEntDoorDef, _battleEnter.xloc, _battleEnter.yloc,
_battleEnter.ang, -kFloor);
- _gfx->setDepthRange(0.0f, 1.0f);
+ _gfx->setColorMask(false);
_gfx->setDepthState(true, true);
+ // host face
+ draw3DBattlePrism(kEntHostDef, _battleEnter.xloc, _battleEnter.yloc,
+ _battleEnter.ang, -kFloor);
+ _gfx->setColorMask(true);
if (_battleMaxP < 100) {
_battlePwh[_battleMaxP] = &_battleEnter;
_battleMaxP++;
@@ -855,25 +864,32 @@ void ColonyEngine::battleDrawTanks() {
_battleShip.xloc, _battleShip.yloc, _battleShip.ang, -kFloor,
_me.look, _me.lookY, _sint, _cost, _me.xloc, _me.yloc);
_battleShip.dist = forward;
- draw3DBattlePrism(kSBodyDef, _battleShip.xloc, _battleShip.yloc,
+ draw3DBattlePrism(kSBodyRestDef, _battleShip.xloc, _battleShip.yloc,
_battleShip.ang, -kFloor);
draw3DBattlePrism(kSFrontDef, _battleShip.xloc, _battleShip.yloc,
_battleShip.ang, -kFloor);
draw3DBattlePrism(kSBackDef, _battleShip.xloc, _battleShip.yloc,
_battleShip.ang, -kFloor);
- // Fins: force-draw (no backface cull) â single-sided surfaces
+ // Fins: single-sided surfaces
draw3DBattlePrism(kFTopDef, _battleShip.xloc, _battleShip.yloc,
_battleShip.ang, -kFloor);
draw3DBattlePrism(kFLeftDef, _battleShip.xloc, _battleShip.yloc,
_battleShip.ang, -kFloor);
draw3DBattlePrism(kFRightDef, _battleShip.xloc, _battleShip.yloc,
_battleShip.ang, -kFloor);
+ // host face
_gfx->setDepthState(true, false);
- _gfx->setDepthRange(0.0f, 0.999f);
+ draw3DBattlePrism(kSBodyHostDef, _battleShip.xloc, _battleShip.yloc,
+ _battleShip.ang, -kFloor);
+ // door
draw3DBattlePrism(kSDoorDef, _battleShip.xloc, _battleShip.yloc,
_battleShip.ang, -kFloor);
- _gfx->setDepthRange(0.0f, 1.0f);
+ // host face
+ _gfx->setColorMask(false);
_gfx->setDepthState(true, true);
+ draw3DBattlePrism(kSBodyHostDef, _battleShip.xloc, _battleShip.yloc,
+ _battleShip.ang, -kFloor);
+ _gfx->setColorMask(true);
if (_battleMaxP < 100) {
_battlePwh[_battleMaxP] = &_battleShip;
_battleMaxP++;
diff --git a/engines/colony/renderer.h b/engines/colony/renderer.h
index 86073313501..58bfb5e4647 100644
--- a/engines/colony/renderer.h
+++ b/engines/colony/renderer.h
@@ -74,6 +74,7 @@ public:
virtual void setMacColors(uint32 fg, uint32 bg) {}
virtual void setDepthState(bool testEnabled, bool writeEnabled) {}
virtual void setDepthRange(float nearVal, float farVal) {}
+ virtual void setColorMask(bool enabled) {}
// features.c clipped each wall feature to its own wall (ClipRect(&rClip)).
virtual void setFeatureClipX(int left, int right) {}
virtual void clearFeatureClipX() {}
diff --git a/engines/colony/renderer_opengl.cpp b/engines/colony/renderer_opengl.cpp
index af782578d97..74b3ba244af 100644
--- a/engines/colony/renderer_opengl.cpp
+++ b/engines/colony/renderer_opengl.cpp
@@ -92,6 +92,10 @@ public:
void setDepthRange(float nearVal, float farVal) override {
glDepthRange(nearVal, farVal);
}
+ void setColorMask(bool enabled) override {
+ const GLboolean mask = enabled ? GL_TRUE : GL_FALSE;
+ glColorMask(mask, mask, mask, mask);
+ }
void applyScissorRect(const Common::Rect &logical) {
const float scaleX = (float)_screenViewport.width() / (float)_width;
@@ -552,6 +556,7 @@ void OpenGLRenderer::end3D() {
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glDisable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
+ glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glDepthRange(0.0, 1.0);
glDisable(GL_SCISSOR_TEST);
diff --git a/engines/colony/renderer_opengl_shaders.cpp b/engines/colony/renderer_opengl_shaders.cpp
index 8f58fd40dc8..04d8a367438 100644
--- a/engines/colony/renderer_opengl_shaders.cpp
+++ b/engines/colony/renderer_opengl_shaders.cpp
@@ -80,6 +80,7 @@ public:
void setMacColors(uint32 fg, uint32 bg) override;
void setDepthState(bool testEnabled, bool writeEnabled) override;
void setDepthRange(float nearVal, float farVal) override;
+ void setColorMask(bool enabled) override;
void setFeatureClipX(int left, int right) override;
void clearFeatureClipX() override;
void applyScissorRect(const Common::Rect &logical);
@@ -723,6 +724,11 @@ void OpenGLShaderRenderer::setDepthRange(float nearVal, float farVal) {
setGLDepthRange(nearVal, farVal);
}
+void OpenGLShaderRenderer::setColorMask(bool enabled) {
+ const GLboolean mask = enabled ? GL_TRUE : GL_FALSE;
+ glColorMask(mask, mask, mask, mask);
+}
+
void OpenGLShaderRenderer::applyScissorRect(const Common::Rect &logical) {
const float scaleX = (float)_screenViewport.width() / (float)_width;
const float scaleY = (float)_screenViewport.height() / (float)_height;
@@ -819,6 +825,7 @@ void OpenGLShaderRenderer::begin3D(int camX, int camY, int camZ, int angle, int
void OpenGLShaderRenderer::end3D() {
glDisable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
+ glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
setGLDepthRange(0.0f, 1.0f);
glDisable(GL_SCISSOR_TEST);
More information about the Scummvm-git-logs
mailing list