projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
From http://www.jwz.org/xscreensaver/xscreensaver-5.33.tar.gz
[xscreensaver]
/
hacks
/
pong.c
diff --git
a/hacks/pong.c
b/hacks/pong.c
index 025a0c1914089decd7a9e8355255429d9afcc9e0..a68872865b44e3765ca6c2bff15ef7577ae98229 100644
(file)
--- a/
hacks/pong.c
+++ b/
hacks/pong.c
@@
-105,6
+105,9
@@
enum {
PONG_TMARG = 10
};
PONG_TMARG = 10
};
+static void
+p_hit_top_bottom(Paddle *p);
+
static void
hit_top_bottom(struct state *st)
{
static void
hit_top_bottom(struct state *st)
{
@@
-155,6
+158,10
@@
new_game(struct state *st)
st->l_paddle.h = PONG_H/4;
st->r_paddle.h = PONG_H/4;
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
}
static void
@@
-678,6
+685,7
@@
static unsigned long
pong_draw (Display *dpy, Window window, void *closure)
{
struct state *st = (struct state *) closure;
pong_draw (Display *dpy, Window window, void *closure)
{
struct state *st = (struct state *) closure;
+ const analogtv_reception *reception = &st->reception;
if (st->clock)
{
if (st->clock)
{
@@
-737,12
+745,14
@@
pong_draw (Display *dpy, Window window, void *closure)
}
if (1) paint_ball(st);
}
if (1) paint_ball(st);
- analogtv_init_signal(st->tv, st->noise);
analogtv_reception_update(&st->reception);
analogtv_reception_update(&st->reception);
- analogtv_add_signal(st->tv, &st->reception);
- analogtv_draw(st->tv);
+ analogtv_draw(st->tv, st->noise, &reception, 1);
- return 10000;
+#ifdef USE_IPHONE
+ return 0;
+#else
+ return 5000;
+#endif
}
\f
}
\f