mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-09-08 05:02:40 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| eb070d817d | |||
| 2df82bd21b | |||
| a944f93f26 | |||
| 74ccea3def |
+1
@@ -83,6 +83,7 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting {
|
||||
SHOW_SHADERS_BUILDING("show_shaders_building"),
|
||||
|
||||
DEBUG_FLUSH_BY_LINE("flush_line"),
|
||||
EXTENDED_LOGGING("extended_logging"),
|
||||
DONT_SHOW_DRIVER_SHADER_WARNING("dont_show_driver_shader_warning"),
|
||||
ENABLE_OVERLAY("enable_overlay"),
|
||||
|
||||
|
||||
+7
@@ -262,6 +262,13 @@ abstract class SettingsItem(
|
||||
descriptionId = R.string.flush_by_line_description
|
||||
)
|
||||
)
|
||||
put(
|
||||
SwitchSetting(
|
||||
BooleanSetting.EXTENDED_LOGGING,
|
||||
titleId = R.string.extended_logging,
|
||||
descriptionId = R.string.extended_logging_description
|
||||
)
|
||||
)
|
||||
|
||||
val dockedModeSetting = object : AbstractBooleanSetting {
|
||||
override val key = BooleanSetting.USE_DOCKED_MODE.key
|
||||
|
||||
+1
@@ -1323,6 +1323,7 @@ class SettingsFragmentPresenter(
|
||||
add(HeaderSetting(R.string.log))
|
||||
|
||||
add(BooleanSetting.DEBUG_FLUSH_BY_LINE.key)
|
||||
add(BooleanSetting.EXTENDED_LOGGING.key)
|
||||
add(StringSetting.LOG_FILTER.key)
|
||||
}
|
||||
|
||||
|
||||
@@ -636,6 +636,8 @@
|
||||
<string name="log">Logging</string>
|
||||
<string name="flush_by_line">Flush debug logs by line</string>
|
||||
<string name="flush_by_line_description">Flushes debugging logs on each line written, making debugging easier in cases of crashing or freezing.</string>
|
||||
<string name="extended_logging">Enable extended logging</string>
|
||||
<string name="extended_logging_description">Increases the maximum log file size from 100 MiB to 1 GiB.</string>
|
||||
<string name="log_filter">Log filter</string>
|
||||
<string name="log_filter_description">Controls Eden\'s log categories. Example: *:Info Service.LM:Debug</string>
|
||||
|
||||
|
||||
@@ -711,8 +711,6 @@ add_library(core STATIC
|
||||
hle/service/kernel_helpers.h
|
||||
hle/service/lbl/lbl.cpp
|
||||
hle/service/lbl/lbl.h
|
||||
hle/service/ldn/client_process_monitor.cpp
|
||||
hle/service/ldn/client_process_monitor.h
|
||||
hle/service/ldn/lan_discovery.cpp
|
||||
hle/service/ldn/lan_discovery.h
|
||||
hle/service/ldn/ldn.cpp
|
||||
@@ -832,8 +830,6 @@ add_library(core STATIC
|
||||
hle/service/ns/system_update_control.h
|
||||
hle/service/ns/system_update_interface.cpp
|
||||
hle/service/ns/system_update_interface.h
|
||||
hle/service/ns/vulnerability_manager_interface.cpp
|
||||
hle/service/ns/vulnerability_manager_interface.h
|
||||
hle/service/nvdrv/core/container.cpp
|
||||
hle/service/nvdrv/core/container.h
|
||||
hle/service/nvdrv/core/heap_mapper.cpp
|
||||
@@ -1067,8 +1063,6 @@ add_library(core STATIC
|
||||
hle/service/sockets/sockets.h
|
||||
hle/service/sockets/sockets_translate.cpp
|
||||
hle/service/sockets/sockets_translate.h
|
||||
hle/service/spl/csrng.cpp
|
||||
hle/service/spl/csrng.h
|
||||
hle/service/spl/spl.cpp
|
||||
hle/service/spl/spl.h
|
||||
hle/service/spl/spl_module.cpp
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -121,6 +124,7 @@ size_t HierarchicalIntegrityVerificationStorage::Read(u8* buffer, size_t size,
|
||||
}
|
||||
|
||||
size_t HierarchicalIntegrityVerificationStorage::GetSize() const {
|
||||
ASSERT(m_data_size >= 0);
|
||||
return m_data_size;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -26,17 +29,14 @@ IStorage::~IStorage() = default;
|
||||
|
||||
Result IStorage::Open(Out<SharedPointer<IStorageAccessor>> out_storage_accessor) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
R_UNLESS(m_impl->GetHandle() == nullptr, AM::ResultInvalidStorageType);
|
||||
|
||||
*out_storage_accessor = std::make_shared<IStorageAccessor>(system, m_impl);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IStorage::OpenTransferStorage(
|
||||
Out<SharedPointer<ITransferStorageAccessor>> out_transfer_storage_accessor) {
|
||||
Result IStorage::OpenTransferStorage(Out<SharedPointer<ITransferStorageAccessor>> out_transfer_storage_accessor) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
R_UNLESS(m_impl->GetHandle() != nullptr, AM::ResultInvalidStorageType);
|
||||
|
||||
*out_transfer_storage_accessor = std::make_shared<ITransferStorageAccessor>(system, m_impl);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "core/hle/service/cmif_serialization.h"
|
||||
#include "core/hle/service/ldn/ldn_results.h"
|
||||
#include "core/hle/service/ldn/client_process_monitor.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
|
||||
namespace Service::LDN {
|
||||
|
||||
IClientProcessMonitor::IClientProcessMonitor(Core::System& system_)
|
||||
: ServiceFramework{system_, "IClientProcessMonitor"} {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, D<&IClientProcessMonitor::RegisterClient>, "RegisterClient"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
IClientProcessMonitor::~IClientProcessMonitor() = default;
|
||||
|
||||
Result IClientProcessMonitor::RegisterClient() {
|
||||
LOG_WARNING(Service_LDN, "(STUBBED) called");
|
||||
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
} // namespace Service::LDN
|
||||
@@ -1,25 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/cmif_types.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::LDN {
|
||||
|
||||
class IClientProcessMonitor final
|
||||
: public ServiceFramework<IClientProcessMonitor> {
|
||||
public:
|
||||
explicit IClientProcessMonitor(Core::System& system_);
|
||||
~IClientProcessMonitor() override;
|
||||
|
||||
private:
|
||||
Result RegisterClient();
|
||||
};
|
||||
|
||||
} // namespace Service::LDN
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
@@ -7,7 +7,6 @@
|
||||
#include "core/core.h"
|
||||
#include "core/hle/service/cmif_serialization.h"
|
||||
#include "core/hle/service/ldn/ldn.h"
|
||||
#include "core/hle/service/ldn/client_process_monitor.h"
|
||||
#include "core/hle/service/ldn/monitor_service.h"
|
||||
#include "core/hle/service/ldn/sf_monitor_service.h"
|
||||
#include "core/hle/service/ldn/sf_service.h"
|
||||
@@ -17,6 +16,26 @@
|
||||
|
||||
namespace Service::LDN {
|
||||
|
||||
class IClientProcessMonitor final
|
||||
: public ServiceFramework<IClientProcessMonitor> {
|
||||
public:
|
||||
explicit IClientProcessMonitor(Core::System& system_)
|
||||
: ServiceFramework{system_, "IClientProcessMonitor"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, D<&IClientProcessMonitor::RegisterClient>, "RegisterClient"},
|
||||
};
|
||||
// clang-format on
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
~IClientProcessMonitor() override = default;
|
||||
private:
|
||||
Result RegisterClient(ClientProcessId pid) {
|
||||
LOG_WARNING(Service_LDN, "(STUBBED) called");
|
||||
R_SUCCEED();
|
||||
}
|
||||
};
|
||||
|
||||
class IMonitorServiceCreator final : public ServiceFramework<IMonitorServiceCreator> {
|
||||
public:
|
||||
explicit IMonitorServiceCreator(Core::System& system_) : ServiceFramework{system_, "ldn:m"} {
|
||||
@@ -25,7 +44,6 @@ public:
|
||||
{0, C<&IMonitorServiceCreator::CreateMonitorService>, "CreateMonitorService"}
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
#include "core/hle/service/ns/query_service.h"
|
||||
#include "core/hle/service/ns/service_getter_interface.h"
|
||||
#include "core/hle/service/ns/system_update_interface.h"
|
||||
#include "core/hle/service/ns/vulnerability_manager_interface.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
#include "core/hle/service/cmif_serialization.h"
|
||||
#include "core/hle/service/cmif_types.h"
|
||||
#include "core/hle/service/server_manager.h"
|
||||
|
||||
namespace Service::NS {
|
||||
@@ -39,6 +41,43 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class IVulnerabilityManagerInterface final
|
||||
: public ServiceFramework<IVulnerabilityManagerInterface> {
|
||||
public:
|
||||
explicit IVulnerabilityManagerInterface(Core::System& system_)
|
||||
: ServiceFramework{system_, "ns:vm"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{1200, D<&IVulnerabilityManagerInterface::NeedsUpdateVulnerability>, "NeedsUpdateVulnerability"},
|
||||
{1201, nullptr, "UpdateSafeSystemVersionForDebug"},
|
||||
{1202, nullptr, "GetSafeSystemVersion"},
|
||||
{3100, D<&IVulnerabilityManagerInterface::GetSafeSystemVersionCheckInfo>, "GetSafeSystemVersionCheckInfo"},
|
||||
{3101, nullptr, "RequestUpdateSafeSystemVersionCheckInfo"},
|
||||
{3102, D<&IVulnerabilityManagerInterface::ResetSafeSystemVersionCheckInfo>, "ResetSafeSystemVersionCheckInfo"},
|
||||
};
|
||||
// clang-format on
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
~IVulnerabilityManagerInterface() override = default;
|
||||
|
||||
Result NeedsUpdateVulnerability(Out<bool> out_needs_update_vulnerability) {
|
||||
LOG_WARNING(Service_NS, "(STUBBED)");
|
||||
*out_needs_update_vulnerability = false;
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result GetSafeSystemVersionCheckInfo(Out<std::array<u8, 0x20>> out_system_version_check_info) {
|
||||
LOG_WARNING(Service_NS, "(STUBBED)");
|
||||
*out_system_version_check_info = {};
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ResetSafeSystemVersionCheckInfo() {
|
||||
LOG_WARNING(Service_NS, "(STUBBED)");
|
||||
R_SUCCEED();
|
||||
}
|
||||
};
|
||||
|
||||
void LoopProcess(Core::System& system) {
|
||||
auto server_manager = std::make_unique<ServerManager>(system);
|
||||
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/hle/service/cmif_serialization.h"
|
||||
#include "core/hle/service/ns/vulnerability_manager_interface.h"
|
||||
|
||||
namespace Service::NS {
|
||||
|
||||
IVulnerabilityManagerInterface::IVulnerabilityManagerInterface(Core::System& system_)
|
||||
: ServiceFramework{system_, "ns:vm"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{1200, D<&IVulnerabilityManagerInterface::NeedsUpdateVulnerability>, "NeedsUpdateVulnerability"},
|
||||
{1201, nullptr, "UpdateSafeSystemVersionForDebug"},
|
||||
{1202, nullptr, "GetSafeSystemVersion"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
IVulnerabilityManagerInterface::~IVulnerabilityManagerInterface() = default;
|
||||
|
||||
Result IVulnerabilityManagerInterface::NeedsUpdateVulnerability(
|
||||
Out<bool> out_needs_update_vulnerability) {
|
||||
LOG_WARNING(Service_NS, "(STUBBED) called");
|
||||
*out_needs_update_vulnerability = false;
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
} // namespace Service::NS
|
||||
@@ -1,21 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/cmif_types.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Service::NS {
|
||||
|
||||
class IVulnerabilityManagerInterface final
|
||||
: public ServiceFramework<IVulnerabilityManagerInterface> {
|
||||
public:
|
||||
explicit IVulnerabilityManagerInterface(Core::System& system_);
|
||||
~IVulnerabilityManagerInterface() override;
|
||||
|
||||
private:
|
||||
Result NeedsUpdateVulnerability(Out<bool> out_needs_update_vulnerability);
|
||||
};
|
||||
|
||||
} // namespace Service::NS
|
||||
@@ -1,18 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/hle/service/spl/csrng.h"
|
||||
|
||||
namespace Service::SPL {
|
||||
|
||||
CSRNG::CSRNG(Core::System& system_, std::shared_ptr<Module> module_)
|
||||
: Interface(system_, std::move(module_), "csrng") {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &CSRNG::GenerateRandomBytes, "GenerateRandomBytes"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
CSRNG::~CSRNG() = default;
|
||||
|
||||
} // namespace Service::SPL
|
||||
@@ -1,20 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/spl/spl_module.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::SPL {
|
||||
|
||||
class CSRNG final : public Module::Interface {
|
||||
public:
|
||||
explicit CSRNG(Core::System& system_, std::shared_ptr<Module> module_);
|
||||
~CSRNG() override;
|
||||
};
|
||||
|
||||
} // namespace Service::SPL
|
||||
@@ -13,7 +13,6 @@
|
||||
#include "core/hle/api_version.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
#include "core/hle/service/server_manager.h"
|
||||
#include "core/hle/service/spl/csrng.h"
|
||||
#include "core/hle/service/spl/spl.h"
|
||||
#include "core/hle/service/spl/spl_module.h"
|
||||
|
||||
@@ -203,6 +202,18 @@ Result Module::Interface::GetConfigImpl(u64* out_config, ConfigItem config_item)
|
||||
}
|
||||
}
|
||||
|
||||
class CSRNG final : public Module::Interface {
|
||||
public:
|
||||
explicit CSRNG(Core::System& system_, std::shared_ptr<Module> module_)
|
||||
: Interface(system_, std::move(module_), "csrng") {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &CSRNG::GenerateRandomBytes, "GenerateRandomBytes"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
~CSRNG() override = default;
|
||||
};
|
||||
|
||||
void LoopProcess(Core::System& system) {
|
||||
auto server_manager = std::make_unique<ServerManager>(system);
|
||||
auto module = std::make_shared<Module>();
|
||||
|
||||
@@ -4,16 +4,17 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
#include <fmt/ranges.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "common/param_package.h"
|
||||
#include "common/settings.h"
|
||||
#include "common/steady_clock.h"
|
||||
#include "common/thread.h"
|
||||
#include "input_common/drivers/mouse.h"
|
||||
|
||||
namespace InputCommon {
|
||||
constexpr int update_time = 10;
|
||||
constexpr float default_panning_sensitivity = 0.0010f;
|
||||
constexpr float default_stick_sensitivity = 0.0006f;
|
||||
constexpr float default_deadzone_counterweight = 0.01f;
|
||||
@@ -73,7 +74,7 @@ Mouse::Mouse(std::string input_engine_) : InputEngine(std::move(input_engine_))
|
||||
last_motion_change = {};
|
||||
}
|
||||
|
||||
void Mouse::UpdateStickInput(Common::SteadyClock::time_point timestamp) {
|
||||
void Mouse::UpdateStickInput() {
|
||||
if (!IsMousePanningEnabled()) {
|
||||
return;
|
||||
}
|
||||
@@ -99,9 +100,12 @@ void Mouse::UpdateStickInput(Common::SteadyClock::time_point timestamp) {
|
||||
last_mouse_change *= clamped_decay;
|
||||
}
|
||||
|
||||
void Mouse::UpdateMotionInput(Common::SteadyClock::time_point timestamp) {
|
||||
const float sensitivity = IsMousePanningEnabled() ? default_motion_panning_sensitivity : default_motion_sensitivity;
|
||||
const float rotation_velocity = std::sqrt(last_motion_change.x * last_motion_change.x + last_motion_change.y * last_motion_change.y);
|
||||
void Mouse::UpdateMotionInput() {
|
||||
const float sensitivity =
|
||||
IsMousePanningEnabled() ? default_motion_panning_sensitivity : default_motion_sensitivity;
|
||||
|
||||
const float rotation_velocity = std::sqrt(last_motion_change.x * last_motion_change.x +
|
||||
last_motion_change.y * last_motion_change.y);
|
||||
|
||||
// Clamp rotation speed
|
||||
if (rotation_velocity > maximum_rotation_speed / sensitivity) {
|
||||
@@ -117,7 +121,7 @@ void Mouse::UpdateMotionInput(Common::SteadyClock::time_point timestamp) {
|
||||
.accel_x = 0,
|
||||
.accel_y = 0,
|
||||
.accel_z = 0,
|
||||
.delta_timestamp = u64(std::chrono::duration_cast<std::chrono::microseconds>(timestamp - last_notify_timestamp).count()),
|
||||
.delta_timestamp = update_time * 1000,
|
||||
};
|
||||
|
||||
if (IsMousePanningEnabled()) {
|
||||
@@ -173,10 +177,8 @@ void Mouse::Move(int x, int y, int center_x, int center_y) {
|
||||
}
|
||||
|
||||
void Mouse::NotifyChanged() {
|
||||
auto const timestamp = Common::SteadyClock::Now();
|
||||
UpdateStickInput(timestamp);
|
||||
UpdateMotionInput(timestamp);
|
||||
last_notify_timestamp = Common::SteadyClock::Now();
|
||||
UpdateStickInput();
|
||||
UpdateMotionInput();
|
||||
}
|
||||
|
||||
void Mouse::MouseMove(f32 touch_x, f32 touch_y) {
|
||||
|
||||
@@ -7,9 +7,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <thread>
|
||||
#include <chrono>
|
||||
|
||||
#include "common/steady_clock.h"
|
||||
#include "common/polyfill_thread.h"
|
||||
#include "common/vector_math.h"
|
||||
#include "input_common/input_engine.h"
|
||||
@@ -103,18 +101,17 @@ public:
|
||||
Common::Input::ButtonNames GetUIName(const Common::ParamPackage& params) const override;
|
||||
|
||||
private:
|
||||
void UpdateStickInput(Common::SteadyClock::time_point timestamp);
|
||||
void UpdateMotionInput(Common::SteadyClock::time_point timestamp);
|
||||
void UpdateStickInput();
|
||||
void UpdateMotionInput();
|
||||
bool IsMousePanningEnabled();
|
||||
|
||||
Common::Input::ButtonNames GetUIButtonName(const Common::ParamPackage& params) const;
|
||||
|
||||
Common::Vec2<int> mouse_origin{};
|
||||
Common::Vec2<int> last_mouse_position{};
|
||||
Common::Vec2<float> last_mouse_change{};
|
||||
Common::Vec3<float> last_motion_change{};
|
||||
Common::Vec2<int> wheel_position{};
|
||||
Common::SteadyClock::time_point last_notify_timestamp{};
|
||||
Common::Vec2<int> mouse_origin;
|
||||
Common::Vec2<int> last_mouse_position;
|
||||
Common::Vec2<float> last_mouse_change;
|
||||
Common::Vec3<float> last_motion_change;
|
||||
Common::Vec2<int> wheel_position;
|
||||
bool button_pressed = false;
|
||||
};
|
||||
|
||||
|
||||
@@ -538,7 +538,6 @@ void GRenderWindow::mouseReleaseEvent(QMouseEvent* event) {
|
||||
}
|
||||
|
||||
void GRenderWindow::ConstrainMouse() {
|
||||
input_subsystem->GetMouse()->NotifyChanged(); // required to reset mouse once it's no longer moved
|
||||
if (QtCommon::emu_thread == nullptr || !Settings::values.mouse_panning) {
|
||||
mouse_constrain_timer.stop();
|
||||
return;
|
||||
@@ -553,12 +552,15 @@ void GRenderWindow::ConstrainMouse() {
|
||||
const auto pos = mapFromGlobal(QCursor::pos());
|
||||
const int new_pos_x = std::clamp(pos.x(), 0, width());
|
||||
const int new_pos_y = std::clamp(pos.y(), 0, height());
|
||||
|
||||
QCursor::setPos(mapToGlobal(QPoint{new_pos_x, new_pos_y}));
|
||||
} else {
|
||||
const int center_x = width() / 2;
|
||||
const int center_y = height() / 2;
|
||||
QCursor::setPos(mapToGlobal(QPoint{center_x, center_y}));
|
||||
return;
|
||||
}
|
||||
|
||||
const int center_x = width() / 2;
|
||||
const int center_y = height() / 2;
|
||||
|
||||
QCursor::setPos(mapToGlobal(QPoint{center_x, center_y}));
|
||||
}
|
||||
|
||||
void GRenderWindow::wheelEvent(QWheelEvent* event) {
|
||||
|
||||
@@ -37,16 +37,10 @@ EmuWindow_SDL3::EmuWindow_SDL3(InputCommon::InputSubsystem* input_subsystem_, Co
|
||||
SDL_SetWindowTitle(this_->render_window, title.c_str());
|
||||
return 2000;
|
||||
}, this);
|
||||
mouse_timer = SDL_AddTimer(100, [](void *userdata, SDL_TimerID, Uint32) -> Uint32 {
|
||||
auto* this_ = (EmuWindow_SDL3*)userdata;
|
||||
this_->input_subsystem->GetMouse()->NotifyChanged();
|
||||
return 100;
|
||||
}, this);
|
||||
}
|
||||
|
||||
EmuWindow_SDL3::~EmuWindow_SDL3() {
|
||||
SDL_RemoveTimer(titlebar_timer);
|
||||
SDL_RemoveTimer(mouse_timer);
|
||||
system.HIDCore().UnloadInputDevices();
|
||||
input_subsystem->Shutdown();
|
||||
SDL_Quit();
|
||||
|
||||
@@ -84,9 +84,6 @@ protected:
|
||||
/// Periodic changer of titlebar (independent of event loop)
|
||||
SDL_TimerID titlebar_timer;
|
||||
|
||||
// Mouse resetter once it
|
||||
SDL_TimerID mouse_timer;
|
||||
|
||||
/// Is the window still open?
|
||||
bool is_open = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user