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:
18 edited

Legend:

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

  • 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"
Note: See TracChangeset for help on using the changeset viewer.