[146] | 1 | /* |
---|
| 2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
| 3 | * |
---|
| 4 | * |
---|
| 5 | * License notice: |
---|
| 6 | * |
---|
| 7 | * This program is free software: you can redistribute it and/or modify |
---|
| 8 | * it under the terms of the GNU General Public License as published by |
---|
| 9 | * the Free Software Foundation, either version 3 of the License, or |
---|
| 10 | * (at your option) any later version. |
---|
| 11 | * |
---|
| 12 | * This program is distributed in the hope that it will be useful, |
---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 15 | * GNU General Public License for more details. |
---|
| 16 | * |
---|
| 17 | * You should have received a copy of the GNU General Public License |
---|
| 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
| 19 | * |
---|
| 20 | * |
---|
| 21 | * Author: |
---|
| 22 | * Reto Grieder |
---|
| 23 | * Co-authors: |
---|
| 24 | * ... |
---|
| 25 | * |
---|
| 26 | */ |
---|
| 27 | |
---|
| 28 | |
---|
| 29 | #ifndef RUN_MANAGER_H |
---|
| 30 | #define RUN_MANAGER_H |
---|
| 31 | |
---|
| 32 | #include "Ogre.h" |
---|
| 33 | #include "OgreStringConverter.h" |
---|
| 34 | #include "OgreException.h" |
---|
| 35 | |
---|
| 36 | #include "ogre_control.h" |
---|
| 37 | #include "orxonox_scene.h" |
---|
| 38 | #include "orxonox_ship.h" |
---|
| 39 | |
---|
| 40 | //Use this define to signify OIS will be used as a DLL |
---|
| 41 | //(so that dll import/export macros are in effect) |
---|
| 42 | #define OIS_DYNAMIC_LIB |
---|
| 43 | #include <OIS/OIS.h> |
---|
| 44 | |
---|
| 45 | using namespace Ogre; |
---|
| 46 | |
---|
| 47 | |
---|
| 48 | // let the class inherit from WindowEventListener in order for the RunMgr |
---|
| 49 | // to act as the central point of all the calcuations in Orxonox |
---|
| 50 | class RunManager : WindowEventListener |
---|
| 51 | { |
---|
| 52 | public: |
---|
| 53 | RunManager(OgreControl*, bool = false, bool = false, bool = false); |
---|
| 54 | |
---|
| 55 | virtual ~RunManager(); |
---|
| 56 | |
---|
| 57 | virtual bool tick(unsigned long, float); |
---|
| 58 | |
---|
| 59 | protected: |
---|
| 60 | OgreControl *mOgre; |
---|
| 61 | |
---|
| 62 | SceneManager *mSceneMgr; |
---|
| 63 | RenderWindow* mWindow; |
---|
| 64 | |
---|
| 65 | OrxonoxScene *mScene; |
---|
| 66 | Camera* mCamera; |
---|
| 67 | SceneNode *mShipNode; |
---|
| 68 | OrxonoxShip *mShip; |
---|
| 69 | |
---|
| 70 | bool mStatsOn; |
---|
| 71 | |
---|
| 72 | std::string mDebugText; |
---|
| 73 | |
---|
| 74 | unsigned int mNumScreenShots; |
---|
| 75 | // just to stop toggles flipping too fast |
---|
| 76 | Real mTimeUntilNextToggle ; |
---|
| 77 | TextureFilterOptions mFiltering; |
---|
| 78 | int mAniso; |
---|
| 79 | |
---|
| 80 | int mSceneDetailIndex ; |
---|
| 81 | Overlay* mDebugOverlay; |
---|
| 82 | |
---|
| 83 | //OIS Input devices |
---|
| 84 | OIS::InputManager* mInputManager; |
---|
| 85 | OIS::Mouse* mMouse; |
---|
| 86 | OIS::Keyboard* mKeyboard; |
---|
| 87 | OIS::JoyStick* mJoy; |
---|
| 88 | |
---|
| 89 | bool leftButtonDown; |
---|
| 90 | Bullet **mBullets; |
---|
| 91 | int mBulletsSize; |
---|
| 92 | int mBulletsPosition; |
---|
| 93 | |
---|
| 94 | // previously elapsed render time |
---|
| 95 | unsigned long mTime; |
---|
| 96 | |
---|
| 97 | virtual void createCamera(void); |
---|
| 98 | |
---|
| 99 | virtual void createViewports(void); |
---|
| 100 | |
---|
| 101 | |
---|
| 102 | /** EVENT HANDLING **/ |
---|
| 103 | |
---|
| 104 | //Adjust mouse clipping area |
---|
| 105 | virtual void windowResized(RenderWindow*); |
---|
| 106 | |
---|
| 107 | //Unattach OIS before window shutdown (very important under Linux) |
---|
| 108 | virtual void windowClosed(RenderWindow*); |
---|
| 109 | |
---|
| 110 | |
---|
| 111 | /** INPUT PROCESSING **/ |
---|
| 112 | virtual bool processUnbufferedKeyInput(); |
---|
| 113 | |
---|
| 114 | virtual bool processUnbufferedMouseInput(); |
---|
| 115 | |
---|
| 116 | |
---|
| 117 | /** OUTPUT **/ |
---|
| 118 | |
---|
| 119 | virtual void updateStats(void); |
---|
| 120 | |
---|
| 121 | virtual void showDebugOverlay(bool); |
---|
| 122 | |
---|
| 123 | }; |
---|
| 124 | |
---|
| 125 | #endif /* RUN_MANAGER_H */ |
---|