diff options
author | Bruno Coudoin <bcoudoin@src.gnome.org> | 2009-01-31 01:14:34 (GMT) |
---|---|---|
committer | Bruno Coudoin <bcoudoin@src.gnome.org> | 2009-01-31 01:14:34 (GMT) |
commit | 6b169bb1f7d1be7a4ff954618c4352b8641afcb1 (patch) | |
tree | 3d9bebfa581d94524339970e7920e244d2a7ac52 /src/gcompris | |
parent | 9210a8b35b16a8d22a29a285ea00609ffb244646 (diff) |
Vitali Perchonok is com gmail from vitali.pe
Graphical improvements. Images taken from openclipart.
Matieu Ignacio: New original background for the target activity.
svn path=/trunk/; revision=3713
Diffstat (limited to 'src/gcompris')
-rw-r--r-- | src/gcompris/timer.c | 23 | ||||
-rw-r--r-- | src/gcompris/timer.h | 1 |
2 files changed, 19 insertions, 5 deletions
diff --git a/src/gcompris/timer.c b/src/gcompris/timer.c index a529cb1..e995aa3 100644 --- a/src/gcompris/timer.c +++ b/src/gcompris/timer.c @@ -46,6 +46,8 @@ gc_timer_display(int ax, int ay, TimerList atype, int second, GcomprisTimerEnd a GdkFont *gdk_font; GdkPixbuf *pixmap = NULL; GcomprisProperties *properties = gc_prop_get(); + char *image_prefix; + /* Timer is not requested */ if(properties->timer==0) @@ -76,18 +78,28 @@ gc_timer_display(int ax, int ay, TimerList atype, int second, GcomprisTimerEnd a { case GCOMPRIS_TIMER_SAND: case GCOMPRIS_TIMER_CLOCK: + case GCOMPRIS_TIMER_TUX: { gchar *filefull = NULL; gchar *filename = NULL; gint fileid; - fileid = (gint)timer; - if(type==GCOMPRIS_TIMER_SAND) - filename = g_strdup_printf("gcompris/timers/sablier%d.png", fileid); - else - filename = g_strdup_printf("gcompris/timers/clock%d.png", fileid); + switch(type) + { + case GCOMPRIS_TIMER_SAND: + image_prefix = "gcompris/timers/sablier%d.png"; + case GCOMPRIS_TIMER_CLOCK: + image_prefix = "gcompris/timers/clock%d.png"; + case GCOMPRIS_TIMER_TUX: + image_prefix = "gcompris/timers/tux%d.png"; + default: + break; + } + fileid = (gint)timer; + filename = g_strdup_printf(image_prefix, fileid); filefull = g_strdup_printf("%s/%s", properties->package_data_dir, filename); + if (g_file_test ((filefull), G_FILE_TEST_EXISTS)) { pixmap = gc_pixmap_load(filename); @@ -221,6 +233,7 @@ start_animation() { case GCOMPRIS_TIMER_SAND: case GCOMPRIS_TIMER_CLOCK: + case GCOMPRIS_TIMER_TUX: /* No subanimation */ break; case GCOMPRIS_TIMER_TEXT: diff --git a/src/gcompris/timer.h b/src/gcompris/timer.h index 1097006..afe85aa 100644 --- a/src/gcompris/timer.h +++ b/src/gcompris/timer.h @@ -32,6 +32,7 @@ typedef enum GCOMPRIS_TIMER_SAND, GCOMPRIS_TIMER_BALLOON, GCOMPRIS_TIMER_CLOCK, + GCOMPRIS_TIMER_TUX, } TimerList; /* Callback when the timer is completed */ |