summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-02-16 01:18:14 +0000
committerJens Arnold <amiconn@rockbox.org>2005-02-16 01:18:14 +0000
commit952d9d0fcf08f23f8735f512aed0179be5528ae7 (patch)
treea150ee5156050d2e3e48b8277e59570c6817508c /apps
parent5b2d874a361663dd17413b8bcf2439fc0f8716d8 (diff)
downloadrockbox-952d9d0fcf08f23f8735f512aed0179be5528ae7.tar.gz
rockbox-952d9d0fcf08f23f8735f512aed0179be5528ae7.zip
Patch #1123576 by Jonas Haggqvist: pong adapted to variable screen resolution (iriver).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5965 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/pong.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/apps/plugins/pong.c b/apps/plugins/pong.c
index d98becf06a..2fec2e3a44 100644
--- a/apps/plugins/pong.c
+++ b/apps/plugins/pong.c
@@ -20,18 +20,18 @@
20 20
21#ifdef HAVE_LCD_BITMAP 21#ifdef HAVE_LCD_BITMAP
22 22
23#define PAD_HEIGHT 10 23#define PAD_HEIGHT LCD_HEIGHT / 6 /* Recorder: 10 iRiver: 21 */
24#define PAD_WIDTH 2 24#define PAD_WIDTH LCD_WIDTH / 50 /* Recorder: 2 iRiver: 2 */
25 25
26#define BALL_HEIGTH 2 26#define BALL_HEIGTH LCD_HEIGHT / 32 /* Recorder: 2 iRiver: 4 */
27#define BALL_WIDTH 2 27#define BALL_WIDTH LCD_HEIGHT / 32 /* We want a square ball */
28 28
29#define SPEEDX 150 29#define SPEEDX ( LCD_WIDTH * 3 ) / 2 /* Recorder: 168 iRiver: 240 */
30#define SPEEDY 120 30#define SPEEDY LCD_HEIGHT * 2 /* Recorder: 128 iRiver: 256 */
31 31
32#define RES 100 32#define RES 100
33 33
34#define MOVE_STEP 2 /* move pad this many steps up/down each move */ 34#define MOVE_STEP LCD_HEIGHT / 32 /* move pad this many steps up/down each move */
35 35
36/* variable button definitions */ 36/* variable button definitions */
37#if CONFIG_KEYPAD == RECORDER_PAD 37#if CONFIG_KEYPAD == RECORDER_PAD
@@ -291,9 +291,11 @@ int keys(struct pong *p)
291void showscore(struct pong *p) 291void showscore(struct pong *p)
292{ 292{
293 static char buffer[20]; 293 static char buffer[20];
294 int w;
294 295
295 rb->snprintf(buffer, sizeof(buffer), "%d - %d", p->score[0], p->score[1]); 296 rb->snprintf(buffer, sizeof(buffer), "%d - %d", p->score[0], p->score[1]);
296 rb->lcd_puts(4, 0, buffer); 297 w = rb->lcd_getstringsize(buffer, NULL, NULL);
298 rb->lcd_putsxy( (LCD_WIDTH / 2) - (w / 2), 0, buffer);
297} 299}
298 300
299/* this is the plugin entry point */ 301/* this is the plugin entry point */