summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rotatingcube.cpp3
-rw-r--r--screensaver_internal.h2
2 files changed, 4 insertions, 1 deletions
diff --git a/rotatingcube.cpp b/rotatingcube.cpp
index 224fc27..9ba891a 100644
--- a/rotatingcube.cpp
+++ b/rotatingcube.cpp
@@ -54,6 +54,7 @@ void ScreenRotatingCube::getRotation( float* x, float* v, float *progress )
*x += ss->cubeRotX;
*v += ss->cubeRotV;
+ *progress = MAX (*progress, ss->cubeProgress);
}
void ScreenRotatingCube::preparePaintScreen( int msSinceLastPaint )
@@ -70,12 +71,14 @@ void ScreenRotatingCube::preparePaintScreen( int msSinceLastPaint )
{
rotX *= getProgress();
ss->zCamera = -screensaverGetCubeZoom(s->display) * getProgress();
+ ss->cubeProgress = getProgress();
}
else if( sd->state.fadingOut )
{
ss->zCamera = ss->zCameraFadeOut * (1-getProgress());
ss->cubeRotX = ss->cubeRotXFadeOut * (1-getProgress());
ss->cubeRotV = ss->cubeRotVFadeOut * (1-getProgress());
+ ss->cubeProgress = 1 - getProgress();
}
if( !sd->state.fadingOut )
diff --git a/screensaver_internal.h b/screensaver_internal.h
index bc54ce2..8c430b7 100644
--- a/screensaver_internal.h
+++ b/screensaver_internal.h
@@ -81,7 +81,7 @@ typedef struct _ScreenSaverScreen {
// time is stored to calculate progress when fadingIn or fadingOut
int time;
- float cubeRotX, cubeRotV, zCamera;
+ float cubeRotX, cubeRotV, cubeProgress, zCamera;
// FadeOut values are the initial value used to calculate the interpolation when fadingOut
float cubeRotXFadeOut, cubeRotVFadeOut, zCameraFadeOut;