Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3873 in orxonox.OLD for orxonox/trunk/src


Ignore:
Timestamp:
Apr 18, 2005, 4:01:42 PM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: added the weapon module to the debug system. some minor changes in the weaponmanager

Location:
orxonox/trunk/src
Files:
5 edited

Legend:

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

    r3863 r3873  
    6868#define DEBUG_MODULE_LIGHT              0
    6969#define DEBUG_MODULE_PLAYER             1
     70#define DEBUG_MODULE_WEAPON             3
    7071#define DEBUG_MODULE_MATH               0
    7172#define DEBUG_MODULE_FONT               4
  • orxonox/trunk/src/world_entities/player.cc

    r3811 r3873  
    5353  acceleration = 10.0;
    5454  //weapons:
     55  this->weaponMan = new WeaponManager();
    5556  Weapon* wpRight = new TestGun(this, new Vector(-2.6, 0.1, 3.0), new Quaternion(), 0);
    5657  Weapon* wpLeft = new TestGun(this, new Vector(-2.6, 0.1, -3.0), new Quaternion(), 1);
     58 
     59  this->weaponMan->addWeapon(wpRight);
     60
    5761  this->weapons->add(wpRight);
    5862  this->activeWeapon = wpRight;
     
    7074  */
    7175  delete this->weapons;
     76  delete this->weaponMan;
    7277}
    7378
  • orxonox/trunk/src/world_entities/player.h

    r3755 r3873  
    1111template<class T> class tList;
    1212class Weapon;
     13class WeaponManager;
    1314class Vector;
    1415class World;
     
    4950  Weapon* activeWeapon;  //!< the weapon that is currenty activated
    5051  Weapon* activeWeaponL;  //temporary -- FIX THIS
     52  WeaponManager* weaponMan; //!< the weapon manager: managing a list of weapon to wepaon-slot mapping
    5153
    5254  World* myWorld;        //!< reference to the world object
  • orxonox/trunk/src/world_entities/weapon.cc

    r3870 r3873  
    1616*/
    1717
     18#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
    1819
    1920#include "weapon.h"
     
    6162          return;
    6263        }
     64      PRINTF(3)("Added new Weapon to Config:%i/Slot:%i\n", configID, freeSlot);
    6365      this->configs[configID].slots[freeSlot] = weapon;
    6466      return;
     
    7173void WeaponManager::nextWeaponConf()
    7274{
    73   for(; this->currConfID < W_MAX_CONFIGS && !this->configs[this->currConfID].bUsed; this->currConfID+=1)
    74     printf("");
    75 }
    76 
    77 
    78 void WeaponManager::prevWeaponConf()
    79 {}
    80 
    81 
    82 void WeaponManager::selectConfig(int confID)
    83 {
    84   PRINTF(0)("There is no weapon config defined with the number W_CONF%i", confID);
    85 }
    86 
     75  int i;
     76  for(i = this->currConfID; i < W_MAX_CONFIGS && !this->configs[i].bUsed; ++i);
     77  if( i == W_MAX_CONFIGS) this->currConfID = W_CONFIG0;
     78  else this->currConfID = i; 
     79}
    8780
    8881
  • orxonox/trunk/src/world_entities/weapon.h

    r3870 r3873  
    8080 
    8181  void addWeapon(Weapon* weapon, int slotID = W_FREE_SLOT, int configID = W_CONFIG1);
     82  void nextWeaponConf();
    8283
    83   void nextWeaponConf();
    84   void prevWeaponConf();
    85   void selectConfig(int configID);
    8684
    8785 private:
Note: See TracChangeset for help on using the changeset viewer.