gint x0 = actor->x, y0 = actor->y,
x1 = (scene->empty%4)*width, y1 = (scene->empty/4)*height,
x,y;
- x = x0 + (x1-x0)*(max - num)/max;
- y = y0 + (y1-y0)*(max - num)/max;
+ //x = x0 + (x1-x0)*(max - num)/max;
+ //y = y0 + (y1-y0)*(max - num)/max;
+ x = x0 + (x1-x0)*(max-num)*(max-num)/(max*max);
+ y = y0 + (y1-y0)*(max-num)*(max-num)/(max*max);
set_actor_position(actor, x, y, actor->z, desktop_plugin);
if (num == 0){
actor->x = x;
}
void moving_all(gint num, gint max, AWallpaperPlugin *desktop_plugin)
{
- gint i;
-
+ gint i, axis;
+ double angle;
+ angle = 360*(max - num)/max;
for (i=0; i<15; i++){
+ if (i%2 == 0) axis = HILDON_AA_Y_AXIS;
+ else axis = HILDON_AA_X_AXIS;
+ set_actor_rotation(actors[i], axis, angle, 0, 0, 0);
+ }
+ if (num == (int)max/2){
+ reinit(desktop_plugin);
}
}
gboolean main_timer(AWallpaperPlugin *desktop_plugin)
scene->timer_num--;
if (scene->bone>-1)
moving_actor(scene->timer_num, 10, desktop_plugin);
+ else
+ moving_all(scene->timer_num, 20, desktop_plugin);
return;
}
- char * accel_filename = "/sys/class/i2c-adapter/i2c-3/3-001d/coord";
- //char * accel_filename = "/home/tanya/coord";
+ //char * accel_filename = "/sys/class/i2c-adapter/i2c-3/3-001d/coord";
+ char * accel_filename = "/home/tanya/coord";
gint direction = -1, bone;
FILE *fd = NULL;
//fprintf(stderr, "change obj %i %i %i\n", ax, ay, az);
if (az < -2000) {
- reinit(desktop_plugin);
+ //reinit(desktop_plugin);
//sleep(1);
- scene->timer_num = 10;
+ scene->timer_num = 20;
scene->bone = -1;
return TRUE;
}