Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 9, 2008, 4:25:52 AM (16 years ago)
Author:
landauf
Message:

merged core3 back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/objects/Ambient.cc

    r1625 r1747  
    3939#include "util/Convert.h"
    4040#include "util/Math.h"
    41 #include "core/Debug.h"
     41#include "util/Debug.h"
    4242#include "core/CoreIncludes.h"
    43 #include "GraphicsEngine.h"
    4443#include "core/XMLPort.h"
    4544#include "core/ConsoleCommand.h"
     45#include "GraphicsEngine.h"
    4646
    4747namespace orxonox
    4848{
    49     SetConsoleCommand(Ambient, setAmbientLightTest, false).setDefaultValues(ColourValue(1, 1, 1, 1)).setAccessLevel(AccessLevel::Offline);
     49    SetConsoleCommandAlias(Ambient, setAmbientLightTest, "setAmbientLight", false).defaultValues(ColourValue(1, 1, 1, 1)).accessLevel(AccessLevel::Offline);
    5050
    5151    CreateFactory(Ambient);
     
    6464    }
    6565
    66     bool Ambient::create(){
    67       GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(ambientLight_);
    68       return Synchronisable::create();
     66    bool Ambient::create()
     67    {
     68        GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(ambientLight_);
     69        return Synchronisable::create();
    6970    }
    70    
    71     void Ambient::registerAllVariables(){
    72       registerVar(&ambientLight_, sizeof(ColourValue), network::DATA);
    73      
     71
     72    void Ambient::registerAllVariables()
     73    {
     74        registerVar(&ambientLight_, sizeof(ColourValue), network::DATA);
    7475    }
    7576
    7677    void Ambient::setAmbientLight(const ColourValue& colour)
    7778    {
    78             GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(colour);
    79       ambientLight_=colour;     
     79        GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(colour);
     80        ambientLight_=colour;
    8081    }
    8182
     
    8889    void Ambient::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    8990    {
    90         BaseObject::XMLPort(xmlelement, mode);
     91        SUPER(Ambient, XMLPort, xmlelement, mode);
    9192
    92         XMLPortParamLoadOnly(Ambient, "colourvalue", setAmbientLight, xmlelement, mode);
     93        XMLPortParam(Ambient, "colourvalue", setAmbientLight, getAmbienetLight, xmlelement, mode);
    9394        create();
    9495    }
Note: See TracChangeset for help on using the changeset viewer.