forked from diasurgical/devilutionX
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle scaling for SDL1 #5
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Hide cursor on joystick move, show cursor on mouse move. - Auto aim at closest monsters, objs or items. - Inventory grid snap navigation - Speed spell grid snap navigation - Char stat snaps navigation - Town portal auto casts if using a controller - Can now identify and repair items via controller - Can dropping items in inventory via controller
Fix walk, talk, attack, pickup etc
- Left stick click for quest log - Y in inventory to read books - Fix increasing player stats infinitely - Fix inventory controls with stick or dpad
Initial game controller support. Actions are based on the Switch branch but the controller code itself is implemented differently, allowing for easy remapping and minimizing changes to the Source/ directory. Many subtle and not so subtle controller bugs have been fixed in this implementation, including: 1. Smoother & more responsive movement with the joysticks. 2. Consistent controls for all the menus in the game (stores, quest log, etc). 3. Cursor appearance / disappearance at appropriate times. Low-level controls are abstracted and 3 SDL interfaces are supported: game controller, joystick, and keyboard. See SourceX/controls/ for more details on this. Wishlist for the future: 1. Primary button and use button should attack continously. This is hard as it requires checking the cooldowns / attack speed. 2. Quick spell menu navigation is very buggy. It is also buggy in the switch branch. I haven't had a change to investigate.
Previously the item was just destroyed instead
- Fix double events - Fix ignored events - Allow moving diagonal in the inventory - Fix mouse wabeling in inventory when scalling - Make controler actions cursor independant - Make sure secoundery and primery key doesn't fire each others events - Automatic switch between controller and keyboard+mouse - Allow the user to change facing direction when blocked - Make code event based instead of relying on time outs
- Rename curHidden to sgbControllerActive to make it more descriptive - Fix mouse controls (was was interupted after 1 step)
Background: Only some handheld devices support auto-scaling. On desktop and most handhelds we need to scale manually. Hardware auto-scaler check for jz4760 provided by @jbanes and @scooterpsu
5 tasks
AJenbo
force-pushed
the
controls
branch
5 times, most recently
from
November 6, 2019 01:12
1dcdc99
to
8f8a3b6
Compare
glebm
added a commit
that referenced
this pull request
Mar 23, 2021
Single-player difficulty selection was implemented in a very hacky way. Documents what's going on there and fixes a memory leak. Memory leaks that this fixes looked like this: ``` Direct leak of 64 byte(s) in 1 object(s) allocated from: #0 0x7f435b789f17 in operator new(unsigned long) (/lib/x86_64-linux-gnu/libasan.so.6+0xb1f17) #1 0x5567766c62b8 in dvl::selgame_GameSelection_Select(int) ../SourceX/DiabloUI/selgame.cpp:163 #2 0x5567766d8ee8 in dvl::selhero_Load_Select(int) ../SourceX/DiabloUI/selhero.cpp:464 #3 0x5567766d6ed1 in dvl::selhero_List_Select(int) ../SourceX/DiabloUI/selhero.cpp:325 #4 0x556776692683 in dvl::UiFocusNavigationSelect() ../SourceX/DiabloUI/diabloui.cpp:396 #5 0x55677669158e in HandleMenuAction ../SourceX/DiabloUI/diabloui.cpp:223 #6 0x5567766917b9 in dvl::UiFocusNavigation(SDL_Event*) ../SourceX/DiabloUI/diabloui.cpp:277 #7 0x556776695dff in dvl::UiPollAndRender() ../SourceX/DiabloUI/diabloui.cpp:626 #8 0x5567766d94ef in UiSelHeroDialog ../SourceX/DiabloUI/selhero.cpp:512 diasurgical#9 0x5567766d997f in dvl::UiSelHeroSingDialog(int (*)(int (*)(dvl::_uiheroinfo*)), int (*)(dvl::_uiheroinfo*), int (*)(dvl::_uiheroinfo*), void (*)(unsigned int, dvl::_uidefaultstats*), int*, char (*) [16], int*) ../SourceX/DiabloUI/selhero.cpp:547 diasurgical#10 0x556776a44f45 in mainmenu_select_hero_dialog ../Source/mainmenu.cpp:98 diasurgical#11 0x5567765f9f15 in SNetInitializeProvider ../SourceX/storm/storm_net.cpp:102 diasurgical#12 0x556776c996b9 in multi_init_single ../Source/multi.cpp:826 diasurgical#13 0x556776c98b1e in NetInit ../Source/multi.cpp:770 diasurgical#14 0x5567767d0c0b in StartGame ../Source/diablo.cpp:375 diasurgical#15 0x556776a4493d in mainmenu_init_menu ../Source/mainmenu.cpp:45 diasurgical#16 0x556776a44c05 in mainmenu_single_player ../Source/mainmenu.cpp:61 diasurgical#17 0x556776a454a9 in mainmenu_loop ../Source/mainmenu.cpp:152 diasurgical#18 0x5567767d2892 in DiabloMain ../Source/diablo.cpp:602 diasurgical#19 0x5567766e3c69 in main ../SourceX/main.cpp:34 diasurgical#20 0x7f435a69ecb1 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28cb1) ```
glebm
added a commit
that referenced
this pull request
Mar 23, 2021
Single-player difficulty selection was implemented in a very hacky way. Documents what's going on there and fixes a memory leak. Memory leaks that this fixes looked like this: ``` Direct leak of 64 byte(s) in 1 object(s) allocated from: #0 0x7f435b789f17 in operator new(unsigned long) (/lib/x86_64-linux-gnu/libasan.so.6+0xb1f17) #1 0x5567766c62b8 in dvl::selgame_GameSelection_Select(int) ../SourceX/DiabloUI/selgame.cpp:163 #2 0x5567766d8ee8 in dvl::selhero_Load_Select(int) ../SourceX/DiabloUI/selhero.cpp:464 #3 0x5567766d6ed1 in dvl::selhero_List_Select(int) ../SourceX/DiabloUI/selhero.cpp:325 #4 0x556776692683 in dvl::UiFocusNavigationSelect() ../SourceX/DiabloUI/diabloui.cpp:396 #5 0x55677669158e in HandleMenuAction ../SourceX/DiabloUI/diabloui.cpp:223 #6 0x5567766917b9 in dvl::UiFocusNavigation(SDL_Event*) ../SourceX/DiabloUI/diabloui.cpp:277 #7 0x556776695dff in dvl::UiPollAndRender() ../SourceX/DiabloUI/diabloui.cpp:626 #8 0x5567766d94ef in UiSelHeroDialog ../SourceX/DiabloUI/selhero.cpp:512 diasurgical#9 0x5567766d997f in dvl::UiSelHeroSingDialog(int (*)(int (*)(dvl::_uiheroinfo*)), int (*)(dvl::_uiheroinfo*), int (*)(dvl::_uiheroinfo*), void (*)(unsigned int, dvl::_uidefaultstats*), int*, char (*) [16], int*) ../SourceX/DiabloUI/selhero.cpp:547 diasurgical#10 0x556776a44f45 in mainmenu_select_hero_dialog ../Source/mainmenu.cpp:98 diasurgical#11 0x5567765f9f15 in SNetInitializeProvider ../SourceX/storm/storm_net.cpp:102 diasurgical#12 0x556776c996b9 in multi_init_single ../Source/multi.cpp:826 diasurgical#13 0x556776c98b1e in NetInit ../Source/multi.cpp:770 diasurgical#14 0x5567767d0c0b in StartGame ../Source/diablo.cpp:375 diasurgical#15 0x556776a4493d in mainmenu_init_menu ../Source/mainmenu.cpp:45 diasurgical#16 0x556776a44c05 in mainmenu_single_player ../Source/mainmenu.cpp:61 diasurgical#17 0x556776a454a9 in mainmenu_loop ../Source/mainmenu.cpp:152 diasurgical#18 0x5567767d2892 in DiabloMain ../Source/diablo.cpp:602 diasurgical#19 0x5567766e3c69 in main ../SourceX/main.cpp:34 diasurgical#20 0x7f435a69ecb1 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28cb1) ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background: Only some handheld devices support auto-scaling.
On desktop and most handhelds we need to scale manually.
Hardware auto-scaler check for jz4760 provided by @jbanes and @scooterpsu