X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2FGameLayer.hh;h=73b6a23e6a141ec2315cb9f5f2a5f34e91e90dc8;hb=b357615aba1dbde81e3c6999366604e6001010a7;hp=b2df7ef11f3aa3433612fc17ed0fec8b86400152;hpb=892da43bf5796e7c5f593a6d0f53bd797a36bd3e;p=chaz%2Fyoink diff --git a/src/GameLayer.hh b/src/GameLayer.hh index b2df7ef..73b6a23 100644 --- a/src/GameLayer.hh +++ b/src/GameLayer.hh @@ -36,19 +36,26 @@ #include #include +#include #include #include -#include #include #include #include -#include +#include #include +#include +#include +#include +#include +#include + #include "Character.hh" -#include "Hud.hh" +#include "Heroine.hh" +#include "Scene.hh" class GameLayer; @@ -57,6 +64,7 @@ typedef boost::shared_ptr GameLayerP; class GameLayer : public Mf::Layer { public: + GameLayer(); static GameLayerP alloc() @@ -65,24 +73,46 @@ 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); + + 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); + + struct State + { + Mf::Script script; + std::vector sceneList; + + HeroineP heroine; + SceneP scene; + + Mf::PolynomialInterpolator<5> interp; + + Mf::Camera camera; + }; private: - Mf::Sound music; + void loadSceneLoader(); + void advanceScene(); + + void thinkTimer(); + + void setProjection(); + void setProjection(Mf::Scalar width, Mf::Scalar height); - CharacterP heroine; - Mf::Sound punchSound; + State mState; + Mf::Timer mThinkTimer; - Mf::PolynomialInterpolator<5> interp; - Mf::Lerp fadeIn; + Mf::SoundStream mMusic; + Mf::Sound mPunchSound; - Mf::Camera camera; - Mf::OctreeP octree; + Mf::Ray<2> mRay; + Mf::Line<2> mLine; + Mf::Sphere<2> mSphere; - HudP hud; + Mf::Timer mRayTimer; + void rayTimer(); };