summaryrefslogtreecommitdiff
path: root/apps/gui/splash.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/splash.c')
-rw-r--r--apps/gui/splash.c40
1 files changed, 17 insertions, 23 deletions
diff --git a/apps/gui/splash.c b/apps/gui/splash.c
index b4b451eed6..034e4a5912 100644
--- a/apps/gui/splash.c
+++ b/apps/gui/splash.c
@@ -45,7 +45,7 @@
45 45
46#endif 46#endif
47 47
48static void splash(struct screen * screen, const char *fmt, va_list ap) 48static void splash_internal(struct screen * screen, const char *fmt, va_list ap)
49{ 49{
50 char splash_buf[MAXBUFFER]; 50 char splash_buf[MAXBUFFER];
51 short widths[MAXLINES]; 51 short widths[MAXLINES];
@@ -187,41 +187,35 @@ static void splash(struct screen * screen, const char *fmt, va_list ap)
187 screen->update(); 187 screen->update();
188} 188}
189 189
190void gui_splash(struct screen * screen, int ticks, 190void splashf(int ticks, const char *fmt, ...)
191 const char *fmt, ...)
192{ 191{
193 va_list ap; 192 va_list ap;
194 va_start( ap, fmt ); 193 int i;
195 splash(screen, fmt, ap); 194
196 va_end( ap ); 195 /* If fmt is a lang ID then get the corresponding string (which
196 still might contain % place holders). */
197 fmt = P2STR((unsigned char *)fmt);
198 FOR_NB_SCREENS(i)
199 {
200 va_start(ap, fmt);
201 screens[i].set_viewport(NULL);
202 splash_internal(&(screens[i]), fmt, ap);
203 va_end(ap);
204 }
197 205
198 if(ticks) 206 if(ticks)
199 sleep(ticks); 207 sleep(ticks);
200} 208}
201 209
202void gui_syncsplash(int ticks, const char *fmt, ...) 210void splash(int ticks, const char *str)
203{ 211{
204 va_list ap;
205 int i;
206#if !defined(SIMULATOR) || CONFIG_CODEC == SWCODEC 212#if !defined(SIMULATOR) || CONFIG_CODEC == SWCODEC
207 long id; 213 long id;
208 /* fmt may be a so called virtual pointer. See settings.h. */ 214 /* fmt may be a so called virtual pointer. See settings.h. */
209 if((id = P2ID((unsigned char *)fmt)) >= 0) 215 if((id = P2ID((const unsigned char*)str)) >= 0)
210 /* If fmt specifies a voicefont ID, and voice menus are 216 /* If fmt specifies a voicefont ID, and voice menus are
211 enabled, then speak it. */ 217 enabled, then speak it. */
212 cond_talk_ids_fq(id); 218 cond_talk_ids_fq(id);
213#endif 219#endif
214 /* If fmt is a lang ID then get the corresponding string (which 220 splashf(ticks, "%s", P2STR((const unsigned char*)str));
215 still might contain % place holders). */
216 fmt = P2STR((unsigned char *)fmt);
217 va_start( ap, fmt );
218 FOR_NB_SCREENS(i)
219 {
220 screens[i].set_viewport(NULL);
221 splash(&(screens[i]), fmt, ap);
222 }
223 va_end( ap );
224
225 if(ticks)
226 sleep(ticks);
227} 221}