Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6341 in orxonox.OLD for trunk/src/world_entities/terrain.cc


Ignore:
Timestamp:
Dec 30, 2005, 1:57:12 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the network branche back to the trunk, so we do not get away from each other to fast

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/terrain.cc

    r6142 r6341  
    2424#include "resource_manager.h"
    2525#include "model.h"
     26#include "network_game_manager.h"
     27
    2628
    2729#include "glincl.h"
     
    111113void Terrain::loadVegetation(const char* vegetationFile)
    112114{
     115  PRINTF(0)("loadVegetation: %s\n", vegetationFile);
    113116  if (this->vegetation)
    114117    ResourceManager::getInstance()->unload(this->vegetation, RP_LEVEL);
     
    116119  {
    117120    PRINTF(4)("fetching %s\n", vegetationFile);
    118       this->vegetation = (Model*)ResourceManager::getInstance()->load(vegetationFile, OBJ, RP_CAMPAIGN);
     121    this->vegetation = (Model*)ResourceManager::getInstance()->load(vegetationFile, OBJ, RP_CAMPAIGN);
    119122  }
    120123  else
     
    315318    }
    316319}
     320
     321int Terrain::writeBytes( const byte * data, int length, int sender )
     322{
     323  setRequestedSync( false );
     324  setIsOutOfSync( false );
     325
     326  SYNCHELP_READ_BEGIN();
     327  SYNCHELP_READ_FKT( WorldEntity::writeState );
     328
     329  return SYNCHELP_READ_N;
     330}
     331
     332int Terrain::readBytes( byte * data, int maxLength, int * reciever )
     333{
     334  if ( isOutOfSync() && !requestedSync() && this->getHostID()!=this->getOwner() )
     335  {
     336    (NetworkGameManager::getInstance())->sync( this->getUniqueID(), this->getOwner() );
     337    setRequestedSync( true );
     338  }
     339
     340  int rec = this->getRequestSync();
     341  if ( rec > 0 )
     342  {
     343    *reciever = rec;
     344
     345    return WorldEntity::readState( data, maxLength );
     346
     347  }
     348
     349  *reciever = 0;
     350  return 0;
     351}
     352
     353void Terrain::writeDebug( ) const
     354{
     355}
     356
     357void Terrain::readDebug( ) const
     358{
     359}
Note: See TracChangeset for help on using the changeset viewer.