Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9068 in orxonox.OLD for branches/presentation/src/world_entities


Ignore:
Timestamp:
Jul 3, 2006, 8:55:53 PM (19 years ago)
Author:
rennerc
Message:

removed some bugs and added texture sync

Location:
branches/presentation/src/world_entities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/world_entities/world_entity.cc

    r9061 r9068  
    8585
    8686  this->toList(OM_NULL);
    87 
     87 
     88  registerVar( new SynchronizeableString( &this->md2TextureFileName, &this->md2TextureFileName, "md2TextureFileName" ) );
    8889  modelFileName_handle = registerVarId( new SynchronizeableString( &modelFileName, &modelFileName, "modelFileName" ) );
    8990  scaling_handle = registerVarId( new SynchronizeableFloat( &scaling, &scaling, "scaling" ) );
    9091  list_handle = registerVarId( new SynchronizeableInt( (int*)&objectListNumber, &list_write, "list" ) );
     92 
     93  health_handle = registerVarId( new SynchronizeableFloat( &this->health, &this->health_write, "health" ) );
     94  healthMax_handle = registerVarId( new SynchronizeableFloat( &this->healthMax, &this->healthMax_write, "maxHealth" ) );
    9195}
    9296
     
    837841    this->toList( (OM_LIST)list_write );
    838842  }
     843 
     844  if ( std::find( id.begin(), id.end(), health_handle ) != id.end() )
     845  {
     846    this->setHealth( health_write );
     847  }
     848 
     849  if ( std::find( id.begin(), id.end(), healthMax_handle ) != id.end() )
     850  {
     851    this->setHealthMax( healthMax_write );
     852  }
    839853
    840854  PNode::varChangeHandler( id );
  • branches/presentation/src/world_entities/world_entity.h

    r9008 r9068  
    198198  int                     list_write;                      //!< entity's list
    199199  int                     list_handle;                     //!< handle for list changes
     200 
     201  float                   health_write;
     202  int                     health_handle;
     203 
     204  float                   healthMax_write;
     205  int                     healthMax_handle;
    200206
    201207  CollisionHandle*        collisionHandles[CREngine::CR_NUMBER];  //!< the list of the collision reactions
Note: See TracChangeset for help on using the changeset viewer.