Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4261 in orxonox.OLD for orxonox/trunk/src/story_entities


Ignore:
Timestamp:
May 22, 2005, 3:19:57 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the levelLoader-branche back into the trunk, because it seems to be stable.
merged with command:
svn merge -r 4230:HEAD levelLoader ../trunk
no conflicts of any interesst

Location:
orxonox/trunk/src/story_entities
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/story_entities/campaign.cc

    r4114 r4261  
    2727#include "list.h"
    2828
     29#include "load_param.h"
     30
    2931using namespace std;
    3032
     
    3537  this->isInit = false;
    3638}
     39
    3740Campaign::Campaign ( TiXmlElement* root)
    3841{
  • orxonox/trunk/src/story_entities/campaign.h

    r4010 r4261  
    88
    99class World;
     10class TiXmlElement;
    1011template<class T> class tList;
    1112
  • orxonox/trunk/src/story_entities/story_entity.h

    r3629 r4261  
    1111#include "story_def.h"
    1212#include "error.h"
    13 
    1413
    1514//! A class that represents something to play in orxonox. it is a container for worlds, movies, mission briefings, etc...
  • orxonox/trunk/src/story_entities/world.cc

    r4245 r4261  
    5353#include "substring.h"
    5454
    55 
     55#include "factory.h"
    5656
    5757using namespace std;
     
    123123CREATE_FACTORY(World);
    124124
    125 World::World( TiXmlElement* root)
     125World::World(const TiXmlElement* root)
    126126{
    127127  this->constuctorInit("", -1);
    128128  this->path = NULL;
    129   const char *string;
    130   char *name;
    131   int id;
    132  
    133   PRINTF0("Creating a World\n");
    134  
    135   // identifier
    136   string = grabParameter( root, "identifier");
    137   if( string == NULL || sscanf(string, "%d", &id) != 1)
    138     {
    139       PRINTF0("World is missing a proper 'identifier'\n");
    140       this->setStoryID( -1);
    141     }
    142   else setStoryID( id);
    143 
    144   // next id
    145   string = grabParameter( root, "nextid");
    146   if( string == NULL || sscanf(string, "%d", &id) != 1)
    147     {
    148       PRINTF0("World is missing a proper 'nextid'\n");
    149       this->setStoryID( -1);
    150     }
    151   else setNextStoryID( id);
    152  
    153 
    154   // path
    155   string = grabParameter( root, "path");
    156   if( string == NULL)
    157     {
    158       PRINTF0("World is missing a proper 'path'\n");
    159       this->setPath( NULL);
    160     }
    161   else
    162     {
    163       name = new char[strlen(string + 2)];
    164       strcpy( name, string);
    165       this->setPath( name);
    166     }
     129 
     130  this->loadParams(root);
    167131}
    168132
     
    213177  //delete animator
    214178
     179  LoadClassDescription::printAll();
     180
    215181  ResourceManager::getInstance()->unloadAllByPriority(RP_LEVEL);
    216182}
     
    234200  this->debugWorldNr = worldID;
    235201  this->entities = new tList<WorldEntity>();
     202}
     203
     204void World::loadParams(const TiXmlElement* root)
     205{
     206  const char *string;
     207  char *name;
     208  int id;
     209
     210  PRINTF0("Creating a World\n");
     211
     212  LoadParam<World>(root, "identifier", this, &World::setStoryID)
     213    .describe("Sets the StoryID of this world");
     214  LoadParam<World>(root, "nextid", this, &World::setNextStoryID)
     215    .describe("Sets the ID of the next world");
     216  LoadParam<World>(root, "path", this, &World::setPath)
     217    .describe("The Filename of this World (relative from the data-dir)");
     218
     219
     220  /* 
     221  // identifier
     222  string = grabParameter( root, "identifier");
     223  if( string == NULL || sscanf(string, "%d", &id) != 1)
     224  {
     225  PRINTF0("World is missing a proper 'identifier'\n");
     226  this->setStoryID( -1);
     227  }
     228  else setStoryID( id);
     229
     230  // next id
     231  string = grabParameter( root, "nextid");
     232  if( string == NULL || sscanf(string, "%d", &id) != 1)
     233  {
     234  PRINTF0("World is missing a proper 'nextid'\n");
     235  this->setStoryID( -1);
     236  }
     237  else setNextStoryID( id);
     238 
     239
     240  // path
     241  string = grabParameter( root, "path");
     242  if( string == NULL)
     243  {
     244  PRINTF0("World is missing a proper 'path'\n");
     245  this->setPath( NULL);
     246  }
     247  else
     248  {
     249  name = new char[strlen(string + 2)];
     250  strcpy( name, string);
     251  this->setPath( name);
     252  }
     253  */
    236254}
    237255
     
    334352  else
    335353    {
    336       this->glmis->load(element);
     354      this->glmis->loadParams(element);
    337355      this->glmis->draw();
    338356    }
     
    421439  glNewList (objectList, GL_COMPILE);
    422440 
    423 
    424441  //trackManager->drawGraph(.01);
    425442  //trackManager->debug(2);
  • orxonox/trunk/src/story_entities/world.h

    r4176 r4261  
    1111#include "story_entity.h"
    1212#include "p_node.h"
    13 #include "xmlparser/tinyxml.h"
    1413
    1514class World;
     
    2423class GarbageCollector;
    2524class Text;
     25class TiXmlElement;
    2626
    2727//! The game world Interface
     
    5656  World (char* name);
    5757  World (int worldID);
    58   World (TiXmlElement* root);
     58  World (const TiXmlElement* root = NULL);
    5959  virtual ~World ();
     60
     61  void loadParams(const TiXmlElement* root);
    6062
    6163  double getGameTime();
Note: See TracChangeset for help on using the changeset viewer.