mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-15 03:08:36 +12:00
fix automoc in sdl-less builds
This commit is contained in:
parent
2ef13ce54a
commit
4d89be9ce7
2 changed files with 27 additions and 17 deletions
|
@ -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<int16_t> axes;
|
||||
std::vector<bool> buttons;
|
||||
std::vector<hat_component> 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<SDL_Joystick*>(joystick_handle));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -839,7 +832,7 @@ const std::map<uint32_t, joystick_state>& emulated_logitech_g27_settings_dialog:
|
|||
int joystick_count;
|
||||
SDL_JoystickID* joystick_ids = SDL_GetJoysticks(&joystick_count);
|
||||
|
||||
std::vector<SDL_Joystick*> new_joystick_handles;
|
||||
std::vector<void*> new_joystick_handles;
|
||||
|
||||
if (joystick_ids != nullptr)
|
||||
{
|
||||
|
@ -900,7 +893,7 @@ const std::map<uint32_t, joystick_state>& emulated_logitech_g27_settings_dialog:
|
|||
for (auto joystick_handle : m_joystick_handles)
|
||||
{
|
||||
if (joystick_handle)
|
||||
SDL_CloseJoystick(joystick_handle);
|
||||
SDL_CloseJoystick(reinterpret_cast<SDL_Joystick*>(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
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include <QCheckBox>
|
||||
#include <QScrollArea>
|
||||
|
||||
#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 <map>
|
||||
#include <vector>
|
||||
#include <Emu/Io/LogitechG27Config.h>
|
||||
|
||||
struct joystick_state;
|
||||
struct joystick_state
|
||||
{
|
||||
std::vector<int16_t> axes;
|
||||
std::vector<bool> buttons;
|
||||
std::vector<hat_component> 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<uint32_t, joystick_state> m_last_joystick_states;
|
||||
std::vector<SDL_Joystick*> m_joystick_handles;
|
||||
// hack: need a completed dummy class when linking automoc generated with sdl-less build
|
||||
std::vector<void*> 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();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue