projects
/
livewp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6a68f04
)
fixed random function
author
Tanya
<tanya@bookdmitri.oblgaz>
Mon, 12 Apr 2010 07:28:06 +0000
(10:28 +0300)
committer
Tanya
<tanya@bookdmitri.oblgaz>
Mon, 12 Apr 2010 07:28:06 +0000
(10:28 +0300)
applet/src/livewp-home-widget.c
patch
|
blob
|
history
diff --git
a/applet/src/livewp-home-widget.c
b/applet/src/livewp-home-widget.c
index
84abca7
..
39263da
100644
(file)
--- 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;
}
srand(time(NULL));
return rand() % max;
}
-gint seed = 0;
+guint seed;
gint fast_rnd(gint max)
{
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);
seed = seed * multiplier + offset;
return (gint)(seed % max);
@@
-728,7
+728,6
@@
init_scene1(AWallpaperPlugin *desktop_plugin)
Actor *actor;
gint now = time(NULL);
Actor *actor;
gint now = time(NULL);
- seed = time(NULL)%10;
scene.daytime = get_daytime();
scene.actors = NULL;
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();
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);
fprintf(stderr, "!!!theme = %s\n", priv->theme);
if (!strcmp(priv->theme,"Modern"))
init_scene(desktop_plugin);