- Timestamp:
- Mar 30, 2006, 11:45:31 AM (19 years ago)
- Location:
- trunk
- Files:
-
- 22 edited
- 12 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/AUTHORS
r4604 r7256 1 1 orxonox-crew: <orxonox-dev@mail.datacore.ch> 2 2 3 Maintainers: 3 4 Patrick Boenzli <patrick@orxonox.ethz.ch> 4 5 Benjamin Grauer <bensch@orxonox.ethz.ch> 6 7 Developers: 8 Christian Meyer 9 David Gruetter 10 11 Coders: 5 12 Simon Hofmann 6 David Gruetter7 13 Johannes Bader 8 14 Adrian Buerli 9 Christian Meyer 15 16 -
trunk/configure.ac
r7223 r7256 646 646 src/lib/parser/tinyxml/Makefile 647 647 src/lib/parser/ini_parser/Makefile 648 src/lib/parser/cmdline_parser/Makefile 649 src/lib/parser/preferences/Makefile 648 650 src/util/Makefile 649 651 src/world_entities/Makefile -
trunk/src/defs/class_id.h
r7193 r7256 96 96 CL_MASK_LOWLEVEL_CLASS = 0x00000fff, 97 97 98 CL_PREFERENCES = 0X00000f51, 98 99 99 100 /// SINGLETON classes (range from 0x00000000 to 0x000000ff) -
trunk/src/defs/globals.h
r6998 r7256 27 27 #define DEFAULT_DATA_DIR DATADIR "/orxonox/" 28 28 #define DEFAULT_DATA_DIR_CHECKFILE "data.oxd" 29 30 #define DEFAULT_ORXONOX_PORT 9999 29 31 30 32 // Defines all the Sections of the Config (in Gui and orxonox) -
trunk/src/lib/BuildLibs.am
r7151 r7256 15 15 $(LIB_PREFIX)/graphics/spatial_separation/libORXquadtree.a \ 16 16 $(LIB_PREFIX)/parser/tinyxml/libtinyxml.a \ 17 $(LIB_PREFIX)/parser/preferences/libPrefsParser.a \ 18 $(LIB_PREFIX)/parser/cmdline_parser/libCmdLineParser.a \ 17 19 $(LIB_PREFIX)/parser/ini_parser/libIniParser.a \ 18 20 $(LIB_PREFIX)/shell/libORXshell.a \ 19 $(LIB_PREFIX)/math/libORXmath.a 21 $(LIB_PREFIX)/math/libORXmath.a \ 22 $(LIB_PREFIX)/libORXlibs.a -
trunk/src/lib/Makefile.am
r7221 r7256 23 23 util/loading/factory.cc \ 24 24 util/loading/dynamic_loader.cc \ 25 util/preferences.cc \ 25 26 \ 26 27 data/data_tank.cc … … 39 40 util/executor/executor_specials.h \ 40 41 util/executor/functor_list.h \ 42 util/preferences.h \ 41 43 \ 42 44 util/loading/resource_manager.h \ -
trunk/src/lib/event/event_handler.cc
r7166 r7256 88 88 * this has to be called before the use of the event handler 89 89 */ 90 void EventHandler::init( IniParser* iniParser)90 void EventHandler::init() 91 91 { 92 92 if (this->keyMapper == NULL) 93 93 { 94 94 this->keyMapper = new KeyMapper(); 95 this->keyMapper->loadKeyBindings( iniParser);95 this->keyMapper->loadKeyBindings(); 96 96 } 97 97 } -
trunk/src/lib/event/event_handler.h
r7164 r7256 15 15 // FORWARD DECLARATION 16 16 class EventListener; 17 class IniParser;18 17 19 18 //! The one Event Handler from Orxonox … … 24 23 /** @returns a Pointer to the only object of this Class */ 25 24 inline static EventHandler* getInstance() { if (!singletonRef) singletonRef = new EventHandler(); return singletonRef; }; 26 void init( IniParser* iniParser);25 void init(); 27 26 28 27 /** @param state: to which the event handler shall change */ -
trunk/src/lib/event/key_mapper.cc
r7221 r7256 25 25 #include "globals.h" 26 26 #include "parser/ini_parser/ini_parser.h" 27 #include "util/preferences.h" 27 28 #include "key_names.h" 28 29 #include "debug.h" … … 145 146 146 147 iniParser->firstVar(); 147 while( iniParser->getCurrentName() != "")148 while( iniParser->getCurrentName() != "" ) 148 149 { 149 150 PRINTF(3)("Keys: Parsing %s, %s now.\n", iniParser->getCurrentName(), iniParser->getCurrentValue()); … … 164 165 165 166 iniParser->firstVar(); 166 while( iniParser->getCurrentName() != "")167 while( iniParser->getCurrentName() != "" ) 167 168 { 168 169 PRINTF(3)("MISC: Parsing %s, %s now.\n", iniParser->getCurrentName(), iniParser->getCurrentValue()); … … 170 171 this->mapKeys(iniParser->getCurrentName(), index); 171 172 iniParser->nextVar(); 173 } 174 } 175 176 void KeyMapper::loadKeyBindings() 177 { 178 if( !Preferences::getInstance()->sectionExists(CONFIG_SECTION_PLAYER "1")) 179 { 180 PRINTF(1)("Could not find key bindings " CONFIG_SECTION_PLAYER"1\n"); 181 return; 182 } 183 int* index; 184 185 std::list<std::string> keys = Preferences::getInstance()->listKeys(CONFIG_SECTION_PLAYER "1"); 186 for ( std::list<std::string>::const_iterator it = keys.begin(); it!=keys.end(); it++ ) 187 { 188 PRINTF(3)("Keys: Parsing %s, %s now.\n", it->c_str(), Preferences::getInstance()->getString(CONFIG_SECTION_PLAYER "1", *it, "").c_str()); 189 // map the name to an sdl index 190 index = nameToIndex (Preferences::getInstance()->getString(CONFIG_SECTION_PLAYER "1", *it, "")); 191 // map the index to a internal name 192 this->mapKeys(*it, index); 193 } 194 195 196 // PARSE MISC SECTION 197 if( !Preferences::getInstance()->sectionExists (CONFIG_SECTION_MISC_KEYS)) 198 { 199 PRINTF(1)("Could not find key bindings " CONFIG_SECTION_MISC_KEYS "\n"); 200 return; 201 } 202 203 keys = Preferences::getInstance()->listKeys(CONFIG_SECTION_MISC_KEYS); 204 for ( std::list<std::string>::const_iterator it = keys.begin(); it!=keys.end(); it++ ) 205 { 206 PRINTF(3)("MISC: Parsing %s, %s now.\n", it->c_str(), Preferences::getInstance()->getString(CONFIG_SECTION_MISC_KEYS, *it, "").c_str()); 207 index = nameToIndex (Preferences::getInstance()->getString(CONFIG_SECTION_MISC_KEYS, *it, "")); 208 this->mapKeys(*it, index); 172 209 } 173 210 } -
trunk/src/lib/event/key_mapper.h
r7221 r7256 29 29 virtual ~KeyMapper(); 30 30 31 void loadKeyBindings(const std::string& fileName = "" ); 31 void loadKeyBindings(const std::string& fileName ); 32 void loadKeyBindings(); 32 33 void loadKeyBindings(IniParser* iniParser); 33 34 -
trunk/src/lib/graphics/graphics_engine.cc
r7221 r7256 29 29 #include "debug.h" 30 30 31 #include " parser/ini_parser/ini_parser.h"31 #include "util/preferences.h" 32 32 #include "substring.h" 33 33 #include "text.h" … … 150 150 /** 151 151 * loads the GraphicsEngine's settings from a given ini-file and section 152 * @param iniParser the iniParser to load from153 * @param section the Section in the ini-file to load from154 152 * @returns nothing usefull 155 153 */ 156 int GraphicsEngine::initFrom IniFile(IniParser* iniParser)154 int GraphicsEngine::initFromPreferences() 157 155 { 158 156 // looking if we are in fullscreen-mode 159 const std::string fullscreen = iniParser->getVar(CONFIG_NAME_FULLSCREEN, CONFIG_SECTION_VIDEO, "0"); 157 const std::string fullscreen = Preferences::getInstance()->getString(CONFIG_SECTION_VIDEO, CONFIG_NAME_FULLSCREEN, "0"); 158 160 159 if (fullscreen[0] == '1' || fullscreen == "true") 161 160 this->fullscreenFlag = SDL_FULLSCREEN; 162 161 163 162 // looking if we are in fullscreen-mode 164 const std::string textures = iniParser->getVar(CONFIG_NAME_TEXTURES, CONFIG_SECTION_VIDEO_ADVANCED, "0");163 const std::string textures = Preferences::getInstance()->getString(CONFIG_SECTION_VIDEO_ADVANCED, CONFIG_NAME_TEXTURES, "0"); 165 164 if (textures[0] == '1' || textures == "true") 166 165 Texture::setTextureEnableState(true); … … 169 168 170 169 // searching for a usefull resolution 171 SubString resolution( iniParser->getVar(CONFIG_NAME_RESOLUTION, CONFIG_SECTION_VIDEO, "640x480").c_str(), 'x'); ///FIXME170 SubString resolution(Preferences::getInstance()->getString(CONFIG_SECTION_VIDEO, CONFIG_NAME_RESOLUTION, "640x480").c_str(), 'x'); ///FIXME 172 171 //resolution.debug(); 173 172 MultiType x = resolution.getString(0), y = resolution.getString(1); -
trunk/src/lib/graphics/graphics_engine.h
r7221 r7256 20 20 // Forward Declaration 21 21 class Text; 22 class IniParser;23 22 class WorldEntity; 24 23 class GraphicsEffect; … … 39 38 40 39 int init(); 41 int initFrom IniFile(IniParser* iniParser);40 int initFromPreferences(); 42 41 43 42 void setWindowName(const std::string& windowName, const std::string& icon); -
trunk/src/lib/network/network_manager.cc
r6695 r7256 88 88 * @param hostName: the name of the destination host 89 89 */ 90 int NetworkManager::establishConnection(const char*name, unsigned int port)90 int NetworkManager::establishConnection(const std::string & name, unsigned int port) 91 91 { 92 92 IPaddress ipAddress; 93 int error = SDLNet_ResolveHost(&ipAddress, name , port);93 int error = SDLNet_ResolveHost(&ipAddress, name.c_str(), port); 94 94 if( error == -1) { 95 95 printf("\n\nerror on address resolution, program inconsistency\n\n"); -
trunk/src/lib/network/network_manager.h
r6981 r7256 36 36 void shutdown(); 37 37 38 int establishConnection( const char*name, unsigned int port);38 int establishConnection( const std::string & name, unsigned int port); 39 39 int createServer(unsigned int port); 40 40 -
trunk/src/lib/parser/Makefile.am
r5944 r7256 1 1 SUBDIRS = \ 2 2 tinyxml \ 3 ini_parser 3 ini_parser \ 4 preferences \ 5 cmdline_parser 4 6 5 7 -
trunk/src/lib/parser/ini_parser/ini_parser.cc
r7221 r7256 392 392 } 393 393 394 /** 395 * @brief edits the entry speciefied by entryName in sectionName/currentSection or creates it if it doesn't exist 396 * @param entryName the Name of the Entry to add 397 * @param value the value to assign to this entry 398 * @param sectionName if NULL then this entry will be set to the currentSection 399 * otherwise to the section refered to by sectionName. 400 * If both are NULL no entry will be added 401 * @return true if everything is ok false on error 402 */ 403 bool IniParser::editVar(const std::string& entryName, const std::string& value, const std::string& sectionName) 404 { 405 std::list<IniSection>::iterator section; 406 407 if (!sectionName.empty()) 408 { 409 for (section = this->sections.begin(); section != this->sections.end(); section++) 410 if ((*section).name == sectionName) 411 break; 412 } 413 else 414 section = this->currentSection; 415 416 if (section == this->sections.end()) 417 { 418 IniSection sec; 419 sec.comment = ""; 420 sec.name = sectionName; 421 section = this->sections.insert(this->sections.end(), sec); 422 } 423 424 if (section == this->sections.end()) 425 { 426 PRINTF(2)("section '%s' not found for value '%s'\n", sectionName.c_str(), entryName.c_str()); 427 return false; 428 } 429 else 430 { 431 //try find item 432 std::list<IniEntry>::iterator entry; 433 for (entry = section->entries.begin(); entry!=section->entries.end(); entry++) 434 if (entry->name == entryName ) 435 break; 436 437 //found it? 438 if ( entry != section->entries.end() ) 439 { 440 entry->value = value; 441 442 return true; 443 } 444 445 //not found -> create it 446 (*section).entries.push_back(IniEntry()); 447 (*section).entries.back().comment = ""; 448 (*section).entries.back().name = entryName; 449 (*section).entries.back().value = value; 450 PRINTF(5)("Added Entry %s with Value '%s' to Section %s\n", 451 (*section).entries.back().name.c_str(), 452 (*section).entries.back().value.c_str(), 453 (*section).name); 454 this->currentEntry = --(*section).entries.end(); 455 return true; 456 } 457 } 458 394 459 395 460 /** -
trunk/src/lib/parser/ini_parser/ini_parser.h
r7221 r7256 69 69 bool addVar(const std::string& entryName, const std::string& value, const std::string& sectionName = "" ); 70 70 const std::string& getVar(const std::string& entryName, const std::string& sectionName, const std::string& defaultValue = "") const; 71 bool IniParser::editVar(const std::string& entryName, const std::string& value, const std::string& sectionName = ""); 71 72 void setEntryComment(const std::string& comment, const std::string& entryName, const std::string& sectionName); 72 73 const std::string& getEntryComment(const std::string& entryName, const std::string& sectionName) const; -
trunk/src/lib/sound/sound_engine.cc
r7225 r7256 26 26 #include "util/loading/resource_manager.h" 27 27 #include "debug.h" 28 #include " parser/ini_parser/ini_parser.h"28 #include "util/preferences.h" 29 29 #include "globals.h" 30 30 … … 95 95 /** 96 96 * loads the settings of the SoundEngine from an ini-file 97 * @param iniParser the IniParser of the inifile98 97 */ 99 void SoundEngine::loadSettings( IniParser* iniParser)100 { 101 MultiType channels = iniParser->getVar(CONFIG_NAME_AUDIO_CHANNELS, CONFIG_SECTION_AUDIO, "32");98 void SoundEngine::loadSettings() 99 { 100 MultiType channels = Preferences::getInstance()->getString(CONFIG_SECTION_AUDIO, CONFIG_NAME_AUDIO_CHANNELS, "32"); 102 101 this->maxSourceCount = channels.getInt(); 103 102 104 MultiType effectsVolume = iniParser->getVar(CONFIG_NAME_EFFECTS_VOLUME, CONFIG_SECTION_AUDIO, "80");103 MultiType effectsVolume = Preferences::getInstance()->getString(CONFIG_SECTION_AUDIO, CONFIG_NAME_EFFECTS_VOLUME, "80"); 105 104 this->effectsVolume = effectsVolume.getFloat()/100.0; 106 105 107 MultiType musicVolume = iniParser->getVar(CONFIG_NAME_MUSIC_VOLUME, CONFIG_SECTION_AUDIO, "75");106 MultiType musicVolume = Preferences::getInstance()->getString(CONFIG_SECTION_AUDIO, CONFIG_NAME_MUSIC_VOLUME, "75"); 108 107 this->musicVolume = musicVolume.getFloat()/100.0; 109 108 } -
trunk/src/lib/sound/sound_engine.h
r7225 r7256 31 31 inline static SoundEngine* getInstance() { if (!SoundEngine::singletonRef) SoundEngine::singletonRef = new SoundEngine(); return SoundEngine::singletonRef; }; 32 32 33 void loadSettings( IniParser* iniParser);33 void loadSettings(); 34 34 35 35 SoundSource* createSource(const std::string& fileName, PNode* sourceNode = NULL); -
trunk/src/orxonox.cc
r7221 r7256 58 58 59 59 #include "state.h" 60 60 #include "lib/parser/preferences/cmd_line_prefs_reader.h" 61 #include "lib/parser/preferences/ini_file_prefs_reader.h" 61 62 #include <string.h> 62 63 … … 66 67 67 68 SHELL_COMMAND(restart, Orxonox, restart); 69 70 REGISTER_ARG_FLAG( l, license, "misc", "showLicenseAndExit", "Prints the licence and exit", "1" ); 71 REGISTER_ARG_FLAG( c, client, "game", "gameType", "Connect to Server (-H)", "multiplayer_client" ); 72 REGISTER_ARG_FLAG( s, server, "game", "gameType", "Start Orxonox as Game Server", "multiplayer_server" ); 73 REGISTER_ARG_ARG( H, host, "game", "host", "Host to connect to", "host"); 74 REGISTER_ARG_ARG( p, port, "game", "port", "Port to use", "port" ); 75 REGISTER_ARG_FLAG( g, gui, "game", "showGui", "starts the orxonox with the configuration GUI", "1"); 68 76 69 77 /** … … 77 85 this->setName("orxonox-main"); 78 86 79 this->iniParser = NULL;80 81 87 this->argc = 0; 82 88 this->argv = NULL; 83 89 84 90 /* this way, there is no network enabled: */ 85 this->serverName = NULL;91 this->serverName = ""; 86 92 this->port = -1; 87 93 … … 114 120 // output-buffer 115 121 delete ShellBuffer::getInstance(); 116 117 // orxonox class-stuff118 delete this->iniParser;119 122 120 123 SDL_QuitSubSystem(SDL_INIT_TIMER); … … 175 178 else 176 179 this->configFileName = ResourceManager::homeDirCheck(DEFAULT_CONFIG_FILE); 177 this->iniParser = new IniParser(this->configFileName); 180 178 181 PRINTF(3)("Parsed Config File: '%s'\n", this->configFileName); 179 182 } … … 182 185 * initialize Orxonox with command line 183 186 */ 184 int Orxonox::init (int argc, char** argv, const char*name, int port)187 int Orxonox::init (int argc, char** argv, const std::string & name, int port) 185 188 { 186 189 this->argc = argc; … … 227 230 GraphicsEngine::getInstance(); 228 231 229 GraphicsEngine::getInstance()->initFrom IniFile(this->iniParser);232 GraphicsEngine::getInstance()->initFromPreferences(); 230 233 231 234 std::string iconName = ResourceManager::getFullName("pictures/fighter-top-32x32.bmp"); … … 247 250 SoundEngine::getInstance(); 248 251 249 SoundEngine::getInstance()->loadSettings( this->iniParser);252 SoundEngine::getInstance()->loadSettings(); 250 253 SoundEngine::getInstance()->initAudio(); 251 254 return 0; … … 260 263 PRINT(3)("> Initializing input\n"); 261 264 262 EventHandler::getInstance()->init( this->iniParser);265 EventHandler::getInstance()->init(); 263 266 EventHandler::getInstance()->subscribe(GraphicsEngine::getInstance(), ES_ALL, EV_VIDEO_RESIZE); 264 267 … … 274 277 PRINT(3)("> Initializing networking\n"); 275 278 276 if( this->serverName != NULL) // we are a client279 if( this->serverName != "") // we are a client 277 280 { 278 281 State::setOnline(true); … … 299 302 // init the resource manager 300 303 std::string dataPath; 301 if ((dataPath = this->iniParser->getVar(CONFIG_NAME_DATADIR, CONFIG_SECTION_DATA))!= "")304 if ((dataPath = Preferences::getInstance()->getString(CONFIG_SECTION_DATA, CONFIG_NAME_DATADIR, ""))!= "") 302 305 { 303 306 if (!ResourceManager::getInstance()->setDataDir(dataPath) && … … 403 406 int main(int argc, char** argv) 404 407 { 405 int i; 406 for(i = 1; i < argc; ++i) 407 { 408 if( !strcmp( "--help", argv[i]) || !strcmp("-h", argv[i])) 409 return showHelp(argc, argv); 410 else if(!strcmp( "--gui", argv[i]) || !strcmp("-g", argv[i])) 411 showGui = true; 412 else if(!strcmp( "--client", argv[i]) || !strcmp("-c", argv[i])) 413 return startNetworkOrxonox(argc, argv); 414 else if(!strcmp( "--server", argv[i]) || !strcmp("-s", argv[i])) 415 return startNetworkOrxonox(argc, argv); 416 else if(!strcmp( "--license", argv[i]) || !strcmp("-l", argv[i])) 417 return PRINT(0)(ORXONOX_LICENSE_SHORT); 418 } 419 420 return startOrxonox(argc, argv, NULL, -1); 421 } 422 423 424 425 int showHelp(int argc, char** argv) 426 { 427 PRINT(0)("Orxonox Version %s\n", PACKAGE_VERSION); 428 PRINT(0)(" Starts Orxonox - The most furious 3D Action Game :)\n"); 429 PRINT(0)("\n"); 430 PRINT(0)("Common options:\n"); 431 PRINT(0)(" -g, --gui starts the orxonox with the configuration GUI \n"); 432 PRINT(0)(" -h, --help shows this help\n"); 433 PRINT(0)("\n"); 434 PRINT(0)("Network options:\n"); 435 PRINT(0)(" -s, --server [port] starts Orxonox and listens on the [port] for players\n"); 436 PRINT(0)(" -c, --client [hostname] [port] starts Orxonox as a Client\n"); 437 PRINT(0)(" -c, --client [ip address] [port] starts Orxonox as a Client\n"); 438 PRINT(0)("\n"); 439 PRINT(0)("Other options:\n"); 440 PRINT(0)(" --license prints the licence and exit\n\n"); 441 PRINT(0)("\n"); 442 443 // { 444 // Gui* gui = new Gui(argc, argv); 445 // gui->printHelp(); 446 // delete gui; 447 // } 448 } 449 408 CmdLinePrefsReader prefs; 409 410 IniFilePrefsReader ini(ResourceManager::homeDirCheck(DEFAULT_CONFIG_FILE)); 411 412 prefs.parse(argc, argv); 413 414 if ( Preferences::getInstance()->getString("misc", "showLicenseAndExit", "") == "1" ) 415 { 416 PRINT(0)(ORXONOX_LICENSE_SHORT); 417 return 0; 418 } 419 420 if( Preferences::getInstance()->getString("game", "showGui", "") == "1" ) 421 showGui = true; 422 else if( Preferences::getInstance()->getString( "game", "gameType", "" ) == "multiplayer_server" || 423 Preferences::getInstance()->getString( "game", "gameType", "" ) == "multiplayer_client" ) 424 return startNetworkOrxonox(argc, argv); 425 426 return startOrxonox(argc, argv, "", -1); 427 return 0; 428 } 450 429 451 430 … … 459 438 { 460 439 461 int i; 462 for(i = 0; i < argc; ++i ) 463 { 464 if( !strcmp( "--client", argv[i]) || !strcmp("-c", argv[i])) 440 std::string gameType = Preferences::getInstance()->getString( "game", "gameType", "" ); 441 442 if ( gameType == "multiplayer_client" ) 443 { 444 int port = Preferences::getInstance()->getInt( "game", "port", DEFAULT_ORXONOX_PORT ); 445 std::string host = Preferences::getInstance()->getString( "game", "host", "" ); 446 447 if ( host == "" ) 465 448 { 466 if( argc <= (i+2)) 467 { 468 printf(" Wrong arguments try following notations:\n"); 469 printf(" --client [server ip address] [port number]\n"); 470 printf(" --client [dns name] [port number]\n"); 471 return 0; 472 } 473 474 const char* name = argv[i+1]; 475 int port = atoi(argv[i+2]); 476 printf("Starting Orxonox as client: connecting to %s, on port %i\n", name, port); 477 478 startOrxonox(argc, argv, name, port); 449 printf("You need to specify a host to connect to ( -H <host> )\n"); 450 return 1; 479 451 } 480 else if( !strcmp( "--server", argv[i]) || !strcmp("-s", argv[i])) 481 { 482 if( argc <= (i+1)) 483 { 484 printf(" Wrong arguments try following notations:\n"); 485 printf(" --server [port number]\n"); 486 return 0; 487 } 488 489 int port = atoi(argv[i+1]); 490 printf("Starting Orxonox as server, listening on port %i\n", port); 491 492 startOrxonox(argc, argv, NULL, port); 493 } 452 453 printf("Starting Orxonox as client: connecting to %s, on port %i\n", host.c_str(), port); 454 455 startOrxonox(argc, argv, host.c_str(), port); 456 } 457 else if ( gameType == "multiplayer_server" ) 458 { 459 int port = Preferences::getInstance()->getInt( "game", "port", DEFAULT_ORXONOX_PORT ); 460 461 printf("Starting Orxonox as server: listening on port %i\n", port); 462 463 startOrxonox(argc, argv, "", port); 494 464 } 495 465 } … … 502 472 * @param argv parameters given to orxonox 503 473 */ 504 int startOrxonox(int argc, char** argv, const char*name, int port)474 int startOrxonox(int argc, char** argv, const std::string & name, int port) 505 475 { 506 476 // checking for existence of the configuration-files, or if the lock file is still used -
trunk/src/orxonox.h
r7221 r7256 11 11 class WorldEntity; 12 12 class GameLoader; 13 class IniParser;14 13 15 14 //! orxonox core singleton class … … 23 22 inline static Orxonox* getInstance() { if (!singletonRef) singletonRef = new Orxonox(); return singletonRef; }; 24 23 25 int init(int argc, char** argv, const char*name, int port);24 int init(int argc, char** argv, const std::string & name, int port); 26 25 27 26 void restart(); … … 31 30 private: 32 31 Orxonox (); 33 34 void parseIniFile(const std::string& fileName);35 32 36 33 int initResources (); … … 46 43 static Orxonox* singletonRef; //!< singleton reference to orxonox 47 44 48 IniParser* iniParser; //!< Reference to the ini-parser used in orxonox49 45 std::string configFileName; //!< Filename of the configuration-file. 50 46 GameLoader* gameLoader; //!< The gameLoader … … 53 49 char** argv; //!< Values of th Arguments of orxonox. 54 50 55 const char* serverName; //!< Name of the Orxonox client if == NULL-> server51 std::string serverName; //!< Name of the Orxonox client if == "" -> server 56 52 int port; //!< number of the network port of the server/client if == -1 no network 57 53 }; … … 61 57 // Start-up functions // 62 58 //////////////////////// 63 int showHelp(int argc, char** argv); 64 int showLicense(); 59 65 60 int startNetworkOrxonox(int argc, char** argv); 66 int startOrxonox(int argc, char** argv, const char*clientName, int port);61 int startOrxonox(int argc, char** argv, const std::string & clientName, int port); 67 62 68 63 #endif /* _ORXONOX_H */ -
trunk/src/subprojects/framework.cc
r7193 r7256 23 23 #include "util/loading/resource_manager.h" 24 24 #include "camera.h" 25 #include " parser/ini_parser/ini_parser.h"25 #include "util/preferences.h" 26 26 #include "globals.h" 27 27 … … 30 30 void Framework::init(void) 31 31 { 32 // create parser 33 char* configFileName = ResourceManager::homeDirCheck(DEFAULT_CONFIG_FILE); 34 35 IniParser iniParser (configFileName); 36 delete configFileName; 37 38 GraphicsEngine::getInstance()->initFromIniFile(&iniParser); 32 GraphicsEngine::getInstance()->initFromPreferences(); 39 33 40 34 LightManager::getInstance(); 41 35 42 36 const char* dataPath; 43 if ((dataPath = iniParser.getVar(CONFIG_NAME_DATADIR, CONFIG_SECTION_DATA))!= NULL)37 if ((dataPath = Preferences::getInstance()->getString(CONFIG_SECTION_DATA, CONFIG_NAME_DATADIR, ""))!= NULL) 44 38 { 45 39 if (!ResourceManager::getInstance()->setDataDir(dataPath))
Note: See TracChangeset
for help on using the changeset viewer.