summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Häggqvist <rasher@rasher.dk>2007-10-08 00:03:15 +0000
committerJonas Häggqvist <rasher@rasher.dk>2007-10-08 00:03:15 +0000
commit46b7028f918101df9de81d698ad2c1bb09060bd3 (patch)
tree74cea2b98ff1be64c0f7486fb04bf00a0f464839
parent548886a17e522cdf5797d4380e64192fa0cfbad1 (diff)
downloadrockbox-46b7028f918101df9de81d698ad2c1bb09060bd3.tar.gz
rockbox-46b7028f918101df9de81d698ad2c1bb09060bd3.zip
Keep a 2 pixel margin in the instructions screen.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15033 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/robotfindskitten.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/apps/plugins/robotfindskitten.c b/apps/plugins/robotfindskitten.c
index 8100cd8520..a2786b7e2d 100644
--- a/apps/plugins/robotfindskitten.c
+++ b/apps/plugins/robotfindskitten.c
@@ -411,8 +411,9 @@ static void play_animation(int input)
411 411
412static void instructions() 412static void instructions()
413{ 413{
414 int y, space_w, width, height; 414#define MARGIN 2
415 unsigned short x = 0, i = 0; 415 int y = MARGIN, space_w, width, height;
416 unsigned short x = MARGIN, i = 0;
416#define WORDS (sizeof instructions / sizeof (char*)) 417#define WORDS (sizeof instructions / sizeof (char*))
417 static char* instructions[] = { 418 static char* instructions[] = {
418#if 0 419#if 0
@@ -427,23 +428,22 @@ static void instructions()
427 }; 428 };
428 rb->lcd_clear_display(); 429 rb->lcd_clear_display();
429 rb->lcd_getstringsize(" ", &space_w, &height); 430 rb->lcd_getstringsize(" ", &space_w, &height);
430 y = 0;
431 for (i = 0; i < WORDS; i++) { 431 for (i = 0; i < WORDS; i++) {
432 rb->lcd_getstringsize(instructions[i], &width, NULL); 432 rb->lcd_getstringsize(instructions[i], &width, NULL);
433 /* Skip to next line if the current one can't fit the word */ 433 /* Skip to next line if the current one can't fit the word */
434 if (x + width > LCD_WIDTH) { 434 if (x + width > LCD_WIDTH - MARGIN) {
435 x = 0; 435 x = MARGIN;
436 y += height; 436 y += height;
437 } 437 }
438 /* .. or if the word is the empty string */ 438 /* .. or if the word is the empty string */
439 if (rb->strcmp(instructions[i], "") == 0) { 439 if (rb->strcmp(instructions[i], "") == 0) {
440 x = 0; 440 x = MARGIN;
441 y += height; 441 y += height;
442 continue; 442 continue;
443 } 443 }
444 /* We filled the screen */ 444 /* We filled the screen */
445 if (y + height > LCD_HEIGHT) { 445 if (y + height > LCD_HEIGHT - MARGIN) {
446 y = 0; 446 y = MARGIN;
447 pause(); 447 pause();
448 rb->lcd_clear_display(); 448 rb->lcd_clear_display();
449 } 449 }