Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9889 for code/branches


Ignore:
Timestamp:
Dec 9, 2013, 4:06:38 PM (11 years ago)
Author:
thiweber
Message:

A few changes..

Location:
code/branches/sfxThilo
Files:
32 edited

Legend:

Unmodified
Added
Removed
  • code/branches/sfxThilo/data/defaultConfig/keybindings.ini

    r9526 r9889  
    5858KeyLeftWindows=
    5959KeyLessThan=
    60 KeyM=
     60KeyM="WorldAmbientSound nextsong"
    6161KeyMail=
    6262KeyMediaSelect=
  • code/branches/sfxThilo/data/levels/Spacerace2.oxw

    r9348 r9889  
    1414
    1515?>
     16<WorldAmbientSound source="Ganymede.ogg" looping="true" playOnLoad="true" />
     17
    1618
    1719<?lua
  • code/branches/sfxThilo/data/levels/asteroidField.oxw

    r9348 r9889  
    1111  include("templates/lodInformation.oxt")
    1212?>
     13<WorldAmbientSound source="Asteroid_rocks.ogg" looping="true" playOnLoad="true" />
    1314
    1415<?lua
  • code/branches/sfxThilo/data/levels/asteroids.oxw

    r9348 r9889  
    55 screenshot = "asteroids.png"
    66/>
     7<WorldAmbientSound source="Asteroid_rocks.ogg" looping="true" playOnLoad="true" />
    78
    89<?lua
  • code/branches/sfxThilo/data/levels/dynamicMatch.oxw

    r9348 r9889  
    55 screenshot = "dynamicMatch.png"
    66/>
     7<WorldAmbientSound source="Mars.ogg" looping="true" playOnLoad="true" />
    78
    89<?lua
  • code/branches/sfxThilo/data/levels/lastManStanding.oxw

    r9555 r9889  
    3232      include("includes/pickups.oxi")
    3333    ?>
     34   
     35    <WorldAmbientSound source="Nebula_metal.ogg" looping="true" playOnLoad="true" />
    3436
    3537<!----- Spawnpoints
  • code/branches/sfxThilo/data/levels/lastTeamStanding.oxw

    r9348 r9889  
    3333      include("includes/pickups.oxi")
    3434    ?>
     35   
     36    <WorldAmbientSound source="Nebula_metal.ogg" looping="true" playOnLoad="true" />
    3537
    3638<Bot />
  • code/branches/sfxThilo/data/levels/lastTeamStandingII.oxw

    r9348 r9889  
    2727    skybox       = "Orxonox/skyBoxBasic"
    2828  >
     29  <WorldAmbientSound source="Nebula_metal.ogg" looping="true" playOnLoad="true" />
     30 
    2931<!-- TODO:
    30321. make collisionshapes bulletproof: -> attach movable entity with dynamic collisionshape within a static collisionshape
  • code/branches/sfxThilo/data/levels/maxim.oxw

    r9664 r9889  
    2525  </templates>
    2626  <?lua include("includes/notifications.oxi") ?>
     27 
     28  <WorldAmbientSound source="Nebula_metal.ogg" looping="true" playOnLoad="true" />
    2729
    2830  <NotificationQueueCEGUI
  • code/branches/sfxThilo/data/levels/pirateAttack.oxw

    r9348 r9889  
    2525    dofile("includes/CuboidSpaceStation.lua")
    2626?>
     27
     28<WorldAmbientSound source="Mars.ogg" looping="true" playOnLoad="true" />
    2729   
    2830<Level
  • code/branches/sfxThilo/data/levels/pong.oxw

    r9720 r9889  
    3535<Template name=pongball>
    3636  <PongBall
    37    defScoreSound = "sounds/Button.ogg"
    38    defBoundarySound = "sounds/Button_press2.ogg">
     37   defScoreSound = "sounds/PlayerWinScore_cut.ogg"
     38   defBatSound = "sounds/Button.ogg"
     39   defBoundarySound = "sounds/Button.ogg">
    3940    <attached>
    4041      <Model mesh="sphere.mesh" scale=2 />
  • code/branches/sfxThilo/data/levels/presentationHS12.oxw

    r9664 r9889  
    486486
    487487<!-- SOUNDS & MUSIC -->
    488             <WorldSound name="scoreSound" position="-920,0,0" source="sounds/ReadyGo.ogg" >
     488            <WorldSound name="scoreSound" position="-920,0,0" source="sounds/Button.ogg" >
    489489              <events>
    490490                <play>
  • code/branches/sfxThilo/data/levels/spaceRace.oxw

    r9016 r9889  
    2929    skybox       = "Orxonox/skyBoxMoreNebula"
    3030  >
     31 
     32  <WorldAmbientSound source="Ganymede.ogg" looping="true" playOnLoad="true" />
     33 
    3134
    3235    <?lua math.randomseed(98) ?>
  • code/branches/sfxThilo/data/levels/surfaceRace.oxw

    r9348 r9889  
    1010 tags = "gametype"
    1111/>
     12<WorldAmbientSound source="Ganymede.ogg" looping="true" playOnLoad="true" />
    1213
    1314<?lua
  • code/branches/sfxThilo/data/levels/teamBaseMatch.oxw

    r9348 r9889  
    1919>
    2020
     21<WorldAmbientSound source="Jupiter.ogg" looping="true" playOnLoad="true" />
     22
    2123  <templates>
    2224    <Template link=lodtemplate_default />
  • code/branches/sfxThilo/data/levels/teamDeathMatch.oxw

    r9348 r9889  
    2222  </templates>
    2323  <?lua include("includes/notifications.oxi") ?>
     24 
     25  <WorldAmbientSound source="Jupiter.ogg" looping="true" playOnLoad="true" />
    2426
    2527  <Scene
  • code/branches/sfxThilo/data/levels/templates/spaceshipAssff.oxt

    r8860 r9889  
    3737   linearDamping     = 0.7
    3838   angularDamping    = 0.9999999
     39
     40   explosionSound = "sounds/Explosion2.ogg"
    3941  >
    4042    <engines>
     
    8284   defEngineSndNormal = "sounds/Engine_low.ogg"
    8385   defEngineSndBoost = "sounds/Engine_high.ogg"
    84 
     86   
    8587   accelerationfront     = 500
    8688   accelerationbrake     = 500
  • code/branches/sfxThilo/data/levels/underAttack.oxw

    r9348 r9889  
    2020  </templates>
    2121  <?lua include("includes/notifications.oxi") ?>
     22  <WorldAmbientSound source="Jupiter.ogg" looping="true" playOnLoad="true" />
    2223
    2324  <Scene
  • code/branches/sfxThilo/src/modules/pong/PongBall.cc

    r9720 r9889  
    4141#include "PongBat.h"
    4242
    43 #include "sound/WorldSound.h" //Thilo
     43#include "sound/WorldSound.h"
    4444#include "core/XMLPort.h"
    4545
     
    7070        this->registerVariables();
    7171
    72         //Thilo
     72        //initialize sound
    7373        if (GameMode::isMaster())
    7474             {
    7575                 this->defScoreSound_ = new WorldSound(this->getContext());
    76                  this->defScoreSound_->setLooping(false);
     76                 this->defScoreSound_->setVolume(1.0f);
    7777                 this->defBatSound_ = new WorldSound(this->getContext());
    78                  this->defBatSound_->setLooping(false);
     78                 this->defBatSound_->setVolume(0.4f);
    7979                 this->defBoundarySound_ = new WorldSound(this->getContext());
    80                  this->defBoundarySound_->setLooping(false);
     80                 this->defBoundarySound_->setVolume(0.5f);
    8181             }
    8282             else
    8383             {
    8484                 this->defScoreSound_ = 0;
     85                 this->defBatSound_ = 0;
     86                 this->defBoundarySound_ = 0;
    8587             }
    8688    }
     
    101103    }
    102104
    103     //Thilo
     105    //xml port for loading sounds
    104106    void PongBall::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    105107    {
     
    144146        if (position.z > this->fieldHeight_ / 2 || position.z < -this->fieldHeight_ / 2)
    145147        {
    146             // Its velocity in z-direction is inverted (i.e. it bounces off).
     148            defBoundarySound_->play(); //play boundary sound
     149                // Its velocity in z-direction is inverted (i.e. it bounces off).
    147150            velocity.z = -velocity.z;
    148151            // And its position is set as to not overstep the boundary it has just crossed.
     
    169172                    if (fabs(distance) <= 1) // If the bat is there to parry.
    170173                    {
    171                         // Set the ball to be exactly at the boundary.
     174                        defBatSound_->play(); //play bat sound
     175                        // Set the ball to be exactly at the boundary.
    172176                        position.x = this->fieldWidth_ / 2;
    173177                        // Invert its velocity in x-direction (i.e. it bounces off).
     
    182186                    else if (GameMode::isMaster() && position.x > this->fieldWidth_ / 2 * (1 + this->relMercyOffset_))
    183187                    {
    184                         defScoreSound_->play();//Thilo
     188                        defScoreSound_->play();//play score sound
    185189                        if (this->getGametype() && this->bat_[0])
    186190                        {
     
    197201                    if (fabs(distance) <= 1) // If the bat is there to parry.
    198202                    {
    199                         // Set the ball to be exactly at the boundary.
     203                        defBatSound_->play(); //play bat sound
     204                        // Set the ball to be exactly at the boundary.
    200205                        position.x = -this->fieldWidth_ / 2;
    201206                        // Invert its velocity in x-direction (i.e. it bounces off).
     
    210215                    else if (GameMode::isMaster() && position.x < -this->fieldWidth_ / 2 * (1 + this->relMercyOffset_))
    211216                    {
    212                         defScoreSound_->play();//Thilo
     217                        defScoreSound_->play();//play score sound
    213218                        if (this->getGametype() && this->bat_[1])
    214219                        {
  • code/branches/sfxThilo/src/modules/pong/PongBall.h

    r9720 r9889  
    126126            static const float MAX_REL_Z_VELOCITY;
    127127
    128             void setDefScoreSound(const std::string& engineSound); //Thilo
    129             const std::string& getDefScoreSound(); //Thilo
     128            void setDefScoreSound(const std::string& engineSound);
     129            const std::string& getDefScoreSound();
     130            void setDefBatSound(const std::string& engineSound);
     131            const std::string& getDefBatSound();
     132            void setDefBoundarySound(const std::string& engineSound);
     133            const std::string& getDefBoundarySound();
    130134
    131135        private:
     
    141145            unsigned int* batID_; //!< The object IDs of the bats, to be able to synchronize them over the network.
    142146            float relMercyOffset_; //!< Offset, that makes the player not loose, when, in all fairness, he would have.
    143             WorldSound* defScoreSound_;//Thilo
     147            WorldSound* defScoreSound_;
     148            WorldSound* defBatSound_;
     149            WorldSound* defBoundarySound_;
    144150    };
    145151}
  • code/branches/sfxThilo/src/orxonox/MoodManager.h

    r9667 r9889  
    5151
    5252        private:
    53             virtual void moodChanged(const std::string& mood) = 0;
     53            virtual bool moodChanged(const std::string& mood) = 0;
    5454
    5555            static void changedMood(const std::string& mood);
  • code/branches/sfxThilo/src/orxonox/items/MultiStateEngine.cc

    r9667 r9889  
    6161            this->defEngineSndNormal_->setLooping(true);
    6262            this->defEngineSndBoost_->setLooping(true);
     63            this->defEngineSndNormal_->setVolume(0.8f);
     64            this->defEngineSndBoost_->setVolume(0.5f);
    6365            this->lua_ = new LuaState();
    6466        }
  • code/branches/sfxThilo/src/orxonox/sound/AmbientSound.cc

    r8861 r9889  
    7979    }
    8080
    81     void AmbientSound::setAmbientSource(const std::string& source)
     81    bool AmbientSound::setAmbientSource(const std::string& source)
    8282    {
    8383        this->ambientSource_ = source;
    84         this->moodChanged(MoodManager::getInstance().getMood());
     84        return(this->moodChanged(MoodManager::getInstance().getMood()));
    8585    }
    8686
    87     void AmbientSound::moodChanged(const std::string& mood)
     87    bool AmbientSound::moodChanged(const std::string& mood)
    8888    {
    8989        if (GameMode::playsSound())
     
    9595                orxout(user_info) << "Loading ambient sound " << path << "..." << endl; // TODO: make this output internal if we implement sound streaming
    9696                this->setSource(path);
     97
     98                // all went fine
     99                return true;
    97100            }
    98101            else
    99102            {
    100103                orxout(internal_warning, context::sound) << this->ambientSource_ << ": Not a valid name! Ambient sound will not change." << endl;
     104
     105                // everything went southways
     106                return false;
    101107            }
    102108        }
     109        return false;
    103110    }
    104111
  • code/branches/sfxThilo/src/orxonox/sound/AmbientSound.h

    r7856 r9889  
    5454        void pause();
    5555
    56         void setAmbientSource(const std::string& source);
     56        bool setAmbientSource(const std::string& source);
    5757        inline const std::string& getAmbientSource() const
    5858            { return this->ambientSource_; }
     
    6868        void preDestroy();
    6969        float getRealVolume();
    70         void moodChanged(const std::string& mood);
     70        bool moodChanged(const std::string& mood);
    7171        inline void ambientSourceChanged()
    7272            { this->setAmbientSource(this->ambientSource_); }
  • code/branches/sfxThilo/src/orxonox/sound/BaseSound.cc

    r9667 r9889  
    4747    BaseSound::BaseSound()
    4848        : bPooling_(false)
    49         , volume_(1.0)
     49        , volume_(0.7)
    5050        , bLooping_(false)
    5151        , state_(Stopped)
  • code/branches/sfxThilo/src/orxonox/sound/SoundManager.cc

    r9667 r9889  
    218218            .description("Defines the overall volume.")
    219219            .callback(this, &SoundManager::checkSoundVolumeValidity);
    220         SetConfigValueAlias(volume_[SoundType::Music], "ambientVolume_", 1.0f)
     220        SetConfigValueAlias(volume_[SoundType::Music], "ambientVolume_", 0.7f)
    221221            .description("Defines the ambient volume.")
    222222            .callback(this, &SoundManager::checkAmbientVolumeValidity);
  • code/branches/sfxThilo/src/orxonox/sound/WorldAmbientSound.cc

    r9667 r9889  
    3333#include "core/XMLPort.h"
    3434#include "AmbientSound.h"
     35#include "core/command/ConsoleCommand.h"
     36#include <exception>
     37
    3538
    3639namespace orxonox
    3740{
     41        SetConsoleCommand("WorldAmbientSound", "nextsong",      &WorldAmbientSound::nextSong);
     42
    3843    RegisterClass(WorldAmbientSound);
    3944
     
    4449        this->ambientSound_ = new AmbientSound();
    4550        this->registerVariables();
     51        soundList_.push_back("Earth.ogg");
     52        soundList_.push_back("Jupiter.ogg");
     53        soundList_.push_back("Mars.ogg");
     54        soundList_.push_back("allgorythm-lift_up.ogg");
     55        soundList_.push_back("allgorythm-resonance_blaster.ogg");
     56        soundList_.push_back("AlphaCentauri.ogg");
     57        soundList_.push_back("Asteroid_rocks.ogg");
     58        soundList_.push_back("Ganymede.ogg");
     59        soundList_.push_back("luke_grey_-_hypermode.ogg");
     60
    4661    }
    47 
    4862    WorldAmbientSound::~WorldAmbientSound()
    4963    {
     
    5165        {
    5266            this->ambientSound_->destroy();
     67            WorldAmbientSound::soundList_.clear();
    5368        }
    5469    }
     
    94109            this->ambientSound_->stop();
    95110    }
     111
     112    void WorldAmbientSound::nextSong()
     113    {
     114
     115        //HACK: Assuption - there is only one WorldAmbientSound in a level and only one level is used.
     116        for (ObjectList<WorldAmbientSound>::iterator it = ObjectList<WorldAmbientSound>::begin();
     117             it != ObjectList<WorldAmbientSound>::end(); ++it)
     118        {
     119                while(it->ambientSound_->setAmbientSource(WorldAmbientSound::soundList_[WorldAmbientSound::soundNumber_]) == false){
     120                        WorldAmbientSound::soundNumber_ = (WorldAmbientSound::soundNumber_ + 1) % WorldAmbientSound::soundList_.size();
     121                }
     122                WorldAmbientSound::soundNumber_ = (WorldAmbientSound::soundNumber_ + 1) % WorldAmbientSound::soundList_.size();
     123        }
     124    }
    96125}
  • code/branches/sfxThilo/src/orxonox/sound/WorldAmbientSound.h

    r9667 r9889  
    3434#include "core/BaseObject.h"
    3535#include "network/synchronisable/Synchronisable.h"
     36#include <string>
     37#include <vector>
     38
    3639
    3740namespace orxonox
     
    5457            void play();
    5558
     59            //This function changes the current ambient song.
     60            //You can call nextSong() active in the level
     61            //by pressing the key 'M'.
     62            static void nextSong();
     63
    5664        private:
    5765            void registerVariables();
    5866
     67            //Vector with the diffrent available level sounds.
     68            //The sound names are pushed in the WorldAmbientSound-constructor.
     69            static std::vector<std::string> soundList_;
     70
     71            // This value will be initialized below, don't make this into
     72            // a const, since we want to change it in nextSong().
     73            static int soundNumber_;
     74
     75
    5976            AmbientSound* ambientSound_;
    6077    };
     78
     79    // This is an initialization for the soundnumber variable. Since it is
     80    // static, we have to initialize it this way.
     81    int WorldAmbientSound::soundNumber_ = 0;
     82    std::vector<std::string> WorldAmbientSound::soundList_;
     83
    6184}
    6285
  • code/branches/sfxThilo/src/orxonox/sound/WorldSound.cc

    r9667 r9889  
    8181            alSourcef(this->audioSource_, AL_REFERENCE_DISTANCE, refDist);
    8282            // TODO: 500 is very magical here. Derive something better
    83             alSourcef(this->audioSource_, AL_MAX_DISTANCE, refDist * 500);
     83            alSourcef(this->audioSource_, AL_MAX_DISTANCE, refDist * 20);
    8484        }
    8585        this->tick(0); // update position, orientation and velocity
  • code/branches/sfxThilo/src/orxonox/weaponsystem/WeaponMode.cc

    r9667 r9889  
    7979            this->defSndWpnFire_ = new WorldSound(this->getContext());
    8080            this->defSndWpnFire_->setLooping(false);
     81            this->defSndWpnFire_->setVolume(0.8f);
    8182            this->bSoundAttached_ = false;
    8283        }
  • code/branches/sfxThilo/src/orxonox/worldentities/pawns/Pawn.cc

    r9667 r9889  
    4646#include "weaponsystem/WeaponPack.h"
    4747#include "weaponsystem/WeaponSet.h"
     48#include "sound/WorldSound.h"
    4849
    4950#include "controllers/FormationController.h"
     
    100101
    101102        this->setSyncMode(ObjectDirection::Bidirectional); // needed to synchronise e.g. aimposition
     103
     104        if (GameMode::isMaster())
     105        {
     106            this->explosionSound_ = new WorldSound(this->getContext());
     107            this->explosionSound_->setVolume(1.0f);
     108        }
     109        else
     110        {
     111            this->explosionSound_ = 0;
     112        }
    102113    }
    103114
     
    109120                this->weaponSystem_->destroy();
    110121        }
     122
    111123    }
    112124
     
    135147        XMLPortParam(Pawn, "reloadwaittime", setReloadWaitTime, getReloadWaitTime, xmlelement, mode).defaultValues(1.0f);
    136148
     149        XMLPortParam(Pawn, "explosionSound",  setExplosionSound,  getExplosionSound,  xmlelement, mode);
     150
    137151        XMLPortParam ( RadarViewable, "radarname", setRadarName, getRadarName, xmlelement, mode );
    138152    }
     153
    139154
    140155    void Pawn::registerVariables()
     
    290305    void Pawn::kill()
    291306    {
    292         this->damage(this->health_);
     307        this->damage(this->health_);
    293308        this->death();
    294309    }
     
    314329        if (this->getGametype() && this->getGametype()->allowPawnDeath(this, this->lastHitOriginator_))
    315330        {
    316             // Set bAlive_ to false and wait for PawnManager to do the destruction
     331            explosionSound_->play();
     332                // Set bAlive_ to false and wait for PawnManager to do the destruction
    317333            this->bAlive_ = false;
    318334
     
    527543
    528544
     545    void Pawn::setExplosionSound(const std::string &explosionSound)
     546    {
     547        if(explosionSound_ )
     548            explosionSound_->setSource(explosionSound);
     549        else
     550            assert(0); // This should never happen, because soundpointer is only available on master
     551    }
     552
     553    const std::string& Pawn::getExplosionSound()
     554    {
     555        if( explosionSound_ )
     556            return explosionSound_->getSource();
     557        else
     558            assert(0);
     559        return BLANKSTRING;
     560    }
     561
    529562
    530563}
  • code/branches/sfxThilo/src/orxonox/worldentities/pawns/Pawn.h

    r9667 r9889  
    3636#include "interfaces/RadarViewable.h"
    3737#include "worldentities/ControllableEntity.h"
     38
    3839
    3940namespace orxonox // tolua_export
     
    178179            virtual void changedVisibility();
    179180
     181            void setExplosionSound(const std::string& engineSound);
     182            const std::string& getExplosionSound();
     183
    180184        protected:
    181185            virtual void preDestroy();
     
    231235
    232236            Vector3 aimPosition_;
     237
     238            WorldSound* explosionSound_;
     239
    233240    }; // tolua_export
    234241} // tolua_export
Note: See TracChangeset for help on using the changeset viewer.