[tecnoballz] 02/03: Fix right click game over bug.
Markus Koschany
apo-guest at moszumanska.debian.org
Tue Feb 10 16:48:29 UTC 2015
This is an automated email from the git hooks/post-receive script.
apo-guest pushed a commit to branch master
in repository tecnoballz.
commit f80e9a743c1373a080a76432d4dc4d4e9a158ca1
Author: Markus Koschany <apo at gambaru.de>
Date: Tue Feb 10 17:31:31 2015 +0100
Fix right click game over bug.
Thanks: Celelibi for the report and Bruno Ethvignot for the patch.
Closes: #776263
---
debian/patches/gigablitz-gauge.patch | 2 -
debian/patches/right-click-game-over.patch | 140 +++++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 141 insertions(+), 2 deletions(-)
diff --git a/debian/patches/gigablitz-gauge.patch b/debian/patches/gigablitz-gauge.patch
index 7589bd2..a70f36d 100644
--- a/debian/patches/gigablitz-gauge.patch
+++ b/debian/patches/gigablitz-gauge.patch
@@ -2,8 +2,6 @@ From: Markus Koschany <apo at gambaru.de>
Date: Tue, 10 Feb 2015 17:27:03 +0100
Subject: gigablitz gauge
-Forwarded: yes
-Bug: https://bugs.debian.org/776342
---
src/right_panel_score.cc | 1 -
1 file changed, 1 deletion(-)
diff --git a/debian/patches/right-click-game-over.patch b/debian/patches/right-click-game-over.patch
new file mode 100644
index 0000000..e0df498
--- /dev/null
+++ b/debian/patches/right-click-game-over.patch
@@ -0,0 +1,140 @@
+From: Markus Koschany <apo at gambaru.de>
+Date: Tue, 10 Feb 2015 17:31:03 +0100
+Subject: right click game over
+
+Forwarded: yes
+Bug: https://bugs.debian.org/776263
+---
+ include/sprite_ball.h | 1 +
+ src/controller_balls.cc | 45 ++-------------------------------------------
+ src/sprite_ball.cc | 42 ++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 45 insertions(+), 43 deletions(-)
+
+diff --git a/include/sprite_ball.h b/include/sprite_ball.h
+index 83a5736..2f8e144 100644
+--- a/include/sprite_ball.h
++++ b/include/sprite_ball.h
+@@ -200,6 +200,7 @@ class sprite_ball:public sprite_object
+ void set_on_ejector (Uint32 eject_id, Uint32 otime = 1);
+ void disable_stick ();
+ void accelerate ();
++ void move_sticked_paddle(sprite_paddle * paddle);
+ virtual bool collision (sprite_object * sprite);
+
+ private:
+diff --git a/src/controller_balls.cc b/src/controller_balls.cc
+index 10844c9..2685166 100644
+--- a/src/controller_balls.cc
++++ b/src/controller_balls.cc
+@@ -232,6 +232,7 @@ controller_balls::check_outside_balls ()
+ num_of_sprites = 1;
+ ball->paddle_touched->stick_ball (ball);
+ ball->starts_again (ball->paddle_touched);
++ ball->move_sticked_paddle (paddle);
+ head_anim->start_interference ();
+ current_player->remove_life (1);
+ ships->force_explosion ();
+@@ -409,49 +410,7 @@ controller_balls::move_balls ()
+ }
+
+ /* displacement of the balls sticked to the paddle */
+- switch (ball->sticky_paddle_num)
+- {
+- case controller_paddles::BOTTOM_PADDLE:
+- j = (paddle->collision_width >> 1) -
+- ((ball->collision_width >> 1) + 1);
+- j += paddle->x_coord;
+- ball->x_coord = j;
+- j = (paddle->y_coord) - (ball->collision_height + 1);
+- ball->y_coord = j;
+- break;
+-
+- case controller_paddles::RIGHT_PADDLE:
+- j = (paddle->x_coord) - (ball->collision_width - 1);
+- ball->x_coord = j;
+- j =
+- (paddle->collision_height >> 1) -
+- ((ball->collision_height >> 1) + 1);
+- j += paddle->y_coord;
+- ball->y_coord = j;
+- break;
+-
+- case controller_paddles::TOP_PADDLE:
+- j =
+- (paddle->collision_width >> 1) -
+- ((ball->collision_width >> 1) + 1);
+- j += paddle->x_coord;
+- ball->x_coord = j;
+- j = (paddle->y_coord) + paddle->collision_height + 1;
+- ball->y_coord = j;
+- break;
+-
+- case controller_paddles::LEFT_PADDLE:
+- j = (paddle->x_coord) + (paddle->collision_width) + 1;
+- ball->x_coord = j;
+- j =
+- (paddle->collision_height >> 1) -
+- ((ball->collision_height >> 1) + 1);
+- j += paddle->y_coord;
+- ball->y_coord = j;
+- break;
+-
+- }
+-
++ ball->move_sticked_paddle (paddle);
+
+ if (--ball->viewfinder_delay < 0)
+ {
+diff --git a/src/sprite_ball.cc b/src/sprite_ball.cc
+index bd34e71..7f237e3 100644
+--- a/src/sprite_ball.cc
++++ b/src/sprite_ball.cc
+@@ -360,6 +360,48 @@ sprite_ball::accelerate ()
+ }
+ }
+
++/** Displacement of the balls sticked to the paddle
++ * */
++void
++sprite_ball::move_sticked_paddle (sprite_paddle * paddle)
++{
++ Sint32 j;
++ switch (sticky_paddle_num)
++ {
++ case controller_paddles::BOTTOM_PADDLE:
++ j = (paddle->collision_width >> 1) - ((collision_width >> 1) + 1);
++ j += paddle->get_x_coord ();
++ x_coord = j;
++ j = (paddle->get_y_coord ()) - (collision_height + 1);
++ y_coord = j;
++ break;
++
++ case controller_paddles::RIGHT_PADDLE:
++ j = (paddle->get_x_coord ()) - (collision_width - 1);
++ x_coord = j;
++ j = (paddle->collision_height >> 1) - ((collision_height >> 1) + 1);
++ j += paddle->get_y_coord ();
++ y_coord = j;
++ break;
++
++ case controller_paddles::TOP_PADDLE:
++ j = (paddle->collision_width >> 1) - ((collision_width >> 1) + 1);
++ j += paddle->get_x_coord ();
++ x_coord = j;
++ j = (paddle->get_y_coord ()) + paddle->collision_height + 1;
++ y_coord = j;
++ break;
++
++ case controller_paddles::LEFT_PADDLE:
++ j = (paddle->get_x_coord ()) + (paddle->collision_width) + 1;
++ x_coord = j;
++ j = (paddle->collision_height >> 1) - ((collision_height >> 1) + 1);
++ j += paddle->get_y_coord ();
++ y_coord = j;
++ break;
++ }
++}
++
+ /**
+ + * Check collision beetween a ball and another sprite.
+ + * Override sprite_object::collision(sprite_object *).
diff --git a/debian/patches/series b/debian/patches/series
index 0561a42..8598b42 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@ disable-Werror.patch
custom-CXXFLAGS.patch
manpage.patch
gigablitz-gauge.patch
+right-click-game-over.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/tecnoballz.git
More information about the Pkg-games-commits
mailing list