From c30511e523ca7314becfedfbfecdf08a0c8f614e Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 2 Jan 2018 15:22:09 +0000 Subject: [PATCH] For the remote server preview, display at 90% scale * This makes it more clear that the preview is coming from renderdoc's replay, not the original program. --- renderdoc/core/replay_proxy.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/renderdoc/core/replay_proxy.cpp b/renderdoc/core/replay_proxy.cpp index e42d1811b..ecf378509 100644 --- a/renderdoc/core/replay_proxy.cpp +++ b/renderdoc/core/replay_proxy.cpp @@ -1949,20 +1949,13 @@ void ReplayProxy::RefreshPreviewWindow() float xScale = float(winWidth) / float(texInfo.width); float yScale = float(winHeight) / float(texInfo.height); - if(xScale > yScale) - { - // use the y scale, calculate the x offset to centre horizontally - cfg.scale = yScale; + // use the smaller scale, and shrink a little so we don't display it fullscreen - makes it a + // little clearer that this is the replay, not the original application + cfg.scale = RDCMIN(xScale, yScale) * 0.9f; - cfg.xOffset = (float(winWidth) - float(texInfo.width) * cfg.scale) / 2.0f; - } - else - { - // use the x scale, calculate the y offset to centre vertically - cfg.scale = xScale; - - cfg.yOffset = (float(winHeight) - float(texInfo.height) * cfg.scale) / 2.0f; - } + // centre the texture + cfg.xOffset = (float(winWidth) - float(texInfo.width) * cfg.scale) / 2.0f; + cfg.yOffset = (float(winHeight) - float(texInfo.height) * cfg.scale) / 2.0f; m_Replay->RenderTexture(cfg); }