Changeset 8283 for code/branches/kicklib2/src
- Timestamp:
- Apr 21, 2011, 6:32:28 PM (14 years ago)
- Location:
- code/branches/kicklib2
- Files:
-
- 11 deleted
- 23 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/kicklib2
- Property svn:mergeinfo changed
/code/branches/kicklib merged: 7940-7948,7950-7951,7953,7956-7957,7959-7961,7964-7965,7967-7969,7971,7973-7974
- Property svn:mergeinfo changed
-
code/branches/kicklib2/src/CMakeLists.txt
r8079 r8283 40 40 ADD_COMPILER_FLAGS("-DBOOST_ALL_DYN_LINK" WIN32 LINK_BOOST_DYNAMIC) 41 41 #ADD_COMPILER_FLAGS("-DENET_DLL" WIN32 LINK_ENET_DYNAMIC) 42 ADD_COMPILER_FLAGS("-DLUA_BUILD_AS_DLL" WIN32 LINK_LUA _DYNAMIC)42 ADD_COMPILER_FLAGS("-DLUA_BUILD_AS_DLL" WIN32 LINK_LUA5.1_DYNAMIC) 43 43 ADD_COMPILER_FLAGS("-DZLIB_DLL" WIN32 LINK_ZLIB_DYNAMIC) 44 44 # If no defines are specified, these libs get linked dynamically 45 ADD_COMPILER_FLAGS("-DCEGUI_STATIC "WIN32 NOT LINK_CEGUI_DYNAMIC)45 ADD_COMPILER_FLAGS("-DCEGUI_STATIC -DTOLUA_STATIC" WIN32 NOT LINK_CEGUI_DYNAMIC) 46 46 ADD_COMPILER_FLAGS("-DOGRE_STATIC_LIB" WIN32 NOT LINK_OGRE_DYNAMIC) 47 47 ADD_COMPILER_FLAGS("-DSTATIC_BUILD" WIN32 NOT LINK_TCL_DYNAMIC) … … 61 61 ENDIF() 62 62 # If no defines are specified, these libs get linked dynamically 63 ADD_COMPILER_FLAGS("-DCEGUILUA_STATIC" WIN32 NOT _external_shared_link)64 63 ADD_COMPILER_FLAGS("-DENET_DLL" WIN32 _external_shared_link) 65 64 ADD_COMPILER_FLAGS("-DOGRE_GUIRENDERER_STATIC_LIB" WIN32 NOT _external_shared_link) 66 65 ADD_COMPILER_FLAGS("-DOIS_STATIC_LIB" WIN32 NOT _external_shared_link) 67 ADD_COMPILER_FLAGS("-DTOLUA_STATIC_BUILD" WIN32 NOT _external_shared_link)68 66 69 67 ############## Include Directories ############## … … 81 79 ${VORBIS_INCLUDE_DIR} 82 80 ${OGG_INCLUDE_DIR} 83 ${LUA _INCLUDE_DIR}81 ${LUA5.1_INCLUDE_DIR} 84 82 ${TCL_INCLUDE_PATH} 85 83 ${DIRECTX_INCLUDE_DIR} … … 97 95 ) 98 96 99 IF (CEGUILUA_USE_INTERNAL_LIBRARY)100 INCLUDE_DIRECTORIES(${ CMAKE_CURRENT_SOURCE_DIR}/external/ceguilua/ceguilua-${CEGUI_VERSION})97 IF (DBGHELP_FOUND) 98 INCLUDE_DIRECTORIES(${DBGHELP_INCLUDE_DIR}) 101 99 ENDIF() 102 100 103 IF (DBGHELP_FOUND) 104 INCLUDE_DIRECTORIES(${DBGHELP_INCLUDE_DIR}) 101 ############## CEGUI OGRE Renderer ############## 102 103 IF(CEGUI_OGRE_RENDERER_BUILD_REQUIRED) 104 SET(CEGUI_OGRE_RENDERER_LIBRARY ogreceguirenderer_orxonox) 105 105 ENDIF() 106 106 -
code/branches/kicklib2/src/SpecialConfig.h.in
r7818 r8283 41 41 42 42 #include "OrxonoxConfig.h" 43 44 #cmakedefine CEGUILUA_USE_INTERNAL_LIBRARY ///< Set whether we must suffix "ceguilua/" for the CEGUILua.h include45 43 46 44 #cmakedefine DEPENDENCY_PACKAGE_ENABLE ///< Defined if a precompiled depdency package was used. We then copy all libraries too when installing. -
code/branches/kicklib2/src/external/CMakeLists.txt
r7459 r8283 21 21 22 22 ADD_SUBDIRECTORY(tolua) 23 24 # Include CEGUILua if not requested otherwise25 IF(CEGUILUA_USE_INTERNAL_LIBRARY)26 IF(NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ceguilua/ceguilua-${CEGUI_VERSION})27 MESSAGE(FATAL_ERROR "CEGUILua version not found in src folder. Update list of supported versions in LibraryConfig.cmake!")28 ENDIF()29 30 ADD_SUBDIRECTORY(ceguilua)31 SET(CEGUILUA_LIBRARY ${CEGUILUA_LIBRARY} PARENT_SCOPE)32 ENDIF()33 34 23 ADD_SUBDIRECTORY(bullet) 35 24 ADD_SUBDIRECTORY(cpptcl) 36 25 ADD_SUBDIRECTORY(enet) 37 26 ADD_SUBDIRECTORY(loki) 38 ADD_SUBDIRECTORY(ogreceguirenderer) 27 IF(CEGUI_OGRE_RENDERER_BUILD_REQUIRED) 28 ADD_SUBDIRECTORY(ogreceguirenderer) 29 ENDIF() 39 30 ADD_SUBDIRECTORY(ois) 40 31 ADD_SUBDIRECTORY(tinyxml) -
code/branches/kicklib2/src/external/ogreceguirenderer/OgreCEGUIRenderer.cpp
r5781 r8283 455 455 d_render_sys->_setTextureAddressingMode(0, d_uvwAddressMode); 456 456 d_render_sys->_setTextureMatrix(0, Matrix4::IDENTITY); 457 #if OGRE_VERSION >= 0x010600458 457 d_render_sys->_setAlphaRejectSettings(CMPF_ALWAYS_PASS, 0, false); 459 #else460 d_render_sys->_setAlphaRejectSettings(CMPF_ALWAYS_PASS, 0);461 #endif462 458 d_render_sys->_setTextureBlendMode(0, d_colourBlendMode); 463 459 d_render_sys->_setTextureBlendMode(0, d_alphaBlendMode); -
code/branches/kicklib2/src/external/ogreceguirenderer/VERSION
r5781 r8283 1 This library is part of the OGRE v1.6. 1source.1 This library is part of the OGRE v1.6.5 source. 2 2 3 3 ----- -
code/branches/kicklib2/src/external/ogreceguirenderer/changes_orxonox.diff
r7163 r8283 18 18 #include "OgreCEGUIRenderer.h" 19 19 #include "OgreCEGUITexture.h" 20 @@ -454,7 +454,11 @@21 d_render_sys->_setTextureUnitFiltering(0, FO_LINEAR, FO_LINEAR, FO_POINT);22 d_render_sys->_setTextureAddressingMode(0, d_uvwAddressMode);23 d_render_sys->_setTextureMatrix(0, Matrix4::IDENTITY);24 +#if OGRE_VERSION >= 0x01060025 + d_render_sys->_setAlphaRejectSettings(CMPF_ALWAYS_PASS, 0, false);26 +#else27 d_render_sys->_setAlphaRejectSettings(CMPF_ALWAYS_PASS, 0);28 +#endif29 d_render_sys->_setTextureBlendMode(0, d_colourBlendMode);30 d_render_sys->_setTextureBlendMode(0, d_alphaBlendMode);31 d_render_sys->_disableTextureUnitsFrom(1);32 20 --- OgreCEGUIRenderer.h Wed Jan 28 21:14:09 2009 33 21 +++ OgreCEGUIRenderer.h Wed Jan 28 21:06:46 2009 -
code/branches/kicklib2/src/external/tolua/CMakeLists.txt
r7163 r8283 18 18 # 19 19 20 ################### Tolua++ library ###################21 22 SET_SOURCE_FILES(TOLUA_FILES23 tolua_event.h24 tolua++.h25 COMPILATION_BEGIN ToluaCompilation.c26 tolua_event.c27 tolua_is.c28 tolua_map.c29 tolua_push.c30 tolua_to.c31 COMPILATION_END32 )33 34 ORXONOX_ADD_LIBRARY(tolua_orxonox35 ORXONOX_EXTERNAL36 DEFINE_SYMBOL37 "TOLUA_SHARED_BUILD"38 VERSION39 1.0.9240 LINK_LIBRARIES41 ${LUA_LIBRARIES}42 SOURCE_FILES43 ${TOLUA_FILES}44 )45 46 47 20 ################## Tolua++ generator ################## 48 21 … … 53 26 NO_INSTALL 54 27 LINK_LIBRARIES 55 ${LUA _LIBRARIES}28 ${LUA5.1_LIBRARY} 56 29 SOURCE_FILES 57 30 tolua.c … … 59 32 60 33 # Set some variables to the cache in order to use them in the TOLUA macro 61 SET(TOLUA_PARSER_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/all- ${LUA_VERSION}.lua" CACHE INTERNAL "")34 SET(TOLUA_PARSER_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/all-5.1.lua" CACHE INTERNAL "") 62 35 SET(TOLUA_PARSER_DEPENDENCIES 63 36 toluaapp_orxonox 64 ${CMAKE_CURRENT_SOURCE_DIR}/all- ${LUA_VERSION}.lua37 ${CMAKE_CURRENT_SOURCE_DIR}/all-5.1.lua 65 38 ${CMAKE_CURRENT_SOURCE_DIR}/lua/compat-5.1.lua 66 39 ${CMAKE_CURRENT_SOURCE_DIR}/lua/compat.lua -
code/branches/kicklib2/src/external/tolua/VERSION
r5738 r8283 1 Tolua++ v1.0.92 with changes:1 Tolua++ v1.0.92 (generator application only) with changes: 2 2 3 3 - Exception handling by CEGUI team -
code/branches/kicklib2/src/external/tolua/changes_orxonox.diff
r5738 r8283 1 diff -ruN tolua/tolua++.h tolua2/tolua++.h2 --- tolua/tolua++.h Wed Jan 28 21:51:38 20093 +++ tolua2/tolua++.h Sat Jan 10 14:48:44 20094 @@ -16,9 +16,34 @@5 #ifndef TOLUA_H6 #define TOLUA_H7 8 +/* original code */9 +/*10 #ifndef TOLUA_API11 #define TOLUA_API extern12 #endif13 +*/14 +15 +/********************************16 +******* ORXONOX CHANGES *********17 +********************************/18 +19 +#if (defined( __WIN32__ ) || defined( _WIN32 )) && !defined( TOLUA_STATIC_BUILD )20 +# ifdef TOLUA_SHARED_BUILD21 +# define TOLUA_API __declspec(dllexport)22 +# else23 +# if defined( __MINGW32__ )24 +# define TOLUA_API25 +# else26 +# define TOLUA_API __declspec(dllimport)27 +# endif28 +# endif29 +#else30 +# define TOLUA_API extern31 +#endif32 +33 +/********************************34 +****** END ORXONOX CHANGES ******35 +********************************/36 37 #define TOLUA_VERSION "tolua++-1.0.92"38 39 1 diff -ruN tolua/tolua.c tolua2/tolua.c 40 2 --- tolua/tolua.c Wed Jan 28 21:51:00 2009 -
code/branches/kicklib2/src/external/tolua/lua/package.lua
r5752 r8283 124 124 output('#endif\n') 125 125 output('#include <string.h>\n\n') 126 output('#include <tolua /tolua++.h>\n\n')126 output('#include <tolua++.h>\n\n') 127 127 128 128 if flags.H then -
code/branches/kicklib2/src/libraries/core/CMakeLists.txt
r8079 r8283 58 58 command/ArgumentCompletionFunctions.cc 59 59 ConfigFileManager.cc 60 MemoryArchive.cc61 60 PathConfig.cc 62 61 COMPILATION_END … … 98 97 ${CEGUI_LIBRARY} 99 98 ${CEGUILUA_LIBRARY} 100 ${LUA_LIBRARIES} 99 ${CEGUI_TOLUA_LIBRARY} 100 ${CEGUI_OGRE_RENDERER_LIBRARY} 101 ${LUA5.1_LIBRARY} 101 102 cpptcl_orxonox 102 ogreceguirenderer_orxonox103 103 ois_orxonox 104 104 tinyxml_orxonox 105 tolua_orxonox106 105 util 107 106 SOURCE_FILES -
code/branches/kicklib2/src/libraries/core/CorePrereqs.h
r8079 r8283 38 38 #include "OrxonoxConfig.h" 39 39 #include <boost/version.hpp> 40 #include <CEGUIVersion.h> 40 41 41 42 //----------------------------------------------------------------------- … … 306 307 class LuaScriptModule; 307 308 309 #if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7 308 310 class OgreCEGUIRenderer; 309 311 class OgreCEGUIResourceProvider; 310 312 class OgreCEGUITexture; 313 #else 314 class OgreRenderer; 315 class OgreResourceProvider; 316 class OgreImageCodec; 317 #endif 311 318 } 312 319 -
code/branches/kicklib2/src/libraries/core/GUIManager.cc
r8079 r8283 30 30 #include "GUIManager.h" 31 31 32 #include <memory> 32 33 #include <boost/bind.hpp> 33 #include <memory> 34 #include <OgreRenderQueue.h> 35 #include <OgreRenderWindow.h> 34 36 35 37 #include <CEGUIDefaultLogger.h> … … 43 45 #include <elements/CEGUIListbox.h> 44 46 #include <elements/CEGUIListboxItem.h> 45 #include <ogreceguirenderer/OgreCEGUIRenderer.h> 46 47 #include "SpecialConfig.h" // Configures the macro below 48 #ifdef CEGUILUA_USE_INTERNAL_LIBRARY 49 # include <ceguilua/CEGUILua.h> 47 48 #ifdef ORXONOX_OLD_CEGUI 49 # include <CEGUILua.h> 50 # include <ogreceguirenderer/OgreCEGUIRenderer.h> 51 extern "C" { 52 # include <lauxlib.h> 53 } 50 54 #else 51 # include <CEGUILua.h> 55 # include <ScriptingModules/LuaScriptModule/CEGUILua.h> 56 # include <RendererModules/Ogre/CEGUIOgreImageCodec.h> 57 # include <RendererModules/Ogre/CEGUIOgreRenderer.h> 58 # include <RendererModules/Ogre/CEGUIOgreResourceProvider.h> 52 59 #endif 53 60 … … 89 96 case CEGUI::Informative: orxonoxLevel = 5; break; 90 97 case CEGUI::Insane: orxonoxLevel = 6; break; 91 default: OrxAssert(false, "CEGUI log level out of range, in pect immediately!");98 default: OrxAssert(false, "CEGUI log level out of range, inspect immediately!"); 92 99 } 93 100 OutputHandler::getOutStream(orxonoxLevel) … … 97 104 } 98 105 }; 106 107 #ifdef ORXONOX_OLD_CEGUI 108 /** Class with the same memory layout as CEGUI::LuaScriptModule. <br> 109 We need this to fix a problem with an uninitialised member variable 110 in CEGUI < 0.7 <br> 111 Notice that "public" modifier for the otherwise private variables. 112 */ 113 class CEGUILUA_API LuaScriptModuleWorkaround : public CEGUI::ScriptModule 114 { 115 public: 116 LuaScriptModuleWorkaround(); 117 ~LuaScriptModuleWorkaround(); 118 119 public: 120 bool d_ownsState; 121 lua_State* d_state; 122 CEGUI::String d_errFuncName; 123 int d_errFuncIndex; 124 CEGUI::String d_activeErrFuncName; 125 int d_activeErrFuncIndex; 126 }; 127 #endif 99 128 100 129 static CEGUI::MouseButton convertButton(MouseButtonCode::ByEnum button); … … 118 147 */ 119 148 GUIManager::GUIManager(const std::pair<int, int>& mousePosition) 120 : resourceProvider_(NULL) 149 : destroyer_(*this, &GUIManager::cleanup) 150 , guiRenderer_(NULL) 151 , luaState_(NULL) 152 , scriptModule_(NULL) 153 , guiSystem_(NULL) 154 , resourceProvider_(NULL) 155 #ifndef ORXONOX_OLD_CEGUI 156 , imageCodec_(NULL) 157 #endif 121 158 , camera_(NULL) 122 159 { … … 129 166 130 167 // Note: No SceneManager specified yet 131 guiRenderer_.reset(new OgreCEGUIRenderer(GraphicsManager::getInstance().getRenderWindow(), Ogre::RENDER_QUEUE_OVERLAY, false, 3000)); 168 #ifdef ORXONOX_OLD_CEGUI 169 guiRenderer_ = new OgreCEGUIRenderer(GraphicsManager::getInstance().getRenderWindow(), Ogre::RENDER_QUEUE_OVERLAY, false, 3000); 132 170 resourceProvider_ = guiRenderer_->createResourceProvider(); 171 #else 172 guiRenderer_ = &OgreRenderer::create(*GraphicsManager::getInstance().getRenderWindow()); 173 resourceProvider_ = &OgreRenderer::createOgreResourceProvider(); 174 imageCodec_ = &OgreRenderer::createOgreImageCodec(); 175 #endif 133 176 resourceProvider_->setDefaultResourceGroup("General"); 134 177 135 178 // Setup scripting 136 luaState_ .reset(new LuaState());179 luaState_ = new LuaState(); 137 180 rootFileInfo_ = Resource::getInfo("InitialiseGUI.lua"); 138 181 // This is necessary to ensure that input events also use the right resource info when triggering lua functions 139 182 luaState_->setDefaultResourceInfo(this->rootFileInfo_); 140 scriptModule_.reset(new LuaScriptModule(luaState_->getInternalLuaState())); 183 #ifdef ORXONOX_OLD_CEGUI 184 scriptModule_ = new LuaScriptModule(luaState_->getInternalLuaState()); 185 // Ugly workaround: older CEGUILua versions don't initialise the member 186 // d_activeErrFuncIndex at all. That leads to "error in error handling" 187 // problems when a Lua error occurs. 188 // We fix this by setting the member manually. 189 reinterpret_cast<LuaScriptModuleWorkaround*>(scriptModule_)->d_activeErrFuncIndex = LUA_NOREF; 190 luaState_->doString("ORXONOX_OLD_CEGUI = true"); 191 #else 192 scriptModule_ = &LuaScriptModule::create(luaState_->getInternalLuaState()); 193 #endif 141 194 scriptModule_->setDefaultPCallErrorHandler(LuaState::ERROR_HANDLER_NAME); 142 195 … … 144 197 std::auto_ptr<CEGUILogger> ceguiLogger(new CEGUILogger()); 145 198 ceguiLogger->setLogFilename(PathConfig::getLogPathString() + "cegui.log"); 146 // set the log level according to ours (translate by subtracting 1)199 // Set the log level according to ours (translate by subtracting 1) 147 200 ceguiLogger->setLoggingLevel( 148 201 static_cast<LoggingLevel>(OutputHandler::getInstance().getSoftDebugLevel("logFile") - 1)); … … 150 203 151 204 // Create the CEGUI system singleton 152 guiSystem_.reset(new System(guiRenderer_.get(), resourceProvider_, 0, scriptModule_.get())); 205 #ifdef ORXONOX_OLD_CEGUI 206 guiSystem_ = new System(guiRenderer_, resourceProvider_, 0, scriptModule_); 207 // Add functions that have been renamed in newer versions 208 luaState_->doString("CEGUI.SchemeManager.create = CEGUI.SchemeManager.loadScheme"); 209 luaState_->doString("CEGUI.Window.getUnclippedOuterRect = CEGUI.Window.getUnclippedPixelRect"); 210 #else 211 guiSystem_ = &System::create(*guiRenderer_, resourceProvider_, 0, imageCodec_, scriptModule_); 212 #endif 153 213 154 214 // Align CEGUI mouse with OIS mouse … … 175 235 } 176 236 177 /** 178 @brief 179 Basically shuts down CEGUI (member smart pointers) but first unloads our Tolua modules. 180 */ 181 GUIManager::~GUIManager() 182 { 237 void GUIManager::cleanup() 238 { 239 using namespace CEGUI; 240 241 #ifdef ORXONOX_OLD_CEGUI 242 delete guiSystem_; 243 delete guiRenderer_; 244 delete scriptModule_; 245 #else 246 System::destroy(); 247 OgreRenderer::destroyOgreResourceProvider(*resourceProvider_); 248 OgreRenderer::destroyOgreImageCodec(*imageCodec_); 249 OgreRenderer::destroy(*guiRenderer_); 250 LuaScriptModule::destroy(*scriptModule_); 251 #endif 252 delete luaState_; 183 253 } 184 254 … … 222 292 { 223 293 this->camera_ = camera; 294 #ifdef ORXONOX_OLD_CEGUI 224 295 if (camera == NULL) 225 296 this->guiRenderer_->setTargetSceneManager(0); 226 297 else 227 298 this->guiRenderer_->setTargetSceneManager(camera->getSceneManager()); 299 #endif 228 300 } 229 301 … … 522 594 The Listbox for which to enable (or disable) tooltips. 523 595 @param enabled 524 Whether to enable or disab elthe tooltips.596 Whether to enable or disable the tooltips. 525 597 */ 526 598 void GUIManager::setItemTooltipsEnabledHelper(CEGUI::Listbox* listbox, bool enabled) … … 535 607 { 536 608 this->guiRenderer_->setDisplaySize(CEGUI::Size((float)newWidth, (float)newHeight)); 609 #else 610 this->guiRenderer_->setDisplaySize(CEGUI::Size((float)newWidth, (float)newHeight)); 611 #endif 537 612 } 538 613 -
code/branches/kicklib2/src/libraries/core/GUIManager.h
r8079 r8283 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 #include <loki/ScopeGuard.h> 46 47 47 48 #include "util/OgreForwardRefs.h" … … 57 58 $cfile "../util/TriBool.h" // tolua_export 58 59 */ 60 61 #if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7 62 # define ORXONOX_OLD_CEGUI 63 #endif 59 64 60 65 namespace orxonox // tolua_export … … 78 83 public: 79 84 GUIManager(const std::pair<int, int>& mousePosition); 80 ~GUIManager(); 85 //! Leave empty and use cleanup() instead 86 ~GUIManager() {} 81 87 82 88 void setConfigValues(void); … … 104 110 const std::string& createInputState(const std::string& name, TriBool::Value showCursor = TriBool::True, TriBool::Value useKeyboard = TriBool::True, bool bBlockJoyStick = false); // tolua_export 105 111 LuaState* getLuaState(void) 106 { return this->luaState_ .get(); }112 { return this->luaState_; } 107 113 108 114 //! Returns the root window for all menu sheets … … 127 133 private: 128 134 GUIManager(const GUIManager& instance); //!< private and undefined copy c'tor (this is a singleton class) 135 136 /// Destructor that also executes when object fails to construct 137 void cleanup(); 138 129 139 void executeCode(const std::string& str); 130 140 … … 147 157 virtual void windowFocusChanged(bool bFocus); 148 158 149 scoped_ptr<CEGUI::OgreCEGUIRenderer> guiRenderer_; //!< CEGUI's interface to the Ogre Engine 150 scoped_ptr<LuaState> luaState_; //!< LuaState, access point to the Lua engine 151 scoped_ptr<CEGUI::LuaScriptModule> scriptModule_; //!< CEGUI's script module to use Lua 152 scoped_ptr<CEGUI::System> guiSystem_; //!< CEGUI's main system 159 /// Surrogate for the destructor 160 Loki::ObjScopeGuardImpl0<GUIManager, void (GUIManager::*)()> destroyer_; 161 162 #ifdef ORXONOX_OLD_CEGUI 163 CEGUI::OgreCEGUIRenderer* guiRenderer_; //!< CEGUI's interface to the Ogre Engine 164 CEGUI::ResourceProvider* resourceProvider_; //!< CEGUI's resource provider 165 #else 166 CEGUI::OgreRenderer* guiRenderer_; //!< CEGUI's interface to the Ogre Engine 167 CEGUI::OgreResourceProvider* resourceProvider_; //!< CEGUI's resource provider 168 CEGUI::OgreImageCodec* imageCodec_; 169 #endif 170 LuaState* luaState_; //!< LuaState, access point to the Lua engine 171 CEGUI::LuaScriptModule* scriptModule_; //!< CEGUI's script module to use Lua 172 CEGUI::System* guiSystem_; //!< CEGUI's main system 153 173 shared_ptr<ResourceInfo> rootFileInfo_; //!< Resource information about the root script 154 CEGUI::ResourceProvider* resourceProvider_; //!< CEGUI's resource provider155 174 CEGUI::Logger* ceguiLogger_; //!< CEGUI's logger to be able to log CEGUI errors in our log 156 175 CEGUI::Window* rootWindow_; //!< Root node for all windows -
code/branches/kicklib2/src/libraries/core/GraphicsManager.cc
r8079 r8283 35 35 #include <boost/shared_array.hpp> 36 36 37 #include <OgreArchiveFactory.h>38 #include <OgreArchiveManager.h>39 37 #include <OgreFrameListener.h> 40 38 #include <OgreRoot.h> … … 60 58 #include "GUIManager.h" 61 59 #include "Loader.h" 62 #include "MemoryArchive.h"63 60 #include "PathConfig.h" 64 61 #include "ViewportEventListener.h" … … 102 99 GraphicsManager::GraphicsManager(bool bLoadRenderer) 103 100 : ogreWindowEventListener_(new OgreWindowEventListener()) 104 #if OGRE_VERSION < 0x010600105 , memoryArchiveFactory_(new MemoryArchiveFactory())106 #endif107 101 , renderWindow_(0) 108 102 , viewport_(0) … … 195 189 196 190 this->loadRenderer(); 197 198 #if OGRE_VERSION < 0x010600199 // WORKAROUND: There is an incompatibility for particle scripts when trying200 // to support both Ogre 1.4 and 1.6. The hacky solution is to create201 // scripts for the 1.6 version and then remove the inserted "particle_system"202 // keyword. But we need to supply these new scripts as well, which is why203 // there is an extra Ogre::Archive dealing with it in the memory.204 using namespace Ogre;205 ArchiveManager::getSingleton().addArchiveFactory(memoryArchiveFactory_.get());206 const StringVector& groups = ResourceGroupManager::getSingleton().getResourceGroups();207 // Travers all groups208 for (StringVector::const_iterator itGroup = groups.begin(); itGroup != groups.end(); ++itGroup)209 {210 FileInfoListPtr files = ResourceGroupManager::getSingleton().findResourceFileInfo(*itGroup, "*.particle");211 for (FileInfoList::const_iterator itFile = files->begin(); itFile != files->end(); ++itFile)212 {213 // open file214 Ogre::DataStreamPtr input = ResourceGroupManager::getSingleton().openResource(itFile->filename, *itGroup, false);215 std::stringstream output;216 // Parse file and replace "particle_system" with nothing217 while (!input->eof())218 {219 std::string line = input->getLine();220 size_t pos = line.find("particle_system");221 if (pos != std::string::npos)222 {223 // 15 is the length of "particle_system"224 line.replace(pos, 15, "");225 }226 output << line << std::endl;227 }228 // Add file to the memory archive229 shared_array<char> data(new char[output.str().size()]);230 // Debug optimisations231 const std::string& outputStr = output.str();232 char* rawData = data.get();233 for (unsigned i = 0; i < outputStr.size(); ++i)234 rawData[i] = outputStr[i];235 MemoryArchive::addFile("particle_scripts_ogre_1.4_" + *itGroup, itFile->filename, data, output.str().size());236 }237 if (!files->empty())238 {239 // Declare the files, but using a new group240 ResourceGroupManager::getSingleton().addResourceLocation("particle_scripts_ogre_1.4_" + *itGroup,241 "Memory", "particle_scripts_ogre_1.4_" + *itGroup);242 }243 }244 #endif245 191 246 192 // Initialise all resources (do this AFTER the renderer has been loaded!) -
code/branches/kicklib2/src/libraries/core/GraphicsManager.h
r8079 r8283 114 114 115 115 scoped_ptr<OgreWindowEventListener> ogreWindowEventListener_; //!< Pimpl to hide OgreWindowUtilities.h 116 #if OGRE_VERSION < 0x010600117 scoped_ptr<MemoryArchiveFactory> memoryArchiveFactory_; //!< Stores the modified particle scripts118 #endif119 116 scoped_ptr<Ogre::LogManager> ogreLogger_; 120 117 scoped_ptr<Ogre::Root> ogreRoot_; //!< Ogre's root -
code/branches/kicklib2/src/libraries/core/LuaState.cc
r7284 r8283 30 30 #include "LuaState.h" 31 31 32 #include <tolua /tolua++.h>32 #include <tolua++.h> 33 33 extern "C" { 34 34 #include <lua.h> … … 60 60 luaState_ = lua_open(); 61 61 Loki::ScopeGuard luaStateGuard = Loki::MakeGuard(&lua_close, luaState_); 62 #if LUA_VERSION_NUM == 50163 62 luaL_openlibs(luaState_); 64 #else65 luaopen_base(luaState_);66 luaopen_string(luaState_);67 luaopen_table(luaState_);68 luaopen_math(luaState_);69 luaopen_io(luaState_);70 luaopen_debug(luaState_);71 #endif72 63 73 64 // Open all available tolua interfaces … … 187 178 } 188 179 189 #if LUA_VERSION_NUM != 501190 LoadS ls;191 ls.s = code.c_str();192 ls.size = code.size();193 int error = lua_load(luaState_, &orxonox::LuaState::lua_Chunkreader, &ls, chunkname.c_str());194 #else195 180 int error = luaL_loadbuffer(luaState_, code.c_str(), code.size(), chunkname.c_str()); 196 #endif197 181 198 182 switch (error) … … 293 277 } 294 278 295 #if LUA_VERSION_NUM != 501296 const char * LuaState::lua_Chunkreader(lua_State *L, void *data, size_t *size)297 {298 LoadS* ls = static_cast<LoadS*>(data);299 if (ls->size == 0)300 return NULL;301 *size = ls->size;302 ls->size = 0;303 return ls->s;304 }305 #endif306 307 279 /*static*/ bool LuaState::addToluaInterface(int (*function)(lua_State*), const std::string& name) 308 280 { -
code/branches/kicklib2/src/libraries/core/LuaState.h
r7401 r8283 113 113 shared_ptr<ResourceInfo> getFileInfo(const std::string& filename); 114 114 115 #if LUA_VERSION_NUM != 501116 struct LoadS117 {118 const char* s;119 size_t size;120 };121 122 static const char * lua_Chunkreader(lua_State *L, void *data, size_t *size);123 #endif124 125 115 std::stringstream output_; 126 116 lua_State* luaState_; -
code/branches/kicklib2/src/libraries/core/input/KeyBinder.cc
r8079 r8283 396 396 397 397 // iterate over all modes 398 for ( size_t mode_index = 0; mode_index < 3; ++mode_index)398 for (int mode_index = 0; mode_index < 3; ++mode_index) 399 399 { 400 400 if (mode_index == (unsigned int)new_mode) // skip commands that are already in the desired mode -
code/branches/kicklib2/src/libraries/tools/Mesh.cc
r6417 r8283 69 69 this->entity_ = this->scenemanager_->createEntity("Mesh" + multi_cast<std::string>(Mesh::meshCounter_s++), meshsource); 70 70 this->entity_->setCastShadows(this->bCastShadows_); 71 72 #if OGRE_VERSION < 0x01060073 this->entity_->setNormaliseNormals(true);74 /*75 Excerpt from Ogre forum:76 "Note that the above is only for the fixed function pipeline.77 If/when you get into shaders, you'll need to manually normalize() the normal inside the vertex or pixel shader."78 79 I don't know exactly what this means, but I put this here if there will be problems with shaders.80 */81 #endif82 71 } 83 72 catch (...) -
code/branches/kicklib2/src/libraries/util/Exception.cc
r7401 r8283 95 95 throw; 96 96 } 97 catch (const CEGUI::Exception& ex) 98 { 99 return GeneralException(ex.getMessage().c_str(), ex.getLine(), 100 ex.getFileName().c_str(), ex.getName().c_str()).getDescription(); 101 } 97 102 catch (const std::exception& ex) 98 103 { 99 104 return ex.what(); 100 }101 catch (const CEGUI::Exception& ex)102 {103 #if CEGUI_VERSION_MAJOR == 0 && CEGUI_VERSION_MINOR < 6104 return GeneralException(ex.getMessage().c_str()).getDescription();105 #else106 return GeneralException(ex.getMessage().c_str(), ex.getLine(),107 ex.getFileName().c_str(), ex.getName().c_str()).getDescription();108 #endif109 105 } 110 106 catch (...) -
code/branches/kicklib2/src/orxonox/CMakeLists.txt
r7648 r8283 78 78 ${VORBIS_LIBRARY} 79 79 ${OGG_LIBRARY} 80 ${CEGUI_TOLUA_LIBRARY} 80 81 tinyxml_orxonox 81 tolua_orxonox82 82 bullet_orxonox 83 83 util
Note: See TracChangeset
for help on using the changeset viewer.