Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9068 in orxonox.OLD


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

removed some bugs and added texture sync

Location:
branches/presentation/src
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/lib/network/network_game_manager.cc

    r9059 r9068  
    9898  ClassID playableClassId = rules.getPlayableClassId( userId, team );
    9999  std::string playableModel = rules.getPlayableModelFileName( userId, team, playableClassId );
     100  std::string playableTexture = rules.getPlayableModelFileName( userId, team, playableClassId );
    100101 
    101102  BaseObject * bo = Factory::fabricate( playableClassId );
     
    106107  Playable & playable = *(dynamic_cast<Playable*>(bo));
    107108 
    108   if (  playableModel != "" )
     109  if ( playableTexture != "" )
     110    playable.loadMD2Texture( playableTexture );
     111  if ( playableModel != "" )
    109112    playable.loadModel( playableModel );
    110113  playable.setOwner( userId );
  • branches/presentation/src/lib/network/shared_network_data.cc

    r6822 r9068  
    4444 */
    4545SharedNetworkData::~SharedNetworkData()
    46 {}
     46{
     47  SharedNetworkData::singletonRef = NULL;
     48}
  • branches/presentation/src/lib/util/loading/game_loader.cc

    r8717 r9068  
    5757    delete this->currentCampaign;
    5858  this->currentCampaign = NULL;
     59 
     60  GameLoader::singletonRef = NULL;
    5961}
    6062
  • branches/presentation/src/subprojects/framework.cc

    r7711 r9068  
    317317  delete GraphicsEngine::getInstance();
    318318
     319  Framework::singletonRef = NULL;
    319320}
    320321
  • branches/presentation/src/util/multiplayer_team_deathmatch.cc

    r9059 r9068  
    455455  ClassID playableClassId = getPlayableClassId( userId, stats.getPreferedTeamId() );
    456456  std::string playableModel = getPlayableModelFileName( userId, stats.getPreferedTeamId(), playableClassId );
     457  std::string playableTexture = getPlayableModelTextureFileName( userId, stats.getPreferedTeamId(), playableClassId );
    457458
    458459  BaseObject * bo = Factory::fabricate( playableClassId );
     
    463464  Playable & playable = *(dynamic_cast<Playable*>(bo));
    464465
    465   playable.loadModel( playableModel );
     466  if ( playableTexture != "" )
     467    playable.loadMD2Texture( playableTexture );
     468  if ( playableModel != "" )
     469    playable.loadModel( playableModel );
    466470  playable.setOwner( userId );
    467471  playable.setUniqueID( SharedNetworkData::getInstance()->getNewUniqueID() );
     
    797801}
    798802
     803std::string MultiplayerTeamDeathmatch::getPlayableModelTextureFileName( int userId, int team, ClassID classId )
     804{
     805  if ( classId == CL_FPS_PLAYER )
     806  {
     807    return "maps/doom_guy.png";
     808  }
     809 
     810  return "";
     811}
     812
  • branches/presentation/src/util/multiplayer_team_deathmatch.h

    r9059 r9068  
    3939    virtual int getTeamForNewUser();
    4040    virtual ClassID getPlayableClassId( int userId, int team );
     41    virtual std::string getPlayableModelTextureFileName( int userId, int team, ClassID classId );
    4142    virtual std::string getPlayableModelFileName( int userId, int team, ClassID classId );
    4243
  • branches/presentation/src/util/network_game_rules.cc

    r8623 r9068  
    4040}
    4141
     42
     43std::string NetworkGameRules::getPlayableModelTextureFileName( int userId, int team, ClassID classId )
     44{
     45  return "";
     46}
     47
    4248std::string NetworkGameRules::getPlayableModelFileName( int uesrId, int team, ClassID classId )
    4349{
  • branches/presentation/src/util/network_game_rules.h

    r8623 r9068  
    2323    virtual ClassID getPlayableClassId( int userId, int team );
    2424    virtual std::string getPlayableModelFileName( int userId, int team, ClassID classId );
     25    virtual std::string getPlayableModelTextureFileName( int userId, int team, ClassID classId );
    2526   
    2627    virtual PlayerStats * getNewPlayerStats( int userId ){ return new PlayerStats( userId ); }
  • branches/presentation/src/util/signal_handler.h

    r8623 r9068  
    4444  public:
    4545    inline static SignalHandler* getInstance() { if (!SignalHandler::singletonRef) SignalHandler::singletonRef = new SignalHandler(); return SignalHandler::singletonRef; }
     46    ~SignalHandler(){ SignalHandler::singletonRef = NULL; }
    4647
    4748    void registerCallback( SignalCallback cb, void * someData );
  • 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.