Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2640 in orxonox.OLD for orxonox/trunk/src/world.h


Ignore:
Timestamp:
Oct 25, 2004, 2:01:06 PM (20 years ago)
Author:
patrick
Message:

orxonox/trunk/src - BUGFIX: input node now redirected to the right story_entity. This should fix the display player visibility problem, encountered on some systems

File:
1 edited

Legend:

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

    r2636 r2640  
    6868  int debugWorldNr;
    6969
     70  WorldEntity* localPlayer;
     71 
    7072  void mainLoop();
    7173  void synchronize();
     
    7476  void collision();
    7577  void display();
     78  void debug();
    7679};
    7780
     
    8992template<typename T> T* World::spawn(Location* loc = NULL, WorldEntity* owner = NULL)
    9093{
    91         Location zeroloc;
    92         T* entity = new T();
    93         entities->add ((WorldEntity*)entity, LIST_ADD_NEXT);
    94         if( loc == NULL)
    95         {
    96           zeroloc.dist = 0;
    97           zeroloc.part = 0;
    98                 zeroloc.pos = Vector();
    99                 zeroloc.rot = Quaternion();
    100                 loc = &zeroloc;
    101         }
    102         entity->init (loc, owner);
    103         if (entity->bFree)
    104         {
    105                 track[loc->part].map_coords( loc, entity->get_placement());
    106         }
    107         entity->post_spawn ();
    108         return entity;
     94  Location zeroloc;
     95  T* entity = new T();
     96  entities->add ((WorldEntity*)entity, LIST_ADD_NEXT);
     97  if( loc == NULL)
     98    {
     99      zeroloc.dist = 0;
     100      zeroloc.part = 0;
     101      zeroloc.pos = Vector();
     102      zeroloc.rot = Quaternion();
     103      loc = &zeroloc;
     104    }
     105  entity->init (loc, owner);
     106  if (entity->bFree)
     107    {
     108      track[loc->part].map_coords( loc, entity->get_placement());
     109    }
     110  entity->post_spawn ();
     111  return entity;
    109112}
    110113
     
    123126template<typename T> T* World::spawn(Placement* plc, WorldEntity* owner = NULL)
    124127{
    125         T* entity = new T();
    126         entities->add ((WorldEntity*)entity, LIST_ADD_NEXT);
    127         entity->init (plc, owner);
    128         if (!entity->bFree)
    129         {
    130                 printf("Can't spawn unfree entity with placement\n");
    131                 entities->remove( (WorldEntity*)entity, LIST_FIND_FW);
    132                 return NULL;
    133         }
    134         entity->post_spawn ();
    135         return entity;
     128  T* entity = new T();
     129  entities->add ((WorldEntity*)entity, LIST_ADD_NEXT);
     130  entity->init (plc, owner);
     131  if (!entity->bFree)
     132    {
     133      printf("Can't spawn unfree entity with placement\n");
     134      entities->remove( (WorldEntity*)entity, LIST_FIND_FW);
     135      return NULL;
     136    }
     137  entity->post_spawn ();
     138  return entity;
    136139}
    137140
Note: See TracChangeset for help on using the changeset viewer.