Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 19, 2009, 9:01:16 PM (15 years ago)
Author:
rgrieder
Message:

Added a sound for the engine (forward active mode) by overloading changedActivity in WorldSound.

Location:
code/branches/sound3/src/orxonox/sound
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/sound3/src/orxonox/sound/AmbientSound.cc

    r6071 r6100  
    125125    void AmbientSound::changedActivity()
    126126    {
    127         COUT(3) << "Sound: " << this->getSource() << ": ChangedActivity: " << this->isActive() << std::endl;
    128         this->BaseObject::changedActivity();
     127        SUPER(AmbientSound, changedActivity);
    129128        if (this->isActive())
    130         {
    131129            this->play();
    132         }
    133130        else
    134         {
    135131            this->stop();
    136         }
    137132    }
    138133}
  • code/branches/sound3/src/orxonox/sound/WorldSound.cc

    r6071 r6100  
    8989        }
    9090    }
     91
     92    void WorldSound::changedActivity()
     93    {
     94        SUPER(WorldSound, changedActivity);
     95        if (this->isActive())
     96            this->play();
     97        else
     98            this->stop();
     99    }
    91100}
  • code/branches/sound3/src/orxonox/sound/WorldSound.h

    r6069 r6100  
    5050        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5151        virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
     52        virtual void changedActivity();
    5253
    5354        virtual void tick(float dt);
Note: See TracChangeset for help on using the changeset viewer.