From 20a9514aa221803d906abe310b04e0490d9d5a32 Mon Sep 17 00:00:00 2001 From: Ian Curtis Date: Thu, 15 Dec 2016 19:27:08 +0000 Subject: [PATCH] For scroll fog set the viewport to the entire area, allows fog to work in widescreen mode --- Src/Graphics/New3D/New3D.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Src/Graphics/New3D/New3D.cpp b/Src/Graphics/New3D/New3D.cpp index 1ca0d6e..48b92cd 100644 --- a/Src/Graphics/New3D/New3D.cpp +++ b/Src/Graphics/New3D/New3D.cpp @@ -91,6 +91,7 @@ void CNew3D::DrawScrollFog() if (n.viewport.scrollFog > 0 && n.viewport.priority == i) { float *rgb = n.viewport.fogParams; + glViewport(0, 0, m_totalXRes, m_totalYRes); // fill the whole viewport m_r3dScrollFog.DrawScrollFog(rgb[0], rgb[1], rgb[2], n.viewport.scrollFog); return; } @@ -769,6 +770,9 @@ void CNew3D::RenderViewport(UINT32 addr) vp->scrollFog = (float)(vpnode[0x20] & 0xFF) * (1.0f / 255.0f); // scroll fog + // Unknown light/fog parameters + float scrollAtt = (float)(vpnode[0x24] & 0xFF) * (1.0f / 255.0f); // scroll attenuation + { //test fog paramaters float lightFogColour[3]; @@ -789,9 +793,6 @@ void CNew3D::RenderViewport(UINT32 addr) vp->fogParams[3] = vp->fogParams[4] = 0.0f; } - // Unknown light/fog parameters - float scrollAtt = (float)(vpnode[0x24] & 0xFF) * (1.0f / 255.0f); // scroll attenuation - // Clear texture offsets before proceeding m_nodeAttribs.Reset();