Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6634 in orxonox.OLD for trunk/src/world_entities


Ignore:
Timestamp:
Jan 21, 2006, 1:18:19 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the network-branche back to the trunk

merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/network . -r6500:HEAD
minor conflicts in texture and one Makefile resolved to the trunk

also made a small patch to texture, so it Modulates with GL_REPEAT

Location:
trunk/src/world_entities
Files:
6 edited
4 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/Makefile.am

    r6532 r6634  
    2323                  world_entities/character_attributes.cc \
    2424                  world_entities/test_entity.cc \
     25                  world_entities/image_entity.cc \
     26                  world_entities/planet.cc \
    2527                  \
    2628                  world_entities/weapons/weapon_manager.cc \
     
    7274                 world_entities/character_attributes.h \
    7375                 world_entities/test_entity.h \
     76                 world_entities/image_entity.h \
     77                 world_entities/planet.h \
    7478                 \
    7579                 world_entities/weapons/weapon_manager.h \
  • trunk/src/world_entities/skybox.cc

    r6523 r6634  
    7171  this->setClassID(CL_SKYBOX, "SkyBox");
    7272  this->toList(OM_ENVIRON_NOTICK);
    73   this->size = 100.0;
     73  //this->size = 100.0;
     74  this->textureSize = 1024.0f;
    7475
    7576  for (int i = 0; i < 6; i++)
     
    215216}
    216217
     218
     219
     220void SkyBox::draw()
     221{
     222  glPushAttrib(GL_ENABLE_BIT);
     223//   glPushAttrib(GL_LIGHTING_BIT);
     224  glDisable(GL_LIGHTING);
     225
     226  WorldEntity::draw();
     227
     228  glPopAttrib();
     229
     230}
     231
     232
    217233/**
    218234 *  rebuilds the SkyBox
     
    233249  model->addVertex (0.5*size, -0.5*size, -0.5*size);
    234250
    235   model->addVertexTexture (0.0, 1.0);
    236   model->addVertexTexture (1.0, 1.0);
    237   model->addVertexTexture (1.0, 0.0);
    238   model->addVertexTexture (0.0, 0.0);
     251//   model->addVertexTexture (0.0, 1.0);
     252//   model->addVertexTexture (1.0, 1.0);
     253//   model->addVertexTexture (1.0, 0.0);
     254//   model->addVertexTexture (0.0, 0.0);
     255
     256  model->addVertexTexture (1.0/this->textureSize, (this->textureSize - 1.0)/this->textureSize);
     257  model->addVertexTexture ((this->textureSize - 1.0)/this->textureSize, (this->textureSize - 1.0)/this->textureSize);
     258  model->addVertexTexture ((this->textureSize - 1.0)/this->textureSize, 1.0/this->textureSize);
     259  model->addVertexTexture (1.0/this->textureSize, 1.0/this->textureSize);
     260
    239261
    240262  model->addVertexNormal (0.0, 0.0, 1.0);
  • trunk/src/world_entities/skybox.h

    r6519 r6634  
    3333  void postInit();
    3434
     35  virtual void draw();
    3536
    3637  void setSize(float size);
     
    6061
    6162  float           size;            //!< Size of the SkyBox. This should match the frustum maximum range.
     63  float           textureSize;     //!< this is the length of a texture (assumes a square texture)
    6264  char*           textureName;     //!< Name of the Texture
    6365
  • trunk/src/world_entities/space_ships/space_ship.cc

    r6617 r6634  
    4040
    4141#include "plane.h"
     42
     43#include "state.h"
     44#include "player.h"
    4245
    4346
     
    272275void SpaceShip::tick (float time)
    273276{
     277  this->getWeaponManager()->tick(time);
     278  // weapon system manipulation
     279  this->weaponAction();
     280
     281//   if( this != State::getPlayer()->getControllable())
     282//     return;
    274283
    275284  // spaceship controlled movement
     
    293302
    294303  //hoover effect
    295   cycle += time;
    296   this->shiftCoor(Vector(0,1,0)*cos(this->cycle*2.0)*0.02);
     304  //cycle += time;
     305  //this->shiftCoor(Vector(0,1,0)*cos(this->cycle*2.0)*0.02);
    297306
    298307  //readjust
     
    311320  this->shiftCoor (move);
    312321
    313   this->getWeaponManager()->tick(time);
    314   // weapon system manipulation
    315   this->weaponAction();
     322
    316323}
    317324
     
    508515  SYNCHELP_READ_BYTE( b );
    509516
    510   if ( b == DATA_state && this->getHostID()!=this->getOwner() )
    511   {
     517  if ( b == DATA_state /*&& (this->getHostID()!=this->getOwner() || sender==0)*/ )
     518  {
     519    PRINTF(0)("GOT STATE %d\n", this->getUniqueID());
    512520    setRequestedSync( false );
    513521    setIsOutOfSync( false );
    514522    SYNCHELP_READ_FKT( WorldEntity::writeState );
    515     SYNCHELP_READ_FLOAT( cycle );
    516   }
    517 
    518   if ( b == DATA_flags && this->getHostID()!=this->getOwner() )
    519   {
    520     int flags;
     523    //SYNCHELP_READ_FLOAT( cycle );
     524
     525    return SYNCHELP_READ_N;
     526  }
     527
     528
     529  if ( b == DATA_flags /*&& this->getHostID()!=this->getOwner()*/ )
     530  {
     531    int flags = 0;
    521532    SYNCHELP_READ_INT( flags );
    522533
    523     bUp = flags & MASK_bUp != 0;
    524     bDown = flags & MASK_bDown != 0;
    525     bLeft = flags & MASK_bLeft != 0;
    526     bRight = flags & MASK_bRight != 0;
    527     bAscend = flags & MASK_bAscend != 0;
    528     bDescend = flags & MASK_bDescend != 0;
    529     bFire = flags & MASK_bFire != 0;
    530     bRollL = flags & MASK_bRollL != 0;
    531     bRollR = flags & MASK_bRollR != 0;
    532   }
    533 
    534   if ( b == DATA_mouse && this->getHostID()!=this->getOwner() )
     534    bUp = (flags & MASK_bUp) != 0;
     535    bDown = (flags & MASK_bDown) != 0;
     536    bLeft = (flags & MASK_bLeft) != 0;
     537    bRight = (flags & MASK_bRight) != 0;
     538    bAscend = (flags & MASK_bAscend) != 0;
     539    bDescend = (flags & MASK_bDescend) != 0;
     540    bFire = (flags & MASK_bFire) != 0;
     541    bRollL = (flags & MASK_bRollL) != 0;
     542    bRollR = (flags & MASK_bRollR) != 0;
     543
     544  }
     545
     546  /*if ( b == DATA_mouse && this->getHostID()!=this->getOwner() )
    535547  {
    536548    SYNCHELP_READ_FLOAT( xMouse );
     
    538550    SYNCHELP_READ_FLOAT( mouseSensitivity );
    539551    SYNCHELP_READ_FLOAT( cycle );
    540   }
     552}*/
     553
     554  if ( this->getOwner() != this->getHostID() )
     555    SYNCHELP_READ_FKT( PNode::writeSync );
    541556
    542557  return SYNCHELP_READ_N;
     
    549564  SYNCHELP_WRITE_BEGIN();
    550565
    551   if ( isOutOfSync() && !requestedSync() && this->getHostID()!=this->getOwner() )
     566  if ( isOutOfSync() && !requestedSync() /*&& this->getHostID()!=this->getOwner()*/ )
    552567  {
    553568    (NetworkGameManager::getInstance())->sync( this->getUniqueID(), this->getOwner() );
    554569    setRequestedSync( true );
     570    PRINTF(0)("REQUESTED STATE %d\n", this->getUniqueID());
    555571  }
    556572
     
    560576    *reciever = rec;
    561577
     578    PRINTF(0)("SEND STATE %d %d\n", this->getUniqueID(), rec);
     579
    562580    SYNCHELP_WRITE_BYTE( (byte)DATA_state );
    563581
    564582    SYNCHELP_WRITE_FKT( WorldEntity::readState );
    565     SYNCHELP_WRITE_FLOAT( cycle );
     583    //SYNCHELP_WRITE_FLOAT( cycle );
    566584
    567585    return SYNCHELP_WRITE_N;
    568586  }
    569 
    570587
    571588  *reciever = 0;
     
    592609      mask |= MASK_bRollR;
    593610
    594     static int oldMask = mask+1; //so it is different the first time!
    595     static float oldxMouse = xMouse + 1.0;
    596     static float oldyMouse = yMouse + 1.0;
     611
     612    //static float oldxMouse = xMouse + 1.0;
     613    //static float oldyMouse = yMouse + 1.0;
    597614
    598615    if ( mask != oldMask )
     
    602619      SYNCHELP_WRITE_INT( mask );
    603620    }
    604 
    605     if ( oldxMouse != xMouse || oldyMouse != yMouse )
     621    else
     622    {
     623      SYNCHELP_WRITE_BYTE( 0 );
     624    }
     625
     626    /*if ( oldxMouse != xMouse || oldyMouse != yMouse )
    606627    {
    607628      oldxMouse = xMouse;
     
    612633      SYNCHELP_WRITE_FLOAT( mouseSensitivity );
    613634      SYNCHELP_WRITE_FLOAT( cycle );
    614     }
    615   }
     635    }*/
     636  }
     637  else
     638  {
     639    SYNCHELP_WRITE_BYTE( 0 );
     640  }
     641
     642  if ( this->getOwner() == this->getHostID() )
     643    SYNCHELP_WRITE_FKT( PNode::readSync );
    616644
    617645  return SYNCHELP_WRITE_N;
  • trunk/src/world_entities/space_ships/space_ship.h

    r6547 r6634  
    7575    float                 airViscosity;
    7676
     77    int oldMask;
     78
    7779};
    7880
  • trunk/src/world_entities/world_entity.cc

    r6512 r6634  
    517517  if ( strcmp(modelFileName, "") )
    518518  {
    519 
    520     if ( strstr(modelFileName, ResourceManager::getInstance()->getDataDir()) )
    521     {
    522       loadModel( modelFileName+strlen(ResourceManager::getInstance()->getDataDir()), scaling );
    523     }
    524     else
    525     {
    526       loadModel( modelFileName, scaling );
    527     }
     519    loadModel( modelFileName, scaling );
    528520  }
    529521  delete[] modelFileName;
    530522
    531   SYNCHELP_READ_STRINGM( modelFileName );
     523  /*SYNCHELP_READ_STRINGM( modelFileName );
    532524
    533525  if ( strcmp(modelFileName, "") )
     
    541533      this->md2TextureFileName = modelFileName;
    542534    }
     535  */
    543536
    544537  return SYNCHELP_READ_N;
     
    558551  SYNCHELP_WRITE_FKT( PNode::readState );
    559552
    560   SYNCHELP_WRITE_STRING( getModel( 0 )->getName() );
     553  if ( getModel(0) && getModel(0)->getName() )
     554  {
     555    char* name = (char*)(getModel( 0 )->getName());
     556
     557    if ( strstr(name, ResourceManager::getInstance()->getDataDir()) )
     558    {
     559      name += strlen(ResourceManager::getInstance()->getDataDir());
     560    }
     561
     562    SYNCHELP_WRITE_STRING( name );
     563  }
     564  else
     565  {
     566    SYNCHELP_WRITE_STRING("");
     567  }
     568
    561569  SYNCHELP_WRITE_FLOAT( scaling );
    562   if ( this->md2TextureFileName!=NULL && strcmp(this->md2TextureFileName, "") )
     570  /*if ( this->md2TextureFileName!=NULL && strcmp(this->md2TextureFileName, "") )
    563571  {
    564572    SYNCHELP_WRITE_STRING(this->md2TextureFileName);
     
    567575  {
    568576    SYNCHELP_WRITE_STRING("");
    569   }
     577}*/
    570578
    571579  return SYNCHELP_WRITE_N;
Note: See TracChangeset for help on using the changeset viewer.