[Orxonox-commit 3277] r7968 - code/branches/kicklib/src/libraries/core

rgrieder at orxonox.net rgrieder at orxonox.net
Sat Feb 26 17:23:49 CET 2011


Author: rgrieder
Date: 2011-02-26 17:23:49 +0100 (Sat, 26 Feb 2011)
New Revision: 7968

Modified:
   code/branches/kicklib/src/libraries/core/GUIManager.cc
   code/branches/kicklib/src/libraries/core/GUIManager.h
Log:
Starting an Orxonox macro with CEGUI is probably not such a good idea.
Also fixed two little bugs.

Modified: code/branches/kicklib/src/libraries/core/GUIManager.cc
===================================================================
--- code/branches/kicklib/src/libraries/core/GUIManager.cc	2011-02-26 16:12:43 UTC (rev 7967)
+++ code/branches/kicklib/src/libraries/core/GUIManager.cc	2011-02-26 16:23:49 UTC (rev 7968)
@@ -45,7 +45,7 @@
 #include <elements/CEGUIListbox.h>
 #include <elements/CEGUIListboxItem.h>
 
-#ifdef CEGUI_OLD_VERSION
+#ifdef ORXONOX_OLD_CEGUI
 #  include <CEGUILua.h>
 #  include <ogreceguirenderer/OgreCEGUIRenderer.h>
 #else
@@ -126,7 +126,7 @@
         , scriptModule_(NULL)
         , guiSystem_(NULL)
         , resourceProvider_(NULL)
-#ifdef CEGUI_OLD_VERSION
+#ifndef ORXONOX_OLD_CEGUI
         , imageCodec_(NULL)
 #endif
         , camera_(NULL)
@@ -139,7 +139,7 @@
         COUT(3) << "Initialising CEGUI." << std::endl;
 
         // Note: No SceneManager specified yet
-#ifdef CEGUI_OLD_VERSION
+#ifdef ORXONOX_OLD_CEGUI
         guiRenderer_ = new OgreCEGUIRenderer(GraphicsManager::getInstance().getRenderWindow(), Ogre::RENDER_QUEUE_OVERLAY, false, 3000);
         resourceProvider_ = guiRenderer_->createResourceProvider();
 #else
@@ -154,7 +154,7 @@
         rootFileInfo_ = Resource::getInfo("InitialiseGUI.lua");
         // This is necessary to ensure that input events also use the right resource info when triggering lua functions
         luaState_->setDefaultResourceInfo(this->rootFileInfo_);
-#ifdef CEGUI_OLD_VERSION
+#ifdef ORXONOX_OLD_CEGUI
         scriptModule_ = new LuaScriptModule(luaState_->getInternalLuaState());
 #else
         scriptModule_ = &LuaScriptModule::create(luaState_->getInternalLuaState());
@@ -170,7 +170,7 @@
         this->ceguiLogger_ = ceguiLogger.release();
 
         // Create the CEGUI system singleton
-#ifdef CEGUI_OLD_VERSION
+#ifdef ORXONOX_OLD_CEGUI
         guiSystem_ = new System(guiRenderer_, resourceProvider_, 0, scriptModule_);
         // Add functions that have been renamed in newer versions
         luaState_->doString("CEGUI.SchemeManager.create = CEGUI.SchemeManager.loadScheme");
@@ -206,7 +206,7 @@
     {
         using namespace CEGUI;
 
-#ifdef CEGUI_OLD_VERSION
+#ifdef ORXONOX_OLD_CEGUI
         delete guiSystem_;
         delete guiRenderer_;
         delete scriptModule_;
@@ -259,7 +259,7 @@
     void GUIManager::setCamera(Ogre::Camera* camera)
     {
         this->camera_ = camera;
-#ifdef CEGUI_OLD_VERSION
+#ifdef ORXONOX_OLD_CEGUI
         if (camera == NULL)
             this->guiRenderer_->setTargetSceneManager(0);
         else
@@ -550,7 +550,7 @@
     */
     void GUIManager::windowResized(unsigned int newWidth, unsigned int newHeight)
     {
-#ifdef CEGUI_OLD_VERSION
+#ifdef ORXONOX_OLD_CEGUI
         this->guiRenderer_->setDisplaySize(CEGUI::Size(newWidth, newHeight));
 #else
         this->guiRenderer_->setDisplaySize(CEGUI::Size((float)newWidth, (float)newHeight));

Modified: code/branches/kicklib/src/libraries/core/GUIManager.h
===================================================================
--- code/branches/kicklib/src/libraries/core/GUIManager.h	2011-02-26 16:12:43 UTC (rev 7967)
+++ code/branches/kicklib/src/libraries/core/GUIManager.h	2011-02-26 16:23:49 UTC (rev 7968)
@@ -58,7 +58,7 @@
 */
 
 #if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
-#  define CEGUI_OLD_VERSION
+#  define ORXONOX_OLD_CEGUI
 #endif
 
 namespace orxonox // tolua_export
@@ -152,7 +152,7 @@
         /// Surrogate for the destructor
         Loki::ObjScopeGuardImpl0<GUIManager, void (GUIManager::*)()> destroyer_;
 
-#ifdef CEGUI_OLD_VERSION
+#ifdef ORXONOX_OLD_CEGUI
         CEGUI::OgreCEGUIRenderer*            guiRenderer_;      //!< CEGUI's interface to the Ogre Engine
         CEGUI::ResourceProvider*             resourceProvider_; //!< CEGUI's resource provider
         static const bool                    CEGUIVERSION7 = false;
@@ -160,7 +160,7 @@
         CEGUI::OgreRenderer*                 guiRenderer_;      //!< CEGUI's interface to the Ogre Engine
         CEGUI::OgreResourceProvider*         resourceProvider_; //!< CEGUI's resource provider
         CEGUI::OgreImageCodec*               imageCodec_;
-        static const bool                    CEGUIVERSION7 = false;
+        static const bool                    CEGUIVERSION7 = true;
 #endif
         LuaState*                            luaState_;         //!< LuaState, access point to the Lua engine
         CEGUI::LuaScriptModule*              scriptModule_;     //!< CEGUI's script module to use Lua




More information about the Orxonox-commit mailing list