X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FGameLayer.hh;h=53613617b513aa7e95ef993fe376b21ec1bf335a;hp=f966c7092ca3703affa4dee90dc60172815a75dd;hb=a295f8def17036c8071b56e181364f99a377cae7;hpb=2d77fb5fb3480f522658f30af6addd5146530517 diff --git a/src/GameLayer.hh b/src/GameLayer.hh index f966c70..5361361 100644 --- a/src/GameLayer.hh +++ b/src/GameLayer.hh @@ -40,21 +40,18 @@ #include -#include -#include #include #include -#include #include #include #include #include #include +#include -#include "Character.hh" -#include "Heroine.hh" -#include "Scene.hh" +#include "Hud.hh" +#include "GameState.hh" class GameLayer; @@ -71,45 +68,36 @@ public: return GameLayerP(new GameLayer); } - void pushed(Mf::Engine& engine); + void pushedOntoEngine(); - 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; - }; + void update(Mf::Scalar t, Mf::Scalar dt); + void draw(Mf::Scalar alpha) const; + bool handleEvent(const Mf::Event& event); private: void loadSceneLoader(); void advanceScene(); - Mf::Scalar getZCoord(const Mf::Vector2& position) const; + void thinkTimer(); void setProjection(); void setProjection(Mf::Scalar width, Mf::Scalar height); - State mState; - Mf::Sound mMusic; - Mf::Sound mPunchSound; + GameState mState; + Mf::Timer mThinkTimer; + + HudP mHud; - Mf::Ray<2> mRay; - Mf::Line<2> mLine; - Mf::Plane mPlane; + Mf::SoundStream mMusic; + Mf::Sound mPunchSound; + + Mf::Ray<2> mRay; + Mf::Line<2> mLine; Mf::Sphere<2> mSphere; + + Mf::Timer mRayTimer; + void rayTimer(); };