Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Jul 9, 2005, 12:48:50 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: state is no more singleton, but static class.
This is faster, and easier to handle, because one can just say State::getBLA() and not State::getInstance()→getBLA(); ——→>> less redundant

File:
1 edited

Legend:

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

    r4826 r4827  
    135135  if( this->worldIsInitialized)
    136136    return this->worldReference->getEntities();
    137   PRINT(1)("Someone tried to use the WorldInterface before it has been initizlized! this can result in SEGFAULTs!\n");
     137  PRINT(1)("tried to use the WorldInterface before it has been initizlized! this can result in SEGFAULTs!\n");
    138138  return NULL;
    139139}
     
    222222  //strcpy(this->worldName, name);
    223223  this->debugWorldNr = worldID;
    224   this->entities = new tList<WorldEntity>();
     224  State::setWorldEntityList(this->entities = new tList<WorldEntity>());
    225225  this->cycle = 0;
    226226
     
    244244  if (!crosshair)
    245245    crosshair = new Crosshair();
    246 
    247   /*
    248   // identifier
    249   string = grabParameter( root, "identifier");
    250   if( string == NULL || sscanf(string, "%d", &id) != 1)
    251   {
    252   PRINTF0("World is missing a proper 'identifier'\n");
    253   this->setStoryID( -1);
    254   }
    255   else setStoryID( id);
    256 
    257   // next id
    258   string = grabParameter( root, "nextid");
    259   if( string == NULL || sscanf(string, "%d", &id) != 1)
    260   {
    261   PRINTF0("World is missing a proper 'nextid'\n");
    262   this->setStoryID( -1);
    263   }
    264   else setNextStoryID( id);
    265 
    266 
    267   // path
    268   string = grabParameter( root, "path");
    269   if( string == NULL)
    270   {
    271   PRINTF0("World is missing a proper 'path'\n");
    272   this->setPath( NULL);
    273   }
    274   else
    275   {
    276   name = new char[strlen(string + 2)];
    277   strcpy( name, string);
    278   this->setPath( name);
    279   }
    280   */
    281246}
    282247
     
    304269  this->localCamera->setName ("Camera");
    305270
    306   State::getInstance()->setCamera(this->localCamera, this->localCamera->getTarget());
     271  State::setCamera(this->localCamera, this->localCamera->getTarget());
    307272
    308273  GraphicsEngine::getInstance()->displayFPS(true);
Note: See TracChangeset for help on using the changeset viewer.