X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FGameLayer.hh;h=4692611789f7cfbc1829be8b67cf13677d94a87d;hp=4e26e689b495a12a39289041ac7fe992b5e085a7;hb=7e84479de612a4ce287c6f63deb014b447a993ec;hpb=8a1acac01b444dccf8b57cedf08392ada2e473c1 diff --git a/src/GameLayer.hh b/src/GameLayer.hh index 4e26e68..4692611 100644 --- a/src/GameLayer.hh +++ b/src/GameLayer.hh @@ -41,16 +41,19 @@ #include #include -#include #include #include #include #include #include +#include +#include +#include +#include + #include "Character.hh" #include "Heroine.hh" -#include "Hud.hh" #include "Scene.hh" @@ -60,6 +63,7 @@ typedef boost::shared_ptr GameLayerP; class GameLayer : public Mf::Layer { public: + GameLayer(); static GameLayerP alloc() @@ -69,9 +73,24 @@ 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 + { + // the script object must be mutable because some script functions must be + // called during draw + mutable Mf::Script script; + std::vector sceneList; + + HeroineP heroine; + SceneP scene; + + Mf::PolynomialInterpolator<5> interp; + + Mf::Camera camera; + }; private: @@ -83,23 +102,15 @@ private: void setProjection(); void setProjection(Mf::Scalar width, Mf::Scalar height); - - // the script object must be mutable because some script functions must be - // called during draw - mutable Mf::Script mScript; - std::vector mSceneList; - - Mf::Sound mMusic; + State mState; + Mf::SoundStream mMusic; Mf::Sound mPunchSound; - HeroineP mHeroine; - SceneP mScene; - - Mf::PolynomialInterpolator<5> mInterp; - - Mf::Camera mCamera; - - HudP mHud; + Mf::Ray<2> mRay; + Mf::Ray<3> mRay3; + Mf::Line<2> mLine; + Mf::Plane mPlane; + Mf::Sphere<2> mSphere; };