On Wed, 8 May 2013 15:58:41 -0700 Vincent Cheng wrote: > On Wed, May 8, 2013 at 2:56 PM, Francesco Poli > <invernom...@paranoici.org> wrote: > > On Mon, 6 May 2013 01:34:07 -0700 Vincent Cheng wrote: [...] > >> Can you try testing the attached patch? It was forwarded to the > >> upstream's bug report tracker (from a quick look, it seems reasonable, > >> but I don't know if it actually solves the issue, and again I don't > >> have a joystick to test with). > > > > Wasn't this patch meant for bug #706564 ? > > Oops, sorry about that! Yes, this is meant for #706564.
Hi Vincent, I finally managed to test the patch. Applying the patch to the Debian source package (supertux/0.3.3-5) required a little (automatic) re-adaptation and adding some patch description to satisfy the 3.0 (quilt) debian source format. The resulting re-adapted patch is attached, in the hope that it may save you the (admittedly very little) time to redo what I have already done. After adding this patch to the quilt series and rebuilding the Debian package, the bug seems to be fixed. Please apply the patch to the Debian package and inform upstream the that patch works. Thanks a lot for your time! P.S.: I wonder what would happen if a user had two or more joysticks/joypads... I suppose that starting supertux with one joystick plugged could destroy the input configuration previously set for another joystick... I cannot test this, as I have one joypad only, but I am under the impression that a better and longer-term solution for the bug that I experienced would require recognizing different joystick models (this seems to be already done by supertux, at least for USB joysticks) and storing distinct configuration settings for each different joystick model. Please talk to upstream about this, if you agree. Thanks again. -- http://www.inventati.org/frx/frx-gpg-key-transition-2010.txt New GnuPG key, see the transition document! ..................................................... Francesco Poli . GnuPG key fpr == CA01 1147 9CD2 EFDF FB82 3925 3E1C 27E1 1F69 BFFE
Description: Do not reset joystick conf when the joystick is not plugged in If the game is started when the joystick/joypad is not plugged in, the joystick input configuration should not be reset to its default state. Author: Arian Behvandnejad <bu...@lavabit.com> Origin: https://supertux.lethargik.org/bugs/file_download.php?file_id=657&type=bug Bug: https://supertux.lethargik.org/bugs/view.php?id=959 Bug-Debian: http://bugs.debian.org/706564 Last-Update: 2013-05-13 --- supertux-0.3.3.orig/src/control/joystickkeyboardcontroller.cpp +++ supertux-0.3.3/src/control/joystickkeyboardcontroller.cpp @@ -229,8 +229,10 @@ JoystickKeyboardController::read(const R continue; } + bool js_available = joysticks.size() > 0; + if (map->get("button", button)) { - if(button < 0 || button >= max_joybuttons) { + if(js_available && (button < 0 || button >= max_joybuttons)) { log_info << "Invalid button '" << button << "' in buttonmap" << std::endl; continue; } @@ -238,7 +240,7 @@ JoystickKeyboardController::read(const R } if (map->get("axis", axis)) { - if (axis == 0 || abs(axis) > max_joyaxis) { + if (js_available && (axis == 0 || abs(axis) > max_joyaxis)) { log_info << "Invalid axis '" << axis << "' in axismap" << std::endl; continue; } @@ -246,7 +248,8 @@ JoystickKeyboardController::read(const R } if (map->get("hat", hat)) { - if (hat != SDL_HAT_UP && + if (js_available && + hat != SDL_HAT_UP && hat != SDL_HAT_DOWN && hat != SDL_HAT_LEFT && hat != SDL_HAT_RIGHT) {
pgpX_iDSJY3Jv.pgp
Description: PGP signature