to properly make use of the joystick support, witchblast needed some

help in the joystick configuration menu, i.e. ignore button release
and limit input for the axis to the HAT. Test reports by Raf Czlonka.

OK pascal@
This commit is contained in:
sebastia 2020-03-18 18:55:24 +00:00
parent 4a4a8048a8
commit bffdcfe8aa
2 changed files with 24 additions and 3 deletions

View File

@ -1,11 +1,11 @@
# $OpenBSD: Makefile,v 1.4 2019/07/14 00:39:37 naddy Exp $
# $OpenBSD: Makefile,v 1.5 2020/03/18 18:55:24 sebastia Exp $
COMMENT = roguelite dungeon crawler game
GH_ACCOUNT = Cirrus-Minor
GH_PROJECT = witchblast
GH_TAGNAME = v0.7.5
REVISION = 1
REVISION = 2
CATEGORIES = games x11

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-src_WitchBlastGame_cpp,v 1.1.1.1 2017/12/26 20:14:34 awolk Exp $
$OpenBSD: patch-src_WitchBlastGame_cpp,v 1.2 2020/03/18 18:55:24 sebastia Exp $
fix save location for death certificates (rip_...)
@ -14,3 +14,24 @@ Index: src/WitchBlastGame.cpp
time_t t = time(0); // get time now
struct tm * now = localtime( & t );
@@ -3109,6 +3109,11 @@ void WitchBlastGame::updateMenu()
return;
}
+ // Ignore buttons that get released
+ if (event.type == sf::Event::JoystickButtonReleased) {
+ return;
+ }
+
// button pressed ?
for (int i = 0; !found && i < nbButtons; i++)
{
@@ -3124,7 +3129,7 @@ void WitchBlastGame::updateMenu()
if (!found)
{
// axis ?
- for (int i = sf::Joystick::X; i <= sf::Joystick::PovY; i++)
+ for (int i = sf::Joystick::PovX; i <= sf::Joystick::PovY; i++)
{
if (sf::Joystick::hasAxis(0, (sf::Joystick::Axis)i))
{