]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Transition.hh
the massive refactoring effort
[chaz/yoink] / src / Moof / Transition.hh
diff --git a/src/Moof/Transition.hh b/src/Moof/Transition.hh
deleted file mode 100644 (file)
index 2f468fc..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-
-/*]  Copyright (c) 2009-2010, Charles McGarvey  [**************************
-**]  All rights reserved.
-*
-* vi:ts=4 sw=4 tw=75
-*
-* Distributable under the terms and conditions of the 2-clause BSD license;
-* see the file COPYING for a complete text of the license.
-*
-**************************************************************************/
-
-#define _MOOF_TRANSITION_HH_
-#ifndef _MOOF_TRANSITION_HH_
-#define _MOOF_TRANSITION_HH_
-
-#include <boost/shared_ptr.hpp>
-
-#include <Moof/Core.hh>
-#include <Moof/Interpolator.hh>
-#include <Moof/Layer.hh>
-#include <Moof/Log.hh>
-#include <Moof/Math.hh>
-#include <Moof/OpenGL.hh>
-#include <Moof/Texture.hh>
-
-
-namespace Mf {
-
-
-template <class T>
-class Transition : public Layer
-{
-       LayerP  mTo;
-       LayerP  mFrom;
-
-       T               mInterp;
-
-public:
-
-       Transition(LayerP t, LayerP f, const T& interp) :
-               mTo(t),
-               mFrom(f),
-               mInterp(interp) {}
-
-       typedef boost::shared_ptr<Transition> Ptr;
-
-       static Ptr alloc(LayerP t, LayerP f, const T& interp)
-       {
-               return Ptr(new Transition(t, f, interp));
-       }
-
-
-       void removedFromCore(Core& core)
-       {
-               if (mTo) core.push(mTo);
-       }
-
-       void update(Core& core, Scalar t, Scalar dt)
-       {
-               mInterp.update(t, dt);
-
-               if (mFrom) mFrom->update(core, t, dt);
-               if (mTo) mTo->update(core, t, dt);
-
-               if (mInterp.isDone())
-               {
-                       // to should /replace/ this
-                       core.pop(this);
-               }
-       }
-
-       void drawFade(Scalar alpha) const
-       {
-               // DRAW FADE
-               glDisable(GL_DEPTH_TEST);
-               glDisable(GL_ALPHA_TEST);
-               glEnable(GL_BLEND);
-               glMatrixMode(GL_PROJECTION);
-               glPushMatrix();
-               glLoadIdentity();
-               glMatrixMode(GL_MODELVIEW);
-               glPushMatrix();
-               glLoadIdentity();
-               glColor(1.0, 1.0, 1.0, alpha);
-               Mf::Texture::resetBind();
-
-               //glRectf(-1.0f, -1.0f, 1.0f, 1.0f);
-               glBegin(GL_QUADS);
-                       glVertex(-1.0, -1.0, -0.1);
-                       glVertex(1.0, -1.0, -0.1);
-                       glVertex(1.0, 1.0, -0.1);
-                       glVertex(-1.0, 1.0, -0.1);
-               glEnd();
-
-               glDisable(GL_BLEND);
-               glEnable(GL_DEPTH_TEST);
-               glEnable(GL_ALPHA_TEST);
-
-               glMatrixMode(GL_PROJECTION);
-               glPopMatrix();
-               glMatrixMode(GL_MODELVIEW);
-               glPopMatrix();
-       }
-
-       void draw(Core& core, Scalar alpha) const
-       {
-               Scalar a = mInterp.getState(alpha);
-               logInfo << "transition state: " << a << std::endl;
-
-               //glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
-               if (mFrom)
-               {
-                       glPushMatrix();
-                       glLoadIdentity();
-                       glRotate(180.0 * a, 0.0, 1.0, 0.0);
-                       mFrom->draw(core, alpha);
-                       glPopMatrix();
-               }
-                       //drawFade(a);
-
-               if (mTo)
-               {
-                       glPushMatrix();
-                       glLoadIdentity();
-                       glRotate(180.0 * (1.0 - a), 0.0, 1.0, 0.0);
-                       mTo->draw(core, alpha);
-                       glPopMatrix();
-               }
-                       //drawFade(1.0 - a);
-       }
-
-       bool handleEvent(Core& core, const Event& event)
-       {
-               if (mTo)
-               {
-                       return mTo->handleEvent(core, event);
-               }
-               else if (mFrom)
-               {
-                       return mFrom->handleEvent(core, event);
-               }
-               return false;
-       }
-};
-
-
-} // namespace Mf
-
-#endif // _MOOF_TRANSITION_HH_
-
This page took 0.025358 seconds and 4 git commands to generate.