fheroes2 icon indicating copy to clipboard operation
fheroes2 copied to clipboard

Generic sdl2 game controller support on compatible devices

Open romadu opened this issue 4 years ago • 3 comments

Preliminary checks

Describe the problem requiring a solution

This #ifdef restriction means that sdl2 game controller is only initialised on Vita or Switch, and not on other systems with compatible sdl2 game controllers. Perhaps game controller support can be made more generic.

https://github.com/ihhub/fheroes2/blob/c79c9866f821a92b73622aadf2cff45d2d98e2ae/src/fheroes2/game/fheroes2.cpp#L150

Describe the possible solution

By removing this #ifdef I am able to initialise game controller support on linux handheld devices. However, I'm not sure if that's the best solution for all use cases.

Additional info

https://github.com/ihhub/fheroes2/blob/c79c9866f821a92b73622aadf2cff45d2d98e2ae/src/fheroes2/game/fheroes2.cpp#L150

romadu avatar Oct 16 '21 01:10 romadu

Hi @romadu , we went through this discussion in the past and as far as I know the problem is that some systems recognize extra controllers making difficult to play the game. Are you on Linux?

ihhub avatar Oct 16 '21 15:10 ihhub

Yes this is on Linux. Anyway, I managed to compile and have game controller support by removing the #ifdef check (because I know my system has only one controller). I was just wondering if there was a way to create a generic fix for others in my situation in the future.

On Sat, 16 Oct 2021 at 23:54, Ihar Hubchyk @.***> wrote:

Hi @romadu https://github.com/romadu , we went through this discussion in the past and as far as I know the problem is that some systems recognize extra controllers making difficult to play the game. Are you on Linux?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ihhub/fheroes2/issues/4435#issuecomment-944939584, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD27XCZY7YZGRDYFRQ7NRTDUHGN43ANCNFSM5GDCBVEQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

romadu avatar Oct 17 '21 06:10 romadu

Some discussion about controllers are made in #2455.

ihhub avatar Oct 19 '21 15:10 ihhub