Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7203 in orxonox.OLD for branches/std/src/orxonox.cc


Ignore:
Timestamp:
Mar 9, 2006, 5:28:10 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: compiles again, BUT well…. i do not expect it to run anymore

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/std/src/orxonox.cc

    r7193 r7203  
    8686  this->port = -1;
    8787
    88   this->configFileName = NULL;
     88  this->configFileName = "";
    8989}
    9090
     
    117117  // orxonox class-stuff
    118118  delete this->iniParser;
    119   delete[] this->configFileName;
    120119
    121120  SDL_QuitSubSystem(SDL_INIT_TIMER);
     
    162161
    163162/**
    164  * this finds the config file
     163 * @brief this finds the config file
    165164 * @returns the new config-fileName
    166165 * Since the config file varies from user to user and since one may want to specify different config files
     
    168167 * it's path and name into configfilename
    169168*/
    170 const char* Orxonox::getConfigFile ()
     169const std::string& Orxonox::getConfigFile ()
    171170{
    172171  if (ResourceManager::isFile("orxonox.conf"))
    173172  {
    174     this->configFileName = new char[strlen("orxonox.conf")+1];
    175     strcpy(this->configFileName, "orxonox.conf");
     173    this->configFileName =  "orxonox.conf";
    176174  }
    177175  else
     
    231229  GraphicsEngine::getInstance()->initFromIniFile(this->iniParser);
    232230
    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())
    235233  {
    236234    GraphicsEngine::getInstance()->setWindowName(PACKAGE_NAME " " PACKAGE_VERSION, iconName);
    237     delete[] iconName;
    238235  }
    239236  return 0;
     
    301298
    302299  // 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))!= "")
    305302  {
    306303    if (!ResourceManager::getInstance()->setDataDir(dataPath) &&
    307304        !ResourceManager::getInstance()->verifyDataDir(DEFAULT_DATA_DIR_CHECKFILE))
    308305    {
    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());
    310307    }
    311308  }
     
    315312    PRINTF(1)("The DataDirectory %s could not be verified\n\nh" \
    316313              "!!!  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(),
    319316              CONFIG_SECTION_DATA,
    320317              CONFIG_NAME_DATADIR );
     
    325322  }
    326323  //! @todo this is a hack and should be loadable
    327   char* imageDir = ResourceManager::getInstance()->getFullName("maps");
     324  std::string imageDir = ResourceManager::getInstance()->getFullName("maps");
    328325  ResourceManager::getInstance()->addImageDir(imageDir);
    329   delete[] imageDir;
    330326  imageDir = ResourceManager::getInstance()->getFullName("pictures");
    331327  ResourceManager::getInstance()->addImageDir(imageDir);
    332   delete[] imageDir;
    333328
    334329  DynamicLoader::loadDyLib("libtest.so");
Note: See TracChangeset for help on using the changeset viewer.