Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 12, 2009, 11:58:01 PM (15 years ago)
Author:
rgrieder
Message:

Merged most of the core4 revisions back to the trunk except for:

  • orxonox_cast
  • all the radical changes in the input library
Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/objects/worldentities/Light.cc

    r3205 r3280  
    3333#include <boost/static_assert.hpp>
    3434
    35 #include "util/String.h"
     35#include "util/StringUtils.h"
    3636#include "util/Exception.h"
    3737#include "core/CoreIncludes.h"
     
    4545
    4646    // Be sure we don't do bad conversions
    47     BOOST_STATIC_ASSERT((int)Ogre::Light::LT_POINT       == (int)Light::LT_POINT);
    48     BOOST_STATIC_ASSERT((int)Ogre::Light::LT_DIRECTIONAL == (int)Light::LT_DIRECTIONAL);
    49     BOOST_STATIC_ASSERT((int)Ogre::Light::LT_SPOTLIGHT   == (int)Light::LT_SPOTLIGHT);
     47    BOOST_STATIC_ASSERT((int)Ogre::Light::LT_POINT       == (int)Light::Point);
     48    BOOST_STATIC_ASSERT((int)Ogre::Light::LT_DIRECTIONAL == (int)Light::Directional);
     49    BOOST_STATIC_ASSERT((int)Ogre::Light::LT_SPOTLIGHT   == (int)Light::Spotlight);
    5050
    5151    Light::Light(BaseObject* creator) : StaticEntity(creator)
     
    5656        this->diffuse_ = ColourValue::White;
    5757        this->specular_ = ColourValue::White;
    58         this->type_ = Light::LT_POINT;
     58        this->type_ = Light::Point;
    5959        this->attenuation_ = Vector4(100000, 1, 0, 0);
    6060        this->spotlightRange_ = Vector3(40.0f, 30.0f, 1.0f);
     
    106106    void Light::registerVariables()
    107107    {
    108         registerVariable((int&)this->type_,     variableDirection::toclient, new NetworkCallback<Light>(this, &Light::updateType));
    109         registerVariable(this->diffuse_,        variableDirection::toclient, new NetworkCallback<Light>(this, &Light::updateDiffuseColour));
    110         registerVariable(this->specular_,       variableDirection::toclient, new NetworkCallback<Light>(this, &Light::updateSpecularColour));
    111         registerVariable(this->attenuation_,    variableDirection::toclient, new NetworkCallback<Light>(this, &Light::updateAttenuation));
    112         registerVariable(this->spotlightRange_, variableDirection::toclient, new NetworkCallback<Light>(this, &Light::updateSpotlightRange));
     108        registerVariable((int&)this->type_,     VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateType));
     109        registerVariable(this->diffuse_,        VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateDiffuseColour));
     110        registerVariable(this->specular_,       VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateSpecularColour));
     111        registerVariable(this->attenuation_,    VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateAttenuation));
     112        registerVariable(this->spotlightRange_, VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateSpotlightRange));
    113113    }
    114114
     
    127127    void Light::updateAttenuation()
    128128    {
    129         if (this->light_ && this->type_ != Light::LT_DIRECTIONAL)
     129        if (this->light_ && this->type_ != Light::Directional)
    130130            this->light_->setAttenuation(this->attenuation_.x, this->attenuation_.y, this->attenuation_.z, this->attenuation_.w);
    131131    }
     
    133133    void Light::updateSpotlightRange()
    134134    {
    135         if (this->light_ && this->type_ == Light::LT_SPOTLIGHT)
     135        if (this->light_ && this->type_ == Light::Spotlight)
    136136            this->light_->setSpotlightRange(Degree(this->spotlightRange_.x), Degree(this->spotlightRange_.y), this->spotlightRange_.z);
    137137    }
     
    140140    {
    141141        if (type == "point")
    142             this->setType(Light::LT_POINT);
     142            this->setType(Light::Point);
    143143        else if (type == "directional")
    144             this->setType(Light::LT_DIRECTIONAL);
     144            this->setType(Light::Directional);
    145145        else if (type == "spotlight")
    146             this->setType(Light::LT_SPOTLIGHT);
     146            this->setType(Light::Spotlight);
    147147        else
    148             this->setType(Light::LT_POINT);
     148            this->setType(Light::Point);
    149149    }
    150150
     
    153153        switch (this->type_)
    154154        {
    155             case Light::LT_DIRECTIONAL:
     155            case Light::Directional:
    156156                return "directional";
    157             case Light::LT_SPOTLIGHT:
     157            case Light::Spotlight:
    158158                return "spotlight";
    159             case Light::LT_POINT:
     159            case Light::Point:
    160160            default:
    161161                return "point";
     
    169169            this->light_->setType(static_cast<Ogre::Light::LightTypes>(this->type_));
    170170
    171             if (this->type_ != Light::LT_DIRECTIONAL)
     171            if (this->type_ != Light::Directional)
    172172                this->updateAttenuation();
    173             if (this->type_ == Light::LT_SPOTLIGHT)
     173            if (this->type_ == Light::Spotlight)
    174174                this->updateSpotlightRange();
    175175        }
Note: See TracChangeset for help on using the changeset viewer.