fixed random function
authorTanya <tanya@bookdmitri.oblgaz>
Mon, 12 Apr 2010 07:28:06 +0000 (10:28 +0300)
committerTanya <tanya@bookdmitri.oblgaz>
Mon, 12 Apr 2010 07:28:06 +0000 (10:28 +0300)
applet/src/livewp-home-widget.c

index 84abca7..39263da 100644 (file)
@@ -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);