diff --git a/rpcs3/rpcs3qt/emulated_logitech_g27_settings_dialog.cpp b/rpcs3/rpcs3qt/emulated_logitech_g27_settings_dialog.cpp index e859064f0c..bb95ed9a0b 100644 --- a/rpcs3/rpcs3qt/emulated_logitech_g27_settings_dialog.cpp +++ b/rpcs3/rpcs3qt/emulated_logitech_g27_settings_dialog.cpp @@ -1,7 +1,7 @@ -#ifdef HAVE_SDL3 - #include "stdafx.h" +#ifdef HAVE_SDL3 + #include "emulated_logitech_g27_settings_dialog.h" #include "Emu/Io/LogitechG27.cpp" #include "Input/sdl_instance.h" @@ -21,13 +21,6 @@ LOG_CHANNEL(logitech_g27_cfg_log, "LOGIG27"); static constexpr const char* DEFAULT_STATUS = " "; -struct joystick_state -{ - std::vector axes; - std::vector buttons; - std::vector hats; -}; - enum mapping_device_choice { CHOICE_NONE = -1, @@ -787,7 +780,7 @@ emulated_logitech_g27_settings_dialog::~emulated_logitech_g27_settings_dialog() for (auto joystick_handle : m_joystick_handles) { if (joystick_handle) - SDL_CloseJoystick(joystick_handle); + SDL_CloseJoystick(reinterpret_cast(joystick_handle)); } } @@ -839,7 +832,7 @@ const std::map& emulated_logitech_g27_settings_dialog: int joystick_count; SDL_JoystickID* joystick_ids = SDL_GetJoysticks(&joystick_count); - std::vector new_joystick_handles; + std::vector new_joystick_handles; if (joystick_ids != nullptr) { @@ -900,7 +893,7 @@ const std::map& emulated_logitech_g27_settings_dialog: for (auto joystick_handle : m_joystick_handles) { if (joystick_handle) - SDL_CloseJoystick(joystick_handle); + SDL_CloseJoystick(reinterpret_cast(joystick_handle)); } m_joystick_handles = new_joystick_handles; @@ -967,4 +960,13 @@ void emulated_logitech_g27_settings_dialog::set_enable(bool enable) m_mapping_scroll_area->verticalScrollBar()->setSliderPosition(slider_position); } +#else + +// minimal symbols for sdl-less builds automoc +#include "emulated_logitech_g27_settings_dialog.h" + +emulated_logitech_g27_settings_dialog::emulated_logitech_g27_settings_dialog(QWidget* parent) + : QDialog(parent) {} +emulated_logitech_g27_settings_dialog::~emulated_logitech_g27_settings_dialog() {}; + #endif diff --git a/rpcs3/rpcs3qt/emulated_logitech_g27_settings_dialog.h b/rpcs3/rpcs3qt/emulated_logitech_g27_settings_dialog.h index f0314c30db..ef28f2eff7 100644 --- a/rpcs3/rpcs3qt/emulated_logitech_g27_settings_dialog.h +++ b/rpcs3/rpcs3qt/emulated_logitech_g27_settings_dialog.h @@ -5,6 +5,7 @@ #include #include +#ifdef HAVE_SDL3 #ifndef _MSC_VER #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wold-style-cast" @@ -13,12 +14,18 @@ #ifndef _MSC_VER #pragma GCC diagnostic pop #endif +#endif #include #include #include -struct joystick_state; +struct joystick_state +{ + std::vector axes; + std::vector buttons; + std::vector hats; +}; class Mapping; class DeviceChoice; @@ -35,11 +42,9 @@ public: void set_enable(bool enable); private: - void load_ui_state_from_config(); - void save_ui_state_to_config(); - std::map m_last_joystick_states; - std::vector m_joystick_handles; + // hack: need a completed dummy class when linking automoc generated with sdl-less build + std::vector m_joystick_handles; uint64_t m_last_joystick_states_update = 0; bool m_sdl_initialized = false; @@ -92,4 +97,7 @@ private: DeviceChoice* m_led_device = nullptr; QScrollArea* m_mapping_scroll_area = nullptr; + + void load_ui_state_from_config(); + void save_ui_state_to_config(); };