alemart / opensurge

A retro game engine with a fun platformer for making your dreams come true!
http://opensurge2d.org
GNU General Public License v3.0
385 stars 33 forks source link

Move forward/backward is not working with DS4 gamepad #28

Closed xcom169 closed 4 years ago

xcom169 commented 4 years ago

Move forward/backward is not working with Sony DS4 gamepad

alemart commented 4 years ago

What's your OS?

Can you try with a different gamepad?

Modify line 668 of src/core/input.c from const float joy_threshold = 0.2f; to const float joy_threshold = 0.125f;. What happens?

Please help me debug some values. Insert a video_showmessage call after line 681 of src/core/input.c, so that

        if(input_is_joystick_enabled() && im->joystick.id < min(input_number_of_joysticks(), MAX_JOYS)) {
            in->state[IB_UP] = in->state[IB_UP] || (joy[im->joystick.id].axis[1] <= -joy_threshold);

becomes

        if(input_is_joystick_enabled() && im->joystick.id < min(input_number_of_joysticks(), MAX_JOYS)) {
            video_showmessage("%f", joy[im->joystick.id].axis[0]); /* <---------- */
            in->state[IB_UP] = in->state[IB_UP] || (joy[im->joystick.id].axis[1] <= -joy_threshold);

What values do you see on the screen when you move forwards/backwards with your joypad?

edit: also, what values do you see when you don't move?

alemart commented 4 years ago

Closed due to inactivity. Can't reproduce it with a different joypad. You may open a new issue to continue the investigation.