Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 25, 2011, 3:07:17 AM (14 years ago)
Author:
rgrieder
Message:

Applied C++ code changes to compile Orxonox with CEGUI 0.7 (does not run yet).

Location:
code/branches/kicklib/src/libraries
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/kicklib/src/libraries/core/CMakeLists.txt

    r7948 r7960  
    9393    ${CEGUILUA_LIBRARY}
    9494    ${CEGUI_TOLUA_LIBRARY}
     95    ${CEGUI_OGRE_RENDERER_LIBRARY}
    9596    ${LUA5.1_LIBRARY}
    9697    cpptcl_orxonox
    97     ogreceguirenderer_orxonox
    9898    ois_orxonox
    9999    tinyxml_orxonox
  • code/branches/kicklib/src/libraries/core/CorePrereqs.h

    r7849 r7960  
    3838#include "OrxonoxConfig.h"
    3939#include <boost/version.hpp>
     40#include <CEGUIVersion.h>
    4041
    4142//-----------------------------------------------------------------------
     
    305306    class LuaScriptModule;
    306307
     308#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
    307309    class OgreCEGUIRenderer;
    308310    class OgreCEGUIResourceProvider;
    309311    class OgreCEGUITexture;
     312#else
     313    class OgreRenderer;
     314    class OgreResourceProvider;
     315    class OgreImageCodec;
     316#endif
    310317}
    311318
  • code/branches/kicklib/src/libraries/core/GUIManager.cc

    r7957 r7960  
    3232#include <memory>
    3333#include <boost/bind.hpp>
     34#include <OgreRenderQueue.h>
     35#include <OgreRenderWindow.h>
    3436
    3537#include <CEGUIDefaultLogger.h>
     
    4446#include <elements/CEGUIListboxItem.h>
    4547
    46 #include <CEGUILua.h>
    47 #include <ogreceguirenderer/OgreCEGUIRenderer.h>
     48#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
     49#  include <CEGUILua.h>
     50#  include <ogreceguirenderer/OgreCEGUIRenderer.h>
     51#else
     52#  include <ScriptingModules/LuaScriptModule/CEGUILua.h>
     53#  include <RendererModules/Ogre/CEGUIOgreImageCodec.h>
     54#  include <RendererModules/Ogre/CEGUIOgreRenderer.h>
     55#  include <RendererModules/Ogre/CEGUIOgreResourceProvider.h>
     56#endif
    4857
    4958#include "util/Clock.h"
     
    118127        , guiSystem_(NULL)
    119128        , resourceProvider_(NULL)
     129#if CEGUI_VERSION_MAJOR >= 1 || CEGUI_VERSION_MINOR >= 7
     130        , imageCodec_(NULL)
     131#endif
    120132        , camera_(NULL)
    121133    {
     
    128140
    129141        // Note: No SceneManager specified yet
     142#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
    130143        guiRenderer_ = new OgreCEGUIRenderer(GraphicsManager::getInstance().getRenderWindow(), Ogre::RENDER_QUEUE_OVERLAY, false, 3000);
    131144        resourceProvider_ = guiRenderer_->createResourceProvider();
     145#else
     146        guiRenderer_ = &OgreRenderer::create(*GraphicsManager::getInstance().getRenderWindow());
     147        resourceProvider_ = &OgreRenderer::createOgreResourceProvider();
     148        imageCodec_ = &OgreRenderer::createOgreImageCodec();
     149#endif
    132150        resourceProvider_->setDefaultResourceGroup("General");
    133151
     
    137155        // This is necessary to ensure that input events also use the right resource info when triggering lua functions
    138156        luaState_->setDefaultResourceInfo(this->rootFileInfo_);
     157#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
    139158        scriptModule_ = new LuaScriptModule(luaState_->getInternalLuaState());
     159#else
     160        scriptModule_ = &LuaScriptModule::create(luaState_->getInternalLuaState());
     161#endif
    140162        scriptModule_->setDefaultPCallErrorHandler(LuaState::ERROR_HANDLER_NAME);
    141163
     
    149171
    150172        // Create the CEGUI system singleton
     173#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
    151174        guiSystem_ = new System(guiRenderer_, resourceProvider_, 0, scriptModule_);
     175#else
     176        guiSystem_ = &System::create(*guiRenderer_, resourceProvider_, 0, imageCodec_, scriptModule_);
     177#endif
    152178
    153179        // Align CEGUI mouse with OIS mouse
     
    178204        using namespace CEGUI;
    179205
     206#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
    180207        delete guiSystem_;
    181208        delete guiRenderer_;
    182209        delete scriptModule_;
     210#else
     211        System::destroy();
     212        OgreRenderer::destroyOgreResourceProvider(*resourceProvider_);
     213        OgreRenderer::destroyOgreImageCodec(*imageCodec_);
     214        OgreRenderer::destroy(*guiRenderer_);
     215        LuaScriptModule::destroy(*scriptModule_);
     216#endif
    183217        delete luaState_;
    184218    }
     
    223257    {
    224258        this->camera_ = camera;
     259#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
    225260        if (camera == NULL)
    226261            this->guiRenderer_->setTargetSceneManager(0);
    227262        else
    228263            this->guiRenderer_->setTargetSceneManager(camera->getSceneManager());
     264#endif
    229265    }
    230266
     
    512548    void GUIManager::windowResized(unsigned int newWidth, unsigned int newHeight)
    513549    {
     550#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
    514551        this->guiRenderer_->setDisplaySize(CEGUI::Size(newWidth, newHeight));
     552#else
     553        this->guiRenderer_->setDisplaySize(CEGUI::Size((float)newWidth, (float)newHeight));
     554#endif
    515555    }
    516556
  • code/branches/kicklib/src/libraries/core/GUIManager.h

    r7957 r7960  
    4242#include <string>
    4343#include <CEGUIForwardRefs.h>
    44 #include <boost/scoped_ptr.hpp>
     44#include <CEGUIVersion.h>
    4545#include <boost/shared_ptr.hpp>
    4646#include <loki/ScopeGuard.h>
     
    147147        Loki::ObjScopeGuardImpl0<GUIManager, void (GUIManager::*)()> destroyer_;
    148148
     149#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
    149150        CEGUI::OgreCEGUIRenderer*            guiRenderer_;      //!< CEGUI's interface to the Ogre Engine
    150151        CEGUI::ResourceProvider*             resourceProvider_; //!< CEGUI's resource provider
     152#else
     153        CEGUI::OgreRenderer*                 guiRenderer_;      //!< CEGUI's interface to the Ogre Engine
     154        CEGUI::OgreResourceProvider*         resourceProvider_; //!< CEGUI's resource provider
     155        CEGUI::OgreImageCodec*               imageCodec_;
     156#endif
    151157        LuaState*                            luaState_;         //!< LuaState, access point to the Lua engine
    152158        CEGUI::LuaScriptModule*              scriptModule_;     //!< CEGUI's script module to use Lua
  • code/branches/kicklib/src/libraries/util/Exception.cc

    r7947 r7960  
    9595            throw;
    9696        }
    97         catch (const std::exception& ex)
    98         {
    99             return ex.what();
    100         }
    10197        catch (const CEGUI::Exception& ex)
    10298        {
    10399            return GeneralException(ex.getMessage().c_str(), ex.getLine(),
    104100                ex.getFileName().c_str(), ex.getName().c_str()).getDescription();
     101        }
     102        catch (const std::exception& ex)
     103        {
     104            return ex.what();
    105105        }
    106106        catch (...)
Note: See TracChangeset for help on using the changeset viewer.