- Timestamp:
- Feb 25, 2011, 3:07:17 AM (14 years ago)
- Location:
- code/branches/kicklib
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/kicklib/cmake/tools/FindCEGUI.cmake
r7941 r7960 26 26 # > www.orxonox.net < 27 27 28 INCLUDE(CompareVersionStrings) 28 29 INCLUDE(DetermineVersion) 29 30 INCLUDE(FindPackageHandleAdvancedArgs) 30 31 INCLUDE(HandleLibraryTypes) 31 32 32 # Find CEGUI library33 # Find headers 33 34 FIND_PATH(CEGUI_INCLUDE_DIR CEGUI.h 34 35 PATHS $ENV{CEGUIDIR} 35 36 PATH_SUFFIXES include include/CEGUI CEGUI.framework/Headers 36 37 ) 38 39 # Inspect CEGUIVersion.h for the version number 40 DETERMINE_VERSION(CEGUI ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h) 41 42 # Find CEGUI library 37 43 FIND_LIBRARY(CEGUI_LIBRARY_OPTIMIZED 38 44 NAMES CEGUIBase CEGUI … … 72 78 ) 73 79 74 # Inspect CEGUIVersion.h for the version number 75 DETERMINE_VERSION(CEGUI ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h) 80 # Newer versions of CEGUI have the renderer for OGRE shipped with them 81 COMPARE_VERSION_STRINGS("${CEGUI_VERSION}" "0.7" _version_compare TRUE) 82 IF(_version_compare GREATER -1) 83 # Find CEGUI OGRE Renderer libraries 84 FIND_LIBRARY(CEGUI_OGRE_RENDERER_LIBRARY_OPTIMIZED 85 NAMES CEGUIOgreRenderer 86 PATHS $ENV{CEGUIDIR} 87 PATH_SUFFIXES lib bin 88 ) 89 FIND_LIBRARY(CEGUI_OGRE_RENDERER_LIBRARY_DEBUG 90 NAMES CEGUIOgreRendererd CEGUIOgreRenderer_d 91 PATHS $ENV{CEGUIDIR} 92 PATH_SUFFIXES lib bin 93 ) 94 SET(CEGUI_OGRE_RENDERER_LIBRARY_NAME CEGUI_OGRE_RENDERER_LIBRARY_OPTIMIZED) 95 ELSE() 96 SET(CEGUI_OGRE_RENDERER_BUILD_REQUIRED TRUE) 97 ENDIF() 76 98 77 99 # Handle the REQUIRED argument and set CEGUI_FOUND … … 82 104 CEGUILUA_LIBRARY_OPTIMIZED 83 105 CEGUI_TOLUA_LIBRARY_OPTIMIZED 106 ${CEGUI_OGRE_RENDERER_LIBRARY_NAME} 84 107 ) 85 108 … … 88 111 HANDLE_LIBRARY_TYPES(CEGUILUA) 89 112 HANDLE_LIBRARY_TYPES(CEGUI_TOLUA) 113 IF(NOT CEGUI_OGRE_RENDERER_BUILD_REQUIRED) 114 HANDLE_LIBRARY_TYPES(CEGUI_OGRE_RENDERER) 115 ENDIF() 90 116 91 117 MARK_AS_ADVANCED( … … 97 123 CEGUI_TOLUA_LIBRARY_OPTIMIZED 98 124 CEGUI_TOLUA_LIBRARY_DEBUG 125 CEGUI_OGRE_RENDERER_LIBRARY_OPTIMIZED 126 CEGUI_OGRE_RENDERER_LIBRARY_DEBUG 99 127 ) -
code/branches/kicklib/src/CMakeLists.txt
r7956 r7960 99 99 ENDIF() 100 100 101 ############## CEGUI OGRE Renderer ############## 102 103 IF(CEGUI_OGRE_RENDERER_BUILD_REQUIRED) 104 SET(CEGUI_OGRE_RENDERER_LIBRARY ogreceguirenderer_orxonox) 105 ENDIF() 106 101 107 ################### Tolua Bind ################## 102 108 -
code/branches/kicklib/src/external/CMakeLists.txt
r7941 r7960 25 25 ADD_SUBDIRECTORY(enet) 26 26 ADD_SUBDIRECTORY(loki) 27 ADD_SUBDIRECTORY(ogreceguirenderer) 27 IF(CEGUI_OGRE_RENDERER_BUILD_REQUIRED) 28 ADD_SUBDIRECTORY(ogreceguirenderer) 29 ENDIF() 28 30 ADD_SUBDIRECTORY(ois) 29 31 ADD_SUBDIRECTORY(tinyxml) -
code/branches/kicklib/src/libraries/core/CMakeLists.txt
r7948 r7960 93 93 ${CEGUILUA_LIBRARY} 94 94 ${CEGUI_TOLUA_LIBRARY} 95 ${CEGUI_OGRE_RENDERER_LIBRARY} 95 96 ${LUA5.1_LIBRARY} 96 97 cpptcl_orxonox 97 ogreceguirenderer_orxonox98 98 ois_orxonox 99 99 tinyxml_orxonox -
code/branches/kicklib/src/libraries/core/CorePrereqs.h
r7849 r7960 38 38 #include "OrxonoxConfig.h" 39 39 #include <boost/version.hpp> 40 #include <CEGUIVersion.h> 40 41 41 42 //----------------------------------------------------------------------- … … 305 306 class LuaScriptModule; 306 307 308 #if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7 307 309 class OgreCEGUIRenderer; 308 310 class OgreCEGUIResourceProvider; 309 311 class OgreCEGUITexture; 312 #else 313 class OgreRenderer; 314 class OgreResourceProvider; 315 class OgreImageCodec; 316 #endif 310 317 } 311 318 -
code/branches/kicklib/src/libraries/core/GUIManager.cc
r7957 r7960 32 32 #include <memory> 33 33 #include <boost/bind.hpp> 34 #include <OgreRenderQueue.h> 35 #include <OgreRenderWindow.h> 34 36 35 37 #include <CEGUIDefaultLogger.h> … … 44 46 #include <elements/CEGUIListboxItem.h> 45 47 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 48 57 49 58 #include "util/Clock.h" … … 118 127 , guiSystem_(NULL) 119 128 , resourceProvider_(NULL) 129 #if CEGUI_VERSION_MAJOR >= 1 || CEGUI_VERSION_MINOR >= 7 130 , imageCodec_(NULL) 131 #endif 120 132 , camera_(NULL) 121 133 { … … 128 140 129 141 // Note: No SceneManager specified yet 142 #if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7 130 143 guiRenderer_ = new OgreCEGUIRenderer(GraphicsManager::getInstance().getRenderWindow(), Ogre::RENDER_QUEUE_OVERLAY, false, 3000); 131 144 resourceProvider_ = guiRenderer_->createResourceProvider(); 145 #else 146 guiRenderer_ = &OgreRenderer::create(*GraphicsManager::getInstance().getRenderWindow()); 147 resourceProvider_ = &OgreRenderer::createOgreResourceProvider(); 148 imageCodec_ = &OgreRenderer::createOgreImageCodec(); 149 #endif 132 150 resourceProvider_->setDefaultResourceGroup("General"); 133 151 … … 137 155 // This is necessary to ensure that input events also use the right resource info when triggering lua functions 138 156 luaState_->setDefaultResourceInfo(this->rootFileInfo_); 157 #if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7 139 158 scriptModule_ = new LuaScriptModule(luaState_->getInternalLuaState()); 159 #else 160 scriptModule_ = &LuaScriptModule::create(luaState_->getInternalLuaState()); 161 #endif 140 162 scriptModule_->setDefaultPCallErrorHandler(LuaState::ERROR_HANDLER_NAME); 141 163 … … 149 171 150 172 // Create the CEGUI system singleton 173 #if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7 151 174 guiSystem_ = new System(guiRenderer_, resourceProvider_, 0, scriptModule_); 175 #else 176 guiSystem_ = &System::create(*guiRenderer_, resourceProvider_, 0, imageCodec_, scriptModule_); 177 #endif 152 178 153 179 // Align CEGUI mouse with OIS mouse … … 178 204 using namespace CEGUI; 179 205 206 #if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7 180 207 delete guiSystem_; 181 208 delete guiRenderer_; 182 209 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 183 217 delete luaState_; 184 218 } … … 223 257 { 224 258 this->camera_ = camera; 259 #if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7 225 260 if (camera == NULL) 226 261 this->guiRenderer_->setTargetSceneManager(0); 227 262 else 228 263 this->guiRenderer_->setTargetSceneManager(camera->getSceneManager()); 264 #endif 229 265 } 230 266 … … 512 548 void GUIManager::windowResized(unsigned int newWidth, unsigned int newHeight) 513 549 { 550 #if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7 514 551 this->guiRenderer_->setDisplaySize(CEGUI::Size(newWidth, newHeight)); 552 #else 553 this->guiRenderer_->setDisplaySize(CEGUI::Size((float)newWidth, (float)newHeight)); 554 #endif 515 555 } 516 556 -
code/branches/kicklib/src/libraries/core/GUIManager.h
r7957 r7960 42 42 #include <string> 43 43 #include <CEGUIForwardRefs.h> 44 #include < boost/scoped_ptr.hpp>44 #include <CEGUIVersion.h> 45 45 #include <boost/shared_ptr.hpp> 46 46 #include <loki/ScopeGuard.h> … … 147 147 Loki::ObjScopeGuardImpl0<GUIManager, void (GUIManager::*)()> destroyer_; 148 148 149 #if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7 149 150 CEGUI::OgreCEGUIRenderer* guiRenderer_; //!< CEGUI's interface to the Ogre Engine 150 151 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 151 157 LuaState* luaState_; //!< LuaState, access point to the Lua engine 152 158 CEGUI::LuaScriptModule* scriptModule_; //!< CEGUI's script module to use Lua -
code/branches/kicklib/src/libraries/util/Exception.cc
r7947 r7960 95 95 throw; 96 96 } 97 catch (const std::exception& ex)98 {99 return ex.what();100 }101 97 catch (const CEGUI::Exception& ex) 102 98 { 103 99 return GeneralException(ex.getMessage().c_str(), ex.getLine(), 104 100 ex.getFileName().c_str(), ex.getName().c_str()).getDescription(); 101 } 102 catch (const std::exception& ex) 103 { 104 return ex.what(); 105 105 } 106 106 catch (...)
Note: See TracChangeset
for help on using the changeset viewer.