Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3875 in orxonox.OLD


Ignore:
Timestamp:
Apr 18, 2005, 4:52:45 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: weapon manager now works in player, cleaning up the rest

Location:
orxonox/trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/defs/debug.h

    r3873 r3875  
    7070#define DEBUG_MODULE_WEAPON             3
    7171#define DEBUG_MODULE_MATH               0
    72 #define DEBUG_MODULE_FONT               4
    73 #define DEBUG_MODULE_ANIM               3
     72#define DEBUG_MODULE_FONT               1
     73#define DEBUG_MODULE_ANIM               1
    7474
    7575#define DEBUG_MODULE_NULL_PARENT        0
  • orxonox/trunk/src/world_entities/player.cc

    r3873 r3875  
    5858 
    5959  this->weaponMan->addWeapon(wpRight);
     60  this->weaponMan->addWeapon(wpLeft);
    6061
    6162  this->weapons->add(wpRight);
     
    216217    {
    217218      //if(this->activeWeapon != NULL)
    218       this->activeWeapon->fire();
     219      //this->activeWeapon->fire();
    219220      //FIX THIS FIX FIIIIIIIIIIIX
    220       this->activeWeaponL->fire();
     221      //this->activeWeaponL->fire();
     222      this->weaponMan->fire();
    221223    }
    222224  if( this->bWeaponChange && this->weapons->getSize() > 1)
  • orxonox/trunk/src/world_entities/weapon.cc

    r3873 r3875  
    3939  this->nrOfSlots = nrOfSlots;
    4040 
    41   this->currConfID = W_CONFIG1;
     41  for(int i = 0; i < W_MAX_CONFIGS; ++i)
     42    for(int j = 0; j < W_MAX_SLOTS; ++j)
     43      this->configs[i].slots[j] = NULL;
     44
     45  this->currConfID = W_CONFIG0;
    4246  this->configs[this->currConfID].bUsed = true;
    4347}
     
    9195
    9296
     97void WeaponManager::fire()
     98{
     99  Weapon* firingWeapon;
     100  for(int i = 0; i < W_MAX_SLOTS; ++i)
     101    {
     102      firingWeapon = this->configs[this->currConfID].slots[i];
     103      if( firingWeapon != NULL) firingWeapon->fire();
     104    }
     105}
     106
     107
    93108/**
    94109   \brief standard constructor
  • orxonox/trunk/src/world_entities/weapon.h

    r3873 r3875  
    7979  ~WeaponManager();
    8080 
    81   void addWeapon(Weapon* weapon, int slotID = W_FREE_SLOT, int configID = W_CONFIG1);
     81  void addWeapon(Weapon* weapon, int slotID = W_FREE_SLOT, int configID = W_CONFIG0);
    8282  void nextWeaponConf();
    8383
     84  void fire();
    8485
    8586 private:
    8687  int nrOfConfigs;                      //<! number of configurations defined
    8788  int nrOfSlots;                        //<! number of weapon slots a ship has
    88   int currConfID;                    //<! the currently selected config
     89  int currConfID;                       //<! the currently selected config
    8990  weaponConfig configs[4];              //<! a list of four configurations
    9091 
Note: See TracChangeset for help on using the changeset viewer.