X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FGameLayer.hh;h=d75d9dc467e07ca998c57374e4482ac816b48112;hp=b2df7ef11f3aa3433612fc17ed0fec8b86400152;hb=e495074443d9fd7bc16137084cf9de3d031b75c4;hpb=892da43bf5796e7c5f593a6d0f53bd797a36bd3e diff --git a/src/GameLayer.hh b/src/GameLayer.hh index b2df7ef..d75d9dc 100644 --- a/src/GameLayer.hh +++ b/src/GameLayer.hh @@ -36,19 +36,20 @@ #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; @@ -65,24 +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); + + 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::Sound music; + Mf::PolynomialInterpolator<5> interp; + + Mf::Camera camera; + }; + +private: - CharacterP heroine; - Mf::Sound punchSound; + void loadSceneLoader(); + void advanceScene(); - Mf::PolynomialInterpolator<5> interp; - Mf::Lerp fadeIn; + Mf::Scalar getZCoord(const Mf::Vector2& position) const; - Mf::Camera camera; - Mf::OctreeP octree; + void setProjection(); + void setProjection(Mf::Scalar width, Mf::Scalar height); - HudP hud; + State mState; + Mf::Sound mMusic; + Mf::Sound mPunchSound; };