mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-09-05 20:04:13 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c857816e15 | |||
| f6e7686038 |
@@ -1,13 +0,0 @@
|
|||||||
diff --git a/libs/cobalt/include/boost/cobalt/concepts.hpp b/libs/cobalt/include/boost/cobalt/concepts.hpp
|
|
||||||
index d49f2ec..a9bdb80 100644
|
|
||||||
--- a/libs/cobalt/include/boost/cobalt/concepts.hpp
|
|
||||||
+++ b/libs/cobalt/include/boost/cobalt/concepts.hpp
|
|
||||||
@@ -62,7 +62,7 @@ struct enable_awaitables
|
|
||||||
template <typename T>
|
|
||||||
concept with_get_executor = requires (T& t)
|
|
||||||
{
|
|
||||||
- {t.get_executor()} -> asio::execution::executor;
|
|
||||||
+ t.get_executor();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
+3
-7
@@ -414,12 +414,9 @@ AddJsonPackage(boost)
|
|||||||
set(BOOST_NO_HEADERS ${Boost_ADDED})
|
set(BOOST_NO_HEADERS ${Boost_ADDED})
|
||||||
|
|
||||||
if (Boost_ADDED)
|
if (Boost_ADDED)
|
||||||
if (MSVC OR ANDROID)
|
add_compile_definitions(YUZU_BOOST_v1)
|
||||||
add_compile_definitions(YUZU_BOOST_v1)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (NOT MSVC OR CXX_CLANG)
|
if (NOT MSVC OR CXX_CLANG)
|
||||||
# boost sucks
|
# solaris sucks
|
||||||
if (SOLARIS)
|
if (SOLARIS)
|
||||||
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-pthreads>)
|
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-pthreads>)
|
||||||
endif()
|
endif()
|
||||||
@@ -428,8 +425,7 @@ if (Boost_ADDED)
|
|||||||
target_compile_options(boost_icl INTERFACE $<$<COMPILE_LANGUAGE:C,CXX>:-Wno-shadow>)
|
target_compile_options(boost_icl INTERFACE $<$<COMPILE_LANGUAGE:C,CXX>:-Wno-shadow>)
|
||||||
target_compile_options(boost_asio INTERFACE
|
target_compile_options(boost_asio INTERFACE
|
||||||
$<$<COMPILE_LANGUAGE:C,CXX>:-Wno-conversion>
|
$<$<COMPILE_LANGUAGE:C,CXX>:-Wno-conversion>
|
||||||
$<$<COMPILE_LANGUAGE:C,CXX>:-Wno-implicit-fallthrough>
|
$<$<COMPILE_LANGUAGE:C,CXX>:-Wno-implicit-fallthrough>)
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
+6
-9
@@ -14,22 +14,19 @@
|
|||||||
"version": "v0.19.0"
|
"version": "v0.19.0"
|
||||||
},
|
},
|
||||||
"boost": {
|
"boost": {
|
||||||
"artifact": "%VERSION%-cmake.tar.xz",
|
"artifact": "boost-%VERSION%.tar.zst",
|
||||||
"find_args": "CONFIG OPTIONAL_COMPONENTS headers context system fiber filesystem",
|
"find_args": "CONFIG OPTIONAL_COMPONENTS headers context system fiber filesystem",
|
||||||
"hash": "6ae6e94664fe7f2fb01976b59b276ac5df8085c7503fa829d810fbfe495960cfec44fa2c36e2cb23480bc19c956ed199d4952b02639a00a6c07625d4e7130c2d",
|
"hash": "077ad58b3d336041c05ad5f2b1de7db9fe1d35af3da85cd99496c35ddeca080ecd0ae5c8058319077bda892361b38624d89f70bc9bfec6713aae2aabc17f2a43",
|
||||||
"min_version": "1.57",
|
"min_version": "1.57",
|
||||||
"package": "Boost",
|
"package": "Boost",
|
||||||
"patches": [
|
"repo": "eden-emulator/ext-boost",
|
||||||
"0001-clang-cl.patch"
|
"version": "1.91.0-1"
|
||||||
],
|
|
||||||
"repo": "boostorg/boost",
|
|
||||||
"version": "boost-1.90.0"
|
|
||||||
},
|
},
|
||||||
"boost_headers": {
|
"boost_headers": {
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"hash": "4ef845775e2277a8104ded6ddf749aa262ce52cf8438042869a048f9a0156dd772fbbcfa74efa1378fecef339b7286f6fe4b4feb5c45d49966b35d08e3e83507",
|
"hash": "c5fa2cd72f6e6666b7963b97bc359c75284b8fb540c30f3629a028b85270c9bc66c8a051383964f2bd4c1e005a4691593d15696e7ef39ea87cf6cff9e5691fb2",
|
||||||
"repo": "boostorg/headers",
|
"repo": "boostorg/headers",
|
||||||
"version": "boost-1.90.0"
|
"version": "boost-1.91.0"
|
||||||
},
|
},
|
||||||
"catch2": {
|
"catch2": {
|
||||||
"hash": "7eea385d79d88a5690cde131fe7ccda97d5c54ea09d6f515000d7bf07c828809d61c1ac99912c1ee507cf933f61c1c47ecdcc45df7850ffa82714034b0fccf35",
|
"hash": "7eea385d79d88a5690cde131fe7ccda97d5c54ea09d6f515000d7bf07c828809d61c1ac99912c1ee507cf933f61c1c47ecdcc45df7850ffa82714034b0fccf35",
|
||||||
|
|||||||
Vendored
+1
@@ -11,6 +11,7 @@
|
|||||||
#include <limits>
|
#include <limits>
|
||||||
#include <span>
|
#include <span>
|
||||||
#include <array>
|
#include <array>
|
||||||
|
#include <algorithm>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
namespace Tz {
|
namespace Tz {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <cstdlib>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <llvm/Demangle/Demangle.h>
|
#include <llvm/Demangle/Demangle.h>
|
||||||
|
|||||||
@@ -4,16 +4,17 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include <chrono>
|
#include <thread>
|
||||||
#include <fmt/ranges.h>
|
#include <fmt/ranges.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include "common/param_package.h"
|
#include "common/param_package.h"
|
||||||
#include "common/settings.h"
|
#include "common/settings.h"
|
||||||
#include "common/steady_clock.h"
|
#include "common/thread.h"
|
||||||
#include "input_common/drivers/mouse.h"
|
#include "input_common/drivers/mouse.h"
|
||||||
|
|
||||||
namespace InputCommon {
|
namespace InputCommon {
|
||||||
|
constexpr int update_time = 10;
|
||||||
constexpr float default_panning_sensitivity = 0.0010f;
|
constexpr float default_panning_sensitivity = 0.0010f;
|
||||||
constexpr float default_stick_sensitivity = 0.0006f;
|
constexpr float default_stick_sensitivity = 0.0006f;
|
||||||
constexpr float default_deadzone_counterweight = 0.01f;
|
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 = {};
|
last_motion_change = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mouse::UpdateStickInput(Common::SteadyClock::time_point timestamp) {
|
void Mouse::UpdateStickInput() {
|
||||||
if (!IsMousePanningEnabled()) {
|
if (!IsMousePanningEnabled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -99,9 +100,12 @@ void Mouse::UpdateStickInput(Common::SteadyClock::time_point timestamp) {
|
|||||||
last_mouse_change *= clamped_decay;
|
last_mouse_change *= clamped_decay;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mouse::UpdateMotionInput(Common::SteadyClock::time_point timestamp) {
|
void Mouse::UpdateMotionInput() {
|
||||||
const float sensitivity = IsMousePanningEnabled() ? default_motion_panning_sensitivity : default_motion_sensitivity;
|
const float sensitivity =
|
||||||
const float rotation_velocity = std::sqrt(last_motion_change.x * last_motion_change.x + last_motion_change.y * last_motion_change.y);
|
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
|
// Clamp rotation speed
|
||||||
if (rotation_velocity > maximum_rotation_speed / sensitivity) {
|
if (rotation_velocity > maximum_rotation_speed / sensitivity) {
|
||||||
@@ -117,7 +121,7 @@ void Mouse::UpdateMotionInput(Common::SteadyClock::time_point timestamp) {
|
|||||||
.accel_x = 0,
|
.accel_x = 0,
|
||||||
.accel_y = 0,
|
.accel_y = 0,
|
||||||
.accel_z = 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()) {
|
if (IsMousePanningEnabled()) {
|
||||||
@@ -173,10 +177,8 @@ void Mouse::Move(int x, int y, int center_x, int center_y) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Mouse::NotifyChanged() {
|
void Mouse::NotifyChanged() {
|
||||||
auto const timestamp = Common::SteadyClock::Now();
|
UpdateStickInput();
|
||||||
UpdateStickInput(timestamp);
|
UpdateMotionInput();
|
||||||
UpdateMotionInput(timestamp);
|
|
||||||
last_notify_timestamp = Common::SteadyClock::Now();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mouse::MouseMove(f32 touch_x, f32 touch_y) {
|
void Mouse::MouseMove(f32 touch_x, f32 touch_y) {
|
||||||
|
|||||||
@@ -7,9 +7,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <chrono>
|
|
||||||
|
|
||||||
#include "common/steady_clock.h"
|
|
||||||
#include "common/polyfill_thread.h"
|
#include "common/polyfill_thread.h"
|
||||||
#include "common/vector_math.h"
|
#include "common/vector_math.h"
|
||||||
#include "input_common/input_engine.h"
|
#include "input_common/input_engine.h"
|
||||||
@@ -103,18 +101,17 @@ public:
|
|||||||
Common::Input::ButtonNames GetUIName(const Common::ParamPackage& params) const override;
|
Common::Input::ButtonNames GetUIName(const Common::ParamPackage& params) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void UpdateStickInput(Common::SteadyClock::time_point timestamp);
|
void UpdateStickInput();
|
||||||
void UpdateMotionInput(Common::SteadyClock::time_point timestamp);
|
void UpdateMotionInput();
|
||||||
bool IsMousePanningEnabled();
|
bool IsMousePanningEnabled();
|
||||||
|
|
||||||
Common::Input::ButtonNames GetUIButtonName(const Common::ParamPackage& params) const;
|
Common::Input::ButtonNames GetUIButtonName(const Common::ParamPackage& params) const;
|
||||||
|
|
||||||
Common::Vec2<int> mouse_origin{};
|
Common::Vec2<int> mouse_origin;
|
||||||
Common::Vec2<int> last_mouse_position{};
|
Common::Vec2<int> last_mouse_position;
|
||||||
Common::Vec2<float> last_mouse_change{};
|
Common::Vec2<float> last_mouse_change;
|
||||||
Common::Vec3<float> last_motion_change{};
|
Common::Vec3<float> last_motion_change;
|
||||||
Common::Vec2<int> wheel_position{};
|
Common::Vec2<int> wheel_position;
|
||||||
Common::SteadyClock::time_point last_notify_timestamp{};
|
|
||||||
bool button_pressed = false;
|
bool button_pressed = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -538,7 +538,6 @@ void GRenderWindow::mouseReleaseEvent(QMouseEvent* event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GRenderWindow::ConstrainMouse() {
|
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) {
|
if (QtCommon::emu_thread == nullptr || !Settings::values.mouse_panning) {
|
||||||
mouse_constrain_timer.stop();
|
mouse_constrain_timer.stop();
|
||||||
return;
|
return;
|
||||||
@@ -553,12 +552,15 @@ void GRenderWindow::ConstrainMouse() {
|
|||||||
const auto pos = mapFromGlobal(QCursor::pos());
|
const auto pos = mapFromGlobal(QCursor::pos());
|
||||||
const int new_pos_x = std::clamp(pos.x(), 0, width());
|
const int new_pos_x = std::clamp(pos.x(), 0, width());
|
||||||
const int new_pos_y = std::clamp(pos.y(), 0, height());
|
const int new_pos_y = std::clamp(pos.y(), 0, height());
|
||||||
|
|
||||||
QCursor::setPos(mapToGlobal(QPoint{new_pos_x, new_pos_y}));
|
QCursor::setPos(mapToGlobal(QPoint{new_pos_x, new_pos_y}));
|
||||||
} else {
|
return;
|
||||||
const int center_x = width() / 2;
|
|
||||||
const int center_y = height() / 2;
|
|
||||||
QCursor::setPos(mapToGlobal(QPoint{center_x, center_y}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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) {
|
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());
|
SDL_SetWindowTitle(this_->render_window, title.c_str());
|
||||||
return 2000;
|
return 2000;
|
||||||
}, this);
|
}, 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() {
|
EmuWindow_SDL3::~EmuWindow_SDL3() {
|
||||||
SDL_RemoveTimer(titlebar_timer);
|
SDL_RemoveTimer(titlebar_timer);
|
||||||
SDL_RemoveTimer(mouse_timer);
|
|
||||||
system.HIDCore().UnloadInputDevices();
|
system.HIDCore().UnloadInputDevices();
|
||||||
input_subsystem->Shutdown();
|
input_subsystem->Shutdown();
|
||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
|
|||||||
@@ -84,9 +84,6 @@ protected:
|
|||||||
/// Periodic changer of titlebar (independent of event loop)
|
/// Periodic changer of titlebar (independent of event loop)
|
||||||
SDL_TimerID titlebar_timer;
|
SDL_TimerID titlebar_timer;
|
||||||
|
|
||||||
// Mouse resetter once it
|
|
||||||
SDL_TimerID mouse_timer;
|
|
||||||
|
|
||||||
/// Is the window still open?
|
/// Is the window still open?
|
||||||
bool is_open = true;
|
bool is_open = true;
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# update cached cpmfile content
|
# update cached cpmfile content
|
||||||
string(JSON cpmfile SET "${cpmfile}" "${key}" "${new_object}")
|
string(JSON cpmfile SET "${cpmfile}" "${KEY}" "${new_object}")
|
||||||
|
|
||||||
# write cached cpmfile
|
# write cached cpmfile
|
||||||
get_cpmfile_path(file)
|
get_cpmfile_path(file)
|
||||||
|
|||||||
Reference in New Issue
Block a user