*******************************************************************************/
-#include <Moof/Engine.hh>
+#include <Moof/Core.hh>
#include <Moof/OpenGL.hh>
#include <Moof/Transition.hh>
#include "TitleLayer.hh"
-void TitleLayer::pushed(Mf::Engine& engine)
+void TitleLayer::addedToCore()
{
- mEngine = &engine;
-
- Mf::Scalar coeff[] = {0.0, 1.0};
- mFadeIn.init(coeff, 0.1);
+ mFadeIn.init(0.0, 1.0);
+ mFadeIn.reset(0.1);
mGameLayer = GameLayer::alloc();
}
void TitleLayer::update(Mf::Scalar t, Mf::Scalar dt)
{
- if (!mFadeIn.isDone()) mFadeIn.update(t, dt);
+ mFadeIn.update(t, dt);
}
void TitleLayer::draw(Mf::Scalar alpha) const
switch (event.type)
{
case SDL_KEYUP:
- Mf::LayerP titleLayer = mEngine->pop(this);
- //mEngine->pushLayer(GameLayer::alloc());
+ if (event.key.keysym.sym == SDLK_ESCAPE)
+ {
+ break;
+ }
+
+ Mf::LayerP titleLayer = Mf::core.pop(this);
- Mf::Scalar coeff[] = {0.0, 1.0};
- Mf::Lerp interp(coeff, 0.2);
+ Mf::Lerp interp(0.1);
+ interp.init(0.0, 1.0);
- //Mf::LayerP mGameLayer = GameLayer::alloc();
Mf::Transition<Mf::Lerp>::Ptr transition =
Mf::Transition<Mf::Lerp>::alloc(mGameLayer, titleLayer, interp);
- mEngine->push(transition);
+ Mf::core.push(transition);
+
return true;
}