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

whoozle noreply at scummvm.org
Mon Jul 13 23:10: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:
1e51d9b548 PHOENIXVR: fix vertical rendering artefacts found in Dracula 2


Commit: 1e51d9b548ab90d05a9365e6e9b225fee08fda52
    https://github.com/scummvm/scummvm/commit/1e51d9b548ab90d05a9365e6e9b225fee08fda52
Author: Vladimir Menshakov (vladimir.menshakov at gmail.com)
Date: 2026-07-14T00:08:11+01:00

Commit Message:
PHOENIXVR: fix vertical rendering artefacts found in Dracula 2

Changed paths:
    engines/phoenixvr/vr.cpp
    engines/phoenixvr/vr.h


diff --git a/engines/phoenixvr/vr.cpp b/engines/phoenixvr/vr.cpp
index 5740f9ffca6..706c7f269ae 100644
--- a/engines/phoenixvr/vr.cpp
+++ b/engines/phoenixvr/vr.cpp
@@ -382,6 +382,17 @@ VR VR::loadStatic(const Graphics::PixelFormat &format, Common::SeekableReadStrea
 			auto *pic = vr._pic.get();
 			if (pic3d) {
 				vr._vr = true;
+
+				if (g_engine->gameIdMatches("dracula2")) {
+					// Original engine seems to skip 1 pixel per tile.
+					// dct.dll uses while(x < 255) loop condition when unpacking pixels to color planes.
+					// However, game tiles for all games are matching perfectly with each other.
+					// Those bad pixels are present on right hand side of the right hand tiles
+					// only found in Dracula 2.
+					// Minimizing rendering artifacts, reducing face size
+					vr._ignoreRightPixel = true;
+				}
+
 				pic->create(kVRImageWidth, kVRImageHeight, format);
 			} else
 				pic->create(kStaticImageWidth, kStaticImageHeight, format);
@@ -614,6 +625,10 @@ void VR::renderVR(Graphics::Screen *screen, float ax, float ay, float fov, float
 	if (_showWaves)
 		_wavesT += dt * 20;
 
+	int faceSize = kVRFaceSize;
+	if (_ignoreRightPixel)
+		--faceSize;
+
 	ColorType *dstPixels = static_cast<ColorType *>(screen->getPixels());
 	const auto dstPixelsPitchIncrement = screen->pitch / sizeof(ColorType);
 	for (int dstY = 0; dstY != h; ++dstY, line += incrementY, dstPixels += dstPixelsPitchIncrement) {
@@ -637,7 +652,7 @@ void VR::renderVR(Graphics::Screen *screen, float ax, float ay, float fov, float
 
 		for (int dstX = 0; dstX != w; ++dstX, ray += incrementX, ++dst) {
 			auto cube = toCube(ray.x(), ray.y(), ray.z());
-			int srcX = static_cast<int>(kVRFaceSize * cube.x);
+			int srcX = static_cast<int>(faceSize * cube.x);
 			int srcY = static_cast<int>(kVRFaceSize * cube.y);
 			int tileId = cube.faceIdx << 2;
 			tileId += (srcY < kVRTileSize) ? (srcX < kVRTileSize ? 0 : 1) : (srcX < kVRTileSize ? 3 : 2);
diff --git a/engines/phoenixvr/vr.h b/engines/phoenixvr/vr.h
index 79fbe4b551c..1fa52bfc40b 100644
--- a/engines/phoenixvr/vr.h
+++ b/engines/phoenixvr/vr.h
@@ -62,6 +62,7 @@ class VR {
 	float _hint = 0;
 	bool _showWaves = false;
 	float _wavesT = 0;
+	bool _ignoreRightPixel = false;
 
 public:
 	static VR loadStatic(const Graphics::PixelFormat &format, Common::SeekableReadStream &s);




More information about the Scummvm-git-logs mailing list