#include <boost/shared_ptr.hpp>
-#include <Moof/Engine.hh>
+#include <Moof/Core.hh>
#include <Moof/Interpolator.hh>
#include <Moof/Layer.hh>
#include <Moof/Log.hh>
}
- void popped(Engine& engine)
+ void removedFromCore()
{
- if (mTo) engine.push(mTo);
+ if (mTo) core.push(mTo);
}
- void update(Engine& engine, Scalar t, Scalar dt)
+ void update(Scalar t, Scalar dt)
{
mInterp.update(t, dt);
- if (mFrom) mFrom->update(engine, t, dt);
- if (mTo) mTo->update(engine, t, dt);
+ if (mFrom) mFrom->update(t, dt);
+ if (mTo) mTo->update(t, dt);
if (mInterp.isDone())
{
// to should /replace/ this
- engine.pop(this);
+ core.pop(this);
}
}
glPopMatrix();
}
- void draw(Engine& engine, Scalar alpha) const
+ void draw(Scalar alpha) const
{
Scalar a = mInterp.getState(alpha);
- logDebug << "transition state: " << a << std::endl;
+ logInfo << "transition state: " << a << std::endl;
//glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glPushMatrix();
glLoadIdentity();
glRotate(180.0 * a, 0.0, 1.0, 0.0);
- mFrom->draw(engine, alpha);
+ mFrom->draw(alpha);
glPopMatrix();
}
//drawFade(a);
glPushMatrix();
glLoadIdentity();
glRotate(180.0 * (1.0 - a), 0.0, 1.0, 0.0);
- mTo->draw(engine, alpha);
+ mTo->draw(alpha);
glPopMatrix();
}
//drawFade(1.0 - a);
}
- bool handleEvent(Engine& engine, const Event& event)
+ bool handleEvent(const Event& event)
{
if (mTo)
{
- return mTo->handleEvent(engine, event);
+ return mTo->handleEvent(event);
}
else if (mFrom)
{
- return mFrom->handleEvent(engine, event);
+ return mFrom->handleEvent(event);
}
return false;
}