}
}
-static void path_tram(GtkWidget * actor, gint* t)
+static void path_tram(GtkWidget * actor, gint t)
{
gint x0 = -300, y0 = 191, scale0 = 100, t0 = 0,
x1 = 800, y1 = 119, scale1 = 130, t1 = 100,
x, y, scale;
- x = 12 * *t - 300;
- y = -0.72 * *t + 191;
- scale = 0.3 * *t + 100;
- if (x >= x1){
- x = x0;
- y = y0;
- scale = scale0;
- *t = 0;
- }
- fprintf(stderr, "path tram: t=%i, x=%i, y=%i, scale=%i\n", *t, x, y, scale);
+ x = 12 * t - 300;
+ y = -0.72 * t + 191;
+ scale = 0.3 * t + 100;
+ //fprintf(stderr, "path tram: t=%i, x=%i, y=%i, scale=%i\n", t, x, y, scale);
actor_set_position_full(actor, x, y, g_object_get_data(G_OBJECT(actor), "z"));
hildon_animation_actor_set_scale(actor, (double)scale/100, (double)scale/100);
}
static gint get_time(gint t)
{
- return t*1.2;
+ return t*1.1;
}
double alt, azm;
gint x, y;
GSList * list = NULL;
+ gchar str[256];
scene.window = window;
scene.daytime = get_daytime();
scene.dynamic_actors = g_slist_append(scene.dynamic_actors, G_OBJECT(actor));
//ma1->multiactor_init("sun", g_slist_append(list, G_OBJECT(actor)));
- actor = init_object("sky", "sky.png", 0, 0, 5, 800, 480, 1, 100, 255, NULL);
+ snprintf(str, 255, "sky%i.png", scene.daytime);
+ actor = init_object("sky", str, 0, 0, 5, 800, 480, 1, 100, 255, NULL);
scene.dynamic_actors = g_slist_append(scene.dynamic_actors, G_OBJECT(actor));
- actor = init_object("town", "town.png", 0, 480-374, 10, 800, 374, 1, 100, 255, NULL);
+ snprintf(str, 255, "town%i.png", scene.daytime);
+ actor = init_object("town", str, 0, 480-374, 10, 800, 374, 1, 100, 255, NULL);
scene.static_actors = g_slist_append(scene.static_actors, G_OBJECT(actor));
- actor = init_object("border", "border.png", 0, 480-79, 30, 800, 79, 1, 100, 255, NULL);
+ snprintf(str, 255, "border%i.png", scene.daytime);
+ actor = init_object("border", str, 0, 480-79, 30, 800, 79, 1, 100, 255, NULL);
scene.static_actors = g_slist_append(scene.static_actors, G_OBJECT(actor));
+ //if (scene.daytime == TIME_DAY) snprintf(str, 255, "tram.png");
+ //else snprintf(str, 255, "tram_dark.png");
actor = init_object("tram", "tram.png", -300, 191, 25, 350, 240, 1, 100, 255, NULL);
scene.dynamic_actors = g_slist_append(scene.dynamic_actors, G_OBJECT(actor));
}
pfunc = g_object_get_data(G_OBJECT(tmp->data), "func");
name = g_object_get_data(G_OBJECT(tmp->data), "name");
if (name == "tram"){
- path_tram(tmp->data, &ttt);
+ path_tram(tmp->data, ttt);
+ //ttt = get_time(ttt+1);
ttt = get_time(ttt+1);
+ if (ttt >= 100) ttt = 0;
}else
if (pfunc){
(*pfunc)(tmp->data, NULL);
gtk_container_add (GTK_CONTAINER (desktop_plugin), label);
init_applet_position();
init_scene(desktop_plugin);
- priv->timer = g_timeout_add(1000, plugin_on_timeout, desktop_plugin);
+ priv->timer = g_timeout_add(500, plugin_on_timeout, desktop_plugin);
}
static void