]> Dogcows Code - chaz/yoink/blobdiff - src/GameLayer.hh
foundational changes; tying up some loose ends
[chaz/yoink] / src / GameLayer.hh
index c4c5420888b63e5f7b7e7067fd5a9df9172f11da..d75d9dc467e07ca998c57374e4482ac816b48112 100644 (file)
 
 #include <iostream>
 #include <string>
+#include <vector>
 
 #include <boost/shared_ptr.hpp>
 
 #include <Moof/Camera.hh>
-#include <Moof/Dispatcher.hh>
 #include <Moof/Interpolator.hh>
 #include <Moof/Layer.hh>
 #include <Moof/Math.hh>
+#include <Moof/Script.hh>
 #include <Moof/Sound.hh>
 
 #include "Character.hh"
 #include "Heroine.hh"
-#include "Hud.hh"
 #include "Scene.hh"
 
 
@@ -66,26 +66,39 @@ public:
        }
 
        void pushed(Mf::Engine& engine);
-       void update(Mf::Scalar t, Mf::Scalar dt);
-       void draw(Mf::Scalar alpha) const;
-       bool handleEvent(const Mf::Event& event);
 
-private:
+       void update(Mf::Engine& engine, Mf::Scalar t, Mf::Scalar dt);
+       void draw(Mf::Engine& engine, Mf::Scalar alpha) const;
+       bool handleEvent(Mf::Engine& engine, const Mf::Event& event);
 
-       void setProjection();
-       void setProjection(Mf::Scalar width, Mf::Scalar height);
+       struct State
+       {
+               // the script object must be mutable because some script functions must be
+               // called during draw
+               mutable Mf::Script                      script;
+               std::vector<std::string>        sceneList;
+
+               HeroineP                heroine;
+               SceneP                  scene;
 
-       Mf::Sound music;
+               Mf::PolynomialInterpolator<5> interp;
 
-       HeroineP        heroine;
-       SceneP          scene;
-       Mf::Sound punchSound;
+               Mf::Camera              camera;
+       };
 
-       Mf::PolynomialInterpolator<5> interp;
+private:
+
+       void loadSceneLoader();
+       void advanceScene();
+
+       Mf::Scalar getZCoord(const Mf::Vector2& position) const;
 
-       Mf::Camera camera;
+       void setProjection();
+       void setProjection(Mf::Scalar width, Mf::Scalar height);
 
-       HudP hud;
+       State           mState;
+       Mf::Sound       mMusic;
+       Mf::Sound       mPunchSound;
 };
 
 
This page took 0.017641 seconds and 4 git commands to generate.