Update common_host_interface.cpp

This commit is contained in:
Connor McLaughlin 2021-04-18 13:52:17 +10:00 committed by GitHub
parent b0bd4b8cfe
commit 64bd840195
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,7 +35,6 @@
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
#include <ctime> #include <ctime>
#include "fullscreen_ui.h"
#ifdef WITH_SDL2 #ifdef WITH_SDL2
#include "sdl_audio_stream.h" #include "sdl_audio_stream.h"
@ -55,7 +54,6 @@
#include <ShlObj.h> #include <ShlObj.h>
#include <mmsystem.h> #include <mmsystem.h>
#endif #endif
#include <frontend-common/imgui_fullscreen.cpp>
Log_SetChannel(CommonHostInterface); Log_SetChannel(CommonHostInterface);
@ -1873,12 +1871,12 @@ void CommonHostInterface::RegisterGeneralHotkeys()
RegisterHotkey(StaticString(TRANSLATABLE("Hotkeys", "General")), StaticString("ChangeDisc"), RegisterHotkey(StaticString(TRANSLATABLE("Hotkeys", "General")), StaticString("ChangeDisc"),
StaticString(TRANSLATABLE("Hotkeys", "ChangeDisc")), [this](bool pressed) { StaticString(TRANSLATABLE("Hotkeys", "ChangeDisc")), [this](bool pressed) {
if (pressed && System::IsValid()) if (pressed && System::IsValid() && System::HasMediaSubImages())
{ {
int current = System::GetMediaSubImageIndex(); const u32 current = System::GetMediaSubImageIndex();
int next = (current + 1) % System::GetMediaSubImageCount(); const u32 next = (current + 1) % System::GetMediaSubImageCount();
if (current != next) if (current != next)
System::SwitchMediaSubImage(static_cast<u32>(next)); System::SwitchMediaSubImage(next);
} }
}); });