Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 20, 2007, 4:10:08 PM (17 years ago)
Author:
nicolasc
Message:
  • a lot of inlining of getfunctions
  • set libaudio to shared (not sure, if related: audioplayer + ingame sound == crash!)
  • minor space cleanups
Location:
code/branches/FICN/src/orxonox/particle
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/orxonox/particle/ParticleInterface.cc

    r658 r659  
    4343namespace particle {
    4444
    45   ParticleInterface::~ParticleInterface(void)
    46   {
    47     sceneManager_->destroyParticleSystem(particleSystem_);
    48   }
    49 
    5045  ParticleInterface::ParticleInterface( SceneManager *sceneManager, String name, String templateName )
    5146  {
     
    6257    numberOfEmitters_ = particleSystem_->getNumEmitters();
    6358    standardizeEmitters();
     59  }
     60
     61  ParticleInterface::~ParticleInterface(void)
     62  {
     63    sceneManager_->destroyParticleSystem(particleSystem_);
    6464  }
    6565
     
    9595    distance_ = d;
    9696    //partikel anpassen
    97     for (int i=0; i<numberOfEmitters_; i++) {
     97    for (int i=0; i < numberOfEmitters_; i++) {
    9898      particleSystem_->getEmitter(i)->setTimeToLive(distance_);
    9999    }
     
    104104    colour_ = colour;
    105105    //partikel anpassen
    106     for (int i=0; i<numberOfEmitters_; i++) {
     106    for (int i=0; i < numberOfEmitters_; i++) {
    107107      particleSystem_->getEmitter(i)->setColour(colour_);
    108108    }
     
    111111  ParticleEmitter* ParticleInterface::getEmitter( int emitterNr )
    112112  {
    113     if (!(emitterNr<numberOfEmitters_)) return NULL;
     113    if ( (emitterNr >= numberOfEmitters_) || (emitterNr < 0) ) return NULL;
    114114    return particleSystem_->getEmitter(emitterNr);
    115115  }
    116116
    117   void ParticleInterface::newEmitter ( void )
     117  void ParticleInterface::newEmitter ()
    118118  {
    119119    particleSystem_->addEmitter(particleSystem_->getEmitter(0)->getType());
    120     numberOfEmitters_=numberOfEmitters_+1;
    121     particleSystem_->getEmitter(0)->copyParametersTo( particleSystem_->getEmitter(numberOfEmitters_-1) );
     120    particleSystem_->getEmitter(0)->copyParametersTo( particleSystem_->getEmitter(numberOfEmitters_) );
     121    numberOfEmitters_++;
    122122  }
    123123
  • code/branches/FICN/src/orxonox/particle/ParticleInterface.h

    r658 r659  
    1919 public:
    2020
    21         ParticleInterface( Ogre::SceneManager *sceneManager, Ogre::String name, Ogre::String templateName );
    22         ~ParticleInterface( void );
     21  ParticleInterface( Ogre::SceneManager *sceneManager, Ogre::String name, Ogre::String templateName );
     22  ~ParticleInterface( void );
    2323
    2424  void inline addToSceneNode( Ogre::SceneNode* sceneNode ) { sceneNode_ = sceneNode; sceneNode_->attachObject(particleSystem_);};
    2525  void inline detachFromSceneNode( void ) { sceneNode_->detachObject(particleSystem_); sceneNode_ = NULL;};
    2626
    27         Ogre::ParticleEmitter* getEmitter ( int emitterNr );
    28         void newEmitter ( void );
     27  Ogre::ParticleEmitter* getEmitter ( int emitterNr );
     28  void newEmitter ( void );
    2929
    3030  Ogre::Vector3 getPositionOfEmitter ( int emitterNr );
     
    3232
    3333  inline Ogre::Vector3 getDirection ( void ) { return particleSystem_->getEmitter(0)->getDirection(); };
    34         void setDirection ( Ogre::Vector3 direction );
     34  void setDirection ( Ogre::Vector3 direction );
    3535
    36         inline Ogre::Real getVelocity() {return velocity_; };
    37         void setVelocity( Ogre::Real v );
     36  inline Ogre::Real getVelocity() {return velocity_; };
     37  void setVelocity( Ogre::Real v );
    3838
    39         inline int getRate() { return rate_; };
    40         void setRate( int r );
     39  inline int getRate() { return rate_; };
     40  void setRate( int r );
    4141
    42         inline Ogre::Real getDistance() { return distance_; };
    43         void setDistance( Ogre::Real d );
     42  inline Ogre::Real getDistance() { return distance_; };
     43  void setDistance( Ogre::Real d );
    4444
    45         inline Ogre::ColourValue getColour( void ) {return colour_;};
    46         void setColour( Ogre::ColourValue colour );
     45  inline Ogre::ColourValue getColour( void ) {return colour_;};
     46  void setColour( Ogre::ColourValue colour );
    4747
    48         void switchEnable( void );
     48  void switchEnable();
    4949
    50   inline Ogre::ParticleSystem* getParticleSystem() {return this->particleSystem_; };
     50  inline Ogre::ParticleSystem* getParticleSystem() { return this->particleSystem_; };
    5151
    5252 private:
    53         Ogre::SceneNode *sceneNode_;
    54         Ogre::SceneManager *sceneManager_;
     53  Ogre::SceneNode *sceneNode_;
     54  Ogre::SceneManager *sceneManager_;
    5555  Ogre::ParticleSystem *particleSystem_;
    56         Ogre::Real distance_;
    57         Ogre::Real velocity_;
    58         int rate_;
    59         Ogre::ColourValue colour_;
    60         int numberOfEmitters_;
     56  Ogre::Real distance_;
     57  Ogre::Real velocity_;
     58  int rate_;
     59  Ogre::ColourValue colour_;
     60  int numberOfEmitters_;
    6161
    62         void standardizeEmitters();
     62  void standardizeEmitters();
    6363};
    64 
    6564
    6665}
Note: See TracChangeset for help on using the changeset viewer.