Changeset 7421 for sandbox_qt
- Timestamp:
- Sep 12, 2010, 12:47:30 AM (14 years ago)
- Location:
- sandbox_qt
- Files:
-
- 2 deleted
- 37 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
sandbox_qt/CMakeLists.txt
r7383 r7421 52 52 SET(DEFAULT_LIBRARY_PATH lib) 53 53 SET(DEFAULT_ARCHIVE_PATH lib/static) 54 SET(DEFAULT_MODULE_PATH lib/modules)55 54 SET(DEFAULT_DOC_PATH doc) 56 55 SET(DEFAULT_DATA_PATH data) … … 62 61 SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_LIBRARY_PATH}) 63 62 SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_ARCHIVE_PATH}) 64 SET(CMAKE_MODULE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_MODULE_PATH})65 63 SET(CMAKE_DOC_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_DOC_PATH}) 66 64 # Data directories are only inputs, no delclaration here 67 65 SET(CMAKE_CONFIG_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_CONFIG_PATH}) 68 66 SET(CMAKE_LOG_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_LOG_PATH}) 69 70 # Set the extension of the dynamic modules71 SET(ORXONOX_MODULE_EXTENSION ".module")72 67 73 68 # Sets where to find the external libraries like OgreMain.dll at runtime -
sandbox_qt/INSTALL
r7248 r7421 6 6 ************** Libraries **************** 7 7 8 In order to compile Orxonox you will need the following libraries: 9 (for windows there are already precompiled packages on the website) 10 11 OGRE 3D Graphics Engine 1.4 - 1.7 12 CEGUI (Crazy Eddie's GUI System) 0.5 - 0.6 13 Boost libraries 1.35 - 14 ENet (Network library) 1.1 - 1.2 15 Lua (scripting language) 5.0 - 5.1 16 Tcl (shell script language) 8.4 - 8.5 17 OpenAL (audio) (no version requirements specified yet) 18 ALUT (audio) (no version requirements specified yet) 19 LibOgg (no version requirements specified yet) 20 LibVorbis (no version requirements specified yet) 21 ZLib (compression) (no version requirements specified yet) 22 23 OGRE supports both OpenGL and DirectX9 rendering. You will also need OGRE for the dedicated server! 24 25 Further information about installing and running this application can be found on 26 http://www.orxonox.net/wiki/Running 8 In order to compile this Orxonox sandbox you will need to install Qt 4.6 -
sandbox_qt/README
r7163 r7421 1 Hi there, 1 This is a fork of the Orxonox trunk used to quickly set up some arbitrary test program. 2 2 3 We are proud to present you Orxonox - the most ferious 3D space shooter ever to exist. 4 5 This game is free, if you have paid for this, get your money back! The source code of this game is licensed under the GPL (GNU General Public License). 6 The game content is licensed under the Creative Commons Attribution-Sharealike 3.0 license. For more information read LICENSE in the same folder you found this file. 7 8 For directions to install this game, please check out the file INSTALL or http://www.orxonox.net/wiki/Running 9 10 This application uses the Ogre Graphics Engine (http://www.ogre3d.org), if you haven't already downloaded a precompiled version of Ogre with this package. Visit our webpage to get your Orxonox compatible version of the Ogre libraries. 11 12 This is an open source game. If you want to contribute check out http://www.orxonox.net/wiki/development to find more information how you could help us making the game better. We are always looking for programmers and content designers, who like to contribute. 13 14 We hope you have fun playing the game. Check out http://www.orxonox.net for news and newer versions of the game. 15 16 Please contact us in our forum ( http://forum.orxonox.net ) or check out our contact page ( http://www.orxonox.net/wiki/about#Contact ). We hope to hear from you and are looking forward to your feedback. 17 18 19 Cheers, 20 The Orxonox Development Team 3 To make life easier you work with the Qt framework and even do some UI stuff. -
sandbox_qt/bin/CMakeLists.txt
r5929 r7421 26 26 27 27 # Create run scripts for Windows to manually add the DLL path when executing 28 SET(RUN_SCRIPTS run standalone client1 client2 server dedicated dedicatedClient)28 SET(RUN_SCRIPTS run) 29 29 IF(WIN32) 30 30 FOREACH(_script ${RUN_SCRIPTS}) -
sandbox_qt/bin/vld.ini.in
r5929 r7421 56 56 ; Default: None. 57 57 ; 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.dll58 ForceIncludeModules = 59 59 60 60 ; Maximum number of data bytes to display for each leaked block. If zero, then -
sandbox_qt/cmake/CompilerConfigGCC.cmake
r7416 r7421 37 37 ) 38 38 39 # Complain about incompatibilities40 COMPARE_VERSION_STRINGS("${GCC_VERSION}" "4.4.0" _compare_result)41 IF(NOT _compare_result LESS 0)42 IF(${Boost_VERSION} LESS 103700)43 MESSAGE(STATUS "Warning: Boost versions earlier than 1.37 may not compile with GCC 4.4 or later!")44 ENDIF()45 ENDIF()46 47 39 # GCC may not support #pragma GCC system_header correctly when using 48 40 # templates. According to Bugzilla, it was fixed March 07 but tests … … 81 73 # For GCC older than version 4, do not display sign compare warnings 82 74 # because of boost::filesystem (which creates about a hundred per include) 83 ADD_COMPILER_FLAGS("-Wno-sign-compare" GCC_NO_SYSTEM_HEADER_SUPPORT CACHE)75 #ADD_COMPILER_FLAGS("-Wno-sign-compare" GCC_NO_SYSTEM_HEADER_SUPPORT CACHE) 84 76 85 77 # For newer GCC (4.3 and above), don't display hundreds of annoying deprecated -
sandbox_qt/cmake/InstallConfig.cmake
r7163 r7421 43 43 SET(LIBRARY_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_LIBRARY_PATH}) 44 44 SET(ARCHIVE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_ARCHIVE_PATH}) 45 SET(MODULE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_MODULE_PATH})46 45 SET(DOC_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_DOC_PATH}) 47 46 SET(DATA_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_DATA_PATH}) … … 55 54 SET(LIBRARY_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/games/orxonox) 56 55 SET(ARCHIVE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/games/orxonox/static) 57 SET(MODULE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/games/orxonox/modules)58 56 SET(DOC_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/share/doc/orxonox) 59 57 SET(DATA_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/share/games/orxonox) -
sandbox_qt/cmake/LibraryConfig.cmake
r7243 r7421 40 40 # On Windows using a package causes way less problems 41 41 SET(_option_msg "Set this to true to use precompiled dependecy archives") 42 IF(WIN32) 43 OPTION(DEPENDENCY_PACKAGE_ENABLE "${_option_msg}" ON) 44 ELSE(WIN32) 45 OPTION(DEPENDENCY_PACKAGE_ENABLE "${_option_msg}" FALSE) 46 ENDIF(WIN32) 42 OPTION(DEPENDENCY_PACKAGE_ENABLE "${_option_msg}" FALSE) 47 43 48 44 # Scripts for specific library and CMake config 49 45 INCLUDE(LibraryConfigTardis) 50 INCLUDE(LibraryConfigApple)51 46 52 47 IF(DEPENDENCY_PACKAGE_ENABLE) … … 93 88 # Performs the search and sets the variables # 94 89 95 FIND_PACKAGE(OGRE 1.4 REQUIRED) 96 FIND_PACKAGE(ENet 1.1 REQUIRED) 97 FIND_PACKAGE(Ogg REQUIRED) 98 FIND_PACKAGE(Vorbis REQUIRED) 99 FIND_PACKAGE(ALUT REQUIRED) 100 FIND_PACKAGE(ZLIB REQUIRED) 101 IF(POCO_REQUIRED) 102 FIND_PACKAGE(POCO REQUIRED) 103 ENDIF() 104 IF(WIN32) 105 FIND_PACKAGE(DirectX REQUIRED) 106 ENDIF() 107 108 ##### CEGUI ##### 109 # We make use of the CEGUI script module called CEGUILua. 110 # However there is a small issue with that: We use Tolua, a C++ binding 111 # generator ourselves. And we also have to use our bindings in the same 112 # lua state is CEGUILua's. Unfortunately this implies that both lua runtime 113 # version are equal or else you get segmentation faults. 114 # In order to match the Lua versions we decided to ship CEGUILua in our 115 # repository, mainly because there is no way to determine which version of 116 # Lua CEGUILua was linked against (you'd have to specify yourself) and secondly 117 # because we can then choose the Lua version. Future plans might involve only 118 # accepting Lua 5.1. 119 120 # Insert all internally supported CEGUILua versions here 121 SET(CEGUILUA_INTERNAL_SUPPORT 0.5.0 0.6.0 0.6.1 0.6.2) 122 OPTION(CEGUILUA_USE_EXTERNAL_LIBRARY "Force the use of external CEGUILua library" OFF) 123 FIND_PACKAGE(CEGUI 0.5 REQUIRED) 124 125 ##### Lua ##### 126 IF(CEGUILUA_USE_EXTERNAL_LIBRARY) 127 COMPARE_VERSION_STRINGS(${CEGUI_VERSION} "0.6" _version_comparison) 128 IF(version_comparison LESS 0) 129 SET(LUA_VERSION_REQUEST 5.0) 130 ELSE() 131 SET(LUA_VERSION_REQUEST 5.1) 132 ENDIF() 133 ELSE() 134 SET(LUA_VERSION_REQUEST 5) 135 ENDIF() 136 FIND_PACKAGE(Lua ${LUA_VERSION_REQUEST} EXACT REQUIRED) 137 138 ##### OpenAL ##### 139 FIND_PACKAGE(OpenAL REQUIRED) 140 # Also use parent include dir (without AL/) for ALUT 141 IF(OPENAL_INCLUDE_DIR MATCHES "/AL$") 142 GET_FILENAME_COMPONENT(ALT_OPENAL_INCLUDE_DIR ${OPENAL_INCLUDE_DIR} PATH) 143 ENDIF() 144 SET(OPENAL_INCLUDE_DIRS ${OPENAL_INCLUDE_DIR} ${ALT_OPENAL_INCLUDE_DIR}) 145 # Notfiy user 146 FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenAL DEFAULT_MSG OPENAL_LIBRARY OPENAL_INCLUDE_DIR) 147 # Hide variables created by the script 148 MARK_AS_ADVANCED(OPENAL_INCLUDE_DIR OPENAL_LIBRARY) 149 150 ##### Tcl ##### 151 # We only require Tcl, so avoid confusing user about other Tcl stuff by 152 # applying a little workaround 153 SET(Tclsh_FIND_QUIETLY TRUE) 154 FIND_PACKAGE(TCL QUIET) 155 # Display messages separately 156 SET(TCL_FIND_QUIETLY FALSE) 157 FIND_PACKAGE_HANDLE_STANDARD_ARGS(TCL DEFAULT_MSG TCL_LIBRARY TCL_INCLUDE_PATH) 158 159 ##### Boost ##### 160 # Expand the next statement if newer boost versions than 1.36.1 are released 161 SET(Boost_ADDITIONAL_VERSIONS 1.37 1.37.0 1.38 1.38.0 1.39 1.39.0 1.40 1.40.0 162 1.41 1.41.0 1.42 1.42.0 1.43 1.43.0 1.44 1.44.0) 163 IF( NOT TARDIS ) 164 FIND_PACKAGE(Boost 1.35 REQUIRED thread filesystem system date_time) 165 ENDIF() 166 # No auto linking, so this option is useless anyway 167 MARK_AS_ADVANCED(Boost_LIB_DIAGNOSTIC_DEFINITIONS) 90 FIND_PACKAGE(QT4 COMPONENTS QtCore QtGui REQUIRED) 168 91 169 92 … … 174 97 # Note: Default option in the libraries vary, but our default option is dynamic 175 98 IF(WIN32) 176 OPTION(LINK_BOOST_DYNAMIC "Link Boost dynamically on Windows" TRUE) 177 OPTION(LINK_CEGUI_DYNAMIC "Link CEGUI dynamicylly on Windows" TRUE) 178 OPTION(LINK_ENET_DYNAMIC "Link ENet dynamically on Windows" TRUE) 179 OPTION(LINK_OGRE_DYNAMIC "Link OGRE dynamically on Windows" TRUE) 180 OPTION(LINK_TCL_DYNAMIC "Link TCL dynamically on Windows" TRUE) 181 OPTION(LINK_ZLIB_DYNAMIC "Link ZLib dynamically on Windows" TRUE) 182 COMPARE_VERSION_STRINGS("${LUA_VERSION}" "5.1" _version_comparison) 183 IF(_version_comparison LESS 0) 184 OPTION(LINK_LUA_DYNAMIC "Link Lua dynamically on Windows" FALSE) 185 ELSE(_version_comparison LESS 0) 186 OPTION(LINK_LUA_DYNAMIC "Link Lua dynamically on Windows" TRUE) 187 ENDIF(_version_comparison LESS 0) 99 #OPTION(LINK_ZLIB_DYNAMIC "Link ZLib dynamically on Windows" TRUE) 188 100 189 101 IF(DEPENDENCY_PACKAGE_ENABLE) 190 MARK_AS_ADVANCED( 191 LINK_BOOST_DYNAMIC LINK_CEGUI_DYNAMIC LINK_ENET_DYNAMIC 192 LINK_OGRE_DYNAMIC LINK_TCL_DYNAMIC LINK_ZLIB_DYNAMIC 193 LINK_LUA_DYNAMIC 194 ) 102 #MARK_AS_ADVANCED( 103 #LINK_ZLIB_DYNAMIC 104 #) 195 105 ENDIF() 196 106 ENDIF(WIN32) 197 198 199 ################# OGRE Plugins ##################200 201 # More plugins: Plugin_BSPSceneManager, Plugin_OctreeSceneManager202 SET(OGRE_PLUGINS_INT Plugin_ParticleFX)203 IF(WIN32)204 # CG program manager is probably DirectX related (not available under unix)205 LIST(APPEND OGRE_PLUGINS_INT Plugin_CgProgramManager)206 ENDIF(WIN32)207 SET(OGRE_PLUGINS ${OGRE_PLUGINS_INT} CACHE STRING208 "Specify which OGRE plugins to load. Existance check is performed.")209 210 # Check the plugins and determine the plugin folder211 # You can give a hint by setting the environment variable ENV{OGRE_PLUGIN_DIR}212 INCLUDE(CheckOGREPlugins)213 CHECK_OGRE_PLUGINS(${OGRE_PLUGINS})214 -
sandbox_qt/cmake/LibraryConfigTardis.cmake
r7418 r7421 21 21 # Adrian Friedli 22 22 # Description: 23 # Sets the correct find script paths on the ETH Tardis workstations. 24 # Also sets the TARDIS variable. 23 # Sets the TARDIS variable. 25 24 # 26 25 … … 33 32 ENDIF() 34 33 ENDIF() 35 36 IF(TARDIS)37 MESSAGE(STATUS "Running on D-ITET isg.ee Tardis Computer. Using customized paths.")38 39 # SET(CMAKE_C_COMPILER "gcc-4.1.1")40 # SET(CMAKE_CXX_COMPILER "g++-4.1.1")41 42 # Note: When setting ENV${} variables, make sure to use quotes when43 # having multiple directories.44 #SET(BOOST_INCLUDEDIR "/usr/pack/boost-1.42.0-bs/include")45 #SET(BOOST_LIBRARYDIR "/usr/pack/boost-1.42.0-bs/i686-debian-linux4.0/lib")46 SET(Boost_VERSION 104200)47 SET(Boost_INCLUDE_DIRS "/usr/pack/boost-1.42.0-bs/include" CACHE PATH "")48 SET(Boost_SYSTEM_LIBRARY_RELEASE "/usr/pack/boost-1.42.0-bs/i686-debian-linux5.0/lib/libboost_system.so" CACHE PATH "")49 SET(Boost_SYSTEM_LIBRARY_DEBUG "/usr/pack/boost-1.42.0-bs/i686-debian-linux5.0/lib/libboost_system-d.so" CACHE PATH "")50 SET(Boost_DATE_TIME_LIBRARY_RELEASE "/usr/pack/boost-1.42.0-bs/i686-debian-linux5.0/lib/libboost_date_time.so" CACHE PATH "")51 SET(Boost_DATE_TIME_LIBRARY_DEBUG "/usr/pack/boost-1.42.0-bs/i686-debian-linux5.0/lib/libboost_date_time-d.so" CACHE PATH "")52 SET(Boost_FILESYSTEM_LIBRARY_RELEASE "/usr/pack/boost-1.42.0-bs/i686-debian-linux5.0/lib/libboost_filesystem.so" CACHE PATH "")53 SET(Boost_FILESYSTEM_LIBRARY_DEBUG "/usr/pack/boost-1.42.0-bs/i686-debian-linux5.0/lib/libboost_filesystem-d.so" CACHE PATH "")54 SET(Boost_THREAD_LIBRARY_RELEASE "/usr/pack/boost-1.42.0-bs/i686-debian-linux5.0/lib/libboost_thread-mt.so" CACHE PATH "")55 SET(Boost_THREAD_LIBRARY_DEBUG "/usr/pack/boost-1.42.0-bs/i686-debian-linux5.0/lib/libboost_thread-mt-d.so" CACHE PATH "")56 57 SET(Boost_SYSTEM_LIBRARY "debug;${Boost_SYSTEM_LIBRARY_DEBUG};optimized;${Boost_SYSTEM_LIBRARY_RELEASE}" CACHE PATH "" FORCE)58 SET(Boost_DATE_TIME_LIBRARY "debug;${Boost_DATE_TIME_LIBRARY_DEBUG};optimized;${Boost_DATE_TIME_LIBRARY_RELEASE}" CACHE PATH "" FORCE)59 SET(Boost_FILESYSTEM_LIBRARY "debug;${Boost_FILESYSTEM_LIBRARY_DEBUG};optimized;${Boost_FILESYSTEM_LIBRARY_RELEASE}" CACHE PATH "" FORCE)60 SET(Boost_THREAD_LIBRARY "debug;${Boost_THREAD_LIBRARY_DEBUG};optimized;${Boost_THREAD_LIBRARY_RELEASE}" CACHE PATH "" FORCE)61 62 MARK_AS_ADVANCED( Boost_INCLUDE_DIRS )63 MARK_AS_ADVANCED( Boost_SYSTEM_LIBRARY Boost_SYSTEM_LIBRARY_RELEASE Boost_SYSTEM_LIBRARY_DEBUG )64 MARK_AS_ADVANCED( Boost_DATE_TIME_LIBRARY Boost_DATE_TIME_LIBRARY_RELEASE Boost_DATE_TIME_LIBRARY_DEBUG )65 MARK_AS_ADVANCED( Boost_FILESYSTEM_LIBRARY Boost_FILESYSTEM_LIBRARY_RELEASE Boost_FILESYSTEM_LIBRARY_DEBUG )66 MARK_AS_ADVANCED( Boost_THREAD_LIBRARY Boost_THREAD_LIBRARY_RELEASE Boost_THREAD_LIBRARY_DEBUG )67 68 69 LIST(APPEND CMAKE_INCLUDE_PATH "/usr/pack/cegui-0.6.2-sd")70 LIST(APPEND CMAKE_LIBRARY_PATH "/usr/pack/cegui-0.6.2-sd/i686-debian-linux5.0")71 LIST(APPEND CMAKE_INCLUDE_PATH "/usr/pack/ogre-1.6.1-sd")72 LIST(APPEND CMAKE_LIBRARY_PATH "/usr/pack/ogre-1.6.1-sd/i686-debian-linux5.0")73 74 #SET(ENV{CEGUIDIR} "/usr/pack/cegui-0.6.2-sd;/usr/pack/cegui-0.6.2-sd/i686-debian-linux5.0")75 #SET(ENV{ENETDIR} "/usr/pack/enet-1.2-sd;/usr/pack/enet-1.2-sd/i686-debian-linux4.0")76 #SET(ENV{ALUTDIR} "/usr/pack/openal-0.0.8-cl;/usr/pack/openal-0.0.8-cl/i686-debian-linux3.1")77 #SET(ENV{OGGDIR} "/usr/pack/oggvorbis-1.0-ds;/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0")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")80 #SET(ENV{OGRE_HOME} "/usr/pack/ogre-1.4.9-sd;/usr/pack/ogre-1.4.9-sd/i686-debian-linux4.0")81 #SET(ENV{OPENALDIR} "/usr/pack/openal-0.0.8-cl;/usr/pack/openal-0.0.8-cl/i686-debian-linux3.1")82 #SET(TCL_INCLUDE_PATH "/usr/pack/tcltk-8.4.9.linux-mo/include")83 ENDIF(TARDIS) -
sandbox_qt/cmake/PackageConfig.cmake
r7418 r7421 25 25 # 26 26 27 # Check package version info28 # MAJOR: Breaking change29 # MINOR: No breaking changes by the dependency package30 # For example any code running on 3.0 should still run on 3.131 # But you can specify that the code only runs on 3.1 and higher32 # 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)34 35 IF(NOT EXISTS ${DEPENDENCY_PACKAGE_DIR}/version.txt)36 SET(DEPENDENCY_VERSION 1.0)37 ELSE()38 # Get version from file39 FILE(READ ${DEPENDENCY_PACKAGE_DIR}/version.txt _file_content)40 SET(_match)41 STRING(REGEX MATCH "([0-9]+.[0-9]+)" _match ${_file_content})42 IF(_match)43 SET(DEPENDENCY_VERSION ${_match})44 ELSE()45 MESSAGE(FATAL_ERROR "The version.txt file in the dependency file has corrupt version information.")46 ENDIF()47 ENDIF()48 49 INCLUDE(CompareVersionStrings)50 SET(_version_match FALSE)51 FOREACH(_version ${ALLOWED_MINIMUM_VERSIONS})52 # Get major version53 STRING(REGEX REPLACE "^([0-9]+)\\..*$" "\\1" _major_version "${_version}")54 COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} ${_major_version} _result TRUE)55 IF(_result EQUAL 0)56 COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} ${_version} _result FALSE)57 IF(NOT _result LESS 0)58 SET(_version_match TRUE)59 ENDIF()60 ENDIF()61 ENDFOREACH(_version)62 IF(NOT _version_match)63 MESSAGE(FATAL_ERROR "Your dependency package version is ${DEPENDENCY_VERSION}\n"64 "Possible required versions: ${ALLOWED_MINIMUM_VERSIONS}\n"65 "You can get a new version from www.orxonox.net")66 ENDIF()67 68 27 IF(NOT _INTERNAL_PACKAGE_MESSAGE) 69 28 MESSAGE(STATUS "Using library package for the dependencies.") … … 71 30 ENDIF() 72 31 73 # Ogre versions >= 1.7 require the POCO library on Windows with MSVC for threading74 COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} 5 _result TRUE)75 IF(NOT _result EQUAL -1 AND NOT MINGW)76 SET(POCO_REQUIRED TRUE)77 ENDIF()78 79 32 # Include paths and other special treatments 80 SET(ENV{ALUTDIR} ${DEP_INCLUDE_DIR}/freealut) 81 SET(ENV{BOOST_ROOT} ${DEP_INCLUDE_DIR}/boost) 82 SET(ENV{CEGUIDIR} ${DEP_INCLUDE_DIR}/cegui) 83 SET(ENV{DXSDK_DIR} ${DEP_INCLUDE_DIR}/directx) 84 SET(ENV{ENETDIR} ${DEP_INCLUDE_DIR}/enet) 85 SET(ENV{LUA_DIR} ${DEP_INCLUDE_DIR}/lua) 86 SET(ENV{OGGDIR} ${DEP_INCLUDE_DIR}/libogg) 87 SET(ENV{VORBISDIR} ${DEP_INCLUDE_DIR}/libvorbis) 88 SET(ENV{OGRE_HOME} ${DEP_INCLUDE_DIR}/ogre) 89 SET(ENV{OGRE_PLUGIN_DIR} ${DEP_BINARY_DIR}) 90 SET(ENV{OPENALDIR} ${DEP_INCLUDE_DIR}/openal) 91 SET(ENV{POCODIR} ${DEP_INCLUDE_DIR}/poco) 92 LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/tcl/include) 93 LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/zlib/include) 33 #SET(ENV{ALUTDIR} ${DEP_INCLUDE_DIR}/freealut) 34 #LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/tcl/include) 94 35 95 36 ### INSTALL ### 96 97 # Tcl script library98 INSTALL(99 DIRECTORY ${DEP_LIBRARY_DIR}/tcl/100 DESTINATION lib/tcl101 )102 37 103 38 # On Windows, DLLs have to be in the executable folder, install them -
sandbox_qt/cmake/PackageConfigMSVC.cmake
r7418 r7421 54 54 # Certain find scripts don't behave as ecpected to we have 55 55 # to specify the libraries ourselves. 56 SET(TCL_LIBRARY ${DEP_LIBRARY_DIR}/tcl85.lib CACHE FILEPATH "") 57 SET(ZLIB_LIBRARY ${DEP_LIBRARY_DIR}/zdll.lib CACHE FILEPATH "") 56 #SET(TCL_LIBRARY ${DEP_LIBRARY_DIR}/tcl85.lib CACHE FILEPATH "") 58 57 59 58 # Visual Leak Detector -
sandbox_qt/cmake/PackageConfigMinGW.cmake
r7418 r7421 47 47 # Certain find scripts don't behave as ecpected to we have 48 48 # to specify the libraries ourselves. 49 SET(TCL_LIBRARY ${DEP_BINARY_DIR}/tcl85.dll CACHE FILEPATH "") 50 SET(ZLIB_LIBRARY ${DEP_BINARY_DIR}/zlib1.dll CACHE FILEPATH "") 49 #SET(TCL_LIBRARY ${DEP_BINARY_DIR}/tcl85.dll CACHE FILEPATH "") 51 50 52 51 ENDIF(MINGW) -
sandbox_qt/cmake/tools/TargetUtilities.cmake
r7416 r7421 34 34 # NO_DLL_INTERFACE: Link statically with MSVC 35 35 # NO_SOURCE_GROUPS: Don't create msvc source groups 36 # MODULE: For dynamic module libraries (libraries only)37 36 # WIN32: Inherited from ADD_EXECUTABLE (executables only) 38 37 # PCH_NO_DEFAULT: Do not make precompiled header files default if … … 46 45 # SOURCE_FILES: Source files for the target 47 46 # DEFINE_SYMBOL: Sets the DEFINE_SYMBOL target property 48 # TOLUA_FILES: Files with tolua interface49 47 # PCH_FILE: Precompiled header file 50 48 # PCH_EXCLUDE: Source files to be excluded from PCH support 51 49 # OUTPUT_NAME: If you want a different name than the target name 50 # QT_MOC_FILES: List of files to be processed by Qt MOC 51 # QT_UIC_FILES: List of files to be processed by Qt UIC 52 52 # Note: 53 53 # This function also installs the target! … … 60 60 INCLUDE(CMakeDependentOption) 61 61 INCLUDE(CapitaliseName) 62 INCLUDE(GenerateToluaBindings)63 62 INCLUDE(ParseMacroArguments) 64 63 INCLUDE(SourceFileUtilities) … … 68 67 69 68 MACRO(ORXONOX_ADD_LIBRARY _target_name) 70 TU_ADD_TARGET(${_target_name} LIBRARY " MODULE" ${ARGN})69 TU_ADD_TARGET(${_target_name} LIBRARY "" ${ARGN}) 71 70 ENDMACRO(ORXONOX_ADD_LIBRARY) 72 71 … … 85 84 NO_INSTALL NO_VERSION ${_additional_switches}) 86 85 SET(_list_names LINK_LIBRARIES VERSION SOURCE_FILES 87 DEFINE_SYMBOL TOLUA_FILES PCH_FILE88 PCH_EXCLUDE OUTPUT_NAME)86 DEFINE_SYMBOL PCH_FILE PCH_EXCLUDE 87 OUTPUT_NAME QT_MOC_FILES QT_UIC_FILES) 89 88 90 89 PARSE_MACRO_ARGUMENTS("${_switches}" "${_list_names}" ${ARGN}) … … 107 106 ENDIF() 108 107 109 # Combine source and header files108 # Combine source, header and QT designer files 110 109 SET(_${_target_name}_files 111 110 ${_${_target_name}_header_files} 112 111 ${_${_target_name}_source_files} 112 ${_arg_QT_UIC_FILES} 113 113 ) 114 114 # Remove potential duplicates 115 115 LIST(REMOVE_DUPLICATES _${_target_name}_files) 116 116 117 # TOLUA_FILES 118 IF(_arg_TOLUA_FILES) 119 GENERATE_TOLUA_BINDINGS(${_target_name_capitalised} _${_target_name}_files 120 INPUTFILES ${_arg_TOLUA_FILES}) 117 # QT MOC and UIC preprocessing 118 IF(_arg_QT_MOC_FILES) 119 QT4_WRAP_CPP(_${_target_name}_files ${_arg_QT_MOC_FILES}) 120 ENDIF() 121 IF(_arg_QT_UIC_FILES) 122 QT4_WRAP_UI(_${_target_name}_files ${_arg_QT_UIC_FILES}) 121 123 ENDIF() 122 124 … … 208 210 ENDIF() 209 211 210 # Configure modules211 IF (_arg_MODULE)212 SET_TARGET_PROPERTIES(${_target_name} PROPERTIES213 RUNTIME_OUTPUT_DIRECTORY ${CMAKE_MODULE_OUTPUT_DIRECTORY} # Windows214 LIBRARY_OUTPUT_DIRECTORY ${CMAKE_MODULE_OUTPUT_DIRECTORY} # Unix215 )216 ADD_MODULE(${_target_name})217 # Ensure that the main program depends on the module218 SET(ORXONOX_MODULES ${ORXONOX_MODULES} ${_target_name} CACHE STRING "" FORCE)219 ENDIF()220 221 212 # LINK_LIBRARIES 222 213 IF(_arg_LINK_LIBRARIES) … … 251 242 # Install all targets except for static ones (executables also have SHARED in _link_mode) 252 243 IF(${_link_mode} STREQUAL "SHARED" AND NOT _arg_NO_INSTALL) 253 IF(_arg_MODULE) 254 INSTALL(TARGETS ${_target_name} 255 RUNTIME DESTINATION ${MODULE_INSTALL_DIRECTORY} 256 LIBRARY DESTINATION ${MODULE_INSTALL_DIRECTORY} 257 ) 258 ELSE() 259 INSTALL(TARGETS ${_target_name} 260 RUNTIME DESTINATION ${RUNTIME_INSTALL_DIRECTORY} 261 LIBRARY DESTINATION ${LIBRARY_INSTALL_DIRECTORY} 262 ) 263 ENDIF() 244 INSTALL(TARGETS ${_target_name} 245 RUNTIME DESTINATION ${RUNTIME_INSTALL_DIRECTORY} 246 LIBRARY DESTINATION ${LIBRARY_INSTALL_DIRECTORY} 247 ) 264 248 ENDIF() 265 249 266 250 ENDMACRO(TU_ADD_TARGET) 267 268 269 # Creates a helper file with name <name_of_the_library>${ORXONOX_MODULE_EXTENSION}270 # This helps finding dynamically loadable modules at runtime271 272 FUNCTION(ADD_MODULE _target)273 # We use the properties to get the name because the librarys name may differ from274 # the target name (for example orxonox <-> liborxonox)275 276 GET_TARGET_PROPERTY(_target_loc ${_target} LOCATION)277 GET_FILENAME_COMPONENT(_target_name ${_target_loc} NAME_WE)278 279 IF(CMAKE_CONFIGURATION_TYPES)280 FOREACH(_config ${CMAKE_CONFIGURATION_TYPES})281 SET(_module_filename ${CMAKE_MODULE_OUTPUT_DIRECTORY}/${_config}/${_target_name}${ORXONOX_MODULE_EXTENSION})282 283 FILE(WRITE ${_module_filename})284 285 INSTALL(286 FILES ${_module_filename}287 DESTINATION ${MODULE_INSTALL_DIRECTORY}288 CONFIGURATIONS ${_config}289 )290 ENDFOREACH()291 ELSE()292 SET(_module_filename ${CMAKE_MODULE_OUTPUT_DIRECTORY}/${_target_name}${ORXONOX_MODULE_EXTENSION})293 294 FILE(WRITE ${_module_filename})295 296 INSTALL(297 FILES ${_module_filename}298 DESTINATION ${MODULE_INSTALL_DIRECTORY}299 )300 ENDIF()301 ENDFUNCTION(ADD_MODULE) -
sandbox_qt/data/CMakeLists.txt
r7163 r7421 30 30 SET(DATA_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE) 31 31 32 # Specify data directory33 GET_FILENAME_COMPONENT(_search_path_1 ${CMAKE_SOURCE_DIR}/../data_extern ABSOLUTE)34 FIND_PATH(EXTERNAL_DATA_DIRECTORY resources.oxr35 PATHS36 ${CMAKE_SOURCE_DIR}/data_extern37 ${_search_path_1}38 NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH39 )40 41 IF(NOT EXTERNAL_DATA_DIRECTORY)42 MESSAGE(STATUS "Warning: External data directory not found. If you want to compile while downloading the data files, you will have to recompile about four files afterwards and relink everything.")43 MESSAGE(STATUS "You can specify your own folder with the EXTERNAL_DATA_DIRECTORY variable. Default location for the path is orxonox_root/data_extern")44 # Temporary override to the default location.45 SET(EXTERNAL_DATA_DIRECTORY ${CMAKE_SOURCE_DIR}/data_extern)46 ENDIF()47 48 49 32 ################ Installation ################# 50 33 51 # Internal directory52 34 INSTALL( 53 35 DIRECTORY ${DATA_DIRECTORY}/ … … 55 37 REGEX "\\.svn$|_svn$|CMakeLists.txt|InstallScript.cmake" EXCLUDE 56 38 ) 57 # External directory58 INSTALL(59 DIRECTORY ${EXTERNAL_DATA_DIRECTORY}/60 DESTINATION ${DATA_INSTALL_DIRECTORY}61 REGEX "\\.svn$|_svn$|resources\\.oxr|AUTHORS|LICENSE" EXCLUDE62 )63 # Configure the install scripts (variables not available during installation)64 CONFIGURE_FILE(DataInstallScript.cmake ${CMAKE_CURRENT_BINARY_DIR}/DataInstallScript.cmake @ONLY)65 # Join both resources.oxr files66 INSTALL(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/DataInstallScript.cmake) -
sandbox_qt/doc/api/Groups.dox
r7401 r7421 44 44 45 45 /** 46 @defgroup Class Class management47 @ingroup Core48 */49 50 /**51 @defgroup Object Object management52 @ingroup Core53 */54 55 /**56 @defgroup Command Command57 @ingroup Core58 */59 60 /**61 46 @defgroup Config Config 62 47 @ingroup Core 63 48 */ 64 65 /**66 @defgroup Input Input67 @ingroup Core68 */69 70 /**71 @defgroup Management Management72 @ingroup Core73 */74 75 /**76 @defgroup XML XML77 @ingroup Core78 */79 80 /**81 @defgroup Network Network82 83 The network library is used to connect clients and server, to synchronize objects and variables, and84 to transmit network function calls. It contains the central @ref orxonox::Server "Server" and85 @ref orxonox::Client "Client" classes as well as several functions and macros for86 @ref orxonox::Synchronisable "synchronisable" classes.87 */88 89 /**90 @defgroup Tools Tools91 92 The tools are a bunch of utilities that belong to the Orxonox library, but are independent of other93 features.94 */95 96 /**97 @defgroup Orxonox Orxonox98 99 The Orxonox library contains the central and most important classes of the game. Managers, interfaces,100 base-classes, and more are located in Orxonox. More specialized classes that inherit of the base-classes101 in Orxonox are often sourced out to the modules.102 */103 104 /**105 @defgroup Modules Modules106 107 The modules are libraries that depend on the Orxonox library and that are loaded dynamically on runtime108 (in contrast to statically loaded libraries like util and core). Each module contains some classes that109 are usually connected to each other, but they are independent of other modules. However modules can still110 link to other modules, but only in a hierarchical order, no circular dependencies.111 */112 113 /**114 @defgroup Designtools Designtools115 @ingroup Modules116 */117 118 /**119 @defgroup Notifications Notifications120 @ingroup Modules121 */122 123 /**124 @defgroup Objects Objects125 @ingroup Modules126 */127 128 /**129 @defgroup Overlays Overlays130 @ingroup Modules131 */132 133 /**134 @defgroup Pickup Pickup135 @ingroup Modules136 */137 138 /**139 @defgroup Pong Pong140 @ingroup Modules141 */142 143 /**144 @defgroup Questsystem Questsystem145 @ingroup Modules146 */147 148 /**149 @defgroup Weapons Weapons150 @ingroup Modules151 */ -
sandbox_qt/doc/api/doxy.config.in
r7401 r7421 624 624 # subdirectory from a directory tree whose root is specified with the INPUT tag. 625 625 626 EXCLUDE = @CMAKE_SOURCE_DIR@/src/external/bullet/ \ 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 @CMAKE_SOURCE_DIR@/src/libraries/core/command/IOConsoleWindows.h \ 632 @CMAKE_SOURCE_DIR@/src/libraries/core/command/IOConsoleWindows.cc \ 633 @CMAKE_SOURCE_DIR@/src/libraries/tools/bsp \ 626 EXCLUDE = 634 627 635 628 # The EXCLUDE_SYMLINKS tag can be used select whether or not files or -
sandbox_qt/doc/api/main.dox
r7401 r7421 2 2 @mainpage 3 3 4 @image html orxonox.jpg 5 6 This is the documentation of Orxonox. It contains descriptions of our classes and functions and 7 explains their usage with several examples and background information. Because Orxonox is so big, 8 we can't document all of our code - sorry for that! But we do your best to document the most 9 important parts of it, namely the @ref Core "core" and @ref Util "util" libraries, as well as the 10 central classes in the @ref Orxonox "orxonox" main library and some @ref Modules "modules". 11 12 To understand the connection between different classes in Orxonox, have a look at the 13 <a href="modules.html"><b>Modules section</b></a>. It contains a list of the most important topics 14 and groups files that contribute to the same feature. 4 This is the documentation of some test project. It has not yet been written though... 15 5 */ -
sandbox_qt/src/CMakeLists.txt
r7401 r7421 33 33 ####### Library Behaviour (dependencies) ######## 34 34 35 # Disable Boost auto linking completely36 ADD_COMPILER_FLAGS("-DBOOST_ALL_NO_LIB")37 38 35 # If no defines are specified, these libs get linked statically 39 ADD_COMPILER_FLAGS("-DBOOST_ALL_DYN_LINK" WIN32 LINK_BOOST_DYNAMIC) 40 ADD_COMPILER_FLAGS("-DENET_DLL" WIN32 LINK_ENET_DYNAMIC) 41 ADD_COMPILER_FLAGS("-DLUA_BUILD_AS_DLL" WIN32 LINK_LUA_DYNAMIC) 42 ADD_COMPILER_FLAGS("-DZLIB_DLL" WIN32 LINK_ZLIB_DYNAMIC) 36 #ADD_COMPILER_FLAGS("-DZLIB_DLL" WIN32 LINK_ZLIB_DYNAMIC) 43 37 # If no defines are specified, these libs get linked dynamically 44 ADD_COMPILER_FLAGS("-DCEGUI_STATIC" WIN32 NOT LINK_CEGUI_DYNAMIC) 45 ADD_COMPILER_FLAGS("-DOGRE_STATIC_LIB" WIN32 NOT LINK_OGRE_DYNAMIC) 46 ADD_COMPILER_FLAGS("-DSTATIC_BUILD" WIN32 NOT LINK_TCL_DYNAMIC) 38 #ADD_COMPILER_FLAGS("-DSTATIC_BUILD" WIN32 NOT LINK_TCL_DYNAMIC) 47 39 48 40 ######### Library Behaviour (external) ########## 49 50 # Use TinyXML++51 ADD_COMPILER_FLAGS("-DTIXML_USE_TICPP")52 41 53 42 # Default linking for externals is SHARED … … 60 49 ENDIF() 61 50 # If no defines are specified, these libs get linked dynamically 62 ADD_COMPILER_FLAGS("-DCEGUILUA_STATIC" WIN32 NOT _external_shared_link) 63 ADD_COMPILER_FLAGS("-DOGRE_GUIRENDERER_STATIC_LIB" WIN32 NOT _external_shared_link) 64 ADD_COMPILER_FLAGS("-DOIS_STATIC_LIB" WIN32 NOT _external_shared_link) 65 ADD_COMPILER_FLAGS("-DTOLUA_STATIC_BUILD" WIN32 NOT _external_shared_link) 51 #ADD_COMPILER_FLAGS("-DTOLUA_STATIC_BUILD" WIN32 NOT _external_shared_link) 66 52 67 53 ############## Include Directories ############## … … 70 56 INCLUDE_DIRECTORIES( 71 57 # External 72 ${OGRE_INCLUDE_DIR}73 ${CEGUI_INCLUDE_DIR}74 ${ENET_INCLUDE_DIR}75 ${Boost_INCLUDE_DIRS}76 ${POCO_INCLUDE_DIR}77 ${OPENAL_INCLUDE_DIRS}78 ${ALUT_INCLUDE_DIR}79 ${VORBIS_INCLUDE_DIR}80 ${OGG_INCLUDE_DIR}81 ${LUA_INCLUDE_DIR}82 ${TCL_INCLUDE_PATH}83 ${DIRECTX_INCLUDE_DIR}84 ${ZLIB_INCLUDE_DIR}85 58 ${VLD_INCLUDE_DIR} 86 59 … … 89 62 ${CMAKE_CURRENT_SOURCE_DIR}/external 90 63 # Include directories needed even if only included by Orxonox 91 ${CMAKE_CURRENT_SOURCE_DIR}/external/bullet 92 ${CMAKE_CURRENT_SOURCE_DIR}/external/ois 64 #${CMAKE_CURRENT_SOURCE_DIR}/external/bullet 93 65 94 66 # OrxonoxConfig.h … … 96 68 ) 97 69 98 IF(CEGUILUA_USE_INTERNAL_LIBRARY) 99 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/external/ceguilua/ceguilua-${CEGUI_VERSION}) 100 ENDIF() 70 ###################### Qt4 ###################### 101 71 102 ################### Tolua Bind ################## 103 104 # Create directory because the tolua application doesn't work otherwise 105 IF(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/toluabind/${CMAKE_CFG_INTDIR}) 106 FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/toluabind/${CMAKE_CFG_INTDIR}) 107 ENDIF() 108 109 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/toluabind/${CMAKE_CFG_INTDIR}) 72 INCLUDE(${QT_USE_FILE}) 110 73 111 74 ################ Sub Directories ################ … … 114 77 ADD_SUBDIRECTORY(libraries) 115 78 ADD_SUBDIRECTORY(orxonox) 116 ADD_SUBDIRECTORY(modules)117 79 118 80 ################## Executable ################### … … 137 99 OUTPUT_NAME orxonox 138 100 ) 139 # Main executable should depend on all modules140 ADD_DEPENDENCIES(orxonox-main ${ORXONOX_MODULES})141 101 142 102 # Get name to configure the run scripts … … 170 130 # core/XMLPort.h instead of src/core/XMLPort.h 171 131 172 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/modules)173 132 GET_DIRECTORY_PROPERTY(_temp INCLUDE_DIRECTORIES) 174 133 # Replace ';' by spaces -
sandbox_qt/src/OrxonoxConfig.h.in
r7401 r7421 194 194 } 195 195 196 // Import general purpose smart pointers197 namespace boost198 {199 template<class T> class scoped_ptr;200 template<class T> class shared_ptr;201 template<class T> class weak_ptr;202 template<class T> class intrusive_ptr;203 template<class T> class shared_array;204 template<class T> class scoped_array;205 }206 namespace orxonox207 {208 using boost::scoped_ptr;209 using boost::shared_ptr;210 using boost::weak_ptr;211 using boost::intrusive_ptr;212 using boost::shared_array;213 using boost::scoped_array;214 }215 196 216 197 #endif /* _OrxonoxConfig_H__ */ -
sandbox_qt/src/SpecialConfig.h.in
r7401 r7421 42 42 #include "OrxonoxConfig.h" 43 43 44 #cmakedefine CEGUILUA_USE_INTERNAL_LIBRARY ///< Set whether we must suffix "ceguilua/" for the CEGUILua.h include45 46 44 #cmakedefine DEPENDENCY_PACKAGE_ENABLE ///< Defined if a precompiled depdency package was used. We then copy all libraries too when installing. 47 45 … … 57 55 const char defaultLibraryPath[] = "@DEFAULT_LIBRARY_PATH@"; 58 56 const char defaultArchivePath[] = "@DEFAULT_ARCHIVE_PATH@"; 59 const char defaultModulePath[] = "@DEFAULT_MODULE_PATH@";60 57 const char defaultDocPath[] = "@DEFAULT_DOC_PATH@"; 61 58 const char defaultDataPath[] = "@DEFAULT_DATA_PATH@"; … … 66 63 // INSTALLATION PATHS 67 64 const char dataInstallDirectory[] = "@DATA_INSTALL_DIRECTORY@"; 68 const char moduleInstallDirectory[] = "@MODULE_INSTALL_DIRECTORY@";69 65 #endif 70 66 71 67 // DEVELOPMENT RUN PATHS 72 68 const char dataDevDirectory[] = "@DATA_DIRECTORY@"; 73 const char externalDataDevDirectory[] = "@EXTERNAL_DATA_DIRECTORY@";74 69 #ifdef CMAKE_CONFIGURATION_TYPES 75 const char moduleDevDirectory[] = "@CMAKE_MODULE_OUTPUT_DIRECTORY@/" CMAKE_INTDIR;76 70 const char configDevDirectory[] = "@CMAKE_CONFIG_OUTPUT_DIRECTORY@/" CMAKE_INTDIR; 77 71 const char logDevDirectory[] = "@CMAKE_LOG_OUTPUT_DIRECTORY@/" CMAKE_INTDIR; 78 72 #else 79 const char moduleDevDirectory[] = "@CMAKE_MODULE_OUTPUT_DIRECTORY@";80 73 const char configDevDirectory[] = "@CMAKE_CONFIG_OUTPUT_DIRECTORY@"; 81 74 const char logDevDirectory[] = "@CMAKE_LOG_OUTPUT_DIRECTORY@"; … … 85 78 const char dependencyLibraryDirectory[] = "@DEP_LIBRARY_DIR@"; 86 79 #endif 87 88 // Module extension89 const char moduleExtension[] = "@ORXONOX_MODULE_EXTENSION@";90 91 // OGRE PLUGINS92 #ifdef NDEBUG93 const char ogrePlugins[] = "@OGRE_PLUGINS_RELEASE@";94 # ifdef DEPENDENCY_PACKAGE_ENABLE95 const char ogrePluginsDirectory[] = ".";96 # else97 const char ogrePluginsDirectory[] = "@OGRE_PLUGINS_FOLDER_RELEASE@";98 # endif99 #else100 const char ogrePlugins[] = "@OGRE_PLUGINS_DEBUG@";101 # ifdef DEPENDENCY_PACKAGE_ENABLE102 const char ogrePluginsDirectory[] = ".";103 # else104 const char ogrePluginsDirectory[] = "@OGRE_PLUGINS_FOLDER_DEBUG@";105 # endif106 #endif107 80 } } 108 81 -
sandbox_qt/src/external/CMakeLists.txt
r7266 r7421 20 20 ################ Sub Directories ################ 21 21 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 ADD_SUBDIRECTORY(bullet)35 ADD_SUBDIRECTORY(cpptcl)36 22 ADD_SUBDIRECTORY(loki) 37 ADD_SUBDIRECTORY(ogreceguirenderer)38 ADD_SUBDIRECTORY(ois)39 ADD_SUBDIRECTORY(tinyxml) -
sandbox_qt/src/libraries/CMakeLists.txt
r7401 r7421 24 24 ADD_SUBDIRECTORY(util) 25 25 ADD_SUBDIRECTORY(core) 26 ADD_SUBDIRECTORY(network)27 ADD_SUBDIRECTORY(tools) -
sandbox_qt/src/libraries/core/CMakeLists.txt
r7284 r7421 19 19 20 20 SET_SOURCE_FILES(CORE_SRC_FILES 21 CommandLineParser.cc22 ConfigValueContainer.cc23 21 Core.cc 24 DynLib.cc25 DynLibManager.cc26 Event.cc27 22 Game.cc 28 GameMode.cc29 GameState.cc30 GraphicsManager.cc31 GUIManager.cc32 Language.cc33 LuaState.cc34 ObjectListBase.cc35 OrxonoxClass.cc36 Resource.cc37 WindowEventListener.cc38 39 # hierarchy40 Identifier.cc41 MetaObjectList.cc42 43 # level44 BaseObject.cc45 ClassTreeMask.cc46 Loader.cc47 Namespace.cc48 NamespaceNode.cc49 Template.cc50 XMLPort.cc51 XMLNameListener.cc52 53 COMPILATION_BEGIN FilesystemCompilation.cc54 command/ArgumentCompletionFunctions.cc55 ConfigFileManager.cc56 MemoryArchive.cc57 23 PathConfig.cc 58 COMPILATION_END59 60 # multithreading61 ThreadPool.cc62 COMPILATION_BEGIN ThreadCompilation.cc63 command/TclThreadManager.cc64 Thread.cc65 COMPILATION_END66 24 ) 67 68 ADD_SUBDIRECTORY(command)69 ADD_SUBDIRECTORY(input)70 25 71 26 ORXONOX_ADD_LIBRARY(core 72 27 FIND_HEADER_FILES 73 TOLUA_FILES74 command/CommandExecutor.h75 ConfigFileManager.h76 Game.h77 GameMode.h78 GUIManager.h79 Loader.h80 LuaState.h81 PathConfig.h82 input/InputManager.h83 input/KeyBinder.h84 input/KeyBinderManager.h85 PCH_FILE86 CorePrecompiledHeaders.h87 28 LINK_LIBRARIES 88 ${OGRE_LIBRARY} 89 ${Boost_FILESYSTEM_LIBRARY} 90 ${Boost_SYSTEM_LIBRARY} # Filesystem dependency 91 ${Boost_THREAD_LIBRARY} 92 ${Boost_DATE_TIME_LIBRARY} # Thread dependency 93 ${CEGUI_LIBRARY} 94 ${CEGUILUA_LIBRARY} 95 ${LUA_LIBRARIES} 96 cpptcl_orxonox 97 ogreceguirenderer_orxonox 98 ois_orxonox 99 tinyxml_orxonox 100 tolua_orxonox 29 ${QT_QTCORE_LIBRARY} 101 30 util 102 31 SOURCE_FILES -
sandbox_qt/src/libraries/core/Core.cc
r7401 r7421 31 31 @file 32 32 @brief 33 Implementation of the Core singleton with its global variables (avoids boost include)33 Implementation of the Core singleton 34 34 */ 35 35 … … 37 37 38 38 #include <cassert> 39 #include <ctime> 39 40 #include <fstream> 40 41 #include <vector> … … 49 50 #endif 50 51 51 #include "util/Clock.h"52 52 #include "util/Debug.h" 53 53 #include "util/Exception.h" 54 #include "util/Scope.h"55 #include "util/ScopedSingletonManager.h"56 #include "util/SignalHandler.h"57 54 #include "PathConfig.h" 58 #include "CommandLineParser.h"59 #include "ConfigFileManager.h"60 #include "ConfigValueIncludes.h"61 #include "CoreIncludes.h"62 #include "DynLibManager.h"63 #include "GameMode.h"64 #include "GraphicsManager.h"65 #include "GUIManager.h"66 #include "Identifier.h"67 #include "Language.h"68 #include "LuaState.h"69 #include "command/ConsoleCommand.h"70 #include "command/IOConsole.h"71 #include "command/TclBind.h"72 #include "command/TclThreadManager.h"73 #include "input/InputManager.h"74 55 75 56 namespace orxonox … … 78 59 Core* Core::singletonPtr_s = 0; 79 60 80 SetCommandLineArgument(settingsFile, "orxonox.ini").information("THE configuration file");81 SetCommandLineSwitch(noIOConsole).information("Use this if you don't want to use the IOConsole (for instance for Lua debugging)");82 83 #ifdef ORXONOX_PLATFORM_WINDOWS84 SetCommandLineArgument(limitToCPU, 1).information("Limits the program to one CPU/core (1, 2, 3, etc.). Default is the first core (faster than off)");85 #endif86 87 61 Core::Core(const std::string& cmdLine) 88 // Cleanup guard for identifier destruction (incl. XMLPort, configValues, consoleCommands)89 : identifierDestroyer_(Identifier::destroyAllIdentifiers)90 // Cleanup guard for external console commands that don't belong to an Identifier91 , consoleCommandDestroyer_(ConsoleCommand::destroyAll)92 , bGraphicsLoaded_(false)93 , bStartIOConsole_(true)94 62 { 95 63 // Set the hard coded fixed paths 96 64 this->pathConfig_.reset(new PathConfig()); 97 65 98 // Create a new dynamic library manager99 this->dynLibManager_.reset(new DynLibManager());100 101 // Load modules102 const std::vector<std::string>& modulePaths = this->pathConfig_->getModulePaths();103 for (std::vector<std::string>::const_iterator it = modulePaths.begin(); it != modulePaths.end(); ++it)104 {105 try106 {107 this->dynLibManager_->load(*it);108 }109 catch (...)110 {111 COUT(1) << "Couldn't load module \"" << *it << "\": " << Exception::handleMessage() << std::endl;112 }113 }114 115 // Parse command line arguments AFTER the modules have been loaded (static code!)116 CommandLineParser::parseCommandLine(cmdLine);117 118 66 // Set configurable paths like log, config and media 119 67 this->pathConfig_->setConfigurablePaths(); 120 121 // create a signal handler (only active for Linux)122 // This call is placed as soon as possible, but after the directories are set123 this->signalHandler_.reset(new SignalHandler());124 this->signalHandler_->doCatch(PathConfig::getExecutablePathString(), PathConfig::getLogPathString() + "orxonox_crash.log");125 68 126 69 // Set the correct log path. Before this call, /tmp (Unix) or %TEMP% (Windows) was used 127 70 OutputHandler::getInstance().setLogPath(PathConfig::getLogPathString()); 128 71 129 // Parse additional options file now that we know its path130 CommandLineParser::parseFile();131 132 72 #ifdef ORXONOX_PLATFORM_WINDOWS 133 73 // limit the main thread to the first core so that QueryPerformanceCounter doesn't jump 134 // do this after ogre has initialised. Somehow Ogre changes the settings again (not through 135 // the timer though). 136 int limitToCPU = CommandLineParser::getValue("limitToCPU"); 74 int limitToCPU = 0;//CommandLineParser::getValue("limitToCPU"); 137 75 if (limitToCPU > 0) 138 76 setThreadAffinity(static_cast<unsigned int>(limitToCPU)); 139 77 #endif 140 78 141 // Manage ini files and set the default settings file (usually orxonox.ini)142 this->configFileManager_.reset(new ConfigFileManager());143 this->configFileManager_->setFilename(ConfigFileType::Settings,144 CommandLineParser::getValue("settingsFile").getString());145 146 // Required as well for the config values147 this->languageInstance_.reset(new Language());148 149 // Do this soon after the ConfigFileManager has been created to open up the150 // possibility to configure everything below here151 ClassIdentifier<Core>::getIdentifier("Core")->initialiseObject(this, "Core", true);152 this->setConfigValues();153 154 // create persistent io console155 if (CommandLineParser::getValue("noIOConsole").getBool())156 {157 ModifyConfigValue(bStartIOConsole_, tset, false);158 }159 if (this->bStartIOConsole_)160 this->ioConsole_.reset(new IOConsole());161 162 // creates the class hierarchy for all classes with factories163 Identifier::createClassHierarchy();164 165 // Load OGRE excluding the renderer and the render window166 this->graphicsManager_.reset(new GraphicsManager(false));167 168 // initialise Tcl169 this->tclBind_.reset(new TclBind(PathConfig::getDataPathString()));170 this->tclThreadManager_.reset(new TclThreadManager(tclBind_->getTclInterpreter()));171 172 // Create singletons that always exist (in other libraries)173 this->rootScope_.reset(new Scope<ScopeID::Root>());174 175 79 // Generate documentation instead of normal run? 176 80 std::string docFilename; 177 CommandLineParser::getValue("generateDoc", &docFilename);81 //CommandLineParser::getValue("generateDoc", &docFilename); 178 82 if (!docFilename.empty()) 179 83 { … … 181 85 if (docFile.is_open()) 182 86 { 183 CommandLineParser::generateDoc(docFile);87 //CommandLineParser::generateDoc(docFile); 184 88 docFile.close(); 185 89 } … … 191 95 /** 192 96 @brief 193 All destruction code is handled by scoped_ptrs and ScopeGuards.97 All destruction code is handled by QScopedPointers 194 98 */ 195 99 Core::~Core() 196 100 { 197 // Remove us from the object lists again to avoid problems when destroying them198 this->unregisterObject();199 101 } 200 102 … … 207 109 const unsigned int defaultLevelLogFile = 4; 208 110 #endif 111 /* 209 112 SetConfigValueExternal(softDebugLevelLogFile_, "OutputHandler", "softDebugLevelLogFile", defaultLevelLogFile) 210 113 .description("The maximum level of debug output shown in the log file"); … … 219 122 SetConfigValue(bStartIOConsole_, true) 220 123 .description("Set to false if you don't want to use the IOConsole (for Lua debugging for instance)"); 221 } 222 223 //! Callback function if the language has changed. 224 void Core::languageChanged() 225 { 226 // Read the translation file after the language was configured 227 Language::getInstance().readTranslatedLanguageFile(); 124 */ 228 125 } 229 126 … … 237 134 bInitialized = true; 238 135 } 239 }240 241 void Core::loadGraphics()242 {243 // Any exception should trigger this, even in upgradeToGraphics (see its remarks)244 Loki::ScopeGuard unloader = Loki::MakeObjGuard(*this, &Core::unloadGraphics);245 246 // Upgrade OGRE to receive a render window247 try248 {249 graphicsManager_->upgradeToGraphics();250 }251 catch (...)252 {253 // Recovery from this is very difficult. It requires to completely254 // destroy Ogre related objects and load again (without graphics).255 // However since Ogre 1.7 there seems to be a problem when Ogre256 // throws an exception and the graphics engine then gets destroyed257 // and reloaded between throw and catch (access violation in MSVC).258 // That's why we abort completely and only display the exception.259 COUT(0) << "An exception occurred during upgrade to graphics. "260 << "That is unrecoverable. The message was:" << endl261 << Exception::handleMessage() << endl;262 abort();263 }264 265 // Calls the InputManager which sets up the input devices.266 inputManager_.reset(new InputManager());267 268 // Load the CEGUI interface269 guiManager_.reset(new GUIManager(inputManager_->getMousePosition()));270 271 bGraphicsLoaded_ = true;272 GameMode::bShowsGraphics_s = true;273 274 // Load some sort of a debug overlay (only denoted by its name, "debug.oxo")275 graphicsManager_->loadDebugOverlay();276 277 // Create singletons associated with graphics (in other libraries)278 graphicsScope_.reset(new Scope<ScopeID::Graphics>());279 280 unloader.Dismiss();281 }282 283 void Core::unloadGraphics()284 {285 this->graphicsScope_.reset();286 this->guiManager_.reset();287 this->inputManager_.reset();288 this->graphicsManager_.reset();289 290 // Load Ogre::Root again, but without the render system291 try292 { this->graphicsManager_.reset(new GraphicsManager(false)); }293 catch (...)294 {295 COUT(0) << "An exception occurred during 'unloadGraphics':" << Exception::handleMessage() << std::endl296 << "Another exception might be being handled which may lead to undefined behaviour!" << std::endl297 << "Terminating the program." << std::endl;298 abort();299 }300 301 bGraphicsLoaded_ = false;302 GameMode::bShowsGraphics_s = false;303 }304 305 //! Sets the language in the config-file back to the default.306 void Core::resetLanguage()307 {308 ResetConfigValue(language_);309 136 } 310 137 … … 354 181 #endif 355 182 } 356 357 void Core::preUpdate(const Clock& time)358 {359 // Update singletons before general ticking360 ScopedSingletonManager::preUpdate<ScopeID::Root>(time);361 if (this->bGraphicsLoaded_)362 {363 // Process input events364 this->inputManager_->preUpdate(time);365 // Update GUI366 this->guiManager_->preUpdate(time);367 // Update singletons before general ticking368 ScopedSingletonManager::preUpdate<ScopeID::Graphics>(time);369 }370 // Process console events and status line371 if (this->ioConsole_ != NULL)372 this->ioConsole_->preUpdate(time);373 // Process thread commands374 this->tclThreadManager_->preUpdate(time);375 }376 377 void Core::postUpdate(const Clock& time)378 {379 // Update singletons just before rendering380 ScopedSingletonManager::postUpdate<ScopeID::Root>(time);381 if (this->bGraphicsLoaded_)382 {383 // Update singletons just before rendering384 ScopedSingletonManager::postUpdate<ScopeID::Graphics>(time);385 // Render (doesn't throw)386 this->graphicsManager_->postUpdate(time);387 }388 }389 183 } -
sandbox_qt/src/libraries/core/Core.h
r7401 r7421 45 45 46 46 #include <string> 47 #include < boost/scoped_ptr.hpp>47 #include <QScopedPointer> 48 48 #include <loki/ScopeGuard.h> 49 49 50 50 #include "util/Singleton.h" 51 #include " OrxonoxClass.h"51 #include "PathConfig.h" 52 52 53 53 namespace orxonox … … 59 59 You should only create this singleton once because it destroys the identifiers! 60 60 */ 61 class _CoreExport Core : public Singleton<Core> , public OrxonoxClass61 class _CoreExport Core : public Singleton<Core> 62 62 { 63 63 typedef Loki::ScopeGuardImpl0<void (*)()> SimpleScopeGuard; … … 78 78 void setConfigValues(); 79 79 80 //! Returns the configured language.81 const std::string& getLanguage()82 { return this->language_; }83 void resetLanguage();84 85 80 private: 86 81 Core(const Core&); //!< Don't use (undefined symbol) 87 82 88 void languageChanged();89 83 void initRandomNumberGenerator(); 90 84 91 void preUpdate(const Clock& time); 92 void postUpdate(const Clock& time); 93 94 void loadGraphics(); 95 void unloadGraphics(); 85 void update() {} 96 86 97 87 void setThreadAffinity(int limitToCPU); 98 88 // MANAGED SINGLETONS/OBJECTS 99 89 // Mind the order for the destruction! 100 scoped_ptr<PathConfig> pathConfig_; 101 scoped_ptr<DynLibManager> dynLibManager_; 102 scoped_ptr<SignalHandler> signalHandler_; 103 SimpleScopeGuard identifierDestroyer_; 104 SimpleScopeGuard consoleCommandDestroyer_; 105 scoped_ptr<ConfigFileManager> configFileManager_; 106 scoped_ptr<Language> languageInstance_; 107 scoped_ptr<IOConsole> ioConsole_; 108 scoped_ptr<TclBind> tclBind_; 109 scoped_ptr<TclThreadManager> tclThreadManager_; 110 scoped_ptr<Scope<ScopeID::Root> > rootScope_; 111 // graphical 112 scoped_ptr<GraphicsManager> graphicsManager_; //!< Interface to OGRE 113 scoped_ptr<InputManager> inputManager_; //!< Interface to OIS 114 scoped_ptr<GUIManager> guiManager_; //!< Interface to GUI 115 scoped_ptr<Scope<ScopeID::Graphics> > graphicsScope_; 90 QScopedPointer<PathConfig> pathConfig_; 116 91 117 bool bGraphicsLoaded_;118 92 int softDebugLevelLogFile_; //!< The debug level for the log file (belongs to OutputHandler) 119 std::string language_; //!< The language120 93 bool bInitRandomNumberGenerator_; //!< If true, srand(time(0)) is called 121 bool bStartIOConsole_; //!< Set to false if you don't want to use the IOConsole122 94 123 95 static Core* singletonPtr_s; -
sandbox_qt/src/libraries/core/CorePrereqs.h
r7284 r7421 37 37 38 38 #include "OrxonoxConfig.h" 39 #include <boost/version.hpp>40 39 41 40 //----------------------------------------------------------------------- … … 63 62 //----------------------------------------------------------------------- 64 63 65 namespace orxonox66 {67 static const uint32_t OBJECTID_UNKNOWN = static_cast<uint32_t>(-1);68 }69 70 64 //----------------------------------------------------------------------- 71 65 // Enums 72 66 //----------------------------------------------------------------------- 73 74 namespace orxonox75 {76 namespace XMLPort77 {78 enum Mode79 {80 NOP,81 LoadObject,82 SaveObject,83 ExpandObject84 };85 }86 87 namespace ConfigFileType88 {89 enum Value90 {91 Settings,92 JoyStickCalibration,93 CommandHistory94 // Don't forget to adjust the array size in the ConfigFileManager when adding a new entry here!95 };96 }97 98 namespace KeybindMode99 {100 enum Value101 {102 OnPress,103 OnHold,104 OnRelease,105 None106 };107 };108 }109 67 110 68 //----------------------------------------------------------------------- … … 114 72 namespace orxonox 115 73 { 116 typedef std::string LanguageEntryLabel;117 118 template <class T, class U>119 T orxonox_cast(U*);120 121 class BaseObject;122 template <class T>123 class ClassFactory;124 template <class T>125 class ClassIdentifier;126 class ClassTreeMask;127 class ClassTreeMaskIterator;128 class ClassTreeMaskNode;129 class ClassTreeMaskObjectIterator;130 class CommandLineParser;131 class CommandLineArgument;132 class ConfigFile;133 class ConfigFileEntry;134 class ConfigFileEntryComment;135 class ConfigFileEntryValue;136 class ConfigFileManager;137 class ConfigFileSection;138 class ConfigValueContainer;139 74 class Core; 140 class DynLib;141 class DynLibManager;142 struct Event;143 class EventState;144 class Factory;145 75 class Game; 146 class GameState;147 struct GameStateInfo;148 struct GameStateTreeNode;149 class GraphicsManager;150 class GUIManager;151 class Identifier;152 template <class T>153 class Iterator;154 class Language;155 class LuaFunctor;156 class LuaState;157 class MemoryArchive;158 class MemoryArchiveFactory;159 class MetaObjectList;160 class MetaObjectListElement;161 class Namespace;162 class NamespaceNode;163 template <class T>164 class ObjectList;165 class ObjectListBase;166 class ObjectListBaseElement;167 template <class T>168 class ObjectListElement;169 template <class T>170 class ObjectListIterator;171 class OgreWindowEventListener;172 class OrxonoxClass;173 76 class PathConfig; 174 struct ResourceInfo;175 class SettingsConfigFile;176 template <class T>177 class SmartPtr;178 template <class T>179 class SubclassIdentifier;180 class Template;181 class Thread;182 class ThreadPool;183 template <class T>184 class WeakPtr;185 class WindowEventListener;186 class XMLFile;187 class XMLNameListener;188 template <class T, class O>189 class XMLPortClassObjectContainer;190 template <class T>191 class XMLPortClassParamContainer;192 class XMLPortObjectContainer;193 class XMLPortParamContainer;194 195 // Command196 class ArgumentCompleter;197 class ArgumentCompletionListElement;198 class CommandEvaluation;199 class ConsoleCommand;200 class Executor;201 template <class T>202 class ExecutorMember;203 class ExecutorStatic;204 class Functor;205 template <class O>206 class FunctorMember;207 typedef FunctorMember<void> FunctorStatic;208 template <class F, class O>209 class FunctorPointer;210 class IOConsole;211 class IRC;212 class Shell;213 class ShellListener;214 class TclBind;215 struct TclInterpreterBundle;216 template <class T>217 class TclThreadList;218 class TclThreadManager;219 220 // Input221 class BaseCommand;222 class BufferedParamCommand;223 class Button;224 class HalfAxis;225 class InputBuffer;226 class InputDevice;227 template <class Traits>228 class InputDeviceTemplated;229 class InputHandler;230 class InputManager;231 class InputState;232 struct InputStatePriority;233 class JoyStickQuantityListener;234 class JoyStick;235 class KeyBinder;236 class KeyBinderManager;237 class Keyboard;238 class KeyDetector;239 class KeyEvent;240 class Mouse;241 class ParamCommand;242 class SimpleCommand;243 }244 245 #include "command/FunctorPtr.h"246 #include "command/ExecutorPtr.h"247 248 // CppTcl249 namespace Tcl250 {251 class interpreter;252 class object;253 }254 255 // Boost256 namespace boost257 {258 #if (BOOST_VERSION < 104400)259 namespace filesystem260 {261 struct path_traits;262 template <class String, class Traits> class basic_path;263 typedef basic_path<std::string, path_traits> path;264 }265 #else266 namespace filesystem2267 {268 struct path_traits;269 template <class String, class Traits> class basic_path;270 typedef basic_path<std::string, path_traits> path;271 }272 namespace filesystem273 {274 using filesystem2::basic_path;275 using filesystem2::path_traits;276 using filesystem2::path;277 }278 #endif279 class thread;280 class mutex;281 class shared_mutex;282 class condition_variable;283 }284 285 // Ogre286 namespace Ogre287 {288 class DataStream;289 template <class T> class SharedPtr;290 typedef SharedPtr<DataStream> DataStreamPtr;291 }292 namespace orxonox293 {294 // Import the Ogre::DataStream295 using Ogre::DataStream;296 using Ogre::DataStreamPtr;297 }298 299 // CEGUI300 namespace CEGUI301 {302 class DefaultLogger;303 class Logger;304 class LuaScriptModule;305 306 class OgreCEGUIRenderer;307 class OgreCEGUIResourceProvider;308 class OgreCEGUITexture;309 }310 311 // Lua312 struct lua_State;313 314 // TinyXML and TinyXML++315 class TiXmlString;316 class TiXmlOutStream;317 class TiXmlNode;318 class TiXmlHandle;319 class TiXmlDocument;320 class TiXmlElement;321 class TiXmlComment;322 class TiXmlUnknown;323 class TiXmlAttribute;324 class TiXmlText;325 class TiXmlDeclaration;326 class TiXmlParsingData;327 namespace ticpp328 {329 class Document;330 class Element;331 class Declaration;332 class StylesheetReference;333 class Text;334 class Comment;335 class Attribute;336 }337 namespace orxonox338 {339 using ticpp::Element;340 77 } 341 78 -
sandbox_qt/src/libraries/core/Game.cc
r7284 r7421 36 36 37 37 #include <exception> 38 #include <boost/weak_ptr.hpp>39 #include <loki/ScopeGuard.h>40 38 41 #include "util/Clock.h"42 39 #include "util/Debug.h" 43 40 #include "util/Exception.h" 44 41 #include "util/Sleep.h" 45 #include "util/SubString.h"46 #include "CommandLineParser.h"47 42 #include "Core.h" 48 #include "CoreIncludes.h"49 #include "ConfigValueIncludes.h"50 #include "GameMode.h"51 #include "GameState.h"52 #include "GUIManager.h"53 #include "command/ConsoleCommand.h"54 43 55 44 namespace orxonox 56 45 { 57 static void stop_game()58 { Game::getInstance().stop(); }59 SetConsoleCommand("exit", &stop_game);60 static void printFPS()61 { COUT(0) << Game::getInstance().getAvgFPS() << std::endl; }62 SetConsoleCommand("printFPS", &printFPS);63 static void printTickTime()64 { COUT(0) << Game::getInstance().getAvgTickTime() << std::endl; }65 SetConsoleCommand("printTickTime", &printTickTime);66 67 std::map<std::string, GameStateInfo> Game::gameStateDeclarations_s;68 46 Game* Game::singletonPtr_s = 0; 69 47 70 //! Represents one node of the game state tree.71 struct GameStateTreeNode72 {73 std::string name_;74 weak_ptr<GameStateTreeNode> parent_;75 std::vector<shared_ptr<GameStateTreeNode> > children_;76 };77 78 48 Game::Game(const std::string& cmdLine) 79 // Destroy factories before the Core!80 : gsFactoryDestroyer_(Game::GameStateFactory::getFactories(), &std::map<std::string, shared_ptr<GameStateFactory> >::clear)81 49 { 82 50 this->bAbort_ = false; 83 bChangingState_ = false;84 85 #ifdef ORXONOX_PLATFORM_WINDOWS86 minimumSleepTime_ = 1000/*us*/;87 #else88 minimumSleepTime_ = 0/*us*/;89 #endif90 91 // reset statistics92 this->statisticsStartTime_ = 0;93 this->statisticsTickTimes_.clear();94 this->periodTickTime_ = 0;95 this->periodTime_ = 0;96 this->avgFPS_ = 0.0f;97 this->avgTickTime_ = 0.0f;98 this->excessSleepTime_ = 0;99 100 // Create an empty root state101 this->declareGameState<GameState>("GameState", "emptyRootGameState", true, false);102 103 // Set up a basic clock to keep time104 this->gameClock_.reset(new Clock());105 51 106 52 // Create the Core 107 53 this->core_.reset(new Core(cmdLine)); 108 109 // Do this after the Core creation!110 ClassIdentifier<Game>::getIdentifier("Game")->initialiseObject(this, "Game", true);111 this->setConfigValues();112 113 // After the core has been created, we can safely instantiate the GameStates that don't require graphics114 for (std::map<std::string, GameStateInfo>::const_iterator it = gameStateDeclarations_s.begin();115 it != gameStateDeclarations_s.end(); ++it)116 {117 if (!it->second.bGraphicsMode)118 constructedStates_[it->second.stateName] = GameStateFactory::fabricate(it->second);119 }120 121 // The empty root state is ALWAYS loaded!122 this->rootStateNode_ = shared_ptr<GameStateTreeNode>(new GameStateTreeNode());123 this->rootStateNode_->name_ = "emptyRootGameState";124 this->loadedTopStateNode_ = this->rootStateNode_;125 this->loadedStates_.push_back(this->getState(rootStateNode_->name_));126 54 } 127 55 128 56 /** 129 57 @brief 130 All destruction code is handled by scoped_ptrs and SimpleScopeGuards.58 All destruction code is handled by QScopedPointers. 131 59 */ 132 60 Game::~Game() 133 61 { 134 // Remove us from the object lists again to avoid problems when destroying them135 this->unregisterObject();136 62 } 137 63 138 64 void Game::setConfigValues() 139 65 { 66 /* 140 67 SetConfigValue(statisticsRefreshCycle_, 250000) 141 68 .description("Sets the time in microseconds interval at which average fps, etc. get updated."); … … 144 71 SetConfigValue(fpsLimit_, 50) 145 72 .description("Sets the desired frame rate (0 for no limit)."); 73 */ 146 74 } 147 75 … … 149 77 @brief 150 78 Main loop of the orxonox game. 151 @note152 We use the Ogre::Timer to measure time since it uses the most precise153 method an any platform (however the windows timer lacks time when under154 heavy kernel load!).155 79 */ 156 80 void Game::run() 157 81 { 158 if (this->requestedStateNodes_.empty()) 159 COUT(0) << "Warning: Starting game without requesting GameState. This automatically terminates the program." << std::endl; 160 161 // START GAME 162 // first delta time should be about 0 seconds 163 this->gameClock_->capture(); 164 // A first item is required for the fps limiter 165 StatisticsTickInfo tickInfo = {0, 0}; 166 statisticsTickTimes_.push_back(tickInfo); 167 while (!this->bAbort_ && (!this->loadedStates_.empty() || this->requestedStateNodes_.size() > 0)) 82 while (!this->bAbort_) 168 83 { 169 // Generate the dt170 this->gameClock_->capture();171 172 // Statistics init173 StatisticsTickInfo tickInfo = {gameClock_->getMicroseconds(), 0};174 statisticsTickTimes_.push_back(tickInfo);175 this->periodTime_ += this->gameClock_->getDeltaTimeMicroseconds();176 177 // Update the GameState stack if required178 this->updateGameStateStack();179 180 // Core preUpdate181 84 try 182 { this->core_->preUpdate(*this->gameClock_); } 183 catch (...) 184 { 185 COUT(0) << "An exception occurred in the Core preUpdate: " << Exception::handleMessage() << std::endl; 186 COUT(0) << "This should really never happen! Closing the program." << std::endl; 187 this->stop(); 188 break; 189 } 190 191 // Update the GameStates bottom up in the stack 192 this->updateGameStates(); 193 194 // Core postUpdate 195 try 196 { this->core_->postUpdate(*this->gameClock_); } 85 { this->core_->update(); } 197 86 catch (...) 198 87 { … … 202 91 break; 203 92 } 204 205 // Evaluate statistics206 this->updateStatistics();207 208 // Limit frame rate209 this->updateFPSLimiter();210 93 } 211 212 // UNLOAD all remaining states213 while (this->loadedStates_.size() > 1)214 this->unloadState(this->loadedStates_.back()->getName());215 this->loadedTopStateNode_ = this->rootStateNode_;216 this->requestedStateNodes_.clear();217 }218 219 void Game::updateGameStateStack()220 {221 while (this->requestedStateNodes_.size() > 0)222 {223 shared_ptr<GameStateTreeNode> requestedStateNode = this->requestedStateNodes_.front();224 assert(this->loadedTopStateNode_);225 if (!this->loadedTopStateNode_->parent_.expired() && requestedStateNode == this->loadedTopStateNode_->parent_.lock())226 this->unloadState(loadedTopStateNode_->name_);227 else // has to be child228 {229 try230 {231 this->loadState(requestedStateNode->name_);232 }233 catch (...)234 {235 COUT(1) << "Error: Loading GameState '" << requestedStateNode->name_ << "' failed: " << Exception::handleMessage() << std::endl;236 // All scheduled operations have now been rendered inert --> flush them and issue a warning237 if (this->requestedStateNodes_.size() > 1)238 COUT(4) << "All " << this->requestedStateNodes_.size() - 1 << " scheduled transitions have been ignored." << std::endl;239 this->requestedStateNodes_.clear();240 break;241 }242 }243 this->loadedTopStateNode_ = requestedStateNode;244 this->requestedStateNodes_.erase(this->requestedStateNodes_.begin());245 }246 }247 248 void Game::updateGameStates()249 {250 // Note: The first element is the empty root state, which doesn't need ticking251 for (GameStateVector::const_iterator it = this->loadedStates_.begin() + 1;252 it != this->loadedStates_.end(); ++it)253 {254 try255 {256 // Add tick time for most of the states257 uint64_t timeBeforeTick = 0;258 if ((*it)->getInfo().bIgnoreTickTime)259 timeBeforeTick = this->gameClock_->getRealMicroseconds();260 (*it)->update(*this->gameClock_);261 if ((*it)->getInfo().bIgnoreTickTime)262 this->subtractTickTime(static_cast<int32_t>(this->gameClock_->getRealMicroseconds() - timeBeforeTick));263 }264 catch (...)265 {266 COUT(1) << "An exception occurred while updating '" << (*it)->getName() << "': " << Exception::handleMessage() << std::endl;267 COUT(1) << "This should really never happen!" << std::endl;268 COUT(1) << "Unloading all GameStates depending on the one that crashed." << std::endl;269 shared_ptr<GameStateTreeNode> current = this->loadedTopStateNode_;270 while (current->name_ != (*it)->getName() && current)271 current = current->parent_.lock();272 if (current && current->parent_.lock())273 this->requestState(current->parent_.lock()->name_);274 else275 this->stop();276 break;277 }278 }279 }280 281 void Game::updateStatistics()282 {283 // Add the tick time of this frame (rendering time has already been subtracted)284 uint64_t currentTime = gameClock_->getMicroseconds();285 uint64_t currentRealTime = gameClock_->getRealMicroseconds();286 this->statisticsTickTimes_.back().tickLength += (uint32_t)(currentRealTime - currentTime);287 this->periodTickTime_ += (uint32_t)(currentRealTime - currentTime);288 if (this->periodTime_ > this->statisticsRefreshCycle_)289 {290 std::list<StatisticsTickInfo>::iterator it = this->statisticsTickTimes_.begin();291 assert(it != this->statisticsTickTimes_.end());292 int64_t lastTime = currentTime - this->statisticsAvgLength_;293 if (static_cast<int64_t>(it->tickTime) < lastTime)294 {295 do296 {297 assert(this->periodTickTime_ >= it->tickLength);298 this->periodTickTime_ -= it->tickLength;299 ++it;300 assert(it != this->statisticsTickTimes_.end());301 } while (static_cast<int64_t>(it->tickTime) < lastTime);302 this->statisticsTickTimes_.erase(this->statisticsTickTimes_.begin(), it);303 }304 305 uint32_t framesPerPeriod = this->statisticsTickTimes_.size();306 // Why minus 1? No idea, but otherwise the fps rate is always (from 10 to 200!) one frame too low307 this->avgFPS_ = -1 + static_cast<float>(framesPerPeriod) / (currentTime - this->statisticsTickTimes_.front().tickTime) * 1000000.0f;308 this->avgTickTime_ = static_cast<float>(this->periodTickTime_) / framesPerPeriod / 1000.0f;309 310 this->periodTime_ -= this->statisticsRefreshCycle_;311 }312 }313 314 void Game::updateFPSLimiter()315 {316 uint64_t nextTime = gameClock_->getMicroseconds() - excessSleepTime_ + static_cast<uint32_t>(1000000.0f / fpsLimit_);317 uint64_t currentRealTime = gameClock_->getRealMicroseconds();318 while (currentRealTime < nextTime - minimumSleepTime_)319 {320 usleep((unsigned long)(nextTime - currentRealTime));321 currentRealTime = gameClock_->getRealMicroseconds();322 }323 // Integrate excess to avoid steady state error324 excessSleepTime_ = (int)(currentRealTime - nextTime);325 // Anti windup326 if (excessSleepTime_ > 50000) // 20ms is about the maximum time Windows would sleep for too long327 excessSleepTime_ = 50000;328 94 } 329 95 … … 332 98 this->bAbort_ = true; 333 99 } 334 335 void Game::subtractTickTime(int32_t length)336 {337 assert(!this->statisticsTickTimes_.empty());338 this->statisticsTickTimes_.back().tickLength -= length;339 this->periodTickTime_ -= length;340 }341 342 343 /***** GameState related *****/344 345 void Game::requestState(const std::string& name)346 {347 if (!this->checkState(name))348 {349 COUT(2) << "Warning: GameState named '" << name << "' doesn't exist!" << std::endl;350 return;351 }352 353 if (this->bChangingState_)354 {355 COUT(2) << "Warning: Requesting GameStates while loading/unloading a GameState is illegal! Ignoring." << std::endl;356 return;357 }358 359 shared_ptr<GameStateTreeNode> lastRequestedNode;360 if (this->requestedStateNodes_.empty())361 lastRequestedNode = this->loadedTopStateNode_;362 else363 lastRequestedNode = this->requestedStateNodes_.back();364 if (name == lastRequestedNode->name_)365 {366 COUT(2) << "Warning: Requesting the currently active state! Ignoring." << std::endl;367 return;368 }369 370 // Check children first371 std::vector<shared_ptr<GameStateTreeNode> > requestedNodes;372 for (unsigned int i = 0; i < lastRequestedNode->children_.size(); ++i)373 {374 if (lastRequestedNode->children_[i]->name_ == name)375 {376 requestedNodes.push_back(lastRequestedNode->children_[i]);377 break;378 }379 }380 381 if (requestedNodes.empty())382 {383 // Check parent and all its grand parents384 shared_ptr<GameStateTreeNode> currentNode = lastRequestedNode;385 while (currentNode != NULL)386 {387 if (currentNode->name_ == name)388 break;389 currentNode = currentNode->parent_.lock();390 requestedNodes.push_back(currentNode);391 }392 if (currentNode == NULL)393 requestedNodes.clear();394 }395 396 if (requestedNodes.empty())397 COUT(1) << "Error: Requested GameState transition is not allowed. Ignoring." << std::endl;398 else399 this->requestedStateNodes_.insert(requestedStateNodes_.end(), requestedNodes.begin(), requestedNodes.end());400 }401 402 void Game::requestStates(const std::string& names)403 {404 SubString tokens(names, ",;", " ");405 for (unsigned int i = 0; i < tokens.size(); ++i)406 this->requestState(tokens[i]);407 }408 409 void Game::popState()410 {411 shared_ptr<GameStateTreeNode> lastRequestedNode;412 if (this->requestedStateNodes_.empty())413 lastRequestedNode = this->loadedTopStateNode_;414 else415 lastRequestedNode = this->requestedStateNodes_.back();416 if (lastRequestedNode != this->rootStateNode_)417 this->requestState(lastRequestedNode->parent_.lock()->name_);418 else419 COUT(2) << "Warning: Can't pop the internal dummy root GameState" << std::endl;420 }421 422 shared_ptr<GameState> Game::getState(const std::string& name)423 {424 GameStateMap::const_iterator it = constructedStates_.find(name);425 if (it != constructedStates_.end())426 return it->second;427 else428 {429 std::map<std::string, GameStateInfo>::const_iterator it = gameStateDeclarations_s.find(name);430 if (it != gameStateDeclarations_s.end())431 COUT(1) << "Error: GameState '" << name << "' has not yet been loaded." << std::endl;432 else433 COUT(1) << "Error: Could not find GameState '" << name << "'." << std::endl;434 return shared_ptr<GameState>();435 }436 }437 438 void Game::setStateHierarchy(const std::string& str)439 {440 // Split string into pieces of the form whitespacesText441 std::vector<std::pair<std::string, int> > stateStrings;442 size_t pos = 0;443 size_t startPos = 0;444 while (pos < str.size())445 {446 int indentation = 0;447 while (pos < str.size() && str[pos] == ' ')448 ++indentation, ++pos;449 startPos = pos;450 while (pos < str.size() && str[pos] != ' ')451 ++pos;452 stateStrings.push_back(std::make_pair(str.substr(startPos, pos - startPos), indentation));453 }454 if (stateStrings.empty())455 ThrowException(GameState, "Emtpy GameState hierarchy provided, terminating.");456 // Add element with large identation to detect the last with just an iterator457 stateStrings.push_back(std::make_pair("", -1));458 459 // Parse elements recursively460 std::vector<std::pair<std::string, int> >::const_iterator begin = stateStrings.begin();461 parseStates(begin, this->rootStateNode_);462 }463 464 /*** Internal ***/465 466 void Game::parseStates(std::vector<std::pair<std::string, int> >::const_iterator& it, shared_ptr<GameStateTreeNode> currentNode)467 {468 SubString tokens(it->first, ",");469 std::vector<std::pair<std::string, int> >::const_iterator startIt = it;470 471 for (unsigned int i = 0; i < tokens.size(); ++i)472 {473 it = startIt; // Reset iterator to the beginning of the sub tree474 if (!this->checkState(tokens[i]))475 ThrowException(GameState, "GameState with name '" << tokens[i] << "' not found!");476 if (tokens[i] == this->rootStateNode_->name_)477 ThrowException(GameState, "You shouldn't use 'emptyRootGameState' in the hierarchy...");478 shared_ptr<GameStateTreeNode> node(new GameStateTreeNode());479 node->name_ = tokens[i];480 node->parent_ = currentNode;481 currentNode->children_.push_back(node);482 483 int currentLevel = it->second;484 ++it;485 while (it->second != -1)486 {487 if (it->second <= currentLevel)488 break;489 else if (it->second == currentLevel + 1)490 parseStates(it, node);491 else492 ThrowException(GameState, "Indentation error while parsing the hierarchy.");493 }494 }495 }496 497 void Game::loadGraphics()498 {499 if (!GameMode::showsGraphics())500 {501 core_->loadGraphics();502 Loki::ScopeGuard graphicsUnloader = Loki::MakeObjGuard(*this, &Game::unloadGraphics);503 504 // Construct all the GameStates that require graphics505 for (std::map<std::string, GameStateInfo>::const_iterator it = gameStateDeclarations_s.begin();506 it != gameStateDeclarations_s.end(); ++it)507 {508 if (it->second.bGraphicsMode)509 {510 // Game state loading failure is serious --> don't catch511 shared_ptr<GameState> gameState = GameStateFactory::fabricate(it->second);512 if (!constructedStates_.insert(std::make_pair(513 it->second.stateName, gameState)).second)514 assert(false); // GameState was already created!515 }516 }517 graphicsUnloader.Dismiss();518 }519 }520 521 void Game::unloadGraphics()522 {523 if (GameMode::showsGraphics())524 {525 // Destroy all the GameStates that require graphics526 for (GameStateMap::iterator it = constructedStates_.begin(); it != constructedStates_.end();)527 {528 if (it->second->getInfo().bGraphicsMode)529 constructedStates_.erase(it++);530 else531 ++it;532 }533 534 core_->unloadGraphics();535 }536 }537 538 bool Game::checkState(const std::string& name) const539 {540 std::map<std::string, GameStateInfo>::const_iterator it = gameStateDeclarations_s.find(name);541 if (it == gameStateDeclarations_s.end())542 return false;543 else544 return true;545 }546 547 void Game::loadState(const std::string& name)548 {549 this->bChangingState_ = true;550 LOKI_ON_BLOCK_EXIT_OBJ(*this, &Game::resetChangingState);551 552 // If state requires graphics, load it553 Loki::ScopeGuard graphicsUnloader = Loki::MakeObjGuard(*this, &Game::unloadGraphics);554 if (gameStateDeclarations_s[name].bGraphicsMode && !GameMode::showsGraphics())555 this->loadGraphics();556 else557 graphicsUnloader.Dismiss();558 559 shared_ptr<GameState> state = this->getState(name);560 state->activateInternal();561 if (!this->loadedStates_.empty())562 this->loadedStates_.back()->activity_.topState = false;563 this->loadedStates_.push_back(state);564 state->activity_.topState = true;565 566 graphicsUnloader.Dismiss();567 }568 569 void Game::unloadState(const std::string& name)570 {571 this->bChangingState_ = true;572 try573 {574 shared_ptr<GameState> state = this->getState(name);575 state->activity_.topState = false;576 this->loadedStates_.pop_back();577 if (!this->loadedStates_.empty())578 this->loadedStates_.back()->activity_.topState = true;579 state->deactivateInternal();580 }581 catch (...)582 {583 COUT(2) << "Warning: Unloading GameState '" << name << "' threw an exception: " << Exception::handleMessage() << std::endl;584 COUT(2) << " There might be potential resource leaks involved! To avoid this, improve exception-safety." << std::endl;585 }586 // Check if graphics is still required587 if (!bAbort_)588 {589 bool graphicsRequired = false;590 for (unsigned i = 0; i < loadedStates_.size(); ++i)591 graphicsRequired |= loadedStates_[i]->getInfo().bGraphicsMode;592 if (!graphicsRequired)593 this->unloadGraphics();594 }595 this->bChangingState_ = false;596 }597 598 /*static*/ std::map<std::string, shared_ptr<Game::GameStateFactory> >& Game::GameStateFactory::getFactories()599 {600 static std::map<std::string, shared_ptr<GameStateFactory> > factories;601 return factories;602 }603 604 /*static*/ shared_ptr<GameState> Game::GameStateFactory::fabricate(const GameStateInfo& info)605 {606 std::map<std::string, shared_ptr<Game::GameStateFactory> >::const_iterator it = getFactories().find(info.className);607 assert(it != getFactories().end());608 return it->second->fabricateInternal(info);609 }610 100 } -
sandbox_qt/src/libraries/core/Game.h
r7401 r7421 39 39 #include "CorePrereqs.h" 40 40 41 #include <cassert>42 #include <list>43 #include <map>44 41 #include <string> 45 #include <vector> 46 #include <boost/shared_ptr.hpp> 47 #include <boost/scoped_ptr.hpp> 48 #include <boost/preprocessor/cat.hpp> 49 #include <loki/ScopeGuard.h> 42 #include <QScopedPointer> 43 #include "util/Singleton.h" 50 44 51 #include "util/Debug.h"52 #include "util/Singleton.h"53 #include "OrxonoxClass.h"54 55 /**56 @brief57 Adds a new GameState to the Game. The second parameter is the name as string58 and every following paramter is a constructor argument (which is usually non existent)59 */60 #define DeclareGameState(className, stateName, bIgnoreTickTime, bGraphicsMode) \61 static bool BOOST_PP_CAT(bGameStateDummy_##className, __LINE__) = orxonox::Game::declareGameState<className>(#className, stateName, bIgnoreTickTime, bGraphicsMode)62 // tolua_begin63 45 namespace orxonox 64 46 { 65 // tolua_end66 67 //! Helper object required before GameStates are being constructed68 struct GameStateInfo69 {70 std::string stateName;71 std::string className;72 bool bIgnoreTickTime;73 bool bGraphicsMode;74 };75 76 47 /** 77 48 @brief … … 80 51 You should only create this singleton once because it owns the Core class! (see remark there) 81 52 */ 82 // tolua_begin 83 class _CoreExport Game 84 // tolua_end 85 : public Singleton<Game>, public OrxonoxClass 86 { // tolua_export 53 class _CoreExport Game : public Singleton<Game> 54 { 87 55 friend class Singleton<Game>; 88 typedef std::vector<shared_ptr<GameState> > GameStateVector;89 typedef std::map<std::string, shared_ptr<GameState> > GameStateMap;90 typedef shared_ptr<GameStateTreeNode> GameStateTreeNodePtr;91 56 92 57 public: … … 96 61 void setConfigValues(); 97 62 98 void setStateHierarchy(const std::string& str);99 shared_ptr<GameState> getState(const std::string& name);100 101 63 void run(); 102 64 void stop(); 103 65 104 static Game& getInstance(){ return Singleton<Game>::getInstance(); } // tolua_export105 106 void requestState(const std::string& name); //tolua_export107 void requestStates(const std::string& names); //tolua_export108 void popState(); //tolua_export109 110 const Clock& getGameClock() { return *this->gameClock_; }111 112 float getAvgTickTime() { return this->avgTickTime_; }113 float getAvgFPS() { return this->avgFPS_; }114 115 void subtractTickTime(int32_t length);116 117 template <class T>118 static bool declareGameState(const std::string& className, const std::string& stateName, bool bIgnoreTickTime, bool bConsoleMode);119 120 66 private: 121 class _CoreExport GameStateFactory122 {123 public:124 virtual ~GameStateFactory() { }125 static shared_ptr<GameState> fabricate(const GameStateInfo& info);126 template <class T>127 static void createFactory(const std::string& className)128 { getFactories()[className].reset(new TemplateGameStateFactory<T>()); }129 130 virtual shared_ptr<GameState> fabricateInternal(const GameStateInfo& info) = 0;131 static std::map<std::string, shared_ptr<GameStateFactory> >& getFactories();132 };133 template <class T>134 class TemplateGameStateFactory : public GameStateFactory135 {136 public:137 shared_ptr<GameState> fabricateInternal(const GameStateInfo& info)138 { return shared_ptr<GameState>(new T(info)); }139 };140 // For the factory destruction141 typedef Loki::ObjScopeGuardImpl0<std::map<std::string, shared_ptr<GameStateFactory> >, void (std::map<std::string, shared_ptr<GameStateFactory> >::*)()> ObjScopeGuard;142 143 struct StatisticsTickInfo144 {145 uint64_t tickTime;146 uint32_t tickLength;147 };148 149 67 Game(Game&); // don't mess with singletons 150 68 151 void loadGraphics(); 152 void unloadGraphics(); 153 154 void parseStates(std::vector<std::pair<std::string, int> >::const_iterator& it, shared_ptr<GameStateTreeNode> currentNode); 155 bool checkState(const std::string& name) const; 156 void loadState(const std::string& name); 157 void unloadState(const std::string& name); 158 159 // Main loop structuring 160 void updateGameStateStack(); 161 void updateGameStates(); 162 void updateStatistics(); 163 void updateFPSLimiter(); 164 165 // ScopeGuard helper function 166 void resetChangingState() { this->bChangingState_ = false; } 167 168 scoped_ptr<Clock> gameClock_; 169 scoped_ptr<Core> core_; 170 ObjScopeGuard gsFactoryDestroyer_; 171 172 GameStateMap constructedStates_; 173 GameStateVector loadedStates_; 174 GameStateTreeNodePtr rootStateNode_; 175 GameStateTreeNodePtr loadedTopStateNode_; 176 std::vector<GameStateTreeNodePtr> requestedStateNodes_; 177 178 bool bChangingState_; 69 QScopedPointer<Core> core_; 179 70 bool bAbort_; 180 71 181 // variables for time statistics182 uint64_t statisticsStartTime_;183 std::list<StatisticsTickInfo> statisticsTickTimes_;184 uint32_t periodTime_;185 uint32_t periodTickTime_;186 float avgFPS_;187 float avgTickTime_;188 int excessSleepTime_;189 unsigned int minimumSleepTime_;190 191 // config values192 unsigned int statisticsRefreshCycle_;193 unsigned int statisticsAvgLength_;194 unsigned int fpsLimit_;195 196 static std::map<std::string, GameStateInfo> gameStateDeclarations_s;197 72 static Game* singletonPtr_s; //!< Pointer to the Singleton 198 }; //tolua_export 199 200 template <class T> 201 /*static*/ bool Game::declareGameState(const std::string& className, const std::string& stateName, bool bIgnoreTickTime, bool bGraphicsMode) 202 { 203 std::map<std::string, GameStateInfo>::const_iterator it = gameStateDeclarations_s.find(stateName); 204 if (it == gameStateDeclarations_s.end()) 205 { 206 GameStateInfo& info = gameStateDeclarations_s[stateName]; 207 info.stateName = stateName; 208 info.className = className; 209 info.bIgnoreTickTime = bIgnoreTickTime; 210 info.bGraphicsMode = bGraphicsMode; 211 } 212 else 213 { 214 COUT(0) << "Error: Cannot declare two GameStates with the same name." << std::endl; 215 COUT(0) << " Ignoring second one ('" << stateName << "')." << std::endl; 216 } 217 218 // Create a factory to delay GameState creation 219 GameStateFactory::createFactory<T>(className); 220 221 // just a required dummy return value 222 return true; 223 } 224 } //tolua_export 73 }; 74 } 225 75 226 76 #endif /* _Game_H__ */ -
sandbox_qt/src/libraries/core/PathConfig.cc
r6417 r7421 33 33 #include <cstdio> 34 34 #include <vector> 35 #include <boost/version.hpp>36 #include <boost/filesystem.hpp>37 35 38 36 #ifdef ORXONOX_PLATFORM_WINDOWS … … 54 52 #include "util/Debug.h" 55 53 #include "util/Exception.h" 56 #include "CommandLineParser.h"57 58 // Boost 1.36 has some issues with deprecated functions that have been omitted59 #if (BOOST_VERSION == 103600)60 # define BOOST_LEAF_FUNCTION filename61 #else62 # define BOOST_LEAF_FUNCTION leaf63 #endif64 54 65 55 namespace orxonox 66 56 { 67 namespace bf = boost::filesystem;68 69 57 //! Static pointer to the singleton 70 58 PathConfig* PathConfig::singletonPtr_s = 0; 71 59 72 SetCommandLineArgument(externalDataPath, "").information("Path to the external data files");73 SetCommandLineOnlyArgument(writingPathSuffix, "").information("Additional subfolder for config and log files");74 75 60 PathConfig::PathConfig() 76 : rootPath_(*(new bf::path()))77 , executablePath_(*(new bf::path()))78 , modulePath_(*(new bf::path()))79 , dataPath_(*(new bf::path()))80 , externalDataPath_(*(new bf::path()))81 , configPath_(*(new bf::path()))82 , logPath_(*(new bf::path()))83 , bDevRun_(false)84 61 { 85 62 ////////////////////////// … … 125 102 #endif 126 103 127 executablePath_ = bf::path(buffer);104 executablePath_ = QDir(buffer); 128 105 #ifndef ORXONOX_PLATFORM_APPLE 129 executablePath_ = executablePath_.branch_path(); // remove executable name 130 #endif 131 132 ///////////////////// 133 // SET MODULE PATH // 134 ///////////////////// 135 136 if (bf::exists(executablePath_ / "orxonox_dev_build.keep_me")) 106 executablePath_.cdUp(); // remove executable name 107 #endif 108 109 if (executablePath_.exists("orxonox_dev_build.keep_me")) 137 110 { 138 111 COUT(1) << "Running from the build tree." << std::endl; 139 112 PathConfig::bDevRun_ = true; 140 modulePath_ = specialConfig::moduleDevDirectory;141 113 } 142 114 else … … 146 118 147 119 // Also set the root path 148 bf::pathrelativeExecutablePath(specialConfig::defaultRuntimePath);120 QDir relativeExecutablePath(specialConfig::defaultRuntimePath); 149 121 rootPath_ = executablePath_; 150 while (!bf::equivalent(rootPath_ / relativeExecutablePath, executablePath_) && !rootPath_.empty()) 151 rootPath_ = rootPath_.branch_path(); 152 if (rootPath_.empty()) 153 ThrowException(General, "Could not derive a root directory. Might the binary installation directory contain '..' when taken relative to the installation prefix path?"); 154 155 // Module path is fixed as well 156 modulePath_ = rootPath_ / specialConfig::defaultModulePath; 122 while (rootPath_ / relativeExecutablePath != executablePath_) 123 { 124 if (!rootPath_.cdUp()) 125 ThrowException(General, "Could not derive a root directory. Might the binary installation directory contain '..' when taken relative to the installation prefix path?"); 126 } 157 127 158 128 #else 159 129 160 130 // There is no root path, so don't set it at all 161 // Module path is fixed as well162 modulePath_ = specialConfig::moduleInstallDirectory;163 131 164 132 #endif … … 168 136 PathConfig::~PathConfig() 169 137 { 170 delete &rootPath_;171 delete &executablePath_;172 delete &modulePath_;173 delete &dataPath_;174 delete &externalDataPath_;175 delete &configPath_;176 delete &logPath_;177 138 } 178 139 … … 184 145 configPath_ = specialConfig::configDevDirectory; 185 146 logPath_ = specialConfig::logDevDirectory; 186 187 // Check for data path override by the command line188 if (!CommandLineParser::getArgument("externalDataPath")->hasDefaultValue())189 externalDataPath_ = CommandLineParser::getValue("externalDataPath").getString();190 else191 externalDataPath_ = specialConfig::externalDataDevDirectory;192 147 } 193 148 else … … 213 168 if (userDataPathPtr == NULL) 214 169 ThrowException(General, "Could not retrieve user data path."); 215 bf::pathuserDataPath(userDataPathPtr);170 QDir userDataPath(userDataPathPtr); 216 171 userDataPath /= ".orxonox"; 217 172 … … 223 178 } 224 179 225 // Option to put all the config and log files in a separate folder226 if (!CommandLineParser::getArgument("writingPathSuffix")->hasDefaultValue())227 {228 const std::string& directory(CommandLineParser::getValue("writingPathSuffix").getString());229 configPath_ = configPath_ / directory;230 logPath_ = logPath_ / directory;231 }232 233 180 // Create directories to avoid problems when opening files in non existent folders. 234 std::vector<std::pair< bf::path, std::string> > directories;235 directories.push_back(std::make_pair( bf::path(configPath_), "config"));236 directories.push_back(std::make_pair( bf::path(logPath_), "log"));237 238 for (std::vector<std::pair< bf::path, std::string> >::iterator it = directories.begin();181 std::vector<std::pair<QDir, std::string> > directories; 182 directories.push_back(std::make_pair(QDir(configPath_), "config")); 183 directories.push_back(std::make_pair(QDir(logPath_), "log")); 184 185 for (std::vector<std::pair<QDir, std::string> >::iterator it = directories.begin(); 239 186 it != directories.end(); ++it) 240 187 { 241 if ( bf::exists(it->first) && !bf::is_directory(it->first))188 if (!it->first.exists()) 242 189 { 243 ThrowException(General, std::string("The ") + it->second + " directory has been preoccupied by a file! \ 244 Please remove " + it->first.string()); 245 } 246 if (bf::create_directories(it->first)) // function may not return true at all (bug?) 247 { 190 if (!it->first.mkpath(".")) 191 ThrowException(General, std::string("The ") + it->second + " directory could not be created."); 248 192 COUT(4) << "Created " << it->second << " directory" << std::endl; 249 193 } … … 251 195 } 252 196 253 std::vector<std::string> PathConfig::getModulePaths()254 {255 std::vector<std::string> modulePaths;256 257 // We search for helper files with the following extension258 const std::string& moduleextension = specialConfig::moduleExtension;259 size_t moduleextensionlength = moduleextension.size();260 261 // Add that path to the PATH variable in case a module depends on another one262 std::string pathVariable(getenv("PATH"));263 putenv(const_cast<char*>(("PATH=" + pathVariable + ';' + modulePath_.string()).c_str()));264 265 // Make sure the path exists, otherwise don't load modules266 if (!boost::filesystem::exists(modulePath_))267 return modulePaths;268 269 boost::filesystem::directory_iterator file(modulePath_);270 boost::filesystem::directory_iterator end;271 272 // Iterate through all files273 while (file != end)274 {275 const std::string& filename = file->BOOST_LEAF_FUNCTION();276 277 // Check if the file ends with the exension in question278 if (filename.size() > moduleextensionlength)279 {280 if (filename.substr(filename.size() - moduleextensionlength) == moduleextension)281 {282 // We've found a helper file283 const std::string& library = filename.substr(0, filename.size() - moduleextensionlength);284 modulePaths.push_back((modulePath_ / library).file_string());285 }286 }287 ++file;288 }289 290 return modulePaths;291 }292 293 197 /*static*/ std::string PathConfig::getRootPathString() 294 198 { 295 return getInstance().rootPath_. string() + '/';199 return getInstance().rootPath_.path().toStdString() + '/'; 296 200 } 297 201 298 202 /*static*/ std::string PathConfig::getExecutablePathString() 299 203 { 300 return getInstance().executablePath_. string() + '/';204 return getInstance().executablePath_.path().toStdString() + '/'; 301 205 } 302 206 303 207 /*static*/ std::string PathConfig::getDataPathString() 304 208 { 305 return getInstance().dataPath_.string() + '/'; 306 } 307 308 /*static*/ std::string PathConfig::getExternalDataPathString() 309 { 310 return getInstance().externalDataPath_.string() + '/'; 209 return getInstance().dataPath_.path().toStdString() + '/'; 311 210 } 312 211 313 212 /*static*/ std::string PathConfig::getConfigPathString() 314 213 { 315 return getInstance().configPath_. string() + '/';214 return getInstance().configPath_.path().toStdString() + '/'; 316 215 } 317 216 318 217 /*static*/ std::string PathConfig::getLogPathString() 319 218 { 320 return getInstance().logPath_.string() + '/'; 321 } 322 323 /*static*/ std::string PathConfig::getModulePathString() 324 { 325 return getInstance().modulePath_.string() + '/'; 219 return getInstance().logPath_.path().toStdString() + '/'; 326 220 } 327 221 } -
sandbox_qt/src/libraries/core/PathConfig.h
r7401 r7421 39 39 #include <string> 40 40 #include <vector> 41 #include <QDir> 41 42 #include "util/Singleton.h" 42 43 43 //tolua_begin44 44 namespace orxonox 45 45 { 46 //tolua_end47 46 /** 48 47 @brief 49 48 The PathConfig class is a singleton used to configure different paths. 50 49 @details 51 The class provides information about the data, config, log, executable ,52 root and modulepath.50 The class provides information about the data, config, log, executable 51 and root path. 53 52 It determines those by the use of platform specific functions. 54 53 @remarks 55 54 Not all paths are always available: 56 55 - root only when installed copyable 57 - externalData only for development builds in the build tree58 56 */ 59 class _CoreExport PathConfig //tolua_export 60 : public Singleton<PathConfig> 61 { //tolua_export 57 class _CoreExport PathConfig : public Singleton<PathConfig> 58 { 62 59 friend class Singleton<PathConfig>; 63 60 friend class Core; … … 66 63 /** 67 64 @brief 68 Retriev s the executable path and sets all hard coded fixed paths (currently only the module path)65 Retrieves the executable path and sets all hard coded fixed paths (currently only the module path) 69 66 Also checks for "orxonox_dev_build.keep_me" in the executable diretory. 70 67 If found it means that this is not an installed run, hence we … … 76 73 ~PathConfig(); 77 74 78 //! Returns the path to the root folder as boost::filesystem::path79 static const boost::filesystem::path& getRootPath()75 //! Returns the path to the root folder as QDir 76 static const QDir& getRootPath() 80 77 { return getInstance().rootPath_; } 81 //! Returns the path to the executable folder as boost::filesystem::path82 static const boost::filesystem::path& getExecutablePath()78 //! Returns the path to the executable folder as QDir 79 static const QDir& getExecutablePath() 83 80 { return getInstance().executablePath_; } 84 //! Returns the path to the data files as boost::filesystem::path85 static const boost::filesystem::path& getDataPath()81 //! Returns the path to the data files as QDir 82 static const QDir& getDataPath() 86 83 { return getInstance().dataPath_; } 87 //! Returns the path to the external data files as boost::filesystem::path 88 static const boost::filesystem::path& getExternalDataPath() 89 { return getInstance().externalDataPath_; } 90 //! Returns the path to the config files as boost::filesystem::path 91 static const boost::filesystem::path& getConfigPath() 84 //! Returns the path to the config files as QDir 85 static const QDir& getConfigPath() 92 86 { return getInstance().configPath_; } 93 //! Returns the path to the log files as boost::filesystem::path94 static const boost::filesystem::path& getLogPath()87 //! Returns the path to the log files as QDir 88 static const QDir& getLogPath() 95 89 { return getInstance().logPath_; } 96 //! Returns the path to the modules as boost::filesystem::path97 static const boost::filesystem::path& getModulePath()98 { return getInstance().modulePath_; }99 90 100 91 //! Returns the path to the root folder as std::string … … 104 95 //! Returns the path to the data files as std::string 105 96 static std::string getDataPathString(); 106 //! Returns the path to the external data files as std::string107 static std::string getExternalDataPathString();108 97 //! Returns the path to the config files as std::string 109 98 static std::string getConfigPathString(); //tolua_export 110 99 //! Returns the path to the log files as std::string 111 100 static std::string getLogPathString(); 112 //! Returns the path to the modules as std::string113 static std::string getModulePathString();114 101 115 102 //! Return trrue for runs in the build directory (not installed) … … 126 113 */ 127 114 void setConfigurablePaths(); 128 //! Returns a list with all modules declared by a *.module file in the module folder.129 std::vector<std::string> getModulePaths();130 115 131 116 //! Path to the parent directory of the ones above if program was installed with relativ paths 132 boost::filesystem::path& rootPath_; 133 boost::filesystem::path& executablePath_; //!< Path to the executable 134 boost::filesystem::path& modulePath_; //!< Path to the modules 135 boost::filesystem::path& dataPath_; //!< Path to the data files folder 136 boost::filesystem::path& externalDataPath_; //!< Path to the external data files folder 137 boost::filesystem::path& configPath_; //!< Path to the config files folder 138 boost::filesystem::path& logPath_; //!< Path to the log files folder 117 QDir rootPath_; 118 QDir executablePath_; //!< Path to the executable 119 QDir dataPath_; //!< Path to the data files folder 120 QDir configPath_; //!< Path to the config files folder 121 QDir logPath_; //!< Path to the log files folder 139 122 140 bool 123 bool bDevRun_; //!< True for runs in the build directory (not installed) 141 124 static PathConfig* singletonPtr_s; 142 125 }; //tolua_export -
sandbox_qt/src/libraries/util/CMakeLists.txt
r7284 r7421 19 19 20 20 SET_SOURCE_FILES(UTIL_SRC_FILES 21 Clock.cc22 21 Exception.cc 23 ExprParser.cc24 22 Math.cc 25 MultiType.cc26 Scope.cc27 23 StringUtils.cc 28 24 COMPILATION_BEGIN StableCompilation.cc 29 Clipboard.cc30 25 Convert.cc 31 CRC32.cc32 26 OutputHandler.cc 33 ScopedSingletonManager.cc34 SharedPtr.cc35 SignalHandler.cc36 27 Sleep.cc 37 SmallObjectAllocator.cc38 28 SubString.cc 39 29 COMPILATION_END 40 30 ) 41 31 42 IF(GCC_NO_SYSTEM_HEADER_SUPPORT)43 # Get around displaying a few hundred lines of warning code44 SET_SOURCE_FILES_PROPERTIES(MultiType.cc PROPERTIES COMPILE_FLAGS "-w")45 ENDIF()46 IF(MSVC)47 # Simply using #pragma warning(disable:4244) doesn't really disable it48 # if the warning occurs in a template in another file49 # Hence promote it manually to a higher warning level (4)50 SET_SOURCE_FILES_PROPERTIES(MultiType.cc PROPERTIES COMPILE_FLAGS "-w44244")51 ENDIF()52 53 32 ORXONOX_ADD_LIBRARY(util 54 33 FIND_HEADER_FILES 55 34 LINK_LIBRARIES 56 ${CEGUI_LIBRARY} 57 ${OGRE_LIBRARY} 35 ${QT_QTCORE_LIBRARY} 58 36 SOURCE_FILES 59 37 ${UTIL_SRC_FILES} -
sandbox_qt/src/libraries/util/Exception.cc
r7401 r7421 35 35 #include "Exception.h" 36 36 37 #include <CEGUIExceptions.h>38 37 #include "Debug.h" 39 38 … … 99 98 return ex.what(); 100 99 } 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 }110 100 catch (...) 111 101 { -
sandbox_qt/src/libraries/util/Math.cc
r7401 r7421 34 34 #include "Math.h" 35 35 36 #include <OgrePlane.h>37 38 #include "MathConvert.h"39 #include "SubString.h"40 // Do not remove this include, it avoids linker errors.41 #include "mbool.h"42 43 36 namespace orxonox 44 37 { 45 #if OGRE_VERSION < 0x01060346 /**47 @brief Function for writing a Radian to a stream.48 */49 std::ostream& operator<<(std::ostream& out, const orxonox::Radian& radian)50 {51 out << radian.valueRadians();52 return out;53 }54 55 /**56 @brief Function for writing a Degree to a stream.57 */58 std::ostream& operator<<(std::ostream& out, const orxonox::Degree& degree)59 {60 out << degree.valueDegrees();61 return out;62 }63 #endif64 65 /**66 @brief Function for reading a Radian from a stream.67 */68 std::istream& operator>>(std::istream& in, orxonox::Radian& radian)69 {70 float temp;71 in >> temp;72 radian = temp;73 return in;74 }75 76 /**77 @brief Function for reading a Degree from a stream.78 */79 std::istream& operator>>(std::istream& in, orxonox::Degree& degree)80 {81 float temp;82 in >> temp;83 degree = temp;84 return in;85 }86 87 88 /**89 @brief Gets the angle between my viewing direction and the direction to the position of the other object.90 @param myposition My position91 @param mydirection My viewing direction92 @param otherposition The position of the other object93 @return The angle in radian94 95 Examples:96 - If the other object is exactly in front of me, the function returns 0.97 - If the other object is exactly behind me, the function returns pi.98 - If the other object is exactly right/left to me (or above/below), the function returns pi/2.99 */100 float getAngle(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& otherposition)101 {102 orxonox::Vector3 distance = otherposition - myposition;103 float distancelength = distance.length();104 if (distancelength == 0)105 return 0;106 else107 return acos(clamp<float>(mydirection.dotProduct(distance) / distancelength, -1, 1));108 }109 110 /**111 @brief Gets the 2D viewing direction (up/down, left/right) to the position of the other object.112 @param myposition My position113 @param mydirection My viewing direction114 @param myorthonormal My orthonormalvector (pointing upwards through my head)115 @param otherposition The position of the other object116 @return The viewing direction117 118 Examples:119 - If the other object is exactly in front of me, the function returns <tt>Vector2(0, 0)</tt>.120 - If the other object is exactly at my left, the function returns <tt>Vector2(-1, 0)</tt>.121 - If the other object is exactly at my right, the function returns <tt>Vector2(1, 0)</tt>.122 - If the other object is only a bit at my right, the function still returns <tt>Vector2(1, 0)</tt>.123 - If the other object is exactly above me, the function returns <tt>Vector2(0, 1)</tt>.124 */125 orxonox::Vector2 get2DViewdirection(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition)126 {127 orxonox::Vector3 distance = otherposition - myposition;128 129 // project difference vector on our plane130 orxonox::Vector3 projection = Ogre::Plane(mydirection, myposition).projectVector(distance);131 132 float projectionlength = projection.length();133 if (projectionlength == 0)134 {135 if (myposition.dotProduct(otherposition) >= 0)136 return orxonox::Vector2(0, 0);137 else138 return orxonox::Vector2(0, 1);139 }140 141 float cos_value = clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1);142 float sin_value = sqrt( 1 - cos_value*cos_value );143 144 if ((mydirection.crossProduct(myorthonormal)).dotProduct(distance) > 0)145 return orxonox::Vector2( sin_value, cos_value );146 else147 return orxonox::Vector2( -sin_value, cos_value );148 }149 150 /**151 @brief Gets the 2D viewing direction (up/down, left/right) to the position of the other object, multiplied with the viewing distance to the object (0° = 0, 180° = 1).152 @param myposition My position153 @param mydirection My viewing direction154 @param myorthonormal My orthonormalvector (pointing upwards through my head)155 @param otherposition The position of the other object156 @return The viewing direction157 158 Examples:159 - If the other object is exactly in front of me, the function returns <tt>Vector2(0, 0)</tt>.160 - If the other object is exactly at my left, the function returns <tt>Vector2(-0.5, 0)</tt>.161 - If the other object is exactly at my right, the function returns <tt>Vector2(0.5, 0)</tt>.162 - If the other object is only a bit at my right, the function still returns <tt>Vector2(0.01, 0)</tt>.163 - If the other object is exactly above me, the function returns <tt>Vector2(0, 0.5)</tt>.164 */165 orxonox::Vector2 get2DViewcoordinates(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition)166 {167 orxonox::Vector3 distance = otherposition - myposition;168 169 // project difference vector on our plane170 orxonox::Vector3 projection = Ogre::Plane(mydirection, myposition).projectVector(distance);171 172 float projectionlength = projection.length();173 if (projectionlength == 0)174 {175 if (myposition.dotProduct(otherposition) >= 0)176 return orxonox::Vector2(0, 0);177 else178 return orxonox::Vector2(0, 1);179 }180 //float angle = acos(clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1));181 182 float cos_value = clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1);183 float sin_value = sqrt( 1 - cos_value*cos_value );184 185 float distancelength = distance.length();186 if (distancelength == 0) return orxonox::Vector2(0, 0);187 float radius = acos(clamp<float>(mydirection.dotProduct(distance) / distancelength, -1, 1)) / math::pi;188 189 if ((mydirection.crossProduct(myorthonormal)).dotProduct(distance) > 0)190 return orxonox::Vector2( sin_value * radius, cos_value * radius);191 else192 return orxonox::Vector2( -sin_value * radius, cos_value * radius);193 }194 195 /**196 @brief Returns the predicted position I have to aim at, if I want to hit a moving target with a moving projectile.197 @param myposition My position198 @param projectilespeed The speed of my projectile199 @param targetposition The position of my target200 @param targetvelocity The velocity of my target201 @return The predicted position202 203 The function predicts the position based on a linear velocity of the target. If the target changes speed or direction, the projectile will miss.204 */205 orxonox::Vector3 getPredictedPosition(const orxonox::Vector3& myposition, float projectilespeed, const orxonox::Vector3& targetposition, const orxonox::Vector3& targetvelocity)206 {207 float squaredProjectilespeed = projectilespeed * projectilespeed;208 orxonox::Vector3 distance = targetposition - myposition;209 float a = distance.squaredLength();210 float b = 2 * (distance.x + distance.y + distance.z) * (targetvelocity.x + targetvelocity.y + targetvelocity.z);211 float c = targetvelocity.squaredLength();212 213 float temp = 4*squaredProjectilespeed*c + a*a - 4*b*c;214 if (temp < 0)215 return orxonox::Vector3::ZERO;216 217 temp = sqrt(temp);218 float time = (temp + a) / (2 * (squaredProjectilespeed - b));219 return (targetposition + targetvelocity * time);220 }221 222 38 /** 223 39 @brief Returns a unique number. This function will never return the same value twice. … … 228 44 return aNumber++; 229 45 } 230 231 232 //////////////////////////233 // Conversion functions //234 //////////////////////////235 236 // std::string to Vector2237 bool ConverterFallback<std::string, orxonox::Vector2>::convert(orxonox::Vector2* output, const std::string& input)238 {239 size_t opening_parenthesis, closing_parenthesis = input.find('}');240 if ((opening_parenthesis = input.find('{')) == std::string::npos)241 opening_parenthesis = 0;242 else243 opening_parenthesis++;244 245 SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis),246 ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');247 if (tokens.size() >= 2)248 {249 if (!convertValue(&(output->x), tokens[0]))250 return false;251 if (!convertValue(&(output->y), tokens[1]))252 return false;253 254 return true;255 }256 return false;257 }258 259 // std::string to Vector3260 bool ConverterFallback<std::string, orxonox::Vector3>::convert(orxonox::Vector3* output, const std::string& input)261 {262 size_t opening_parenthesis, closing_parenthesis = input.find('}');263 if ((opening_parenthesis = input.find('{')) == std::string::npos)264 opening_parenthesis = 0;265 else266 opening_parenthesis++;267 268 SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis),269 ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');270 if (tokens.size() >= 3)271 {272 if (!convertValue(&(output->x), tokens[0]))273 return false;274 if (!convertValue(&(output->y), tokens[1]))275 return false;276 if (!convertValue(&(output->z), tokens[2]))277 return false;278 279 return true;280 }281 return false;282 }283 284 // std::string to Vector4285 bool ConverterFallback<std::string, orxonox::Vector4>::convert(orxonox::Vector4* output, const std::string& input)286 {287 size_t opening_parenthesis, closing_parenthesis = input.find('}');288 if ((opening_parenthesis = input.find('{')) == std::string::npos)289 opening_parenthesis = 0;290 else291 opening_parenthesis++;292 293 SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis),294 ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');295 if (tokens.size() >= 4)296 {297 if (!convertValue(&(output->x), tokens[0]))298 return false;299 if (!convertValue(&(output->y), tokens[1]))300 return false;301 if (!convertValue(&(output->z), tokens[2]))302 return false;303 if (!convertValue(&(output->w), tokens[3]))304 return false;305 306 return true;307 }308 return false;309 }310 311 // std::string to Quaternion312 bool ConverterFallback<std::string, orxonox::Quaternion>::convert(orxonox::Quaternion* output, const std::string& input)313 {314 size_t opening_parenthesis, closing_parenthesis = input.find('}');315 if ((opening_parenthesis = input.find('{')) == std::string::npos)316 opening_parenthesis = 0;317 else318 opening_parenthesis++;319 320 SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');321 if (tokens.size() >= 4)322 {323 if (!convertValue(&(output->w), tokens[0]))324 return false;325 if (!convertValue(&(output->x), tokens[1]))326 return false;327 if (!convertValue(&(output->y), tokens[2]))328 return false;329 if (!convertValue(&(output->z), tokens[3]))330 return false;331 332 return true;333 }334 return false;335 }336 337 // std::string to ColourValue338 bool ConverterFallback<std::string, orxonox::ColourValue>::convert(orxonox::ColourValue* output, const std::string& input)339 {340 size_t opening_parenthesis, closing_parenthesis = input.find('}');341 if ((opening_parenthesis = input.find('{')) == std::string::npos)342 opening_parenthesis = 0;343 else344 opening_parenthesis++;345 346 SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');347 if (tokens.size() >= 3)348 {349 if (!convertValue(&(output->r), tokens[0]))350 return false;351 if (!convertValue(&(output->g), tokens[1]))352 return false;353 if (!convertValue(&(output->b), tokens[2]))354 return false;355 if (tokens.size() >= 4)356 {357 if (!convertValue(&(output->a), tokens[3]))358 return false;359 }360 else361 output->a = 1.0;362 363 return true;364 }365 return false;366 }367 46 } -
sandbox_qt/src/libraries/util/Math.h
r7401 r7421 35 35 @file 36 36 @ingroup Math 37 @brief Declaration and implementation of several math-functions , typedefs of some Ogre::Math classes to the orxonox namespace.37 @brief Declaration and implementation of several math-functions. 38 38 */ 39 39 … … 45 45 #include <string> 46 46 #include <cmath> 47 48 #include <OgreMath.h>49 #include <OgreVector2.h>50 #include <OgreVector3.h>51 #include <OgreVector4.h>52 #include <OgreQuaternion.h>53 #include <OgreColourValue.h>54 47 55 48 // Certain headers might define unwanted macros... … … 83 76 } 84 77 85 #if OGRE_VERSION < 0x01060386 _UtilExport std::ostream& operator<<(std::ostream& out, const orxonox::Radian& radian);87 _UtilExport std::ostream& operator<<(std::ostream& out, const orxonox::Degree& degree);88 #endif89 _UtilExport std::istream& operator>>(std::istream& in, orxonox::Radian& radian);90 _UtilExport std::istream& operator>>(std::istream& in, orxonox::Degree& degree);91 92 _UtilExport float getAngle(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& otherposition);93 _UtilExport orxonox::Vector2 get2DViewdirection(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition);94 _UtilExport orxonox::Vector2 get2DViewcoordinates(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition);95 _UtilExport orxonox::Vector3 getPredictedPosition(const orxonox::Vector3& myposition, float projectilespeed, const orxonox::Vector3& targetposition, const orxonox::Vector3& targetvelocity);96 97 78 /** 98 79 @brief Returns the sign of the given value. … … 177 158 return ((x % max) + max); 178 159 } 179 180 /**181 @brief Returns a "zero" value for the given type.182 @note This is the default template of the zeroise() function. The template is spezialized for each supported type.183 184 The exact return value of the function depends on the type. For @c int this is 0,185 for @c float it's 0.0f. For a @c std::string the function returns "" and for186 @c Vector3 you get <tt>Vector3(0, 0, 0)</tt>.187 */188 template <typename T>189 inline T zeroise()190 {191 // Default, raise a compiler error without including large boost header cascade.192 T temp();193 *********temp; // If you reach this code, you abused zeroise()!194 return temp;195 }196 197 template <> inline char zeroise<char>() { return 0; }198 template <> inline unsigned char zeroise<unsigned char>() { return 0; }199 template <> inline short zeroise<short>() { return 0; }200 template <> inline unsigned short zeroise<unsigned short>() { return 0; }201 template <> inline int zeroise<int>() { return 0; }202 template <> inline unsigned int zeroise<unsigned int>() { return 0; }203 template <> inline long zeroise<long>() { return 0; }204 template <> inline unsigned long zeroise<unsigned long>() { return 0; }205 template <> inline long long zeroise<long long>() { return 0; }206 template <> inline unsigned long long zeroise<unsigned long long>() { return 0; }207 template <> inline float zeroise<float>() { return 0; }208 template <> inline double zeroise<double>() { return 0; }209 template <> inline long double zeroise<long double>() { return 0; }210 template <> inline bool zeroise<bool>() { return 0; }211 template <> inline void* zeroise<void*>() { return 0; }212 template <> inline std::string zeroise<std::string>() { return std::string(); }213 template <> inline orxonox::Radian zeroise<orxonox::Radian>() { return orxonox::Radian(0.0f); }214 template <> inline orxonox::Degree zeroise<orxonox::Degree>() { return orxonox::Degree(0.0f); }215 template <> inline orxonox::Vector2 zeroise<orxonox::Vector2>() { return orxonox::Vector2 (0, 0) ; }216 template <> inline orxonox::Vector3 zeroise<orxonox::Vector3>() { return orxonox::Vector3 (0, 0, 0) ; }217 template <> inline orxonox::Vector4 zeroise<orxonox::Vector4>() { return orxonox::Vector4 (0, 0, 0, 0); }218 template <> inline orxonox::ColourValue zeroise<orxonox::ColourValue>() { return orxonox::ColourValue(0, 0, 0, 0); }219 template <> inline orxonox::Quaternion zeroise<orxonox::Quaternion>() { return orxonox::Quaternion (0, 0, 0, 0); }220 221 /**222 @brief Provides zero value symbols that can be returned as reference223 @see zeroise()224 */225 template <typename T>226 struct NilValue227 {228 inline operator const T&() const229 {230 return value;231 }232 static T value;233 };234 template <typename T>235 T NilValue<T>::value = zeroise<T>();236 160 237 161 /** … … 297 221 298 222 _UtilExport unsigned long getUniqueNumber(); 299 300 /**301 @brief A Vector class containing two integers @a x and @a y.302 */303 class IntVector2304 {305 public:306 IntVector2() : x(0), y(0) { }307 IntVector2(int _x, int _y) : x(_x), y(_y) { }308 int x;309 int y;310 };311 312 /**313 @brief A Vector class containing three integers @a x, @a y, and @a z.314 */315 class IntVector3316 {317 public:318 IntVector3() : x(0), y(0), z(0) { }319 IntVector3(int _x, int _y, int _z) : x(_x), y(_y), z(_z) { }320 int x;321 int y;322 int z;323 };324 223 } 325 224 -
sandbox_qt/src/libraries/util/Singleton.h
r7401 r7421 145 145 146 146 //! Update method called by ClassSingletonManager (if used) 147 void preUpdateSingleton( const Clock& time) { static_cast<T*>(T::singletonPtr_s)->preUpdate(time); }147 void preUpdateSingleton() { static_cast<T*>(T::singletonPtr_s)->preUpdate(); } 148 148 //! Empty update method for the static polymorphism 149 void preUpdate( const Clock& time) { }149 void preUpdate() { } 150 150 //! Update method called by ClassSingletonManager (if used) 151 void postUpdateSingleton( const Clock& time) { static_cast<T*>(T::singletonPtr_s)->postUpdate(time); }151 void postUpdateSingleton() { static_cast<T*>(T::singletonPtr_s)->postUpdate(); } 152 152 //! Empty update method for the static polymorphism 153 void postUpdate( const Clock& time) { }153 void postUpdate() { } 154 154 155 155 protected: -
sandbox_qt/src/libraries/util/StringUtils.cc
r7401 r7421 35 35 36 36 #include <cctype> 37 #include <boost/scoped_array.hpp> 37 #include <QVarLengthArray> 38 #include <QDir> 39 38 40 #include "Convert.h" 39 41 #include "Math.h" … … 493 495 size_t cols = str1.size() + 1; 494 496 size_t rows = str2.size() + 1; 495 boost::scoped_array<int> matrix(new int[rows * cols]);497 QVarLengthArray<int> matrix(rows * cols); 496 498 497 499 for (size_t r = 0; r < rows; ++r) … … 516 518 return matrix[(rows-1)*cols + cols-1]; 517 519 } 520 521 QDir& operator/=(QDir& lhs, const QDir& rhs) 522 { 523 lhs.setPath(lhs.path() + QDir::separator() + rhs.path()); 524 return lhs; 525 } 526 527 QDir& operator/=(QDir& lhs, const QString& rhs) 528 { 529 return operator/=(lhs, QDir(rhs)); 530 } 531 532 QDir operator/(const QDir& lhs, const QDir& rhs) 533 { 534 return (QDir(lhs) /= rhs); 535 } 536 537 QDir operator/(const QDir& lhs, const QString& rhs) 538 { 539 return operator/(lhs, QDir(rhs)); 540 } 518 541 } -
sandbox_qt/src/libraries/util/UtilPrereqs.h
r6417 r7421 59 59 60 60 //----------------------------------------------------------------------- 61 // Enums62 //-----------------------------------------------------------------------63 64 namespace orxonox65 {66 namespace ScopeID67 {68 //!A list of available scopes for the Scope template.69 enum Value70 {71 Root,72 Graphics73 };74 }75 }76 77 //-----------------------------------------------------------------------78 61 // Forward declarations 79 62 //----------------------------------------------------------------------- … … 81 64 namespace orxonox 82 65 { 83 class Clock;84 66 class Exception; 85 class ExprParser;86 class IntVector2;87 class IntVector3;88 class MultiType;89 67 class OutputHandler; 90 68 class OutputListener; 91 template <ScopeID::Value>92 class Scope;93 template <class, ScopeID::Value>94 class ScopedSingleton;95 class ScopeListener;96 class SignalHandler;97 69 template <class T> 98 70 class Singleton; 99 71 class SubString; 100 }101 102 namespace Ogre103 {104 class Radian;105 class Degree;106 class Vector2;107 class Vector3;108 class Vector4;109 class Matrix3;110 class Matrix4;111 class Quaternion;112 class ColourValue;113 }114 namespace orxonox115 {116 using Ogre::Radian;117 using Ogre::Degree;118 using Ogre::Vector2;119 using Ogre::Vector3;120 using Ogre::Vector4;121 using Ogre::Matrix3;122 using Ogre::Matrix4;123 using Ogre::Quaternion;124 using Ogre::ColourValue;125 72 } 126 73 … … 131 78 } 132 79 80 class QDir; 81 class QString; 82 133 83 // Just so you don't have to include StringUtils.h everywhere just for this 134 84 namespace orxonox … … 137 87 } 138 88 89 //----------------------------------------------------------------------- 90 // Functions (implementations in StringUtils.cc) 91 //----------------------------------------------------------------------- 92 93 namespace orxonox 94 { 95 _UtilExport QDir& operator/=(QDir& lhs, const QDir& rhs); 96 _UtilExport QDir& operator/=(QDir& lhs, const QString& rhs); 97 _UtilExport QDir operator/(const QDir& lhs, const QDir& rhs); 98 _UtilExport QDir operator/(const QDir& lhs, const QString& rhs); 99 } 139 100 140 101 #endif /* _UtilPrereqs_H__ */ -
sandbox_qt/src/orxonox-main.vcproj.user.in
r5744 r7421 11 11 <DebugSettings 12 12 WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)" 13 Environment="P ath=${RUNTIME_LIBRARY_DIRECTORY}"13 Environment="PATH=${RUNTIME_LIBRARY_DIRECTORY};%PATH%" 14 14 EnvironmentMerge="true" 15 15 /> … … 20 20 <DebugSettings 21 21 WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)" 22 Environment="P ath=${RUNTIME_LIBRARY_DIRECTORY}"22 Environment="PATH=${RUNTIME_LIBRARY_DIRECTORY};%PATH%" 23 23 EnvironmentMerge="true" 24 24 /> … … 29 29 <DebugSettings 30 30 WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)" 31 Environment="P ath=${RUNTIME_LIBRARY_DIRECTORY}"31 Environment="PATH=${RUNTIME_LIBRARY_DIRECTORY};%PATH%" 32 32 EnvironmentMerge="true" 33 33 /> … … 38 38 <DebugSettings 39 39 WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)" 40 Environment="P ath=${RUNTIME_LIBRARY_DIRECTORY}"40 Environment="PATH=${RUNTIME_LIBRARY_DIRECTORY};%PATH%" 41 41 EnvironmentMerge="true" 42 42 /> -
sandbox_qt/src/orxonox/CMakeLists.txt
r7401 r7421 24 24 25 25 SET_SOURCE_FILES(ORXONOX_SRC_FILES 26 Level.cc27 LevelManager.cc28 26 Main.cc 29 MoodManager.cc30 PawnManager.cc31 PlayerManager.cc32 Radar.cc33 ChatHistory.cc34 ChatInputHandler.cc35 # Test.cc36 COMPILATION_BEGIN SceneCompilation.cc37 CameraManager.cc38 Scene.cc39 COMPILATION_END40 27 ) 41 28 42 ADD_SUBDIRECTORY(collisionshapes) 43 ADD_SUBDIRECTORY(controllers) 44 ADD_SUBDIRECTORY(gamestates) 45 ADD_SUBDIRECTORY(gametypes) 46 ADD_SUBDIRECTORY(graphics) 47 ADD_SUBDIRECTORY(infos) 48 ADD_SUBDIRECTORY(interfaces) 49 ADD_SUBDIRECTORY(items) 50 ADD_SUBDIRECTORY(overlays) 51 ADD_SUBDIRECTORY(pickup) 52 ADD_SUBDIRECTORY(sound) 53 ADD_SUBDIRECTORY(weaponsystem) 54 ADD_SUBDIRECTORY(worldentities) 29 #ADD_SUBDIRECTORY(subdir) 55 30 56 31 ORXONOX_ADD_LIBRARY(orxonox 57 32 FIND_HEADER_FILES 58 TOLUA_FILES59 ChatInputHandler.h60 LevelManager.h61 MoodManager.h62 controllers/HumanController.h63 interfaces/Pickupable.h64 infos/PlayerInfo.h65 sound/SoundManager.h66 PCH_FILE67 OrxonoxPrecompiledHeaders.h68 33 LINK_LIBRARIES 69 ${Boost_FILESYSTEM_LIBRARY} 70 ${Boost_SYSTEM_LIBRARY} # Filesystem dependency 71 ${Boost_THREAD_LIBRARY} 72 ${Boost_DATE_TIME_LIBRARY} # Thread dependency 73 ${OGRE_LIBRARY} 74 ${OPENAL_LIBRARY} 75 ${ALUT_LIBRARY} 76 ${VORBISFILE_LIBRARY} 77 ${VORBIS_LIBRARY} 78 ${OGG_LIBRARY} 79 tinyxml_orxonox 80 tolua_orxonox 81 bullet_orxonox 34 ${QT_QTCORE_LIBRARY} 82 35 util 83 36 core 84 network85 tools86 37 SOURCE_FILES ${ORXONOX_SRC_FILES} 87 38 ) -
sandbox_qt/src/orxonox/Main.cc
r7401 r7421 36 36 #include "OrxonoxPrereqs.h" 37 37 38 #include "core/CommandLineParser.h"39 38 #include "core/Game.h" 40 #include "core/LuaState.h"41 #include "ToluaBindOrxonox.h"42 #include "ToluaBindNetwork.h"43 39 #include "Main.h" 44 45 DeclareToluaInterface(Orxonox);46 DeclareToluaInterface(Network);47 40 48 41 namespace orxonox 49 42 { 50 SetCommandLineSwitch(console).information("Start in console mode (text IO only)");51 SetCommandLineSwitch(server).information("Start in server mode");52 SetCommandLineSwitch(client).information("Start in client mode");53 SetCommandLineSwitch(dedicated).information("Start in dedicated server mode");54 SetCommandLineSwitch(standalone).information("Start in standalone mode");55 SetCommandLineSwitch(dedicatedClient).information("Start in dedicated client mode");56 57 SetCommandLineArgument(generateDoc, "")58 .information("Generates a Doxygen file from things like SetConsoleCommand");59 60 43 /** 61 44 @brief … … 66 49 Game* game = new Game(strCmdLine); 67 50 68 if (CommandLineParser::getValue("generateDoc").getString().empty()) 69 { 70 game->setStateHierarchy( 71 "root" 72 " graphics" 73 " mainMenu" 74 " standalone,server,client" 75 " level" 76 " server,client" 77 " level" 78 ); 79 80 game->requestState("root"); 81 82 // Some development hacks (not really, but in the future, these calls won't make sense anymore) 83 if (CommandLineParser::getValue("standalone").getBool()) 84 Game::getInstance().requestStates("graphics, standalone, level"); 85 else if (CommandLineParser::getValue("server").getBool()) 86 Game::getInstance().requestStates("graphics, server, level"); 87 else if (CommandLineParser::getValue("client").getBool()) 88 Game::getInstance().requestStates("graphics, client, level"); 89 else if (CommandLineParser::getValue("dedicated").getBool()) 90 Game::getInstance().requestStates("server, level"); 91 else if (CommandLineParser::getValue("dedicatedClient").getBool()) 92 Game::getInstance().requestStates("client, level"); 93 else 94 { 95 if (!CommandLineParser::getValue("console").getBool()) 96 Game::getInstance().requestStates("graphics, mainMenu"); 97 } 98 99 game->run(); 100 } 51 //if (CommandLineParser::getValue("generateDoc").getString().empty()) 52 // game->run(); 101 53 102 54 delete game; -
sandbox_qt/src/orxonox/OrxonoxPrereqs.h
r7163 r7421 37 37 38 38 #include "OrxonoxConfig.h" 39 #include "tools/ToolsPrereqs.h"40 39 41 40 //----------------------------------------------------------------------- … … 65 64 namespace orxonox 66 65 { 67 class CameraManager;68 class Level;69 class LevelManager;70 class PawnManager;71 class PlayerManager;72 class Radar;73 class Scene;74 75 // collisionshapes76 class CollisionShape;77 class CompoundCollisionShape;78 class WorldEntityCollisionShape;79 80 // controllers81 class AIController;82 class ArtificialController;83 class Controller;84 class DroneController;85 class HumanController;86 class ScriptController;87 class WaypointController;88 class WaypointPatrolController;89 90 // gametypes91 class Asteroids;92 class Deathmatch;93 class Dynamicmatch;94 class Gametype;95 class TeamBaseMatch;96 class TeamDeathmatch;97 class UnderAttack;98 99 // graphics100 class Backlight;101 class Billboard;102 class BlinkingBillboard;103 class Camera;104 class FadingBillboard;105 class GlobalShader;106 class Light;107 class Model;108 class ParticleEmitter;109 class ParticleSpawner;110 111 // infos112 class Bot;113 class GametypeInfo;114 class HumanPlayer;115 class Info;116 class PlayerInfo;117 118 // interfaces119 class GametypeMessageListener;120 class NotificationListener;121 class Pickupable;122 class PickupCarrier;123 class PlayerTrigger;124 class RadarListener;125 class RadarViewable;126 class Rewardable;127 class TeamColourable;128 129 // items130 class Engine;131 class Item;132 class MultiStateEngine;133 134 // overlays135 class InGameConsole;136 class Map;137 class OrxonoxOverlay;138 class OverlayGroup;139 140 // pickup141 class PickupIdentifier;142 143 //sound144 class AmbientSound;145 class BaseSound;146 class SoundBuffer;147 class SoundManager;148 class SoundStreamer;149 class WorldSound;150 151 // weaponsystem152 class DefaultWeaponmodeLink;153 class Munition;154 class Weapon;155 class WeaponMode;156 class WeaponPack;157 class WeaponSet;158 class WeaponSlot;159 class WeaponSystem;160 161 // worldentities162 class BigExplosion;163 class CameraPosition;164 class ControllableEntity;165 class Drone;166 class EffectContainer;167 class ExplosionChunk;168 class MobileEntity;169 class MovableEntity;170 class SpawnPoint;171 class StaticEntity;172 class TeamSpawnPoint;173 class WorldEntity;174 class Rocket;175 // worldentities, pawns176 class Destroyer;177 class Pawn;178 class SpaceShip;179 class Spectator;180 class TeamBaseMatchBase;181 66 } 182 67 183 // Bullet Physics Engine184 class btTransform;185 class btVector3;186 187 class btRigidBody;188 class btCollisionObject;189 class btGhostObject;190 class btManifoldPoint;191 192 class btCollisionShape;193 class btSphereShape;194 class btCompoundShape;195 class btStaticPlaneShape;196 197 class btDiscreteDynamicsWorld;198 class bt32BitAxisSweep3;199 class btDefaultCollisionConfiguration;200 class btCollisionDispatcher;201 class btSequentialImpulseConstraintSolver;202 203 // ALUT204 typedef struct ALCcontext_struct ALCcontext;205 typedef struct ALCdevice_struct ALCdevice;206 typedef unsigned int ALuint;207 typedef int ALint;208 typedef int ALenum;209 210 68 #endif /* _OrxonoxPrereqs_H__ */
Note: See TracChangeset
for help on using the changeset viewer.