From de403a6203dcacad72ad237b78a5f9685d7a0789 Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Mon, 13 May 2024 16:12:32 +0200 Subject: [PATCH] switch, uwp, libretro build fixes --- core/oslib/oslib.cpp | 4 ++-- core/rend/dx11/dx11_renderer.cpp | 6 +++++- shell/switch/switch_main.cpp | 11 +++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/core/oslib/oslib.cpp b/core/oslib/oslib.cpp index 834ade0ef..976620a30 100644 --- a/core/oslib/oslib.cpp +++ b/core/oslib/oslib.cpp @@ -199,7 +199,7 @@ void saveScreenshot(const std::string& name, const std::vector& data) StorageFolder^ folder = KnownFolders::PicturesLibrary; // or SavedPictures? if (folder == nullptr) { INFO_LOG(COMMON, "KnownFolders::PicturesLibrary is null"); - throw FlycastException(); + throw FlycastException("Can't find Pictures library"); } nowide::wstackstring wstr; wchar_t *wname = wstr.convert(name.c_str()); @@ -220,7 +220,7 @@ void saveScreenshot(const std::string& name, const std::vector& data) } catch (COMException^ e) { WARN_LOG(COMMON, "Save screenshot failed: %S", e->Message->Data()); - throw FlycastException(); + throw FlycastException(""); } } diff --git a/core/rend/dx11/dx11_renderer.cpp b/core/rend/dx11/dx11_renderer.cpp index 2cb9e9357..cd5cb76fa 100644 --- a/core/rend/dx11/dx11_renderer.cpp +++ b/core/rend/dx11/dx11_renderer.cpp @@ -1384,8 +1384,12 @@ bool DX11Renderer::GetLastFrame(std::vector& data, int& width, int& height) quad->draw(fbTextureView, samplers->getSampler(true), nullptr, -1.f, -1.f, 2.f, 2.f, config::Rotate90); +#ifndef LIBRETRO deviceContext->OMSetRenderTargets(1, &theDX11Context.getRenderTarget().get(), nullptr); - +#else + ID3D11RenderTargetView *nullView = nullptr; + deviceContext->OMSetRenderTargets(1, &nullView, nullptr); +#endif D3D11_TEXTURE2D_DESC desc; dstTex->GetDesc(&desc); desc.Usage = D3D11_USAGE_STAGING; diff --git a/shell/switch/switch_main.cpp b/shell/switch/switch_main.cpp index ffc102655..2d710796a 100644 --- a/shell/switch/switch_main.cpp +++ b/shell/switch/switch_main.cpp @@ -21,6 +21,8 @@ #include "emulator.h" #include "ui/mainui.h" #include "oslib/directory.h" +#include +#include int main(int argc, char *argv[]) { @@ -58,4 +60,13 @@ void os_DoEvents() { } +namespace hostfs +{ + +void saveScreenshot(const std::string& name, const std::vector& data) +{ + throw FlycastException("Not supported on Switch"); +} + +} #endif //!LIBRETRO