From 98604e513e302732d1818f041b0295133fc13099 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 31 Dec 2019 20:11:31 +0100 Subject: [PATCH] - set up the scene viewport for the postprocessor. --- source/common/rendering/v_framebuffer.cpp | 26 +++++------------------ source/common/rendering/v_video.h | 1 - 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/source/common/rendering/v_framebuffer.cpp b/source/common/rendering/v_framebuffer.cpp index 2b6218b15..7f6f7169a 100644 --- a/source/common/rendering/v_framebuffer.cpp +++ b/source/common/rendering/v_framebuffer.cpp @@ -45,6 +45,7 @@ #include "v_draw.h" #include "i_time.h" #include "v_2ddrawer.h" +#include "build.h" /* #include "hwrenderer/scene/hw_portal.h" #include "hwrenderer/utility/hw_clock.h" @@ -237,20 +238,8 @@ void DFrameBuffer::SetViewportRects(IntRect *bounds) return; } -#if 0 // Special handling so the view with a visible status bar displays properly - int height, width; - if (screenblocks >= 10) - { - height = GetHeight(); - width = GetWidth(); - } - else - { - height = (screenblocks*GetHeight() / 10) & ~7; - width = (screenblocks*GetWidth() / 10); - } -#endif + int height = windowxy2.y - windowxy1.y + 1, width = windowxy2.x - windowxy1.x + 1; // Back buffer letterbox for the final output int clientWidth = GetClientWidth(); @@ -286,16 +275,11 @@ void DFrameBuffer::SetViewportRects(IntRect *bounds) mScreenViewport.width = screenWidth; mScreenViewport.height = screenHeight; -#if 0 // Viewport for the 3D scene - mSceneViewport.left = viewwindowx; - mSceneViewport.top = screenHeight - (height + viewwindowy - ((height - viewheight) / 2)); - mSceneViewport.width = viewwidth; + mSceneViewport.left = windowxy1.x; + mSceneViewport.top = windowxy1.y; + mSceneViewport.width = width; mSceneViewport.height = height; -#else - // For now use the full screen. This needs to be done better. - mSceneViewport = mScreenViewport; -#endif // Scale viewports to fit letterbox bool notScaled = ((mScreenViewport.width == ViewportScaledWidth(mScreenViewport.width, mScreenViewport.height)) && diff --git a/source/common/rendering/v_video.h b/source/common/rendering/v_video.h index 64788b4b8..d4e1158e4 100644 --- a/source/common/rendering/v_video.h +++ b/source/common/rendering/v_video.h @@ -259,7 +259,6 @@ public: inline int GetWidth() const { return Width; } inline int GetHeight() const { return Height; } - // Currently there is no concept of a scene viewport in Build, but let's keep this stuff here to implement it later. FVector2 SceneScale() const { return { mSceneViewport.width / (float)mScreenViewport.width, mSceneViewport.height / (float)mScreenViewport.height };