00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #if !defined(AFX_MAINCAMERA_H__97593EBB_5901_4D81_BAEB_8ADC76CFB627__INCLUDED_)
00022 #define AFX_MAINCAMERA_H__97593EBB_5901_4D81_BAEB_8ADC76CFB627__INCLUDED_
00023
00024 #include <GLEXT/GLMenuI.h>
00025 #include <engine/GameStateI.h>
00026 #include <graph/TargetCamera.h>
00027 #include <common/Vector.h>
00028 #include <map>
00029
00030 class MainCamera : public GameStateI, public GLMenuI
00031 {
00032 public:
00033 static MainCamera *instance();
00034
00035 GLCamera &getCamera() { return targetCam_.getCamera(); }
00036 TargetCamera &getTarget() { return targetCam_; }
00037
00038 bool getCameraSelected() { return mouseDown_ || keyDown_ || scrolling_; }
00039 bool getShowArena() { return showArena_; }
00040
00041
00042 virtual void simulate(const unsigned state,
00043 float frameTime);
00044 virtual void draw(const unsigned state);
00045 virtual void mouseWheel(const unsigned state,
00046 int x, int y, int z, bool &skipRest);
00047 virtual void mouseDown(const unsigned state,
00048 GameState::MouseButton button, int x, int y, bool &skipRest);
00049 virtual void mouseUp(const unsigned state,
00050 GameState::MouseButton button, int x, int y, bool &skipRest);
00051 virtual void mouseDrag(const unsigned state,
00052 GameState::MouseButton button,
00053 int mx, int my, int x, int y, bool &skipRest);
00054 virtual void keyboardCheck(
00055 const unsigned state, float frameTime,
00056 char *buffer, unsigned int keyState,
00057 KeyboardHistory::HistoryElement *history, int hisCount,
00058 bool &skipRest);
00059
00060
00061 virtual bool getEnabled(const char* menuName);
00062 virtual void menuSelection(const char* menuName,
00063 const int position, GLMenuItem &item);
00064 virtual bool getMenuItems(const char* menuName,
00065 std::list<GLMenuItem> &result);
00066
00067
00068 class SaveScreen : public GameStateI
00069 {
00070 public:
00071 SaveScreen() : GameStateI("SaveScreen"), saveScreen_(false), saveScreenTest_(false) {}
00072 virtual void draw(const unsigned state);
00073
00074 bool saveScreen_;
00075 bool saveScreenTest_;
00076 } saveScreen_;
00077
00078 class Precipitation : public GameStateI
00079 {
00080 public:
00081 Precipitation() : GameStateI("Precipitation") {}
00082 virtual void draw(const unsigned state);
00083 } precipitation_;
00084
00085 protected:
00086 static MainCamera *instance_;
00087 bool mouseDown_, keyDown_, scrolling_, showArena_;
00088 TargetCamera targetCam_;
00089
00090 std::map<int, std::pair<Vector, Vector> > quickKeys_;
00091
00092 void setQuick(int key);
00093 void useQuick(int key);
00094
00095 private:
00096 MainCamera();
00097 virtual ~MainCamera();
00098
00099 };
00100
00101 #endif // !defined(AFX_MAINCAMERA_H__97593EBB_5901_4D81_BAEB_8ADC76CFB627__INCLUDED_)