Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1260


Ignore:
Timestamp:
May 12, 2008, 7:08:58 PM (16 years ago)
Author:
rgrieder
Message:
  • moved variable initialisation of class hierarchy members into initialiser list
  • added windowClosed (Ogre::WindowEventUtilities::WindowEventListener) event to GraphicsEngine
Location:
code/branches/ogre/src
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ogre/src/core/BaseObject.cc

    r1209 r1260  
    4545        @brief Constructor: Registers the object in the BaseObject-list.
    4646    */
    47     BaseObject::BaseObject()
     47    BaseObject::BaseObject() :
     48      bActive_(true),
     49      bVisible_(true),
     50      level_(0),
     51      namespace_(0)
    4852    {
    4953        RegisterRootObject(BaseObject);
    50 
    51         this->bActive_ = true;
    52         this->bVisible_ = true;
    53         this->level_ = 0;
    54         this->namespace_ = 0;
    5554    }
    5655
  • code/branches/ogre/src/core/Error.cc

    r1062 r1260  
    3737namespace orxonox
    3838{
    39         Error::Error()
    40         {
    41                 Error(0,"");
    42         }
    43 
    4439        Error::Error(std::string errorMsg, int errorCode)
    45         {
    46                 Error(errorCode, errorMsg);
    47         }
    48 
    49         Error::Error(int errorCode, std::string errorMsg)
    5040        {
    5141                COUT(1) << "############################ "<< std::endl
  • code/branches/ogre/src/core/Error.h

    r1062 r1260  
    4444        {
    4545        public:
    46                 Error();
    47                 Error(std::string errorMsg, int errorCode = 0);
    48                 Error(int errorCode, std::string errorMsg = "");
     46                Error(std::string errorMsg = "", int errorCode = 0);
    4947        private:
    5048
  • code/branches/ogre/src/core/Namespace.cc

    r1062 r1260  
    3737    CreateFactory(Namespace);
    3838
    39     Namespace::Namespace()
     39    Namespace::Namespace() :
     40      bAutogeneratedFileRootNamespace_(false),
     41      bRoot_(false),
     42      operator_("or")
    4043    {
    4144        RegisterObject(Namespace);
    42 
    43         this->bAutogeneratedFileRootNamespace_ = false;
    44         this->bRoot_ = false;
    45         this->operator_ = "or";
    4645    }
    4746
  • code/branches/ogre/src/core/OrxonoxClass.cc

    r1056 r1260  
    3737{
    3838    /** @brief Constructor: Sets the default values. */
    39     OrxonoxClass::OrxonoxClass()
     39    OrxonoxClass::OrxonoxClass() :
     40      identifier_(0),
     41      parents_(0)
    4042    {
    4143        this->setConfigValues();
    42 
    43         this->identifier_ = 0;
    44         this->parents_ = 0;
    4544    }
    4645
  • code/branches/ogre/src/orxonox/GraphicsEngine.cc

    r1252 r1260  
    4444#include "core/ConfigValueIncludes.h"
    4545#include "core/Debug.h"
     46#include "core/CommandExecutor.h"
    4647
    4748
     
    138139    // create a logManager
    139140    Ogre::LogManager *logger;
    140                 if (Ogre::LogManager::getSingletonPtr() == 0)
    141                         logger = new Ogre::LogManager();
     141    if (Ogre::LogManager::getSingletonPtr() == 0)
     142      logger = new Ogre::LogManager();
    142143    else
    143144      logger = Ogre::LogManager::getSingletonPtr();
     
    222223    {
    223224      Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
    224       Ogre::StringVector str = Ogre::ResourceGroupManager::getSingleton().getResourceGroups();
     225      /*Ogre::StringVector str = Ogre::ResourceGroupManager::getSingleton().getResourceGroups();
    225226      for (unsigned int i = 0; i < str.size(); i++)
    226227      {
    227228        Ogre::ResourceGroupManager::getSingleton().loadResourceGroup(str[i]);
    228       }
     229      }*/
    229230    }
    230231    catch (Ogre::Exception e)
     
    325326  }
    326327
    327     void GraphicsEngine::windowMoved(Ogre::RenderWindow *rw){
    328         int w = rw->getWidth();
    329         int h = rw->getHeight();
    330         InputManager::setWindowExtents(w, h);
    331     }
    332 
    333     void GraphicsEngine::windowResized(Ogre::RenderWindow *rw){
    334         int w = rw->getWidth();
    335         int h = rw->getHeight();
    336         InputManager::setWindowExtents(w, h);
    337     }
    338 
    339     void GraphicsEngine::windowFocusChanged(Ogre::RenderWindow *rw){
    340         int w = rw->getWidth();
    341         int h = rw->getHeight();
    342         InputManager::setWindowExtents(w, h);
    343     }
     328  /**
     329  * Window has resized.
     330  * @param rw The render window it occured in
     331  */
     332  void GraphicsEngine::windowMoved(Ogre::RenderWindow *rw)
     333  {
     334    // note: this doesn't change the window extents
     335  }
     336
     337  /**
     338  * Window has resized.
     339  * @param rw The render window it occured in
     340  * @note GraphicsEngine has a render window stored itself. This is the same
     341  *       as rw. But we have to be careful when using multiple render windows!
     342  */
     343  void GraphicsEngine::windowResized(Ogre::RenderWindow *rw)
     344  {
     345    // change the mouse clipping size for absolute mouse movements
     346    int w = rw->getWidth();
     347    int h = rw->getHeight();
     348    InputManager::setWindowExtents(w, h);
     349  }
     350
     351  /**
     352  * Window has resized.
     353  * @param rw The render window it occured in
     354  */
     355  void GraphicsEngine::windowFocusChanged(Ogre::RenderWindow *rw)
     356  {
     357    // note: this doesn't change the window extents
     358  }
     359
     360  /**
     361  * Window has resized.
     362  * @param rw The render window it occured in
     363  */
     364  void GraphicsEngine::windowClosed(Ogre::RenderWindow *rw)
     365  {
     366    // using CommandExecutor in order to avoid depending on Orxonox class.
     367    CommandExecutor::execute("exit", false);
     368  }
    344369}
  • code/branches/ogre/src/orxonox/GraphicsEngine.h

    r1249 r1260  
    7373            int getWindowHeight() const;
    7474
    75             void windowMoved(Ogre::RenderWindow* rw);
    76             void windowResized(Ogre::RenderWindow* rw);
     75            void windowMoved       (Ogre::RenderWindow* rw);
     76            void windowResized     (Ogre::RenderWindow* rw);
    7777            void windowFocusChanged(Ogre::RenderWindow* rw);
     78            void windowClosed      (Ogre::RenderWindow* rw);
    7879
    7980            static GraphicsEngine& getSingleton();
  • code/branches/ogre/src/orxonox/OrxonoxPlatform.h

    r1064 r1260  
    2121 *
    2222 *   Author:
    23  *      An unknown man from the Ogre development crew
     23 *      ...
    2424 *   Co-authors:
    2525 *      Reto Grieder
  • code/branches/ogre/src/orxonox/objects/Explosion.cc

    r1243 r1260  
    4545    CreateFactory(Explosion);
    4646
    47     Explosion::Explosion(WorldEntity* owner)
     47    Explosion::Explosion(WorldEntity* owner) :
     48      particle_(0),
     49      lifetime_(0.4)
    4850    {
    49         this->particle_ = 0;
    50         this->lifetime_ = 0.4;
    51 
    5251        RegisterObject(Explosion);
    5352
  • code/branches/ogre/src/orxonox/objects/Model.cc

    r1209 r1260  
    4949    }
    5050
    51     void Model::loadParams(TiXmlElement* xmlElem)
    52     {
    53         WorldEntity::loadParams(xmlElem);
    54 
    55         if (xmlElem->Attribute("mesh"))
    56         {
    57             meshSrc_ = xmlElem->Attribute("mesh");
    58         }
    59         create();
    60     }
    61 
    6251    /**
    6352        @brief XML loading and saving.
  • code/branches/ogre/src/orxonox/objects/Model.h

    r1056 r1260  
    4343            Model();
    4444            virtual ~Model();
    45             virtual void loadParams(TiXmlElement* xmlElem);
    4645            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    4746            void setMesh(const std::string& meshname);
  • code/branches/ogre/src/orxonox/objects/NPC.cc

    r1056 r1260  
    3636  CreateFactory(NPC);
    3737
    38   NPC::NPC()
     38  NPC::NPC() :
     39    movable_(true)
    3940  {
    4041    RegisterObject(NPC);
    41     movable_ = true;
    4242  }
    4343
  • code/branches/ogre/src/orxonox/objects/Projectile.cc

    r1056 r1260  
    4242    CreateFactory(Projectile);
    4343
    44     Projectile::Projectile(SpaceShip* owner)
     44    Projectile::Projectile(SpaceShip* owner) :
     45      owner_(owner)
    4546    {
    4647        RegisterObject(Projectile);
    4748
    4849        this->setConfigValues();
    49 
    50         this->owner_ = owner;
    5150
    5251        this->billboard_.setBillboardSet("Examples/Flare", ColourValue(1.0, 1.0, 0.5), 1);
  • code/branches/ogre/src/orxonox/objects/WorldEntity.cc

    r1243 r1260  
    4545    unsigned int WorldEntity::worldEntityCounter_s = 0;
    4646
    47     WorldEntity::WorldEntity()
     47    WorldEntity::WorldEntity() :
     48      velocity_    (0, 0, 0),
     49      acceleration_(0, 0, 0),
     50      rotationAxis_(0, 1, 0),
     51      rotationRate_(0),
     52      momentum_    (0),
     53      node_        (0),
     54      bStatic_     (true)
    4855    {
    49         this->bStatic_ = true;
    50         this->velocity_ = Vector3(0, 0, 0);
    51         this->acceleration_ = Vector3(0, 0, 0);
    52         this->rotationAxis_ = Vector3(0, 1, 0);
    53         this->rotationRate_ = 0;
    54         this->momentum_ = 0;
    55 
    5656        RegisterObject(WorldEntity);
    5757
     
    6464
    6565          registerAllVariables();
    66         }
    67         else
    68         {
    69           this->node_ = 0;
    7066        }
    7167    }
     
    9288        BaseObject::loadParams(xmlElem);
    9389        create();
    94 /*
    95         if (xmlElem->Attribute("position"))
    96         {
    97             std::vector<std::string> pos = tokenize(xmlElem->Attribute("position"),",");
    98             float x, y, z;
    99             String2Number<float>(x, pos[0]);
    100             String2Number<float>(y, pos[1]);
    101             String2Number<float>(z, pos[2]);
    102             this->setPosition(x, y, z);
    103         }
    104 
    105         if (xmlElem->Attribute("direction"))
    106         {
    107             std::vector<std::string> pos = tokenize(xmlElem->Attribute("direction"),",");
    108             float x, y, z;
    109             String2Number<float>(x, pos[0]);
    110             String2Number<float>(y, pos[1]);
    111             String2Number<float>(z, pos[2]);
    112             this->setDirection(x, y, z);
    113         }
    114 
    115         if (xmlElem->Attribute("yaw") || xmlElem->Attribute("pitch") || xmlElem->Attribute("roll"))
    116         {
    117             float yaw = 0.0, pitch = 0.0, roll = 0.0;
    118             if (xmlElem->Attribute("yaw"))
    119                 String2Number<float>(yaw,xmlElem->Attribute("yaw"));
    120 
    121             if (xmlElem->Attribute("pitch"))
    122                 String2Number<float>(pitch,xmlElem->Attribute("pitch"));
    123 
    124             if (xmlElem->Attribute("roll"))
    125                 String2Number<float>(roll,xmlElem->Attribute("roll"));
    126 
    127             this->yaw(Degree(yaw));
    128             this->pitch(Degree(pitch));
    129             this->roll(Degree(roll));
    130         }
    131 
    132         if (xmlElem->Attribute("scale"))
    133         {
    134             std::string scaleStr = xmlElem->Attribute("scale");
    135             float scale;
    136             String2Number<float>(scale, scaleStr);
    137             this->setScale(scale);
    138         }
    139 
    140         if (xmlElem->Attribute("rotationAxis"))
    141         {
    142             std::vector<std::string> pos = tokenize(xmlElem->Attribute("rotationAxis"),",");
    143             float x, y, z;
    144             String2Number<float>(x, pos[0]);
    145             String2Number<float>(y, pos[1]);
    146             String2Number<float>(z, pos[2]);
    147             this->setRotationAxis(x, y, z);
    148         }
    149 
    150         if (xmlElem->Attribute("rotationRate"))
    151         {
    152             float rotationRate;
    153             String2Number<float>(rotationRate, xmlElem->Attribute("rotationRate"));
    154             this->setRotationRate(Degree(rotationRate));
    155             if (rotationRate != 0)
    156                 this->setStatic(false);
    157         }
    158 
    159         create();
    160 */
    16190    }
    16291
Note: See TracChangeset for help on using the changeset viewer.