Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 21, 2018, 12:03:52 AM (7 years ago)
Author:
landauf
Message:

merged ogre1.9 (including cegui0.8) into new branch

Location:
code/branches/cegui0.8_ogre1.9
Files:
36 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cegui0.8_ogre1.9

  • code/branches/cegui0.8_ogre1.9/src/libraries/core/CMakeLists.txt

    r11712 r11795  
    9595  LINK_LIBRARIES
    9696    ${OGRE_LIBRARY}
     97    ${OGRE_OVERLAY_LIBRARY}
    9798    ${Boost_FILESYSTEM_LIBRARY}
    9899    ${Boost_SYSTEM_LIBRARY} # Filesystem dependency
  • code/branches/cegui0.8_ogre1.9/src/libraries/core/GUIManager.cc

    r11117 r11795  
    482482        assert(guiSystem_);
    483483        this->protectedCeguiSystemCall(std::bind(&CEGUI::System::injectTimePulse, arg::_1, time.getDeltaTime()));
     484#if CEGUI_VERSION >= 0x000800
     485        this->protectedCeguiContextCall(std::bind(&CEGUI::GUIContext::injectTimePulse, arg::_1, time.getDeltaTime()));
     486#endif
    484487    }
    485488
     
    664667            this->setBackgroundImage("");
    665668        else
    666             this->setBackgroundImage("set: " + imageSet + " image: " + imageName);
     669            this->setBackgroundImage(imageSet + "/" + imageName);
    667670    }
    668671
     
    846849    bool GUIManager::protectedCeguiContextCall(FunctionType function)
    847850    {
    848         return this->protectedCall(function, this->guiSystem_->getDefaultGUIContext());
     851        return this->protectedCall(function, &this->guiSystem_->getDefaultGUIContext());
    849852    }
    850853#endif
  • code/branches/cegui0.8_ogre1.9/src/libraries/core/GraphicsManager.cc

    r11115 r11795  
    4545#include <OgreViewport.h>
    4646#include <OgreWindowEventUtilities.h>
     47#if OGRE_VERSION >= 0x010900
     48#   include <Overlay/OgreOverlaySystem.h>
     49#endif
    4750
    4851#include "SpecialConfig.h"
     
    115118        this->loadOgreRoot();
    116119
     120#if OGRE_VERSION >= 0x010900
     121        this->overlaySystem_ = new Ogre::OverlaySystem();
     122#else
     123        this->overlaySystem_ = nullptr;
     124#endif
     125
    117126        // At first, add the root paths of the data directories as resource locations
    118127        Ogre::ResourceGroupManager::getSingleton().addResourceLocation(ConfigurablePaths::getDataPathString(), "FileSystem");
     
    155164        Loader::getInstance().unload(extResources_.get());
    156165
     166#if OGRE_VERSION >= 0x010900
     167        safeObjectDelete(&overlaySystem_);
     168#endif
    157169        safeObjectDelete(&ogreRoot_);
    158170        safeObjectDelete(&ogreLogger_);
  • code/branches/cegui0.8_ogre1.9/src/libraries/core/GraphicsManager.h

    r11085 r11795  
    5252
    5353#include "util/DestructionHelper.h"
     54#include "util/OgreForwardRefs.h"
    5455#include "util/Singleton.h"
    5556#include "config/Configurable.h"
     
    7980        void postUpdate(const Clock& time);
    8081
    81         Ogre::Viewport* getViewport()         { return this->viewport_; }
    82         Ogre::RenderWindow* getRenderWindow() { return this->renderWindow_; }
     82        Ogre::Viewport* getViewport()           { return this->viewport_; }
     83        Ogre::RenderWindow* getRenderWindow()   { return this->renderWindow_; }
     84        Ogre::OverlaySystem* getOverlaySystem() { return this->overlaySystem_; }
    8385        size_t getRenderWindowHandle();
    8486
     
    129131        Ogre::RenderWindow*      renderWindow_;            //!< the one and only render window
    130132        Ogre::Viewport*          viewport_;                //!< default full size viewport
     133        Ogre::OverlaySystem*     overlaySystem_;
    131134        GlowMaterialListener*    glowMaterialListener_;    //!< Material Listener for the 'Glow' compositor
    132135        float                    lastFrameStartTime_;      //!< Time stamp of the beginning of the last frame
  • code/branches/cegui0.8_ogre1.9/src/libraries/util/DisplayStringConversions.h

    r11071 r11795  
    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/cegui0.8_ogre1.9/src/libraries/util/OgreForwardRefs.h

    r7168 r11795  
    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;
     
    120115    class OverlayElementFactory;
    121116    class OverlayManager;
     117    class OverlaySystem;
    122118    class Particle;
    123119    class ParticleAffector;
     
    179175    class SimpleSpline;
    180176    class Skeleton;
    181     class SkeletonPtr;
    182177    class SkeletonInstance;
    183178    class SkeletonManager;
     
    195190    class TextureUnitState;
    196191    class Texture;
    197     class TexturePtr;
    198192    class TextureFont;
    199193    class TextureManager;
  • code/branches/cegui0.8_ogre1.9/src/modules/designtools/ScreenshotManager.cc

    r11071 r11795  
    101101        }
    102102        if(!this->tempTexture_.isNull())
    103             this->tempTexture_.freeMethod();
     103            this->tempTexture_.setNull();
    104104    }
    105105   
  • code/branches/cegui0.8_ogre1.9/src/modules/hover/FlagHUD.cc

    r11071 r11795  
    3232#include "FlagHUD.h"
    3333
    34 #include <OgreOverlayManager.h>
    35 #include <OgreMaterialManager.h>
    36 #include <OgrePanelOverlayElement.h>
     34#if OGRE_VERSION >= 0x010900
     35#   include <Overlay/OgreOverlayManager.h>
     36#   include <Overlay/OgrePanelOverlayElement.h>
     37#else
     38#   include <OgreOverlayManager.h>
     39#   include <OgrePanelOverlayElement.h>
     40#endif
    3741
    3842#include "util/StringUtils.h"
  • code/branches/cegui0.8_ogre1.9/src/modules/objects/Planet.cc

    r10624 r11795  
    3131#include <OgreEntity.h>
    3232#include <OgreBillboardSet.h>
    33 #include <OgreProgressiveMesh.h>
    3433
    3534#include "core/CoreIncludes.h"
     
    4746     * @brief Constructor
    4847     */
    49     Planet::Planet(Context* context) : MovableEntity(context)
     48    Planet::Planet(Context* context) : Model(context)
    5049    {
    5150        RegisterObject(Planet);
     51        this->setLodEnabled(false);
    5252        this->registerVariables();
    5353    }
     
    5858    Planet::~Planet()
    5959    {
    60         if (this->isInitialized() && this->mesh_.getEntity())
    61             this->detachOgreObject(this->mesh_.getEntity());
    6260    }
    6361
     
    8785    }
    8886
    89     void Planet::changedMesh()
     87    void Planet::changedAtmosphere()
    9088    {
    9189        if( GameMode::showsGraphics() )
    9290        {
    93             if (this->mesh_.getEntity())
    94                 this->detachOgreObject(this->mesh_.getEntity());
    95 
    96             this->mesh_.setMeshSource(this->getScene()->getSceneManager(), this->meshSrc_);
    97 
    98             if (this->mesh_.getEntity())
     91            if (this->getMesh().getEntity())
    9992            {
    100                 this->attachOgreObject(this->mesh_.getEntity());
    101                 this->mesh_.getEntity()->setCastShadows(this->bCastShadows_);
    102                 this->mesh_.setVisible(this->isVisible());
    103 
    104                 float scaleFactor = this->getScale();
    105 
    106 #if OGRE_VERSION >= 0x010800
    107                 Ogre::ProgressiveMesh::LodValueList distList;
    108 #elif OGRE_VERSION >= 0x010700
    109                 Ogre::Mesh::LodValueList distList;
    110 #else
    111                 Ogre::Mesh::LodDistanceList distList;
    112 #endif
    113 
    114                 distList.push_back(10.0f*scaleFactor);
    115                 distList.push_back(19.0f*scaleFactor);
    116                 distList.push_back(27.0f*scaleFactor);
    117                 distList.push_back(34.0f*scaleFactor);
    118                 distList.push_back(40.0f*scaleFactor);
    119                 distList.push_back(45.0f*scaleFactor);
    120                 distList.push_back(49.0f*scaleFactor);
    121                 distList.push_back(52.0f*scaleFactor);
    122                 distList.push_back(54.0f*scaleFactor);
    123                 distList.push_back(55.0f*scaleFactor);
    124 
    125                 float reductionValue = 0.2f;
    126 
    127 #if OGRE_VERSION >= 0x010800
    128                 Ogre::ProgressiveMesh::generateLodLevels(this->mesh_.getEntity()->getMesh().get(), distList, Ogre::ProgressiveMesh::VRQ_PROPORTIONAL,
    129                     reductionValue);
    130 #else
    131                 this->mesh_.getEntity()->getMesh()->generateLodLevels(distList, Ogre::ProgressiveMesh::VRQ_PROPORTIONAL, reductionValue);
    132 #endif
    133                 billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->atmosphere_, Vector3(0,0,0));
     93                this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->atmosphere_, Vector3(0,0,0));
    13494
    13595                this->attachOgreObject(this->billboard_.getBillboardSet());
    13696                this->billboard_.getBillboardSet()->setUseAccurateFacing(true);
    137                 this->setCastShadows(true);
    138                 this->billboard_.getBillboardSet()->setRenderQueueGroup(this->mesh_.getEntity()->getRenderQueueGroup());
    139                 this->mesh_.setCastShadows(true);
     97                this->billboard_.getBillboardSet()->setRenderQueueGroup(this->getMesh().getEntity()->getRenderQueueGroup());
    14098            }
    14199        }
    142     }
    143 
    144     void Planet::changedShadows()
    145     {
    146         this->mesh_.setCastShadows(this->bCastShadows_);
    147100    }
    148101
     
    154107        XMLPortParam(Planet, "atmospheresize", setAtmosphereSize, getAtmosphereSize, xmlelement,mode);
    155108        XMLPortParam(Planet, "imagesize", setImageSize, getImageSize, xmlelement,mode);
    156         XMLPortParam(Planet, "mesh", setMeshSource, getMeshSource, xmlelement, mode);
    157         XMLPortParam(Planet, "shadow", setCastShadows, getCastShadows, xmlelement, mode).defaultValues(true);
    158109    }
    159110
    160111    void Planet::registerVariables()
    161112    {
    162         registerVariable(this->atmosphere_, VariableDirection::ToClient);
     113        registerVariable(this->atmosphere_, VariableDirection::ToClient, new NetworkCallback<Planet>(this, &Planet::changedAtmosphere));
    163114        registerVariable(this->atmosphereSize, VariableDirection::ToClient);
    164115        registerVariable(this->imageSize, VariableDirection::ToClient);
    165         // Note: the meshSrc should be synchronised after atmosphere and other values, because the meshSrc callback setts the atmosphere billboards
    166         registerVariable(this->meshSrc_, VariableDirection::ToClient, new NetworkCallback<Planet>(this, &Planet::changedMesh));
    167         registerVariable(this->bCastShadows_, VariableDirection::ToClient, new NetworkCallback<Planet>(this, &Planet::changedShadows));
    168116    }
    169117
     
    171119    {
    172120        SUPER(Planet, changedVisibility);
    173         if (this->isInitialized())
    174         {
    175             this->mesh_.setVisible(this->isVisible());
    176             this->billboard_.setVisible(this->isVisible());
    177         }
     121
     122        this->billboard_.setVisible(this->isVisible());
    178123    }
    179124}
  • code/branches/cegui0.8_ogre1.9/src/modules/objects/Planet.h

    r11071 r11795  
    4040#include <string>
    4141#include "tools/BillboardSet.h"
    42 #include "tools/Mesh.h"
    43 #include "worldentities/MovableEntity.h"
     42#include "tools/interfaces/Tickable.h"
     43#include "graphics/Model.h"
    4444
    4545namespace orxonox
    4646{
    47     class _ObjectsExport Planet : public MovableEntity
     47    class _ObjectsExport Planet : public Model, public Tickable
    4848    {
    4949        public:
     
    5858            virtual void changedVisibility() override;
    5959
    60             inline void setMeshSource(const std::string& meshname)
    61                 { this->meshSrc_ = meshname; this->changedMesh(); }
    62 
    63             inline const std::string& getMeshSource() const
    64                 { return this->meshSrc_; }
    65 
    66             inline void setCastShadows(bool bCastShadows)
    67                 { this->bCastShadows_ = bCastShadows; this->changedShadows(); }
    68 
    69             inline bool getCastShadows() const
    70                 { return this->bCastShadows_; }
    71 
    72             inline const std::string& getMesh() const{
    73                 return this->meshSrc_;
    74             }
    75 
    7660            inline void setAtmosphereSize(float size){
    7761                this->atmosphereSize = size;
     
    8468            inline void setAtmosphere(const std::string& atmosphere){
    8569                this->atmosphere_ = atmosphere;
     70                this->changedAtmosphere();
    8671            }
    8772
     
    10388            void registerVariables();
    10489
    105             void changedMesh();
    106             void changedShadows();
     90            void changedAtmosphere();
    10791
    108             std::string meshSrc_;
    10992            std::string atmosphere_;
    110             Mesh mesh_;
    11193            float atmosphereSize;
    11294            float imageSize;
    11395            BillboardSet billboard_;
    114             bool bCastShadows_;
    11596
    11697    };
  • code/branches/cegui0.8_ogre1.9/src/modules/overlays/FadeoutText.cc

    r9667 r11795  
    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/cegui0.8_ogre1.9/src/modules/overlays/OverlayText.cc

    r11071 r11795  
    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/cegui0.8_ogre1.9/src/modules/overlays/hud/ChatOverlay.cc

    r11083 r11795  
    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/cegui0.8_ogre1.9/src/modules/overlays/hud/ChatOverlay.h

    r11071 r11795  
    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/cegui0.8_ogre1.9/src/modules/overlays/hud/HUDBar.cc

    r11071 r11795  
    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/cegui0.8_ogre1.9/src/modules/overlays/hud/HUDBar.h

    r11071 r11795  
    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/cegui0.8_ogre1.9/src/modules/overlays/hud/HUDNavigation.cc

    r11071 r11795  
    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/cegui0.8_ogre1.9/src/modules/overlays/hud/HUDRadar.cc

    r11071 r11795  
    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/cegui0.8_ogre1.9/src/modules/overlays/hud/HUDWeapon.cc

    r11071 r11795  
    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/cegui0.8_ogre1.9/src/modules/overlays/hud/HUDWeapon.h

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

    r11071 r11795  
    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/cegui0.8_ogre1.9/src/modules/overlays/hud/HUDWeaponMode.h

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

    r11071 r11795  
    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/cegui0.8_ogre1.9/src/orxonox/CMakeLists.txt

    r11704 r11795  
    7171  LINK_LIBRARIES
    7272    ${OGRE_LIBRARY}
     73    ${OGRE_OVERLAY_LIBRARY}
    7374    ${CEGUI}
    7475    ${LUA5.1_LIBRARY}
  • code/branches/cegui0.8_ogre1.9/src/orxonox/RenderQueueListener.cc

    r11080 r11795  
    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/cegui0.8_ogre1.9/src/orxonox/Scene.cc

    r11085 r11795  
    4040#include <OgreSceneManagerEnumerator.h>
    4141#include <OgreSceneNode.h>
     42#if OGRE_VERSION >= 0x010900
     43#   include <Overlay/OgreOverlaySystem.h>
     44#endif
    4245
    4346#include <BulletCollision/BroadphaseCollision/btAxisSweep3.h>
     
    9093            this->renderQueueListener_ = new RenderQueueListener();
    9194            this->sceneManager_->addRenderQueueListener(this->renderQueueListener_);//add our own renderQueueListener
     95#if OGRE_VERSION >= 0x010900
     96            this->sceneManager_->addRenderQueueListener(GraphicsManager::getInstance().getOverlaySystem());
     97#endif
    9298
    9399            this->radar_ = new Radar();
     
    134140            if (GameMode::showsGraphics())
    135141            {
     142#if OGRE_VERSION >= 0x010900
     143                this->sceneManager_->removeRenderQueueListener(GraphicsManager::getInstance().getOverlaySystem());
     144#endif
    136145                this->sceneManager_->removeRenderQueueListener(this->renderQueueListener_);
    137146                delete this->renderQueueListener_;
  • code/branches/cegui0.8_ogre1.9/src/orxonox/chat/ChatInputHandler.cc

    r11083 r11795  
    131131    /* GET WINDOW POINTERS */
    132132#if CEGUI_VERSION >= 0x000800
    133     input = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild( "orxonox/ChatBox/input" );
    134     inputonly = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild( "orxonox/ChatBox-inputonly/input" );
    135     CEGUI::Window *history = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild( "orxonox/ChatBox/history" );
     133    //input = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild( "ChatBox/input" );
     134    //const CEGUI::Window* root = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild("MenuRootWindow");
     135    //std::cout << "Count: " << root->getChildCount() << std::endl;
     136    //for (int i = 0; i < root->getChildCount(); ++i) {
     137    //  std::cout << "Child: " << root->getChildAtIdx(i)->getName() << std::endl;
     138    //}
     139    for (auto iterator = CEGUI::WindowManager::getSingleton().getIterator(); !iterator.isAtEnd(); iterator++) {
     140        CEGUI::Window* currentWindow = iterator.getCurrentValue();
     141        if (currentWindow->getName().compare("ChatBox") == 0) {
     142                input = currentWindow->getChild("frame")->getChild("input");
     143                CEGUI::Window* history = currentWindow->getChild("frame")->getChild("history");
     144                lb_history = dynamic_cast<CEGUI::Listbox*>(history);
     145        } else if (currentWindow->getName().compare("ChatBox-inputonly") == 0) {
     146                inputonly = currentWindow->getChild("input");
     147        }
     148    }
     149
     150    //input = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild( "ChatBox" )->getChild("frame")->getChild("input");
     151    //inputonly = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild( "orxonox/ChatBox-inputonly/input" );
     152    //CEGUI::Window *history = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild( "orxonox/ChatBox/history" );
    136153#else
    137154    input = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox/input" );
    138155    inputonly = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox-inputonly/input" );
    139156    CEGUI::Window *history = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox/history" );
    140 #endif
    141157
    142158    /* cast it to a listbox */
    143159    lb_history = dynamic_cast<CEGUI::Listbox*>(history);
     160#endif
    144161
    145162    /* assert wee */
  • code/branches/cegui0.8_ogre1.9/src/orxonox/controllers/NewHumanController.cc

    r11071 r11795  
    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/cegui0.8_ogre1.9/src/orxonox/graphics/AnimatedModel.cc

    r9667 r11795  
    4949    AnimatedModel::~AnimatedModel()
    5050    {
    51         if (this->isInitialized() && this->mesh_.getEntity())
    52             this->detachOgreObject(this->mesh_.getEntity());
     51        if (this->isInitialized() && this->getMesh().getEntity())
     52            this->detachOgreObject(this->getMesh().getEntity());
    5353    }
    5454
     
    6666        if (GameMode::showsGraphics())
    6767        {
    68             if (this->mesh_.getEntity())
    69                 this->detachOgreObject(this->mesh_.getEntity());
     68            if (this->getMesh().getEntity())
     69                this->detachOgreObject(this->getMesh().getEntity());
    7070
    71             this->mesh_.setMeshSource(this->getScene()->getSceneManager(), this->meshSrc_);
     71            this->getMesh().setMeshSource(this->getScene()->getSceneManager(), this->getMeshSource());
    7272
    73             if (this->mesh_.getEntity())
     73            if (this->getMesh().getEntity())
    7474            {
    75                 this->attachOgreObject(this->mesh_.getEntity());
    76                 this->mesh_.getEntity()->setCastShadows(this->bCastShadows_);
     75                this->attachOgreObject(this->getMesh().getEntity());
     76                this->getMesh().getEntity()->setCastShadows(this->getCastShadows());
    7777                this->setAnimationState(this->bAnimLoop_, this->bAnimEnabled_, this->anims_);
    78                 this->mesh_.setVisible(this->isVisible());
     78                this->getMesh().setVisible(this->isVisible());
    7979            }
    8080        }
     
    8989        if(state!="")
    9090        {
    91         if(this->mesh_.getEntity()->getAnimationState(state))
     91        if(this->getMesh().getEntity()->getAnimationState(state))
    9292        {
    93         Ogre::AnimationState* as = this->mesh_.getEntity()->getAnimationState(state);
     93        Ogre::AnimationState* as = this->getMesh().getEntity()->getAnimationState(state);
    9494        as->setLoop(loop);
    9595        as->setEnabled(enabled);
     
    109109    void AnimatedModel::tick(float dt)
    110110    {
    111         if(this->mesh_.getEntity()->getAnimationState(anims_))
     111        if(this->getMesh().getEntity()->getAnimationState(anims_))
    112112        {
    113113// Test to change Material at runtime!
    114114
    115 //            Ogre::MaterialPtr mat = this->mesh_.getEntity()->getSubEntity(0)->getMaterial();
     115//            Ogre::MaterialPtr mat = this->getMesh().getEntity()->getSubEntity(0)->getMaterial();
    116116//            mat->setDiffuse(0.4, 0.3, 0.1, 0.1);
    117117//            mat->setAmbient(0.3, 0.7, 0.8);
     
    121121//            mat->setSceneBlending(sbt);
    122122
    123             Ogre::AnimationState* as = this->mesh_.getEntity()->getAnimationState(anims_);
     123            Ogre::AnimationState* as = this->getMesh().getEntity()->getAnimationState(anims_);
    124124            as->addTime(dt);
    125125    }
  • code/branches/cegui0.8_ogre1.9/src/orxonox/graphics/Camera.cc

    r9667 r11795  
    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/cegui0.8_ogre1.9/src/orxonox/graphics/Model.cc

    r11783 r11795  
    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"
     
    203208            {
    204209                float volume = this->mesh_.getEntity()->getBoundingBox().volume();
    205 /*
    206                 float scaleFactor = 1;
    207 
    208                 BaseObject* creatorPtr = this;
    209 
    210                 while(creatorPtr!=nullptr&&orxonox_cast<WorldEntity*>(creatorPtr))
    211                 {
    212                     scaleFactor *= getBiggestScale(((WorldEntity*) creatorPtr)->getScale3D());
    213                     creatorPtr = creatorPtr->getCreator();
    214                 }
    215                 orxout() << "name: " << this->meshSrc_ << "scaleFactor: " << scaleFactor << ", volume: " << volume << endl;
    216 */
    217210                orxout(verbose, context::lod) << "Setting lodLevel for " << this->meshSrc_<< " with lodLevel_: " << this->lodLevel_ <<" and volume: "<< volume << ":" << endl;
    218211
    219 #if OGRE_VERSION >= 0x010800
     212#if OGRE_VERSION >= 0x010900
     213                Ogre::LodConfig::LodLevelList distList;
     214#elif OGRE_VERSION >= 0x010800
    220215                Ogre::ProgressiveMesh::LodValueList distList;
    221216#elif OGRE_VERSION >= 0x010700
     
    227222                if( lodLevel_>0 )
    228223                {
    229 //                    float factor = scaleFactor*5/lodLevel_;
    230224                    float factor = pow(volume, 2.0f / 3.0f) * 15.0f / lodLevel_;
    231225
    232226                    orxout(verbose, context::lod) << "LodLevel set with factor: " << factor << endl;
    233227
    234                     distList.push_back(70.0f*factor);
    235                     distList.push_back(140.0f*factor);
    236                     distList.push_back(170.0f*factor);
    237                     distList.push_back(200.0f*factor);
    238                     distList.push_back(230.0f*factor);
    239                     distList.push_back(250.0f*factor);
    240                     distList.push_back(270.0f*factor);
    241                     distList.push_back(290.0f*factor);
    242                     distList.push_back(310.0f*factor);
    243                     distList.push_back(330.0f*factor);
     228                    addLodDistanceToList(distList, 70.0f*factor);
     229                    addLodDistanceToList(distList, 140.0f*factor);
     230                    addLodDistanceToList(distList, 170.0f*factor);
     231                    addLodDistanceToList(distList, 200.0f*factor);
     232                    addLodDistanceToList(distList, 230.0f*factor);
     233                    addLodDistanceToList(distList, 250.0f*factor);
     234                    addLodDistanceToList(distList, 270.0f*factor);
     235                    addLodDistanceToList(distList, 290.0f*factor);
     236                    addLodDistanceToList(distList, 310.0f*factor);
     237                    addLodDistanceToList(distList, 330.0f*factor);
    244238                    while(distList.size()>this->numLodLevels_)
    245239                        distList.pop_back();
     
    247241
    248242                    //Generiert LOD-Levels
    249 #if OGRE_VERSION >= 0x010800
     243#if OGRE_VERSION >= 0x010900
     244                    Ogre::LodConfig config;
     245                    config.mesh = this->mesh_.getEntity()->getMesh();
     246                    config.levels = distList;
     247                    config.strategy = Ogre::DistanceLodSphereStrategy::getSingletonPtr();
     248
     249                    Ogre::ProgressiveMeshGenerator generator;
     250                    generator.generateLodLevels(config);
     251#elif OGRE_VERSION >= 0x010800
    250252                    Ogre::ProgressiveMesh::generateLodLevels(this->mesh_.getEntity()->getMesh().get(), distList, Ogre::ProgressiveMesh::VRQ_PROPORTIONAL,
    251253                        this->lodReductionRate_);
     
    270272#endif
    271273    }
     274
     275    template <class T>
     276    void Model::addLodDistanceToList(T& list, float distance)
     277    {
     278#if OGRE_VERSION >= 0x010900
     279        list.push_back({distance, Ogre::LodLevel::VRM_COLLAPSE_COST, this->lodReductionRate_, 0, false});
     280#else
     281        list.push_back(distance);
     282#endif
     283    }
    272284}
  • code/branches/cegui0.8_ogre1.9/src/orxonox/graphics/Model.h

    r11783 r11795  
    8989
    9090        protected:
     91            inline Mesh& getMesh()
     92                { return this->mesh_; }
     93
     94            inline void setLodEnabled(bool bLodEnabled)
     95                { this->bLodEnabled_ = bLodEnabled; }
     96
     97        private:
    9198            /**
    9299            @brief
     
    108115            //LoD
    109116            void enableLod();
     117
     118            template <class T>
     119            void addLodDistanceToList(T& list, float distance);
    110120
    111121            inline void setLodLevel(float lodLevel)
  • code/branches/cegui0.8_ogre1.9/src/orxonox/overlays/InGameConsole.cc

    r11071 r11795  
    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/cegui0.8_ogre1.9/src/orxonox/overlays/OrxonoxOverlay.cc

    r11099 r11795  
    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/cegui0.8_ogre1.9/src/orxonox/worldentities/WorldEntity.cc

    r11083 r11795  
    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.