From 72362f907a78c0aa348949e693cff1f7e9811bb412c89fb558b787299e517740 Mon Sep 17 00:00:00 2001 From: Dirk Stoecker Date: Mon, 29 Jul 2024 13:21:11 +0000 Subject: [PATCH] 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 --- ltris-gamepad-pause-exit.patch | 46 ++++++++++++++++++++++++++++++++++ ltris.changes | 6 +++++ ltris.spec | 5 ++-- 3 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 ltris-gamepad-pause-exit.patch diff --git a/ltris-gamepad-pause-exit.patch b/ltris-gamepad-pause-exit.patch new file mode 100644 index 0000000..826ada3 --- /dev/null +++ b/ltris-gamepad-pause-exit.patch @@ -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(); diff --git a/ltris.changes b/ltris.changes index 256177d..2747620 100644 --- a/ltris.changes +++ b/ltris.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jun 20 12:12:26 UTC 2024 - Atri Bhattacharya + +- 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 diff --git a/ltris.spec b/ltris.spec index 1cc3588..bfbf84c 100644 --- a/ltris.spec +++ b/ltris.spec @@ -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):