Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 11, 2009, 2:05:00 AM (15 years ago)
Author:
scheusso
Message:

various fixes for client: NHC, sound, callback handling of Vector4 & Quaternion

Location:
code/branches/presentation2/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/libraries/util/Serialise.h

    r6192 r6320  
    549549        return checkEquality(variable.w, mem) && checkEquality(variable.x, mem+returnSize(variable.w)) &&
    550550            checkEquality(variable.y, mem+returnSize(variable.w)+returnSize(variable.x)) &&
    551             checkEquality(variable.y, mem+returnSize(variable.w)+returnSize(variable.x)+returnSize(variable.y));
     551            checkEquality(variable.z, mem+returnSize(variable.w)+returnSize(variable.x)+returnSize(variable.y));
    552552    }
    553553   
     
    579579        return checkEquality(variable.w, mem) && checkEquality(variable.x, mem+returnSize(variable.w)) &&
    580580            checkEquality(variable.y, mem+returnSize(variable.w)+returnSize(variable.x)) &&
    581             checkEquality(variable.y, mem+returnSize(variable.w)+returnSize(variable.x)+returnSize(variable.y));
     581            checkEquality(variable.z, mem+returnSize(variable.w)+returnSize(variable.x)+returnSize(variable.y));
    582582    }
    583583   
  • code/branches/presentation2/src/orxonox/controllers/NewHumanController.cc

    r6316 r6320  
    6262        , crossHairOverlay_(NULL)
    6363        , centerOverlay_(NULL)
     64        , arrowsOverlay1_(NULL)
     65        , arrowsOverlay2_(NULL)
     66        , arrowsOverlay3_(NULL)
     67        , arrowsOverlay4_(NULL)
     68        , damageOverlayTop_(NULL)
     69        , damageOverlayRight_(NULL)
     70        , damageOverlayBottom_(NULL)
     71        , damageOverlayLeft_(NULL)
     72        , damageOverlayTT_(0)
    6473    {
    6574        RegisterObject(NewHumanController);
     
    560569
    561570    void NewHumanController::showOverlays() {
     571        if( !GameMode::showsGraphics() )
     572            return;
    562573        this->crossHairOverlay_->show();
    563574        this->centerOverlay_->show();
     
    572583
    573584    void NewHumanController::hideOverlays() {
     585        if( !GameMode::showsGraphics() )
     586            return;
    574587        this->crossHairOverlay_->hide();
    575588        this->centerOverlay_->hide();
     
    586599
    587600    void NewHumanController::hideArrows() {
     601        if( !GameMode::showsGraphics() )
     602            return;
    588603        if (showArrows_) {
    589604            this->arrowsOverlay1_->hide();
  • code/branches/presentation2/src/orxonox/sound/AmbientSound.cc

    r6307 r6320  
    5858    {
    5959        registerVariable(volume_, ObjectDirection::ToClient, new NetworkCallback<BaseSound>(static_cast<BaseSound*>(this), &BaseSound::volumeChanged));
    60 //         registerVariable(source_, ObjectDirection::ToClient, new NetworkCallback<BaseSound>(static_cast<BaseSound*>(this), &BaseSound::sourceChanged));
    6160        registerVariable(ambientSource_, ObjectDirection::ToClient, new NetworkCallback<AmbientSound>(this, &AmbientSound::ambientSourceChanged));
    6261        registerVariable(bLooping_, ObjectDirection::ToClient, new NetworkCallback<BaseSound>(static_cast<BaseSound*>(this), &BaseSound::loopingChanged));
    6362        registerVariable(pitch_, ObjectDirection::ToClient, new NetworkCallback<BaseSound>(static_cast<BaseSound*>(this), &BaseSound::pitchChanged));
    64         registerVariable((int&)(BaseSound::state_), ObjectDirection::ToClient);
     63        registerVariable((int&)(BaseSound::state_), ObjectDirection::ToClient, new NetworkCallback<BaseSound>(static_cast<BaseSound*>(this), &BaseSound::stateChanged));
    6564    }
    6665
     
    8483            SoundManager::getInstance().registerAmbientSound(this);
    8584        }
     85        else
     86            BaseSound::play();
    8687    }
    8788
     
    9798            SoundManager::getInstance().unregisterAmbientSound(this);
    9899        }
     100        else
     101            BaseSound::stop();
    99102    }
    100103
     
    110113            SoundManager::getInstance().pauseAmbientSound(this);
    111114        }
     115        else
     116            BaseSound::pause();
    112117    }
    113118   
     
    136141    }
    137142
    138     void AmbientSound::changedActivity() 
     143    void AmbientSound::changedActivity()
    139144    {
    140145        SUPER(AmbientSound, changedActivity);
  • code/branches/presentation2/src/orxonox/sound/BaseSound.cc

    r6307 r6320  
    221221            alSourcePause(this->audioSource_);
    222222    }
     223   
     224    void BaseSound::stateChanged()
     225    {
     226        CCOUT(0) << "changed state to " << this->state_ << endl;
     227        switch( this->state_ )
     228        {
     229            case Playing:
     230                this->play();
     231                break;
     232            case Paused:
     233                this->pause();
     234                break;
     235            case Stopped:
     236            default:
     237                this->stop();
     238                break;
     239        }
     240    }
    223241}
  • code/branches/presentation2/src/orxonox/sound/BaseSound.h

    r6307 r6320  
    5959        virtual void pause();
    6060
    61         bool isPlaying() { return this->state_ == Playing; }
    62         bool isPaused()  { return this->state_ == Paused; }
    63         bool isStopped() { return this->state_ == Stopped; }
     61        bool isPlaying() const { return this->state_ == Playing; }
     62        bool isPaused()  const { return this->state_ == Paused; }
     63        bool isStopped() const { return this->state_ == Stopped; }
    6464
    6565        void setPlaying(bool val)
     
    8484        void setPitch(float pitch);
    8585        inline void pitchChanged(){ this->setPitch(this->pitch_); }
     86       
     87        void stateChanged();
    8688
    8789        //ALuint getALAudioSource(void);
  • code/branches/presentation2/src/orxonox/sound/WorldSound.cc

    r6307 r6320  
    6060        registerVariable(source_, ObjectDirection::ToClient, new NetworkCallback<BaseSound>(static_cast<BaseSound*>(this), &BaseSound::sourceChanged));
    6161        registerVariable(bLooping_, ObjectDirection::ToClient, new NetworkCallback<BaseSound>(static_cast<BaseSound*>(this), &BaseSound::loopingChanged));
    62         registerVariable((int&)(BaseSound::state_), ObjectDirection::ToClient);
     62        registerVariable((int&)(BaseSound::state_), ObjectDirection::ToClient, new NetworkCallback<BaseSound>(static_cast<BaseSound*>(this), &BaseSound::stateChanged));
    6363        registerVariable(pitch_, ObjectDirection::ToClient, new NetworkCallback<BaseSound>(static_cast<BaseSound*>(this), &BaseSound::pitchChanged));
    6464    }
Note: See TracChangeset for help on using the changeset viewer.