Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3336


Ignore:
Timestamp:
Jul 23, 2009, 12:15:06 PM (15 years ago)
Author:
rgrieder
Message:

Moved Config value detailLevelParticle from GraphicsManager to ParticleInterface.
The resulting section name problem is to be resolved later. We've got a mess of config values anyway.

Location:
code/branches/resource/src/orxonox
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/resource/src/orxonox/GraphicsManager.cc

    r3327 r3336  
    182182        SetConfigValue(ogreLogLevelCritical_, 2)
    183183            .description("Corresponding orxonox debug level for ogre Critical");
    184         SetConfigValue(detailLevelParticle_, 2)
    185             .description("O: off, 1: low, 2: normal, 3: high").callback(this, &GraphicsManager::detailLevelParticleChanged);
    186     }
    187 
    188     void GraphicsManager::detailLevelParticleChanged()
    189     {
    190         for (ObjectList<ParticleInterface>::iterator it = ObjectList<ParticleInterface>::begin(); it; ++it)
    191             it->detailLevelChanged(this->detailLevelParticle_);
    192184    }
    193185
  • code/branches/resource/src/orxonox/GraphicsManager.h

    r3280 r3336  
    6060        void update(const Clock& time);
    6161
    62         void detailLevelParticleChanged();
    63         inline unsigned int getDetailLevelParticle() const
    64             { return this->detailLevelParticle_; }
    65 
    6662        inline Ogre::Viewport* getViewport()
    6763            { return this->viewport_; }
     
    9995
    10096        // config values
    101         unsigned int        detailLevelParticle_;      //!< Detail level of particle effects (0: off, 1: low, 2: normal, 3: high)
    10297        std::string         resourceFile_;             //!< resources file name
    10398        std::string         ogreConfigFile_;           //!< ogre config file name
  • code/branches/resource/src/orxonox/tools/ParticleInterface.cc

    r3301 r3336  
    4343#include "util/Math.h"
    4444#include "core/CoreIncludes.h"
     45#include "core/ConfigValueIncludes.h"
    4546#include "core/GameMode.h"
    4647#include "GraphicsManager.h"
     
    9192    }
    9293
     94    void ParticleInterface::setConfigValues()
     95    {
     96        SetConfigValue(globalDetailLevel_, 2)
     97            .description("O: off, 1: low, 2: normal, 3: high").callback(this, &ParticleInterface::detailLevelChanged);
     98    }
     99
    93100    Ogre::ParticleEmitter* ParticleInterface::createNewEmitter()
    94101    {
     
    180187        this->detaillevel_ = level;
    181188        if (GameMode::showsGraphics())
    182             this->detailLevelChanged(GraphicsManager::getInstance().getDetailLevelParticle());
    183     }
    184 
    185     void ParticleInterface::detailLevelChanged(unsigned int newlevel)
    186     {
    187         if (newlevel >= static_cast<unsigned int>(this->detaillevel_))
     189            this->detailLevelChanged();
     190    }
     191
     192    void ParticleInterface::detailLevelChanged()
     193    {
     194        if (this->globalDetailLevel_ >= this->detaillevel_)
    188195            this->bAllowedByLOD_ = true;
    189196        else
  • code/branches/resource/src/orxonox/tools/ParticleInterface.h

    r3280 r3336  
    4747            ParticleInterface(Ogre::SceneManager* scenemanager, const std::string& templateName, LODParticle::Value detaillevel);
    4848            virtual ~ParticleInterface();
     49            void setConfigValues();
    4950
    5051            inline Ogre::ParticleSystem* getParticleSystem()
     
    7778                { return this->bVisible_; }
    7879
    79             void detailLevelChanged(unsigned int newlevel);
    8080            void setDetailLevel(unsigned int level);
    8181
     
    9090        private:
    9191            void updateVisibility();
     92            void detailLevelChanged();
    9293
    9394            Ogre::ParticleSystem*     particleSystem_;
     
    9697            bool                      bEnabled_;
    9798            bool                      bAllowedByLOD_;
    98             unsigned int              detaillevel_;     //!< Detail level of this particle effect (0: off, 1: low, 2: normal, 3: high)
     99            unsigned int              detaillevel_;       //!< Detail level of this particle effect (0: off, 1: low, 2: normal, 3: high)
    99100            float                     speedFactor_;
     101
     102            // config values
     103            unsigned int              globalDetailLevel_; //!< Global maximum detail level of particle effects (0: off, 1: low, 2: normal, 3: high)
    100104
    101105            static ParticleInterface* currentParticleInterface_s;
Note: See TracChangeset for help on using the changeset viewer.