Merge branch 'update' of https://github.com/digant73/rpcs3 into update

This commit is contained in:
digant 2024-12-19 21:04:27 +01:00
commit 0f5dbdb374
8 changed files with 21 additions and 20 deletions

View file

@ -956,9 +956,10 @@ static inline void pos_to_gem_state(u32 gem_num, gem_config::gem_controller& con
static constexpr f32 PI = 3.14159265f;
const auto degree_to_rad = [](f32 degree) -> f32 { return degree * PI / 180.0f; };
const f32 max_angle_per_side = g_cfg.io.fake_move_rotation_cone / 2.0f;
const f32 roll = -degree_to_rad((image_y - half_height) / half_height * max_angle_per_side); // This is actually the pitch
const f32 pitch = -degree_to_rad((image_x - half_width) / half_width * max_angle_per_side); // This is actually the yaw
const f32 max_angle_per_side_h = g_cfg.io.fake_move_rotation_cone_h / 2.0f;
const f32 max_angle_per_side_v = g_cfg.io.fake_move_rotation_cone_v / 2.0f;
const f32 roll = -degree_to_rad((image_y - half_height) / half_height * max_angle_per_side_v); // This is actually the pitch
const f32 pitch = -degree_to_rad((image_x - half_width) / half_width * max_angle_per_side_h); // This is actually the yaw
const f32 yaw = degree_to_rad(0.0f);
const f32 cr = std::cos(roll * 0.5f);
const f32 sr = std::sin(roll * 0.5f);

View file

@ -83,7 +83,8 @@ namespace rsx
add_dropdown(&g_cfg.io.pad_mode, localized_string_id::HOME_MENU_SETTINGS_INPUT_PAD_MODE);
add_unsigned_slider(&g_cfg.io.pad_sleep, localized_string_id::HOME_MENU_SETTINGS_INPUT_PAD_SLEEP, " µs", 100);
add_unsigned_slider(&g_cfg.io.fake_move_rotation_cone, localized_string_id::HOME_MENU_SETTINGS_INPUT_FAKE_MOVE_ROTATION_CONE, "°", 1);
add_unsigned_slider(&g_cfg.io.fake_move_rotation_cone_h, localized_string_id::HOME_MENU_SETTINGS_INPUT_FAKE_MOVE_ROTATION_CONE_H, "°", 1);
add_unsigned_slider(&g_cfg.io.fake_move_rotation_cone_v, localized_string_id::HOME_MENU_SETTINGS_INPUT_FAKE_MOVE_ROTATION_CONE_V, "°", 1);
apply_layout();
}

View file

@ -223,7 +223,8 @@ enum class localized_string_id
HOME_MENU_SETTINGS_INPUT_CAMERA_FLIP,
HOME_MENU_SETTINGS_INPUT_PAD_MODE,
HOME_MENU_SETTINGS_INPUT_PAD_SLEEP,
HOME_MENU_SETTINGS_INPUT_FAKE_MOVE_ROTATION_CONE,
HOME_MENU_SETTINGS_INPUT_FAKE_MOVE_ROTATION_CONE_H,
HOME_MENU_SETTINGS_INPUT_FAKE_MOVE_ROTATION_CONE_V,
HOME_MENU_SETTINGS_ADVANCED,
HOME_MENU_SETTINGS_ADVANCED_PREFERRED_SPU_THREADS,
HOME_MENU_SETTINGS_ADVANCED_MAX_CPU_PREEMPTIONS,

View file

@ -283,7 +283,8 @@ struct cfg_root : cfg::node
cfg::string midi_devices{this, "Emulated Midi devices", "ßßß@@@ßßß@@@ßßß@@@"};
cfg::_bool load_sdl_mappings{ this, "Load SDL GameController Mappings", true };
cfg::_bool debug_overlay{ this, "IO Debug overlay", false, true };
cfg::uint<1, 180> fake_move_rotation_cone{ this, "Fake Move Rotation Cone", 10, true };
cfg::uint<1, 180> fake_move_rotation_cone_h{ this, "Fake Move Rotation Cone", 10, true };
cfg::uint<1, 180> fake_move_rotation_cone_v{ this, "Fake Move Rotation Cone (Vertical)", 10, true };
} io{ this };

View file

@ -79,7 +79,8 @@ flow_layout::~flow_layout()
void flow_layout::clear()
{
for (QLayoutItem* item : m_item_list)
// We can't use a ranged loop here, since deleting the widget will call takeAt on the layout. So let's also use takeAt.
while (QLayoutItem* item = takeAt(0))
{
if (item)
{

View file

@ -244,7 +244,8 @@ private:
case localized_string_id::HOME_MENU_SETTINGS_INPUT_CAMERA_FLIP: return tr("Camera Flip", "Input");
case localized_string_id::HOME_MENU_SETTINGS_INPUT_PAD_MODE: return tr("Pad Handler Mode", "Input");
case localized_string_id::HOME_MENU_SETTINGS_INPUT_PAD_SLEEP: return tr("Pad Handler Sleep", "Input");
case localized_string_id::HOME_MENU_SETTINGS_INPUT_FAKE_MOVE_ROTATION_CONE: return tr("Fake PS Move Rotation Cone", "Input");
case localized_string_id::HOME_MENU_SETTINGS_INPUT_FAKE_MOVE_ROTATION_CONE_H: return tr("Fake PS Move Rotation Cone (Horizontal)", "Input");
case localized_string_id::HOME_MENU_SETTINGS_INPUT_FAKE_MOVE_ROTATION_CONE_V: return tr("Fake PS Move Rotation Cone (Vertical)", "Input");
case localized_string_id::HOME_MENU_SETTINGS_ADVANCED: return tr("Advanced");
case localized_string_id::HOME_MENU_SETTINGS_ADVANCED_PREFERRED_SPU_THREADS: return tr("Preferred SPU Threads", "Advanced");
case localized_string_id::HOME_MENU_SETTINGS_ADVANCED_MAX_CPU_PREEMPTIONS: return tr("Max Power Saving CPU-Preemptions", "Advanced");

View file

@ -94,7 +94,7 @@ void remove_item(QComboBox* box, int data_value, int def_value)
extern const std::map<std::string_view, int> g_prx_list;
settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std::shared_ptr<emu_settings> emu_settings, const int& tab_index, QWidget* parent, const GameInfo* game, bool create_cfg_from_global_cfg)
settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std::shared_ptr<emu_settings> emu_settings, int tab_index, QWidget* parent, const GameInfo* game, bool create_cfg_from_global_cfg)
: QDialog(parent)
, m_tab_index(tab_index)
, ui(new Ui::settings_dialog)
@ -2607,14 +2607,11 @@ void settings_dialog::ApplyStylesheet(bool reset)
}
}
int settings_dialog::exec()
void settings_dialog::open()
{
// singleShot Hack to fix following bug:
// If we use setCurrentIndex now we will miraculously see a resize of the dialog as soon as we
// switch to the cpu tab after conjuring the settings_dialog with another tab opened first.
// Weirdly enough this won't happen if we change the tab order so that anything else is at index 0.
ui->tab_widget_settings->setCurrentIndex(0);
QTimer::singleShot(0, [this]{ ui->tab_widget_settings->setCurrentIndex(m_tab_index); });
QDialog::open();
ui->tab_widget_settings->setCurrentIndex(m_tab_index);
// Open a dialog if your config file contained invalid entries
QTimer::singleShot(10, [this]
@ -2640,8 +2637,6 @@ int settings_dialog::exec()
}
}
});
return QDialog::exec();
}
void settings_dialog::SubscribeDescription(QLabel* description)

View file

@ -21,9 +21,9 @@ class settings_dialog : public QDialog
Q_OBJECT
public:
explicit settings_dialog(std::shared_ptr<gui_settings> gui_settings, std::shared_ptr<emu_settings> emu_settings, const int& tab_index = 0, QWidget* parent = nullptr, const GameInfo* game = nullptr, bool create_cfg_from_global_cfg = true);
explicit settings_dialog(std::shared_ptr<gui_settings> gui_settings, std::shared_ptr<emu_settings> emu_settings, int tab_index = 0, QWidget* parent = nullptr, const GameInfo* game = nullptr, bool create_cfg_from_global_cfg = true);
~settings_dialog();
int exec() override;
void open() override;
Q_SIGNALS:
void GuiStylesheetRequest();
void GuiRepaintRequest();