Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10332 in orxonox.OLD


Ignore:
Timestamp:
Jan 24, 2007, 3:23:23 PM (17 years ago)
Author:
muellmic
Message:

in this version the acid splasher isn't loaded anymore. it then doesn't crash when shooting.

Location:
branches/playability/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/util/hud.cc

    r10291 r10332  
    316316        weapon->getEnergyWidget()->setBackgroundColor(Color(.8,.2,.11, 0.1));
    317317        weapon->getEnergyWidget()->setFrontColor(Color( .2,.5,.7,.6));
     318        weapon->getEnergyWidget()->setWidgetSize(150,50);
    318319        //weapon->getEnergyWidget()->frontMaterial().setTransparency(.6);
    319320        this->weaponsWidgetsSec.push_back(dynamic_cast<OrxGui::GLGuiEnergyWidgetVertical*> (weapon->getEnergyWidget()));
     
    341342
    342343  int overlayWidth = this->resX * (overlayPercentage)/(200);
     344  if (overlayWidth < 100)
     345    overlayWidth = 100;
     346
    343347  this->rightRect->hide();
    344348  this->leftRect->hide();
     
    406410
    407411  std::list<OrxGui::GLGuiEnergyWidgetVertical*>::iterator weaponWidget;
    408   Vector2D pos = Vector2D(overlayWidth + this->rightRect->getAbsCoor2D().x, 0.5*this->resY);
     412  Vector2D pos = Vector2D(overlayWidth, 0.4*this->resY);
    409413  //PRINTF(0)("Cur Pos: %f,%f\n",pos.x,pos.y);
    410414  // out of reasons i can't get behind, this version is segfaulting when calling getSizeX2D or getSizeY2D. the other
     
    413417  for (weaponWidget = this->weaponsWidgetsPrim.begin(); weaponWidget != this->weaponsWidgetsPrim.end(); weaponWidget++)
    414418  {
    415     if (pos.x < overlayWidth*0.2)
    416     {
    417       pos.x = overlayWidth + this->rightRect->getAbsCoor2D().x;
     419    float ySize = (*weaponWidget)->getSizeY2D();
     420    if (pos.x < ySize)
     421    {
     422      pos.x = overlayWidth;
    418423      pos.y += (*weaponWidget)->getSizeX2D();
    419424    }
    420     pos.x -= (*weaponWidget)->getSizeY2D();
    421     (*weaponWidget)->setAbsCoor2D(pos.x, pos.y);
     425    pos.x -= ySize;
     426    (*weaponWidget)->setAbsCoor2D(pos.x + this->rightRect->getAbsCoor2D().x, pos.y);
    422427    //(*weaponWidget)->setAbsCoor2D(0,100);
    423428    (*weaponWidget)->show();
     
    426431
    427432  pos.y += 160;
    428   pos.x = overlayWidth + this->rightRect->getAbsCoor2D().x;
     433  pos.x = 0; //overlayWidth + this->rightRect->getAbsCoor2D().x;
    429434  for (weaponWidget = this->weaponsWidgetsSec.begin(); weaponWidget != this->weaponsWidgetsSec.end(); weaponWidget++)
    430435  {
    431     if (pos.x < overlayWidth*0.2)
    432     {
    433       pos.x = overlayWidth + this->rightRect->getAbsCoor2D().x;
     436    float ySize = (*weaponWidget)->getSizeY2D();
     437    if (pos.x < ySize)
     438    {
     439      pos.x = overlayWidth;
    434440      pos.y += (*weaponWidget)->getSizeX2D();
    435441    }
    436     pos.x -= (*weaponWidget)->getSizeY2D();
    437     (*weaponWidget)->setAbsCoor2D(pos.x, pos.y);
     442    pos.x -= ySize;
     443    PRINTF(0)("secweaponwidget y-size: %f/n", (*weaponWidget)->getSizeY2D());
     444    (*weaponWidget)->setAbsCoor2D(pos.x + this->rightRect->getAbsCoor2D().x, pos.y);
    438445    (*weaponWidget)->show();
    439446    //printf("update thing %s::%s\n", (*weaponWidget)->getClassCName(), (*weaponWidget)->getName());
  • branches/playability/src/world_entities/elements/glgui_energywidgetvertical.cc

    r10301 r10332  
    8989  GLGuiEnergyWidgetVertical::~GLGuiEnergyWidgetVertical ()
    9090  {
     91
    9192    if ( this->_valueText )
    9293    {
     
    100101      this->_image = NULL;
    101102    }
     103   
     104    /*
     105    if ( this->_bar )
     106    {
     107      delete this->_bar;
     108      this->_bar = NULL;
     109    }
     110    */
    102111  }
    103112
  • branches/playability/src/world_entities/space_ships/space_ship.cc

    r10306 r10332  
    179179//  spike2->setName( "SpikeLauncher" );
    180180
     181  /*
    181182  Weapon* acid0 = new AcidLauncher();
    182183  acid0->setName( "AcidSplasher" );
     
    184185  Weapon* acid1 = new AcidLauncher();
    185186  acid1->setName( "AcidSplasher" );
     187  */
    186188
    187189  this->weaponMan.addWeapon( wpLeft1, 0, 0);
     
    203205  this->weaponMan.addWeapon( wpRight3, 3, 5);
    204206
     207  /*
    205208  this->weaponMan.addWeapon( acid0, 0, 6);
    206209  this->weaponMan.addWeapon( acid1, 0, 7);
     210  */
    207211
    208212  this->secWeaponMan.addWeapon( cannon, 0, 2);
     
    368372  //this->travelDistancePlus = Vector2D(38.0, 43.0);
    369373  //this->travelDistanceMinus = Vector2D(-38.0, -43.0);
    370   this->travelDistancePlus = Vector2D(0,0);
    371   this->travelDistancePlus = Vector2D(0,0);
     374  this->travelDistancePlus = Vector2D(50,50);
     375  this->travelDistanceMinus = Vector2D(-50,-50);
    372376  this->isTravelDistanceInit = false;
    373377  this->actionWidthPercentage = 1;
     
    419423  LoadParam(root, "cameraDistance", this, SpaceShip, setCameraDistance);
    420424  LoadParam(root, "cameraFovy", this, SpaceShip, setCameraFovy);
    421   LoadParam(root, "actionWidthPercentage", this, SpaceShip, setActionWidthPercentage);
     425  //LoadParam(root, "actionWidthPercentage", this, SpaceShip, setActionWidthPercentage);
    422426
    423427  State::getCamera()->setViewMode(Camera::ViewTop);
     
    858862        this->travelNode->setAbsCoor(this->getAbsCoor());
    859863        this->travelNode->updateNode(0.01f);
    860         this->isTravelDistanceInit = false;
    861        
     864
     865        if (this->hasPlayer())
     866          this->isTravelDistanceInit = false;
     867
    862868        if(this->entityTrack)
    863869           this->travelNode->setParent(this->entityTrack->getTrackNode());
     
    11661172  //State::getPlayer()->hud().setOverlayPercentage(100-i);
    11671173  //updateTravelDistance();
    1168   this->isTravelDistanceInit = false;
     1174  if (this->hasPlayer())
     1175    this->isTravelDistanceInit = false;
    11691176};
Note: See TracChangeset for help on using the changeset viewer.