Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4114 in orxonox.OLD for orxonox/trunk/src


Ignore:
Timestamp:
May 7, 2005, 10:02:57 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: minor cleanup/windowsTest

Location:
orxonox/trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/factory.h

    r4020 r4114  
    8080const char* grabParameter( TiXmlElement* root, const char* name);
    8181
    82 
    83 
    84 
    8582#endif /* _FACTORY_H */
    8683
  • orxonox/trunk/src/game_loader.cc

    r4113 r4114  
    290290        assert( factory != NULL);
    291291       
    292         PRINTF0("Registered factory for '%s'\n", factory->getFactoryName());
     292        PRINTF(4)("Registered factory for '%s'\n", factory->getFactoryName());
    293293       
    294294        if( first == NULL) first = factory;
     
    302302BaseObject* GameLoader::fabricate( TiXmlElement* element)
    303303{
    304         assert( element != NULL);
    305        
    306         if( first == NULL)
    307         {
    308                 PRINTF0("GameLoader does not know any factories, fabricate() failed\n");
    309                 return NULL;
    310         }
    311        
    312         if( element->Value() != NULL)
    313         {
    314                 PRINTF0("Attempting fabrication of a '%s'\n", element->Value());
    315                 BaseObject* b = first->fabricate( element);
    316                 if( b == NULL) PRINTF0("Failed to fabricate a '%s'\n", element->Value());
    317                 else PRINTF0("Successfully fabricated a '%s'\n", element->Value());
    318                 return b;
    319         }
    320        
    321         PRINTF0("Fabricate failed, TiXmlElement did not contain a value\n");
    322        
    323         return NULL;
    324 }
     304  assert( element != NULL);
     305       
     306  if( first == NULL)
     307    {
     308      PRINTF(1)("GameLoader does not know any factories, fabricate() failed\n");
     309      return NULL;
     310    }
     311       
     312  if( element->Value() != NULL)
     313    {
     314      PRINTF(4)("Attempting fabrication of a '%s'\n", element->Value());
     315      BaseObject* b = first->fabricate( element);
     316      if( b == NULL)
     317        PRINTF(2)("Failed to fabricate a '%s'\n", element->Value());
     318      else
     319        PRINTF(4)("Successfully fabricated a '%s'\n", element->Value());
     320      return b;
     321    }
     322       
     323  PRINTF(2)("Fabricate failed, TiXmlElement did not contain a value\n");
     324       
     325  return NULL;
     326}
  • orxonox/trunk/src/story_entities/campaign.cc

    r4010 r4114  
    4141  int id;
    4242 
    43   PRINTF0("Loading Campaign...\n");
     43  PRINTF(3)("Loading Campaign...\n");
    4444 
    4545  assert( root != NULL);
     
    5353  if( string == NULL || sscanf(string, "%d", &id) != 1)
    5454    {
    55       PRINTF0("Campaign is missing a proper 'identifier'\n");
     55      PRINTF(2)("Campaign is missing a proper 'identifier'\n");
    5656      this->setStoryID( -1);
    5757    }
     
    6262  if( element == NULL)
    6363    {
    64       PRINTF0("Campaign is missing a proper 'WorldList'\n");
     64      PRINTF(2)("Campaign is missing a proper 'WorldList'\n");
    6565    }
    6666  else
  • orxonox/trunk/src/world_entities/player.cc

    r4091 r4114  
    8282Player::Player(TiXmlElement* root) : WorldEntity(root)
    8383{
    84   /*
    85     char* temp;
    86     const char* string;
    87     string = grabParameter( root, "name");
    88     if( string == NULL)
    89     {
    90     PRINTF0("Player is missing a proper 'name'\n");
    91     string = "Unknown";
    92     temp = new char[strlen(string + 2)];
    93     strcpy( temp, string);
    94     this->setName( temp);
    95     }
    96     else
    97     {
    98     temp = new char[strlen(string + 2)];
    99     strcpy( temp, string);
    100     this->setName( temp);
    101     }
    102    
    103     this->model = NULL;
    104     string = grabParameter( root, "model");
    105     if( string != NULL)
    106     this->model = (Model*)ResourceManager::getInstance()->load(string, OBJ, RP_CAMPAIGN);
    107     else
    108     {
    109     PRINTF0("Player is missing a proper 'model'\n");
    110     this->model = (Model*)ResourceManager::getInstance()->load("models/reaplow.obj", OBJ, RP_CAMPAIGN);
    111     }
    112     if( this->model == NULL)
    113     {
    114     PRINTF0("Player model '%s' could not be loaded\n", string);
    115     }
    116   */
    11784  this->weapons = new tList<Weapon>();
    11885  this->activeWeapon = NULL;
  • orxonox/trunk/src/world_entities/world_entity.cc

    r4013 r4114  
    3030/**
    3131   \brief standard constructor
    32    
    33    Every derived contructor HAS to call the previous one supplying the isFree parameter. This is necessary to distunguish
    34    between free and bound entities. The difference between them is simply the fact that the movement of a free entity is
    35    not bound to the track of a world. Use this to implement projectile or effect classes that do not have to travel along the track.
    36    To specify an entity to be free or bound set the default parameter in the declaration of the constructor.
    37    Theoretically you should never have to call the constructor of an Entity directly, for it is called by the spawn() function of the World
    38    class. So if you want to create a new entity at any time, call World::spawn(). It will handle everything that is necessary.
    3932*/
    4033WorldEntity::WorldEntity ()
     
    4639}
    4740
     41/**
     42   \brief Loads the WordEntity-specific Part of any derived Class
     43*/
    4844WorldEntity::WorldEntity(TiXmlElement* root)
    4945{
     
    5450  if( string == NULL)
    5551    {
    56       PRINTF(0)("WorldEntity is missing a proper 'name'\n");
     52      PRINTF(2)("WorldEntity is missing a proper 'name'\n");
    5753      string = "Unknown";
    5854      temp = new char[strlen(string + 2)];
     
    6965  this->model = NULL;
    7066  string = grabParameter( root, "model");
     67  printf("::::::::::::::::::::::string is %s\n", string);
    7168  if( string != NULL)
    7269    this->model = (Model*)ResourceManager::getInstance()->load(string, OBJ, RP_CAMPAIGN);
    7370  else
    7471    {
    75       PRINTF(0)("WorldEntity is missing a proper 'model'\n");
     72      PRINTF(2)("WorldEntity is missing a proper 'model'\n");
    7673      this->model = NULL;
    7774    }
    7875  if( this->model == NULL)
    7976    {
    80       PRINTF(0)("WorldEntity model '%s' could not be loaded\n", string);
    81     }
    82 
     77      PRINTF(2)("WorldEntity model '%s' could not be loaded\n", string);
     78    }
    8379  this->bDraw = true;
    8480}
Note: See TracChangeset for help on using the changeset viewer.