Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 9, 2008, 4:44:36 PM (16 years ago)
Author:
landauf
Message:

merged core branch to trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/objects/Ambient.cc

    r790 r871  
    4040#include "../core/CoreIncludes.h"
    4141#include "../Orxonox.h"
     42#include "core/XMLPort.h"
    4243
    4344#include "Ambient.h"
     
    4546namespace orxonox
    4647{
    47     // create a template instantiations
    48     //template class _OrxonoxExport ClassIdentifier<Ambient>;
    49 
    5048    CreateFactory(Ambient);
    5149
     
    6159    void Ambient::loadParams(TiXmlElement* xmlElem)
    6260    {
    63         Ogre::SceneManager* mgr = orxonox::Orxonox::getSingleton()->getSceneManager();
    64 
    6561        if (xmlElem->Attribute("colourvalue"))
    6662        {
     
    7268                String2Number<float>(b, colourvalues[2]);
    7369
    74                 mgr->setAmbientLight(ColourValue(r,g,b));
     70                this->setAmbientLight(ColourValue(r, g, b));
    7571
    7672                COUT(4) << "Loader: Set ambient light: "<<r<<" " << g << " " << b  << std::endl << std::endl;
    7773        }
    7874   }
     75
     76   void Ambient::setAmbientLight(const ColourValue& colour)
     77   {
     78        Orxonox::getSingleton()->getSceneManager()->setAmbientLight(colour);
     79   }
     80
     81    /**
     82        @brief XML loading and saving.
     83        @param xmlelement The XML-element
     84        @param loading Loading (true) or saving (false)
     85        @return The XML-element
     86    */
     87    void Ambient::XMLPort(Element& xmlelement, bool loading)
     88    {
     89        BaseObject::XMLPort(xmlelement, loading);
     90
     91        XMLPortParamLoadOnly(Ambient, "colourvalue", setAmbientLight, xmlelement, loading);
     92    }
    7993}
Note: See TracChangeset for help on using the changeset viewer.