summaryrefslogtreecommitdiff
path: root/apps/plugins
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/plugins
parent5b2d874a361663dd17413b8bcf2439fc0f8716d8 (diff)
downloadrockbox-952d9d0fcf08f23f8735f512aed0179be5528ae7.zip
rockbox-952d9d0fcf08f23f8735f512aed0179be5528ae7.tar.gz
rockbox-952d9d0fcf08f23f8735f512aed0179be5528ae7.tar.bz2
rockbox-952d9d0fcf08f23f8735f512aed0179be5528ae7.tar.xz
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/plugins')
-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 d98becf..2fec2e3 100644
--- a/apps/plugins/pong.c
+++ b/apps/plugins/pong.c
@@ -20,18 +20,18 @@
#ifdef HAVE_LCD_BITMAP
-#define PAD_HEIGHT 10
-#define PAD_WIDTH 2
+#define PAD_HEIGHT LCD_HEIGHT / 6 /* Recorder: 10 iRiver: 21 */
+#define PAD_WIDTH LCD_WIDTH / 50 /* Recorder: 2 iRiver: 2 */
-#define BALL_HEIGTH 2
-#define BALL_WIDTH 2
+#define BALL_HEIGTH LCD_HEIGHT / 32 /* Recorder: 2 iRiver: 4 */
+#define BALL_WIDTH LCD_HEIGHT / 32 /* We want a square ball */
-#define SPEEDX 150
-#define SPEEDY 120
+#define SPEEDX ( LCD_WIDTH * 3 ) / 2 /* Recorder: 168 iRiver: 240 */
+#define SPEEDY LCD_HEIGHT * 2 /* Recorder: 128 iRiver: 256 */
#define RES 100
-#define MOVE_STEP 2 /* move pad this many steps up/down each move */
+#define MOVE_STEP LCD_HEIGHT / 32 /* move pad this many steps up/down each move */
/* variable button definitions */
#if CONFIG_KEYPAD == RECORDER_PAD
@@ -291,9 +291,11 @@ int keys(struct pong *p)
void showscore(struct pong *p)
{
static char buffer[20];
+ int w;
rb->snprintf(buffer, sizeof(buffer), "%d - %d", p->score[0], p->score[1]);
- rb->lcd_puts(4, 0, buffer);
+ w = rb->lcd_getstringsize(buffer, NULL, NULL);
+ rb->lcd_putsxy( (LCD_WIDTH / 2) - (w / 2), 0, buffer);
}
/* this is the plugin entry point */