diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-09-05 17:58:27 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-09-05 17:58:27 +0000 |
commit | 3fdb3607df325c11738834d101535fb82823b598 (patch) | |
tree | df4b508452e8211de22ffd0dcc3b3a8d1f1b6c89 | |
parent | 52681472c8a0105d8a0d2b73e547edcb7a8a0a8e (diff) | |
download | rockbox-3fdb3607df325c11738834d101535fb82823b598.tar.gz rockbox-3fdb3607df325c11738834d101535fb82823b598.zip |
Credits gone movie-style! ;-)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2189 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/credits.c | 61 |
1 files changed, 45 insertions, 16 deletions
diff --git a/apps/credits.c b/apps/credits.c index 4d24800e06..0325a6f4fe 100644 --- a/apps/credits.c +++ b/apps/credits.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include "lcd.h" | 21 | #include "lcd.h" |
22 | #include "kernel.h" | 22 | #include "kernel.h" |
23 | #include "button.h" | 23 | #include "button.h" |
24 | #include "sprintf.h" | ||
24 | 25 | ||
25 | char* credits[] = { | 26 | char* credits[] = { |
26 | "Bjorn Stenberg", | 27 | "Bjorn Stenberg", |
@@ -73,39 +74,67 @@ char* credits[] = { | |||
73 | #define DISPLAY_TIME HZ | 74 | #define DISPLAY_TIME HZ |
74 | #endif | 75 | #endif |
75 | 76 | ||
77 | #ifdef HAVE_LCD_CHARCELLS | ||
76 | void roll_credits(void) | 78 | void roll_credits(void) |
77 | { | 79 | { |
78 | int i; | 80 | int i; |
79 | int j; | ||
80 | int line = 0; | 81 | int line = 0; |
81 | int numnames = sizeof(credits)/sizeof(char*); | 82 | int numnames = sizeof(credits)/sizeof(char*); |
82 | 83 | ||
83 | lcd_clear_display(); | 84 | lcd_clear_display(); |
84 | 85 | ||
85 | #ifdef HAVE_LCD_BITMAP | ||
86 | lcd_setmargins(0,8); | ||
87 | #endif | ||
88 | |||
89 | for ( i=0; i < numnames; i += MAX_LINES ) | 86 | for ( i=0; i < numnames; i += MAX_LINES ) |
90 | { | 87 | { |
91 | lcd_clear_display(); | 88 | lcd_clear_display(); |
92 | #ifdef HAVE_LCD_BITMAP | ||
93 | lcd_putsxy(0, 0, " [Credits]",0); | ||
94 | #endif | ||
95 | for(line = 0;line < MAX_LINES && line+i < numnames;line++) | 89 | for(line = 0;line < MAX_LINES && line+i < numnames;line++) |
96 | { | 90 | { |
97 | lcd_puts(0, line, credits[line+i]); | 91 | lcd_puts(0, line, credits[line+i]); |
98 | } | 92 | } |
99 | 93 | ||
100 | lcd_update(); | ||
101 | |||
102 | /* abort on keypress */ | 94 | /* abort on keypress */ |
103 | for ( j=0;j<10;j++ ) | 95 | if (button_get_w_tmo(DISPLAY_TIME)) |
104 | { | 96 | return; |
105 | sleep(DISPLAY_TIME/10); | ||
106 | if (button_get(false)) | ||
107 | return; | ||
108 | } | ||
109 | } | 97 | } |
110 | return; | 98 | return; |
111 | } | 99 | } |
100 | #else | ||
101 | |||
102 | void roll_credits(void) | ||
103 | { | ||
104 | int i; | ||
105 | int line = 0; | ||
106 | int numnames = sizeof(credits)/sizeof(char*); | ||
107 | char buffer[40]; | ||
108 | |||
109 | int y=64; | ||
110 | |||
111 | int height; | ||
112 | int width; | ||
113 | |||
114 | lcd_getfontsize(0, &width, &height); | ||
115 | |||
116 | while(1) { | ||
117 | lcd_clear_display(); | ||
118 | for ( i=0; i <= (64-y)/height; i++ ) | ||
119 | lcd_putsxy(0, i*height+y, line+i<numnames?credits[line+i]:"", 0); | ||
120 | snprintf(buffer, sizeof(buffer), " [Credits] %2d/%2d ", | ||
121 | line+1, numnames); | ||
122 | lcd_putsxy(0, 0, buffer, 0); | ||
123 | lcd_update(); | ||
124 | |||
125 | if (button_get_w_tmo(HZ/10)) | ||
126 | return; | ||
127 | |||
128 | y-=2; | ||
129 | |||
130 | if(y<0) { | ||
131 | line++; | ||
132 | if(line >= numnames) | ||
133 | break; | ||
134 | y+=8; | ||
135 | } | ||
136 | |||
137 | } | ||
138 | return; | ||
139 | } | ||
140 | #endif | ||