Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


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

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

Location:
branches/std/src/story_entities
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/std/src/story_entities/game_world.cc

    r7193 r7203  
    145145  GameLoader* loader = GameLoader::getInstance();
    146146
    147   if( getLoadFile() == NULL)
     147  if( getLoadFile().empty())
    148148  {
    149149    PRINTF(1)("GameWorld has no path specified for loading\n");
     
    155155  if( !XMLDoc->LoadFile())
    156156  {
    157     PRINTF(1)("loading XML File: %s @ %s:l%d:c%d\n", XMLDoc->ErrorDesc(), this->getLoadFile(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
     157    PRINTF(1)("loading XML File: %s @ %s:l%d:c%d\n", XMLDoc->ErrorDesc(), this->getLoadFile().c_str(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
    158158    delete XMLDoc;
    159159    return (ErrorMessage){213,"XML File parsing error","GameWorld::load()"};
  • branches/std/src/story_entities/game_world_data.cc

    r7193 r7203  
    129129  // load the parameters
    130130  // name
    131   const char* string = grabParameter( root, "name");
    132   if( string == NULL)
     131  std::string string = grabParameter( root, "name");
     132  if( string.empty() )
    133133  {
    134134    PRINTF(2)("GameWorld is missing a proper 'name'\n");
     
    136136  }
    137137  else
    138     this->setName(string);
     138    this->setName(string.c_str());
    139139
    140140  this->loadGUI(root);
     
    363363  {
    364364    PRINTF(3)("Setting Sound Track to %s\n", name);
    365     char* oggFile = ResourceManager::getFullName(name); /// FIXME
     365    std::string oggFile = ResourceManager::getFullName(name);
    366366    this->music = new OggPlayer(oggFile);
    367     delete[] oggFile;
    368367
    369368    //(OggPlayer*)ResourceManager::getInstance()->load(name, OGG, RP_LEVEL);
  • branches/std/src/story_entities/story_entity.cc

    r7193 r7203  
    4040  this->isRunning = false;
    4141
    42   this->loadFile = NULL;
     42  this->loadFile = "";
    4343  this->storyID = -1;
    4444  this->description = NULL;
     
    100100 * @param name the name of the path
    101101 */
    102 void StoryEntity::setLoadFile(const char* fileName)
    103 {
    104   if (this->loadFile)
    105     delete this->loadFile;
     102void StoryEntity::setLoadFile(const std::string& fileName)
     103{
    106104  if (ResourceManager::isFile(fileName))
    107105  {
    108     this->loadFile = new char[strlen(fileName)+1];
    109     strcpy(this->loadFile, fileName);
     106    this->loadFile =  fileName;
    110107  }
    111108  else
     
    149146{
    150147  PRINTF(3)("Grabbing the Worlds Settings\n", this->getLoadFile());
    151   if( getLoadFile() == NULL)
    152     return;
     148  if( getLoadFile().empty())
     149        return;
    153150  TiXmlDocument XMLDoc(this->getLoadFile());
    154151  // load the xml world file for further loading
    155152  if( !XMLDoc.LoadFile())
    156153  {
    157     PRINTF(1)("loading XML File: %s @ %s:l%d:c%d\n", XMLDoc.ErrorDesc(), this->getLoadFile(), XMLDoc.ErrorRow(), XMLDoc.ErrorCol());
     154    PRINTF(1)("loading XML File: %s @ %s:l%d:c%d\n", XMLDoc.ErrorDesc(), this->getLoadFile().c_str(), XMLDoc.ErrorRow(), XMLDoc.ErrorCol());
    158155    return;
    159156  }
  • branches/std/src/story_entities/story_entity.h

    r6993 r7203  
    6161  inline int getStoryID() { return this->storyID; }
    6262
    63   void setLoadFile( const char* fileName);
     63  void setLoadFile(const std::string& fileName);
    6464  /** @returns the Filename this StoryEntity was loaded with */
    65   const char* getLoadFile() const { return this->loadFile; }
     65  const std::string& getLoadFile() const { return this->loadFile; }
    6666
    6767  void setNextStoryID(int nextStoryID);
     
    8686
    8787  protected:
    88     bool isInit;            //!< if the entity is initialized, this has to be true.
    89     bool isRunning;         //!< is true if the entity is running
    90     bool isPaused;          //!< is true if the entity is paused
     88    bool          isInit;            //!< if the entity is initialized, this has to be true.
     89    bool          isRunning;         //!< is true if the entity is running
     90    bool          isPaused;          //!< is true if the entity is paused
    9191
    9292
    9393 private:
    94     int     storyID;          //!< this is the number of this entity, identifying it in a list/tree...
    95     int     nextStoryID;      //!< if this entity has finished, this entity shall be called
    96     char*   loadFile;         //!< The file from which this world is loaded
     94    int           storyID;          //!< this is the number of this entity, identifying it in a list/tree...
     95    int           nextStoryID;      //!< if this entity has finished, this entity shall be called
     96    std::string   loadFile;         //!< The file from which this world is loaded
    9797
    98     char*   description;      //!< the description of the StoryEntity
    99     char*   menuItemImage;    //!< the item image of the StoryEntity
    100     char*   menuScreenshoot;  //!< the screenshoot of the StoryEntity
    101     bool    bMenuEntry;       //!< If true, this GameWorld apears in the SimpleMenu: SimpleMenu specific
     98    char*         description;      //!< the description of the StoryEntity
     99    char*         menuItemImage;    //!< the item image of the StoryEntity
     100    char*         menuScreenshoot;  //!< the screenshoot of the StoryEntity
     101    bool          bMenuEntry;       //!< If true, this GameWorld apears in the SimpleMenu: SimpleMenu specific
    102102};
    103103
Note: See TracChangeset for help on using the changeset viewer.