-
-
Notifications
You must be signed in to change notification settings - Fork 494
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
Make rumble functions configurable #2742
base: master
Are you sure you want to change the base?
Conversation
Wait, I completely forgot about joysticks (and left in a mistake during a rebasing mistake) that skips most of the conditions. |
fb6976f
to
226e759
Compare
Should hopefully be good to go? (Note: I don't own a joystick, so the changes affecting the joystick component are untested - even if they are presumed to be fine.) |
src/control/joystick_manager.cpp
Outdated
JoystickManager::rumble(SDL_Joystick* controller) const | ||
JoystickManager::rumble(SDL_Joystick* joystick) const | ||
{ | ||
return this->rumble(joystick, 0xFFFF, 0xFFFF, 100); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
src/control/joystick_manager.hpp
Outdated
#include "control/controller.hpp" | ||
|
||
#include <stdint.h> | ||
#include <vector> | ||
#include <unordered_map> | ||
|
||
#include "control/controller.hpp" | ||
#include <SDL.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as previously too.
Besides my previous comments maybe it would make sense to add rumble configuration to options menu? Because currently this change seems little bit pointless. |
I haven't completed my work in trying to get
I do not know if I should do that yet, as that would require me to answer the following: Should I use the Later on, I'd like to use information such as the direction that a player was hit from or whether the player got a fire flower more easily later. |
I think you should trigger rumble when there's any type of screenshake, which does not require player |
Hm, would be a good start and one could immediately combine it with #2741. |
Affects GameControllerManager::rumble() and JoystickManager::rumble(). The functions were overloaded so as to be made configurable, but there is a default rumble (that now lasts 100ms instead of 300ms). Just a small refactoring job.
226e759
to
b1e6f7c
Compare
I'll look at whether I can get the Camera class to talk to GameControllerManager. |
it's not a singleton? |
Affects GameControllerManager::rumble() and JoystickManager::rumble().
The functions were overloaded so as to be made configurable, but there
is a default rumble (that now lasts 100ms instead of 300ms).
Just a small refactoring job.
I have not figured out how to expose the rumble function to Player.cpp in a clean way yet, but this is a start.
Related to #2741.