summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortrappist <trappist@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-16 18:39:51 +0000
committertrappist <trappist@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-16 18:39:51 +0000
commit2930b4c14baf49df28d9f70f6dbc24671275a39f (patch)
treebcf5006b6bbe9421550749111c45b4815e2df63a
parente53db9b91cd680d2ebf3552d69af828d37d7c26f (diff)
downloadmarex-dev-2930b4c14baf49df28d9f70f6dbc24671275a39f.tar.gz
marex-dev-2930b4c14baf49df28d9f70f6dbc24671275a39f.tar.bz2
Add grid size options to explode3d animation
git-svn-id: file:///beryl/trunk@4111 d7aaf104-2d23-0410-ae22-9d23157bf5a3
-rw-r--r--beryl-plugins/src/animation.c53
1 files changed, 51 insertions, 2 deletions
diff --git a/beryl-plugins/src/animation.c b/beryl-plugins/src/animation.c
index cf45104..ac82b48 100644
--- a/beryl-plugins/src/animation.c
+++ b/beryl-plugins/src/animation.c
@@ -110,6 +110,7 @@
#define BORDER_H(w) ((w)->height + (w)->input.top + (w)->input.bottom)
#define RAND_FLOAT() ((float)rand() / RAND_MAX)
+#define MIN_WINDOW_GRID_SIZE 10
typedef struct _xy_pair
@@ -522,6 +523,12 @@ modelInitObjects(Model * model, int x, int y, int width, int height);
#define ANIM_EXPLODE3D_THICKNESS_MIN 0.0
#define ANIM_EXPLODE3D_THICKNESS_MAX 50.0
#define ANIM_EXPLODE3D_THICKNESS_PRECISION 1.0
+#define ANIM_EXPLODE3D_GRIDSIZE_X_DEFAULT 20
+#define ANIM_EXPLODE3D_GRIDSIZE_X_MIN MIN_WINDOW_GRID_SIZE
+#define ANIM_EXPLODE3D_GRIDSIZE_X_MAX 200
+#define ANIM_EXPLODE3D_GRIDSIZE_Y_DEFAULT 14
+#define ANIM_EXPLODE3D_GRIDSIZE_Y_MIN MIN_WINDOW_GRID_SIZE
+#define ANIM_EXPLODE3D_GRIDSIZE_Y_MAX 200
typedef enum
@@ -1183,6 +1190,8 @@ typedef enum
ANIM_SCREEN_OPTION_DOMINO_DIRECTION,
ANIM_SCREEN_OPTION_RAZR_DIRECTION,
ANIM_SCREEN_OPTION_EXPLODE3D_THICKNESS,
+ ANIM_SCREEN_OPTION_EXPLODE3D_GRIDSIZE_X,
+ ANIM_SCREEN_OPTION_EXPLODE3D_GRIDSIZE_Y,
ANIM_SCREEN_OPTION_FIRE_PARTICLES,
ANIM_SCREEN_OPTION_FIRE_SIZE,
ANIM_SCREEN_OPTION_FIRE_SLOWDOWN,
@@ -3897,7 +3906,7 @@ tessellateIntoRectangles(CompWindow * w,
winLimitsW = BORDER_W(w);
winLimitsH = BORDER_H(w);
}
- float minRectSize = 20;
+ float minRectSize = MIN_WINDOW_GRID_SIZE;
float rectW = winLimitsW / (float)gridSizeX;
float rectH = winLimitsH / (float)gridSizeY;
@@ -4999,7 +5008,9 @@ static void fxExplode3DInit(CompScreen * s, CompWindow * w)
{
ANIM_WINDOW(w);
ANIM_SCREEN(s);
- if (!tessellateIntoRectangles(w, 20, 14,
+ if (!tessellateIntoRectangles(w,
+ as->opt[ANIM_SCREEN_OPTION_EXPLODE3D_GRIDSIZE_X].value.i,
+ as->opt[ANIM_SCREEN_OPTION_EXPLODE3D_GRIDSIZE_Y].value.i,
as->opt[ANIM_SCREEN_OPTION_EXPLODE3D_THICKNESS].value.f))
return;
@@ -6127,6 +6138,18 @@ animSetScreenOption(CompScreen * screen, char *name, CompOptionValue * value)
return TRUE;
}
break;
+ case ANIM_SCREEN_OPTION_EXPLODE3D_GRIDSIZE_X:
+ if (compSetIntOption(o, value))
+ {
+ return TRUE;
+ }
+ break;
+ case ANIM_SCREEN_OPTION_EXPLODE3D_GRIDSIZE_Y:
+ if (compSetIntOption(o, value))
+ {
+ return TRUE;
+ }
+ break;
case ANIM_SCREEN_OPTION_GLIDE1_AWAY_POS:
if (compSetFloatOption(o, value))
{
@@ -7472,6 +7495,32 @@ static void animScreenInitOptions(AnimScreen * as)
o->rest.f.max = ANIM_EXPLODE3D_THICKNESS_MAX;
o->rest.f.precision = ANIM_EXPLODE3D_THICKNESS_PRECISION;
+ o = &as->opt[ANIM_SCREEN_OPTION_EXPLODE3D_GRIDSIZE_X];
+ o->name = "explode_gridx";
+ o->group = N_("Explode");
+ o->subGroup = N_("");
+ o->advanced = False;
+ o->shortDesc = N_("Window grid width");
+ o->longDesc = N_("The exploding window will be split into pieces along a grid. Specify the width, in pixels, of the columns in the grid.");
+ o->displayHints = "";
+ o->type = CompOptionTypeInt;
+ o->value.i = ANIM_EXPLODE3D_GRIDSIZE_X_DEFAULT;
+ o->rest.i.min = ANIM_EXPLODE3D_GRIDSIZE_X_MIN;
+ o->rest.i.max = ANIM_EXPLODE3D_GRIDSIZE_X_MAX;
+
+ o = &as->opt[ANIM_SCREEN_OPTION_EXPLODE3D_GRIDSIZE_Y];
+ o->name = "explode_gridy";
+ o->group = N_("Explode");
+ o->subGroup = N_("");
+ o->advanced = False;
+ o->shortDesc = N_("Window grid height");
+ o->longDesc = N_("The exploding window will be split into pieces along a grid. Specify the height, in pixels, of the rows in the grid.");
+ o->displayHints = "";
+ o->type = CompOptionTypeInt;
+ o->value.i = ANIM_EXPLODE3D_GRIDSIZE_Y_DEFAULT;
+ o->rest.i.min = ANIM_EXPLODE3D_GRIDSIZE_Y_MIN;
+ o->rest.i.max = ANIM_EXPLODE3D_GRIDSIZE_Y_MAX;
+
// Glide 1
o = &as->opt[ANIM_SCREEN_OPTION_GLIDE1_AWAY_POS];