summaryrefslogtreecommitdiff
path: root/apps/plugins/pong.c
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2009-10-18 15:50:30 +0000
committerBertrik Sikken <bertrik@sikken.nl>2009-10-18 15:50:30 +0000
commitd24d885aa42b5087d89f12dabad13895051da4e2 (patch)
tree61584fe54660aab9a57bcb67c5a65cb888f4a38b /apps/plugins/pong.c
parent1c64a4d3e0a4ae2f4eb537f00c7dc4372ca5df88 (diff)
downloadrockbox-d24d885aa42b5087d89f12dabad13895051da4e2.tar.gz
rockbox-d24d885aa42b5087d89f12dabad13895051da4e2.zip
Use wrap-safe TIME_BEFORE/TIME_AFTER macros to compare times with current_time, instead of comparing them directly.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23246 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/pong.c')
-rw-r--r--apps/plugins/pong.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/apps/plugins/pong.c b/apps/plugins/pong.c
index a6144d9664..1c6f02eb0d 100644
--- a/apps/plugins/pong.c
+++ b/apps/plugins/pong.c
@@ -450,21 +450,21 @@ int keys(struct pong *p)
450 int start = *rb->current_tick; 450 int start = *rb->current_tick;
451 int end = start + time; 451 int end = start + time;
452 452
453 while(end > *rb->current_tick) { 453 while(TIME_BEFORE(*rb->current_tick, end)) {
454 key = rb->button_get_w_tmo(end - *rb->current_tick); 454 key = rb->button_get_w_tmo(end - *rb->current_tick);
455 455
456#ifdef HAVE_TOUCHSCREEN 456#ifdef HAVE_TOUCHSCREEN
457 short touch_x, touch_y; 457 short touch_x, touch_y;
458 if(key & BUTTON_TOUCHSCREEN) 458 if(key & BUTTON_TOUCHSCREEN)
459 { 459 {
460 touch_x = rb->button_get_data() >> 16; 460 touch_x = rb->button_get_data() >> 16;
461 touch_y = rb->button_get_data() & 0xFFFF; 461 touch_y = rb->button_get_data() & 0xFFFF;
462 if(touch_x >= xpos[0] && touch_x <= xpos[0]+(PAD_WIDTH*4)) 462 if(touch_x >= xpos[0] && touch_x <= xpos[0]+(PAD_WIDTH*4))
463 padmove(&p->w_pad[0], touch_y-(p->e_pad[0]*2+PAD_HEIGHT)/2); 463 padmove(&p->w_pad[0], touch_y-(p->e_pad[0]*2+PAD_HEIGHT)/2);
464 464
465 if(touch_x >= xpos[1]-(PAD_WIDTH*4) && touch_x <= xpos[1]) 465 if(touch_x >= xpos[1]-(PAD_WIDTH*4) && touch_x <= xpos[1])
466 padmove(&p->w_pad[1], touch_y-(p->e_pad[1]*2+PAD_HEIGHT)/2); 466 padmove(&p->w_pad[1], touch_y-(p->e_pad[1]*2+PAD_HEIGHT)/2);
467 } 467 }
468#endif 468#endif
469 469
470#ifdef HAS_BUTTON_HOLD 470#ifdef HAS_BUTTON_HOLD