[Scummvm-git-logs] scummvm master -> 73fe5f0bdff1ddf383e6a02caf4a87be9da7b799

whoozle noreply at scummvm.org
Sun Jul 26 21:38:12 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:
73fe5f0bdf PHOENIXVR: Use alpha channel for lens flare effect


Commit: 73fe5f0bdff1ddf383e6a02caf4a87be9da7b799
    https://github.com/scummvm/scummvm/commit/73fe5f0bdff1ddf383e6a02caf4a87be9da7b799
Author: Vladimir Menshakov (vladimir.menshakov at gmail.com)
Date: 2026-07-26T22:37:52+01:00

Commit Message:
PHOENIXVR: Use alpha channel for lens flare effect

Changed paths:
    engines/phoenixvr/phoenixvr.cpp


diff --git a/engines/phoenixvr/phoenixvr.cpp b/engines/phoenixvr/phoenixvr.cpp
index 3fc96738d8f..cfac7595f4b 100644
--- a/engines/phoenixvr/phoenixvr.cpp
+++ b/engines/phoenixvr/phoenixvr.cpp
@@ -1534,7 +1534,6 @@ void PhoenixVREngine::renderLensflare() {
 		const Graphics::ManagedSurface &src = *it->_value;
 		const int dstX = static_cast<int>(sourceX + (_screenCenter.x - sourceX) * lens.scale);
 		const int dstY = static_cast<int>(sourceY + (_screenCenter.y - sourceY) * lens.scale);
-		const uint32 transparentColor = src.hasTransparentColor() ? src.getTransparentColor() : src.format.RGBToColor(0, 0, 0);
 
 		for (int y = 0; y != src.h; ++y) {
 			const int screenY = dstY + y;
@@ -1545,12 +1544,13 @@ void PhoenixVREngine::renderLensflare() {
 				if (screenX < 0 || screenX >= _screen->w)
 					continue;
 
-				const uint32 srcColor = src.getPixel(x, y);
-				if (srcColor == transparentColor)
+				uint8 srcR, srcG, srcB, srcA, dstR, dstG, dstB;
+				src.format.colorToARGB(src.getPixel(x, y), srcA, srcR, srcG, srcB);
+				srcR = srcR * srcA / 255;
+				srcG = srcG * srcA / 255;
+				srcB = srcB * srcA / 255;
+				if ((srcR | srcG | srcB) == 0)
 					continue;
-
-				uint8 srcR, srcG, srcB, dstR, dstG, dstB;
-				src.format.colorToRGB(srcColor, srcR, srcG, srcB);
 				_screen->format.colorToRGB(_screen->getPixel(screenX, screenY), dstR, dstG, dstB);
 				_screen->setPixel(screenX, screenY, _screen->format.RGBToColor(CLIP<int>(dstR + srcR, 0, 255), CLIP<int>(dstG + srcG, 0, 255), CLIP<int>(dstB + srcB, 0, 255)));
 			}




More information about the Scummvm-git-logs mailing list