early-access version 1331

This commit is contained in:
pineappleEA
2021-01-17 01:28:21 +01:00
parent 1f59a2561a
commit 233493ad87
47 changed files with 527 additions and 664 deletions

View File

@@ -296,6 +296,10 @@ void Config::ReadValues() {
sdl2_config->GetBoolean("ControlsGeneral", "motion_enabled", true));
Settings::values.touchscreen.enabled =
sdl2_config->GetBoolean("ControlsGeneral", "touch_enabled", true);
Settings::values.touchscreen.device =
sdl2_config->Get("ControlsGeneral", "touch_device", "engine:emu_window");
Settings::values.touchscreen.finger =
sdl2_config->GetInteger("ControlsGeneral", "touch_finger", 0);
Settings::values.touchscreen.rotation_angle =
sdl2_config->GetInteger("ControlsGeneral", "touch_angle", 0);
Settings::values.touchscreen.diameter_x =

View File

@@ -29,16 +29,16 @@ EmuWindow_SDL2::~EmuWindow_SDL2() {
}
void EmuWindow_SDL2::OnMouseMotion(s32 x, s32 y) {
TouchMoved((unsigned)std::max(x, 0), (unsigned)std::max(y, 0), 0);
TouchMoved((unsigned)std::max(x, 0), (unsigned)std::max(y, 0));
input_subsystem->GetMouse()->MouseMove(x, y);
}
void EmuWindow_SDL2::OnMouseButton(u32 button, u8 state, s32 x, s32 y) {
if (button == SDL_BUTTON_LEFT) {
if (state == SDL_PRESSED) {
TouchPressed((unsigned)std::max(x, 0), (unsigned)std::max(y, 0), 0);
TouchPressed((unsigned)std::max(x, 0), (unsigned)std::max(y, 0));
} else {
TouchReleased(0);
TouchReleased();
}
} else if (button == SDL_BUTTON_RIGHT) {
if (state == SDL_PRESSED) {
@@ -66,16 +66,16 @@ void EmuWindow_SDL2::OnFingerDown(float x, float y) {
// 3DS does
const auto [px, py] = TouchToPixelPos(x, y);
TouchPressed(px, py, 0);
TouchPressed(px, py);
}
void EmuWindow_SDL2::OnFingerMotion(float x, float y) {
const auto [px, py] = TouchToPixelPos(x, y);
TouchMoved(px, py, 0);
TouchMoved(px, py);
}
void EmuWindow_SDL2::OnFingerUp() {
TouchReleased(0);
TouchReleased();
}
void EmuWindow_SDL2::OnKeyEvent(int key, u8 state) {