bool
HorizontalFoldsAnim::zoomToIcon ()
{
    return ((mCurWindowEvent == WindowEventMinimize ||
	     mCurWindowEvent == WindowEventUnminimize) &&
	    optValB (AnimationOptions::HorizontalFoldsZoomToTaskbar));
}
Пример #2
0
BurnAnim::BurnAnim (CompWindow *w,
                    WindowEvent curWindowEvent,
                    float duration,
                    const AnimEffect info,
                    const CompRect &icon) :
    Animation::Animation (w, curWindowEvent, duration, info, icon),
    ParticleAnim::ParticleAnim (w, curWindowEvent, duration, info, icon)
{
    mDirection =
	getActualAnimDirection ((AnimDirection) optValI
	                        (AnimationaddonOptions::FireDirection),
	                        false);

    if (optValB (AnimationaddonOptions::FireConstantSpeed))
    {
	int winHeight = w->height () + w->output ().top + w->output ().bottom;

	mTotalTime *= winHeight / 500.0;
	mRemainingTime *= winHeight / 500.0;
    }

    mMysticalFire = optValB (AnimationaddonOptions::FireMystical);
    mLife         = optValF (AnimationaddonOptions::FireLife);
    mColor        = optValC (AnimationaddonOptions::FireColor);
    mSize         = optValF (AnimationaddonOptions::FireSize);
    mHasSmoke     = optValB (AnimationaddonOptions::FireSmoke);

    mFirePSId  = mHasSmoke ? 1 : 0;
    mSmokePSId = 0;

    int numFireParticles = optValI (AnimationaddonOptions::FireParticles);
    float slowDown = optValF (AnimationaddonOptions::FireSlowdown);

    // Light ParticleSystem is for smoke, which is optional.
    // Dark ParticleSystem is for fire.
    initLightDarkParticles (mHasSmoke ? numFireParticles / 10 : 0,
                            numFireParticles,
                            slowDown / 2.0f, slowDown);
}
Пример #3
0
void
RollUpAnim::step ()
{
    float forwardProgress = progressEaseInEaseOut ();
    bool fixedInterior = optValB (AnimationOptions::RollupFixedInterior);

    CompRect outRect (mAWindow->savedRectsValid () ?
		      mAWindow->savedOutRect () :
		      mWindow->outputRect ());

    int ox = outRect.x ();
    int oy = outRect.y ();
    int owidth = outRect.width ();
    int oheight = outRect.height ();

    GridModel::GridObject *object = mModel->objects ();
    unsigned int n = mModel->numObjects ();
    for (unsigned int i = 0; i < n; i++, object++)
    {
	// Executing shade mode

	Point3d &objPos = object->position ();

	if (i % 2 == 0) // object is at the left side
	{
	    float objGridY = object->gridPosition ().y ();

	    if (objGridY == 0)
	    {
		objPos.setY (oy);
	    }
	    else if (objGridY == 1)
	    {
		objPos.setY (
		    (1 - forwardProgress) * (oy + oheight * objGridY) +
		    forwardProgress * (oy +
				       mDecorTopHeight + mDecorBottomHeight));
	    }
	    else
	    {
		// find position in window contents
		// (window contents correspond to 0.0-1.0 range)
		float relPosInWinContents =
		    (objGridY * oheight -
		     mDecorTopHeight) / mWindow->height ();

		if (relPosInWinContents > forwardProgress)
		{
		    objPos.setY (
			(1 - forwardProgress) * (oy + oheight * objGridY) +
			forwardProgress * (oy + mDecorTopHeight));

		    if (fixedInterior)
			object->offsetTexCoordForQuadBefore ().
			    setY (-forwardProgress * mWindow->height ());
		}
		else
		{
		    objPos.setY (oy + mDecorTopHeight);
		    if (!fixedInterior)
			object->offsetTexCoordForQuadAfter ().
			    setY ((forwardProgress - relPosInWinContents) *
				  mWindow->height ());
		}
	    }
	}
	else // object is at the right side
	{
	    // Set y position to the y position of the object at the left
	    // on the same row (previous object)
	    objPos.setY ((object - 1)->position ().y ());

	    // Also copy offset texture y coordinates
	    object->offsetTexCoordForQuadBefore ().
		setY ((object - 1)->offsetTexCoordForQuadBefore ().y ());
	    object->offsetTexCoordForQuadAfter ().
		setY ((object - 1)->offsetTexCoordForQuadAfter ().y ());
	}

	float origx = ox + owidth * object->gridPosition ().x ();

	objPos.setX (origx);
    }
}