[xscreensaver] pong: adjust paddle position again on new game (bug 1199713)

Mamoru TASAKA mtasaka at fedoraproject.org
Mon Mar 9 04:35:22 UTC 2015


commit 83ab4c34ad71dbf0444d1633f7a8c0b1c7a31d3a
Author: Mamoru TASAKA <mtasaka at fedoraproject.org>
Date:   Mon Mar 9 13:35:07 2015 +0900

    pong: adjust paddle position again on new game (bug 1199713)

 ...-adjust-paddle-position-again-on-new-game.patch | 43 ++++++++++++++++++++++
 xscreensaver.spec                                  |  8 +++-
 2 files changed, 50 insertions(+), 1 deletion(-)
---
diff --git a/xscreensaver-5.32-0009-pong-adjust-paddle-position-again-on-new-game.patch b/xscreensaver-5.32-0009-pong-adjust-paddle-position-again-on-new-game.patch
new file mode 100644
index 0000000..34f1c4e
--- /dev/null
+++ b/xscreensaver-5.32-0009-pong-adjust-paddle-position-again-on-new-game.patch
@@ -0,0 +1,43 @@
+From 8b0464926ecabef09c5a5d9d6a982aec84226f7a Mon Sep 17 00:00:00 2001
+From: Mamoru TASAKA <mtasaka at fedoraproject.org>
+Date: Mon, 9 Mar 2015 13:21:53 +0900
+Subject: [PATCH] pong: adjust paddle position again on new game
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1199713
+
+Each time start_game() is called, paddle length is
+shortened. Then when calling new_game() paddle length
+is reset (so enlarged), and we have to adjust paddle
+position again.
+---
+ hacks/pong.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/hacks/pong.c b/hacks/pong.c
+index 38e1d84..a688728 100644
+--- a/hacks/pong.c
++++ b/hacks/pong.c
+@@ -106,6 +106,9 @@ enum {
+ };
+ 
+ static void
++p_hit_top_bottom(Paddle *p);
++
++static void
+ hit_top_bottom(struct state *st)
+ {
+   if ( (st->ball.y <= PONG_TMARG) ||
+@@ -155,6 +158,10 @@ new_game(struct state *st)
+ 
+   st->l_paddle.h = PONG_H/4;
+   st->r_paddle.h = PONG_H/4;
++  /* Adjust paddle position again, because
++     paddle length is enlarged (reset) above. */
++  p_hit_top_bottom(&st->l_paddle);
++  p_hit_top_bottom(&st->r_paddle);
+ }
+ 
+ static void
+-- 
+2.1.0
+
diff --git a/xscreensaver.spec b/xscreensaver.spec
index 22f1121..b92c847 100644
--- a/xscreensaver.spec
+++ b/xscreensaver.spec
@@ -10,7 +10,7 @@
 %define split_getimage   1
 %endif
 
-%define fedora_rel    9
+%define fedora_rel    10
 
 %global use_clang_as_cc 0
 %global use_clang_analyze 0
@@ -97,6 +97,8 @@ Patch207:        xscreensaver-5.32-0007-utils-utf8wc.c-fix-Unicode-Combining-Dia
 # pick_font_1: rescue when XftFontOpenXlfd fails correctly
 # bug 1195437
 Patch208:        xscreensaver-5.32-0008-pick_font_1-rescue-when-XftFontOpenXlfd-fails-correc.patch
+# pong: adjust paddle position again on new game (bug 1199713)
+Patch209:        xscreensaver-5.32-0009-pong-adjust-paddle-position-again-on-new-game.patch
 #
 # Patches end
 Requires:        xscreensaver-base = %{epoch}:%{version}-%{release}
@@ -361,6 +363,7 @@ gzip -dc %{SOURCE50} > po/ja.po
 %__cat %PATCH206 | %__git am
 %__cat %PATCH207 | %__git am
 %__cat %PATCH208 | %__git am
+%__cat %PATCH209 | %__git am
 
 change_option(){
    set +x
@@ -1011,6 +1014,9 @@ exit 0
 %endif
 
 %changelog
+* Mon Mar  9 2015 Mamoru TASAKA <mtasaka at fedoraproject.org> - 1:5.32-10
+- pong: adjust paddle position again on new game (bug 1199713)
+
 * Fri Feb 27 2015 Mamoru TASAKA <mtasaka at fedoraproject.org> - 1:5.32-9
 - pick_font_1: rescue when XftFontOpenXlfd fails correctly
   (bug 1195437)


More information about the scm-commits mailing list