Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8283


Ignore:
Timestamp:
Apr 21, 2011, 6:32:28 PM (14 years ago)
Author:
rgrieder
Message:

Merged revisions 7940-7974 from kicklib to kicklib2.

Location:
code/branches/kicklib2
Files:
12 deleted
33 edited
2 copied

Legend:

Unmodified
Added
Removed
  • code/branches/kicklib2

  • code/branches/kicklib2/INSTALL

    r7248 r8283  
    99(for windows there are already precompiled packages on the website)
    1010
    11 OGRE 3D Graphics Engine          1.4 - 1.7
    12 CEGUI (Crazy Eddie's GUI System) 0.5 - 0.6
     11OGRE 3D Graphics Engine          1.6 - 1.7
     12CEGUI (Crazy Eddie's GUI System) 0.6
    1313Boost libraries                  1.35 -
    14 ENet (Network library)           1.1 - 1.2
    1514Lua (scripting language)         5.0 - 5.1
    1615Tcl (shell script language)      8.4 - 8.5
  • code/branches/kicklib2/bin/vld.ini.in

    r5929 r8283  
    5656;   Default: None.
    5757;
    58 ForceIncludeModules = boost_date_time-vc80-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.dll
     58ForceIncludeModules = 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
    5959
    6060; Maximum number of data bytes to display for each leaked block. If zero, then
  • code/branches/kicklib2/cmake/LibraryConfig.cmake

    r8264 r8283  
    9393# Performs the search and sets the variables    #
    9494
    95 FIND_PACKAGE(OGRE  1.4       REQUIRED)
    96 #FIND_PACKAGE(ENet  1.1       REQUIRED)
     95FIND_PACKAGE(OGRE     1.6    REQUIRED)
     96#FIND_PACKAGE(ENet     1.1    REQUIRED)
     97FIND_PACKAGE(Lua5.1          REQUIRED)
    9798FIND_PACKAGE(Ogg             REQUIRED)
    9899FIND_PACKAGE(Vorbis          REQUIRED)
     
    111112##### CEGUI #####
    112113# 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.
     119FIND_PACKAGE(CEGUI 0.6 REQUIRED)
    140120
    141121##### OpenAL #####
     
    177157# Note: Default option in the libraries vary, but our default option is dynamic
    178158IF(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)
    191166
    192167  IF(DEPENDENCY_PACKAGE_ENABLE)
     
    194169      LINK_BOOST_DYNAMIC LINK_CEGUI_DYNAMIC #LINK_ENET_DYNAMIC
    195170      LINK_OGRE_DYNAMIC  LINK_TCL_DYNAMIC   LINK_ZLIB_DYNAMIC
    196       LINK_LUA_DYNAMIC
     171      LINK_LUA5.1_DYNAMIC
    197172    )
    198173  ENDIF()
  • code/branches/kicklib2/cmake/LibraryConfigTardis.cmake

    r6746 r8283  
    7777  #SET(ENV{OGGDIR}      "/usr/pack/oggvorbis-1.0-ds;/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0")
    7878  #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")
    8080  #SET(ENV{OGRE_HOME}   "/usr/pack/ogre-1.4.9-sd;/usr/pack/ogre-1.4.9-sd/i686-debian-linux4.0")
    8181  #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  
    3131#        But you can specify that the code only runs on 3.1 and higher
    3232#        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)
     33IF(MSVC)
     34  SET(ALLOWED_MINIMUM_VERSIONS 4.3 5.1 6.0)
     35ELSE()
     36  SET(ALLOWED_MINIMUM_VERSIONS 4.1 5.2)
     37ENDIF()
    3438
    3539IF(NOT EXISTS ${DEPENDENCY_PACKAGE_DIR}/version.txt)
     
    8488SET(ENV{DXSDK_DIR}             ${DEP_INCLUDE_DIR}/directx)
    8589#SET(ENV{ENETDIR}               ${DEP_INCLUDE_DIR}/enet)
    86 SET(ENV{LUA_DIR}               ${DEP_INCLUDE_DIR}/lua)
     90SET(ENV{LUA5.1_DIR}            ${DEP_INCLUDE_DIR}/lua)
    8791SET(ENV{OGGDIR}                ${DEP_INCLUDE_DIR}/libogg)
    8892SET(ENV{VORBISDIR}             ${DEP_INCLUDE_DIR}/libvorbis)
  • code/branches/kicklib2/cmake/tools/FindCEGUI.cmake

    r7163 r8283  
    44#  CEGUI_INCLUDE_DIR
    55#  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++.
    68#  CEGUI_FOUND, If false, do not try to use CEGUI
    79#  CEGUI_VERSION, the version as string "x.y.z"
    8 #  CEGUILUA_LIBRARY, Script module library
    9 #  CEGUILUA_USE_INTERNAL_LIBRARY, True if CEGUILUA_LIBRARY was not defined here
    1010#
    1111# Input:
    1212#  ENV{CEGUIDIR}, CEGUI path, optional
    13 #  FIND CEGUILUA_INTERNAL_SUPPORT, List of all CEGUILua version supported
    14 #                                  in the source repository
    15 #  CEGUILUA_USE_EXTERNAL_LIBRARY, Force finding of CEGUILua
    1613#
    1714# Created by Matt Williams to find OGRE libraries
     
    2926#                 > www.orxonox.net <
    3027
     28INCLUDE(CompareVersionStrings)
    3129INCLUDE(DetermineVersion)
    3230INCLUDE(FindPackageHandleAdvancedArgs)
    3331INCLUDE(HandleLibraryTypes)
    3432
     33# Find headers
    3534FIND_PATH(CEGUI_INCLUDE_DIR CEGUI.h
    3635  PATHS $ENV{CEGUIDIR}
    3736  PATH_SUFFIXES include include/CEGUI CEGUI.framework/Headers
    3837)
     38
     39# Inspect CEGUIVersion.h for the version number
     40DETERMINE_VERSION(CEGUI ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h)
     41
     42# Find CEGUI library
    3943FIND_LIBRARY(CEGUI_LIBRARY_OPTIMIZED
    4044  NAMES CEGUIBase CEGUI
     
    5054)
    5155
    52 # Inspect CEGUIVersion.h for the version number
    53 DETERMINE_VERSION(CEGUI ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h)
     56# Find CEGUILua libraries
     57FIND_LIBRARY(CEGUILUA_LIBRARY_OPTIMIZED
     58  NAMES CEGUILua CEGUILuaScriptModule
     59  PATHS $ENV{CEGUIDIR}
     60  PATH_SUFFIXES lib bin
     61)
     62FIND_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
     69FIND_LIBRARY(CEGUI_TOLUA_LIBRARY_OPTIMIZED
     70  NAMES CEGUItoluapp tolua++
     71  PATHS $ENV{CEGUIDIR}
     72  PATH_SUFFIXES lib bin
     73)
     74FIND_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
     81COMPARE_VERSION_STRINGS("${CEGUI_VERSION}" "0.7" _version_compare TRUE)
     82IF(_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)
     95ELSE()
     96  SET(CEGUI_OGRE_RENDERER_BUILD_REQUIRED TRUE)
     97ENDIF()
    5498
    5599# Handle the REQUIRED argument and set CEGUI_FOUND
    56100# Also checks the version requirements if given
    57101FIND_PACKAGE_HANDLE_ADVANCED_ARGS(CEGUI DEFAULT_MSG "${CEGUI_VERSION}"
     102  CEGUI_INCLUDE_DIR
    58103  CEGUI_LIBRARY_OPTIMIZED
    59   CEGUI_INCLUDE_DIR
     104  CEGUILUA_LIBRARY_OPTIMIZED
     105  CEGUI_TOLUA_LIBRARY_OPTIMIZED
     106  ${CEGUI_OGRE_RENDERER_LIBRARY_NAME}
    60107)
    61108
    62109# Collect optimized and debug libraries
    63110HANDLE_LIBRARY_TYPES(CEGUI)
     111HANDLE_LIBRARY_TYPES(CEGUILUA)
     112HANDLE_LIBRARY_TYPES(CEGUI_TOLUA)
     113IF(NOT CEGUI_OGRE_RENDERER_BUILD_REQUIRED)
     114  HANDLE_LIBRARY_TYPES(CEGUI_OGRE_RENDERER)
     115ENDIF()
    64116
    65117MARK_AS_ADVANCED(
     
    67119  CEGUI_LIBRARY_OPTIMIZED
    68120  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
    69127)
    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.6
    75   FIND_LIBRARY(CEGUILUA_LIBRARY_OPTIMIZED
    76     NAMES CEGUILua
    77     PATHS $ENV{CEGUIDIR}
    78     PATH_SUFFIXES lib bin
    79   )
    80   FIND_LIBRARY(CEGUILUA_LIBRARY_DEBUG
    81     NAMES CEGUILuad CEGUILua_d
    82     PATHS $ENV{CEGUIDIR}
    83     PATH_SUFFIXES lib bin
    84   )
    85 
    86   SET(CEGUILua_FIND_REQUIRED ${CEGUI_FIND_REQUIRED})
    87   # Handle the REQUIRED argument and set CEGUILUA_FOUND
    88   FIND_PACKAGE_HANDLE_STANDARD_ARGS(CEGUILua DEFAULT_MSG
    89     CEGUILUA_LIBRARY_OPTIMIZED
    90   )
    91 
    92   # Collect optimized and debug libraries
    93   HANDLE_LIBRARY_TYPES(CEGUILUA)
    94 
    95   MARK_AS_ADVANCED(
    96     CEGUILUA_LIBRARY_OPTIMIZED
    97     CEGUILUA_LIBRARY_DEBUG
    98   )
    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  
    3131
    3232    local lookAndFeel = CEGUI.WidgetLookManager:getSingleton():getWidgetLook(window:getLookNFeel())
    33     local height = window:getFont():getLineSpacing() + window:getUnclippedPixelRect():getHeight() - lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window):getHeight()
    34     local width =  window:getFont():getTextExtent(window:getText()) + window:getUnclippedPixelRect():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()
    3535
    3636    table.insert(size, height)
     
    4040
    4141function getScrollingStepSize(window)
    42     local height = window:getUnclippedPixelRect():getHeight()
    43     local maxHeight = CEGUI.System:getSingleton():getGUISheet():getUnclippedPixelRect():getHeight()
     42    local height = window:getUnclippedOuterRect():getHeight()
     43    local maxHeight = CEGUI.System:getSingleton():getGUISheet():getUnclippedOuterRect():getHeight()
    4444    local ratio = height/maxHeight
    4545    return 0.008*ratio/0.3204
     
    4747
    4848function getStaticTextWindowHeight(window)
     49    -- Get the area the text is formatted and drawn into.
    4950    local lookAndFeel = CEGUI.WidgetLookManager:getSingleton():getWidgetLook(window:getLookNFeel())
    5051    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
    5462    return height
    5563end
  • code/branches/kicklib2/data/gui/scripts/InitialiseGUI.lua

    r7801 r8283  
    77local scheme = orxonox.CommandExecutor:query("getConfig GUIManager guiScheme_")
    88-- 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")
     10schemeMgr:create(scheme .. "Look.scheme")
     11--schemeMgr:create("TaharezLook.scheme")
     12--schemeMgr:create("WindowsLook.scheme")
     13--schemeMgr:create("VanillaLook.scheme")
     14--schemeMgr:create("SleekSpaceLook.scheme")
    1515
    1616-- Connect skin specific window types with our own window types
    1717-- By loading a different file (if there is) you can change the skin
    1818-- of the menus or the HUD independently
    19 --schemeMgr:loadScheme("TaharezGreenMenuWidgets.scheme")
     19--schemeMgr:create("TaharezGreenMenuWidgets.scheme")
    2020--menuImageSet = "TaharezGreenLook"
    21 --schemeMgr:loadScheme("TaharezGreenHUDWidgets.scheme")
     21--schemeMgr:create("TaharezGreenHUDWidgets.scheme")
    2222--hudImageSet = "TaharezGreenLook"
    23 schemeMgr:loadScheme(scheme .. "MenuWidgets.scheme")
     23schemeMgr:create(scheme .. "MenuWidgets.scheme")
    2424menuImageSet = scheme .. "Look"
    25 schemeMgr:loadScheme(scheme .. "HUDWidgets.scheme")
     25schemeMgr:create(scheme .. "HUDWidgets.scheme")
    2626hudImageSet = scheme .. "Look"
    2727
    2828-- Just a remaining test hack
    29 schemeMgr:loadScheme("OrxonoxGUIScheme.scheme")
     29schemeMgr:create("OrxonoxGUIScheme.scheme")
    3030
    3131local system = CEGUI.System:getSingleton()
  • code/branches/kicklib2/data/gui/scripts/NotificationLayer.lua

    r8079 r8283  
    484484    local lookAndFeel = CEGUI.WidgetLookManager:getSingleton():getWidgetLook(queue:getLookNFeel())
    485485    local formattedArea = lookAndFeel:getNamedArea("ItemRenderingArea"):getArea():getPixelRect(queue)
    486     local frameHeight = queue:getUnclippedPixelRect():getHeight() - formattedArea:getHeight()
     486    local frameHeight = queue:getUnclippedOuterRect():getHeight() - formattedArea:getHeight()
    487487    listbox:removeItem(item)
    488488    return frameHeight + singleItemHeight*size
  • code/branches/kicklib2/doc/api/doxy.config.in

    r7818 r8283  
    626626EXCLUDE                = @CMAKE_SOURCE_DIR@/src/external/bullet/ \
    627627                         @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 \
    631628                         @CMAKE_SOURCE_DIR@/src/libraries/core/command/IOConsoleWindows.h \
    632629                         @CMAKE_SOURCE_DIR@/src/libraries/core/command/IOConsoleWindows.cc \
  • code/branches/kicklib2/src/CMakeLists.txt

    r8079 r8283  
    4040ADD_COMPILER_FLAGS("-DBOOST_ALL_DYN_LINK" WIN32 LINK_BOOST_DYNAMIC)
    4141#ADD_COMPILER_FLAGS("-DENET_DLL"           WIN32 LINK_ENET_DYNAMIC)
    42 ADD_COMPILER_FLAGS("-DLUA_BUILD_AS_DLL"   WIN32 LINK_LUA_DYNAMIC)
     42ADD_COMPILER_FLAGS("-DLUA_BUILD_AS_DLL"   WIN32 LINK_LUA5.1_DYNAMIC)
    4343ADD_COMPILER_FLAGS("-DZLIB_DLL"           WIN32 LINK_ZLIB_DYNAMIC)
    4444# If no defines are specified, these libs get linked dynamically
    45 ADD_COMPILER_FLAGS("-DCEGUI_STATIC"      WIN32 NOT LINK_CEGUI_DYNAMIC)
     45ADD_COMPILER_FLAGS("-DCEGUI_STATIC -DTOLUA_STATIC" WIN32 NOT LINK_CEGUI_DYNAMIC)
    4646ADD_COMPILER_FLAGS("-DOGRE_STATIC_LIB"    WIN32 NOT LINK_OGRE_DYNAMIC)
    4747ADD_COMPILER_FLAGS("-DSTATIC_BUILD"       WIN32 NOT LINK_TCL_DYNAMIC)
     
    6161ENDIF()
    6262# If no defines are specified, these libs get linked dynamically
    63 ADD_COMPILER_FLAGS("-DCEGUILUA_STATIC"             WIN32 NOT _external_shared_link)
    6463ADD_COMPILER_FLAGS("-DENET_DLL"                    WIN32     _external_shared_link)
    6564ADD_COMPILER_FLAGS("-DOGRE_GUIRENDERER_STATIC_LIB" WIN32 NOT _external_shared_link)
    6665ADD_COMPILER_FLAGS("-DOIS_STATIC_LIB"              WIN32 NOT _external_shared_link)
    67 ADD_COMPILER_FLAGS("-DTOLUA_STATIC_BUILD"          WIN32 NOT _external_shared_link)
    6866
    6967############## Include Directories ##############
     
    8179  ${VORBIS_INCLUDE_DIR}
    8280  ${OGG_INCLUDE_DIR}
    83   ${LUA_INCLUDE_DIR}
     81  ${LUA5.1_INCLUDE_DIR}
    8482  ${TCL_INCLUDE_PATH}
    8583  ${DIRECTX_INCLUDE_DIR}
     
    9795)
    9896
    99 IF(CEGUILUA_USE_INTERNAL_LIBRARY)
    100   INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/external/ceguilua/ceguilua-${CEGUI_VERSION})
     97IF (DBGHELP_FOUND)
     98  INCLUDE_DIRECTORIES(${DBGHELP_INCLUDE_DIR})
    10199ENDIF()
    102100
    103 IF (DBGHELP_FOUND)
    104   INCLUDE_DIRECTORIES(${DBGHELP_INCLUDE_DIR})
     101############## CEGUI OGRE Renderer ##############
     102
     103IF(CEGUI_OGRE_RENDERER_BUILD_REQUIRED)
     104  SET(CEGUI_OGRE_RENDERER_LIBRARY ogreceguirenderer_orxonox)
    105105ENDIF()
    106106
  • code/branches/kicklib2/src/SpecialConfig.h.in

    r7818 r8283  
    4141
    4242#include "OrxonoxConfig.h"
    43 
    44 #cmakedefine CEGUILUA_USE_INTERNAL_LIBRARY  ///< Set whether we must suffix "ceguilua/" for the CEGUILua.h include
    4543
    4644#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  
    2121
    2222ADD_SUBDIRECTORY(tolua)
    23 
    24 # Include CEGUILua if not requested otherwise
    25 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 
    3423ADD_SUBDIRECTORY(bullet)
    3524ADD_SUBDIRECTORY(cpptcl)
    3625ADD_SUBDIRECTORY(enet)
    3726ADD_SUBDIRECTORY(loki)
    38 ADD_SUBDIRECTORY(ogreceguirenderer)
     27IF(CEGUI_OGRE_RENDERER_BUILD_REQUIRED)
     28  ADD_SUBDIRECTORY(ogreceguirenderer)
     29ENDIF()
    3930ADD_SUBDIRECTORY(ois)
    4031ADD_SUBDIRECTORY(tinyxml)
  • code/branches/kicklib2/src/external/ogreceguirenderer/OgreCEGUIRenderer.cpp

    r5781 r8283  
    455455        d_render_sys->_setTextureAddressingMode(0, d_uvwAddressMode);
    456456        d_render_sys->_setTextureMatrix(0, Matrix4::IDENTITY);
    457 #if OGRE_VERSION >= 0x010600
    458457        d_render_sys->_setAlphaRejectSettings(CMPF_ALWAYS_PASS, 0, false);
    459 #else
    460         d_render_sys->_setAlphaRejectSettings(CMPF_ALWAYS_PASS, 0);
    461 #endif
    462458        d_render_sys->_setTextureBlendMode(0, d_colourBlendMode);
    463459        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.1 source.
     1This library is part of the OGRE v1.6.5 source.
    22
    33-----
  • code/branches/kicklib2/src/external/ogreceguirenderer/changes_orxonox.diff

    r7163 r8283  
    1818 #include "OgreCEGUIRenderer.h"
    1919 #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 >= 0x010600
    25 +       d_render_sys->_setAlphaRejectSettings(CMPF_ALWAYS_PASS, 0, false);
    26 +#else
    27         d_render_sys->_setAlphaRejectSettings(CMPF_ALWAYS_PASS, 0);
    28 +#endif
    29         d_render_sys->_setTextureBlendMode(0, d_colourBlendMode);
    30         d_render_sys->_setTextureBlendMode(0, d_alphaBlendMode);
    31         d_render_sys->_disableTextureUnitsFrom(1);
    3220--- OgreCEGUIRenderer.h Wed Jan 28 21:14:09 2009
    3321+++ OgreCEGUIRenderer.h Wed Jan 28 21:06:46 2009
  • code/branches/kicklib2/src/external/tolua/CMakeLists.txt

    r7163 r8283  
    1818 #
    1919
    20 ################### Tolua++ library ###################
    21 
    22 SET_SOURCE_FILES(TOLUA_FILES
    23   tolua_event.h
    24   tolua++.h
    25 COMPILATION_BEGIN ToluaCompilation.c
    26   tolua_event.c
    27   tolua_is.c
    28   tolua_map.c
    29   tolua_push.c
    30   tolua_to.c
    31 COMPILATION_END
    32 )
    33 
    34 ORXONOX_ADD_LIBRARY(tolua_orxonox
    35   ORXONOX_EXTERNAL
    36   DEFINE_SYMBOL
    37     "TOLUA_SHARED_BUILD"
    38   VERSION
    39     1.0.92
    40   LINK_LIBRARIES
    41     ${LUA_LIBRARIES}
    42   SOURCE_FILES
    43     ${TOLUA_FILES}
    44 )
    45 
    46 
    4720################## Tolua++ generator ##################
    4821
     
    5326  NO_INSTALL
    5427  LINK_LIBRARIES
    55     ${LUA_LIBRARIES}
     28    ${LUA5.1_LIBRARY}
    5629  SOURCE_FILES
    5730    tolua.c
     
    5932
    6033# 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 "")
     34SET(TOLUA_PARSER_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/all-5.1.lua" CACHE INTERNAL "")
    6235SET(TOLUA_PARSER_DEPENDENCIES
    6336  toluaapp_orxonox
    64   ${CMAKE_CURRENT_SOURCE_DIR}/all-${LUA_VERSION}.lua
     37  ${CMAKE_CURRENT_SOURCE_DIR}/all-5.1.lua
    6538  ${CMAKE_CURRENT_SOURCE_DIR}/lua/compat-5.1.lua
    6639  ${CMAKE_CURRENT_SOURCE_DIR}/lua/compat.lua
  • code/branches/kicklib2/src/external/tolua/VERSION

    r5738 r8283  
    1 Tolua++ v1.0.92 with changes:
     1Tolua++ v1.0.92 (generator application only) with changes:
    22
    33- Exception handling by CEGUI team
  • code/branches/kicklib2/src/external/tolua/changes_orxonox.diff

    r5738 r8283  
    1 diff -ruN tolua/tolua++.h tolua2/tolua++.h
    2 --- tolua/tolua++.h     Wed Jan 28 21:51:38 2009
    3 +++ tolua2/tolua++.h    Sat Jan 10 14:48:44 2009
    4 @@ -16,9 +16,34 @@
    5  #ifndef TOLUA_H
    6  #define TOLUA_H
    7  
    8 +/* original code */
    9 +/*
    10  #ifndef TOLUA_API
    11  #define TOLUA_API extern
    12  #endif
    13 +*/
    14 +
    15 +/********************************
    16 +******* ORXONOX CHANGES *********
    17 +********************************/
    18 +
    19 +#if (defined( __WIN32__ ) || defined( _WIN32 )) && !defined( TOLUA_STATIC_BUILD )
    20 +#  ifdef TOLUA_SHARED_BUILD
    21 +#    define TOLUA_API __declspec(dllexport)
    22 +#  else
    23 +#    if defined( __MINGW32__ )
    24 +#      define TOLUA_API
    25 +#    else
    26 +#      define TOLUA_API __declspec(dllimport)
    27 +#    endif
    28 +#  endif
    29 +#else
    30 +#  define TOLUA_API extern
    31 +#endif
    32 +
    33 +/********************************
    34 +****** END ORXONOX CHANGES ******
    35 +********************************/
    36  
    37  #define TOLUA_VERSION "tolua++-1.0.92"
    38  
    391diff -ruN tolua/tolua.c tolua2/tolua.c
    402--- tolua/tolua.c       Wed Jan 28 21:51:00 2009
  • code/branches/kicklib2/src/external/tolua/lua/package.lua

    r5752 r8283  
    124124    output('#endif\n')
    125125    output('#include <string.h>\n\n')
    126     output('#include <tolua/tolua++.h>\n\n')
     126    output('#include <tolua++.h>\n\n')
    127127
    128128    if flags.H then
  • code/branches/kicklib2/src/libraries/core/CMakeLists.txt

    r8079 r8283  
    5858  command/ArgumentCompletionFunctions.cc
    5959  ConfigFileManager.cc
    60   MemoryArchive.cc
    6160  PathConfig.cc
    6261COMPILATION_END
     
    9897    ${CEGUI_LIBRARY}
    9998    ${CEGUILUA_LIBRARY}
    100     ${LUA_LIBRARIES}
     99    ${CEGUI_TOLUA_LIBRARY}
     100    ${CEGUI_OGRE_RENDERER_LIBRARY}
     101    ${LUA5.1_LIBRARY}
    101102    cpptcl_orxonox
    102     ogreceguirenderer_orxonox
    103103    ois_orxonox
    104104    tinyxml_orxonox
    105     tolua_orxonox
    106105    util
    107106  SOURCE_FILES
  • code/branches/kicklib2/src/libraries/core/CorePrereqs.h

    r8079 r8283  
    3838#include "OrxonoxConfig.h"
    3939#include <boost/version.hpp>
     40#include <CEGUIVersion.h>
    4041
    4142//-----------------------------------------------------------------------
     
    306307    class LuaScriptModule;
    307308
     309#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
    308310    class OgreCEGUIRenderer;
    309311    class OgreCEGUIResourceProvider;
    310312    class OgreCEGUITexture;
     313#else
     314    class OgreRenderer;
     315    class OgreResourceProvider;
     316    class OgreImageCodec;
     317#endif
    311318}
    312319
  • code/branches/kicklib2/src/libraries/core/GUIManager.cc

    r8079 r8283  
    3030#include "GUIManager.h"
    3131
     32#include <memory>
    3233#include <boost/bind.hpp>
    33 #include <memory>
     34#include <OgreRenderQueue.h>
     35#include <OgreRenderWindow.h>
    3436
    3537#include <CEGUIDefaultLogger.h>
     
    4345#include <elements/CEGUIListbox.h>
    4446#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>
     51extern "C" {
     52#  include <lauxlib.h>
     53}
    5054#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>
    5259#endif
    5360
     
    8996                case CEGUI::Informative: orxonoxLevel = 5; break;
    9097                case CEGUI::Insane:      orxonoxLevel = 6; break;
    91                 default: OrxAssert(false, "CEGUI log level out of range, inpect immediately!");
     98                default: OrxAssert(false, "CEGUI log level out of range, inspect immediately!");
    9299            }
    93100            OutputHandler::getOutStream(orxonoxLevel)
     
    97104        }
    98105    };
     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
    99128
    100129    static CEGUI::MouseButton convertButton(MouseButtonCode::ByEnum button);
     
    118147    */
    119148    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
    121158        , camera_(NULL)
    122159    {
     
    129166
    130167        // 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);
    132170        resourceProvider_ = guiRenderer_->createResourceProvider();
     171#else
     172        guiRenderer_ = &OgreRenderer::create(*GraphicsManager::getInstance().getRenderWindow());
     173        resourceProvider_ = &OgreRenderer::createOgreResourceProvider();
     174        imageCodec_ = &OgreRenderer::createOgreImageCodec();
     175#endif
    133176        resourceProvider_->setDefaultResourceGroup("General");
    134177
    135178        // Setup scripting
    136         luaState_.reset(new LuaState());
     179        luaState_ = new LuaState();
    137180        rootFileInfo_ = Resource::getInfo("InitialiseGUI.lua");
    138181        // This is necessary to ensure that input events also use the right resource info when triggering lua functions
    139182        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
    141194        scriptModule_->setDefaultPCallErrorHandler(LuaState::ERROR_HANDLER_NAME);
    142195
     
    144197        std::auto_ptr<CEGUILogger> ceguiLogger(new CEGUILogger());
    145198        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)
    147200        ceguiLogger->setLoggingLevel(
    148201            static_cast<LoggingLevel>(OutputHandler::getInstance().getSoftDebugLevel("logFile") - 1));
     
    150203
    151204        // 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
    153213
    154214        // Align CEGUI mouse with OIS mouse
     
    175235    }
    176236
    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_;
    183253    }
    184254
     
    222292    {
    223293        this->camera_ = camera;
     294#ifdef ORXONOX_OLD_CEGUI
    224295        if (camera == NULL)
    225296            this->guiRenderer_->setTargetSceneManager(0);
    226297        else
    227298            this->guiRenderer_->setTargetSceneManager(camera->getSceneManager());
     299#endif
    228300    }
    229301
     
    522594        The Listbox for which to enable (or disable) tooltips.
    523595    @param enabled
    524         Whether to enable or disabel the tooltips.
     596        Whether to enable or disable the tooltips.
    525597    */
    526598    void GUIManager::setItemTooltipsEnabledHelper(CEGUI::Listbox* listbox, bool enabled)
     
    535607    {
    536608        this->guiRenderer_->setDisplaySize(CEGUI::Size((float)newWidth, (float)newHeight));
     609#else
     610        this->guiRenderer_->setDisplaySize(CEGUI::Size((float)newWidth, (float)newHeight));
     611#endif
    537612    }
    538613
  • code/branches/kicklib2/src/libraries/core/GUIManager.h

    r8079 r8283  
    4242#include <string>
    4343#include <CEGUIForwardRefs.h>
    44 #include <boost/scoped_ptr.hpp>
     44#include <CEGUIVersion.h>
    4545#include <boost/shared_ptr.hpp>
     46#include <loki/ScopeGuard.h>
    4647
    4748#include "util/OgreForwardRefs.h"
     
    5758$cfile "../util/TriBool.h" // tolua_export
    5859*/
     60
     61#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
     62#  define ORXONOX_OLD_CEGUI
     63#endif
    5964
    6065namespace orxonox // tolua_export
     
    7883    public:
    7984        GUIManager(const std::pair<int, int>& mousePosition);
    80         ~GUIManager();
     85        //! Leave empty and use cleanup() instead
     86        ~GUIManager() {}
    8187
    8288        void setConfigValues(void);
     
    104110        const std::string& createInputState(const std::string& name, TriBool::Value showCursor = TriBool::True, TriBool::Value useKeyboard = TriBool::True, bool bBlockJoyStick = false); // tolua_export
    105111        LuaState* getLuaState(void)
    106             { return this->luaState_.get(); }
     112            { return this->luaState_; }
    107113
    108114        //! Returns the root window for all menu sheets
     
    127133    private:
    128134        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
    129139        void executeCode(const std::string& str);
    130140
     
    147157        virtual void windowFocusChanged(bool bFocus);
    148158
    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
    153173        shared_ptr<ResourceInfo>             rootFileInfo_;     //!< Resource information about the root script
    154         CEGUI::ResourceProvider*             resourceProvider_; //!< CEGUI's resource provider
    155174        CEGUI::Logger*                       ceguiLogger_;      //!< CEGUI's logger to be able to log CEGUI errors in our log
    156175        CEGUI::Window*                       rootWindow_;       //!< Root node for all windows
  • code/branches/kicklib2/src/libraries/core/GraphicsManager.cc

    r8079 r8283  
    3535#include <boost/shared_array.hpp>
    3636
    37 #include <OgreArchiveFactory.h>
    38 #include <OgreArchiveManager.h>
    3937#include <OgreFrameListener.h>
    4038#include <OgreRoot.h>
     
    6058#include "GUIManager.h"
    6159#include "Loader.h"
    62 #include "MemoryArchive.h"
    6360#include "PathConfig.h"
    6461#include "ViewportEventListener.h"
     
    10299    GraphicsManager::GraphicsManager(bool bLoadRenderer)
    103100        : ogreWindowEventListener_(new OgreWindowEventListener())
    104 #if OGRE_VERSION < 0x010600
    105         , memoryArchiveFactory_(new MemoryArchiveFactory())
    106 #endif
    107101        , renderWindow_(0)
    108102        , viewport_(0)
     
    195189
    196190        this->loadRenderer();
    197 
    198 #if OGRE_VERSION < 0x010600
    199         // WORKAROUND: There is an incompatibility for particle scripts when trying
    200         // to support both Ogre 1.4 and 1.6. The hacky solution is to create
    201         // 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 why
    203         // 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 groups
    208         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 file
    214                 Ogre::DataStreamPtr input = ResourceGroupManager::getSingleton().openResource(itFile->filename, *itGroup, false);
    215                 std::stringstream output;
    216                 // Parse file and replace "particle_system" with nothing
    217                 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 archive
    229                 shared_array<char> data(new char[output.str().size()]);
    230                 // Debug optimisations
    231                 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 group
    240                 ResourceGroupManager::getSingleton().addResourceLocation("particle_scripts_ogre_1.4_" + *itGroup,
    241                     "Memory", "particle_scripts_ogre_1.4_" + *itGroup);
    242             }
    243         }
    244 #endif
    245191
    246192        // Initialise all resources (do this AFTER the renderer has been loaded!)
  • code/branches/kicklib2/src/libraries/core/GraphicsManager.h

    r8079 r8283  
    114114
    115115        scoped_ptr<OgreWindowEventListener> ogreWindowEventListener_; //!< Pimpl to hide OgreWindowUtilities.h
    116 #if OGRE_VERSION < 0x010600
    117         scoped_ptr<MemoryArchiveFactory>    memoryArchiveFactory_;    //!< Stores the modified particle scripts
    118 #endif
    119116        scoped_ptr<Ogre::LogManager>        ogreLogger_;
    120117        scoped_ptr<Ogre::Root>              ogreRoot_;                //!< Ogre's root
  • code/branches/kicklib2/src/libraries/core/LuaState.cc

    r7284 r8283  
    3030#include "LuaState.h"
    3131
    32 #include <tolua/tolua++.h>
     32#include <tolua++.h>
    3333extern "C" {
    3434#include <lua.h>
     
    6060        luaState_ = lua_open();
    6161        Loki::ScopeGuard luaStateGuard = Loki::MakeGuard(&lua_close, luaState_);
    62 #if LUA_VERSION_NUM == 501
    6362        luaL_openlibs(luaState_);
    64 #else
    65         luaopen_base(luaState_);
    66         luaopen_string(luaState_);
    67         luaopen_table(luaState_);
    68         luaopen_math(luaState_);
    69         luaopen_io(luaState_);
    70         luaopen_debug(luaState_);
    71 #endif
    7263
    7364        // Open all available tolua interfaces
     
    187178        }
    188179
    189 #if LUA_VERSION_NUM != 501
    190         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 #else
    195180        int error = luaL_loadbuffer(luaState_, code.c_str(), code.size(), chunkname.c_str());
    196 #endif
    197181
    198182        switch (error)
     
    293277    }
    294278
    295 #if LUA_VERSION_NUM != 501
    296     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 #endif
    306 
    307279    /*static*/ bool LuaState::addToluaInterface(int (*function)(lua_State*), const std::string& name)
    308280    {
  • code/branches/kicklib2/src/libraries/core/LuaState.h

    r7401 r8283  
    113113        shared_ptr<ResourceInfo> getFileInfo(const std::string& filename);
    114114
    115 #if LUA_VERSION_NUM != 501
    116         struct LoadS
    117         {
    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 #endif
    124 
    125115        std::stringstream output_;
    126116        lua_State* luaState_;
  • code/branches/kicklib2/src/libraries/core/input/KeyBinder.cc

    r8079 r8283  
    396396
    397397            // 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)
    399399            {
    400400                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  
    6969                this->entity_ = this->scenemanager_->createEntity("Mesh" + multi_cast<std::string>(Mesh::meshCounter_s++), meshsource);
    7070                this->entity_->setCastShadows(this->bCastShadows_);
    71 
    72 #if OGRE_VERSION < 0x010600
    73                 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 #endif
    8271            }
    8372            catch (...)
  • code/branches/kicklib2/src/libraries/util/Exception.cc

    r7401 r8283  
    9595            throw;
    9696        }
     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        }
    97102        catch (const std::exception& ex)
    98103        {
    99104            return ex.what();
    100         }
    101         catch (const CEGUI::Exception& ex)
    102         {
    103 #if CEGUI_VERSION_MAJOR == 0 && CEGUI_VERSION_MINOR < 6
    104             return GeneralException(ex.getMessage().c_str()).getDescription();
    105 #else
    106             return GeneralException(ex.getMessage().c_str(), ex.getLine(),
    107                 ex.getFileName().c_str(), ex.getName().c_str()).getDescription();
    108 #endif
    109105        }
    110106        catch (...)
  • code/branches/kicklib2/src/orxonox/CMakeLists.txt

    r7648 r8283  
    7878    ${VORBIS_LIBRARY}
    7979    ${OGG_LIBRARY}
     80    ${CEGUI_TOLUA_LIBRARY}
    8081    tinyxml_orxonox
    81     tolua_orxonox
    8282    bullet_orxonox
    8383    util
Note: See TracChangeset for help on using the changeset viewer.