Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 680 for code/branches


Ignore:
Timestamp:
Dec 24, 2007, 12:10:18 AM (17 years ago)
Author:
rgrieder
Message:
  • removed some gcc warnings in weapon system
Location:
code/branches/FICN/src/orxonox/objects/weapon_system
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/orxonox/objects/weapon_system/BaseWeapon.cc

    r668 r680  
    4747  //CreateFactory(BaseWeapon);
    4848
    49   float BaseWeapon::nextActionValidityPeriod_ = 0.5;
     49  float BaseWeapon::nextActionValidityPeriod_s = 0.5;
    5050
    5151  BaseWeapon::BaseWeapon()
    5252    : sceneMgr_(Orxonox::getSingleton()->getSceneManager()),
    53       bulletCounter_(0), primaryFireRequest_(false), currentState_(IDLE),
    54       secondaryFireRequest_(false),
     53      bulletCounter_(0),
    5554      bulletManager_(Orxonox::getSingleton()->getBulletMgr()),
    56       secondaryFired_(false),
    57       timeSinceNextActionAdded_(0), actionAdded_(false), nextAction_(NOTHING),
    58       ammoDump_(NULL), totalTime_(0.0), leftAmmo_(0)
     55      ammoDump_(NULL),
     56      primaryFireRequest_(false), secondaryFireRequest_(false),
     57      totalTime_(0.0f), actionStartTime_(0.0f),
     58      currentState_(IDLE), secondaryFired_(false),
     59      nextAction_(NOTHING), actionAdded_(false),
     60      timeSinceNextActionAdded_(0.0f),
     61      leftAmmo_(0)
    5962  {
    6063    RegisterObject(BaseWeapon);
     
    102105    }
    103106
    104     if (currentState_ != IDLE)
     107    switch (currentState_)
    105108    {
    106       switch (currentState_)
    107       {
    108       case PRIMARY_FIRE:
    109         primaryFiring(totalTime_ - actionStartTime_);
    110         break;
     109    case IDLE:
     110      break;
    111111
    112       case SECONDARY_FIRE:
    113         secondaryFiring(totalTime_ - actionStartTime_);
    114         break;
     112    case PRIMARY_FIRE:
     113      primaryFiring(totalTime_ - actionStartTime_);
     114      break;
    115115
    116       case RELOADING:
    117         break;
     116    case SECONDARY_FIRE:
     117      secondaryFiring(totalTime_ - actionStartTime_);
     118      break;
    118119
    119       case CHANGING_AMMO:
    120         break;
    121       }
     120    case RELOADING:
     121      break;
     122
     123    case CHANGING_AMMO:
     124      break;
    122125    }
    123126
     
    170173    secondaryFireRequest_ = false;
    171174
    172     if (totalTime_ - timeSinceNextActionAdded_ > nextActionValidityPeriod_)
     175    if (totalTime_ - timeSinceNextActionAdded_ > nextActionValidityPeriod_s)
    173176      nextAction_ = NOTHING;
    174177  }
  • code/branches/FICN/src/orxonox/objects/weapon_system/BaseWeapon.h

    r673 r680  
    108108    bool actionAdded_;
    109109    float timeSinceNextActionAdded_;
    110     static float nextActionValidityPeriod_;
     110    static float nextActionValidityPeriod_s;
    111111
    112112    // weapon properties
  • code/branches/FICN/src/orxonox/objects/weapon_system/BulletManager.cc

    r668 r680  
    3737  CreateFactory(BulletManager);
    3838
    39   BulletManager::BulletManager() : bulletsIndex_(0), bulletsSize_(8)
     39  BulletManager::BulletManager() : bulletsSize_(8), bulletsIndex_(0)
    4040  {
    4141    RegisterObject(BulletManager);
  • code/branches/FICN/src/orxonox/objects/weapon_system/WeaponStation.cc

    r668 r680  
    4242
    4343  WeaponStation::WeaponStation(int stationSize)
    44         : stationSize_(stationSize), lastActiveSlotIndex_(-1),
    45         slots_(new BaseWeapon*[stationSize])
     44        : slots_(new BaseWeapon*[stationSize]),
     45          lastActiveSlotIndex_(-1), stationSize_(stationSize)
    4646  {
    4747        //slots_ = new BaseWeapon*[stationSize];
     
    5959  bool WeaponStation::addWeapon(BaseWeapon *weapon)
    6060  {
    61     if (lastActiveSlotIndex_ = stationSize_ - 1)
     61    if (lastActiveSlotIndex_ == stationSize_ - 1)
    6262      return false;
    6363
Note: See TracChangeset for help on using the changeset viewer.