diff options
| author | 2021-08-12 22:27:17 +0200 | |
|---|---|---|
| committer | 2021-08-12 22:27:17 +0200 | |
| commit | 78a82495931e8c6b2161f79d2ac00ea88baea4f2 (patch) | |
| tree | 94480efdcd09a71e676782434a44d124002f835a /src/yuzu_cmd | |
| parent | network: correct formatting in network.cpp and network_interface.cpp (diff) | |
| parent | Merge pull request #6838 from ameerj/sws-align (diff) | |
| download | yuzu-78a82495931e8c6b2161f79d2ac00ea88baea4f2.tar.gz yuzu-78a82495931e8c6b2161f79d2ac00ea88baea4f2.tar.xz yuzu-78a82495931e8c6b2161f79d2ac00ea88baea4f2.zip | |
Merge branch 'yuzu-emu:master' into fix-lan-play
Diffstat (limited to 'src/yuzu_cmd')
| -rw-r--r-- | src/yuzu_cmd/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | 5 | ||||
| -rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2.h | 3 | ||||
| -rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp | 1 | ||||
| -rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp | 1 |
5 files changed, 11 insertions, 0 deletions
diff --git a/src/yuzu_cmd/CMakeLists.txt b/src/yuzu_cmd/CMakeLists.txt index e55a19649..74fc24972 100644 --- a/src/yuzu_cmd/CMakeLists.txt +++ b/src/yuzu_cmd/CMakeLists.txt | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules) | 1 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules) |
| 2 | 2 | ||
| 3 | # Credits to Samantas5855 and others for this function. | ||
| 3 | function(create_resource file output filename) | 4 | function(create_resource file output filename) |
| 4 | # Read hex data from file | 5 | # Read hex data from file |
| 5 | file(READ ${file} filedata HEX) | 6 | file(READ ${file} filedata HEX) |
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp index f643a4b0b..87fce0c23 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | |||
| @@ -122,6 +122,10 @@ void EmuWindow_SDL2::OnResize() { | |||
| 122 | UpdateCurrentFramebufferLayout(width, height); | 122 | UpdateCurrentFramebufferLayout(width, height); |
| 123 | } | 123 | } |
| 124 | 124 | ||
| 125 | void EmuWindow_SDL2::ShowCursor(bool show_cursor) { | ||
| 126 | SDL_ShowCursor(show_cursor ? SDL_ENABLE : SDL_DISABLE); | ||
| 127 | } | ||
| 128 | |||
| 125 | void EmuWindow_SDL2::Fullscreen() { | 129 | void EmuWindow_SDL2::Fullscreen() { |
| 126 | switch (Settings::values.fullscreen_mode.GetValue()) { | 130 | switch (Settings::values.fullscreen_mode.GetValue()) { |
| 127 | case Settings::FullscreenMode::Exclusive: | 131 | case Settings::FullscreenMode::Exclusive: |
| @@ -228,6 +232,7 @@ void EmuWindow_SDL2::WaitEvent() { | |||
| 228 | } | 232 | } |
| 229 | } | 233 | } |
| 230 | 234 | ||
| 235 | // Credits to Samantas5855 and others for this function. | ||
| 231 | void EmuWindow_SDL2::SetWindowIcon() { | 236 | void EmuWindow_SDL2::SetWindowIcon() { |
| 232 | SDL_RWops* const yuzu_icon_stream = SDL_RWFromConstMem((void*)yuzu_icon, yuzu_icon_size); | 237 | SDL_RWops* const yuzu_icon_stream = SDL_RWFromConstMem((void*)yuzu_icon, yuzu_icon_size); |
| 233 | if (yuzu_icon_stream == nullptr) { | 238 | if (yuzu_icon_stream == nullptr) { |
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.h b/src/yuzu_cmd/emu_window/emu_window_sdl2.h index aa0d52ae4..4810f8775 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2.h +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.h | |||
| @@ -67,6 +67,9 @@ protected: | |||
| 67 | /// Called by WaitEvent when any event that may cause the window to be resized occurs | 67 | /// Called by WaitEvent when any event that may cause the window to be resized occurs |
| 68 | void OnResize(); | 68 | void OnResize(); |
| 69 | 69 | ||
| 70 | /// Called when users want to hide the mouse cursor | ||
| 71 | void ShowCursor(bool show_cursor); | ||
| 72 | |||
| 70 | /// Called when user passes the fullscreen parameter flag | 73 | /// Called when user passes the fullscreen parameter flag |
| 71 | void Fullscreen(); | 74 | void Fullscreen(); |
| 72 | 75 | ||
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp index 5b98c255b..a075ad08a 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp | |||
| @@ -111,6 +111,7 @@ EmuWindow_SDL2_GL::EmuWindow_SDL2_GL(InputCommon::InputSubsystem* input_subsyste | |||
| 111 | 111 | ||
| 112 | if (fullscreen) { | 112 | if (fullscreen) { |
| 113 | Fullscreen(); | 113 | Fullscreen(); |
| 114 | ShowCursor(false); | ||
| 114 | } | 115 | } |
| 115 | 116 | ||
| 116 | window_context = SDL_GL_CreateContext(render_window); | 117 | window_context = SDL_GL_CreateContext(render_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 cdda375d8..de40b76bf 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp | |||
| @@ -45,6 +45,7 @@ EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsyste | |||
| 45 | 45 | ||
| 46 | if (fullscreen) { | 46 | if (fullscreen) { |
| 47 | Fullscreen(); | 47 | Fullscreen(); |
| 48 | ShowCursor(false); | ||
| 48 | } | 49 | } |
| 49 | 50 | ||
| 50 | switch (wm.subsystem) { | 51 | switch (wm.subsystem) { |