Changeset 7203 in orxonox.OLD for branches/std/src/orxonox.cc
- Timestamp:
- Mar 9, 2006, 5:28:10 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/std/src/orxonox.cc
r7193 r7203 86 86 this->port = -1; 87 87 88 this->configFileName = NULL;88 this->configFileName = ""; 89 89 } 90 90 … … 117 117 // orxonox class-stuff 118 118 delete this->iniParser; 119 delete[] this->configFileName;120 119 121 120 SDL_QuitSubSystem(SDL_INIT_TIMER); … … 162 161 163 162 /** 164 * this finds the config file163 * @brief this finds the config file 165 164 * @returns the new config-fileName 166 165 * Since the config file varies from user to user and since one may want to specify different config files … … 168 167 * it's path and name into configfilename 169 168 */ 170 const char*Orxonox::getConfigFile ()169 const std::string& Orxonox::getConfigFile () 171 170 { 172 171 if (ResourceManager::isFile("orxonox.conf")) 173 172 { 174 this->configFileName = new char[strlen("orxonox.conf")+1]; 175 strcpy(this->configFileName, "orxonox.conf"); 173 this->configFileName = "orxonox.conf"; 176 174 } 177 175 else … … 231 229 GraphicsEngine::getInstance()->initFromIniFile(this->iniParser); 232 230 233 char*iconName = ResourceManager::getFullName("pictures/fighter-top-32x32.bmp");234 if ( iconName != NULL)231 std::string iconName = ResourceManager::getFullName("pictures/fighter-top-32x32.bmp"); 232 if (!iconName.empty()) 235 233 { 236 234 GraphicsEngine::getInstance()->setWindowName(PACKAGE_NAME " " PACKAGE_VERSION, iconName); 237 delete[] iconName;238 235 } 239 236 return 0; … … 301 298 302 299 // init the resource manager 303 const char*dataPath;304 if ((dataPath = this->iniParser->getVar(CONFIG_NAME_DATADIR, CONFIG_SECTION_DATA))!= NULL)300 std::string dataPath; 301 if ((dataPath = this->iniParser->getVar(CONFIG_NAME_DATADIR, CONFIG_SECTION_DATA))!= "") 305 302 { 306 303 if (!ResourceManager::getInstance()->setDataDir(dataPath) && 307 304 !ResourceManager::getInstance()->verifyDataDir(DEFAULT_DATA_DIR_CHECKFILE)) 308 305 { 309 PRINTF(1)("Data Could not be located in %s\n", dataPath );306 PRINTF(1)("Data Could not be located in %s\n", dataPath.c_str()); 310 307 } 311 308 } … … 315 312 PRINTF(1)("The DataDirectory %s could not be verified\n\nh" \ 316 313 "!!! Please Change in File %s Section %s Entry %s to a suitable value !!!\n", 317 ResourceManager::getInstance()->getDataDir(),318 this->configFileName,314 ResourceManager::getInstance()->getDataDir().c_str(), 315 this->configFileName.c_str(), 319 316 CONFIG_SECTION_DATA, 320 317 CONFIG_NAME_DATADIR ); … … 325 322 } 326 323 //! @todo this is a hack and should be loadable 327 char*imageDir = ResourceManager::getInstance()->getFullName("maps");324 std::string imageDir = ResourceManager::getInstance()->getFullName("maps"); 328 325 ResourceManager::getInstance()->addImageDir(imageDir); 329 delete[] imageDir;330 326 imageDir = ResourceManager::getInstance()->getFullName("pictures"); 331 327 ResourceManager::getInstance()->addImageDir(imageDir); 332 delete[] imageDir;333 328 334 329 DynamicLoader::loadDyLib("libtest.so");
Note: See TracChangeset
for help on using the changeset viewer.