[Orxonox-commit 3276] r7967 - code/branches/kicklib/src/libraries/core

rgrieder at orxonox.net rgrieder at orxonox.net
Sat Feb 26 17:12:43 CET 2011


Author: rgrieder
Date: 2011-02-26 17:12:43 +0100 (Sat, 26 Feb 2011)
New Revision: 7967

Modified:
   code/branches/kicklib/src/libraries/core/GUIManager.cc
   code/branches/kicklib/src/libraries/core/GUIManager.h
Log:
Cleaned up macro monstrosities in GUIManager and fixed some typos.

Modified: code/branches/kicklib/src/libraries/core/GUIManager.cc
===================================================================
--- code/branches/kicklib/src/libraries/core/GUIManager.cc	2011-02-26 16:00:17 UTC (rev 7966)
+++ code/branches/kicklib/src/libraries/core/GUIManager.cc	2011-02-26 16:12:43 UTC (rev 7967)
@@ -45,7 +45,7 @@
 #include <elements/CEGUIListbox.h>
 #include <elements/CEGUIListboxItem.h>
 
-#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
+#ifdef CEGUI_OLD_VERSION
 #  include <CEGUILua.h>
 #  include <ogreceguirenderer/OgreCEGUIRenderer.h>
 #else
@@ -92,7 +92,7 @@
                 case CEGUI::Standard:    orxonoxLevel = 4; break;
                 case CEGUI::Informative: orxonoxLevel = 5; break;
                 case CEGUI::Insane:      orxonoxLevel = 6; break;
-                default: OrxAssert(false, "CEGUI log level out of range, inpect immediately!");
+                default: OrxAssert(false, "CEGUI log level out of range, inspect immediately!");
             }
             OutputHandler::getOutStream(orxonoxLevel)
                 << "CEGUI: " << message << std::endl;
@@ -126,7 +126,7 @@
         , scriptModule_(NULL)
         , guiSystem_(NULL)
         , resourceProvider_(NULL)
-#if CEGUI_VERSION_MAJOR >= 1 || CEGUI_VERSION_MINOR >= 7
+#ifdef CEGUI_OLD_VERSION
         , imageCodec_(NULL)
 #endif
         , camera_(NULL)
@@ -139,7 +139,7 @@
         COUT(3) << "Initialising CEGUI." << std::endl;
 
         // Note: No SceneManager specified yet
-#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
+#ifdef CEGUI_OLD_VERSION
         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_);
-#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
+#ifdef CEGUI_OLD_VERSION
         scriptModule_ = new LuaScriptModule(luaState_->getInternalLuaState());
 #else
         scriptModule_ = &LuaScriptModule::create(luaState_->getInternalLuaState());
@@ -170,7 +170,7 @@
         this->ceguiLogger_ = ceguiLogger.release();
 
         // Create the CEGUI system singleton
-#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
+#ifdef CEGUI_OLD_VERSION
         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;
 
-#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
+#ifdef CEGUI_OLD_VERSION
         delete guiSystem_;
         delete guiRenderer_;
         delete scriptModule_;
@@ -259,7 +259,7 @@
     void GUIManager::setCamera(Ogre::Camera* camera)
     {
         this->camera_ = camera;
-#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
+#ifdef CEGUI_OLD_VERSION
         if (camera == NULL)
             this->guiRenderer_->setTargetSceneManager(0);
         else
@@ -538,7 +538,7 @@
     @param listbox
         The Listbox for which to enable (or disable) tooltips.
     @param enabled
-        Whether to enable or disabel the tooltips.
+        Whether to enable or disable the tooltips.
     */
     void GUIManager::setItemTooltipsEnabledHelper(CEGUI::Listbox* listbox, bool enabled)
     {
@@ -550,7 +550,7 @@
     */
     void GUIManager::windowResized(unsigned int newWidth, unsigned int newHeight)
     {
-#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
+#ifdef CEGUI_OLD_VERSION
         this->guiRenderer_->setDisplaySize(CEGUI::Size(newWidth, newHeight));
 #else
         this->guiRenderer_->setDisplaySize(CEGUI::Size((float)newWidth, (float)newHeight));
@@ -558,7 +558,7 @@
     }
 
     /**
-        @brief Notify CEGUI if the windows loses the focus (stops higlight of menu items, etc).
+        @brief Notify CEGUI if the windows loses the focus (stops highlight of menu items, etc).
     */
     void GUIManager::windowFocusChanged(bool bFocus)
     {

Modified: code/branches/kicklib/src/libraries/core/GUIManager.h
===================================================================
--- code/branches/kicklib/src/libraries/core/GUIManager.h	2011-02-26 16:00:17 UTC (rev 7966)
+++ code/branches/kicklib/src/libraries/core/GUIManager.h	2011-02-26 16:12:43 UTC (rev 7967)
@@ -57,6 +57,10 @@
 $cfile "../util/TriBool.h" // tolua_export
 */
 
+#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
+#  define CEGUI_OLD_VERSION
+#endif
+
 namespace orxonox // tolua_export
 { // tolua_export
     class PlayerInfo; // Forward declaration
@@ -148,7 +152,7 @@
         /// Surrogate for the destructor
         Loki::ObjScopeGuardImpl0<GUIManager, void (GUIManager::*)()> destroyer_;
 
-#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
+#ifdef CEGUI_OLD_VERSION
         CEGUI::OgreCEGUIRenderer*            guiRenderer_;      //!< CEGUI's interface to the Ogre Engine
         CEGUI::ResourceProvider*             resourceProvider_; //!< CEGUI's resource provider
         static const bool                    CEGUIVERSION7 = false;




More information about the Orxonox-commit mailing list