Accepting request 1190276 from home:badshah400:branches:games

Add ltris-gamepad-pause-exit.patch: Interpret pause button from gamepad (https://sourceforge.net/p/lgames/patches/35/).

OBS-URL: https://build.opensuse.org/request/show/1190276
OBS-URL: https://build.opensuse.org/package/show/games/ltris?expand=0&rev=29
This commit is contained in:
Dirk Stoecker 2024-07-29 13:21:11 +00:00 committed by Git OBS Bridge
parent 5dbf2f2a7c
commit 72362f907a
3 changed files with 55 additions and 2 deletions

View File

@ -0,0 +1,46 @@
---
src/tetris.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
Index: ltris-1.3.2/src/tetris.c
===================================================================
--- ltris-1.3.2.orig/src/tetris.c
+++ ltris-1.3.2/src/tetris.c
@@ -463,6 +463,9 @@ void tetris_set_bowl_controls(int i, SDL
bc->hdrop = CS_DOWN;
if (ev->jbutton.button == config.gp_hold)
bc->hold = CS_DOWN;
+ if (ev->jbutton.button == config.gp_pause)
+ if ( b )
+ bowl_toggle_pause( b );
}
}
}
@@ -515,12 +518,12 @@ void tetris_run()
SDL_ShowCursor( 0 );
- fpsStart = SDL_GetTicks();
- fpsCycles = 0;
- if (config.fps == 1)
- maxDelay = 20;
- else
- maxDelay = 17;
+ fpsStart = SDL_GetTicks();
+ fpsCycles = 0;
+ if (config.fps == 1)
+ maxDelay = 20;
+ else
+ maxDelay = 17;
/* main loop */
fade_screen( FADE_IN, FADE_DEF_TIME );
@@ -544,6 +547,8 @@ void tetris_run()
leave = 1;
}else if (event.key.keysym.sym == config.pause_key)
request_pause = 1;
+ else if (event.type == SDL_JOYBUTTONDOWN && event.jbutton.button == config.gp_pause)
+ request_pause = 1;
else switch ( event.key.keysym.sym ) {
case SDLK_F5:
gamepad_close();

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Jun 20 12:12:26 UTC 2024 - Atri Bhattacharya <badshah400@gmail.com>
- Add ltris-gamepad-pause-exit.patch: Interpret pause button from
gamepad (https://sourceforge.net/p/lgames/patches/35/).
-------------------------------------------------------------------
Sun Jun 9 05:11:55 UTC 2024 - Carsten Ziepke <kieltux@gmail.com>

View File

@ -26,6 +26,8 @@ URL: http://lgames.sourceforge.net/index.php?project=LTris
Source: https://sourceforge.net/projects/lgames/files/ltris/ltris-%{version}.tar.gz
Source1: %{name}.desktop
Patch0: ltris-no_system_wide_hiscore_file.patch
# PATCH-FIX-UPSTREAM ltris-gamepad-pause-exit.patch badshah400@gmail.com -- Interpret pause button from gamepad (https://sourceforge.net/p/lgames/patches/35/)
Patch1: ltris-gamepad-pause-exit.patch
BuildRequires: SDL-devel
BuildRequires: fdupes
BuildRequires: pkgconfig
@ -40,8 +42,7 @@ and multiplayer with up to three players either human or CPU
controlled.
%prep
%setup -q
%autopatch -p1
%autosetup -p1
# we patch both Makefile.am and Makefile.in; touch Makefile.in here again
# to make sure configure won't run autoreconf (which it does if the .am file
# is newer than the .in file):