From owner-dev-commits-ports-main@freebsd.org Thu May 20 14:22:29 2021 Return-Path: Delivered-To: dev-commits-ports-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA2D1640687; Thu, 20 May 2021 14:22:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FmBlT4wqsz3h5F; Thu, 20 May 2021 14:22:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90EC427760; Thu, 20 May 2021 14:22:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 14KEMTAo056921; Thu, 20 May 2021 14:22:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14KEMT2N056920; Thu, 20 May 2021 14:22:29 GMT (envelope-from git) Date: Thu, 20 May 2021 14:22:29 GMT Message-Id: <202105201422.14KEMT2N056920@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Jan Beich Subject: git: bd9872793c6e - main - emulators/yuzu: unbreak with sdl < 2.0.14 after c61770cb8015 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jbeich X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bd9872793c6e27cff9aef8891905ff8200f79986 Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the main branch of the FreeBSD ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 May 2021 14:22:29 -0000 The branch main has been updated by jbeich: URL: https://cgit.FreeBSD.org/ports/commit/?id=bd9872793c6e27cff9aef8891905ff8200f79986 commit bd9872793c6e27cff9aef8891905ff8200f79986 Author: Jan Beich AuthorDate: 2021-05-20 13:54:35 +0000 Commit: Jan Beich CommitDate: 2021-05-20 14:21:38 +0000 emulators/yuzu: unbreak with sdl < 2.0.14 after c61770cb8015 src/input_common/sdl/sdl_impl.cpp:95:20: error: 'SDL_ControllerSensorEvent' has not been declared 95 | void SetMotion(SDL_ControllerSensorEvent event) { | ^~~~~~~~~~~~~~~~~~~~~~~~~ src/input_common/sdl/sdl_impl.cpp: In member function 'void InputCommon::SDL::SDLJoystick::EnableMotion()': src/input_common/sdl/sdl_impl.cpp:79:17: error: 'SDL_GameControllerHasSensor' was not declared in this scope; did you mean 'SDL_GameControllerGetVendor'? 79 | if (SDL_GameControllerHasSensor(controller, SDL_SENSOR_ACCEL) && !has_accel) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ | SDL_GameControllerGetVendor src/input_common/sdl/sdl_impl.cpp:80:17: error: 'SDL_GameControllerSetSensorEnabled' was not declared in this scope; did you mean 'SDL_GameControllerGetVendor'? 80 | SDL_GameControllerSetSensorEnabled(controller, SDL_SENSOR_ACCEL, SDL_TRUE); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | SDL_GameControllerGetVendor src/input_common/sdl/sdl_impl.cpp:83:17: error: 'SDL_GameControllerHasSensor' was not declared in this scope; did you mean 'SDL_GameControllerGetVendor'? 83 | if (SDL_GameControllerHasSensor(controller, SDL_SENSOR_GYRO) && !has_gyro) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ | SDL_GameControllerGetVendor src/input_common/sdl/sdl_impl.cpp:84:17: error: 'SDL_GameControllerSetSensorEnabled' was not declared in this scope; did you mean 'SDL_GameControllerGetVendor'? 84 | SDL_GameControllerSetSensorEnabled(controller, SDL_SENSOR_GYRO, SDL_TRUE); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | SDL_GameControllerGetVendor src/input_common/sdl/sdl_impl.cpp: In member function 'void InputCommon::SDL::SDLJoystick::SetMotion(int)': src/input_common/sdl/sdl_impl.cpp:98:37: error: request for member 'timestamp' in 'event', which is of non-class type 'int' 98 | u64 time_difference = event.timestamp - last_motion_update; | ^~~~~~~~~ src/input_common/sdl/sdl_impl.cpp:99:36: error: request for member 'timestamp' in 'event', which is of non-class type 'int' 99 | last_motion_update = event.timestamp; | ^~~~~~~~~ src/input_common/sdl/sdl_impl.cpp:100:23: error: request for member 'sensor' in 'event', which is of non-class type 'int' 100 | switch (event.sensor) { | ^~~~~~ src/input_common/sdl/sdl_impl.cpp:102:56: error: request for member 'data' in 'event', which is of non-class type 'int' 102 | const Common::Vec3f acceleration = {-event.data[0], event.data[2], -event.data[1]}; | ^~~~ src/input_common/sdl/sdl_impl.cpp:102:71: error: request for member 'data' in 'event', which is of non-class type 'int' 102 | const Common::Vec3f acceleration = {-event.data[0], event.data[2], -event.data[1]}; | ^~~~ src/input_common/sdl/sdl_impl.cpp:102:87: error: request for member 'data' in 'event', which is of non-class type 'int' 102 | const Common::Vec3f acceleration = {-event.data[0], event.data[2], -event.data[1]}; | ^~~~ src/input_common/sdl/sdl_impl.cpp:102:94: error: could not convert '{, , }' from '' to 'const Vec3f' {aka 'const Common::Vec3'} 102 | const Common::Vec3f acceleration = {-event.data[0], event.data[2], -event.data[1]}; | ^ | | | src/input_common/sdl/sdl_impl.cpp:107:52: error: request for member 'data' in 'event', which is of non-class type 'int' 107 | const Common::Vec3f gyroscope = {event.data[0], -event.data[2], event.data[1]}; | ^~~~ src/input_common/sdl/sdl_impl.cpp:107:68: error: request for member 'data' in 'event', which is of non-class type 'int' 107 | const Common::Vec3f gyroscope = {event.data[0], -event.data[2], event.data[1]}; | ^~~~ src/input_common/sdl/sdl_impl.cpp:107:83: error: request for member 'data' in 'event', which is of non-class type 'int' 107 | const Common::Vec3f gyroscope = {event.data[0], -event.data[2], event.data[1]}; | ^~~~ src/input_common/sdl/sdl_impl.cpp:107:90: error: could not convert '{, , }' from '' to 'const Vec3f' {aka 'const Common::Vec3'} 107 | const Common::Vec3f gyroscope = {event.data[0], -event.data[2], event.data[1]}; | ^ | | | src/input_common/sdl/sdl_impl.cpp: In member function 'void InputCommon::SDL::SDLState::HandleGameControllerEvent(const SDL_Event&)': src/input_common/sdl/sdl_impl.cpp:355:10: error: 'SDL_CONTROLLERSENSORUPDATE' was not declared in this scope; did you mean 'SDL_CONTROLLERBUTTONUP'? 355 | case SDL_CONTROLLERSENSORUPDATE: { | ^~~~~~~~~~~~~~~~~~~~~~~~~~ | SDL_CONTROLLERBUTTONUP src/input_common/sdl/sdl_impl.cpp:356:57: error: 'const SDL_Event' {aka 'const union SDL_Event'} has no member named 'csensor'; did you mean 'sensor'? 356 | if (auto joystick = GetSDLJoystickBySDLID(event.csensor.which)) { | ^~~~~~~ | sensor src/input_common/sdl/sdl_impl.cpp:357:39: error: 'const SDL_Event' {aka 'const union SDL_Event'} has no member named 'csensor'; did you mean 'sensor'? 357 | joystick->SetMotion(event.csensor); | ^~~~~~~ | sensor src/input_common/sdl/sdl_impl.cpp: In function 'Common::ParamPackage InputCommon::SDL::{anonymous}::SDLEventToMotionParamPackage(InputCommon::SDL::SDLState&, const SDL_Event&)': src/input_common/sdl/sdl_impl.cpp:1008:10: error: 'SDL_CONTROLLERSENSORUPDATE' was not declared in this scope; did you mean 'SDL_CONTROLLERBUTTONUP'? 1008 | case SDL_CONTROLLERSENSORUPDATE: { | ^~~~~~~~~~~~~~~~~~~~~~~~~~ | SDL_CONTROLLERBUTTONUP src/input_common/sdl/sdl_impl.cpp:1012:19: error: 'const SDL_Event' {aka 'const union SDL_Event'} has no member named 'csensor'; did you mean 'sensor'? 1012 | if (event.csensor.sensor == SDL_SENSOR_ACCEL) { | ^~~~~~~ | sensor src/input_common/sdl/sdl_impl.cpp:1013:56: error: 'const SDL_Event' {aka 'const union SDL_Event'} has no member named 'csensor'; did you mean 'sensor'? 1013 | const Common::Vec3f acceleration = {-event.csensor.data[0], event.csensor.data[2], | ^~~~~~~ | sensor src/input_common/sdl/sdl_impl.cpp:1013:79: error: 'const SDL_Event' {aka 'const union SDL_Event'} has no member named 'csensor'; did you mean 'sensor'? 1013 | const Common::Vec3f acceleration = {-event.csensor.data[0], event.csensor.data[2], | ^~~~~~~ | sensor src/input_common/sdl/sdl_impl.cpp:1014:56: error: 'const SDL_Event' {aka 'const union SDL_Event'} has no member named 'csensor'; did you mean 'sensor'? 1014 | -event.csensor.data[1]}; | ^~~~~~~ | sensor src/input_common/sdl/sdl_impl.cpp:1014:71: error: could not convert '{, , }' from '' to 'const Vec3f' {aka 'const Common::Vec3'} 1014 | -event.csensor.data[1]}; | ^ | | | src/input_common/sdl/sdl_impl.cpp:1020:19: error: 'const SDL_Event' {aka 'const union SDL_Event'} has no member named 'csensor'; did you mean 'sensor'? 1020 | if (event.csensor.sensor == SDL_SENSOR_GYRO) { | ^~~~~~~ | sensor src/input_common/sdl/sdl_impl.cpp:1021:52: error: 'const SDL_Event' {aka 'const union SDL_Event'} has no member named 'csensor'; did you mean 'sensor'? 1021 | const Common::Vec3f gyroscope = {event.csensor.data[0], -event.csensor.data[2], | ^~~~~~~ | sensor src/input_common/sdl/sdl_impl.cpp:1021:76: error: 'const SDL_Event' {aka 'const union SDL_Event'} has no member named 'csensor'; did you mean 'sensor'? 1021 | const Common::Vec3f gyroscope = {event.csensor.data[0], -event.csensor.data[2], | ^~~~~~~ | sensor src/input_common/sdl/sdl_impl.cpp:1022:52: error: 'const SDL_Event' {aka 'const union SDL_Event'} has no member named 'csensor'; did you mean 'sensor'? 1022 | event.csensor.data[1]}; | ^~~~~~~ | sensor src/input_common/sdl/sdl_impl.cpp:1022:67: error: could not convert '{, , }' from '' to 'const Vec3f' {aka 'const Common::Vec3'} 1022 | event.csensor.data[1]}; | ^ | | | src/input_common/sdl/sdl_impl.cpp:1032:69: error: 'const SDL_Event' {aka 'const union SDL_Event'} has no member named 'csensor'; did you mean 'sensor'? 1032 | if (const auto joystick = state.GetSDLJoystickBySDLID(event.csensor.which)) { | ^~~~~~~ | sensor src/input_common/sdl/sdl_impl.cpp: In member function 'std::optional InputCommon::SDL::Polling::SDLMotionPoller::FromEvent(const SDL_Event&) const': src/input_common/sdl/sdl_impl.cpp:1300:14: error: 'SDL_CONTROLLERSENSORUPDATE' was not declared in this scope; did you mean 'SDL_CONTROLLERBUTTONUP'? 1300 | case SDL_CONTROLLERSENSORUPDATE: | ^~~~~~~~~~~~~~~~~~~~~~~~~~ | SDL_CONTROLLERBUTTONUP Reported by: pkg-fallout --- emulators/yuzu/files/patch-sdl2 | 77 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 75 insertions(+), 2 deletions(-) diff --git a/emulators/yuzu/files/patch-sdl2 b/emulators/yuzu/files/patch-sdl2 index a540dc413999..6eda6f9d8d2e 100644 --- a/emulators/yuzu/files/patch-sdl2 +++ b/emulators/yuzu/files/patch-sdl2 @@ -22,13 +22,86 @@ CMake Error at externals/CMakeLists.txt:54 (add_subdirectory): if (SDL2_FOUND) --- src/input_common/sdl/sdl_impl.cpp.orig 2021-05-19 22:47:48 UTC +++ src/input_common/sdl/sdl_impl.cpp -@@ -797,7 +797,9 @@ SDLState::SDLState() { +@@ -74,6 +74,7 @@ class SDLJoystick { (public) + } + + void EnableMotion() { ++#if SDL_VERSION_ATLEAST(2,0,14) + if (sdl_controller) { + SDL_GameController* controller = sdl_controller.get(); + if (SDL_GameControllerHasSensor(controller, SDL_SENSOR_ACCEL) && !has_accel) { +@@ -85,6 +86,7 @@ class SDLJoystick { (public) + has_gyro = true; + } + } ++#endif + } + + void SetButton(int button, bool value) { +@@ -92,6 +94,7 @@ class SDLJoystick { (public) + state.buttons.insert_or_assign(button, value); + } + ++#if SDL_VERSION_ATLEAST(2,0,14) + void SetMotion(SDL_ControllerSensorEvent event) { + constexpr float gravity_constant = 9.80665f; + std::lock_guard lock{mutex}; +@@ -119,6 +122,7 @@ class SDLJoystick { (public) + motion.UpdateRotation(time_difference * 1000); + motion.UpdateOrientation(time_difference * 1000); + } ++#endif + + bool GetButton(int button) const { + std::lock_guard lock{mutex}; +@@ -352,12 +356,14 @@ void SDLState::HandleGameControllerEvent(const SDL_Eve + } + break; + } ++#if SDL_VERSION_ATLEAST(2,0,14) + case SDL_CONTROLLERSENSORUPDATE: { + if (auto joystick = GetSDLJoystickBySDLID(event.csensor.which)) { + joystick->SetMotion(event.csensor); + } + break; + } ++#endif + case SDL_JOYDEVICEREMOVED: + LOG_DEBUG(Input, "Controller removed with Instance_ID {}", event.jdevice.which); + CloseJoystick(SDL_JoystickFromInstanceID(event.jdevice.which)); +@@ -797,7 +803,9 @@ SDLState::SDLState() { // Enable HIDAPI rumble. This prevents SDL from disabling motion on PS4 and PS5 controllers SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, "1"); -+#ifdef SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE ++#if SDL_VERSION_ATLEAST(2,0,15) SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE, "1"); +#endif // Tell SDL2 to use the hidapi driver. This will allow joycons to be detected as a // GameController and not a generic one +@@ -1003,6 +1011,7 @@ Common::ParamPackage SDLEventToMotionParamPackage(SDLS + } + break; + } ++#if SDL_VERSION_ATLEAST(2,0,14) + case SDL_CONTROLLERSENSORUPDATE: { + bool is_motion_shaking = false; + constexpr float gyro_threshold = 5.0f; +@@ -1032,6 +1041,7 @@ Common::ParamPackage SDLEventToMotionParamPackage(SDLS + } + break; + } ++#endif + } + return {}; + } +@@ -1295,7 +1305,9 @@ class SDLMotionPoller final : public SDLPoller { (publ + [[fallthrough]]; + case SDL_JOYBUTTONUP: + case SDL_JOYHATMOTION: ++#if SDL_VERSION_ATLEAST(2,0,14) + case SDL_CONTROLLERSENSORUPDATE: ++#endif + return {SDLEventToMotionParamPackage(state, event)}; + } + return std::nullopt;