Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 9, 2013, 9:26:46 PM (11 years ago)
Author:
landauf
Message:

BaseObject now requires a Context instead of a creator (BaseObject*) in its constructor.
Namespace, Level, and Scene inherit from Context

Location:
code/branches/core6/src/modules/weapons
Files:
39 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core6/src/modules/weapons/MuzzleFlash.cc

    r8855 r9629  
    4141    CreateFactory(MuzzleFlash);
    4242
    43     MuzzleFlash::MuzzleFlash(BaseObject* creator) : Billboard(creator)
     43    MuzzleFlash::MuzzleFlash(Context* context) : Billboard(context)
    4444    {
    4545        RegisterObject(MuzzleFlash);
  • code/branches/core6/src/modules/weapons/MuzzleFlash.h

    r8855 r9629  
    5555    {
    5656        public:
    57             MuzzleFlash(BaseObject* creator);
     57            MuzzleFlash(Context* context);
    5858            virtual ~MuzzleFlash() {}
    5959
  • code/branches/core6/src/modules/weapons/RocketController.cc

    r9348 r9629  
    4545        Constructor.
    4646    */
    47     RocketController::RocketController(BaseObject* creator) : Controller(creator)
     47    RocketController::RocketController(Context* context) : Controller(context)
    4848    {
    4949        RegisterObject(RocketController);
     
    5151
    5252        // Create a rocket for the controller.
    53         this->rocket_ = new SimpleRocket(this);
     53        this->rocket_ = new SimpleRocket(this->getContext());
    5454        this->rocket_->setController(this);
    5555        this->setControllableEntity(orxonox_cast<ControllableEntity*>(this->rocket_));
  • code/branches/core6/src/modules/weapons/RocketController.h

    r8855 r9629  
    5252    {
    5353        public:
    54             RocketController(BaseObject* creator);
     54            RocketController(Context* context);
    5555            virtual ~RocketController();
    5656
  • code/branches/core6/src/modules/weapons/munitions/FusionMunition.cc

    r8855 r9629  
    3939    CreateFactory(FusionMunition);
    4040
    41     FusionMunition::FusionMunition(BaseObject* creator) : Munition(creator)
     41    FusionMunition::FusionMunition(Context* context) : Munition(context)
    4242    {
    4343        RegisterObject(FusionMunition);
  • code/branches/core6/src/modules/weapons/munitions/FusionMunition.h

    r8855 r9629  
    5151    {
    5252        public:
    53             FusionMunition(BaseObject* creator);
     53            FusionMunition(Context* context);
    5454            virtual ~FusionMunition() {}
    5555    };
  • code/branches/core6/src/modules/weapons/munitions/LaserMunition.cc

    r8855 r9629  
    3939    CreateFactory(LaserMunition);
    4040
    41     LaserMunition::LaserMunition(BaseObject* creator) : ReplenishingMunition(creator)
     41    LaserMunition::LaserMunition(Context* context) : ReplenishingMunition(context)
    4242    {
    4343        RegisterObject(LaserMunition);
  • code/branches/core6/src/modules/weapons/munitions/LaserMunition.h

    r8855 r9629  
    5151    {
    5252        public:
    53             LaserMunition(BaseObject* creator);
     53            LaserMunition(Context* context);
    5454            virtual ~LaserMunition() {}
    5555    };
  • code/branches/core6/src/modules/weapons/munitions/ReplenishingMunition.cc

    r8855 r9629  
    4141    CreateFactory(ReplenishingMunition);
    4242
    43     ReplenishingMunition::ReplenishingMunition(BaseObject* creator) : Munition(creator)
     43    ReplenishingMunition::ReplenishingMunition(Context* context) : Munition(context)
    4444    {
    4545        RegisterObject(ReplenishingMunition);
  • code/branches/core6/src/modules/weapons/munitions/ReplenishingMunition.h

    r8855 r9629  
    5353    {
    5454        public:
    55             ReplenishingMunition(BaseObject* creator);
     55            ReplenishingMunition(Context* context);
    5656            virtual ~ReplenishingMunition() {}
    5757
  • code/branches/core6/src/modules/weapons/munitions/RocketMunition.cc

    r8855 r9629  
    3939    CreateFactory(RocketMunition);
    4040
    41     RocketMunition::RocketMunition(BaseObject* creator) : Munition(creator)
     41    RocketMunition::RocketMunition(Context* context) : Munition(context)
    4242    {
    4343        RegisterObject(RocketMunition);
  • code/branches/core6/src/modules/weapons/munitions/RocketMunition.h

    r8855 r9629  
    5151    {
    5252        public:
    53             RocketMunition(BaseObject* creator);
     53            RocketMunition(Context* context);
    5454            virtual ~RocketMunition() {}
    5555    };
  • code/branches/core6/src/modules/weapons/projectiles/BasicProjectile.cc

    r9567 r9629  
    106106                {
    107107                    {
    108                         ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getCreator());
     108                        ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getContext());
    109109                        effect->setPosition(entity->getPosition());
    110110                        effect->setOrientation(entity->getOrientation());
     
    115115                    // Second effect with same condition
    116116                    {
    117                         ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getCreator());
     117                        ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getContext());
    118118                        effect->setPosition(entity->getPosition());
    119119                        effect->setOrientation(entity->getOrientation());
     
    127127                if (victim && victim->hasShield() && (this->getDamage() > 0.0f || this->getShieldDamage() > 0.0f) && victim->getHealth() > 0.0f)
    128128                {
    129                     ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getCreator());
     129                    ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getContext());
    130130                    effect->setDestroyAfterLife(true);
    131131                    effect->setSource("Orxonox/Shield");
  • code/branches/core6/src/modules/weapons/projectiles/BillboardProjectile.cc

    r8855 r9629  
    4242    CreateFactory(BillboardProjectile);
    4343
    44     BillboardProjectile::BillboardProjectile(BaseObject* creator) : Projectile(creator)
     44    BillboardProjectile::BillboardProjectile(Context* context) : Projectile(context)
    4545    {
    4646        RegisterObject(BillboardProjectile);
  • code/branches/core6/src/modules/weapons/projectiles/BillboardProjectile.h

    r8855 r9629  
    5555    {
    5656        public:
    57             BillboardProjectile(BaseObject* creator);
     57            BillboardProjectile(Context* context);
    5858            virtual ~BillboardProjectile();
    5959
  • code/branches/core6/src/modules/weapons/projectiles/LightningGunProjectile.cc

    r8855 r9629  
    4242    CreateFactory(LightningGunProjectile);
    4343
    44     LightningGunProjectile::LightningGunProjectile(BaseObject* creator) : BillboardProjectile(creator)
     44    LightningGunProjectile::LightningGunProjectile(Context* context) : BillboardProjectile(context)
    4545    {
    4646        RegisterObject(LightningGunProjectile);
  • code/branches/core6/src/modules/weapons/projectiles/LightningGunProjectile.h

    r8855 r9629  
    5555    {
    5656        public:
    57             LightningGunProjectile(BaseObject* creator);
     57            LightningGunProjectile(Context* context);
    5858            virtual ~LightningGunProjectile() {}
    5959
  • code/branches/core6/src/modules/weapons/projectiles/ParticleProjectile.cc

    r9589 r9629  
    4343    CreateFactory(ParticleProjectile);
    4444
    45     ParticleProjectile::ParticleProjectile(BaseObject* creator) : BillboardProjectile(creator)
     45    ParticleProjectile::ParticleProjectile(Context* context) : BillboardProjectile(context)
    4646    {
    4747        RegisterObject(ParticleProjectile);
  • code/branches/core6/src/modules/weapons/projectiles/ParticleProjectile.h

    r8855 r9629  
    5151    {
    5252        public:
    53             ParticleProjectile(BaseObject* creator);
     53            ParticleProjectile(Context* context);
    5454            virtual ~ParticleProjectile();
    5555            virtual void changedVisibility();
  • code/branches/core6/src/modules/weapons/projectiles/Projectile.cc

    r9558 r9629  
    4646    CreateFactory(Projectile);
    4747
    48     Projectile::Projectile(BaseObject* creator) : MovableEntity(creator), BasicProjectile()
     48    Projectile::Projectile(Context* context) : MovableEntity(context), BasicProjectile()
    4949    {
    5050        RegisterObject(Projectile);
     
    6060            this->setCollisionType(Kinematic);
    6161
    62             SphereCollisionShape* shape = new SphereCollisionShape(this);
     62            SphereCollisionShape* shape = new SphereCollisionShape(this->getContext());
    6363            shape->setRadius(20.0f);
    6464            this->attachCollisionShape(shape);
  • code/branches/core6/src/modules/weapons/projectiles/Projectile.h

    r8855 r9629  
    5858    {
    5959        public:
    60             Projectile(BaseObject* creator);
     60            Projectile(Context* context);
    6161            virtual ~Projectile();
    6262
  • code/branches/core6/src/modules/weapons/projectiles/Rocket.cc

    r9016 r9629  
    5757        Constructor. Registers the object and initializes some default values.
    5858    */
    59     Rocket::Rocket(BaseObject* creator)
    60         : ControllableEntity(creator)
     59    Rocket::Rocket(Context* context)
     60        : ControllableEntity(context)
    6161        , BasicProjectile()
    62         , RadarViewable(creator, static_cast<WorldEntity*>(this))
     62        , RadarViewable(this, static_cast<WorldEntity*>(this))
    6363    {
    6464        RegisterObject(Rocket);// Register the Rocket class to the core
     
    7373
    7474            // Create rocket model
    75             Model* model = new Model(this);
     75            Model* model = new Model(this->getContext());
    7676            model->setMeshSource("rocket.mesh");
    7777            model->scale(0.7f);
     
    7979
    8080            // Add effects.
    81             ParticleEmitter* fire = new ParticleEmitter(this);
     81            ParticleEmitter* fire = new ParticleEmitter(this->getContext());
    8282            this->attach(fire);
    8383            fire->setOrientation(this->getOrientation());
     
    8989
    9090            // Add collision shape
    91             ConeCollisionShape* collisionShape = new ConeCollisionShape(this);
     91            ConeCollisionShape* collisionShape = new ConeCollisionShape(this->getContext());
    9292            collisionShape->setRadius(3);
    9393            collisionShape->setHeight(500);
     
    9797
    9898            // Add sound
    99             this->defSndWpnEngine_ = new WorldSound(this);
     99            this->defSndWpnEngine_ = new WorldSound(this->getContext());
    100100            this->defSndWpnEngine_->setLooping(true);
    101101            this->defSndWpnEngine_->setSource("sounds/Rocket_engine.ogg");
     
    103103            this->attach(defSndWpnEngine_);
    104104
    105             this->defSndWpnLaunch_ = new WorldSound(this);
     105            this->defSndWpnLaunch_ = new WorldSound(this->getContext());
    106106            this->defSndWpnLaunch_->setLooping(false);
    107107            this->defSndWpnLaunch_->setSource("sounds/Rocket_launch.ogg");
     
    116116
    117117        // Add camera
    118         CameraPosition* camPosition = new CameraPosition(this);
     118        CameraPosition* camPosition = new CameraPosition(this->getContext());
    119119        camPosition->setPosition(0,4,15);
    120120        camPosition->setAllowMouseLook(true);
     
    226226        if(this->getShooter())
    227227        {
    228             effect1 = new ParticleSpawner(this->getShooter()->getCreator());
    229             effect2 = new ParticleSpawner(this->getShooter()->getCreator());
     228            effect1 = new ParticleSpawner(this->getShooter()->getContext());
     229            effect2 = new ParticleSpawner(this->getShooter()->getContext());
    230230        }
    231231        else
    232232        {
    233             effect1 = new ParticleSpawner(static_cast<BaseObject*>(this->getScene().get()));
    234             effect2 = new ParticleSpawner(static_cast<BaseObject*>(this->getScene().get()));
     233            effect1 = new ParticleSpawner(this->getContext());
     234            effect2 = new ParticleSpawner(this->getContext());
    235235        }
    236236
  • code/branches/core6/src/modules/weapons/projectiles/Rocket.h

    r9016 r9629  
    5959    {
    6060        public:
    61             Rocket(BaseObject* creator);
     61            Rocket(Context* context);
    6262            virtual ~Rocket();
    6363
  • code/branches/core6/src/modules/weapons/projectiles/SimpleRocket.cc

    r8859 r9629  
    5656    const float SimpleRocket::FUEL_PERCENTAGE = 0.8f;
    5757
    58     SimpleRocket::SimpleRocket(BaseObject* creator)
    59         : ControllableEntity(creator)
     58    SimpleRocket::SimpleRocket(Context* context)
     59        : ControllableEntity(context)
    6060        , BasicProjectile()
    61         , RadarViewable(creator, static_cast<WorldEntity*>(this))
     61        , RadarViewable(this, static_cast<WorldEntity*>(this))
    6262    {
    6363        RegisterObject(SimpleRocket);// Register the SimpleRocket class to the core
     
    7474
    7575            // Create rocket model.
    76             Model* model = new Model(this);
     76            Model* model = new Model(this->getContext());
    7777            model->setMeshSource("rocket.mesh");
    7878            model->scale(0.7f);
     
    8080
    8181            // Add effects.
    82             this->fire_ = new ParticleEmitter(this);
     82            this->fire_ = new ParticleEmitter(this->getContext());
    8383            this->attach(this->fire_);
    8484
     
    9191            // Add collision shape.
    9292            // TODO: fix the orientation and size of this collision shape to match the rocket
    93             ConeCollisionShape* collisionShape = new ConeCollisionShape(this);
     93            ConeCollisionShape* collisionShape = new ConeCollisionShape(this->getContext());
    9494            collisionShape->setOrientation(this->getOrientation());
    9595            collisionShape->setRadius(1.5f);
  • code/branches/core6/src/modules/weapons/projectiles/SimpleRocket.h

    r8859 r9629  
    6060    {
    6161        public:
    62             SimpleRocket(BaseObject* creator);
     62            SimpleRocket(Context* context);
    6363            virtual ~SimpleRocket();
    6464            virtual void tick(float dt);
  • code/branches/core6/src/modules/weapons/weaponmodes/EnergyDrink.cc

    r8855 r9629  
    5151    CreateFactory(EnergyDrink);
    5252
    53     EnergyDrink::EnergyDrink(BaseObject* creator) : WeaponMode(creator)
     53    EnergyDrink::EnergyDrink(Context* context) : WeaponMode(context)
    5454    {
    5555        RegisterObject(EnergyDrink);
     
    101101    {
    102102        // Create the projectile
    103         Projectile* projectile = new Projectile(this);
    104         Model* model = new Model(projectile);
     103        Projectile* projectile = new Projectile(this->getContext());
     104        Model* model = new Model(projectile->getContext());
    105105        model->setMeshSource("can.mesh");
    106106        model->setCastShadows(false);
     
    127127    void EnergyDrink::muzzleflash()
    128128    {
    129         MuzzleFlash *muzzleFlash = new MuzzleFlash(this);
     129        MuzzleFlash *muzzleFlash = new MuzzleFlash(this->getContext());
    130130        this->getWeapon()->attach(muzzleFlash);
    131131        muzzleFlash->setPosition(this->getMuzzleOffset());
  • code/branches/core6/src/modules/weapons/weaponmodes/EnergyDrink.h

    r8855 r9629  
    5454    {
    5555        public:
    56             EnergyDrink(BaseObject* creator);
     56            EnergyDrink(Context* context);
    5757            virtual ~EnergyDrink() {}
    5858
  • code/branches/core6/src/modules/weapons/weaponmodes/FusionFire.cc

    r8855 r9629  
    4848    CreateFactory(FusionFire);
    4949
    50     FusionFire::FusionFire(BaseObject* creator) : WeaponMode(creator)
     50    FusionFire::FusionFire(Context* context) : WeaponMode(context)
    5151    {
    5252        RegisterObject(FusionFire);
     
    6666    void FusionFire::fire()
    6767    {
    68         BillboardProjectile* projectile = new BillboardProjectile(this);
     68        BillboardProjectile* projectile = new BillboardProjectile(this->getContext());
    6969
    7070        projectile->setOrientation(this->getMuzzleOrientation());
  • code/branches/core6/src/modules/weapons/weaponmodes/FusionFire.h

    r8855 r9629  
    5151    {
    5252        public:
    53             FusionFire(BaseObject* creator);
     53            FusionFire(Context* context);
    5454            virtual ~FusionFire() {}
    5555
  • code/branches/core6/src/modules/weapons/weaponmodes/HsW01.cc

    r9526 r9629  
    5252    CreateFactory(HsW01);
    5353
    54     HsW01::HsW01(BaseObject* creator) : WeaponMode(creator)
     54    HsW01::HsW01(Context* context) : WeaponMode(context)
    5555    {
    5656        RegisterObject(HsW01);
     
    111111
    112112        // Create the projectile.
    113         Projectile* projectile = new Projectile(this);
    114         Model* model = new Model(projectile);
     113        Projectile* projectile = new Projectile(this->getContext());
     114        Model* model = new Model(projectile->getContext());
    115115        model->setMeshSource(mesh_);
    116116        model->setCastShadows(false);
     
    138138    void HsW01::muzzleflash()
    139139    {
    140         MuzzleFlash *muzzleFlash = new MuzzleFlash(this);
     140        MuzzleFlash *muzzleFlash = new MuzzleFlash(this->getContext());
    141141        this->getWeapon()->attach(muzzleFlash);
    142142        muzzleFlash->setPosition(this->getMuzzleOffset());
  • code/branches/core6/src/modules/weapons/weaponmodes/HsW01.h

    r9526 r9629  
    5353    {
    5454        public:
    55             HsW01(BaseObject* creator);
     55            HsW01(Context* context);
    5656            virtual ~HsW01();
    5757
  • code/branches/core6/src/modules/weapons/weaponmodes/LaserFire.cc

    r8855 r9629  
    4747    CreateFactory(LaserFire);
    4848
    49     LaserFire::LaserFire(BaseObject* creator) : WeaponMode(creator)
     49    LaserFire::LaserFire(Context* context) : WeaponMode(context)
    5050    {
    5151        RegisterObject(LaserFire);
     
    6464    void LaserFire::fire()
    6565    {
    66         ParticleProjectile* projectile = new ParticleProjectile(this);
     66        ParticleProjectile* projectile = new ParticleProjectile(this->getContext());
    6767
    6868        projectile->setOrientation(this->getMuzzleOrientation());
  • code/branches/core6/src/modules/weapons/weaponmodes/LaserFire.h

    r8855 r9629  
    5151    {
    5252        public:
    53             LaserFire(BaseObject* creator);
     53            LaserFire(Context* context);
    5454            virtual ~LaserFire() {}
    5555
  • code/branches/core6/src/modules/weapons/weaponmodes/LightningGun.cc

    r9016 r9629  
    4646    CreateFactory(LightningGun);
    4747
    48     LightningGun::LightningGun(BaseObject* creator) : WeaponMode(creator)
     48    LightningGun::LightningGun(Context* context) : WeaponMode(context)
    4949    {
    5050        RegisterObject(LightningGun);
     
    6868    void LightningGun::fire()
    6969    {
    70         LightningGunProjectile* projectile = new LightningGunProjectile(this);
     70        LightningGunProjectile* projectile = new LightningGunProjectile(this->getContext());
    7171        projectile->setMaterial("Flares/LightningBall_");
    7272
  • code/branches/core6/src/modules/weapons/weaponmodes/LightningGun.h

    r8855 r9629  
    5151    {
    5252        public:
    53             LightningGun(BaseObject* creator);
     53            LightningGun(Context* context);
    5454            virtual ~LightningGun();
    5555
  • code/branches/core6/src/modules/weapons/weaponmodes/RocketFire.cc

    r8855 r9629  
    4848    CreateFactory(RocketFire);
    4949
    50     RocketFire::RocketFire(BaseObject* creator) : WeaponMode(creator)
     50    RocketFire::RocketFire(Context* context) : WeaponMode(context)
    5151    {
    5252        RegisterObject(RocketFire);
     
    7171    void RocketFire::fire()
    7272    {
    73         Rocket* rocket = new Rocket(this);
     73        Rocket* rocket = new Rocket(this->getContext());
    7474
    7575        this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
  • code/branches/core6/src/modules/weapons/weaponmodes/RocketFire.h

    r8855 r9629  
    5151    {
    5252        public:
    53             RocketFire(BaseObject* creator);
     53            RocketFire(Context* context);
    5454            virtual ~RocketFire();
    5555
  • code/branches/core6/src/modules/weapons/weaponmodes/SimpleRocketFire.cc

    r8855 r9629  
    5252    CreateFactory(SimpleRocketFire);
    5353
    54     SimpleRocketFire::SimpleRocketFire(BaseObject* creator) : WeaponMode(creator)
     54    SimpleRocketFire::SimpleRocketFire(Context* context) : WeaponMode(context)
    5555    {
    5656        RegisterObject(SimpleRocketFire);
     
    7676    void SimpleRocketFire::fire()
    7777    {
    78         RocketController* controller = new RocketController(this);
     78        RocketController* controller = new RocketController(this->getContext());
    7979        SimpleRocket* rocket = controller->getRocket();
    8080        this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
  • code/branches/core6/src/modules/weapons/weaponmodes/SimpleRocketFire.h

    r8855 r9629  
    5050    {
    5151        public:
    52             SimpleRocketFire(BaseObject* creator);
     52            SimpleRocketFire(Context* context);
    5353            virtual ~SimpleRocketFire();
    5454            void deactivateFire();
Note: See TracChangeset for help on using the changeset viewer.