Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 20, 2009, 5:20:11 PM (15 years ago)
Author:
rgrieder
Message:

Merged particles2 branch to presentation2.

Location:
code/branches/presentation2
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2

  • code/branches/presentation2/src/orxonox/worldentities/ControllableEntity.cc

    r5929 r6107  
    3636#include "core/GameMode.h"
    3737#include "core/XMLPort.h"
     38#include "network/NetworkFunction.h"
    3839
    3940#include "Scene.h"
     
    4748{
    4849    CreateFactory(ControllableEntity);
     50
     51    registerMemberNetworkFunction( ControllableEntity, fire );
    4952
    5053    ControllableEntity::ControllableEntity(BaseObject* creator) : MobileEntity(creator)
     
    217220            this->cameraPositionRootNode_->roll(Radian(value.y * this->mouseLookSpeed_), Ogre::Node::TS_LOCAL);
    218221    }
     222   
     223    void ControllableEntity::fire(unsigned int firemode)
     224    {
     225        if(GameMode::isMaster())
     226        {
     227            this->fired(firemode);
     228        }
     229        else
     230        {
     231            callMemberNetworkFunction(ControllableEntity, fire, this->getObjectID(), 0, firemode);
     232        }
     233    }
    219234
    220235    void ControllableEntity::setPlayer(PlayerInfo* player)
  • code/branches/presentation2/src/orxonox/worldentities/ControllableEntity.h

    r5929 r6107  
    8484                { this->rotateRoll(Vector2(value, 0)); }
    8585
    86             virtual void fire(unsigned int firemode) {}
     86            void fire(unsigned int firemode);
     87            virtual void fired(unsigned int firemode) {}
    8788            virtual void reload() {}
    8889
  • code/branches/presentation2/src/orxonox/worldentities/pawns/Pawn.cc

    r5929 r6107  
    5252    CreateFactory(Pawn);
    5353
    54     registerMemberNetworkFunction( Pawn, doFire );
    55 
    5654    Pawn::Pawn(BaseObject* creator) : ControllableEntity(creator)
    5755    {
     
    110108        XMLPortObject(Pawn, WeaponSlot, "weaponslots", addWeaponSlot, getWeaponSlot, xmlelement, mode);
    111109        XMLPortObject(Pawn, WeaponSet, "weaponsets", addWeaponSet, getWeaponSet, xmlelement, mode);
    112         XMLPortObject(Pawn, WeaponPack, "weapons", addWeaponPack, getWeaponPack, xmlelement, mode);
     110        XMLPortObject(Pawn, WeaponPack, "weapons", addWeaponPackXML, getWeaponPack, xmlelement, mode);
    113111    }
    114112
     
    263261    }
    264262
    265     void Pawn::fire(unsigned int firemode)
    266     {
    267         this->doFire(firemode);
    268     }
    269 
    270     void Pawn::doFire(uint8_t firemode)
    271     {
    272         if(GameMode::isMaster())
    273         {
    274             if (this->weaponSystem_)
    275                 this->weaponSystem_->fire(firemode);
    276         }
    277         else
    278         {
    279             callMemberNetworkFunction(Pawn, doFire, this->getObjectID(), 0, firemode);
    280             if (this->weaponSystem_)
    281                 this->weaponSystem_->fire(firemode);
    282         }
     263    void Pawn::fired(unsigned int firemode)
     264    {
     265        if (this->weaponSystem_)
     266            this->weaponSystem_->fire(firemode);
    283267    }
    284268
     
    341325    }
    342326
     327    void Pawn::addWeaponPackXML(WeaponPack * wPack)
     328    {
     329        if (this->weaponSystem_)
     330            if (!this->weaponSystem_->addWeaponPack(wPack))
     331                wPack->destroy();
     332    }
     333
    343334    WeaponPack * Pawn::getWeaponPack(unsigned int index) const
    344335    {
  • code/branches/presentation2/src/orxonox/worldentities/pawns/Pawn.h

    r5781 r6107  
    7979            virtual void kill();
    8080
    81             virtual void fire(unsigned int firemode);
     81            virtual void fired(unsigned int firemode);
    8282            virtual void reload();
    83             virtual void doFire(uint8_t firemode);
    8483            virtual void postSpawn();
    8584
     
    8988            WeaponSet * getWeaponSet(unsigned int index) const;
    9089            void addWeaponPack(WeaponPack * wPack);
     90            void addWeaponPackXML(WeaponPack * wPack);
    9191            WeaponPack * getWeaponPack(unsigned int index) const;
    9292
  • code/branches/presentation2/src/orxonox/worldentities/pawns/Spectator.cc

    r5929 r6107  
    189189    }
    190190
    191     void Spectator::fire(unsigned int firemode)
     191    void Spectator::fired(unsigned int firemode)
    192192    {
    193193        if (this->getPlayer())
  • code/branches/presentation2/src/orxonox/worldentities/pawns/Spectator.h

    r5781 r6107  
    5555            virtual void rotateRoll(const Vector2& value);
    5656
    57             virtual void fire(unsigned int firemode);
     57            virtual void fired(unsigned int firemode);
    5858            virtual void greet();
    5959
Note: See TracChangeset for help on using the changeset viewer.