Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 9, 2008, 4:04:23 AM (17 years ago)
Author:
landauf
Message:

cool shit's happening here… it works! wow. I wonder why, but hey, don't ask, just commit. this update might also be helpful for the network guys.

  • fixed a bug in XMLPort
  • fixed a bug in the MultiTypes
  • implemented some XMLPort functions in Model, SpaceShip, Skybox and Ambient (and of course the WorldEntity), but this is just a workaround as all those classes are more or less just temporary solutions
File:
1 edited

Legend:

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

    r845 r869  
    4040#include "../core/CoreIncludes.h"
    4141#include "../Orxonox.h"
     42#include "core/XMLPort.h"
    4243
    4344#include "Ambient.h"
     
    5859    void Ambient::loadParams(TiXmlElement* xmlElem)
    5960    {
    60         Ogre::SceneManager* mgr = orxonox::Orxonox::getSingleton()->getSceneManager();
    61 
    6261        if (xmlElem->Attribute("colourvalue"))
    6362        {
     
    6968                String2Number<float>(b, colourvalues[2]);
    7069
    71                 mgr->setAmbientLight(ColourValue(r,g,b));
     70                this->setAmbientLight(ColourValue(r, g, b));
    7271
    7372                COUT(4) << "Loader: Set ambient light: "<<r<<" " << g << " " << b  << std::endl << std::endl;
    7473        }
    7574   }
     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    Element& Ambient::XMLPort(Element& xmlelement, bool loading)
     88    {
     89        BaseObject::XMLPort(xmlelement, loading);
     90
     91        XMLPortParamLoadOnly(Ambient, "colourvalue", setAmbientLight, xmlelement, loading);
     92
     93        return xmlelement;
     94    }
    7695}
Note: See TracChangeset for help on using the changeset viewer.