From 019bdb307da64f87c5444f3ea640071e3a4ef12f Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Wed, 21 Jul 2021 23:32:59 +0200 Subject: [PATCH] early-access version 1906 --- README.md | 2 +- src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | 12 ++++++------ src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp | 6 +++++- src/yuzu_cmd/emu_window/emu_window_sdl2_vk.h | 2 +- src/yuzu_cmd/yuzu.cpp | 2 +- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 631425ba1..c620dc988 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 1905. +This is the source code for early-access 1906. ## Legal Notice diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp index 896181f0b..8dfc09393 100755 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp @@ -122,12 +122,6 @@ void EmuWindow_SDL2::OnResize() { } void EmuWindow_SDL2::Fullscreen() { - if (SDL_SetWindowFullscreen(render_window, SDL_WINDOW_FULLSCREEN) == 0) { - return; - } - - LOG_ERROR(Frontend, "Fullscreening failed: {}", SDL_GetError()); - // Try a different fullscreening method LOG_INFO(Frontend, "Attempting to use borderless fullscreen..."); if (SDL_SetWindowFullscreen(render_window, SDL_WINDOW_FULLSCREEN_DESKTOP) == 0) { @@ -136,6 +130,12 @@ void EmuWindow_SDL2::Fullscreen() { LOG_ERROR(Frontend, "Borderless fullscreening failed: {}", SDL_GetError()); + if (SDL_SetWindowFullscreen(render_window, SDL_WINDOW_FULLSCREEN) == 0) { + return; + } + + LOG_ERROR(Frontend, "Fullscreening failed: {}", SDL_GetError()); + // Fallback algorithm: Maximise window. // Works on all systems (unless something is seriously wrong), so no fallback for this one. LOG_INFO(Frontend, "Falling back on a maximised window..."); diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp index 152e56db8..d1473dbab 100755 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp @@ -24,7 +24,7 @@ #include #include -EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem) +EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem, bool fullscreen) : EmuWindow_SDL2{input_subsystem} { const std::string window_title = fmt::format("yuzu {} | {}-{} (Vulkan)", Common::g_build_name, Common::g_scm_branch, Common::g_scm_desc); @@ -42,6 +42,10 @@ EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsyste SetWindowIcon(); + if (fullscreen) { + Fullscreen(); + } + switch (wm.subsystem) { #ifdef SDL_VIDEO_DRIVER_WINDOWS case SDL_SYSWM_TYPE::SDL_SYSWM_WINDOWS: diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.h b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.h index bdfdc3c6f..de53844f0 100755 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.h +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.h @@ -19,7 +19,7 @@ class InputSubsystem; class EmuWindow_SDL2_VK final : public EmuWindow_SDL2 { public: - explicit EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem); + explicit EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem, bool fullscreen); ~EmuWindow_SDL2_VK() override; std::unique_ptr CreateSharedContext() const override; diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index f46731a33..35ce23696 100755 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp @@ -175,7 +175,7 @@ int main(int argc, char** argv) { emu_window = std::make_unique(&input_subsystem, fullscreen); break; case Settings::RendererBackend::Vulkan: - emu_window = std::make_unique(&input_subsystem); + emu_window = std::make_unique(&input_subsystem, fullscreen); break; }