Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 30, 2009, 2:10:44 PM (15 years ago)
Author:
rgrieder
Message:

Merged resource branch back to the trunk. Changes:

  • Automated graphics loading by evaluating whether a GameState requires it
  • Using native Tcl library (x3n)

Windows users: Update your dependency package!

Location:
code/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/sound/SoundBase.cc

    r3196 r3370  
    6565    void SoundBase::update() {
    6666        if(this->entity_ != NULL && alIsSource(this->source_)) {
    67             Vector3 pos = this->entity_->getPosition();
     67            const Vector3& pos = this->entity_->getPosition();
    6868            alSource3f(this->source_, AL_POSITION, pos.x, pos.y, pos.z);
    6969            ALenum error = alGetError();
     
    7171                COUT(2) << "Sound: OpenAL: Invalid sound position" << std::endl;
    7272
    73             Vector3 vel = this->entity_->getVelocity();
     73            const Vector3& vel = this->entity_->getVelocity();
    7474            alSource3f(this->source_, AL_VELOCITY, vel.x, vel.y, vel.z);
    7575            error = alGetError();
     
    7777                COUT(2) << "Sound: OpenAL: Invalid sound velocity" << std::endl;
    7878
    79             Quaternion orient = this->entity_->getOrientation();
     79            const Quaternion& orient = this->entity_->getOrientation();
    8080            Vector3 at = orient.zAxis();
    8181            alSource3f(this->source_, AL_DIRECTION, at.x, at.y, at.z);
     
    190190        if(ov_open(f, &vf, NULL, 0) < 0)
    191191        {
    192             COUT(2) << "Sound: libvorbisfile: File seems not to be an Ogg Vorbis bitstream" << std::endl;
     192            COUT(2) << "Sound: libvorbisfile: File does not seem to be an Ogg Vorbis bitstream" << std::endl;
    193193            ov_clear(&vf);
    194194            return AL_NONE;
  • code/trunk/src/orxonox/sound/SoundManager.cc

    r3280 r3370  
    3838namespace orxonox
    3939{
    40     SoundManager* SoundManager::singletonRef_s = NULL;
     40    SoundManager* SoundManager::singletonPtr_s = NULL;
    4141
    4242    /**
     
    4545    SoundManager::SoundManager()
    4646    {
    47         assert(singletonRef_s == NULL);
    48         singletonRef_s = this;
    49 
    5047        this->device_ = NULL;
    5148        this->soundavailable_ = true;
     
    9390    SoundManager::~SoundManager()
    9491    {
    95         assert(singletonRef_s != NULL);
    96         singletonRef_s = NULL;
    97 
    9892        alcDestroyContext(this->context_);
    9993        alcCloseDevice(this->device_);
     
    148142
    149143        // update listener orientation
    150         Quaternion orient = camera->getOrientation();
     144        const Quaternion& orient = camera->getOrientation();
    151145        Vector3 up = orient.xAxis(); // just a wild guess
    152146        Vector3 at = orient.zAxis();
  • code/trunk/src/orxonox/sound/SoundManager.h

    r3280 r3370  
    3232#include <cassert>
    3333#include <list>
     34#include "util/Singleton.h"
    3435#include "interfaces/Tickable.h"
    3536
     
    4243     *
    4344     */
    44     class _OrxonoxExport SoundManager : public Tickable
     45    class _OrxonoxExport SoundManager : public Singleton<SoundManager>, public Tickable
    4546    {
     47        friend class Singleton<SoundManager>;
    4648    public:
    4749        SoundManager();
     
    5254        bool isSoundAvailable();
    5355
    54         static SoundManager& getInstance() { assert(singletonRef_s); return *singletonRef_s; }
    55 
    5656    private:
    5757        ALCdevice* device_;
     
    6060        bool soundavailable_;
    6161
    62         static SoundManager* singletonRef_s;
     62        static SoundManager* singletonPtr_s;
    6363    }; // class SoundManager
    6464} // namespace orxonox
Note: See TracChangeset for help on using the changeset viewer.