}
void
-change_plane(Actor *actor, AWallpaperPlugin *desktop_plugin)
+change_plane1(Actor *actor, AWallpaperPlugin *desktop_plugin)
{
gint x0 = 620, y0 = 233, scale0 = 100,
x1 = 79, y1 = -146, scale1 = 100,
}
void
+change_plane2(Actor *actor, AWallpaperPlugin *desktop_plugin)
+{
+ gint x0 = -actor->width, y0 = 45, scale0 = 100,
+ x1 = 800, y1 = 20, scale1 = 100,
+ x, y, scale;
+ struct timeval tvb;
+ suseconds_t ms;
+ long sec;
+ double t;
+ gint daytime = get_daytime();
+
+ gettimeofday(&tvb, NULL);
+
+ ms = tvb.tv_usec;
+ sec = tvb.tv_sec;
+// fprintf(stderr, "1 %f - %d\n", sec+(double)ms/100000, now);
+
+ if (!actor->visible){
+ actor->visible = TRUE;
+ if (daytime == TIME_NIGHT)
+ actor->filename = g_strdup("plane3.png");
+ else
+ actor->filename = g_strdup("plane3.png");
+ create_hildon_actor(actor, desktop_plugin);
+ }
+ t = (double)((double)sec+(double)ms/1000000 - actor->time_start_animation) / actor->duration_animation;
+ x = path_line(x0, x1, t);
+ y = path_line(y0, y1, t);
+ //scale = path_line(scale0, scale1, t);
+ //fprintf(stderr, "change tram t=%f x=%d y=%d scale=%d\n", t, x, y, scale);
+ actor_set_position_full(actor->widget, x, y, actor->z);
+ //hildon_animation_actor_set_scale(HILDON_ANIMATION_ACTOR(actor->widget), (double)scale/100, (double)scale/100);
+ if (t >= 1){
+ /* stop animation */
+ actor->visible = FALSE;
+ destroy_hildon_actor(actor);
+ actor->time_start_animation = sec + 5*60;
+ }
+
+}
+
+void
create_hildon_actor(Actor *actor, AWallpaperPlugin *desktop_plugin)
{
GtkWidget *ha = NULL;
change_sun(actor, desktop_plugin);
scene.actors = g_slist_append(scene.actors, actor);
-#if 0
- actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 9, 50, 50,
+
+ actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 10, 50, 50,
TRUE, 100, 255, NULL, NULL);
scene.actors = g_slist_append(scene.actors, actor);
-#endif
- actor = init_object(desktop_plugin, "town", "town.png", 0, 0, 8, 800, 480,
+
+ actor = init_object(desktop_plugin, "town", "town.png", 0, 0, 9, 800, 480,
TRUE, 100, 255, (gpointer)&change_static_actor, NULL);
change_static_actor(actor, desktop_plugin);
scene.actors = g_slist_append(scene.actors, actor);
change_moon(actor, desktop_plugin);
scene.actors = g_slist_append(scene.actors, actor);
- actor = init_object(desktop_plugin, "plane1", "tu154.png", 620, 233, 7, 379, 146,
- FALSE, 100, 255, (gpointer)&change_plane, NULL);
- actor->time_start_animation = time(NULL) + 10;
+ actor = init_object(desktop_plugin, "plane2", "plane3.png", 0, 45, 7, 160, 50,
+ FALSE, 100, 255, (gpointer)&change_plane2, NULL);
+ actor->time_start_animation = time(NULL) + 5;
actor->duration_animation = 60;
scene.actors = g_slist_append(scene.actors, actor);
+
+ actor = init_object(desktop_plugin, "plane1", "tu154_small.png", 620, 233, 8, 300, 116,
+ FALSE, 100, 255, (gpointer)&change_plane1, NULL);
+ actor->time_start_animation = time(NULL) + 60;
+ actor->duration_animation = 30;
+ scene.actors = g_slist_append(scene.actors, actor);
}
/* TODO Move scene to priv */
scene.timer_type = LONG_TIMER_TYPE;
- sleep(2);
+ //sleep(2);
}
static void