added clouds in Modern, added wind
authorTanya <tanya@bookdmitri.oblgaz>
Mon, 12 Apr 2010 15:27:44 +0000 (18:27 +0300)
committerTanya <tanya@bookdmitri.oblgaz>
Mon, 12 Apr 2010 15:27:44 +0000 (18:27 +0300)
applet/data/theme/Berlin/cloud1.png
applet/data/theme/Berlin/cloud4.png
applet/data/theme/Modern/cloud1.png [new file with mode: 0644]
applet/data/theme/Modern/cloud2.png [new file with mode: 0644]
applet/data/theme/Modern/cloud4.png [new file with mode: 0644]
applet/src/livewp-home-widget.c

index 7b82062..e3a5e9d 100644 (file)
Binary files a/applet/data/theme/Berlin/cloud1.png and b/applet/data/theme/Berlin/cloud1.png differ
index ef46d54..0fb87ba 100644 (file)
Binary files a/applet/data/theme/Berlin/cloud4.png and b/applet/data/theme/Berlin/cloud4.png differ
diff --git a/applet/data/theme/Modern/cloud1.png b/applet/data/theme/Modern/cloud1.png
new file mode 100644 (file)
index 0000000..e3a5e9d
Binary files /dev/null and b/applet/data/theme/Modern/cloud1.png differ
diff --git a/applet/data/theme/Modern/cloud2.png b/applet/data/theme/Modern/cloud2.png
new file mode 100644 (file)
index 0000000..25abdd3
Binary files /dev/null and b/applet/data/theme/Modern/cloud2.png differ
diff --git a/applet/data/theme/Modern/cloud4.png b/applet/data/theme/Modern/cloud4.png
new file mode 100644 (file)
index 0000000..0fb87ba
Binary files /dev/null and b/applet/data/theme/Modern/cloud4.png differ
index 1874793..1219d36 100644 (file)
@@ -358,7 +358,7 @@ change_tram(Actor * actor, AWallpaperPlugin *desktop_plugin)
         /* stop animation */
         actor->visible = FALSE;
         destroy_hildon_actor(actor);
-        actor->time_start_animation = sec + 5*60;
+        actor->time_start_animation = sec + fast_rnd(300);
     }
 }
 
@@ -470,7 +470,7 @@ change_cloud(Actor *actor, AWallpaperPlugin *desktop_plugin)
     
     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;
@@ -502,12 +502,22 @@ change_cloud(Actor *actor, AWallpaperPlugin *desktop_plugin)
         /* 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;
@@ -662,10 +672,14 @@ static void
 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);
@@ -682,31 +696,52 @@ init_scene(AWallpaperPlugin *desktop_plugin)
   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;
@@ -757,7 +792,7 @@ init_scene1(AWallpaperPlugin *desktop_plugin)
   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;