Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6501


Ignore:
Timestamp:
Mar 11, 2010, 11:32:01 AM (15 years ago)
Author:
rgrieder
Message:

Ensured OGRE v1.7 "Cthugha" code compatibility. Does not yet seem to run run though.

Location:
code/trunk/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/core/Resource.cc

    r6417 r6501  
    7979        }
    8080        Ogre::FileInfoListPtr infos = Ogre::ResourceGroupManager::getSingleton().findResourceFileInfo(group, name);
    81         for (std::vector<Ogre::FileInfo>::const_iterator it = infos->begin(); it != infos->end(); ++it)
     81        for (Ogre::FileInfoList::const_iterator it = infos->begin(); it != infos->end(); ++it)
    8282        {
    8383            if (it->filename == name)
  • code/trunk/src/modules/objects/Planet.cc

    r5929 r6501  
    9191        float scaleFactor = this->getScale();
    9292
    93         this->distList.push_back(10.0f*scaleFactor);
    94         this->distList.push_back(19.0f*scaleFactor);
    95         this->distList.push_back(27.0f*scaleFactor);
    96         this->distList.push_back(34.0f*scaleFactor);
    97         this->distList.push_back(40.0f*scaleFactor);
    98         this->distList.push_back(45.0f*scaleFactor);
    99         this->distList.push_back(49.0f*scaleFactor);
    100         this->distList.push_back(52.0f*scaleFactor);
    101         this->distList.push_back(54.0f*scaleFactor);
    102         this->distList.push_back(55.0f*scaleFactor);
     93#if OGRE_VERSION >= 0x010700
     94        Ogre::Mesh::LodValueList distList;
     95#else
     96        Ogre::Mesh::LodDistanceList distList;
     97#endif
     98
     99        distList.push_back(10.0f*scaleFactor);
     100        distList.push_back(19.0f*scaleFactor);
     101        distList.push_back(27.0f*scaleFactor);
     102        distList.push_back(34.0f*scaleFactor);
     103        distList.push_back(40.0f*scaleFactor);
     104        distList.push_back(45.0f*scaleFactor);
     105        distList.push_back(49.0f*scaleFactor);
     106        distList.push_back(52.0f*scaleFactor);
     107        distList.push_back(54.0f*scaleFactor);
     108        distList.push_back(55.0f*scaleFactor);
    103109
    104110        float reductionValue = 0.2f;
  • code/trunk/src/modules/objects/Planet.h

    r5781 r6501  
    106106            float atmosphereSize;
    107107            float imageSize;
    108             std::vector<float> distList;
    109108            BillboardSet billboard_;
    110109            bool bCastShadows_;
  • code/trunk/src/orxonox/LevelManager.cc

    r6417 r6501  
    132132    void LevelManager::compileAvailableLevelList()
    133133    {
    134         availableLevels_ = *Resource::findResourceNames("*.oxw");
    135         for (std::vector<std::string>::iterator it = availableLevels_.begin(); it != availableLevels_.end();)
    136             if (it->find("old/") == 0)
    137                 it = availableLevels_.erase(it);
    138             else
     134        this->availableLevels_.clear();
     135        Ogre::StringVectorPtr levels = Resource::findResourceNames("*.oxw");
     136        for (Ogre::StringVector::const_iterator it = levels->begin(); it != levels->end(); ++it)
     137        {
     138            if (it->find("old/") != 0)
    139139            {
    140140                size_t pos = it->find(".oxw");
    141                 *it = it->substr(0, pos);
    142                 ++it;
     141                this->availableLevels_.push_back(it->substr(0, pos));
    143142            }
     143        }
    144144    }
    145145}
  • code/trunk/src/orxonox/controllers/NewHumanController.cc

    r6417 r6501  
    366366            {
    367367                // Try to cast the user pointer
    368                 WorldEntity* wePtr = dynamic_cast<WorldEntity*>(itr->movable->getUserObject());
     368                WorldEntity* wePtr = dynamic_cast<WorldEntity*>(Ogre::any_cast<OrxonoxClass*>(itr->movable->getUserAny()));
    369369                if (wePtr)
    370370                {
  • code/trunk/src/orxonox/graphics/Camera.cc

    r6417 r6501  
    6262
    6363        this->camera_ = this->getScene()->getSceneManager()->createCamera(getUniqueNumberString());
    64         this->camera_->setUserObject(this);
     64        static_cast<Ogre::MovableObject*>(this->camera_)->setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(this)));
    6565        this->cameraNode_ = this->getScene()->getRootSceneNode()->createChildSceneNode();
    6666        this->attachNode(this->cameraNode_);
  • code/trunk/src/orxonox/worldentities/WorldEntity.cc

    r6417 r6501  
    474474    {
    475475        this->node_->attachObject(object);
    476         object->setUserObject(this);
     476        object->setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(this)));
    477477    }
    478478
     
    489489    void WorldEntity::detachOgreObject(Ogre::MovableObject* object)
    490490    {
    491         object->setUserObject(NULL);
     491        object->setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(NULL)));
    492492        this->node_->detachObject(object);
    493493    }
  • code/trunk/src/orxonox/worldentities/WorldEntity.h

    r6417 r6501  
    3333#include "OrxonoxPrereqs.h"
    3434
    35 #include <OgreUserDefinedObject.h>
    3635#ifdef ORXONOX_RELEASE
    3736#  include <OgreSceneNode.h>
     
    7069        Collision shapes: These are controlled by the internal WorldEntityCollisionShape. @see WorldEntityCollisionShape.
    7170    */
    72     class _OrxonoxExport WorldEntity : public BaseObject, public Synchronisable, public btMotionState, public Ogre::UserDefinedObject
     71    class _OrxonoxExport WorldEntity : public BaseObject, public Synchronisable, public btMotionState
    7372    {
    7473        friend class Scene;
Note: See TracChangeset for help on using the changeset viewer.