[1293] | 1 | /* |
---|
| 2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
| 3 | * > www.orxonox.net < |
---|
| 4 | * |
---|
| 5 | * |
---|
| 6 | * License notice: |
---|
| 7 | * |
---|
| 8 | * This program is free software; you can redistribute it and/or |
---|
| 9 | * modify it under the terms of the GNU General Public License |
---|
| 10 | * as published by the Free Software Foundation; either version 2 |
---|
| 11 | * of the License, or (at your option) any later version. |
---|
| 12 | * |
---|
| 13 | * This program is distributed in the hope that it will be useful, |
---|
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 16 | * GNU General Public License for more details. |
---|
| 17 | * |
---|
| 18 | * You should have received a copy of the GNU General Public License |
---|
| 19 | * along with this program; if not, write to the Free Software |
---|
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
| 21 | * |
---|
| 22 | * Author: |
---|
[1535] | 23 | * Reto Grieder |
---|
[1638] | 24 | * Benjamin Knecht <beni_at_orxonox.net>, (C) 2007 |
---|
[1293] | 25 | * Co-authors: |
---|
[1638] | 26 | * ... |
---|
[1293] | 27 | * |
---|
| 28 | */ |
---|
| 29 | |
---|
[612] | 30 | /** |
---|
| 31 | @file Orxonox.h |
---|
| 32 | @brief Main Orxonox Class File |
---|
| 33 | @author Benjamin Knecht <beni_at_orxonox.net> |
---|
| 34 | */ |
---|
| 35 | |
---|
[673] | 36 | #ifndef _Orxonox_H__ |
---|
| 37 | #define _Orxonox_H__ |
---|
[612] | 38 | |
---|
[1039] | 39 | #include "OrxonoxPrereqs.h" |
---|
| 40 | |
---|
[715] | 41 | #include <string> |
---|
| 42 | |
---|
[612] | 43 | #include <OgrePrerequisites.h> |
---|
[1638] | 44 | |
---|
| 45 | #include "core/OrxonoxClass.h" |
---|
[777] | 46 | #include "audio/AudioPrereqs.h" |
---|
[612] | 47 | #include "GraphicsEngine.h" |
---|
[1638] | 48 | #include "Settings.h" |
---|
[612] | 49 | |
---|
[1638] | 50 | namespace orxonox |
---|
| 51 | { |
---|
[1032] | 52 | //! Orxonox singleton class |
---|
[1638] | 53 | class _OrxonoxExport Orxonox : public OrxonoxClass |
---|
[612] | 54 | { |
---|
| 55 | public: |
---|
[1638] | 56 | Orxonox(); |
---|
| 57 | ~Orxonox(); |
---|
[1293] | 58 | |
---|
[1638] | 59 | void start(); |
---|
| 60 | void setConfigValues(); |
---|
| 61 | |
---|
[1021] | 62 | void abortRequest(); |
---|
| 63 | |
---|
[1638] | 64 | static Orxonox& getSingleton(); |
---|
[1293] | 65 | |
---|
[1638] | 66 | static void slomo(float factor) { Orxonox::setTimeFactor(factor); } |
---|
| 67 | static float getTimeFactor() { return Orxonox::getSingleton().timefactor_; } |
---|
| 68 | static void loadGame(const std::string& name); |
---|
| 69 | static void exit() { Orxonox::getSingleton().abortRequest(); } |
---|
[1563] | 70 | static void setTimeFactor(float factor = 1.0); |
---|
[1505] | 71 | |
---|
[1021] | 72 | private: |
---|
| 73 | // don't mess with singletons |
---|
| 74 | Orxonox(Orxonox& instance); |
---|
| 75 | |
---|
[1638] | 76 | bool loadLevel(const GameMode& mode); |
---|
[1293] | 77 | bool serverLoad(); |
---|
| 78 | bool clientLoad(); |
---|
| 79 | bool standaloneLoad(); |
---|
[1021] | 80 | |
---|
[1638] | 81 | bool loadPlayground(); |
---|
[1293] | 82 | bool loadScene(); |
---|
[1638] | 83 | void startRenderLoop(); |
---|
[1293] | 84 | |
---|
[612] | 85 | private: |
---|
[717] | 86 | GraphicsEngine* ogre_; //!< our dearest graphics engine <3 |
---|
[1625] | 87 | Level* startLevel_; //!< current hard coded default level |
---|
| 88 | Level* hud_; //!< 'level' object fo the HUD |
---|
| 89 | Radar* radar_; //!< represents the Radar (not the HUD part) |
---|
[1293] | 90 | //audio::AudioManager* auMan_; //!< audio manager |
---|
[1021] | 91 | Ogre::Timer* timer_; //!< Main loop timer |
---|
[1293] | 92 | bool bAbort_; //!< aborts the render loop if true |
---|
[1052] | 93 | float timefactor_; //!< A factor to change the gamespeed |
---|
[612] | 94 | |
---|
| 95 | // this is used to identify the mode (server/client/...) we're in |
---|
[1638] | 96 | GameMode mode_; |
---|
| 97 | GameMode modeRequest_; |
---|
[1021] | 98 | |
---|
[1638] | 99 | // config values |
---|
| 100 | float debugRefreshTime_; |
---|
| 101 | |
---|
[1021] | 102 | static Orxonox *singletonRef_s; |
---|
[612] | 103 | }; |
---|
| 104 | } |
---|
[673] | 105 | #endif /* _Orxonox_H__ */ |
---|