gnome-games r8698 - trunk/gnometris
- From: jclinton svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-games r8698 - trunk/gnometris
- Date: Tue, 10 Feb 2009 23:48:52 +0000 (UTC)
Author: jclinton
Date: Tue Feb 10 23:48:52 2009
New Revision: 8698
URL: http://svn.gnome.org/viewvc/gnome-games?rev=8698&view=rev
Log:
Change preview widget from rotate to pulse to be less annoying
This was done at the request of some hardcore players.
Modified:
trunk/gnometris/preview.cpp
trunk/gnometris/preview.h
Modified: trunk/gnometris/preview.cpp
==============================================================================
--- trunk/gnometris/preview.cpp (original)
+++ trunk/gnometris/preview.cpp Tue Feb 10 23:48:52 2009
@@ -58,23 +58,20 @@
ClutterColor stage_color = { 0x0, 0x0, 0x0, 0xff };
clutter_stage_set_color (CLUTTER_STAGE (stage),
&stage_color);
- rotar = clutter_group_new ();
+ piece = clutter_group_new ();
clutter_group_add (CLUTTER_GROUP (stage),
- rotar);
+ piece);
clutter_actor_show_all (stage);
- rot_timeline = clutter_timeline_new_for_duration (5000);
- clutter_timeline_set_loop (rot_timeline, true);
- alpha = clutter_alpha_new_full (rot_timeline,
- CLUTTER_ALPHA_RAMP_INC,
+ piece_timeline = clutter_timeline_new_for_duration (180);
+ alpha = clutter_alpha_new_full (piece_timeline,
+ CLUTTER_ALPHA_SINE_HALF,
NULL, NULL);
- rot_behav = clutter_behaviour_rotate_new (alpha,
- CLUTTER_Z_AXIS, CLUTTER_ROTATE_CW, 0.0, 360.0);
- clutter_behaviour_rotate_set_center (CLUTTER_BEHAVIOUR_ROTATE (rot_behav),
- PREVIEW_SIZE*12, PREVIEW_SIZE*12, 0);
- clutter_actor_set_position (CLUTTER_ACTOR(rotar), 0, 0);
- clutter_behaviour_apply (rot_behav, rotar);
- clutter_timeline_start (rot_timeline);
+ piece_behav = clutter_behaviour_scale_new (alpha,
+ 1.0, 1.0, 1.4, 1.4);
+ clutter_actor_set_anchor_point (piece, PREVIEW_SIZE*10, PREVIEW_SIZE*10);
+ clutter_actor_set_position (CLUTTER_ACTOR(piece), PREVIEW_SIZE*10, PREVIEW_SIZE*10);
+ clutter_behaviour_apply (piece_behav, piece);
}
Preview::~Preview ()
@@ -134,7 +131,7 @@
if ((blocknr != -1) &&
blockTable[blocknr][0][x-1][y-1]) {
blocks[x][y].what = LAYING;
- blocks[x][y].createActor (rotar,
+ blocks[x][y].createActor (piece,
renderer->getCacheCellById (color));
clutter_actor_set_position (CLUTTER_ACTOR(blocks[x][y].actor),
x*PREVIEW_SIZE*4, y*PREVIEW_SIZE*4);
@@ -147,17 +144,10 @@
}
}
}
- positionRotar ();
+ clutter_timeline_start (piece_timeline);
clutter_actor_show_all (stage);
}
-void
-Preview::positionRotar()
-{
-
- //
-}
-
gint
Preview::configure(GtkWidget * widget, GdkEventConfigure * event, Preview * preview)
{
@@ -165,7 +155,6 @@
preview->height = event->height;
preview->regenerateRenderer ();
- preview->positionRotar ();
return TRUE;
}
Modified: trunk/gnometris/preview.h
==============================================================================
--- trunk/gnometris/preview.h (original)
+++ trunk/gnometris/preview.h Tue Feb 10 23:48:52 2009
@@ -42,7 +42,6 @@
void enable (bool enable);
void setTheme (gint id);
void previewBlock (int bnr, int bcolor);
- void positionRotar();
void regenerateRenderer ();
private:
@@ -53,12 +52,12 @@
gint color;
gint themeID;
- ClutterTimeline *rot_timeline;
+ ClutterTimeline *piece_timeline;
ClutterAlpha *alpha;
- ClutterBehaviour *rot_behav;
+ ClutterBehaviour *piece_behav;
Block **blocks;
- ClutterActor* rotar;
+ ClutterActor* piece;
Renderer* renderer;
bool enabled;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]