Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11129 for code


Ignore:
Timestamp:
Mar 6, 2016, 3:32:26 PM (9 years ago)
Author:
landauf
Message:

orxonox now compiles with ogre 1.9 (but still needs some other changes)

Location:
code/branches/ogre1.9/src
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ogre1.9/src/libraries/util/DisplayStringConversions.h

    r11071 r11129  
    3737
    3838#include "UtilPrereqs.h"
    39 #include <OgreOverlayElement.h>
     39#include <OgrePrerequisites.h>
     40#if OGRE_VERSION >= 0x010900
     41#   include <Overlay/OgreOverlayElement.h>
     42#else
     43#   include <OgreOverlayElement.h>
     44#endif
    4045
    4146#if OGRE_UNICODE_SUPPORT
  • code/branches/ogre1.9/src/libraries/util/OgreForwardRefs.h

    r7168 r11129  
    6767    class Factory;
    6868    class Font;
    69     class FontPtr;
    7069    class FontManager;
    7170    struct FrameEvent;
     
    7372    class Frustum;
    7473    class GpuProgram;
    75     class GpuProgramPtr;
    7674    class GpuProgramManager;
    7775    class GpuProgramUsage;
     
    8280    class HardwarePixelBufferSharedPtr;
    8381    class HighLevelGpuProgram;
    84     class HighLevelGpuProgramPtr;
    8582    class HighLevelGpuProgramManager;
    8683    class HighLevelGpuProgramFactory;
     
    9693    class ManualObject;
    9794    class Material;
    98     class MaterialPtr;
    9995    class MaterialManager;
    10096    class MaterialScriptCompiler;
     
    104100    class MemoryManager;
    105101    class Mesh;
    106     class MeshPtr;
    107102    class MeshSerializer;
    108103    class MeshSerializerImpl;
     
    179174    class SimpleSpline;
    180175    class Skeleton;
    181     class SkeletonPtr;
    182176    class SkeletonInstance;
    183177    class SkeletonManager;
     
    195189    class TextureUnitState;
    196190    class Texture;
    197     class TexturePtr;
    198191    class TextureFont;
    199192    class TextureManager;
  • code/branches/ogre1.9/src/modules/objects/Planet.cc

    r11128 r11129  
    3131#include <OgreEntity.h>
    3232#include <OgreBillboardSet.h>
    33 #include <OgreProgressiveMesh.h>
    3433
    3534#include "core/CoreIncludes.h"
  • code/branches/ogre1.9/src/modules/objects/Planet.h

    r11128 r11129  
    4040#include <string>
    4141#include "tools/BillboardSet.h"
    42 #include "tools/Mesh.h"
    4342#include "tools/interfaces/Tickable.h"
    4443#include "graphics/Model.h"
  • code/branches/ogre1.9/src/modules/overlays/FadeoutText.cc

    r9667 r11129  
    2929#include "FadeoutText.h"
    3030
    31 #include <OgreTextAreaOverlayElement.h>
     31#if OGRE_VERSION >= 0x010900
     32#   include <Overlay/OgreTextAreaOverlayElement.h>
     33#else
     34#   include <OgreTextAreaOverlayElement.h>
     35#endif
    3236#include "util/Math.h"
    3337#include "core/CoreIncludes.h"
  • code/branches/ogre1.9/src/modules/overlays/OverlayText.cc

    r11071 r11129  
    2929#include "OverlayText.h"
    3030
    31 #include <OgreOverlayManager.h>
    32 #include <OgrePanelOverlayElement.h>
    33 #include <OgreTextAreaOverlayElement.h>
     31#if OGRE_VERSION >= 0x010900
     32#   include <Overlay/OgreOverlayManager.h>
     33#   include <Overlay/OgrePanelOverlayElement.h>
     34#   include <Overlay/OgreTextAreaOverlayElement.h>
     35#else
     36#   include <OgreOverlayManager.h>
     37#   include <OgrePanelOverlayElement.h>
     38#   include <OgreTextAreaOverlayElement.h>
     39#endif
    3440
    3541#include "util/StringUtils.h"
  • code/branches/ogre1.9/src/modules/overlays/hud/ChatOverlay.cc

    r11083 r11129  
    3030
    3131#include <string>
    32 #include <OgreTextAreaOverlayElement.h>
     32
     33#if OGRE_VERSION >= 0x010900
     34#   include <Overlay/OgreTextAreaOverlayElement.h>
     35#else
     36#   include <OgreTextAreaOverlayElement.h>
     37#endif
    3338
    3439#include "util/Convert.h"
  • code/branches/ogre1.9/src/modules/overlays/hud/ChatOverlay.h

    r11071 r11129  
    3333
    3434#include <list>
    35 #include <OgreOverlayElement.h>
     35
     36#include <OgrePrerequisites.h>
     37#if OGRE_VERSION >= 0x010900
     38#   include <Overlay/OgreOverlayElement.h>
     39#else
     40#   include <OgreOverlayElement.h>
     41#endif
    3642
    3743#include "chat/ChatListener.h"
  • code/branches/ogre1.9/src/modules/overlays/hud/HUDBar.cc

    r11071 r11129  
    3232#include "HUDBar.h"
    3333
    34 #include <OgreOverlayManager.h>
    3534#include <OgreMaterialManager.h>
    3635#include <OgreTechnique.h>
    3736#include <OgrePass.h>
    38 #include <OgrePanelOverlayElement.h>
     37
     38#if OGRE_VERSION >= 0x010900
     39#   include <Overlay/OgreOverlayManager.h>
     40#   include <Overlay/OgrePanelOverlayElement.h>
     41#else
     42#   include <OgreOverlayManager.h>
     43#   include <OgrePanelOverlayElement.h>
     44#endif
    3945
    4046#include "util/Convert.h"
     
    248254        return this->icon_->getMaterialName();
    249255    }
     256
     257    void HUDBar::setIconPosition(Vector2 position)
     258    {
     259        this->icon_->setPosition(position.x, position.y);
     260    }
     261
     262    void HUDBar::setIconDimensions(Vector2 dimensions)
     263    {
     264        this->icon_->setDimensions(dimensions.x, dimensions.y);
     265    }
    250266}
  • code/branches/ogre1.9/src/modules/overlays/hud/HUDBar.h

    r11071 r11129  
    3737#include <map>
    3838#include <vector>
    39 #include <OgrePanelOverlayElement.h>
    4039
    4140#include "util/Math.h"
     
    122121            { return this->currentColour_; }
    123122
    124         inline void setIconPosition(Vector2 position)
    125             { this->icon_->setPosition(position.x, position.y); }
    126         inline void setIconDimensions(Vector2 dimensions)
    127             { this->icon_->setDimensions(dimensions.x, dimensions.y); }
     123        void setIconPosition(Vector2 position);
     124        void setIconDimensions(Vector2 dimensions);
    128125
    129126    protected:
  • code/branches/ogre1.9/src/modules/overlays/hud/HUDNavigation.cc

    r11071 r11129  
    3232
    3333#include <OgreCamera.h>
    34 #include <OgreFontManager.h>
    35 #include <OgreOverlayManager.h>
    36 #include <OgreTextAreaOverlayElement.h>
    37 #include <OgrePanelOverlayElement.h>
     34
     35#if OGRE_VERSION >= 0x010900
     36#   include <Overlay/OgreFontManager.h>
     37#   include <Overlay/OgreOverlayManager.h>
     38#   include <Overlay/OgreTextAreaOverlayElement.h>
     39#   include <Overlay/OgrePanelOverlayElement.h>
     40#else
     41#   include <OgreFontManager.h>
     42#   include <OgreOverlayManager.h>
     43#   include <OgreTextAreaOverlayElement.h>
     44#   include <OgrePanelOverlayElement.h>
     45#endif
    3846
    3947#include <typeinfo>
  • code/branches/ogre1.9/src/modules/overlays/hud/HUDRadar.cc

    r11071 r11129  
    3131#include "HUDRadar.h"
    3232
    33 #include <OgreOverlayManager.h>
    34 #include <OgrePanelOverlayElement.h>
     33#if OGRE_VERSION >= 0x010900
     34#   include <Overlay/OgreOverlayManager.h>
     35#   include <Overlay/OgrePanelOverlayElement.h>
     36#else
     37#   include <OgreOverlayManager.h>
     38#   include <OgrePanelOverlayElement.h>
     39#endif
    3540
    3641#include "util/Math.h"
  • code/branches/ogre1.9/src/modules/overlays/hud/HUDWeapon.cc

    r11071 r11129  
    2828
    2929#include "HUDWeapon.h"
     30
     31#if OGRE_VERSION >= 0x010900
     32#   include <Overlay/OgreOverlayManager.h>
     33#   include <Overlay/OgrePanelOverlayElement.h>
     34#else
     35#   include <OgreOverlayManager.h>
     36#   include <OgrePanelOverlayElement.h>
     37#endif
    3038
    3139#include "core/CoreIncludes.h"
  • code/branches/ogre1.9/src/modules/overlays/hud/HUDWeapon.h

    r11071 r11129  
    3535#include <vector>
    3636#include <string>
    37 
    38 #include <OgreOverlayManager.h>
    39 #include <OgrePanelOverlayElement.h>
    4037
    4138#include "overlays/OrxonoxOverlay.h"
  • code/branches/ogre1.9/src/modules/overlays/hud/HUDWeaponMode.cc

    r11071 r11129  
    2828
    2929#include "HUDWeaponMode.h"
     30
     31#if OGRE_VERSION >= 0x010900
     32#   include <Overlay/OgreOverlayManager.h>
     33#   include <Overlay/OgrePanelOverlayElement.h>
     34#else
     35#   include <OgreOverlayManager.h>
     36#   include <OgrePanelOverlayElement.h>
     37#endif
    3038
    3139#include "util/Convert.h"
  • code/branches/ogre1.9/src/modules/overlays/hud/HUDWeaponMode.h

    r11071 r11129  
    3636#include <vector>
    3737#include <string>
    38 
    39 #include <OgreOverlayManager.h>
    40 #include <OgrePanelOverlayElement.h>
    4138
    4239#include "overlays/OrxonoxOverlay.h"
  • code/branches/ogre1.9/src/modules/overlays/stats/Stats.cc

    r11071 r11129  
    3030
    3131#include <string>
    32 #include <OgreOverlayManager.h>
    33 #include <OgreBorderPanelOverlayElement.h>
     32
     33#if OGRE_VERSION >= 0x010900
     34#   include <Overlay/OgreOverlayManager.h>
     35#   include <Overlay/OgreBorderPanelOverlayElement.h>
     36#else
     37#   include <OgreOverlayManager.h>
     38#   include <OgreBorderPanelOverlayElement.h>
     39#endif
    3440
    3541#include "util/StringUtils.h"
  • code/branches/ogre1.9/src/orxonox/RenderQueueListener.cc

    r11080 r11129  
    8383            renderSystem->setStencilBufferParams(Ogre::CMPF_ALWAYS_PASS,
    8484                STENCIL_VALUE_FOR_GLOW, STENCIL_FULL_MASK,
     85#if OGRE_VERSION >= 0x010900
     86                STENCIL_FULL_MASK,
     87#endif
    8588                Ogre::SOP_KEEP,Ogre::SOP_KEEP,Ogre::SOP_REPLACE,false);       
    8689        }
     
    9194            renderSystem->setStencilBufferParams(Ogre::CMPF_NOT_EQUAL,
    9295                STENCIL_VALUE_FOR_GLOW, STENCIL_FULL_MASK,
     96#if OGRE_VERSION >= 0x010900
     97                STENCIL_FULL_MASK,
     98#endif
    9399                Ogre::SOP_KEEP,Ogre::SOP_KEEP,Ogre::SOP_REPLACE,false);       
    94100        }
  • code/branches/ogre1.9/src/orxonox/controllers/NewHumanController.cc

    r11071 r11129  
    397397                try
    398398                {
    399                     wePtr = orxonox_cast<WorldEntity*>(Ogre::any_cast<OrxonoxClass*>(itr->movable->getUserAny()));
     399#if OGRE_VERSION >= 0x010900
     400                    const Ogre::Any& any = itr->movable->getUserObjectBindings().getUserAny();
     401#else
     402                    const Ogre::Any& any = itr->movable->getUserAny();
     403#endif
     404                    wePtr = orxonox_cast<WorldEntity*>(Ogre::any_cast<OrxonoxClass*>(any));
    400405                }
    401406                catch (...)
  • code/branches/ogre1.9/src/orxonox/graphics/Camera.cc

    r9667 r11129  
    6262
    6363        this->camera_ = this->getScene()->getSceneManager()->createCamera(getUniqueNumberString());
    64         static_cast<Ogre::MovableObject*>(this->camera_)->setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(this)));
     64        Ogre::MovableObject* movable = static_cast<Ogre::MovableObject*>(this->camera_);
     65#if OGRE_VERSION >= 0x010900
     66        movable->getUserObjectBindings().setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(this)));
     67#else
     68        movable->setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(this)));
     69#endif
    6570        this->cameraNode_ = this->getScene()->getRootSceneNode()->createChildSceneNode();
    6671        this->attachNode(this->cameraNode_);
  • code/branches/ogre1.9/src/orxonox/graphics/Model.cc

    r11080 r11129  
    3030
    3131#include <OgreEntity.h>
    32 #include <OgreProgressiveMesh.h>
     32#if OGRE_VERSION >= 0x010900
     33#   include <OgreProgressiveMeshGenerator.h>
     34#   include <OgreDistanceLodStrategy.h>
     35#else
     36#   include <OgreProgressiveMesh.h>
     37#endif
    3338
    3439#include "core/CoreIncludes.h"
     
    196201            {
    197202                float volume = this->mesh_.getEntity()->getBoundingBox().volume();
    198 /*
    199                 float scaleFactor = 1;
    200 
    201                 BaseObject* creatorPtr = this;
    202 
    203                 while(creatorPtr!=nullptr&&orxonox_cast<WorldEntity*>(creatorPtr))
    204                 {
    205                     scaleFactor *= getBiggestScale(((WorldEntity*) creatorPtr)->getScale3D());
    206                     creatorPtr = creatorPtr->getCreator();
    207                 }
    208                 orxout() << "name: " << this->meshSrc_ << "scaleFactor: " << scaleFactor << ", volume: " << volume << endl;
    209 */
    210203                orxout(verbose, context::lod) << "Setting lodLevel for " << this->meshSrc_<< " with lodLevel_: " << this->lodLevel_ <<" and volume: "<< volume << ":" << endl;
    211204
    212 #if OGRE_VERSION >= 0x010800
     205#if OGRE_VERSION >= 0x010900
     206                Ogre::LodConfig::LodLevelList distList;
     207#elif OGRE_VERSION >= 0x010800
    213208                Ogre::ProgressiveMesh::LodValueList distList;
    214209#elif OGRE_VERSION >= 0x010700
     
    220215                if( lodLevel_>0 )
    221216                {
    222 //                    float factor = scaleFactor*5/lodLevel_;
    223217                    float factor = pow(volume, 2.0f / 3.0f) * 15.0f / lodLevel_;
    224218
    225219                    orxout(verbose, context::lod) << "LodLevel set with factor: " << factor << endl;
    226220
    227                     distList.push_back(70.0f*factor);
    228                     distList.push_back(140.0f*factor);
    229                     distList.push_back(170.0f*factor);
    230                     distList.push_back(200.0f*factor);
    231                     distList.push_back(230.0f*factor);
    232                     distList.push_back(250.0f*factor);
    233                     distList.push_back(270.0f*factor);
    234                     distList.push_back(290.0f*factor);
    235                     distList.push_back(310.0f*factor);
    236                     distList.push_back(330.0f*factor);
     221                    addLodDistanceToList(distList, 70.0f*factor);
     222                    addLodDistanceToList(distList, 140.0f*factor);
     223                    addLodDistanceToList(distList, 170.0f*factor);
     224                    addLodDistanceToList(distList, 200.0f*factor);
     225                    addLodDistanceToList(distList, 230.0f*factor);
     226                    addLodDistanceToList(distList, 250.0f*factor);
     227                    addLodDistanceToList(distList, 270.0f*factor);
     228                    addLodDistanceToList(distList, 290.0f*factor);
     229                    addLodDistanceToList(distList, 310.0f*factor);
     230                    addLodDistanceToList(distList, 330.0f*factor);
    237231                    while(distList.size()>this->numLodLevels_)
    238232                        distList.pop_back();
     
    240234
    241235                    //Generiert LOD-Levels
    242 #if OGRE_VERSION >= 0x010800
     236#if OGRE_VERSION >= 0x010900
     237                    Ogre::LodConfig config;
     238                    config.mesh = this->mesh_.getEntity()->getMesh();
     239                    config.levels = distList;
     240                    config.strategy = Ogre::DistanceLodSphereStrategy::getSingletonPtr();
     241
     242                    Ogre::ProgressiveMeshGenerator generator;
     243                    generator.generateLodLevels(config);
     244#elif OGRE_VERSION >= 0x010800
    243245                    Ogre::ProgressiveMesh::generateLodLevels(this->mesh_.getEntity()->getMesh().get(), distList, Ogre::ProgressiveMesh::VRQ_PROPORTIONAL,
    244246                        this->lodReductionRate_);
     
    263265#endif
    264266    }
     267
     268    template <class T>
     269    void Model::addLodDistanceToList(T& list, float distance)
     270    {
     271#if OGRE_VERSION >= 0x010900
     272        list.push_back({distance, Ogre::LodLevel::VRM_COLLAPSE_COST, this->lodReductionRate_, 0, false});
     273#else
     274        list.push_back(distance);
     275#endif
     276    }
    265277}
  • code/branches/ogre1.9/src/orxonox/graphics/Model.h

    r11128 r11129  
    114114            void enableLod();
    115115
     116            template <class T>
     117            void addLodDistanceToList(T& list, float distance);
     118
    116119            inline void setLodLevel(float lodLevel)
    117120                { this->lodLevel_ =  lodLevel; }
  • code/branches/ogre1.9/src/orxonox/overlays/InGameConsole.cc

    r11071 r11129  
    3232#include <algorithm>
    3333#include <string>
    34 #include <OgreOverlay.h>
    35 #include <OgreOverlayElement.h>
    36 #include <OgreOverlayManager.h>
    37 #include <OgreOverlayContainer.h>
    38 #include <OgreBorderPanelOverlayElement.h>
    39 #include <OgreTextAreaOverlayElement.h>
    40 #include <OgreFontManager.h>
    41 #include <OgreFont.h>
     34#include <OgrePrerequisites.h>
     35#if OGRE_VERSION >= 0x010900
     36#   include <Overlay/OgreOverlay.h>
     37#   include <Overlay/OgreOverlayElement.h>
     38#   include <Overlay/OgreOverlayManager.h>
     39#   include <Overlay/OgreOverlayContainer.h>
     40#   include <Overlay/OgreBorderPanelOverlayElement.h>
     41#   include <Overlay/OgreTextAreaOverlayElement.h>
     42#   include <Overlay/OgreFontManager.h>
     43#   include <Overlay/OgreFont.h>
     44#else
     45#   include <OgreOverlay.h>
     46#   include <OgreOverlayElement.h>
     47#   include <OgreOverlayManager.h>
     48#   include <OgreOverlayContainer.h>
     49#   include <OgreBorderPanelOverlayElement.h>
     50#   include <OgreTextAreaOverlayElement.h>
     51#   include <OgreFontManager.h>
     52#   include <OgreFont.h>
     53#endif
    4254
    4355#include "util/Clock.h"
  • code/branches/ogre1.9/src/orxonox/overlays/OrxonoxOverlay.cc

    r11099 r11129  
    3535
    3636#include <cmath>
    37 #include <OgreOverlay.h>
    38 #include <OgreOverlayManager.h>
    39 #include <OgrePanelOverlayElement.h>
     37#if OGRE_VERSION >= 0x010900
     38#   include <Overlay/OgreOverlay.h>
     39#   include <Overlay/OgreOverlayManager.h>
     40#   include <Overlay/OgrePanelOverlayElement.h>
     41#else
     42#   include <OgreOverlay.h>
     43#   include <OgreOverlayManager.h>
     44#   include <OgrePanelOverlayElement.h>
     45#endif
    4046#include <OgreRenderWindow.h>
    4147#include <OgreMaterialManager.h>
  • code/branches/ogre1.9/src/orxonox/worldentities/WorldEntity.cc

    r11083 r11129  
    548548    {
    549549        this->node_->attachObject(object);
     550#if OGRE_VERSION >= 0x010900
     551        object->getUserObjectBindings().setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(this)));
     552#else
    550553        object->setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(this)));
     554#endif
    551555    }
    552556
     
    563567    void WorldEntity::detachOgreObject(Ogre::MovableObject* object)
    564568    {
     569#if OGRE_VERSION >= 0x010900
     570        object->getUserObjectBindings().setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(nullptr)));
     571#else
    565572        object->setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(nullptr)));
     573#endif
    566574        this->node_->detachObject(object);
    567575    }
Note: See TracChangeset for help on using the changeset viewer.