From: Tanya Date: Mon, 12 Apr 2010 07:28:06 +0000 (+0300) Subject: fixed random function X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;h=3977242e67f6d2986828ad6dfab8c6eb5b5d2f4e;p=livewp fixed random function --- diff --git a/applet/src/livewp-home-widget.c b/applet/src/livewp-home-widget.c index 84abca7..39263da 100644 --- a/applet/src/livewp-home-widget.c +++ b/applet/src/livewp-home-widget.c @@ -230,11 +230,11 @@ rnd(gint max) srand(time(NULL)); return rand() % max; } -gint seed = 0; +guint seed; gint fast_rnd(gint max) { - gint offset = 12923; - gint multiplier = 4079; + guint offset = 12923; + guint multiplier = 4079; seed = seed * multiplier + offset; return (gint)(seed % max); @@ -728,7 +728,6 @@ init_scene1(AWallpaperPlugin *desktop_plugin) Actor *actor; gint now = time(NULL); - seed = time(NULL)%10; scene.daytime = get_daytime(); scene.actors = NULL; @@ -1002,6 +1001,10 @@ animation_wallpaper_plugin_init (AWallpaperPlugin *desktop_plugin) gtk_container_add (GTK_CONTAINER (desktop_plugin), rich_animation); init_applet_position(); + + /* start value for random */ + seed = time(NULL); + fprintf(stderr, "!!!theme = %s\n", priv->theme); if (!strcmp(priv->theme,"Modern")) init_scene(desktop_plugin);