Changeset 8283 for code/branches/kicklib2
- Timestamp:
- Apr 21, 2011, 6:32:28 PM (14 years ago)
- Location:
- code/branches/kicklib2
- Files:
-
- 12 deleted
- 33 edited
- 2 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/INSTALL
r7248 r8283 9 9 (for windows there are already precompiled packages on the website) 10 10 11 OGRE 3D Graphics Engine 1. 4- 1.712 CEGUI (Crazy Eddie's GUI System) 0. 5 - 0.611 OGRE 3D Graphics Engine 1.6 - 1.7 12 CEGUI (Crazy Eddie's GUI System) 0.6 13 13 Boost libraries 1.35 - 14 ENet (Network library) 1.1 - 1.215 14 Lua (scripting language) 5.0 - 5.1 16 15 Tcl (shell script language) 8.4 - 8.5 -
code/branches/kicklib2/bin/vld.ini.in
r5929 r8283 56 56 ; Default: None. 57 57 ; 58 ForceIncludeModules = boost_date_time-vc 80-mt-gd-1_39.dll, boost_filesystem-vc80-mt-gd-1_39.dll, boost_system-vc80-mt-gd-1_39.dll, boost_thread-vc80-mt-gd-1_39.dll, enet_d.dll, lua_d.dll, ogg_d.dll, vorbis_d.dll, vorbifile_d.dll58 ForceIncludeModules = boost_date_time-vc90-mt-gd-1_44.dll, boost_filesystem-vc90-mt-gd-1_44.dll, boost_system-vc90-mt-gd-1_44.dll, boost_thread-vc90-mt-gd-1_44.dll, lua_d.dll, ogg_d.dll, vorbis_d.dll, vorbifile_d.dll 59 59 60 60 ; Maximum number of data bytes to display for each leaked block. If zero, then -
code/branches/kicklib2/cmake/LibraryConfig.cmake
r8264 r8283 93 93 # Performs the search and sets the variables # 94 94 95 FIND_PACKAGE(OGRE 1.4 REQUIRED) 96 #FIND_PACKAGE(ENet 1.1 REQUIRED) 95 FIND_PACKAGE(OGRE 1.6 REQUIRED) 96 #FIND_PACKAGE(ENet 1.1 REQUIRED) 97 FIND_PACKAGE(Lua5.1 REQUIRED) 97 98 FIND_PACKAGE(Ogg REQUIRED) 98 99 FIND_PACKAGE(Vorbis REQUIRED) … … 111 112 ##### CEGUI ##### 112 113 # We make use of the CEGUI script module called CEGUILua. 113 # However there is a small issue with that: We use Tolua, a C++ binding 114 # generator ourselves. And we also have to use our bindings in the same 115 # lua state is CEGUILua's. Unfortunately this implies that both lua runtime 116 # version are equal or else you get segmentation faults. 117 # In order to match the Lua versions we decided to ship CEGUILua in our 118 # repository, mainly because there is no way to determine which version of 119 # Lua CEGUILua was linked against (you'd have to specify yourself) and secondly 120 # because we can then choose the Lua version. Future plans might involve only 121 # accepting Lua 5.1. 122 123 # Insert all internally supported CEGUILua versions here 124 SET(CEGUILUA_INTERNAL_SUPPORT 0.5.0 0.6.0 0.6.1 0.6.2) 125 OPTION(CEGUILUA_USE_EXTERNAL_LIBRARY "Force the use of external CEGUILua library" OFF) 126 FIND_PACKAGE(CEGUI 0.5 REQUIRED) 127 128 ##### Lua ##### 129 IF(CEGUILUA_USE_EXTERNAL_LIBRARY) 130 COMPARE_VERSION_STRINGS(${CEGUI_VERSION} "0.6" _version_comparison) 131 IF(version_comparison LESS 0) 132 SET(LUA_VERSION_REQUEST 5.0) 133 ELSE() 134 SET(LUA_VERSION_REQUEST 5.1) 135 ENDIF() 136 ELSE() 137 SET(LUA_VERSION_REQUEST 5) 138 ENDIF() 139 FIND_PACKAGE(Lua ${LUA_VERSION_REQUEST} EXACT REQUIRED) 114 # However there is a small issue with that: Both CEGUILua and Orxonox use 115 # Lua library functions on the same objects. And it turns out that in this case 116 # the linked library must be EXACTLY the same. 117 # Since Lua v5.1 has been out for a long while, this does not seem to be a 118 # problem anymore, at least as long as Lua 5.2 is not released. 119 FIND_PACKAGE(CEGUI 0.6 REQUIRED) 140 120 141 121 ##### OpenAL ##### … … 177 157 # Note: Default option in the libraries vary, but our default option is dynamic 178 158 IF(WIN32) 179 OPTION(LINK_BOOST_DYNAMIC "Link Boost dynamically on Windows" TRUE) 180 OPTION(LINK_CEGUI_DYNAMIC "Link CEGUI dynamicylly on Windows" TRUE) 181 #OPTION(LINK_ENET_DYNAMIC "Link ENet dynamically on Windows" TRUE) 182 OPTION(LINK_OGRE_DYNAMIC "Link OGRE dynamically on Windows" TRUE) 183 OPTION(LINK_TCL_DYNAMIC "Link TCL dynamically on Windows" TRUE) 184 OPTION(LINK_ZLIB_DYNAMIC "Link ZLib dynamically on Windows" TRUE) 185 COMPARE_VERSION_STRINGS("${LUA_VERSION}" "5.1" _version_comparison) 186 IF(_version_comparison LESS 0) 187 OPTION(LINK_LUA_DYNAMIC "Link Lua dynamically on Windows" FALSE) 188 ELSE(_version_comparison LESS 0) 189 OPTION(LINK_LUA_DYNAMIC "Link Lua dynamically on Windows" TRUE) 190 ENDIF(_version_comparison LESS 0) 159 OPTION(LINK_BOOST_DYNAMIC "Link Boost dynamically on Windows" TRUE) 160 OPTION(LINK_CEGUI_DYNAMIC "Link CEGUI dynamicylly on Windows" TRUE) 161 #OPTION(LINK_ENET_DYNAMIC "Link ENet dynamically on Windows" TRUE) 162 OPTION(LINK_OGRE_DYNAMIC "Link OGRE dynamically on Windows" TRUE) 163 OPTION(LINK_TCL_DYNAMIC "Link TCL dynamically on Windows" TRUE) 164 OPTION(LINK_ZLIB_DYNAMIC "Link ZLib dynamically on Windows" TRUE) 165 OPTION(LINK_LUA5.1_DYNAMIC "Link Lua dynamically on Windows" TRUE) 191 166 192 167 IF(DEPENDENCY_PACKAGE_ENABLE) … … 194 169 LINK_BOOST_DYNAMIC LINK_CEGUI_DYNAMIC #LINK_ENET_DYNAMIC 195 170 LINK_OGRE_DYNAMIC LINK_TCL_DYNAMIC LINK_ZLIB_DYNAMIC 196 LINK_LUA _DYNAMIC171 LINK_LUA5.1_DYNAMIC 197 172 ) 198 173 ENDIF() -
code/branches/kicklib2/cmake/LibraryConfigTardis.cmake
r6746 r8283 77 77 #SET(ENV{OGGDIR} "/usr/pack/oggvorbis-1.0-ds;/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0") 78 78 #SET(ENV{VORBISDIR} "/usr/pack/oggvorbis-1.0-ds;/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0") 79 #SET(ENV{LUA _DIR}"/usr/pack/lua-5.1.4-sd;/usr/pack/lua-5.1.4-sd/i686-debian-linux4.0")79 #SET(ENV{LUA5.1_DIR} "/usr/pack/lua-5.1.4-sd;/usr/pack/lua-5.1.4-sd/i686-debian-linux4.0") 80 80 #SET(ENV{OGRE_HOME} "/usr/pack/ogre-1.4.9-sd;/usr/pack/ogre-1.4.9-sd/i686-debian-linux4.0") 81 81 #SET(ENV{OPENALDIR} "/usr/pack/openal-0.0.8-cl;/usr/pack/openal-0.0.8-cl/i686-debian-linux3.1") -
code/branches/kicklib2/cmake/PackageConfig.cmake
r7459 r8283 31 31 # But you can specify that the code only runs on 3.1 and higher 32 32 # or 4.0 and higher (so both 3.1 and 4.0 will work). 33 SET(ALLOWED_MINIMUM_VERSIONS 3.1 4.0 5.0) 33 IF(MSVC) 34 SET(ALLOWED_MINIMUM_VERSIONS 4.3 5.1 6.0) 35 ELSE() 36 SET(ALLOWED_MINIMUM_VERSIONS 4.1 5.2) 37 ENDIF() 34 38 35 39 IF(NOT EXISTS ${DEPENDENCY_PACKAGE_DIR}/version.txt) … … 84 88 SET(ENV{DXSDK_DIR} ${DEP_INCLUDE_DIR}/directx) 85 89 #SET(ENV{ENETDIR} ${DEP_INCLUDE_DIR}/enet) 86 SET(ENV{LUA _DIR}${DEP_INCLUDE_DIR}/lua)90 SET(ENV{LUA5.1_DIR} ${DEP_INCLUDE_DIR}/lua) 87 91 SET(ENV{OGGDIR} ${DEP_INCLUDE_DIR}/libogg) 88 92 SET(ENV{VORBISDIR} ${DEP_INCLUDE_DIR}/libvorbis) -
code/branches/kicklib2/cmake/tools/FindCEGUI.cmake
r7163 r8283 4 4 # CEGUI_INCLUDE_DIR 5 5 # CEGUI_LIBRARY, the library to link against to use CEGUI. 6 # CEGUILUA_LIBRARY, the library to link against to use the CEGUI script module. 7 # CEGUI_TOLUA_LIBRARY, the library to link against to use Tolua++. 6 8 # CEGUI_FOUND, If false, do not try to use CEGUI 7 9 # CEGUI_VERSION, the version as string "x.y.z" 8 # CEGUILUA_LIBRARY, Script module library9 # CEGUILUA_USE_INTERNAL_LIBRARY, True if CEGUILUA_LIBRARY was not defined here10 10 # 11 11 # Input: 12 12 # ENV{CEGUIDIR}, CEGUI path, optional 13 # FIND CEGUILUA_INTERNAL_SUPPORT, List of all CEGUILua version supported14 # in the source repository15 # CEGUILUA_USE_EXTERNAL_LIBRARY, Force finding of CEGUILua16 13 # 17 14 # Created by Matt Williams to find OGRE libraries … … 29 26 # > www.orxonox.net < 30 27 28 INCLUDE(CompareVersionStrings) 31 29 INCLUDE(DetermineVersion) 32 30 INCLUDE(FindPackageHandleAdvancedArgs) 33 31 INCLUDE(HandleLibraryTypes) 34 32 33 # Find headers 35 34 FIND_PATH(CEGUI_INCLUDE_DIR CEGUI.h 36 35 PATHS $ENV{CEGUIDIR} 37 36 PATH_SUFFIXES include include/CEGUI CEGUI.framework/Headers 38 37 ) 38 39 # Inspect CEGUIVersion.h for the version number 40 DETERMINE_VERSION(CEGUI ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h) 41 42 # Find CEGUI library 39 43 FIND_LIBRARY(CEGUI_LIBRARY_OPTIMIZED 40 44 NAMES CEGUIBase CEGUI … … 50 54 ) 51 55 52 # Inspect CEGUIVersion.h for the version number 53 DETERMINE_VERSION(CEGUI ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h) 56 # Find CEGUILua libraries 57 FIND_LIBRARY(CEGUILUA_LIBRARY_OPTIMIZED 58 NAMES CEGUILua CEGUILuaScriptModule 59 PATHS $ENV{CEGUIDIR} 60 PATH_SUFFIXES lib bin 61 ) 62 FIND_LIBRARY(CEGUILUA_LIBRARY_DEBUG 63 NAMES CEGUILuad CEGUILua_d CEGUILuaScriptModuled CEGUILuaScriptModule_d 64 PATHS $ENV{CEGUIDIR} 65 PATH_SUFFIXES lib bin 66 ) 67 68 # Find CEGUI Tolua++ libraries 69 FIND_LIBRARY(CEGUI_TOLUA_LIBRARY_OPTIMIZED 70 NAMES CEGUItoluapp tolua++ 71 PATHS $ENV{CEGUIDIR} 72 PATH_SUFFIXES lib bin 73 ) 74 FIND_LIBRARY(CEGUI_TOLUA_LIBRARY_DEBUG 75 NAMES CEGUItoluappd CEGUItoluapp_d tolua++d tolua++_d 76 PATHS $ENV{CEGUIDIR} 77 PATH_SUFFIXES lib bin 78 ) 79 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() 54 98 55 99 # Handle the REQUIRED argument and set CEGUI_FOUND 56 100 # Also checks the version requirements if given 57 101 FIND_PACKAGE_HANDLE_ADVANCED_ARGS(CEGUI DEFAULT_MSG "${CEGUI_VERSION}" 102 CEGUI_INCLUDE_DIR 58 103 CEGUI_LIBRARY_OPTIMIZED 59 CEGUI_INCLUDE_DIR 104 CEGUILUA_LIBRARY_OPTIMIZED 105 CEGUI_TOLUA_LIBRARY_OPTIMIZED 106 ${CEGUI_OGRE_RENDERER_LIBRARY_NAME} 60 107 ) 61 108 62 109 # Collect optimized and debug libraries 63 110 HANDLE_LIBRARY_TYPES(CEGUI) 111 HANDLE_LIBRARY_TYPES(CEGUILUA) 112 HANDLE_LIBRARY_TYPES(CEGUI_TOLUA) 113 IF(NOT CEGUI_OGRE_RENDERER_BUILD_REQUIRED) 114 HANDLE_LIBRARY_TYPES(CEGUI_OGRE_RENDERER) 115 ENDIF() 64 116 65 117 MARK_AS_ADVANCED( … … 67 119 CEGUI_LIBRARY_OPTIMIZED 68 120 CEGUI_LIBRARY_DEBUG 121 CEGUILUA_LIBRARY_OPTIMIZED 122 CEGUILUA_LIBRARY_DEBUG 123 CEGUI_TOLUA_LIBRARY_OPTIMIZED 124 CEGUI_TOLUA_LIBRARY_DEBUG 125 CEGUI_OGRE_RENDERER_LIBRARY_OPTIMIZED 126 CEGUI_OGRE_RENDERER_LIBRARY_DEBUG 69 127 ) 70 71 LIST(FIND CEGUILUA_INTERNAL_SUPPORT "${CEGUI_VERSION}" _find_result)72 IF(CEGUILUA_USE_EXTERNAL_LIBRARY OR _find_result EQUAL -1)73 # Also try to find the CEGUILua libraries.74 # There would already be libraries in src/ for versions 0.5 and 0.675 FIND_LIBRARY(CEGUILUA_LIBRARY_OPTIMIZED76 NAMES CEGUILua77 PATHS $ENV{CEGUIDIR}78 PATH_SUFFIXES lib bin79 )80 FIND_LIBRARY(CEGUILUA_LIBRARY_DEBUG81 NAMES CEGUILuad CEGUILua_d82 PATHS $ENV{CEGUIDIR}83 PATH_SUFFIXES lib bin84 )85 86 SET(CEGUILua_FIND_REQUIRED ${CEGUI_FIND_REQUIRED})87 # Handle the REQUIRED argument and set CEGUILUA_FOUND88 FIND_PACKAGE_HANDLE_STANDARD_ARGS(CEGUILua DEFAULT_MSG89 CEGUILUA_LIBRARY_OPTIMIZED90 )91 92 # Collect optimized and debug libraries93 HANDLE_LIBRARY_TYPES(CEGUILUA)94 95 MARK_AS_ADVANCED(96 CEGUILUA_LIBRARY_OPTIMIZED97 CEGUILUA_LIBRARY_DEBUG98 )99 100 ELSE(CEGUILUA_USE_EXTERNAL_LIBRARY OR _find_result EQUAL -1)101 SET(CEGUILUA_USE_INTERNAL_LIBRARY TRUE)102 ENDIF(CEGUILUA_USE_EXTERNAL_LIBRARY OR _find_result EQUAL -1)103 -
code/branches/kicklib2/data/gui/scripts/GUITools.lua
r8079 r8283 31 31 32 32 local lookAndFeel = CEGUI.WidgetLookManager:getSingleton():getWidgetLook(window:getLookNFeel()) 33 local height = window:getFont():getLineSpacing() + window:getUnclipped PixelRect():getHeight() - lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window):getHeight()34 local width = window:getFont():getTextExtent(window:getText()) + window:getUnclipped PixelRect():getWidth() - lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window):getWidth()33 local height = window:getFont():getLineSpacing() + window:getUnclippedOuterRect():getHeight() - lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window):getHeight() 34 local width = window:getFont():getTextExtent(window:getText()) + window:getUnclippedOuterRect():getWidth() - lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window):getWidth() 35 35 36 36 table.insert(size, height) … … 40 40 41 41 function getScrollingStepSize(window) 42 local height = window:getUnclipped PixelRect():getHeight()43 local maxHeight = CEGUI.System:getSingleton():getGUISheet():getUnclipped PixelRect():getHeight()42 local height = window:getUnclippedOuterRect():getHeight() 43 local maxHeight = CEGUI.System:getSingleton():getGUISheet():getUnclippedOuterRect():getHeight() 44 44 local ratio = height/maxHeight 45 45 return 0.008*ratio/0.3204 … … 47 47 48 48 function getStaticTextWindowHeight(window) 49 -- Get the area the text is formatted and drawn into. 49 50 local lookAndFeel = CEGUI.WidgetLookManager:getSingleton():getWidgetLook(window:getLookNFeel()) 50 51 local formattedArea = lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window) 51 local frameHeight = window:getUnclippedPixelRect():getHeight() - formattedArea:getHeight() 52 local lines = window:getFont():getFormattedLineCount(window:getText(), formattedArea, CEGUI.WordWrapLeftAligned) 53 local height = lines * window:getFont():getLineSpacing() + frameHeight 52 -- Calculate the pixel height of the frame by subtracting the height of the area above from the total height of the window. 53 local frameHeight = window:getUnclippedOuterRect():getHeight() - formattedArea:getHeight() 54 55 local height = 0 56 if ORXONOX_OLD_CEGUI then 57 local lines = window:getFont():getFormattedLineCount(window:getText(), formattedArea, CEGUI.WordWrapLeftAligned) 58 height = lines * window:getFont():getLineSpacing() + frameHeight 59 else 60 height = math.floor(CEGUI.PropertyHelper:stringToFloat(window:getProperty("VertExtent")) + frameHeight) + 1 61 end 54 62 return height 55 63 end -
code/branches/kicklib2/data/gui/scripts/InitialiseGUI.lua
r7801 r8283 7 7 local scheme = orxonox.CommandExecutor:query("getConfig GUIManager guiScheme_") 8 8 -- Load all required skins 9 --schemeMgr: loadScheme("TaharezGreenLook.scheme")10 schemeMgr: loadScheme(scheme .. "Look.scheme")11 --schemeMgr: loadScheme("TaharezLook.scheme")12 --schemeMgr: loadScheme("WindowsLook.scheme")13 --schemeMgr: loadScheme("VanillaLook.scheme")14 --schemeMgr: loadScheme("SleekSpaceLook.scheme")9 --schemeMgr:create("TaharezGreenLook.scheme") 10 schemeMgr:create(scheme .. "Look.scheme") 11 --schemeMgr:create("TaharezLook.scheme") 12 --schemeMgr:create("WindowsLook.scheme") 13 --schemeMgr:create("VanillaLook.scheme") 14 --schemeMgr:create("SleekSpaceLook.scheme") 15 15 16 16 -- Connect skin specific window types with our own window types 17 17 -- By loading a different file (if there is) you can change the skin 18 18 -- of the menus or the HUD independently 19 --schemeMgr: loadScheme("TaharezGreenMenuWidgets.scheme")19 --schemeMgr:create("TaharezGreenMenuWidgets.scheme") 20 20 --menuImageSet = "TaharezGreenLook" 21 --schemeMgr: loadScheme("TaharezGreenHUDWidgets.scheme")21 --schemeMgr:create("TaharezGreenHUDWidgets.scheme") 22 22 --hudImageSet = "TaharezGreenLook" 23 schemeMgr: loadScheme(scheme .. "MenuWidgets.scheme")23 schemeMgr:create(scheme .. "MenuWidgets.scheme") 24 24 menuImageSet = scheme .. "Look" 25 schemeMgr: loadScheme(scheme .. "HUDWidgets.scheme")25 schemeMgr:create(scheme .. "HUDWidgets.scheme") 26 26 hudImageSet = scheme .. "Look" 27 27 28 28 -- Just a remaining test hack 29 schemeMgr: loadScheme("OrxonoxGUIScheme.scheme")29 schemeMgr:create("OrxonoxGUIScheme.scheme") 30 30 31 31 local system = CEGUI.System:getSingleton() -
code/branches/kicklib2/data/gui/scripts/NotificationLayer.lua
r8079 r8283 484 484 local lookAndFeel = CEGUI.WidgetLookManager:getSingleton():getWidgetLook(queue:getLookNFeel()) 485 485 local formattedArea = lookAndFeel:getNamedArea("ItemRenderingArea"):getArea():getPixelRect(queue) 486 local frameHeight = queue:getUnclipped PixelRect():getHeight() - formattedArea:getHeight()486 local frameHeight = queue:getUnclippedOuterRect():getHeight() - formattedArea:getHeight() 487 487 listbox:removeItem(item) 488 488 return frameHeight + singleItemHeight*size -
code/branches/kicklib2/doc/api/doxy.config.in
r7818 r8283 626 626 EXCLUDE = @CMAKE_SOURCE_DIR@/src/external/bullet/ \ 627 627 @CMAKE_SOURCE_DIR@/src/external/cpptcl/ \ 628 @CMAKE_SOURCE_DIR@/src/external/ceguilua/ceguilua-0.5.0 \629 @CMAKE_SOURCE_DIR@/src/external/ceguilua/ceguilua-0.6.0 \630 @CMAKE_SOURCE_DIR@/src/external/ceguilua/ceguilua-0.6.1 \631 628 @CMAKE_SOURCE_DIR@/src/libraries/core/command/IOConsoleWindows.h \ 632 629 @CMAKE_SOURCE_DIR@/src/libraries/core/command/IOConsoleWindows.cc \ -
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.