summaryrefslogtreecommitdiff
path: root/3d.c
diff options
context:
space:
mode:
authorDennis Kasprzyk <onestone@opencompositing.org>2008-04-09 18:45:42 +0200
committerDennis Kasprzyk <onestone@opencompositing.org>2008-04-09 18:45:42 +0200
commit6446339621792f4fb6b4b8e42c56c4a02f318497 (patch)
treed20e3e1ca4654910df6f7fbee0c2aeeb271b96a1 /3d.c
parent52e42f94635ff133de06b05bdc56ae4206472efa (diff)
download3d-6446339621792f4fb6b4b8e42c56c4a02f318497.tar.gz
3d-6446339621792f4fb6b4b8e42c56c4a02f318497.tar.bz2
Use cube progress value instead of own animation calculation.
Diffstat (limited to '3d.c')
-rw-r--r--3d.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/3d.c b/3d.c
index a4c2dc8..b8b2138 100644
--- a/3d.c
+++ b/3d.c
@@ -128,7 +128,6 @@ tdPreparePaintScreen (CompScreen *s,
int msSinceLastPaint)
{
CompWindow *w;
- float amount;
Bool active;
TD_SCREEN (s);
@@ -137,11 +136,13 @@ tdPreparePaintScreen (CompScreen *s,
active = (cs->rotationState != RotationNone) && s->hsize > 2 &&
!(tdGetManualOnly(s) && (cs->rotationState != RotationManual));
- amount = ((float)msSinceLastPaint * tdGetSpeed (s) / 1000.0);
- if (active)
+ if (active || tds->basicScale != 1.0)
{
float maxDiv = (float) tdGetMaxWindowSpace (s) / 100;
float minScale = (float) tdGetMinCubeSize (s) / 100;
+ float x, progress;
+
+ (*cs->getRotation) (s, &x, &x, &progress);
tds->maxDepth = 0;
for (w = s->windows; w; w = w->next)
@@ -159,17 +160,11 @@ tdPreparePaintScreen (CompScreen *s,
}
minScale = MAX (minScale, 1.0 - (tds->maxDepth * maxDiv));
- if (cs->invert == 1)
- tds->basicScale = MAX (minScale, tds->basicScale - amount);
- else
- tds->basicScale = MIN (2 - minScale, tds->basicScale + amount);
+ tds->basicScale = 1.0 - ((1.0 - minScale) * progress);
}
else
{
- if (cs->invert == 1)
- tds->basicScale = MIN (1.0, tds->basicScale + amount);
- else
- tds->basicScale = MAX (1.0, tds->basicScale - amount);
+ tds->basicScale = 1.0;
}
/* comparing float values with != is error prone, so better cache