From 665ef86cf0a0dcd029a338e397b8a59092b335e0 Mon Sep 17 00:00:00 2001 From: Bobby Smith <33353403+bslenul@users.noreply.github.com> Date: Tue, 14 Nov 2023 18:32:33 +0100 Subject: [PATCH] [Libretro] Change VMUs scaling for GL/D3D11 --- core/rend/dx11/dx11_overlay.cpp | 5 ++++- core/rend/gles/gldraw.cpp | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/core/rend/dx11/dx11_overlay.cpp b/core/rend/dx11/dx11_overlay.cpp index f35b6435b9..bab450e04e 100644 --- a/core/rend/dx11/dx11_overlay.cpp +++ b/core/rend/dx11/dx11_overlay.cpp @@ -28,14 +28,17 @@ void DX11Overlay::draw(u32 width, u32 height, bool vmu, bool crosshair) deviceContext->RSSetScissorRects(1, &rect); if (vmu) { +#ifndef LIBRETRO float vmu_padding = 8.f * settings.display.uiScale; float vmu_height = 70.f * settings.display.uiScale; float vmu_width = 48.f / 32.f * vmu_height; -#ifndef LIBRETRO const float blend_factor[4] = { 0.75f, 0.75f, 0.75f, 0.75f }; deviceContext->OMSetBlendState(blendStates.getState(true, 8, 8), blend_factor, 0xffffffff); #else + float vmu_padding = 8.f * config::RenderResolution / 480.f; + float vmu_height = 32.f * config::RenderResolution / 480.f; + float vmu_width = 48.f * config::RenderResolution / 480.f; deviceContext->OMSetBlendState(blendStates.getState(true, 4, 5), nullptr, 0xffffffff); #endif diff --git a/core/rend/gles/gldraw.cpp b/core/rend/gles/gldraw.cpp index 958cbbba98..6306e0a985 100644 --- a/core/rend/gles/gldraw.cpp +++ b/core/rend/gles/gldraw.cpp @@ -828,11 +828,11 @@ static void updateVmuTexture(int vmu_screen_number) void DrawVmuTexture(u8 vmu_screen_number, int width, int height) { - constexpr float vmu_padding = 8.f; + float vmu_padding = 8.f * config::RenderResolution / 480.f; float x = vmu_padding; float y = vmu_padding; - float w = (float)VMU_SCREEN_WIDTH * vmu_screen_params[vmu_screen_number].vmu_screen_size_mult * 4.f / 3.f / gl.ofbo.aspectRatio; - float h = (float)VMU_SCREEN_HEIGHT * vmu_screen_params[vmu_screen_number].vmu_screen_size_mult; + float w = (float)VMU_SCREEN_WIDTH * vmu_screen_params[vmu_screen_number].vmu_screen_size_mult * 4.f / 3.f / gl.ofbo.aspectRatio * config::RenderResolution / 480.f; + float h = (float)VMU_SCREEN_HEIGHT * vmu_screen_params[vmu_screen_number].vmu_screen_size_mult * config::RenderResolution / 480.f; if (vmu_lcd_changed[vmu_screen_number * 2] || vmuTextureId[vmu_screen_number] == 0) updateVmuTexture(vmu_screen_number);