Pieces that can move are now shown in cyan when no pieces are selected. Squares now...
[NALCG.git] / src / view / viewframelistener.h
bloba50c8931806045dba86e4875fd24219bb25c13df
1 #ifndef _NALCG_VIEW_FRAME_LISTENER_H_
2 #define _NALCG_VIEW_FRAME_LISTENER_H_
4 #include "animationmanager.h"
5 #include "bufferedinputhandler.h"
7 #include <Ogre.h>
8 #include <CEGUI/CEGUI.h>
9 #include <OIS/OIS.h>
11 using namespace Ogre;
13 class ViewFrameListener : public FrameListener
15 public:
16 ViewFrameListener(OIS::Keyboard* keyboard, OIS::Mouse* mouse,
17 RenderWindow* window, Camera* camera, SceneManager* sceneManager,
18 View* view)
19 : mKeyboard(keyboard), mMouse(mouse), mAnimationManager(),
20 mHandler(window, camera, sceneManager, &mAnimationManager, view),
21 mContinue(true), mWindow(window), mTime(0), mSceneMgr(sceneManager),
22 mCamera(camera), mCreated(false)
24 mDebugOverlay = OverlayManager::getSingleton().getByName("Core/DebugOverlay");
25 mKeyboard->setEventCallback(&mHandler);
26 mMouse->setEventCallback(&mHandler);
29 bool frameStarted(const FrameEvent& evt);
30 bool frameEnded(const FrameEvent& evt);
31 bool quit(const CEGUI::EventArgs& e);
32 bool toggleDebugInfo(const CEGUI::EventArgs& e);
33 bool handleAnimationSpeedChanged(const CEGUI::EventArgs& e);
34 void move(int fromX, int fromY, int toX, int toY,
35 bool continuous, unsigned int promoteTo = 0)
37 mHandler.move(fromX, fromY, toX, toY, continuous, promoteTo);
39 AnimationManager& getAnimationManager()
41 return mAnimationManager;
43 void setCanShowSelectablePieces(bool canShow)
45 mHandler.setCanShowSelectablePieces(canShow);
47 virtual void clearSelectedObject()
49 mHandler.clearSelectedObject();
52 protected:
53 OIS::Keyboard* mKeyboard;
54 OIS::Mouse* mMouse;
55 AnimationManager mAnimationManager;
56 BufferedInputHandler mHandler;
57 bool mContinue;
58 Overlay* mDebugOverlay;
59 RenderWindow* mWindow;
60 double mTime;
61 SceneManager* mSceneMgr;
62 Camera* mCamera;
63 bool mCreated;
65 virtual void updateStats();
66 void flashMovableSquares(const Real& timeSinceLastFrame);
67 void moveLights(const Real& timeSinceLastFrame);
68 void playOpeningAnimation(const Real& timeSinceLastFrame);
71 #endif // _NALCG_VIEW_FRAME_LISTENER_H_