Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2640 in orxonox.OLD


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

Location:
orxonox/trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/Makefile.in

    r2636 r2640  
    159159HEADERS = $(noinst_HEADERS)
    160160
    161 DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.in ChangeLog INSTALL \
     161DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.in INSTALL \
    162162        Makefile.am
    163163SOURCES = $(orxonox_SOURCES)
  • orxonox/trunk/src/player.cc

    r2636 r2640  
    7171
    7272void Player::draw ()
    73 {
     73{ 
    7474  glMatrixMode(GL_MODELVIEW);
    7575  glLoadIdentity();
  • orxonox/trunk/src/world.cc

    r2636 r2640  
    5050World::~World ()
    5151{
    52   unload ();
     52  Orxonox *orx = Orxonox::getInstance();
     53  orx->get_localinput()->unbind (localPlayer);
    5354  delete entities;
    5455}
     
    7273  this->bQuitCurrentGame = true;
    7374  this->localCamera->setWorld(NULL);
     75  this->~World();
    7476}
    7577
     
    111113            // create a player
    112114            WorldEntity* myPlayer = (WorldEntity*) this->spawn<Player>();
    113            
     115            this->localPlayer = myPlayer;           
     116
    114117            // bind input
    115118            Orxonox *orx = Orxonox::getInstance();
     
    142145            // create a player
    143146            WorldEntity* myPlayer = (WorldEntity*) this->spawn<Player>();
     147            this->localPlayer = myPlayer;
    144148           
    145149            // bind input
     
    394398}
    395399
     400void World::debug()
     401{
     402  List<WorldEntity> *l;
     403  WorldEntity* entity;
     404 
     405  printf("counting all entities\n");
     406  l = entities->get_next(); 
     407  while( l != NULL )
     408    {
     409      entity = l->get_object();
     410      if( entity->bDraw ) printf("got an entity\n");
     411      l = l->get_next();
     412    }
     413}
     414
    396415
    397416void World::mainLoop()
     
    403422  while(!this->bQuitOrxonox && !this->bQuitCurrentGame) /* pause pause pause ?!?!?*/
    404423    {
     424      //debug routine
     425      //debug();
    405426      // Network
    406427      synchronize();
  • 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.