[4766] | 1 | /*! |
---|
[5018] | 2 | * @file orxonox.h |
---|
| 3 | * Orxonox core functions |
---|
[4766] | 4 | */ |
---|
[1856] | 5 | |
---|
[3224] | 6 | #ifndef _ORXONOX_H |
---|
| 7 | #define _ORXONOX_H |
---|
[1803] | 8 | |
---|
[4817] | 9 | #include "base_object.h" |
---|
[2190] | 10 | |
---|
[2636] | 11 | class GameLoader; |
---|
[4766] | 12 | class IniParser; |
---|
[1850] | 13 | |
---|
[4768] | 14 | //! orxonox core singleton class |
---|
[2190] | 15 | /** |
---|
| 16 | */ |
---|
[4817] | 17 | class Orxonox : public BaseObject { |
---|
[1803] | 18 | |
---|
[6351] | 19 | |
---|
[4445] | 20 | public: |
---|
| 21 | virtual ~Orxonox (); |
---|
[4836] | 22 | /** @returns a Pointer to the only object of this Class */ |
---|
[4766] | 23 | inline static Orxonox* getInstance() { if (!singletonRef) singletonRef = new Orxonox(); return singletonRef; }; |
---|
| 24 | |
---|
[5996] | 25 | int init(int argc, char** argv, const char* name, int port); |
---|
[6351] | 26 | void start(); |
---|
[4445] | 27 | |
---|
[5207] | 28 | |
---|
[1850] | 29 | private: |
---|
[4447] | 30 | Orxonox (); |
---|
| 31 | |
---|
[6351] | 32 | int initResources (int argc, char** argv); |
---|
| 33 | int initVideo (int argc, char** argv); |
---|
| 34 | int initSound (int argc, char** argv); |
---|
| 35 | int initInput (int argc, char** argv); |
---|
| 36 | int initNetworking (int argc, char** argv); |
---|
| 37 | int initMisc (int argc, char** argv); |
---|
| 38 | |
---|
[4766] | 39 | void parseIniFile(const char* fileName); |
---|
[6351] | 40 | const char* getConfigFile (); |
---|
[4766] | 41 | |
---|
[4445] | 42 | |
---|
| 43 | private: |
---|
[4447] | 44 | static Orxonox* singletonRef; //!< singleton reference to orxonox |
---|
[3543] | 45 | |
---|
[4766] | 46 | IniParser* iniParser; //!< Reference to the ini-parser used in orxonox |
---|
[4830] | 47 | char* configFileName; //!< Filename of the configuration-file. |
---|
[4447] | 48 | GameLoader* gameLoader; //!< The gameLoader |
---|
[4766] | 49 | |
---|
[4447] | 50 | unsigned int argc; //!< Count of Arguments of orxonox |
---|
| 51 | char** argv; //!< Values of th Arguments of orxonox. |
---|
[5996] | 52 | |
---|
| 53 | const char* serverName; //!< Name of the Orxonox client if == NULL -> server |
---|
[6351] | 54 | int dedicatedServer; //!< is 1 if the server is a dedicated server, 0 else |
---|
[5996] | 55 | int port; //!< number of the network port of the server/client if == -1 no network |
---|
[1803] | 56 | }; |
---|
| 57 | |
---|
[4447] | 58 | |
---|
[5024] | 59 | //////////////////////// |
---|
| 60 | // Start-up functions // |
---|
| 61 | //////////////////////// |
---|
[5996] | 62 | int showHelp(int argc, char** argv); |
---|
| 63 | int showLicense(); |
---|
| 64 | int startOrxonox(int argc, char** argv, const char* clientName, int port); |
---|
[3648] | 65 | |
---|
[3224] | 66 | #endif /* _ORXONOX_H */ |
---|
[1850] | 67 | |
---|