Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 20, 2009, 11:11:32 AM (16 years ago)
Author:
rgrieder
Message:

Changed "source" parameter of AmbientSound to "ambientSource" to restore consistency with the c++ methods.
Adjusted sound.oxw file.

Also moved XML ports form WorldSound/AmbientSound to BaseSound::XMLPortExtern.
To make that work, I had to insert a dynamic_cast into the XMLPortParamGeneric macro. Shouldn't be a problem though. Just don't use XMLPortParam inside a class that might not be a BaseObject (at least dynamically).

File:
1 edited

Legend:

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

    r6071 r6102  
    3737#include "core/GameMode.h"
    3838#include "core/Resource.h"
     39#include "core/XMLPort.h"
    3940
    4041namespace orxonox
     
    6061        if (GameMode::playsSound())
    6162            alDeleteSources(1, &this->audioSource_);
     63    }
     64
     65    void BaseSound::XMLPortExtern(Element& xmlelement, XMLPort::Mode mode)
     66    {
     67        XMLPortParam(BaseSound, "volume", setVolume,  getVolume,  xmlelement, mode);
     68        XMLPortParam(BaseSound, "loop",   setLooping, getLooping, xmlelement, mode);
     69        XMLPortParam(BaseSound, "play",   play,       isPlaying,  xmlelement, mode);
     70        XMLPortParam(BaseSound, "source", setSource,  getSource,  xmlelement, mode);
    6271    }
    6372
Note: See TracChangeset for help on using the changeset viewer.