X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FGameLayer.hh;h=d75d9dc467e07ca998c57374e4482ac816b48112;hp=4e26e689b495a12a39289041ac7fe992b5e085a7;hb=e495074443d9fd7bc16137084cf9de3d031b75c4;hpb=c9e20ac06383b20ceb5404c9237e319c2e90d157 diff --git a/src/GameLayer.hh b/src/GameLayer.hh index 4e26e68..d75d9dc 100644 --- a/src/GameLayer.hh +++ b/src/GameLayer.hh @@ -41,7 +41,6 @@ #include #include -#include #include #include #include @@ -50,7 +49,6 @@ #include "Character.hh" #include "Heroine.hh" -#include "Hud.hh" #include "Scene.hh" @@ -69,9 +67,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 +96,9 @@ 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; - Mf::Sound mPunchSound; - - HeroineP mHeroine; - SceneP mScene; - - Mf::PolynomialInterpolator<5> mInterp; - - Mf::Camera mCamera; - - HudP mHud; + State mState; + Mf::Sound mMusic; + Mf::Sound mPunchSound; };