]> Dogcows Code - chaz/yoink/blobdiff - src/TitleLayer.cc
dispatch class not a singleton, engine is static
[chaz/yoink] / src / TitleLayer.cc
index 11c624d07e94e59375141a98681df5a658a7370f..ed8f4c1acd340d2ca952c32b90275f704d696f2a 100644 (file)
 #include "TitleLayer.hh"
 
 
-void TitleLayer::pushed(Mf::Engine& engine)
+void TitleLayer::pushedOntoEngine()
 {
-       mEngine = &engine;
-
        Mf::Scalar coeff[] = {0.0, 1.0};
        mFadeIn.init(coeff, 0.1);
 
@@ -60,16 +58,21 @@ bool TitleLayer::handleEvent(const Mf::Event& event)
        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::engine.pop(this);
+                       //engine.pushLayer(GameLayer::alloc());
 
-                       Mf::Scalar coeff[] = {0.0, 1.0};
-                       Mf::Lerp interp(coeff, 0.2);
+                       Mf::Scalar coeff[] = {0.0, 0.75, 0.99, 1.0};
+                       Mf::PolynomialInterpolator<3> interp(coeff, 0.1);
 
                        //Mf::LayerP mGameLayer = GameLayer::alloc();
-                       Mf::Transition<Mf::Lerp>::Ptr transition =
-                               Mf::Transition<Mf::Lerp>::alloc(mGameLayer, titleLayer, interp);
-                       mEngine->push(transition);
+                       Mf::Transition<Mf::PolynomialInterpolator<3> >::Ptr transition =
+                               Mf::Transition<Mf::PolynomialInterpolator<3> >::alloc(mGameLayer, titleLayer, interp);
+                       Mf::engine.push(transition);
                        return true;
        }
 
This page took 0.01755 seconds and 4 git commands to generate.