/* stop animation */
actor->visible = FALSE;
destroy_hildon_actor(actor);
- actor->time_start_animation = sec + 5*60;
+ actor->time_start_animation = sec + fast_rnd(300);
}
}
ms = tvb.tv_usec;
sec = tvb.tv_sec;
-// fprintf(stderr, "1 %f - %d\n", sec+(double)ms/100000, now);
+ //fprintf(stderr, "c1oud %s - y0=%d\n", actor->name, actor->y);
if (!actor->visible){
actor->visible = TRUE;
/* stop animation */
actor->visible = FALSE;
destroy_hildon_actor(actor);
- actor->time_start_animation = sec + (fast_rnd(5) + 1)*60;
+ actor->time_start_animation = sec + fast_rnd(300);
+ actor->y = fast_rnd(300);
}
}
void
+change_wind(Actor *actor, AWallpaperPlugin *desktop_plugin)
+{
+ scene.wind_orientation = fast_rnd(2) - 1;
+ scene.wind_angle = (double)(fast_rnd(400) - 200) / 100;
+ actor->time_start_animation = time(NULL) + (fast_rnd(20) + 10) * 60;
+ fprintf(stderr, "change wind orient = %d angle = %f after = %d\n", scene.wind_orientation, scene.wind_angle, actor->time_start_animation-time(NULL));
+}
+
+void
create_hildon_actor(Actor *actor, AWallpaperPlugin *desktop_plugin)
{
GtkWidget *ha = NULL;
init_scene(AWallpaperPlugin *desktop_plugin)
{
Actor *actor;
+ gint now = time(NULL);
/* fprintf(stderr, "init scene \n");*/
scene.daytime = get_daytime();
scene.actors = NULL;
+ scene.wind_orientation = -1;
+ scene.wind_angle = 0.3;
+
actor = init_object(desktop_plugin, "sky", "sky0.png", 0, 0, 5, 800, 480,
TRUE, 100, 255, (gpointer)&change_static_actor, NULL);
actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50,
TRUE, 100, 255, NULL, NULL);
scene.actors = g_slist_append(scene.actors, actor);
+
+ actor = init_object(desktop_plugin, "cloud1", "cloud1.png", 0, fast_rnd(300)-97, 7, 150, 97,
+ FALSE, 100, 255, (gpointer)&change_cloud, NULL);
+ actor->time_start_animation = now + fast_rnd(180);
+ actor->duration_animation = 5*60;
+ scene.actors = g_slist_append(scene.actors, actor);
+
+ actor = init_object(desktop_plugin, "cloud2", "cloud2.png", 0, fast_rnd(300)-75, 7, 188, 75,
+ FALSE, 100, 255, (gpointer)&change_cloud, NULL);
+ actor->time_start_animation = now + fast_rnd(180);
+ actor->duration_animation = 5*60;
+ scene.actors = g_slist_append(scene.actors, actor);
+
+ actor = init_object(desktop_plugin, "cloud4", "cloud4.png", 0, fast_rnd(300)-75, 7, 150, 75,
+ FALSE, 100, 255, (gpointer)&change_cloud, NULL);
+ actor->time_start_animation = now + fast_rnd(180);
+ actor->duration_animation = 5*60;
+ scene.actors = g_slist_append(scene.actors, actor);
- actor = init_object(desktop_plugin, "town", "town0.png", 0, 0, 7, 800, 480,
+ actor = init_object(desktop_plugin, "town", "town0.png", 0, 0, 8, 800, 480,
TRUE, 100, 255, (gpointer)&change_static_actor, NULL);
change_static_actor(actor, desktop_plugin);
scene.actors = g_slist_append(scene.actors, actor);
-
-
- actor = init_object(desktop_plugin, "tram", "tram.png", -300, 225, 8, 350, 210,
+ actor = init_object(desktop_plugin, "tram", "tram.png", -300, 225, 9, 350, 210,
FALSE, 100, 255, (gpointer)&change_tram, NULL);
- actor->time_start_animation = time(NULL) + 10;
+ actor->time_start_animation = time(NULL) + fast_rnd(60);
actor->duration_animation = 60;
scene.actors = g_slist_append(scene.actors, actor);
- actor = init_object(desktop_plugin, "border", "border0.png", 0, 480-79, 9, 800, 79,
+ actor = init_object(desktop_plugin, "border", "border0.png", 0, 480-79, 10, 800, 79,
TRUE, 100, 255, (gpointer)&change_static_actor, NULL);
change_static_actor(actor, desktop_plugin);
scene.actors = g_slist_append(scene.actors, actor);
- actor = init_object(desktop_plugin, "moon", "moon1.png", 400, 20, 10, 60, 60,
+ actor = init_object(desktop_plugin, "moon", "moon1.png", 400, 20, 6, 60, 60,
FALSE, 100, 255, (gpointer)&change_moon, NULL);
change_moon(actor, desktop_plugin);
scene.actors = g_slist_append(scene.actors, actor);
+ actor = init_object(desktop_plugin, "wind", "", 0, 0, 5, 0, 0,
+ FALSE, 100, 255, (gpointer)&change_wind, NULL);
+ change_wind(actor, desktop_plugin);
+ scene.actors = g_slist_append(scene.actors, actor);
+
#if 0
anim = g_new0(Animation, 1);
anim->count = 1;
change_moon(actor, desktop_plugin);
scene.actors = g_slist_append(scene.actors, actor);
- actor = init_object(desktop_plugin, "cloud1", "cloud2.png", 0, fast_rnd(300), 11, 188, 75,
+ actor = init_object(desktop_plugin, "cloud1", "cloud2.png", 0, fast_rnd(300), 7, 188, 75,
FALSE, 100, 255, (gpointer)&change_cloud, NULL);
actor->time_start_animation = now + fast_rnd(3) * 60;
actor->duration_animation = 5*60;