[Orxonox-commit 5009] r9675 - in code/trunk: . cmake/tools src src/libraries/core src/libraries/util src/modules/objects src/orxonox/chat src/orxonox/graphics
landauf at orxonox.net
landauf at orxonox.net
Thu Sep 26 23:03:33 CEST 2013
Author: landauf
Date: 2013-09-26 23:03:33 +0200 (Thu, 26 Sep 2013)
New Revision: 9675
Modified:
code/trunk/
code/trunk/cmake/tools/FindCEGUI.cmake
code/trunk/src/OrxonoxConfig.h.in
code/trunk/src/libraries/core/CorePrereqs.h
code/trunk/src/libraries/core/GUIManager.cc
code/trunk/src/libraries/core/GUIManager.h
code/trunk/src/libraries/core/GraphicsManager.cc
code/trunk/src/libraries/core/GraphicsManager.h
code/trunk/src/libraries/core/Resource.cc
code/trunk/src/libraries/util/Exception.cc
code/trunk/src/modules/objects/Planet.cc
code/trunk/src/orxonox/chat/ChatInputHandler.cc
code/trunk/src/orxonox/chat/ChatInputHandler.h
code/trunk/src/orxonox/graphics/Model.cc
Log:
merged branch 'libs' back to trunk. orxonox now compiles and runs with ogre 1.8 and it compiles (but doesn't run) with cegui 0.8
Property changes on: code/trunk
___________________________________________________________________
Modified: svn:mergeinfo
- /code/branches/Racingbot:9388-9513
/code/branches/ai:6592-7033
/code/branches/ai2:8721-8880
/code/branches/bigships:8137-8588
/code/branches/buildsystem:1874-2276,2278-2400
/code/branches/buildsystem2:2506-2658
/code/branches/buildsystem3:2662-2708
/code/branches/ceguilua:1802-1808
/code/branches/chat:6527-6797
/code/branches/chat2:6836-6910
/code/branches/console:5941-6104
/code/branches/consolecommands2:6451-7178
/code/branches/consolecommands3:7178-7283
/code/branches/core3:1572-1739
/code/branches/core4:3221-3224,3227,3234-3238,3242,3244-3250,3252-3254,3256,3259-3261,3264-3265,3268-3275,3277-3278,3280,3284-3285,3287,3289-3294,3305,3309-3310
/code/branches/core5:5768-5928,6009
/code/branches/core6:9552-9666
/code/branches/data_cleanup:7537-7686
/code/branches/doc:7290-7400
/code/branches/dockingsystem:8101-8192
/code/branches/dockingsystem2:8196-8560
/code/branches/dynamicmatch:6584-7030
/code/branches/environment3:8887-8975
/code/branches/formation:8885-8991
/code/branches/formationupdate:9580-9624
/code/branches/fps:6591-7072
/code/branches/gamecontent:8893-8968
/code/branches/gameimmersion:8102-8577
/code/branches/gamestate:6430-6572,6621-6661
/code/branches/gamestates2:6594-6745
/code/branches/gametypes:2826-3031
/code/branches/gcc43:1580
/code/branches/gui:1635-1723,2795-2894
/code/branches/hud:8883-8986
/code/branches/hudelements:6584-6941
/code/branches/hudimprovements:7920-8672
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/ipv6:7293-7458
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/largeShip1:9384-9515
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/lod:6586-6911
/code/branches/lodfinal:2372-2411
/code/branches/mac_osx:7789-8128,8135
/code/branches/map:2801-3086,3089
/code/branches/masterserver:7502-7738
/code/branches/masterserverfix:8933-8936
/code/branches/menu:5941-6146,6148,7536-7687
/code/branches/menue:8884-8976
/code/branches/miniprojects:2754-2824
/code/branches/netp2:2835-2988
/code/branches/netp3:2988-3082
/code/branches/netp6:3214-3302
/code/branches/network:2356
/code/branches/network2:6434-6465
/code/branches/network3:7196-7344
/code/branches/network4:7497-7755
/code/branches/network5:7757-7781
/code/branches/network6:7823-8315
/code/branches/network64:2210-2355
/code/branches/newlevel2012:9033-9244
/code/branches/notifications:7314-7401
/code/branches/objecthierarchy:1911-2085,2100,2110-2169
/code/branches/objecthierarchy2:2171-2479
/code/branches/ois_update:7506-7788
/code/branches/output:8739-8857
/code/branches/overlay:2117-2385
/code/branches/pCuts:9023-9284
/code/branches/particles:2829-3085
/code/branches/particles2:6050-6106,6109
/code/branches/pch:3113-3194
/code/branches/physics:1912-2055,2107-2439
/code/branches/physics_merge:2436-2457
/code/branches/pickup:8145-8555
/code/branches/pickup2:5942-6405
/code/branches/pickup2012:9029-9189
/code/branches/pickup3:6418-6523
/code/branches/pickup4:6594-6710
/code/branches/pickups:1926-2086,2127,2827-2915
/code/branches/pickups2:2107-2497,2915-3071
/code/branches/png2:7262-7263
/code/branches/portals:8087-8455
/code/branches/portals2:8460-8602
/code/branches/ppspickups1:6552-6708
/code/branches/ppspickups2:6527-6532,6554-6709
/code/branches/ppspickups3:6757-6997
/code/branches/ppspickups4:7003-7089
/code/branches/presentation:2369-2652,2654-2660,7736-7786,8500-8705
/code/branches/presentation2:6106-6416,7787-7800
/code/branches/presentation2011:8974-9015
/code/branches/presentation2012:9189-9268
/code/branches/presentation2012merge:9266-9347
/code/branches/presentation3:6913-7162
/code/branches/presentationHS12:9481-9525
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/releasetodo:7614-7647
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/rocket2:6953-6970
/code/branches/script_trigger:1295-1953,1955
/code/branches/shipSelection:9038-9206
/code/branches/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound2012:9205-9214
/code/branches/sound3:5941-6102
/code/branches/spaceNavigation:9381-9497
/code/branches/spaceboundaries:8085-8457
/code/branches/spaceboundaries2:8460-8613
/code/branches/spacerace:8182-8630
/code/branches/spaceraceTwo:8881-8996
/code/branches/steering:5949-6091,8140-8595
/code/branches/surfaceRace:9028-9199
/code/branches/testing:9015-9549
/code/branches/tetris:8100-8563
/code/branches/turret:9380-9501
/code/branches/tutoriallevel:7827-8370
/code/branches/tutoriallevel2:8370-8452
/code/branches/tutoriallevel3:8453-8636
/code/branches/unity_build:8440-8716
/code/branches/usability:7915-8078
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weapons:2897-3051,8143-8591
/code/branches/weaponsystem:2742-2890
+ /code/branches/Racingbot:9388-9513
/code/branches/ai:6592-7033
/code/branches/ai2:8721-8880
/code/branches/bigships:8137-8588
/code/branches/buildsystem:1874-2276,2278-2400
/code/branches/buildsystem2:2506-2658
/code/branches/buildsystem3:2662-2708
/code/branches/ceguilua:1802-1808
/code/branches/chat:6527-6797
/code/branches/chat2:6836-6910
/code/branches/console:5941-6104
/code/branches/consolecommands2:6451-7178
/code/branches/consolecommands3:7178-7283
/code/branches/core3:1572-1739
/code/branches/core4:3221-3224,3227,3234-3238,3242,3244-3250,3252-3254,3256,3259-3261,3264-3265,3268-3275,3277-3278,3280,3284-3285,3287,3289-3294,3305,3309-3310
/code/branches/core5:5768-5928,6009
/code/branches/core6:9552-9666
/code/branches/data_cleanup:7537-7686
/code/branches/doc:7290-7400
/code/branches/dockingsystem:8101-8192
/code/branches/dockingsystem2:8196-8560
/code/branches/dynamicmatch:6584-7030
/code/branches/environment3:8887-8975
/code/branches/formation:8885-8991
/code/branches/formationupdate:9580-9624
/code/branches/fps:6591-7072
/code/branches/gamecontent:8893-8968
/code/branches/gameimmersion:8102-8577
/code/branches/gamestate:6430-6572,6621-6661
/code/branches/gamestates2:6594-6745
/code/branches/gametypes:2826-3031
/code/branches/gcc43:1580
/code/branches/gui:1635-1723,2795-2894
/code/branches/hud:8883-8986
/code/branches/hudelements:6584-6941
/code/branches/hudimprovements:7920-8672
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/ipv6:7293-7458
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/largeShip1:9384-9515
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/libs:9668-9674
/code/branches/lod:6586-6911
/code/branches/lodfinal:2372-2411
/code/branches/mac_osx:7789-8128,8135
/code/branches/map:2801-3086,3089
/code/branches/masterserver:7502-7738
/code/branches/masterserverfix:8933-8936
/code/branches/menu:5941-6146,6148,7536-7687
/code/branches/menue:8884-8976
/code/branches/miniprojects:2754-2824
/code/branches/netp2:2835-2988
/code/branches/netp3:2988-3082
/code/branches/netp6:3214-3302
/code/branches/network:2356
/code/branches/network2:6434-6465
/code/branches/network3:7196-7344
/code/branches/network4:7497-7755
/code/branches/network5:7757-7781
/code/branches/network6:7823-8315
/code/branches/network64:2210-2355
/code/branches/newlevel2012:9033-9244
/code/branches/notifications:7314-7401
/code/branches/objecthierarchy:1911-2085,2100,2110-2169
/code/branches/objecthierarchy2:2171-2479
/code/branches/ois_update:7506-7788
/code/branches/output:8739-8857
/code/branches/overlay:2117-2385
/code/branches/pCuts:9023-9284
/code/branches/particles:2829-3085
/code/branches/particles2:6050-6106,6109
/code/branches/pch:3113-3194
/code/branches/physics:1912-2055,2107-2439
/code/branches/physics_merge:2436-2457
/code/branches/pickup:8145-8555
/code/branches/pickup2:5942-6405
/code/branches/pickup2012:9029-9189
/code/branches/pickup3:6418-6523
/code/branches/pickup4:6594-6710
/code/branches/pickups:1926-2086,2127,2827-2915
/code/branches/pickups2:2107-2497,2915-3071
/code/branches/png2:7262-7263
/code/branches/portals:8087-8455
/code/branches/portals2:8460-8602
/code/branches/ppspickups1:6552-6708
/code/branches/ppspickups2:6527-6532,6554-6709
/code/branches/ppspickups3:6757-6997
/code/branches/ppspickups4:7003-7089
/code/branches/presentation:2369-2652,2654-2660,7736-7786,8500-8705
/code/branches/presentation2:6106-6416,7787-7800
/code/branches/presentation2011:8974-9015
/code/branches/presentation2012:9189-9268
/code/branches/presentation2012merge:9266-9347
/code/branches/presentation3:6913-7162
/code/branches/presentationHS12:9481-9525
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/releasetodo:7614-7647
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/rocket2:6953-6970
/code/branches/script_trigger:1295-1953,1955
/code/branches/shipSelection:9038-9206
/code/branches/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound2012:9205-9214
/code/branches/sound3:5941-6102
/code/branches/spaceNavigation:9381-9497
/code/branches/spaceboundaries:8085-8457
/code/branches/spaceboundaries2:8460-8613
/code/branches/spacerace:8182-8630
/code/branches/spaceraceTwo:8881-8996
/code/branches/steering:5949-6091,8140-8595
/code/branches/surfaceRace:9028-9199
/code/branches/testing:9015-9549
/code/branches/tetris:8100-8563
/code/branches/turret:9380-9501
/code/branches/tutoriallevel:7827-8370
/code/branches/tutoriallevel2:8370-8452
/code/branches/tutoriallevel3:8453-8636
/code/branches/unity_build:8440-8716
/code/branches/usability:7915-8078
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weapons:2897-3051,8143-8591
/code/branches/weaponsystem:2742-2890
Modified: code/trunk/cmake/tools/FindCEGUI.cmake
===================================================================
--- code/trunk/cmake/tools/FindCEGUI.cmake 2013-09-26 20:37:57 UTC (rev 9674)
+++ code/trunk/cmake/tools/FindCEGUI.cmake 2013-09-26 21:03:33 UTC (rev 9675)
@@ -30,18 +30,33 @@
INCLUDE(FindPackageHandleAdvancedArgs)
INCLUDE(HandleLibraryTypes)
-# Find CEGUI headers
-FIND_PATH(CEGUI_INCLUDE_DIR CEGUI.h
+# Determine CEGUI's version
+FIND_FILE(CEGUI_VERSION_FILE CEGUIVersion.h Version.h
PATHS $ENV{CEGUIDIR}
PATH_SUFFIXES include include/CEGUI
)
+DETERMINE_VERSION(CEGUI ${CEGUI_VERSION_FILE})
-# Inspect CEGUIVersion.h for the version number
-DETERMINE_VERSION(CEGUI ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h)
+# Find CEGUI headers
+COMPARE_VERSION_STRINGS("${CEGUI_VERSION}" "0.8" _version_0_8_compare TRUE)
+# Version 0.8 introduced a new directory and file naming convention
+IF(_version_0_8_compare GREATER -1)
+ # 0.8 and newer
+ FIND_PATH(CEGUI_INCLUDE_DIR CEGUI/CEGUI.h
+ PATHS $ENV{CEGUIDIR}
+ PATH_SUFFIXES include
+ )
+ELSE()
+ # 0.8 and older
+ FIND_PATH(CEGUI_INCLUDE_DIR CEGUI.h
+ PATHS $ENV{CEGUIDIR}
+ PATH_SUFFIXES include include/CEGUI
+ )
+ENDIF()
# Find CEGUI library
FIND_LIBRARY(CEGUI_LIBRARY_OPTIMIZED
- NAMES CEGUIBase CEGUI
+ NAMES CEGUIBase CEGUI CEGUIBase-0
PATHS $ENV{CEGUIDIR}
PATH_SUFFIXES lib bin
)
@@ -54,16 +69,17 @@
)
# Find CEGUILua headers
-FIND_PATH(CEGUILUA_INCLUDE_DIR CEGUILua.h
+FIND_PATH(CEGUILUA_INCLUDE_DIR CEGUILua.h Functor.h
PATHS
$ENV{CEGUIDIR}
$ENV{CEGUILUADIR}
${CEGUI_INCLUDE_DIR}/ScriptingModules/LuaScriptModule
+ ${CEGUI_INCLUDE_DIR}/CEGUI/ScriptModules/Lua
PATH_SUFFIXES include include/CEGUI
)
# Find CEGUILua libraries
FIND_LIBRARY(CEGUILUA_LIBRARY_OPTIMIZED
- NAMES CEGUILua CEGUILuaScriptModule
+ NAMES CEGUILua CEGUILuaScriptModule CEGUILuaScriptModule-0
PATHS $ENV{CEGUIDIR} $ENV{CEGUILUADIR}
PATH_SUFFIXES lib bin
)
@@ -81,6 +97,7 @@
${CEGUILUA_INCLUDE_DIR}
# For newer CEGUI versions >= 0.7
${CEGUILUA_INCLUDE_DIR}/support/tolua++
+ ${DEP_INCLUDE_DIR}/tolua++/include
# For Mac OS X, tolua++ is a separate framework in the dependency package
${DEP_FRAMEWORK_DIR}
NO_DEFAULT_PATH # Don't attempt to find tolua++ installed on the system
@@ -98,10 +115,10 @@
)
# Newer versions of CEGUI have the renderer for OGRE shipped with them
-COMPARE_VERSION_STRINGS("${CEGUI_VERSION}" "0.7" _version_compare TRUE)
-IF(_version_compare GREATER -1)
+COMPARE_VERSION_STRINGS("${CEGUI_VERSION}" "0.7" _version_0_7_compare TRUE)
+IF(_version_0_7_compare GREATER -1)
# Find CEGUI OGRE Renderer headers
- FIND_PATH(CEGUI_OGRE_RENDERER_INCLUDE_DIR CEGUIOgreRenderer.h
+ FIND_PATH(CEGUI_OGRE_RENDERER_INCLUDE_DIR CEGUIOgreRenderer.h Renderer.h
PATHS
$ENV{CEGUIDIR}
$ENV{CEGUIOGRERENDERERDIR}
@@ -110,7 +127,7 @@
)
# Find CEGUI OGRE Renderer libraries
FIND_LIBRARY(CEGUI_OGRE_RENDERER_LIBRARY_OPTIMIZED
- NAMES CEGUIOgreRenderer
+ NAMES CEGUIOgreRenderer CEGUIOgreRenderer-0
PATHS $ENV{CEGUIDIR} $ENV{CEGUIOGRERENDERERDIR}
PATH_SUFFIXES lib bin
)
Modified: code/trunk/src/OrxonoxConfig.h.in
===================================================================
--- code/trunk/src/OrxonoxConfig.h.in 2013-09-26 20:37:57 UTC (rev 9674)
+++ code/trunk/src/OrxonoxConfig.h.in 2013-09-26 21:03:33 UTC (rev 9675)
@@ -245,4 +245,8 @@
# endif
#endif
+// CEGUI changed its file naming convention in version 0.8 thus we cannot even include CEGUI's Version.h file before knowing its version
+#include <@CEGUI_VERSION_FILE@>
+#define CEGUI_VERSION ((CEGUI_VERSION_MAJOR << 16) | (CEGUI_VERSION_MINOR << 8) | CEGUI_VERSION_PATCH)
+
#endif /* _OrxonoxConfig_H__ */
Modified: code/trunk/src/libraries/core/CorePrereqs.h
===================================================================
--- code/trunk/src/libraries/core/CorePrereqs.h 2013-09-26 20:37:57 UTC (rev 9674)
+++ code/trunk/src/libraries/core/CorePrereqs.h 2013-09-26 21:03:33 UTC (rev 9675)
@@ -37,7 +37,6 @@
#include "OrxonoxConfig.h"
#include <boost/version.hpp>
-#include <CEGUIVersion.h>
//-----------------------------------------------------------------------
// Shared library settings
Modified: code/trunk/src/libraries/core/GUIManager.cc
===================================================================
--- code/trunk/src/libraries/core/GUIManager.cc 2013-09-26 20:37:57 UTC (rev 9674)
+++ code/trunk/src/libraries/core/GUIManager.cc 2013-09-26 21:03:33 UTC (rev 9675)
@@ -35,35 +35,57 @@
#include <OgreRenderQueue.h>
#include <OgreRenderWindow.h>
-#include <CEGUIDefaultLogger.h>
-#include <CEGUIExceptions.h>
-#include <CEGUIFontManager.h>
-#include <CEGUIInputEvent.h>
-#include <CEGUIMouseCursor.h>
-#include <CEGUIResourceProvider.h>
-#include <CEGUISystem.h>
-#include <CEGUIWindow.h>
-#include <CEGUIWindowManager.h>
-#include <CEGUIXMLAttributes.h>
-#include <elements/CEGUIListbox.h>
-#include <elements/CEGUIListboxItem.h>
+#if CEGUI_VERSION >= 0x000800
+# include <CEGUI/DefaultLogger.h>
+# include <CEGUI/Exceptions.h>
+# include <CEGUI/FontManager.h>
+# include <CEGUI/InputEvent.h>
+# include <CEGUI/MouseCursor.h>
+# include <CEGUI/ResourceProvider.h>
+# include <CEGUI/System.h>
+# include <CEGUI/Window.h>
+# include <CEGUI/WindowManager.h>
+# include <CEGUI/XMLAttributes.h>
+# include <CEGUI/widgets/Listbox.h>
+# include <CEGUI/widgets/ListboxItem.h>
+#else
+# include <CEGUIDefaultLogger.h>
+# include <CEGUIExceptions.h>
+# include <CEGUIFontManager.h>
+# include <CEGUIInputEvent.h>
+# include <CEGUIMouseCursor.h>
+# include <CEGUIResourceProvider.h>
+# include <CEGUISystem.h>
+# include <CEGUIWindow.h>
+# include <CEGUIWindowManager.h>
+# include <CEGUIXMLAttributes.h>
+# include <elements/CEGUIListbox.h>
+# include <elements/CEGUIListboxItem.h>
+#endif
#ifdef ORXONOX_OLD_CEGUI
-# include <CEGUILua.h>
-# include <ogreceguirenderer/OgreCEGUIRenderer.h>
+# include <CEGUILua.h>
+# include <ogreceguirenderer/OgreCEGUIRenderer.h>
extern "C" {
-# include <lauxlib.h>
+# include <lauxlib.h>
}
#else
-# include <ScriptingModules/LuaScriptModule/CEGUILua.h>
-# include <RendererModules/Ogre/CEGUIOgreImageCodec.h>
-# include <RendererModules/Ogre/CEGUIOgreRenderer.h>
-# include <RendererModules/Ogre/CEGUIOgreResourceProvider.h>
-# include <OgreCamera.h>
-# include <OgreRenderQueueListener.h>
-# include <OgreRenderSystem.h>
-# include <OgreRoot.h>
-# include <OgreSceneManager.h>
+# if CEGUI_VERSION >= 0x000800
+# include <CEGUI/ScriptModules/Lua/ScriptModule.h>
+# include <CEGUI/RendererModules/Ogre/ImageCodec.h>
+# include <CEGUI/RendererModules/Ogre/Renderer.h>
+# include <CEGUI/RendererModules/Ogre/ResourceProvider.h>
+# else
+# include <ScriptingModules/LuaScriptModule/CEGUILua.h>
+# include <RendererModules/Ogre/CEGUIOgreImageCodec.h>
+# include <RendererModules/Ogre/CEGUIOgreRenderer.h>
+# include <RendererModules/Ogre/CEGUIOgreResourceProvider.h>
+# endif
+# include <OgreCamera.h>
+# include <OgreRenderQueueListener.h>
+# include <OgreRenderSystem.h>
+# include <OgreRoot.h>
+# include <OgreSceneManager.h>
#endif
#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(ORXONOX_COMPILER_MINGW)
@@ -207,7 +229,11 @@
{
if (id == Ogre::RENDER_QUEUE_OVERLAY && invocation.empty())
{
+#if CEGUI_VERSION >= 0x000800
+ CEGUI::System::getSingleton().renderAllGUIContexts();
+#else
CEGUI::System::getSingleton().renderGUI();
+#endif
// Important workaround! (at least required by CEGUI 0.7.5)
// If we don't reset the scissor test, OGRE will only render overlays
@@ -331,7 +357,11 @@
}
// Align CEGUI mouse with OIS mouse
+#if CEGUI_VERSION >= 0x000800
+ guiSystem_->getDefaultGUIContext().injectMousePosition((float)mousePosition.first, (float)mousePosition.second);
+#else
guiSystem_->injectMousePosition((float)mousePosition.first, (float)mousePosition.second);
+#endif
// Initialise the Lua framework and load the schemes
orxout(user_info) << "Loading user interface..." << endl;
@@ -343,9 +373,15 @@
this->hudRootWindow_ = CEGUI::WindowManager::getSingleton().createWindow("DefaultWindow", "HUDRootWindow");
this->menuRootWindow_ = CEGUI::WindowManager::getSingleton().createWindow("DefaultWindow", "MenuRootWindow");
// And connect them
+#if CEGUI_VERSION >= 0x000800
+ CEGUI::System::getSingleton().getDefaultGUIContext().setRootWindow(this->rootWindow_);
+ this->rootWindow_->addChild(this->hudRootWindow_);
+ this->rootWindow_->addChild(this->menuRootWindow_);
+#else
CEGUI::System::getSingleton().setGUISheet(this->rootWindow_);
this->rootWindow_->addChildWindow(this->hudRootWindow_);
this->rootWindow_->addChildWindow(this->menuRootWindow_);
+#endif
// No background to start with (sets the alpha value to 0)
this->setBackgroundImage("");
@@ -412,7 +448,7 @@
void GUIManager::preUpdate(const Clock& time)
{
assert(guiSystem_);
- this->protectedCall(boost::bind(&CEGUI::System::injectTimePulse, _1, time.getDeltaTime()));
+ this->protectedCeguiSystemCall(boost::bind(&CEGUI::System::injectTimePulse, _1, time.getDeltaTime()));
}
/**
@@ -587,13 +623,22 @@
void GUIManager::buttonPressed(const KeyEvent& evt)
{
- this->protectedCall(boost::bind(&CEGUI::System::injectKeyDown, _1, evt.getKeyCode()));
- this->protectedCall(boost::bind(&CEGUI::System::injectChar, _1, evt.getText()));
+#if CEGUI_VERSION >= 0x000800
+ this->protectedCeguiContextCall(boost::bind(&CEGUI::GUIContext::injectKeyDown, _1, (CEGUI::Key::Scan) evt.getKeyCode())); // TODO: will this cast always work?
+ this->protectedCeguiContextCall(boost::bind(&CEGUI::GUIContext::injectChar, _1, evt.getText()));
+#else
+ this->protectedCeguiSystemCall(boost::bind(&CEGUI::System::injectKeyDown, _1, evt.getKeyCode()));
+ this->protectedCeguiSystemCall(boost::bind(&CEGUI::System::injectChar, _1, evt.getText()));
+#endif
}
void GUIManager::buttonReleased(const KeyEvent& evt)
{
- this->protectedCall(boost::bind(&CEGUI::System::injectKeyUp, _1, evt.getKeyCode()));
+#if CEGUI_VERSION >= 0x000800
+ this->protectedCeguiContextCall(boost::bind(&CEGUI::GUIContext::injectKeyUp, _1, (CEGUI::Key::Scan) evt.getKeyCode())); // TODO: will this cast always work?
+#else
+ this->protectedCeguiSystemCall(boost::bind(&CEGUI::System::injectKeyUp, _1, evt.getKeyCode()));
+#endif
}
/**
@@ -607,7 +652,11 @@
*/
void GUIManager::buttonPressed(MouseButtonCode::ByEnum id)
{
- this->protectedCall(boost::bind(&CEGUI::System::injectMouseButtonDown, _1, convertButton(id)));
+#if CEGUI_VERSION >= 0x000800
+ this->protectedCeguiContextCall(boost::bind(&CEGUI::GUIContext::injectMouseButtonDown, _1, convertButton(id)));
+#else
+ this->protectedCeguiSystemCall(boost::bind(&CEGUI::System::injectMouseButtonDown, _1, convertButton(id)));
+#endif
}
/**
@@ -621,17 +670,29 @@
*/
void GUIManager::buttonReleased(MouseButtonCode::ByEnum id)
{
- this->protectedCall(boost::bind(&CEGUI::System::injectMouseButtonUp, _1, convertButton(id)));
+#if CEGUI_VERSION >= 0x000800
+ this->protectedCeguiContextCall(boost::bind(&CEGUI::GUIContext::injectMouseButtonUp, _1, convertButton(id)));
+#else
+ this->protectedCeguiSystemCall(boost::bind(&CEGUI::System::injectMouseButtonUp, _1, convertButton(id)));
+#endif
}
void GUIManager::mouseMoved(IntVector2 abs, IntVector2 rel, IntVector2 clippingSize)
{
- this->protectedCall(boost::bind(&CEGUI::System::injectMousePosition, _1, (float)abs.x, (float)abs.y));
+#if CEGUI_VERSION >= 0x000800
+ this->protectedCeguiContextCall(boost::bind(&CEGUI::GUIContext::injectMousePosition, _1, (float)abs.x, (float)abs.y));
+#else
+ this->protectedCeguiSystemCall(boost::bind(&CEGUI::System::injectMousePosition, _1, (float)abs.x, (float)abs.y));
+#endif
}
void GUIManager::mouseScrolled(int abs, int rel)
{
- this->protectedCall(boost::bind(&CEGUI::System::injectMouseWheelChange, _1, (float)sgn(rel) * this->numScrollLines_));
+#if CEGUI_VERSION >= 0x000800
+ this->protectedCeguiContextCall(boost::bind(&CEGUI::GUIContext::injectMouseWheelChange, _1, (float)sgn(rel) * this->numScrollLines_));
+#else
+ this->protectedCeguiSystemCall(boost::bind(&CEGUI::System::injectMouseWheelChange, _1, (float)sgn(rel) * this->numScrollLines_));
+#endif
}
/**
@@ -639,7 +700,11 @@
*/
void GUIManager::mouseLeft()
{
- this->protectedCall(boost::bind(&CEGUI::System::injectMouseLeaves, _1));
+#if CEGUI_VERSION >= 0x000800
+ this->protectedCeguiContextCall(boost::bind(&CEGUI::GUIContext::injectMouseLeaves, _1));
+#else
+ this->protectedCeguiSystemCall(boost::bind(&CEGUI::System::injectMouseLeaves, _1));
+#endif
}
/**
@@ -691,12 +756,12 @@
@return
True if input was handled, false otherwise. A caught exception yields true.
*/
- template <typename FunctionType>
- bool GUIManager::protectedCall(FunctionType function)
+ template <typename FunctionType, typename ObjectType>
+ bool GUIManager::protectedCall(FunctionType function, ObjectType object)
{
try
{
- return function(this->guiSystem_);
+ return function(object);
}
catch (CEGUI::ScriptException& ex)
{
@@ -706,6 +771,20 @@
}
}
+ template <typename FunctionType>
+ bool GUIManager::protectedCeguiSystemCall(FunctionType function)
+ {
+ return this->protectedCall(function, this->guiSystem_);
+ }
+
+#if CEGUI_VERSION >= 0x000800
+ template <typename FunctionType>
+ bool GUIManager::protectedCeguiContextCall(FunctionType function)
+ {
+ return this->protectedCall(function, this->guiSystem_->getDefaultGUIContext());
+ }
+#endif
+
/**
@brief
Subscribe the input function to the input event for the input window.
@@ -761,7 +840,11 @@
*/
void GUIManager::windowResized(unsigned int newWidth, unsigned int newHeight)
{
+#if CEGUI_VERSION >= 0x000800
+ this->guiRenderer_->setDisplaySize(CEGUI::Sizef((float)newWidth, (float)newHeight));
+#else
this->guiRenderer_->setDisplaySize(CEGUI::Size((float)newWidth, (float)newHeight));
+#endif
}
/**
@@ -811,7 +894,11 @@
if(CEGUI::FontManager::getSingleton().isDefined(name)) // If a font with that name already exists.
return;
+ #if CEGUI_VERSION >= 0x000800
+ CEGUI::FontManager::getSingleton().createFreeTypeFont(name, (float)size, true, fontName, "", CEGUI::ASM_Both, CEGUI::Sizef(800.0f, 600.0f));
+ #else
CEGUI::FontManager::getSingleton().createFreeTypeFont(name, (float)size, true, fontName, "", true, 800.0f, 600.0f);
+ #endif
#endif
}
Modified: code/trunk/src/libraries/core/GUIManager.h
===================================================================
--- code/trunk/src/libraries/core/GUIManager.h 2013-09-26 20:37:57 UTC (rev 9674)
+++ code/trunk/src/libraries/core/GUIManager.h 2013-09-26 21:03:33 UTC (rev 9675)
@@ -39,8 +39,15 @@
#include <map>
#include <string>
-#include <CEGUIForwardRefs.h>
-#include <CEGUIVersion.h>
+
+#if CEGUI_VERSION >= 0x000800
+# include <CEGUI/ForwardRefs.h>
+# include <CEGUI/Version.h>
+#else
+# include <CEGUIForwardRefs.h>
+# include <CEGUIVersion.h>
+#endif
+
#include <boost/shared_ptr.hpp>
#include "util/DestructionHelper.h"
@@ -148,9 +155,17 @@
void executeCode(const std::string& str);
+ template <typename FunctionType, typename ObjectType>
+ bool protectedCall(FunctionType function, ObjectType object);
+
template <typename FunctionType>
- bool protectedCall(FunctionType function);
+ bool protectedCeguiSystemCall(FunctionType function);
+#if CEGUI_VERSION >= 0x000800
+ template <typename FunctionType>
+ bool protectedCeguiContextCall(FunctionType function);
+#endif
+
void changedCeguiOutputLevel();
// keyHandler functions
Modified: code/trunk/src/libraries/core/GraphicsManager.cc
===================================================================
--- code/trunk/src/libraries/core/GraphicsManager.cc 2013-09-26 20:37:57 UTC (rev 9674)
+++ code/trunk/src/libraries/core/GraphicsManager.cc 2013-09-26 21:03:33 UTC (rev 9675)
@@ -401,9 +401,17 @@
@param logName
The name of this log (so you can have several listeners
for different logs, and identify them)
+ @param skipThisMessage
+ If set to true by the messageLogged() implementation message will not be logged
*/
+#if OGRE_VERSION >= 0x010800
void GraphicsManager::messageLogged(const std::string& message,
+ Ogre::LogMessageLevel lml, bool maskDebug, const std::string& logName, bool& skipThisMessage)
+ // TODO: do we have to ignore the message if skipThisMessage is set?
+#else
+ void GraphicsManager::messageLogged(const std::string& message,
Ogre::LogMessageLevel lml, bool maskDebug, const std::string& logName)
+#endif
{
OutputLevel orxonoxLevel;
std::string introduction;
Modified: code/trunk/src/libraries/core/GraphicsManager.h
===================================================================
--- code/trunk/src/libraries/core/GraphicsManager.h 2013-09-26 20:37:57 UTC (rev 9674)
+++ code/trunk/src/libraries/core/GraphicsManager.h 2013-09-26 21:03:33 UTC (rev 9675)
@@ -107,8 +107,11 @@
void loadRenderer();
// event from Ogre::LogListener
- void messageLogged(const std::string& message, Ogre::LogMessageLevel lml,
- bool maskDebug, const std::string& logName);
+#if OGRE_VERSION >= 0x010800
+ void messageLogged(const std::string& message, Ogre::LogMessageLevel lml, bool maskDebug, const std::string& logName, bool& skipThisMessage);
+#else
+ void messageLogged(const std::string& message, Ogre::LogMessageLevel lml, bool maskDebug, const std::string& logName);
+#endif
// console commands
void printScreen();
Modified: code/trunk/src/libraries/core/Resource.cc
===================================================================
--- code/trunk/src/libraries/core/Resource.cc 2013-09-26 20:37:57 UTC (rev 9674)
+++ code/trunk/src/libraries/core/Resource.cc 2013-09-26 21:03:33 UTC (rev 9675)
@@ -100,7 +100,11 @@
ptr->basename = it->basename;
ptr->group = group;
ptr->size = it->uncompressedSize;
+#if OGRE_VERSION >= 0x010800
+ if (dynamic_cast<const Ogre::FileSystemArchive*>(it->archive) != NULL)
+#else
if (dynamic_cast<Ogre::FileSystemArchive*>(it->archive) != NULL)
+#endif
{
boost::filesystem::path base(it->archive->getName());
base /= it->filename;
Modified: code/trunk/src/libraries/util/Exception.cc
===================================================================
--- code/trunk/src/libraries/util/Exception.cc 2013-09-26 20:37:57 UTC (rev 9674)
+++ code/trunk/src/libraries/util/Exception.cc 2013-09-26 21:03:33 UTC (rev 9675)
@@ -35,7 +35,13 @@
#include "Exception.h"
#include <cstddef>
-#include <CEGUIExceptions.h>
+
+#if CEGUI_VERSION >= 0x000800
+# include <CEGUI/Exceptions.h>
+#else
+# include <CEGUIExceptions.h>
+#endif
+
#include "Output.h"
namespace orxonox
Modified: code/trunk/src/modules/objects/Planet.cc
===================================================================
--- code/trunk/src/modules/objects/Planet.cc 2013-09-26 20:37:57 UTC (rev 9674)
+++ code/trunk/src/modules/objects/Planet.cc 2013-09-26 21:03:33 UTC (rev 9675)
@@ -107,11 +107,13 @@
float scaleFactor = this->getScale();
- #if OGRE_VERSION >= 0x010700
+#if OGRE_VERSION >= 0x010800
+ Ogre::ProgressiveMesh::LodValueList distList;
+#elif OGRE_VERSION >= 0x010700
Ogre::Mesh::LodValueList distList;
- #else
+#else
Ogre::Mesh::LodDistanceList distList;
- #endif
+#endif
distList.push_back(10.0f*scaleFactor);
distList.push_back(19.0f*scaleFactor);
@@ -126,7 +128,12 @@
float reductionValue = 0.2f;
+#if OGRE_VERSION >= 0x010800
+ Ogre::ProgressiveMesh::generateLodLevels(this->mesh_.getEntity()->getMesh().get(), distList, Ogre::ProgressiveMesh::VRQ_PROPORTIONAL,
+ reductionValue);
+#else
this->mesh_.getEntity()->getMesh()->generateLodLevels(distList, Ogre::ProgressiveMesh::VRQ_PROPORTIONAL, reductionValue);
+#endif
billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->atmosphere_, Vector3(0,0,0));
this->attachOgreObject(this->billboard_.getBillboardSet());
Modified: code/trunk/src/orxonox/chat/ChatInputHandler.cc
===================================================================
--- code/trunk/src/orxonox/chat/ChatInputHandler.cc 2013-09-26 20:37:57 UTC (rev 9674)
+++ code/trunk/src/orxonox/chat/ChatInputHandler.cc 2013-09-26 21:03:33 UTC (rev 9675)
@@ -31,12 +31,21 @@
#include <cassert>
#include <cstddef>
#include <string>
-#include <CEGUIWindow.h>
-#include <CEGUIWindowManager.h>
-#include <elements/CEGUIListbox.h>
-#include <elements/CEGUIListboxItem.h>
-#include <elements/CEGUIListboxTextItem.h>
+#if CEGUI_VERSION >= 0x000800
+# include <CEGUI/Window.h>
+# include <CEGUI/WindowManager.h>
+# include <CEGUI/widgets/Listbox.h>
+# include <CEGUI/widgets/ListboxItem.h>
+# include <CEGUI/widgets/ListboxTextItem.h>
+#else
+# include <CEGUIWindow.h>
+# include <CEGUIWindowManager.h>
+# include <elements/CEGUIListbox.h>
+# include <elements/CEGUIListboxItem.h>
+# include <elements/CEGUIListboxTextItem.h>
+#endif
+
#include "util/ScopedSingletonManager.h"
#include "core/CoreIncludes.h"
#include "core/GUIManager.h"
@@ -118,11 +127,15 @@
this->inpbuf->registerListener(this, &ChatInputHandler::cursorHome, KeyCode::Home);
/* GET WINDOW POINTERS */
+#if CEGUI_VERSION >= 0x000800
+ input = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild( "orxonox/ChatBox/input" );
+ inputonly = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild( "orxonox/ChatBox-inputonly/input" );
+ CEGUI::Window *history = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild( "orxonox/ChatBox/history" );
+#else
input = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox/input" );
inputonly = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox-inputonly/input" );
-
- /* get pointer to the history window */
CEGUI::Window *history = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox/history" );
+#endif
/* cast it to a listbox */
lb_history = dynamic_cast<CEGUI::Listbox*>(history);
@@ -141,21 +154,21 @@
// three loops: red tones, blue tones and green tones
// reds
for( i = 0; i < NumberOfColors/3; ++i )
- { this->text_colors[ i ] = CEGUI::colour( red, green, blue );
+ { this->text_colors[ i ] = CEGUIColour( red, green, blue );
green += 0.2f, blue += 0.2f;
}
// greens
red = 0.5, green = 1, blue = 0.5;
for( ; i < NumberOfColors*2/3; ++i )
- { this->text_colors[ i ] = CEGUI::colour( red, green, blue );
+ { this->text_colors[ i ] = CEGUIColour( red, green, blue );
red += 0.2f, blue += 0.2f;
}
// blues
red = 0.5, green = 0.5, blue = 1;
for( ; i < NumberOfColors; ++i )
- { this->text_colors[ i ] = CEGUI::colour( red, green, blue );
+ { this->text_colors[ i ] = CEGUIColour( red, green, blue );
red += 0.2f, green += 0.2f;
}
}
@@ -272,15 +285,21 @@
if( this->fullchat )
{
/* adjust curser position - magic number 5 for font width */
- sub_adjust_dispoffset( (int)(this->input->getUnclippedInnerRect().getWidth()/6),
- cursorpos, assembled.length() );
+#if CEGUI_VERSION >= 0x000800
+ sub_adjust_dispoffset( (int)(this->input->getUnclippedInnerRect().get().getWidth()/6), cursorpos, assembled.length() );
+#else
+ sub_adjust_dispoffset( (int)(this->input->getUnclippedInnerRect().getWidth()/6), cursorpos, assembled.length() );
+#endif
this->input->setProperty( "Text", assembled.substr( disp_offset ) );
}
else
{
/* adjust curser position - magic number 5 for font width */
- sub_adjust_dispoffset( (int)(this->inputonly->getUnclippedInnerRect().getWidth()/6),
- cursorpos, assembled.length() );
+#if CEGUI_VERSION >= 0x000800
+ sub_adjust_dispoffset( (int)(this->inputonly->getUnclippedInnerRect().get().getWidth()/6), cursorpos, assembled.length() );
+#else
+ sub_adjust_dispoffset( (int)(this->inputonly->getUnclippedInnerRect().getWidth()/6), cursorpos, assembled.length() );
+#endif
this->inputonly->setProperty( "Text", assembled.substr( disp_offset) );
}
Modified: code/trunk/src/orxonox/chat/ChatInputHandler.h
===================================================================
--- code/trunk/src/orxonox/chat/ChatInputHandler.h 2013-09-26 20:37:57 UTC (rev 9674)
+++ code/trunk/src/orxonox/chat/ChatInputHandler.h 2013-09-26 21:03:33 UTC (rev 9675)
@@ -32,14 +32,27 @@
#include "OrxonoxPrereqs.h"
#include <string>
-#include <CEGUIForwardRefs.h>
-#include <CEGUIcolour.h>
+#if CEGUI_VERSION >= 0x000800
+# include <CEGUI/ForwardRefs.h>
+# include <CEGUI/Colour.h>
+#else
+# include <CEGUIForwardRefs.h>
+# include <CEGUIcolour.h>
+#endif
+
#include "util/Singleton.h"
#include "chat/ChatListener.h"
namespace orxonox // tolua_export
{ // tolua_export
+
+#if CEGUI_VERSION >= 0x000800
+ typedef CEGUI::Colour CEGUIColour;
+#else
+ typedef CEGUI::colour CEGUIColour;
+#endif
+
/* class to handle chat using an InputBuffer */
class _OrxonoxExport ChatInputHandler // tolua_export
: public Singleton<ChatInputHandler>, public ChatListener
@@ -54,7 +67,7 @@
/* colors for nickname coloring */
static const int NumberOfColors = 10;
- CEGUI::colour text_colors[ NumberOfColors ];
+ CEGUIColour text_colors[ NumberOfColors ];
/** input state */
InputState *inputState;
Modified: code/trunk/src/orxonox/graphics/Model.cc
===================================================================
--- code/trunk/src/orxonox/graphics/Model.cc 2013-09-26 20:37:57 UTC (rev 9674)
+++ code/trunk/src/orxonox/graphics/Model.cc 2013-09-26 21:03:33 UTC (rev 9675)
@@ -29,6 +29,7 @@
#include "Model.h"
#include <OgreEntity.h>
+#include <OgreProgressiveMesh.h>
#include "core/CoreIncludes.h"
#include "core/config/ConfigValueIncludes.h"
@@ -161,7 +162,9 @@
*/
orxout(verbose, context::lod) << "Setting lodLevel for " << this->meshSrc_<< " with lodLevel_: " << this->lodLevel_ <<" and volume: "<< volume << ":" << endl;
-#if OGRE_VERSION >= 0x010700
+#if OGRE_VERSION >= 0x010800
+ Ogre::ProgressiveMesh::LodValueList distList;
+#elif OGRE_VERSION >= 0x010700
Ogre::Mesh::LodValueList distList;
#else
Ogre::Mesh::LodDistanceList distList;
@@ -189,7 +192,12 @@
//Generiert LOD-Levels
+#if OGRE_VERSION >= 0x010800
+ Ogre::ProgressiveMesh::generateLodLevels(this->mesh_.getEntity()->getMesh().get(), distList, Ogre::ProgressiveMesh::VRQ_PROPORTIONAL,
+ this->lodReductionRate_);
+#else
this->mesh_.getEntity()->getMesh()->generateLodLevels(distList, Ogre::ProgressiveMesh::VRQ_PROPORTIONAL, this->lodReductionRate_);
+#endif
}
else
{
More information about the Orxonox-commit
mailing list