/*] Copyright (c) 2009-2010, Charles McGarvey [************************** **] All rights reserved. * * vi:ts=4 sw=4 tw=75 * * Distributable under the terms and conditions of the 2-clause BSD license; * see the file COPYING for a complete text of the license. * **************************************************************************/ #ifndef _GAMELAYER_HH_ #define _GAMELAYER_HH_ /** * @file GameLayer.hh * This is the big enchilada. */ #include #include #include #include #include #include #include // TODO #include #include #include #include #include #include "GameState.hh" #include "Hud.hh" class GameLayer; typedef boost::shared_ptr GameLayerP; class GameLayer : public Mf::View { public: static GameLayerP alloc() { return GameLayerP(new GameLayer); } GameLayer(); void didAddToView(); 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::Settings& settings); void thinkTimer(); void setProjection(); void setProjection(Mf::Scalar width, Mf::Scalar height); GameState mState; Mf::Timer mThinkTimer; HudP mHud; Mf::SoundStream mMusic; Mf::Sound mPunchSound; Mf::Ray2 mRay; Mf::Line2 mLine; Mf::Circle mCircle; Mf::Timer mRayTimer; void rayTimer(); }; #endif // _GAMELAYER_HH_