Enlightenment CVS committal
Author : handyande
Project : e17
Module : apps/e
Dir : e17/apps/e/src/modules/snow
Modified Files:
e_mod_main.c e_mod_main.h
Log Message:
small fixes and slow the snow fall
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/modules/snow/e_mod_main.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- e_mod_main.c 9 Dec 2004 18:53:50 -0000 1.1
+++ e_mod_main.c 9 Dec 2004 23:07:39 -0000 1.2
@@ -96,10 +96,6 @@
{
Snow *snow;
Evas_List *managers, *l, *l2;
- Evas_Object *o;
- Evas_Coord xx, yy, ww, hh;
- char buf[4096];
- int tw, th, i;
snow = calloc(1, sizeof(Snow));
if (!snow) return NULL;
@@ -137,6 +133,7 @@
}
}
+ evas_output_viewport_get(snow->canvas, NULL, NULL, &snow->width,
&snow->height);
_snow_trees_load(snow);
_snow_flakes_load('s', snow);
_snow_flakes_load('m', snow);
@@ -275,11 +272,9 @@
static void
_snow_trees_load(Snow *snow) {
Evas_Object *o;
- Evas_Coord xx, yy, ww, hh;
char buf[4096];
int tw, th, i;
- evas_output_viewport_get(snow->canvas, &xx, &yy, &ww, &hh);
snprintf(buf, sizeof(buf), "%s/tree.png", e_module_dir_get(snow->module));
o = evas_object_image_add(snow->canvas);
@@ -297,8 +292,8 @@
evas_object_image_alpha_set(o, 1);
evas_object_image_fill_set(o, 0, 0, tw, th);
- tx = random() % (ww - tw);
- ty = random() % (hh - th);
+ tx = random() % (snow->width - tw);
+ ty = random() % (snow->height - th);
evas_object_move(o, tx, ty);
evas_object_show(o);
snow->trees = evas_list_append(snow->trees, o);
@@ -376,9 +371,9 @@
flake = next->data;
d = ecore_time_get() - flake->start_time;
- y = 100 * d * flake->speed;
+ y = 30 * d * flake->speed;
evas_object_geometry_get(flake->flake, &x, NULL, NULL, NULL);
- if (y > 1024) /* FIXME */
+ if (y > snow->height)
flake->start_time = ecore_time_get() + (double) (random() % 100) /
(double) 100;
evas_object_move(flake->flake, x, y);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/modules/snow/e_mod_main.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- e_mod_main.h 9 Dec 2004 18:53:50 -0000 1.1
+++ e_mod_main.h 9 Dec 2004 23:07:40 -0000 1.2
@@ -22,6 +22,7 @@
E_Config_DD *conf_edd;
Config *conf;
+ Evas_Coord width, height;
};
struct _Snow_Flake
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs