mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-29 12:20:53 +00:00
Changed: Merged in latest API changes to OVQT plugin system.
This commit is contained in:
commit
1336dd5473
12478 changed files with 2915849 additions and 0 deletions
208
.hgignore
Normal file
208
.hgignore
Normal file
|
@ -0,0 +1,208 @@
|
|||
syntax: glob
|
||||
|
||||
# Various build directories
|
||||
bin
|
||||
obj
|
||||
Debug
|
||||
Release
|
||||
ReleaseDebug
|
||||
DebugFast
|
||||
ReleaseDebugStatic
|
||||
DebugFastStatic
|
||||
|
||||
# Test and application directories
|
||||
screenshots
|
||||
release
|
||||
test
|
||||
Temp
|
||||
|
||||
# NeL cache
|
||||
*.packed_sheets
|
||||
|
||||
# Ryzom save
|
||||
save_shard
|
||||
last_loaded_char.bin
|
||||
*.binprim
|
||||
*.string_cache
|
||||
graphs_output
|
||||
default_c
|
||||
|
||||
# Windows compile
|
||||
*.exe
|
||||
*.dll
|
||||
*.lib
|
||||
*.obj
|
||||
|
||||
# Linux compile
|
||||
*.a
|
||||
*.la
|
||||
*.lo
|
||||
*.Po
|
||||
*.Plo
|
||||
*.o
|
||||
*.so
|
||||
*.so.*
|
||||
*_debug
|
||||
core
|
||||
*.pc
|
||||
*.gch
|
||||
|
||||
# Mac OS X compile
|
||||
*.dylib
|
||||
|
||||
# Log dump files
|
||||
report_refused
|
||||
report_failed
|
||||
exception_catched
|
||||
*.stat
|
||||
*.log
|
||||
log.txt
|
||||
|
||||
# Max plugin extensions
|
||||
*.dlx
|
||||
*.dlm
|
||||
*.dlu
|
||||
|
||||
# makeall build
|
||||
.mode_static
|
||||
|
||||
# cmake build files & directories
|
||||
CMakeFiles
|
||||
CMakeCache.txt
|
||||
cmake_install.cmake
|
||||
CTestTestfile.cmake
|
||||
CPackConfig.cmake
|
||||
CPackSourceConfig.cmake
|
||||
.libs
|
||||
|
||||
# Linux garbage
|
||||
Makefile*
|
||||
aclocal.m4
|
||||
config.guess
|
||||
config.sub
|
||||
configure
|
||||
depcomp
|
||||
config.h.in
|
||||
nelconfig.h.in
|
||||
install-sh
|
||||
ltmain.sh
|
||||
missing
|
||||
ylwrap
|
||||
*.mk
|
||||
|
||||
# Visual Studio garbage
|
||||
*.opensdf
|
||||
UpgradeLog*.XML
|
||||
_UpgradeReport_Files
|
||||
BuildLog.htm
|
||||
mt.dep
|
||||
ipch
|
||||
*.suo
|
||||
*.ncb
|
||||
*.user
|
||||
*.ilk
|
||||
*.pdb
|
||||
*.aps
|
||||
*.exp
|
||||
*.idb
|
||||
*.sdf
|
||||
|
||||
# Mac OS X garbage
|
||||
.DS_Store
|
||||
|
||||
# Ryzom server garbage
|
||||
aes_alias_name.cfg
|
||||
aes_nagios_report.txt
|
||||
aes_state.txt
|
||||
*.launch_ctrl
|
||||
*.state
|
||||
*.start_count
|
||||
|
||||
# Vim and kwrite cache
|
||||
*~
|
||||
|
||||
# Kdevelop4 garbage
|
||||
*.kdev4
|
||||
.kdev4
|
||||
|
||||
# Python cache
|
||||
*.pyd
|
||||
*.pyc
|
||||
|
||||
# Qt compiler
|
||||
moc_*.cpp
|
||||
*.moc
|
||||
|
||||
# Misc garbage
|
||||
*.rej
|
||||
*.orig
|
||||
*.cachefile
|
||||
*.cache
|
||||
*.patch
|
||||
*.7z
|
||||
external
|
||||
external_stlport
|
||||
3rdParty
|
||||
.svn
|
||||
|
||||
# build
|
||||
code/nel/build/*
|
||||
code/nelns/build/*
|
||||
code/snowballs/build/*
|
||||
code/ryzom/build/*
|
||||
code/build/*
|
||||
build/*
|
||||
install/*
|
||||
|
||||
# Linux nel compile
|
||||
code/nel/build/nel-config
|
||||
code/nel/config.status
|
||||
code/nel/include/nelconfig.h
|
||||
code/nel/include/stamp-h1
|
||||
code/nel/libtool
|
||||
code/nel/nel-config
|
||||
code/nel/samples/3d/cluster_viewer/cluster_viewer
|
||||
code/nel/samples/3d/font/font
|
||||
code/nel/samples/georges/georges
|
||||
code/nel/samples/misc/command/command
|
||||
code/nel/samples/misc/configfile/configfile
|
||||
code/nel/samples/misc/debug/debug
|
||||
code/nel/samples/misc/i18n/i18n
|
||||
code/nel/samples/misc/log/log
|
||||
code/nel/samples/misc/strings/strings
|
||||
code/nel/samples/net/chat/chatclient
|
||||
code/nel/samples/net/chat/chatserver
|
||||
code/nel/samples/net/login_system/nls_frontend_service
|
||||
code/nel/samples/net/login_system/nls_login_client
|
||||
code/nel/samples/net/udp/udp_bench_client
|
||||
code/nel/samples/net/udp/udp_bench_service
|
||||
code/nel/samples/pacs/pacs_sample
|
||||
code/nel/tools/3d/build_coarse_mesh/build_coarse_mesh
|
||||
code/nel/tools/3d/build_far_bank/build_far_bank
|
||||
code/nel/tools/3d/build_smallbank/build_smallbank
|
||||
code/nel/tools/3d/ig_lighter/ig_lighter
|
||||
code/nel/tools/3d/zone_dependencies/zone_dependencies
|
||||
code/nel/tools/3d/zone_ig_lighter/zone_ig_lighter
|
||||
code/nel/tools/3d/zone_lighter/zone_lighter
|
||||
code/nel/tools/3d/zone_welder/zone_welder
|
||||
code/nel/tools/misc/bnp_make/bnp_make
|
||||
code/nel/tools/misc/disp_sheet_id/disp_sheet_id
|
||||
code/nel/tools/misc/make_sheet_id/make_sheet_id
|
||||
code/nel/tools/misc/xml_packer/xml_packer
|
||||
code/nel/tools/pacs/build_ig_boxes/build_ig_boxes
|
||||
code/nel/tools/pacs/build_indoor_rbank/build_indoor_rbank
|
||||
code/nel/tools/pacs/build_rbank/build_rbank
|
||||
code/ryzom/common/data_leveldesign/leveldesign/game_element/xp_table/skills.skill_tree
|
||||
code/ryzom/common/data_leveldesign/leveldesign/game_element/xp_table/xptable.xp_table
|
||||
code/ryzom/tools/server/sql/ryzom_admin_default_data.sql
|
||||
|
||||
# Linux server compile
|
||||
code/ryzom/server/src/entities_game_service/entities_game_service
|
||||
code/ryzom/server/src/frontend_service/frontend_service
|
||||
code/ryzom/server/src/gpm_service/gpm_service
|
||||
code/ryzom/server/src/input_output_service/input_output_service
|
||||
code/ryzom/server/src/mirror_service/mirror_service
|
||||
code/ryzom/server/src/ryzom_admin_service/ryzom_admin_service
|
||||
code/ryzom/server/src/ryzom_naming_service/ryzom_naming_service
|
||||
code/ryzom/server/src/ryzom_welcome_service/ryzom_welcome_service
|
||||
code/ryzom/server/src/tick_service/tick_service
|
297
code/CMakeLists.txt
Normal file
297
code/CMakeLists.txt
Normal file
|
@ -0,0 +1,297 @@
|
|||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# NeL
|
||||
# Authors: Nevrax and the NeL Community
|
||||
# Version: 0.8.0
|
||||
#
|
||||
# Notes:
|
||||
# * Changing install location: add -DCMAKE_INSTALL_PREFIX:PATH=/my/new/path
|
||||
# * Changing specific install location variables:
|
||||
# * NL_ETC_PREFIX (default: $CMAKE_INSTALL_PREFIX/etc)
|
||||
# * NL_SHARE_PREFIX (default: $CMAKE_INSTALL_PREFIX/share)
|
||||
# * NL_BIN_PREFIX (default: $CMAKE_INSTALL_PREFIX/bin)
|
||||
# * NL_SBIN_PREFIX (default: $CMAKE_INSTALL_PREFIX/sbin)
|
||||
# * NL_LIB_PREFIX (default: $CMAKE_INSTALL_PREFIX/lib)
|
||||
# * NL_DRIVER_PREFIX (default: $CMAKE_INSTALL_PREFIX/lib (windows) or $CMAKE_INSTALL_PREFIX/lib/nel)
|
||||
# * Enable building of documentation: add -DBUILD_DOCUMENTATION:BOOL=ON - new make target: DoxygenDoc
|
||||
# * Updating version: update header (above) but also update NL_VERSION below.
|
||||
# * To build binary archive, use the 'package' target.
|
||||
# To build source archive, use the 'package_source' target.
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Load some macros.
|
||||
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
|
||||
#-----------------------------------------------------------------------------
|
||||
# Set CMake 2.6 Policies.
|
||||
IF(COMMAND cmake_policy)
|
||||
# Works around warnings libraries linked against that don't
|
||||
# have absolute paths (e.g. -lpthread)
|
||||
cmake_policy(SET CMP0003 NEW)
|
||||
|
||||
# Works around warnings about escaped quotes in ADD_DEFINITIONS
|
||||
# statements
|
||||
cmake_policy(SET CMP0005 OLD)
|
||||
ENDIF(COMMAND cmake_policy)
|
||||
|
||||
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/nel.cmake)
|
||||
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/ConfigureChecks.cmake)
|
||||
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/CheckDepends.cmake)
|
||||
INCLUDE(${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL)
|
||||
|
||||
# Force out of source builds.
|
||||
CHECK_OUT_OF_SOURCE()
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||
PROJECT(RyzomCore CXX C)
|
||||
SET(NL_VERSION_MAJOR 0)
|
||||
SET(NL_VERSION_MINOR 8)
|
||||
SET(NL_VERSION_PATCH 0)
|
||||
SET(NL_VERSION "${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}.${NL_VERSION_PATCH}")
|
||||
|
||||
NL_SETUP_BUILD()
|
||||
NL_SETUP_BUILD_FLAGS()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Redirect output files
|
||||
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
|
||||
# DLL should be in the same directory as EXE under Windows
|
||||
IF(WIN32)
|
||||
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
ELSE(WIN32)
|
||||
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
ENDIF(WIN32)
|
||||
|
||||
IF(WIN32)
|
||||
IF(WITH_MFC)
|
||||
FIND_PACKAGE(MFC QUIET)
|
||||
ENDIF(WITH_MFC)
|
||||
|
||||
IF(NOT DEFINED ENV{QTDIR})
|
||||
SET(ENV{QTDIR} "c:/qt/4.6.3")
|
||||
ENDIF(NOT DEFINED ENV{QTDIR})
|
||||
ENDIF(WIN32)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Set default config options
|
||||
#
|
||||
NL_SETUP_DEFAULT_OPTIONS()
|
||||
NL_SETUP_NEL_DEFAULT_OPTIONS()
|
||||
NL_SETUP_NELNS_DEFAULT_OPTIONS()
|
||||
NL_SETUP_RYZOM_DEFAULT_OPTIONS()
|
||||
NL_SETUP_SNOWBALLS_DEFAULT_OPTIONS()
|
||||
|
||||
NL_SETUP_PREFIX_PATHS()
|
||||
RYZOM_SETUP_PREFIX_PATHS()
|
||||
|
||||
NL_CONFIGURE_CHECKS()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#Platform specifics
|
||||
|
||||
IF(WIN32)
|
||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake)
|
||||
SET(WINSOCK2_LIB ws2_32.lib)
|
||||
|
||||
FIND_PACKAGE(External REQUIRED)
|
||||
|
||||
IF(${CMAKE_MAKE_PROGRAM} MATCHES "Common7")
|
||||
# convert IDE fullpath to VC++ path
|
||||
STRING(REGEX REPLACE "Common7/IDE/.+" "VC" VC_DIR ${CMAKE_MAKE_PROGRAM})
|
||||
ELSE(${CMAKE_MAKE_PROGRAM} MATCHES "Common7")
|
||||
IF(${CMAKE_CXX_COMPILER} MATCHES "VC")
|
||||
# convert compiler fullpath to VC++ path
|
||||
STRING(REGEX REPLACE "VC/bin/.+" "VC" VC_DIR ${CMAKE_CXX_COMPILER})
|
||||
ELSE(${CMAKE_CXX_COMPILER} MATCHES "VC")
|
||||
# Hack for Visual C++ 2010
|
||||
GET_FILENAME_COMPONENT(VC_ROOT_PATH "[HKEY_CURRENT_USER\\Software\\Microsoft\\VCExpress\\10.0_Config;InstallDir]" ABSOLUTE)
|
||||
# convert IDE fullpath to VC++ path
|
||||
STRING(REGEX REPLACE "Common7/.*" "VC" VC_DIR ${VC_ROOT_PATH})
|
||||
ENDIF(${CMAKE_CXX_COMPILER} MATCHES "VC")
|
||||
ENDIF(${CMAKE_MAKE_PROGRAM} MATCHES "Common7")
|
||||
|
||||
IF(WITH_MFC)
|
||||
FIND_PACKAGE(CustomMFC REQUIRED)
|
||||
ENDIF(WITH_MFC)
|
||||
ENDIF(WIN32)
|
||||
|
||||
FIND_PACKAGE(Threads REQUIRED)
|
||||
FIND_PACKAGE(LibXml2 REQUIRED)
|
||||
FIND_PACKAGE(PNG REQUIRED)
|
||||
FIND_PACKAGE(Jpeg)
|
||||
|
||||
IF(WITH_STATIC)
|
||||
# libxml2 could need winsock2 library
|
||||
SET(LIBXML2_DEFINITIONS ${LIBXML2_DEFINITIONS} -DLIBXML_STATIC)
|
||||
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${WINSOCK2_LIB})
|
||||
|
||||
# on Mac OS X libxml2 requieres iconv
|
||||
IF(APPLE)
|
||||
FIND_PACKAGE(Iconv REQUIRED)
|
||||
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${ICONV_LIBRARIES})
|
||||
ENDIF(APPLE)
|
||||
ENDIF(WITH_STATIC)
|
||||
|
||||
IF(WITH_STLPORT)
|
||||
FIND_PACKAGE(STLport REQUIRED)
|
||||
INCLUDE_DIRECTORIES(${STLPORT_INCLUDE_DIR})
|
||||
IF(WIN32)
|
||||
SET(VC_INCLUDE_DIR "${VC_DIR}/include")
|
||||
|
||||
FIND_PACKAGE(WindowsSDK REQUIRED)
|
||||
# use VC++ and Windows SDK include paths
|
||||
INCLUDE_DIRECTORIES(${VC_INCLUDE_DIR} ${WINSDK_INCLUDE_DIR})
|
||||
ENDIF(WIN32)
|
||||
ENDIF(WITH_STLPORT)
|
||||
|
||||
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/PCHSupport.cmake)
|
||||
|
||||
IF(FINAL_VERSION)
|
||||
ADD_DEFINITIONS(-DFINAL_VERSION=1)
|
||||
ENDIF(FINAL_VERSION)
|
||||
|
||||
IF(WITH_QT)
|
||||
FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtXml REQUIRED)
|
||||
ENDIF(WITH_QT)
|
||||
|
||||
IF(WITH_NEL)
|
||||
IF(WITH_NEL_TESTS)
|
||||
FIND_PACKAGE(CppTest)
|
||||
ENDIF(WITH_NEL_TESTS)
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/nel/include ${LIBXML2_INCLUDE_DIR})
|
||||
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})
|
||||
ADD_SUBDIRECTORY(nel)
|
||||
ENDIF(WITH_NEL)
|
||||
|
||||
IF(WITH_RYZOM)
|
||||
ADD_SUBDIRECTORY(ryzom)
|
||||
ENDIF(WITH_RYZOM)
|
||||
|
||||
IF(WITH_NELNS)
|
||||
# ADD_SUBDIRECTORY(nelns)
|
||||
ENDIF(WITH_NELNS)
|
||||
|
||||
IF(WITH_SNOWBALLS)
|
||||
# ADD_SUBDIRECTORY(snowballs2)
|
||||
ENDIF(WITH_SNOWBALLS)
|
||||
|
||||
IF(WITH_TOOLS)
|
||||
ADD_SUBDIRECTORY(tool)
|
||||
ENDIF(WITH_TOOLS)
|
||||
|
||||
# To build the documention, you will have to enable it
|
||||
# and then do the equivalent of "make DoxygenDoc".
|
||||
IF(BUILD_DOCUMENTATION)
|
||||
IF(DOT)
|
||||
SET(HAVE_DOT YES)
|
||||
ELSE(DOT)
|
||||
SET(HAVE_DOT NO)
|
||||
ENDIF(DOT)
|
||||
# This processes our Doxyfile.in and substitutes paths to generate
|
||||
# a final Doxyfile
|
||||
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/doc/Doxyfile.cmake.in ${CMAKE_BINARY_DIR}/doc/Doxyfile)
|
||||
|
||||
ADD_CUSTOM_TARGET(DoxygenDoc ${DOXYGEN} ${CMAKE_BINARY_DIR}/doc/Doxyfile)
|
||||
ENDIF(BUILD_DOCUMENTATION)
|
||||
|
||||
IF(WITH_NEL_TESTS)
|
||||
ENABLE_TESTING()
|
||||
ADD_TEST(nel_unit_test ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/nel_unit_test --html)
|
||||
IF(BUILD_DASHBOARD)
|
||||
INCLUDE(Dart)
|
||||
SET(SVNCOMMAND svn)
|
||||
SET(SVNSOURCEDIR http://dev.ryzom.com/svn/trunk/nel)
|
||||
SET(GENERATELOGS svn2cl)
|
||||
ENDIF(BUILD_DASHBOARD)
|
||||
ENDIF(WITH_NEL_TESTS)
|
||||
|
||||
# packaging information
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "NeL MMORPG Framework")
|
||||
SET(CPACK_PACKAGE_VENDOR "NeL")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_SOURCE_DIR}/README)
|
||||
SET(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/COPYING)
|
||||
SET(CPACK_PACKAGE_VERSION_MAJOR "${NL_VERSION_MAJOR}")
|
||||
SET(CPACK_PACKAGE_VERSION_MINOR "${NL_VERSION_MINOR}")
|
||||
SET(CPACK_PACKAGE_VERSION_PATCH "${NL_VERSION_PATCH}")
|
||||
SET(CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_BINARY_DIR};NeL;ALL;/")
|
||||
SET(CPACK_PACKAGE_EXECUTABLES "nel${NL_VERSION}" "nel")
|
||||
|
||||
# NSIS Specific Packing Setup
|
||||
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "NeL")
|
||||
SET(CPACK_NSIS_MODIFY_PATH "ON")
|
||||
SET(CPACK_NSIS_MUI_ICON ${CMAKE_SOURCE_DIR}/resources/nevraxpill.ico)
|
||||
SET(CPACK_NSIS_MUI_UNIICON ${CMAKE_SOURCE_DIR}/resources/nevraxpill.ico)
|
||||
SET(CPACK_PACKAGE_ICON ${CMAKE_SOURCE_DIR}/resources\\\\nel.bmp)
|
||||
SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} NeL")
|
||||
SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\dev.ryzom.com")
|
||||
SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\dev.ryzom.com\\\\projects\\\\nel\\\\wiki")
|
||||
SET(CPACK_NSIS_CONTACT "matt.raykowski@gmail.com")
|
||||
|
||||
## Source Packages
|
||||
SET(CPACK_PACKAGE_FILE_NAME "nel-${NL_VERSION}")
|
||||
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "nel-${NL_VERSION}")
|
||||
IF(WIN32)
|
||||
#SET(CPACK_GENERATOR "NSIS")
|
||||
SET(CPACK_GENERATOR "NSIS;ZIP")
|
||||
SET(CPACK_SOURCE_GENERATOR "ZIP")
|
||||
ELSE(WIN32)
|
||||
SET(CPACK_GENERATOR "TGZ")
|
||||
SET(CPACK_SOURCE_GENERATOR "TGZ")
|
||||
ENDIF(WIN32)
|
||||
set(CPACK_SOURCE_IGNORE_FILES
|
||||
"~$"
|
||||
"\\\\.cvsignore$"
|
||||
"^${CMAKE_SOURCE_DIR}.*/CVS/"
|
||||
"^${CMAKE_SOURCE_DIR}.*/\\\\.svn/"
|
||||
"^${CMAKE_SOURCE_DIR}/debian/"
|
||||
"^${CMAKE_SOURCE_DIR}/old/")
|
||||
IF(WIN32)
|
||||
IF(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
SET(CMAKE_INSTALL_DEBUG_LIBRARIES TRUE)
|
||||
IF(WITH_QT)
|
||||
INCLUDE(${QT_USE_FILE})
|
||||
INSTALL(FILES
|
||||
"${QT_LIBRARY_DIR}/../bin/QtGuid4.dll"
|
||||
"${QT_LIBRARY_DIR}/../bin/QtXmld4.dll"
|
||||
"${QT_LIBRARY_DIR}/../bin/QtCored4.dll"
|
||||
DESTINATION bin)
|
||||
ENDIF(WITH_QT)
|
||||
ELSE(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
IF(WITH_QT)
|
||||
INCLUDE(${QT_USE_FILE})
|
||||
INSTALL(FILES
|
||||
"${QT_LIBRARY_DIR}/../bin/QtGui4.dll"
|
||||
"${QT_LIBRARY_DIR}/../bin/QtXml4.dll"
|
||||
"${QT_LIBRARY_DIR}/../bin/QtCore4.dll"
|
||||
DESTINATION bin)
|
||||
ENDIF(WITH_QT)
|
||||
ENDIF(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
|
||||
# Install CEGUI and its dependencies.
|
||||
IF(WITH_NEL_CEGUI)
|
||||
INSTALL(FILES "${CEGUI_LIB_DIR}/CEGUIBase.dll" DESTINATION bin)
|
||||
INSTALL(FILES "${CEGUI_LIB_DIR}/CEGUIDevilImageCodec.dll" DESTINATION bin)
|
||||
INSTALL(FILES "${CEGUI_LIB_DIR}/CEGUIExpatParser.dll" DESTINATION bin)
|
||||
INSTALL(FILES "${CEGUI_LIB_DIR}/CEGUIFalagardWRBase.dll" DESTINATION bin)
|
||||
INSTALL(FILES "${CEGUI_LIB_DIR}/Devil.dll" DESTINATION bin)
|
||||
INSTALL(FILES "${CEGUI_LIB_DIR}/ILU.dll" DESTINATION bin)
|
||||
ENDIF(WITH_NEL_CEGUI)
|
||||
|
||||
# Only the tools require MFC.
|
||||
IF(WITH_TOOLS)
|
||||
SET(CMAKE_INSTALL_MFC_LIBRARIES TRUE)
|
||||
ENDIF(WITH_TOOLS)
|
||||
INCLUDE(InstallRequiredSystemLibraries)
|
||||
ENDIF(WIN32)
|
||||
|
||||
INCLUDE(CPack)
|
||||
|
||||
INCLUDE(CMakePackaging.txt)
|
||||
|
||||
## Debian Packages
|
||||
#INCLUDE(UseDebian)
|
||||
#IF(DEBIAN_FOUND)
|
||||
# ADD_DEBIAN_TARGETS(nel)
|
||||
#ENDIF(DEBIAN_FOUND)
|
138
code/CMakeModules/CheckDepends.cmake
Normal file
138
code/CMakeModules/CheckDepends.cmake
Normal file
|
@ -0,0 +1,138 @@
|
|||
# Macros to check if a library needs to be manually linked to another one
|
||||
# because it's using a symbol from it but it's not linked to
|
||||
|
||||
# CHECK_UNDEFINED_SYMBOL
|
||||
# Macro to check if a library is calling an undefined symbol
|
||||
#
|
||||
# Syntax:
|
||||
# CHECK_UNDEFINED_SYMBOL(MYLIBRARY SYMBOL SYMBOL_FOUND)
|
||||
# SYMBOL_FOUND will be set to TRUE if UNDEFINED
|
||||
#
|
||||
# Example:
|
||||
# CHECK_UNDEFINED_SYMBOL(PNG_LIBRARY inflate INFLATE_FOUND)
|
||||
#
|
||||
MACRO(CHECK_UNDEFINED_SYMBOL MYLIBRARY SYMBOL SYMBOL_FOUND)
|
||||
SET(${SYMBOL_FOUND} TRUE)
|
||||
IF(WIN32)
|
||||
# Always TRUE under Windows because we are using static libraries
|
||||
ELSEIF(APPLE)
|
||||
SET(CMAKE_NM nm)
|
||||
IF(CMAKE_NM)
|
||||
# Use nm to check if a library is using an external symbol
|
||||
EXEC_PROGRAM(${CMAKE_NM} ARGS "-gu ${${MYLIBRARY}} | grep ${SYMBOL}" OUTPUT_VARIABLE NM_SYMBOL)
|
||||
# MESSAGE(STATUS "Checking for undefined symbol ${SYMBOL} in ${${MYLIBRARY}}")
|
||||
IF(NOT NM_SYMBOL MATCHES ${SYMBOL})
|
||||
SET(${SYMBOL_FOUND} FALSE)
|
||||
# MESSAGE(STATUS "Defined symbol ${SYMBOL} detected in ${${MYLIBRARY}}")
|
||||
ENDIF(NOT NM_SYMBOL MATCHES ${SYMBOL})
|
||||
ENDIF(CMAKE_NM)
|
||||
ELSEIF(UNIX)
|
||||
SET(CMAKE_OBJDUMP objdump)
|
||||
IF(CMAKE_OBJDUMP)
|
||||
# Use objdump to check if a library is using an external symbol
|
||||
#MESSAGE(STATUS "exec ${CMAKE_OBJDUMP} -T ${${MYLIBRARY}} | grep ${SYMBOL}")
|
||||
EXEC_PROGRAM(${CMAKE_OBJDUMP} ARGS "-T ${${MYLIBRARY}} | grep ${SYMBOL}" OUTPUT_VARIABLE OBJDUMP_SYMBOL)
|
||||
IF(NOT OBJDUMP_SYMBOL MATCHES "UND")
|
||||
#MESSAGE(STATUS "${${MYLIBRARY}} does not use symbol ${SYMBOL}")
|
||||
SET(${SYMBOL_FOUND} FALSE)
|
||||
ELSE(NOT OBJDUMP_SYMBOL MATCHES "UND")
|
||||
#MESSAGE(STATUS "${${MYLIBRARY}} uses symbol ${SYMBOL}")
|
||||
ENDIF(NOT OBJDUMP_SYMBOL MATCHES "UND")
|
||||
ENDIF(CMAKE_OBJDUMP)
|
||||
ENDIF(WIN32)
|
||||
ENDMACRO(CHECK_UNDEFINED_SYMBOL)
|
||||
|
||||
# CHECK_LINKED_LIBRARY
|
||||
# Macro to check if a library is linked to another one
|
||||
#
|
||||
# Syntax:
|
||||
# CHECK_LINKED_LIBRARY(MYLIBRARY OTHERLIBRARY LIBRARY_FOUND)
|
||||
# LIBRARY_FOUND will be set to TRUE if LINKED
|
||||
#
|
||||
# Example:
|
||||
# CHECK_LINKED_LIBRARY(PNG_LIBRARY ZLIB_LIBRARY ZLIB_FOUND)
|
||||
#
|
||||
MACRO(CHECK_LINKED_LIBRARY MYLIBRARY OTHERLIBRARY LIBRARY_FOUND)
|
||||
SET(${LIBRARY_FOUND} FALSE)
|
||||
IF(WIN32)
|
||||
# Always FALSE under Windows because we are using static libraries
|
||||
ELSEIF(APPLE)
|
||||
SET(CMAKE_OTOOL otool)
|
||||
IF(CMAKE_OTOOL)
|
||||
# Use otool to check if a library is linked to another library
|
||||
GET_FILENAME_COMPONENT(LIBNAME "${${OTHERLIBRARY}}" NAME_WE)
|
||||
EXEC_PROGRAM(${CMAKE_OTOOL} ARGS "-L ${${MYLIBRARY}} | grep ${LIBNAME}" OUTPUT_VARIABLE OTOOL_LIBRARY)
|
||||
# MESSAGE(STATUS "Checking if ${LIBNAME} is linked to ${${MYLIBRARY}}")
|
||||
IF(OTOOL_LIBRARY MATCHES "${LIBNAME}")
|
||||
SET(${LIBRARY_FOUND} TRUE)
|
||||
# MESSAGE(STATUS "Library ${LIBNAME} already linked to ${${MYLIBRARY}}")
|
||||
ENDIF(OTOOL_LIBRARY MATCHES "${LIBNAME}")
|
||||
ENDIF(CMAKE_OTOOL)
|
||||
ELSEIF(UNIX)
|
||||
SET(CMAKE_OBJDUMP objdump)
|
||||
IF(CMAKE_OBJDUMP)
|
||||
GET_FILENAME_COMPONENT(LIBNAME "${${OTHERLIBRARY}}" NAME)
|
||||
# TODO: under Solaris use dump -Lv <lib>
|
||||
# Use objdump to check if a library is linked to another library
|
||||
#MESSAGE(STATUS "exec ${CMAKE_OBJDUMP} -p ${${MYLIBRARY}} | grep ${LIBNAME}")
|
||||
EXEC_PROGRAM(${CMAKE_OBJDUMP} ARGS "-p ${${MYLIBRARY}} | grep ${LIBNAME}" OUTPUT_VARIABLE OBJDUMP_LIBRARY)
|
||||
IF(OBJDUMP_LIBRARY MATCHES "NEEDED")
|
||||
#MESSAGE(STATUS "${${MYLIBRARY}} references to ${LIBNAME}.")
|
||||
SET(${LIBRARY_FOUND} TRUE)
|
||||
ELSE(OBJDUMP_LIBRARY MATCHES "NEEDED")
|
||||
#MESSAGE(STATUS "${${MYLIBRARY}} does not reference to ${LIBNAME}!")
|
||||
ENDIF(OBJDUMP_LIBRARY MATCHES "NEEDED")
|
||||
ENDIF(CMAKE_OBJDUMP)
|
||||
ENDIF(WIN32)
|
||||
ENDMACRO(CHECK_LINKED_LIBRARY)
|
||||
|
||||
MACRO(CHECK_DEPENDS MYLIBRARY OTHERLIBRARY SYMBOL MUSTLINK)
|
||||
CHECK_UNDEFINED_SYMBOL(MYLIBRARY SYMBOL SYMBOL_FOUND)
|
||||
|
||||
IF(SYMBOL_FOUND)
|
||||
CHECK_LINKED_LIBRARY(MYLIBRARY OTHERLIBRARY LIBRARY_FOUND)
|
||||
ENDIF(SYMBOL_FOUND)
|
||||
|
||||
IF(SYMBOL_FOUND AND NOT LIBRARY_FOUND)
|
||||
SET(${MUSTLINK} YES)
|
||||
ELSE(SYMBOL_FOUND AND NOT LIBRARY_FOUND)
|
||||
SET(${MUSTLINK} NO)
|
||||
ENDIF(SYMBOL_FOUND AND NOT LIBRARY_FOUND)
|
||||
ENDMACRO(CHECK_DEPENDS)
|
||||
|
||||
# LINK_DEPENDS
|
||||
# Macro to link a library if a symbol is used but is not already linked to it
|
||||
#
|
||||
# Syntax:
|
||||
# LINK_DEPENDS(LIBRARIES MYLIBRARY OTHERLIBRARY SYMBOL)
|
||||
# OTHERLIBRARY_LINKED will be set to TRUE or FALSE
|
||||
#
|
||||
# Example:
|
||||
# LINK_DEPENDS(PNG_LIBRARIES PNG_LIBRARY ZLIB_LIBRARY inflate)
|
||||
#
|
||||
MACRO(LINK_DEPENDS LIBRARIES MYLIBRARY OTHERLIBRARY SYMBOL)
|
||||
SET(MUST_LINK FALSE)
|
||||
IF(${MYLIBRARY} AND ${OTHERLIBRARY} AND NOT ${OTHERLIBRARY}_LINKED)
|
||||
IF(WIN32 OR WITH_STATIC)
|
||||
# In static, we link all libraries because it will keep only used symbols
|
||||
SET(MUST_LINK TRUE)
|
||||
ELSE(WIN32 OR WITH_STATIC)
|
||||
CHECK_UNDEFINED_SYMBOL(${MYLIBRARY} ${SYMBOL} SYMBOL_FOUND)
|
||||
|
||||
IF(SYMBOL_FOUND)
|
||||
CHECK_LINKED_LIBRARY(${MYLIBRARY} ${OTHERLIBRARY} LIBRARY_FOUND)
|
||||
ENDIF(SYMBOL_FOUND)
|
||||
|
||||
IF(SYMBOL_FOUND AND NOT LIBRARY_FOUND)
|
||||
MESSAGE(STATUS "Underlinking found: ${${MYLIBRARY}} needs ${${OTHERLIBRARY}} but is not linked to, manually linking...")
|
||||
SET(MUST_LINK TRUE)
|
||||
ENDIF(SYMBOL_FOUND AND NOT LIBRARY_FOUND)
|
||||
ENDIF(WIN32 OR WITH_STATIC)
|
||||
ENDIF(${MYLIBRARY} AND ${OTHERLIBRARY} AND NOT ${OTHERLIBRARY}_LINKED)
|
||||
IF(MUST_LINK)
|
||||
MESSAGE(STATUS "Linking with ${${OTHERLIBRARY}}")
|
||||
SET(${LIBRARIES} ${${LIBRARIES}} ${${OTHERLIBRARY}})
|
||||
SET(${OTHERLIBRARY}_LINKED TRUE)
|
||||
ENDIF(MUST_LINK)
|
||||
ENDMACRO(LINK_DEPENDS)
|
||||
|
79
code/CMakeModules/ConfigureChecks.cmake
Normal file
79
code/CMakeModules/ConfigureChecks.cmake
Normal file
|
@ -0,0 +1,79 @@
|
|||
MACRO(NL_CONFIGURE_CHECKS)
|
||||
INCLUDE(CheckIncludeFiles)
|
||||
INCLUDE(CheckFunctionExists)
|
||||
INCLUDE(CheckLibraryExists)
|
||||
INCLUDE(CheckTypeSize)
|
||||
|
||||
CHECK_INCLUDE_FILES ("execinfo.h" HAVE_EXECINFO_H)
|
||||
CHECK_INCLUDE_FILES ("stdint.h" HAVE_STDINT_H)
|
||||
CHECK_INCLUDE_FILES ("sys/types.h" HAVE_SYS_TYPES_H)
|
||||
CHECK_INCLUDE_FILES ("inttypes.h" HAVE_INTTYPES_H)
|
||||
CHECK_INCLUDE_FILES ("unistd.h" HAVE_UNISTD_H)
|
||||
CHECK_INCLUDE_FILES ("utime.h" HAVE_UTIME_H)
|
||||
|
||||
CHECK_INCLUDE_FILES ("dl.h" HAVE_DL_H)
|
||||
CHECK_INCLUDE_FILES ("limits.h" HAVE_LIMITS_H)
|
||||
CHECK_INCLUDE_FILES ("malloc.h" HAVE_MALLOC_H)
|
||||
CHECK_INCLUDE_FILES ("sys/param.h" HAVE_SYS_PARAM_H)
|
||||
CHECK_INCLUDE_FILES ("sys/param.h;sys/mount.h" HAVE_SYS_MOUNT_H)
|
||||
CHECK_INCLUDE_FILES ("sys/statvfs.h" HAVE_SYS_STATVFS_H)
|
||||
|
||||
CHECK_INCLUDE_FILES ("pthread.h" HAVE_PTHREAD)
|
||||
|
||||
CHECK_TYPE_SIZE("size_t" SIZEOF_SIZE_T)
|
||||
#if (NOT HAVE_SIZEOF_SIZE_T)
|
||||
# MESSAGE(FATAL_ERROR "size_t is not present on this architecture - aborting")
|
||||
#endif (NOT HAVE_SIZEOF_SIZE_T)
|
||||
MESSAGE(STATUS "DEBUG size_t is ${SIZEOF_SIZE_T}")
|
||||
|
||||
CHECK_TYPE_SIZE("off_t" SIZEOF_OFF_T)
|
||||
MESSAGE(STATUS "DEBUG off_t is ${SIZEOF_OFF_T}")
|
||||
|
||||
CHECK_FUNCTION_EXISTS("backtrace" HAVE_BACKTRACE)
|
||||
CHECK_FUNCTION_EXISTS("getsockname" HAVE_GETSOCKNAME)
|
||||
CHECK_FUNCTION_EXISTS("inet_ntoa" HAVE_INET_NTOA)
|
||||
CHECK_FUNCTION_EXISTS("inet_ntop" HAVE_INET_NTOP)
|
||||
CHECK_FUNCTION_EXISTS("inet_pton" HAVE_INET_PTON)
|
||||
CHECK_FUNCTION_EXISTS("regcomp" HAVE_REGCOMP)
|
||||
CHECK_FUNCTION_EXISTS("strerror" HAVE_STRERROR)
|
||||
CHECK_FUNCTION_EXISTS("strlcat" HAVE_STRLCAT)
|
||||
CHECK_FUNCTION_EXISTS("strptime" HAVE_STRPTIME)
|
||||
CHECK_FUNCTION_EXISTS("strtok_r" HAVE_STRTOK_R)
|
||||
CHECK_FUNCTION_EXISTS("strtoull" HAVE_STRTOULL)
|
||||
CHECK_FUNCTION_EXISTS("statvfs" HAVE_STATVFS)
|
||||
CHECK_FUNCTION_EXISTS("stat64" HAVE_STAT64)
|
||||
|
||||
# 3D drivers
|
||||
IF(WITH_DRIVER_OPENGL)
|
||||
SET(NL_OPENGL_AVAILABLE 1)
|
||||
ENDIF(WITH_DRIVER_OPENGL)
|
||||
|
||||
IF(WITH_DRIVER_OPENGLES)
|
||||
SET(NL_OPENGLES_AVAILABLE 1)
|
||||
ENDIF(WITH_DRIVER_OPENGLES)
|
||||
|
||||
IF(WITH_DRIVER_DIRECT3D)
|
||||
SET(NL_DIRECT3D_AVAILABLE 1)
|
||||
ENDIF(WITH_DRIVER_DIRECT3D)
|
||||
|
||||
# sound drivers
|
||||
IF(WITH_DRIVER_FMOD)
|
||||
SET(NL_FMOD_AVAILABLE 1)
|
||||
ENDIF(WITH_DRIVER_FMOD)
|
||||
|
||||
IF(WITH_DRIVER_OPENAL)
|
||||
SET(NL_OPENAL_AVAILABLE 1)
|
||||
ENDIF(WITH_DRIVER_OPENAL)
|
||||
|
||||
IF(WITH_DRIVER_DSOUND)
|
||||
SET(NL_DSOUND_AVAILABLE 1)
|
||||
ENDIF(WITH_DRIVER_DSOUND)
|
||||
|
||||
IF(WITH_DRIVER_XAUDIO2)
|
||||
SET(NL_XAUDIO2_AVAILABLE 1)
|
||||
ENDIF(WITH_DRIVER_XAUDIO2)
|
||||
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
|
||||
ADD_DEFINITIONS(-DHAVE_CONFIG_H)
|
||||
ENDMACRO(NL_CONFIGURE_CHECKS)
|
73
code/CMakeModules/Find3dsMaxSDK.cmake
Normal file
73
code/CMakeModules/Find3dsMaxSDK.cmake
Normal file
|
@ -0,0 +1,73 @@
|
|||
# - Find DirectInput
|
||||
# Find the DirectSound includes and libraries
|
||||
#
|
||||
# MAXSDK_INCLUDE_DIR - where to find baseinterface.h
|
||||
# MAXSDK_LIBRARIES - List of libraries when using 3DSMAX.
|
||||
# MAXSDK_FOUND - True if MAX SDK found.
|
||||
|
||||
if(MAXSDK_INCLUDE_DIR)
|
||||
# Already in cache, be silent
|
||||
set(MAXSDK_FIND_QUIETLY TRUE)
|
||||
endif(MAXSDK_INCLUDE_DIR)
|
||||
|
||||
find_path(MAXSDK_INCLUDE_DIR max.h
|
||||
PATHS
|
||||
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2010 SDK/maxsdk/include"
|
||||
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2009 SDK/maxsdk/include"
|
||||
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2008 SDK/maxsdk/include"
|
||||
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 9 SDK/maxsdk/include"
|
||||
"$ENV{3DSMAX_2011_SDK_PATH}/maxsdk/include"
|
||||
)
|
||||
|
||||
find_path(MAXSDK_CS_INCLUDE_DIR bipexp.h
|
||||
PATHS
|
||||
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2010 SDK/maxsdk/include/CS"
|
||||
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2009 SDK/maxsdk/include/CS"
|
||||
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2008 SDK/maxsdk/include/CS"
|
||||
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 9 SDK/maxsdk/include/CS"
|
||||
"$ENV{3DSMAX_2011_SDK_PATH}/maxsdk/include/CS"
|
||||
)
|
||||
|
||||
MACRO(FIND_3DS_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
||||
FIND_LIBRARY(${MYLIBRARY}
|
||||
NAMES ${MYLIBRARYNAME}
|
||||
PATHS
|
||||
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2010 SDK/maxsdk/lib"
|
||||
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2009 SDK/maxsdk/lib"
|
||||
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2008 SDK/maxsdk/lib"
|
||||
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 9 SDK/maxsdk/lib"
|
||||
"$ENV{3DSMAX_2011_SDK_PATH}/maxsdk/lib"
|
||||
)
|
||||
ENDMACRO(FIND_3DS_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
||||
|
||||
FIND_3DS_LIBRARY(MAXSDK_CORE_LIBRARY core)
|
||||
FIND_3DS_LIBRARY(MAXSDK_GEOM_LIBRARY geom)
|
||||
FIND_3DS_LIBRARY(MAXSDK_GFX_LIBRARY gfx)
|
||||
FIND_3DS_LIBRARY(MAXSDK_MESH_LIBRARY mesh)
|
||||
FIND_3DS_LIBRARY(MAXSDK_MAXUTIL_LIBRARY maxutil)
|
||||
FIND_3DS_LIBRARY(MAXSDK_MAXSCRIPT_LIBRARY maxscrpt)
|
||||
FIND_3DS_LIBRARY(MAXSDK_PARAMBLK2_LIBRARY paramblk2)
|
||||
FIND_3DS_LIBRARY(MAXSDK_BMM_LIBRARY bmm)
|
||||
|
||||
# Handle the QUIETLY and REQUIRED arguments and set MAXSDK_FOUND to TRUE if
|
||||
# all listed variables are TRUE.
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(MAXSDK DEFAULT_MSG
|
||||
MAXSDK_INCLUDE_DIR MAXSDK_CORE_LIBRARY)
|
||||
|
||||
if(MAXSDK_FOUND)
|
||||
SET(MAXSDK_LIBRARIES
|
||||
${MAXSDK_CORE_LIBRARY}
|
||||
${MAXSDK_GEOM_LIBRARY}
|
||||
${MAXSDK_GFX_LIBRARY}
|
||||
${MAXSDK_MESH_LIBRARY}
|
||||
${MAXSDK_MAXUTIL_LIBRARY}
|
||||
${MAXSDK_MAXSCRIPT_LIBRARY}
|
||||
${MAXSDK_PARAMBLK2_LIBRARY}
|
||||
${MAXSDK_BMM_LIBRARY} )
|
||||
|
||||
else(MAXSDK_FOUND)
|
||||
set(MAXSDK_LIBRARIES)
|
||||
endif(MAXSDK_FOUND)
|
||||
|
||||
mark_as_advanced(MAXSDK_INCLUDE_DIR MAXSDK_LIBRARY)
|
53
code/CMakeModules/FindCEGUI.cmake
Normal file
53
code/CMakeModules/FindCEGUI.cmake
Normal file
|
@ -0,0 +1,53 @@
|
|||
# - Locate CEGUI library
|
||||
# This module defines
|
||||
# CEGUI_LIBRARY, the library to link against
|
||||
# CEGUI_FOUND, if false, do not try to link to CEGUI
|
||||
# CEGUI_INCLUDE_DIRS, where to find headers.
|
||||
|
||||
IF(CEGUI_LIBRARY AND CEGUI_INCLUDE_DIRS)
|
||||
# in cache already
|
||||
SET(CEGUI_FIND_QUIETLY TRUE)
|
||||
ENDIF(CEGUI_LIBRARY AND CEGUI_INCLUDE_DIRS)
|
||||
|
||||
|
||||
FIND_PATH(CEGUI_INCLUDE_DIRS
|
||||
CEGUI
|
||||
PATHS
|
||||
$ENV{CEGUI_DIR}/include
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
/opt/csw/include
|
||||
/opt/include
|
||||
PATH_SUFFIXES cegui CEGUI
|
||||
)
|
||||
|
||||
FIND_LIBRARY(CEGUI_LIBRARY
|
||||
NAMES CEGUIBase
|
||||
PATHS
|
||||
$ENV{CEGUI_DIR}/lib
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/local/X11R6/lib
|
||||
/usr/X11R6/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
GET_FILENAME_COMPONENT(CEGUI_LIB_DIR ${CEGUI_LIBRARY} PATH CACHE)
|
||||
|
||||
IF(CEGUI_LIBRARY AND CEGUI_INCLUDE_DIRS)
|
||||
SET(CEGUI_FOUND "YES")
|
||||
SET(CEGUI_INCLUDE_DIRS "${CEGUI_INCLUDE_DIRS}/CEGUI")
|
||||
IF(NOT CEGUI_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found CEGUI: ${CEGUI_LIBRARY}")
|
||||
ENDIF(NOT CEGUI_FIND_QUIETLY)
|
||||
ELSE(CEGUI_LIBRARY AND CEGUI_INCLUDE_DIRS)
|
||||
IF(NOT CEGUI_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Warning: Unable to find CEGUI!")
|
||||
ENDIF(NOT CEGUI_FIND_QUIETLY)
|
||||
ENDIF(CEGUI_LIBRARY AND CEGUI_INCLUDE_DIRS)
|
84
code/CMakeModules/FindCppTest.cmake
Normal file
84
code/CMakeModules/FindCppTest.cmake
Normal file
|
@ -0,0 +1,84 @@
|
|||
#
|
||||
# Find the CppTest includes and library
|
||||
#
|
||||
# This module defines
|
||||
# CPPTEST_INCLUDE_DIR, where to find tiff.h, etc.
|
||||
# CPPTEST_LIBRARIES, where to find the CppTest libraries.
|
||||
# CPPTEST_FOUND, If false, do not try to use CppTest.
|
||||
|
||||
# also defined, but not for general use are
|
||||
IF(CPPTEST_LIBRARIES AND CPPTEST_INCLUDE_DIR)
|
||||
# in cache already
|
||||
SET(CPPTEST_FIND_QUIETLY TRUE)
|
||||
ENDIF(CPPTEST_LIBRARIES AND CPPTEST_INCLUDE_DIR)
|
||||
|
||||
FIND_PATH(CPPTEST_INCLUDE_DIR
|
||||
cpptest.h
|
||||
PATHS
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
/opt/csw/include
|
||||
/opt/include
|
||||
PATH_SUFFIXES cppunit
|
||||
)
|
||||
|
||||
SET(LIBRARY_NAME_RELEASE cpptest)
|
||||
SET(LIBRARY_NAME_DEBUG cpptestd)
|
||||
|
||||
IF(WITH_STLPORT)
|
||||
SET(LIBRARY_NAME_RELEASE cpptest_stlport ${LIBRARY_NAME_RELEASE})
|
||||
SET(LIBRARY_NAME_DEBUG cpptest_stlportd ${LIBRARY_NAME_DEBUG})
|
||||
ENDIF(WITH_STLPORT)
|
||||
|
||||
FIND_LIBRARY(CPPTEST_LIBRARY_RELEASE
|
||||
${LIBRARY_NAME_RELEASE}
|
||||
PATHS
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/local/X11R6/lib
|
||||
/usr/X11R6/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
FIND_LIBRARY(CPPTEST_LIBRARY_DEBUG
|
||||
${LIBRARY_NAME_DEBUG}
|
||||
PATHS
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/local/X11R6/lib
|
||||
/usr/X11R6/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
IF(CPPTEST_INCLUDE_DIR)
|
||||
IF(CPPTEST_LIBRARY_RELEASE)
|
||||
SET(CPPTEST_FOUND TRUE)
|
||||
|
||||
SET(CPPTEST_LIBRARIES "optimized;${CPPTEST_LIBRARY_RELEASE}")
|
||||
IF(CPPTEST_LIBRARY_DEBUG)
|
||||
SET(CPPTEST_LIBRARIES "${CPPTEST_LIBRARIES};debug;${CPPTEST_LIBRARY_DEBUG}")
|
||||
ENDIF(CPPTEST_LIBRARY_DEBUG)
|
||||
ENDIF(CPPTEST_LIBRARY_RELEASE)
|
||||
ENDIF(CPPTEST_INCLUDE_DIR)
|
||||
|
||||
IF(CPPTEST_FOUND)
|
||||
IF(NOT CPPTEST_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found CppTest: ${CPPTEST_LIBRARIES}")
|
||||
ENDIF(NOT CPPTEST_FIND_QUIETLY)
|
||||
ELSE(CPPTEST_FOUND)
|
||||
IF(NOT CPPTEST_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Warning: Unable to find CppTest!")
|
||||
ENDIF(NOT CPPTEST_FIND_QUIETLY)
|
||||
ENDIF(CPPTEST_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(CPPTEST_LIBRARY_RELEASE CPPTEST_LIBRARY_DEBUG)
|
59
code/CMakeModules/FindCustomMFC.cmake
Normal file
59
code/CMakeModules/FindCustomMFC.cmake
Normal file
|
@ -0,0 +1,59 @@
|
|||
# - Locate MFC libraries
|
||||
# This module defines
|
||||
# MFC_FOUND, if false, do not try to link to MFC
|
||||
# MFC_LIBRARY_DIR, where to find libraries
|
||||
# MFC_INCLUDE_DIR, where to find headers
|
||||
|
||||
# Try to find MFC using official module, MFC_FOUND is set
|
||||
FIND_PACKAGE(MFC)
|
||||
|
||||
SET(CUSTOM_MFC_DIR FALSE)
|
||||
|
||||
# If using STLport and MFC have been found, remember its directory
|
||||
IF(WITH_STLPORT AND MFC_FOUND AND VC_DIR)
|
||||
SET(MFC_STANDARD_DIR "${VC_DIR}/atlmfc")
|
||||
ENDIF(WITH_STLPORT AND MFC_FOUND AND VC_DIR)
|
||||
|
||||
# If using STLport or MFC haven't been found, search for afxwin.h
|
||||
IF(WITH_STLPORT OR NOT MFC_FOUND)
|
||||
FIND_PATH(MFC_DIR
|
||||
include/afxwin.h
|
||||
PATHS
|
||||
${MFC_STANDARD_DIR}
|
||||
)
|
||||
|
||||
IF(CustomMFC_FIND_REQUIRED)
|
||||
SET(MFC_FIND_REQUIRED TRUE)
|
||||
ENDIF(CustomMFC_FIND_REQUIRED)
|
||||
|
||||
# Display an error message if MFC are not found, MFC_FOUND is updated
|
||||
# User will be able to update MFC_DIR to the correct directory
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(MFC DEFAULT_MSG MFC_DIR)
|
||||
|
||||
IF(MFC_FOUND)
|
||||
SET(CUSTOM_MFC_DIR TRUE)
|
||||
SET(MFC_INCLUDE_DIR "${MFC_DIR}/include")
|
||||
INCLUDE_DIRECTORIES(${MFC_INCLUDE_DIR})
|
||||
ENDIF(MFC_FOUND)
|
||||
ENDIF(WITH_STLPORT OR NOT MFC_FOUND)
|
||||
|
||||
# Only if using a custom path
|
||||
IF(CUSTOM_MFC_DIR)
|
||||
# Using 32 or 64 bits libraries
|
||||
IF(TARGET_X64)
|
||||
SET(MFC_LIBRARY_DIR "${MFC_DIR}/lib/amd64")
|
||||
ELSE(TARGET_X64)
|
||||
SET(MFC_LIBRARY_DIR "${MFC_DIR}/lib")
|
||||
ENDIF(TARGET_X64)
|
||||
|
||||
# Add MFC libraries directory to default library path
|
||||
LINK_DIRECTORIES(${MFC_LIBRARY_DIR})
|
||||
ENDIF(CUSTOM_MFC_DIR)
|
||||
|
||||
IF(MFC_FOUND)
|
||||
# Set definitions for using MFC in DLL
|
||||
SET(MFC_DEFINITIONS -D_AFXDLL)
|
||||
ENDIF(MFC_FOUND)
|
||||
|
||||
# TODO: create a macro which set MFC_DEFINITIONS, MFC_LIBRARY_DIR and MFC_INCLUDE_DIR for a project
|
38
code/CMakeModules/FindDInput.cmake
Normal file
38
code/CMakeModules/FindDInput.cmake
Normal file
|
@ -0,0 +1,38 @@
|
|||
# - Find DirectInput
|
||||
# Find the DirectSound includes and libraries
|
||||
#
|
||||
# DINPUT_INCLUDE_DIR - where to find dinput.h
|
||||
# DINPUT_LIBRARIES - List of libraries when using DirectInput.
|
||||
# DINPUT_FOUND - True if DirectInput found.
|
||||
|
||||
if(DINPUT_INCLUDE_DIR)
|
||||
# Already in cache, be silent
|
||||
set(DINPUT_FIND_QUIETLY TRUE)
|
||||
endif(DINPUT_INCLUDE_DIR)
|
||||
|
||||
find_path(DINPUT_INCLUDE_DIR dinput.h
|
||||
"$ENV{DXSDK_DIR}"
|
||||
"$ENV{DXSDK_DIR}/Include"
|
||||
)
|
||||
|
||||
find_library(DINPUT_LIBRARY
|
||||
NAMES dinput dinput8
|
||||
PATHS
|
||||
"$ENV{DXSDK_DIR}"
|
||||
"$ENV{DXSDK_DIR}/Lib"
|
||||
"$ENV{DXSDK_DIR}/Lib/x86"
|
||||
)
|
||||
|
||||
# Handle the QUIETLY and REQUIRED arguments and set DINPUT_FOUND to TRUE if
|
||||
# all listed variables are TRUE.
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(DINPUT DEFAULT_MSG
|
||||
DINPUT_INCLUDE_DIR DINPUT_LIBRARY)
|
||||
|
||||
if(DINPUT_FOUND)
|
||||
set(DINPUT_LIBRARIES ${DINPUT_LIBRARY})
|
||||
else(DINPUT_FOUND)
|
||||
set(DINPUT_LIBRARIES)
|
||||
endif(DINPUT_FOUND)
|
||||
|
||||
mark_as_advanced(DINPUT_INCLUDE_DIR DINPUT_LIBRARY)
|
36
code/CMakeModules/FindDSound.cmake
Normal file
36
code/CMakeModules/FindDSound.cmake
Normal file
|
@ -0,0 +1,36 @@
|
|||
# - Find DirectSound
|
||||
# Find the DirectSound includes and libraries
|
||||
#
|
||||
# DSOUND_INCLUDE_DIR - where to find dsound.h
|
||||
# DSOUND_LIBRARIES - List of libraries when using dsound.
|
||||
# DSOUND_FOUND - True if dsound found.
|
||||
|
||||
if(DSOUND_INCLUDE_DIR)
|
||||
# Already in cache, be silent
|
||||
set(DSOUND_FIND_QUIETLY TRUE)
|
||||
endif(DSOUND_INCLUDE_DIR)
|
||||
|
||||
find_path(DSOUND_INCLUDE_DIR dsound.h
|
||||
"$ENV{DXSDK_DIR}"
|
||||
"$ENV{DXSDK_DIR}/Include"
|
||||
)
|
||||
|
||||
find_library(DSOUND_LIBRARY dsound
|
||||
"$ENV{DXSDK_DIR}"
|
||||
"$ENV{DXSDK_DIR}/Lib"
|
||||
"$ENV{DXSDK_DIR}/Lib/x86"
|
||||
)
|
||||
|
||||
# Handle the QUIETLY and REQUIRED arguments and set DSOUND_FOUND to TRUE if
|
||||
# all listed variables are TRUE.
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(DSOUND DEFAULT_MSG
|
||||
DSOUND_INCLUDE_DIR DSOUND_LIBRARY)
|
||||
|
||||
if(DSOUND_FOUND)
|
||||
set(DSOUND_LIBRARIES ${DSOUND_LIBRARY})
|
||||
else(DSOUND_FOUND)
|
||||
set(DSOUND_LIBRARIES)
|
||||
endif(DSOUND_FOUND)
|
||||
|
||||
mark_as_advanced(DSOUND_INCLUDE_DIR DSOUND_LIBRARY)
|
65
code/CMakeModules/FindDirectXSDK.cmake
Normal file
65
code/CMakeModules/FindDirectXSDK.cmake
Normal file
|
@ -0,0 +1,65 @@
|
|||
# - Find DirectX
|
||||
# Find the DirectX includes and libraries
|
||||
#
|
||||
# DXSDK_INCLUDE_DIR - where to find baseinterface.h
|
||||
# DXSDK_LIBRARIES - List of libraries when using 3DSMAX.
|
||||
# DXSDK_FOUND - True if MAX SDK found.
|
||||
|
||||
IF(DXSDK_DIR)
|
||||
# Already in cache, be silent
|
||||
SET(DXSDK_FIND_QUIETLY TRUE)
|
||||
ENDIF(DXSDK_DIR)
|
||||
|
||||
FIND_PATH(DXSDK_DIR
|
||||
"Include/dxsdkver.h"
|
||||
PATHS
|
||||
"$ENV{DXSDK_DIR}"
|
||||
)
|
||||
|
||||
MACRO(FIND_DXSDK_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
||||
FIND_LIBRARY(${MYLIBRARY}
|
||||
NAMES ${MYLIBRARYNAME}
|
||||
PATHS
|
||||
"${DXSDK_LIBRARY_DIR}"
|
||||
"$ENV{DXSDK_DIR}"
|
||||
"$ENV{DXSDK_DIR}/Lib"
|
||||
"$ENV{DXSDK_DIR}/Lib/x86"
|
||||
)
|
||||
ENDMACRO(FIND_DXSDK_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
||||
|
||||
IF(DXSDK_DIR)
|
||||
SET(DXSDK_INCLUDE_DIR "${DXSDK_DIR}/Include")
|
||||
|
||||
IF(TARGET_X64)
|
||||
SET(DXSDK_LIBRARY_DIR "${DXSDK_DIR}/Lib/x64")
|
||||
ELSE(TARGET_X64)
|
||||
SET(DXSDK_LIBRARY_DIR "${DXSDK_DIR}/Lib/x86")
|
||||
ENDIF(TARGET_X64)
|
||||
|
||||
FIND_DXSDK_LIBRARY(DXSDK_GUID_LIBRARY dxguid)
|
||||
FIND_DXSDK_LIBRARY(DXSDK_DINPUT_LIBRARY dinput8)
|
||||
FIND_DXSDK_LIBRARY(DXSDK_DSOUND_LIBRARY dsound)
|
||||
FIND_DXSDK_LIBRARY(DXSDK_XAUDIO_LIBRARY x3daudio)
|
||||
FIND_DXSDK_LIBRARY(DXSDK_D3DX9_LIBRARY d3dx9)
|
||||
FIND_DXSDK_LIBRARY(DXSDK_D3D9_LIBRARY d3d9)
|
||||
|
||||
#FIND_DXSDK_LIBRARY(DXSDK_MESH_LIBRARY mesh)
|
||||
#FIND_DXSDK_LIBRARY(DXSDK_MAXUTIL_LIBRARY maxutil)
|
||||
#FIND_DXSDK_LIBRARY(DXSDK_MAXSCRIPT_LIBRARY maxscrpt)
|
||||
#FIND_DXSDK_LIBRARY(DXSDK_PARAMBLK2_LIBRARY paramblk2)
|
||||
#FIND_DXSDK_LIBRARY(DXSDK_BMM_LIBRARY bmm)
|
||||
ENDIF(DXSDK_DIR)
|
||||
|
||||
# Handle the QUIETLY and REQUIRED arguments and set DXSDK_FOUND to TRUE if
|
||||
# all listed variables are TRUE.
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(DirectXSDK DEFAULT_MSG DXSDK_DIR DXSDK_GUID_LIBRARY DXSDK_DINPUT_LIBRARY)
|
||||
|
||||
MARK_AS_ADVANCED(DXSDK_INCLUDE_DIR
|
||||
DXSDK_GUID_LIBRARY
|
||||
DXSDK_DINPUT_LIBRARY
|
||||
DXSDK_DSOUND_LIBRARY
|
||||
DXSDK_XAUDIO_LIBRARY
|
||||
DXSDK_D3DX9_LIBRARY
|
||||
DXSDK_D3D9_LIBRARY)
|
50
code/CMakeModules/FindEFXUtil.cmake
Normal file
50
code/CMakeModules/FindEFXUtil.cmake
Normal file
|
@ -0,0 +1,50 @@
|
|||
# - Locate EFX-Util library
|
||||
# This module defines
|
||||
# EFXUTIL_LIBRARY, the library to link against
|
||||
# EFXUTIL_FOUND, if false, do not try to link to EFX-Util
|
||||
# EFXUTIL_INCLUDE_DIR, where to find headers.
|
||||
|
||||
IF(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR)
|
||||
# in cache already
|
||||
SET(EFXUTIL_FIND_QUIETLY TRUE)
|
||||
ENDIF(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR)
|
||||
|
||||
|
||||
FIND_PATH(EFXUTIL_INCLUDE_DIR
|
||||
EFX-Util.h
|
||||
PATHS
|
||||
$ENV{EFXUTIL_DIR}/include
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
/opt/csw/include
|
||||
/opt/include
|
||||
PATH_SUFFIXES AL
|
||||
)
|
||||
|
||||
FIND_LIBRARY(EFXUTIL_LIBRARY
|
||||
NAMES EFX-Util efxutil libefxutil
|
||||
PATHS
|
||||
$ENV{EFXUTIL_DIR}/lib
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/local/X11R6/lib
|
||||
/usr/X11R6/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
IF(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR)
|
||||
SET(EFXUTIL_FOUND "YES")
|
||||
IF(NOT EFXUTIL_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found EFX-Util: ${EFXUTIL_LIBRARY}")
|
||||
ENDIF(NOT EFXUTIL_FIND_QUIETLY)
|
||||
ELSE(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR)
|
||||
IF(NOT EFXUTIL_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Warning: Unable to find EFX-Util!")
|
||||
ENDIF(NOT EFXUTIL_FIND_QUIETLY)
|
||||
ENDIF(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR)
|
64
code/CMakeModules/FindExternal.cmake
Normal file
64
code/CMakeModules/FindExternal.cmake
Normal file
|
@ -0,0 +1,64 @@
|
|||
# Look for a directory containing external libraries.
|
||||
#
|
||||
# The following values are defined
|
||||
# EXTERNAL_PATH - where to find external
|
||||
# EXTERNAL_INCLUDE_PATH - where to find external includes
|
||||
# EXTERNAL_LIBRARY_PATH - where to find external libraries
|
||||
# EXTERNAL_FOUND - True if the external libraries are available
|
||||
|
||||
SET(EXTERNAL_TEMP_PATH ${CMAKE_CURRENT_SOURCE_DIR}/external ${CMAKE_CURRENT_SOURCE_DIR}/../external ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty ${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty ${EXTERNAL_PATH})
|
||||
SET(EXTERNAL_TEMP_FILE "include/zlib.h")
|
||||
SET(EXTERNAL_NAME "external")
|
||||
|
||||
# If using STLport preprend external_stlport
|
||||
IF(WITH_STLPORT)
|
||||
SET(EXTERNAL_TEMP_PATH ${CMAKE_CURRENT_SOURCE_DIR}/external_stlport ${CMAKE_CURRENT_SOURCE_DIR}/../external_stlport ${EXTERNAL_TEMP_PATH})
|
||||
SET(EXTERNAL_TEMP_FILE "include/stlport/string")
|
||||
SET(EXTERNAL_NAME "external with STLport")
|
||||
ENDIF(WITH_STLPORT)
|
||||
|
||||
FIND_PATH(EXTERNAL_PATH
|
||||
${EXTERNAL_TEMP_FILE}
|
||||
PATHS
|
||||
$ENV{EXTERNAL_PATH}
|
||||
${EXTERNAL_TEMP_PATH}
|
||||
/usr/local
|
||||
/usr
|
||||
/sw
|
||||
/opt/local
|
||||
/opt/csw
|
||||
/opt
|
||||
)
|
||||
|
||||
IF(EXTERNAL_PATH)
|
||||
SET(EXTERNAL_FOUND TRUE)
|
||||
SET(EXTERNAL_INCLUDE_PATH "${EXTERNAL_PATH}/include")
|
||||
|
||||
# Using 32 or 64 bits libraries
|
||||
IF(TARGET_X64)
|
||||
SET(EXTERNAL_LIBRARY_PATH "${EXTERNAL_PATH}/lib64")
|
||||
ELSE(TARGET_X64)
|
||||
SET(EXTERNAL_LIBRARY_PATH "${EXTERNAL_PATH}/lib")
|
||||
ENDIF(TARGET_X64)
|
||||
|
||||
SET(CMAKE_INCLUDE_PATH "${EXTERNAL_INCLUDE_PATH};${CMAKE_INCLUDE_PATH}")
|
||||
# Stupid hack for FindOpenAL.cmake
|
||||
SET(CMAKE_INCLUDE_PATH "${EXTERNAL_PATH};${CMAKE_INCLUDE_PATH}")
|
||||
SET(CMAKE_LIBRARY_PATH "${EXTERNAL_LIBRARY_PATH};${CMAKE_LIBRARY_PATH}")
|
||||
ENDIF(EXTERNAL_PATH)
|
||||
|
||||
IF(EXTERNAL_FOUND)
|
||||
IF(NOT External_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found ${EXTERNAL_NAME}: ${EXTERNAL_PATH}")
|
||||
ENDIF(NOT External_FIND_QUIETLY)
|
||||
ELSE(EXTERNAL_FOUND)
|
||||
IF(External_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Unable to find ${EXTERNAL_NAME}!")
|
||||
ELSE(External_FIND_REQUIRED)
|
||||
IF(NOT External_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Warning: Unable to find ${EXTERNAL_NAME}!")
|
||||
ENDIF(NOT External_FIND_QUIETLY)
|
||||
ENDIF(External_FIND_REQUIRED)
|
||||
ENDIF(EXTERNAL_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(EXTERNAL_INCLUDE_PATH EXTERNAL_LIBRARY_PATH)
|
50
code/CMakeModules/FindFMOD.cmake
Normal file
50
code/CMakeModules/FindFMOD.cmake
Normal file
|
@ -0,0 +1,50 @@
|
|||
# - Locate FMOD library
|
||||
# This module defines
|
||||
# FMOD_LIBRARY, the library to link against
|
||||
# FMOD_FOUND, if false, do not try to link to FMOD
|
||||
# FMOD_INCLUDE_DIR, where to find headers.
|
||||
|
||||
IF(FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
|
||||
# in cache already
|
||||
SET(FMOD_FIND_QUIETLY TRUE)
|
||||
ENDIF(FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
|
||||
|
||||
|
||||
FIND_PATH(FMOD_INCLUDE_DIR
|
||||
fmod.h
|
||||
PATHS
|
||||
$ENV{FMOD_DIR}/include
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
/opt/csw/include
|
||||
/opt/include
|
||||
PATH_SUFFIXES fmod fmod3
|
||||
)
|
||||
|
||||
FIND_LIBRARY(FMOD_LIBRARY
|
||||
NAMES fmod fmodvc libfmod fmod64
|
||||
PATHS
|
||||
$ENV{FMOD_DIR}/lib
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/local/X11R6/lib
|
||||
/usr/X11R6/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
IF(FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
|
||||
SET(FMOD_FOUND "YES")
|
||||
IF(NOT FMOD_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found FMOD: ${FMOD_LIBRARY}")
|
||||
ENDIF(NOT FMOD_FIND_QUIETLY)
|
||||
ELSE(FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
|
||||
IF(NOT FMOD_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Warning: Unable to find FMOD!")
|
||||
ENDIF(NOT FMOD_FIND_QUIETLY)
|
||||
ENDIF(FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
|
67
code/CMakeModules/FindFreeType.cmake
Normal file
67
code/CMakeModules/FindFreeType.cmake
Normal file
|
@ -0,0 +1,67 @@
|
|||
# - Locate FreeType library
|
||||
# This module defines
|
||||
# FREETYPE_LIBRARY, the library to link against
|
||||
# FREETYPE_FOUND, if false, do not try to link to FREETYPE
|
||||
# FREETYPE_INCLUDE_DIRS, where to find headers.
|
||||
|
||||
IF(FREETYPE_LIBRARY AND FREETYPE_INCLUDE_DIRS)
|
||||
# in cache already
|
||||
SET(FREETYPE_FIND_QUIETLY TRUE)
|
||||
ENDIF(FREETYPE_LIBRARY AND FREETYPE_INCLUDE_DIRS)
|
||||
|
||||
|
||||
FIND_PATH(FREETYPE_INCLUDE_DIRS
|
||||
freetype
|
||||
PATHS
|
||||
$ENV{FREETYPE_DIR}/include
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
/opt/csw/include
|
||||
/opt/include
|
||||
PATH_SUFFIXES freetype freetype2
|
||||
)
|
||||
|
||||
# ft2build.h does not reside in the freetype include dir
|
||||
FIND_PATH(FREETYPE_ADDITIONAL_INCLUDE_DIR
|
||||
ft2build.h
|
||||
PATHS
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
/opt/csw/include
|
||||
/opt/include
|
||||
)
|
||||
|
||||
# combine both include directories into one variable
|
||||
IF(FREETYPE_ADDITIONAL_INCLUDE_DIR)
|
||||
SET(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS} ${FREETYPE_ADDITIONAL_INCLUDE_DIR})
|
||||
ENDIF(FREETYPE_ADDITIONAL_INCLUDE_DIR)
|
||||
|
||||
FIND_LIBRARY(FREETYPE_LIBRARY
|
||||
NAMES freetype libfreetype freetype219
|
||||
PATHS
|
||||
$ENV{FREETYPE_DIR}/lib
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/local/X11R6/lib
|
||||
/usr/X11R6/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
IF(FREETYPE_LIBRARY AND FREETYPE_INCLUDE_DIRS)
|
||||
SET(FREETYPE_FOUND "YES")
|
||||
IF(NOT FREETYPE_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found FreeType: ${FREETYPE_LIBRARY}")
|
||||
ENDIF(NOT FREETYPE_FIND_QUIETLY)
|
||||
ELSE(FREETYPE_LIBRARY AND FREETYPE_INCLUDE_DIRS)
|
||||
IF(NOT FREETYPE_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Warning: Unable to find FreeType!")
|
||||
ENDIF(NOT FREETYPE_FIND_QUIETLY)
|
||||
ENDIF(FREETYPE_LIBRARY AND FREETYPE_INCLUDE_DIRS)
|
452
code/CMakeModules/FindGTK2.cmake
Normal file
452
code/CMakeModules/FindGTK2.cmake
Normal file
|
@ -0,0 +1,452 @@
|
|||
# - Try to find GTK2
|
||||
# Once done this will define
|
||||
#
|
||||
# GTK2_FOUND - System has GTK2
|
||||
# GTK2_INCLUDE_DIRS - GTK2 include directory
|
||||
# GTK2_LIBRARIES - Link these to use GTK2
|
||||
# GTK2_LIBRARY_DIRS - The path to where the GTK2 library files are.
|
||||
# GTK2_DEFINITIONS - Compiler switches required for using GTK2
|
||||
#
|
||||
# Copyright (c) 2007 Andreas Schneider <mail@cynapses.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the New
|
||||
# BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
#
|
||||
|
||||
set(GTK2_DEBUG ON)
|
||||
|
||||
macro(GTK2_DEBUG_MESSAGE _message)
|
||||
if (GTK2_DEBUG)
|
||||
message(STATUS "(DEBUG) ${_message}")
|
||||
endif (GTK2_DEBUG)
|
||||
endmacro(GTK2_DEBUG_MESSAGE _message)
|
||||
|
||||
if (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS)
|
||||
# in cache already
|
||||
set(GTK2_FOUND TRUE)
|
||||
else (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS)
|
||||
if (UNIX)
|
||||
# use pkg-config to get the directories and then use these values
|
||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
include(UsePkgConfig)
|
||||
|
||||
pkgconfig(gtk+-2.0 _GTK2IncDir _GTK2LinkDir _GTK2LinkFlags _GTK2Cflags)
|
||||
|
||||
find_path(GTK2_GTK_INCLUDE_DIR
|
||||
NAMES
|
||||
gtk/gtk.h
|
||||
PATHS
|
||||
$ENV{GTK2_HOME}
|
||||
${_GTK2IncDir}
|
||||
/usr/include/gtk-2.0
|
||||
/usr/local/include/gtk-2.0
|
||||
/opt/include/gtk-2.0
|
||||
/opt/gnome/include/gtk-2.0
|
||||
/sw/include/gtk-2.0
|
||||
)
|
||||
gtk2_debug_message("GTK2_GTK_INCLUDE_DIR is ${GTK2_GTK_INCLUDE_DIR}")
|
||||
|
||||
# Some Linux distributions (e.g. Red Hat) have glibconfig.h
|
||||
# and glib.h in different directories, so we need to look
|
||||
# for both.
|
||||
# - Atanas Georgiev <atanas@cs.columbia.edu>
|
||||
pkgconfig(glib-2.0 _GLIB2IncDir _GLIB2LinkDir _GLIB2LinkFlags _GLIB2Cflags)
|
||||
pkgconfig(gmodule-2.0 _GMODULE2IncDir _GMODULE2LinkDir _GMODULE2LinkFlags _GMODULE2Cflags)
|
||||
|
||||
find_path(GTK2_GLIBCONFIG_INCLUDE_DIR
|
||||
NAMES
|
||||
glibconfig.h
|
||||
PATHS
|
||||
${_GLIB2IncDir}
|
||||
${_GMODULE2IncDir}
|
||||
/opt/gnome/lib64/glib-2.0/include
|
||||
/opt/gnome/lib/glib-2.0/include
|
||||
/opt/lib/glib-2.0/include
|
||||
/usr/lib64/glib-2.0/include
|
||||
/usr/lib/glib-2.0/include
|
||||
/sw/lib/glib-2.0/include
|
||||
)
|
||||
gtk2_debug_message("GTK2_GLIBCONFIG_INCLUDE_DIR is ${GTK2_GLIBCONFIG_INCLUDE_DIR}")
|
||||
|
||||
find_path(GTK2_GLIB_INCLUDE_DIR
|
||||
NAMES
|
||||
glib.h
|
||||
PATHS
|
||||
${_GLIB2IncDir}
|
||||
${_GMODULE2IncDir}
|
||||
/opt/include/glib-2.0
|
||||
/opt/gnome/include/glib-2.0
|
||||
/usr/include/glib-2.0
|
||||
/sw/include/glib-2.0
|
||||
)
|
||||
gtk2_debug_message("GTK2_GLIB_INCLUDE_DIR is ${GTK2_GLIB_INCLUDE_DIR}")
|
||||
|
||||
pkgconfig(gdk-2.0 _GDK2IncDir _GDK2LinkDir _GDK2LinkFlags _GDK2Cflags)
|
||||
|
||||
find_path(GTK2_GDK_INCLUDE_DIR
|
||||
NAMES
|
||||
gdkconfig.h
|
||||
PATHS
|
||||
${_GDK2IncDir}
|
||||
/opt/gnome/lib/gtk-2.0/include
|
||||
/opt/gnome/lib64/gtk-2.0/include
|
||||
/opt/lib/gtk-2.0/include
|
||||
/usr/lib/gtk-2.0/include
|
||||
/usr/lib64/gtk-2.0/include
|
||||
/sw/lib/gtk-2.0/include
|
||||
)
|
||||
gtk2_debug_message("GTK2_GDK_INCLUDE_DIR is ${GTK2_GDK_INCLUDE_DIR}")
|
||||
|
||||
find_path(GTK2_GTKGL_INCLUDE_DIR
|
||||
NAMES
|
||||
gtkgl/gtkglarea.h
|
||||
PATHS
|
||||
${_GLIB2IncDir}
|
||||
/usr/include
|
||||
/usr/include/gtkgl-2.0
|
||||
/usr/local/include
|
||||
/usr/openwin/share/include
|
||||
/opt/gnome/include
|
||||
/opt/include
|
||||
/sw/include
|
||||
)
|
||||
gtk2_debug_message("GTK2_GTKGL_INCLUDE_DIR is ${GTK2_GTKGL_INCLUDE_DIR}")
|
||||
|
||||
pkgconfig(libglade-2.0 _GLADEIncDir _GLADELinkDir _GLADELinkFlags _GLADECflags)
|
||||
|
||||
find_path(GTK2_GLADE_INCLUDE_DIR
|
||||
NAMES
|
||||
glade/glade.h
|
||||
PATHS
|
||||
${_GLADEIncDir}
|
||||
/opt/gnome/include/libglade-2.0
|
||||
/usr/include/libglade-2.0
|
||||
/opt/include/libglade-2.0
|
||||
/sw/include/libglade-2.0
|
||||
)
|
||||
gtk2_debug_message("GTK2_GLADE_INCLUDE_DIR is ${GTK2_GLADE_INCLUDE_DIR}")
|
||||
|
||||
pkgconfig(pango _PANGOIncDir _PANGOLinkDir _PANGOLinkFlags _PANGOCflags)
|
||||
|
||||
find_path(GTK2_PANGO_INCLUDE_DIR
|
||||
NAMES
|
||||
pango/pango.h
|
||||
PATHS
|
||||
${_PANGOIncDir}
|
||||
/usr/include/pango-1.0
|
||||
/opt/gnome/include/pango-1.0
|
||||
/opt/include/pango-1.0
|
||||
/sw/include/pango-1.0
|
||||
)
|
||||
gtk2_debug_message("GTK2_PANGO_INCLUDE_DIR is ${GTK2_PANGO_INCLUDE_DIR}")
|
||||
|
||||
pkgconfig(cairo _CAIROIncDir _CAIROLinkDir _CAIROLinkFlags _CAIROCflags)
|
||||
|
||||
find_path(GTK2_CAIRO_INCLUDE_DIR
|
||||
NAMES
|
||||
cairo.h
|
||||
PATHS
|
||||
${_CAIROIncDir}
|
||||
/opt/gnome/include/cairo
|
||||
/usr/include
|
||||
/usr/include/cairo
|
||||
/opt/include
|
||||
/opt/include/cairo
|
||||
/sw/include
|
||||
/sw/include/cairo
|
||||
)
|
||||
gtk2_debug_message("GTK2_CAIRO_INCLUDE_DIR is ${GTK2_CAIRO_INCLUDE_DIR}")
|
||||
|
||||
pkgconfig(atk _ATKIncDir _ATKLinkDir _ATKLinkFlags _ATKCflags)
|
||||
|
||||
find_path(GTK2_ATK_INCLUDE_DIR
|
||||
NAMES
|
||||
atk/atk.h
|
||||
PATHS
|
||||
${_ATKIncDir}
|
||||
/opt/gnome/include/atk-1.0
|
||||
/usr/include/atk-1.0
|
||||
/opt/include/atk-1.0
|
||||
/sw/include/atk-1.0
|
||||
)
|
||||
gtk2_debug_message("GTK2_ATK_INCLUDE_DIR is ${GTK2_ATK_INCLUDE_DIR}")
|
||||
|
||||
find_library(GTK2_GTK_LIBRARY
|
||||
NAMES
|
||||
gtk-x11-2.0
|
||||
PATHS
|
||||
${_GTK2LinkDir}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/usr/openwin/lib
|
||||
/usr/X11R6/lib
|
||||
/opt/gnome/lib
|
||||
/opt/lib
|
||||
/sw/lib
|
||||
)
|
||||
gtk2_debug_message("GTK2_GTK_LIBRARY is ${GTK2_GTK_LIBRARY}")
|
||||
|
||||
find_library(GTK2_GDK_LIBRARY
|
||||
NAMES
|
||||
gdk-x11-2.0
|
||||
PATHS
|
||||
${_GDK2LinkDir}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/usr/openwin/lib
|
||||
/usr/X11R6/lib
|
||||
/opt/gnome/lib
|
||||
/opt/lib
|
||||
/sw/lib
|
||||
)
|
||||
gtk2_debug_message("GTK2_GDK_LIBRARY is ${GTK2_GDK_LIBRARY}")
|
||||
|
||||
find_library(GTK2_GDK_PIXBUF_LIBRARY
|
||||
NAMES
|
||||
gdk_pixbuf-2.0
|
||||
PATHS
|
||||
${_GDK2LinkDir}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/usr/openwin/lib
|
||||
/usr/X11R6/lib
|
||||
/opt/gnome/lib
|
||||
/opt/lib
|
||||
/sw/lib
|
||||
)
|
||||
gtk2_debug_message("GTK2_GDK_PIXBUF_LIBRARY is ${GTK2_GDK_PIXBUF_LIBRARY}")
|
||||
|
||||
find_library(GTK2_GMODULE_LIBRARY
|
||||
NAMES
|
||||
gmodule-2.0
|
||||
PATHS
|
||||
${_GMODULE2LinkDir}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/usr/openwin/lib
|
||||
/usr/X11R6/lib
|
||||
/opt/gnome/lib
|
||||
/opt/lib
|
||||
/sw/lib
|
||||
)
|
||||
gtk2_debug_message("GTK2_GMODULE_LIBRARY is ${GTK2_GMODULE_LIBRARY}")
|
||||
|
||||
find_library(GTK2_GTHREAD_LIBRARY
|
||||
NAMES
|
||||
gthread-2.0
|
||||
PATHS
|
||||
${_GTK2LinkDir}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/usr/openwin/lib
|
||||
/usr/X11R6/lib
|
||||
/opt/gnome/lib
|
||||
/opt/lib
|
||||
/sw/lib
|
||||
)
|
||||
gtk2_debug_message("GTK2_GTHREAD_LIBRARY is ${GTK2_GTHREAD_LIBRARY}")
|
||||
|
||||
find_library(GTK2_GOBJECT_LIBRARY
|
||||
NAMES
|
||||
gobject-2.0
|
||||
PATHS
|
||||
${_GTK2LinkDir}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/usr/openwin/lib
|
||||
/usr/X11R6/lib
|
||||
/opt/gnome/lib
|
||||
/opt/lib
|
||||
/sw/lib
|
||||
)
|
||||
gtk2_debug_message("GTK2_GOBJECT_LIBRARY is ${GTK2_GOBJECT_LIBRARY}")
|
||||
|
||||
find_library(GTK2_GLIB_LIBRARY
|
||||
NAMES
|
||||
glib-2.0
|
||||
PATHS
|
||||
${_GLIB2LinkDir}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/usr/openwin/lib
|
||||
/usr/X11R6/lib
|
||||
/opt/gnome/lib
|
||||
/opt/lib
|
||||
/sw/lib
|
||||
)
|
||||
gtk2_debug_message("GTK2_GLIB_LIBRARY is ${GTK2_GLIB_LIBRARY}")
|
||||
|
||||
find_library(GTK2_GTKGL_LIBRARY
|
||||
NAMES
|
||||
gtkgl-2.0
|
||||
PATHS
|
||||
${_GTK2LinkDir}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/usr/openwin/lib
|
||||
/usr/X11R6/lib
|
||||
/opt/gnome/lib
|
||||
/opt/lib
|
||||
/sw/lib
|
||||
)
|
||||
gtk2_debug_message("GTK2_GTKGL_LIBRARY is ${GTK2_GTKGL_LIBRARY}")
|
||||
|
||||
find_library(GTK2_GLADE_LIBRARY
|
||||
NAMES
|
||||
glade-2.0
|
||||
PATHS
|
||||
${_GLADELinkDir}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/usr/openwin/lib
|
||||
/usr/X11R6/lib
|
||||
/opt/gnome/lib
|
||||
/opt/lib
|
||||
/sw/lib
|
||||
)
|
||||
gtk2_debug_message("GTK2_GLADE_LIBRARY is ${GTK2_GLADE_LIBRARY}")
|
||||
|
||||
find_library(GTK2_PANGO_LIBRARY
|
||||
NAMES
|
||||
pango-1.0
|
||||
PATHS
|
||||
${_PANGOLinkDir}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/usr/openwin/lib
|
||||
/usr/X11R6/lib
|
||||
/opt/gnome/lib
|
||||
/opt/lib
|
||||
/sw/lib
|
||||
)
|
||||
gtk2_debug_message("GTK2_PANGO_LIBRARY is ${GTK2_PANGO_LIBRARY}")
|
||||
|
||||
find_library(GTK2_CAIRO_LIBRARY
|
||||
NAMES
|
||||
pangocairo-1.0
|
||||
PATHS
|
||||
${_CAIROLinkDir}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/usr/openwin/lib
|
||||
/usr/X11R6/lib
|
||||
/opt/gnome/lib
|
||||
/opt/lib
|
||||
/sw/lib
|
||||
)
|
||||
gtk2_debug_message("GTK2_PANGO_LIBRARY is ${GTK2_CAIRO_LIBRARY}")
|
||||
|
||||
find_library(GTK2_ATK_LIBRARY
|
||||
NAMES
|
||||
atk-1.0
|
||||
PATHS
|
||||
${_ATKinkDir}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/usr/openwin/lib
|
||||
/usr/X11R6/lib
|
||||
/opt/gnome/lib
|
||||
/opt/lib
|
||||
/sw/lib
|
||||
)
|
||||
gtk2_debug_message("GTK2_ATK_LIBRARY is ${GTK2_ATK_LIBRARY}")
|
||||
|
||||
set(GTK2_INCLUDE_DIRS
|
||||
${GTK2_GTK_INCLUDE_DIR}
|
||||
${GTK2_GLIBCONFIG_INCLUDE_DIR}
|
||||
${GTK2_GLIB_INCLUDE_DIR}
|
||||
${GTK2_GDK_INCLUDE_DIR}
|
||||
${GTK2_GLADE_INCLUDE_DIR}
|
||||
${GTK2_PANGO_INCLUDE_DIR}
|
||||
${GTK2_CAIRO_INCLUDE_DIR}
|
||||
${GTK2_ATK_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
if (GTK2_GTK_LIBRARY AND GTK2_GTK_INCLUDE_DIR)
|
||||
if (GTK2_GDK_LIBRARY AND GTK2_GDK_PIXBUF_LIBRARY AND GTK2_GDK_INCLUDE_DIR)
|
||||
if (GTK2_GMODULE_LIBRARY)
|
||||
if (GTK2_GTHREAD_LIBRARY)
|
||||
if (GTK2_GOBJECT_LIBRARY)
|
||||
if (GTK2_GLADE_LIBRARY AND GTK2_GLADE_INCLUDE_DIR)
|
||||
if (GTK2_PANGO_LIBRARY AND GTK2_PANGO_INCLUDE_DIR)
|
||||
if (GTK2_CAIRO_LIBRARY AND GTK2_CAIRO_INCLUDE_DIR)
|
||||
if (GTK2_ATK_LIBRARY AND GTK2_ATK_INCLUDE_DIR)
|
||||
|
||||
# set GTK2 libraries
|
||||
set (GTK2_LIBRARIES
|
||||
${GTK2_GTK_LIBRARY}
|
||||
${GTK2_GDK_LIBRARY}
|
||||
${GTK2_GDK_PIXBUF_LIBRARY}
|
||||
${GTK2_GMODULE_LIBRARY}
|
||||
${GTK2_GTHREAD_LIBRARY}
|
||||
${GTK2_GOBJECT_LIBRARY}
|
||||
${GTK2_GLADE_LIBRARY}
|
||||
${GTK2_PANGO_LIBRARY}
|
||||
${GTK2_CAIRO_LIBRARY}
|
||||
${GTK2_ATK_LIBRARY}
|
||||
)
|
||||
|
||||
# check for gtkgl support
|
||||
if (GTK2_GTKGL_LIBRARY AND GTK2_GTKGL_INCLUDE_DIR)
|
||||
set(GTK2_GTKGL_FOUND TRUE)
|
||||
|
||||
set(GTK2_INCLUDE_DIRS
|
||||
${GTK2_INCLUDE_DIRS}
|
||||
${GTK2_GTKGL_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
set(GTK2_LIBRARIES
|
||||
${GTK2_LIBRARIES}
|
||||
${GTK2_GTKGL_LIBRARY}
|
||||
)
|
||||
endif (GTK2_GTKGL_LIBRARY AND GTK2_GTKGL_INCLUDE_DIR)
|
||||
|
||||
else (GTK2_ATK_LIBRARY AND GTK2_ATK_INCLUDE_DIR)
|
||||
message(SEND_ERROR "Could not find ATK")
|
||||
endif (GTK2_ATK_LIBRARY AND GTK2_ATK_INCLUDE_DIR)
|
||||
else (GTK2_CAIRO_LIBRARY AND GTK2_CAIRO_INCLUDE_DIR)
|
||||
message(SEND_ERROR "Could not find CAIRO")
|
||||
endif (GTK2_CAIRO_LIBRARY AND GTK2_CAIRO_INCLUDE_DIR)
|
||||
else (GTK2_PANGO_LIBRARY AND GTK2_PANGO_INCLUDE_DIR)
|
||||
message(SEND_ERROR "Could not find PANGO")
|
||||
endif (GTK2_PANGO_LIBRARY AND GTK2_PANGO_INCLUDE_DIR)
|
||||
else (GTK2_GLADE_LIBRARY AND GTK2_GLADE_INCLUDE_DIR)
|
||||
message(SEND_ERROR "Could not find GLADE")
|
||||
endif (GTK2_GLADE_LIBRARY AND GTK2_GLADE_INCLUDE_DIR)
|
||||
else (GTK2_GOBJECT_LIBRARY)
|
||||
message(SEND_ERROR "Could not find GOBJECT")
|
||||
endif (GTK2_GOBJECT_LIBRARY)
|
||||
else (GTK2_GTHREAD_LIBRARY)
|
||||
message(SEND_ERROR "Could not find GTHREAD")
|
||||
endif (GTK2_GTHREAD_LIBRARY)
|
||||
else (GTK2_GMODULE_LIBRARY)
|
||||
message(SEND_ERROR "Could not find GMODULE")
|
||||
endif (GTK2_GMODULE_LIBRARY)
|
||||
else (GTK2_GDK_LIBRARY AND GTK2_GDK_PIXBUF_LIBRARY AND GTK2_GDK_INCLUDE_DIR)
|
||||
message(SEND_ERROR "Could not find GDK (GDK_PIXBUF)")
|
||||
endif (GTK2_GDK_LIBRARY AND GTK2_GDK_PIXBUF_LIBRARY AND GTK2_GDK_INCLUDE_DIR)
|
||||
else (GTK2_GTK_LIBRARY AND GTK2_GTK_INCLUDE_DIR)
|
||||
message(SEND_ERROR "Could not find GTK2-X11")
|
||||
endif (GTK2_GTK_LIBRARY AND GTK2_GTK_INCLUDE_DIR)
|
||||
|
||||
if (GTK2_INCLUDE_DIRS AND GTK2_LIBRARIES)
|
||||
set(GTK2_FOUND TRUE)
|
||||
endif (GTK2_INCLUDE_DIRS AND GTK2_LIBRARIES)
|
||||
|
||||
if (GTK2_FOUND)
|
||||
if (NOT GTK2_FIND_QUIETLY)
|
||||
message(STATUS "Found GTK2: ${GTK2_LIBRARIES}")
|
||||
endif (NOT GTK2_FIND_QUIETLY)
|
||||
else (GTK2_FOUND)
|
||||
if (GTK2_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find GTK2")
|
||||
endif (GTK2_FIND_REQUIRED)
|
||||
endif (GTK2_FOUND)
|
||||
|
||||
# show the GTK2_INCLUDE_DIRS and GTK2_LIBRARIES variables only in the advanced view
|
||||
mark_as_advanced(GTK2_INCLUDE_DIRS GTK2_LIBRARIES)
|
||||
|
||||
endif (UNIX)
|
||||
endif (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS)
|
||||
|
83
code/CMakeModules/FindIconv.cmake
Normal file
83
code/CMakeModules/FindIconv.cmake
Normal file
|
@ -0,0 +1,83 @@
|
|||
# - Try to find Iconv on Mac OS X
|
||||
# Once done this will define
|
||||
#
|
||||
# ICONV_FOUND - system has Iconv
|
||||
# ICONV_INCLUDE_DIR - the Iconv include directory
|
||||
# ICONV_LIBRARIES - Link these to use Iconv
|
||||
# ICONV_SECOND_ARGUMENT_IS_CONST - the second argument for iconv() is const
|
||||
#
|
||||
|
||||
IF(APPLE)
|
||||
include(CheckCCompilerFlag)
|
||||
include(CheckCSourceCompiles)
|
||||
|
||||
IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
|
||||
# Already in cache, be silent
|
||||
SET(ICONV_FIND_QUIETLY TRUE)
|
||||
ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
|
||||
|
||||
IF(APPLE)
|
||||
FIND_PATH(ICONV_INCLUDE_DIR iconv.h
|
||||
PATHS
|
||||
/opt/local/include/
|
||||
NO_CMAKE_SYSTEM_PATH
|
||||
)
|
||||
|
||||
FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv c
|
||||
PATHS
|
||||
/opt/local/lib/
|
||||
NO_CMAKE_SYSTEM_PATH
|
||||
)
|
||||
ENDIF(APPLE)
|
||||
|
||||
FIND_PATH(ICONV_INCLUDE_DIR iconv.h PATHS /opt/local/include /sw/include)
|
||||
|
||||
string(REGEX REPLACE "(.*)/include/?" "\\1" ICONV_INCLUDE_BASE_DIR "${ICONV_INCLUDE_DIR}")
|
||||
|
||||
FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv c HINTS "${ICONV_INCLUDE_BASE_DIR}/lib" PATHS /opt/local/lib)
|
||||
|
||||
IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
|
||||
SET(ICONV_FOUND TRUE)
|
||||
ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
|
||||
|
||||
set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
|
||||
IF(ICONV_FOUND)
|
||||
check_c_compiler_flag("-Werror" ICONV_HAVE_WERROR)
|
||||
set (CMAKE_C_FLAGS_BACKUP "${CMAKE_C_FLAGS}")
|
||||
if(ICONV_HAVE_WERROR)
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
|
||||
endif(ICONV_HAVE_WERROR)
|
||||
check_c_source_compiles("
|
||||
#include <iconv.h>
|
||||
int main(){
|
||||
iconv_t conv = 0;
|
||||
const char* in = 0;
|
||||
size_t ilen = 0;
|
||||
char* out = 0;
|
||||
size_t olen = 0;
|
||||
iconv(conv, &in, &ilen, &out, &olen);
|
||||
return 0;
|
||||
}
|
||||
" ICONV_SECOND_ARGUMENT_IS_CONST )
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BACKUP}")
|
||||
ENDIF(ICONV_FOUND)
|
||||
set(CMAKE_REQUIRED_INCLUDES)
|
||||
set(CMAKE_REQUIRED_LIBRARIES)
|
||||
|
||||
IF(ICONV_FOUND)
|
||||
IF(NOT ICONV_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found Iconv: ${ICONV_LIBRARIES}")
|
||||
ENDIF(NOT ICONV_FIND_QUIETLY)
|
||||
ELSE(ICONV_FOUND)
|
||||
IF(Iconv_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Could not find Iconv")
|
||||
ENDIF(Iconv_FIND_REQUIRED)
|
||||
ENDIF(ICONV_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
ICONV_INCLUDE_DIR
|
||||
ICONV_LIBRARIES
|
||||
ICONV_SECOND_ARGUMENT_IS_CONST
|
||||
)
|
||||
ENDIF(APPLE)
|
50
code/CMakeModules/FindJpeg.cmake
Normal file
50
code/CMakeModules/FindJpeg.cmake
Normal file
|
@ -0,0 +1,50 @@
|
|||
# - Locate Jpeg library
|
||||
# This module defines
|
||||
# JPEG_LIBRARY, the library to link against
|
||||
# JPEG_FOUND, if false, do not try to link to JPEG
|
||||
# JPEG_INCLUDE_DIR, where to find headers.
|
||||
|
||||
IF(JPEG_LIBRARY AND JPEG_INCLUDE_DIR)
|
||||
# in cache already
|
||||
SET(JPEG_FIND_QUIETLY TRUE)
|
||||
ENDIF(JPEG_LIBRARY AND JPEG_INCLUDE_DIR)
|
||||
|
||||
|
||||
FIND_PATH(JPEG_INCLUDE_DIR
|
||||
jpeglib.h
|
||||
PATHS
|
||||
$ENV{JPEG_DIR}/include
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
/opt/csw/include
|
||||
/opt/include
|
||||
PATH_SUFFIXES jpeg
|
||||
)
|
||||
|
||||
FIND_LIBRARY(JPEG_LIBRARY
|
||||
NAMES jpeg libjpeg
|
||||
PATHS
|
||||
$ENV{JPEG_DIR}/lib
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/local/X11R6/lib
|
||||
/usr/X11R6/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
IF(JPEG_LIBRARY AND JPEG_INCLUDE_DIR)
|
||||
SET(JPEG_FOUND "YES")
|
||||
IF(NOT JPEG_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found Jpeg: ${JPEG_LIBRARY}")
|
||||
ENDIF(NOT JPEG_FIND_QUIETLY)
|
||||
ELSE(JPEG_LIBRARY AND JPEG_INCLUDE_DIR)
|
||||
IF(NOT JPEG_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Warning: Unable to find Jpeg!")
|
||||
ENDIF(NOT JPEG_FIND_QUIETLY)
|
||||
ENDIF(JPEG_LIBRARY AND JPEG_INCLUDE_DIR)
|
155
code/CMakeModules/FindLibwww.cmake
Normal file
155
code/CMakeModules/FindLibwww.cmake
Normal file
|
@ -0,0 +1,155 @@
|
|||
#
|
||||
# Find the W3C libwww includes and library
|
||||
#
|
||||
# This module defines
|
||||
# LIBWWW_INCLUDE_DIR, where to find tiff.h, etc.
|
||||
# LIBWWW_LIBRARY, where to find the LibWWW library.
|
||||
# LIBWWW_FOUND, If false, do not try to use LibWWW.
|
||||
|
||||
SET(LIBWWW_FIND_QUIETLY ${Libwww_FIND_QUIETLY})
|
||||
|
||||
# also defined, but not for general use are
|
||||
IF(LIBWWW_LIBRARIES AND LIBWWW_INCLUDE_DIR)
|
||||
# in cache already
|
||||
SET(LIBWWW_FIND_QUIETLY TRUE)
|
||||
ENDIF(LIBWWW_LIBRARIES AND LIBWWW_INCLUDE_DIR)
|
||||
|
||||
FIND_PATH(LIBWWW_INCLUDE_DIR
|
||||
WWWInit.h
|
||||
PATHS
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
/opt/csw/include
|
||||
/opt/include
|
||||
PATH_SUFFIXES libwww w3c-libwww
|
||||
)
|
||||
|
||||
# when installing libwww on mac os x using macports the file wwwconf.h resides
|
||||
# in /opt/local/include and not in the real libwww include dir :/
|
||||
FIND_PATH(LIBWWW_ADDITIONAL_INCLUDE_DIR
|
||||
wwwconf.h
|
||||
PATHS
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
/opt/csw/include
|
||||
/opt/include
|
||||
)
|
||||
|
||||
# combine both include directories into one variable
|
||||
IF(LIBWWW_ADDITIONAL_INCLUDE_DIR)
|
||||
SET(LIBWWW_INCLUDE_DIR ${LIBWWW_INCLUDE_DIR} ${LIBWWW_ADDITIONAL_INCLUDE_DIR})
|
||||
ENDIF(LIBWWW_ADDITIONAL_INCLUDE_DIR)
|
||||
|
||||
# helper to find all the libwww sub libraries
|
||||
MACRO(FIND_WWW_LIBRARY MYLIBRARY OPTION)
|
||||
FIND_LIBRARY(${MYLIBRARY}
|
||||
NAMES ${ARGN}
|
||||
PATHS
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/local/X11R6/lib
|
||||
/usr/X11R6/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
IF(${MYLIBRARY})
|
||||
IF(${OPTION} STREQUAL REQUIRED OR WITH_STATIC)
|
||||
SET(LIBWWW_LIBRARIES ${LIBWWW_LIBRARIES} ${${MYLIBRARY}})
|
||||
ENDIF(${OPTION} STREQUAL REQUIRED OR WITH_STATIC)
|
||||
ELSE(${MYLIBRARY})
|
||||
IF(NOT LIBWWW_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Warning: Libwww: Library not found: ${MYLIBRARY}")
|
||||
ENDIF(NOT LIBWWW_FIND_QUIETLY)
|
||||
ENDIF(${MYLIBRARY})
|
||||
|
||||
MARK_AS_ADVANCED(${MYLIBRARY})
|
||||
ENDMACRO(FIND_WWW_LIBRARY)
|
||||
|
||||
MACRO(LINK_WWW_LIBRARY MYLIBRARY OTHERLIBRARY SYMBOL)
|
||||
LINK_DEPENDS(LIBWWW_LIBRARIES ${MYLIBRARY} ${OTHERLIBRARY} ${SYMBOL})
|
||||
ENDMACRO(LINK_WWW_LIBRARY)
|
||||
|
||||
# Find and link required libs for static or dynamic
|
||||
FIND_WWW_LIBRARY(LIBWWWAPP_LIBRARY REQUIRED wwwapp) # cache core file ftp gopher html http mime news stream telnet trans utils zip xml xmlparse
|
||||
FIND_WWW_LIBRARY(LIBWWWCORE_LIBRARY REQUIRED wwwcore) # utils
|
||||
FIND_WWW_LIBRARY(LIBWWWFILE_LIBRARY REQUIRED wwwfile) # core trans utils html
|
||||
FIND_WWW_LIBRARY(LIBWWWHTML_LIBRARY REQUIRED wwwhtml) # core utils
|
||||
FIND_WWW_LIBRARY(LIBWWWHTTP_LIBRARY REQUIRED wwwhttp) # md5 core mime stream utils
|
||||
FIND_WWW_LIBRARY(LIBWWWMIME_LIBRARY REQUIRED wwwmime) # core cache stream utils
|
||||
|
||||
# Required for static or if underlinking
|
||||
FIND_WWW_LIBRARY(LIBWWWCACHE_LIBRARY OPTIONAL wwwcache) # core trans utils
|
||||
FIND_WWW_LIBRARY(LIBWWWSTREAM_LIBRARY OPTIONAL wwwstream) # core file utils
|
||||
|
||||
FIND_WWW_LIBRARY(LIBWWWTRANS_LIBRARY REQUIRED wwwtrans) # core utils
|
||||
FIND_WWW_LIBRARY(LIBWWWUTILS_LIBRARY REQUIRED wwwutils)
|
||||
|
||||
|
||||
# Required only if underlinking
|
||||
|
||||
# Unused protocols
|
||||
FIND_WWW_LIBRARY(LIBWWWFTP_LIBRARY OPTIONAL wwwftp) # core file utils
|
||||
FIND_WWW_LIBRARY(LIBWWWGOPHER_LIBRARY OPTIONAL wwwgopher) # core html utils file
|
||||
FIND_WWW_LIBRARY(LIBWWWNEWS_LIBRARY OPTIONAL wwwnews) # core html mime stream utils
|
||||
FIND_WWW_LIBRARY(LIBWWWTELNET_LIBRARY OPTIONAL wwwtelnet) # core utils
|
||||
|
||||
# Other used by app
|
||||
FIND_WWW_LIBRARY(LIBWWWDIR_LIBRARY OPTIONAL wwwdir) # file
|
||||
FIND_WWW_LIBRARY(LIBWWWINIT_LIBRARY OPTIONAL wwwinit) # app cache core file html utils
|
||||
FIND_WWW_LIBRARY(LIBWWWMUX_LIBRARY OPTIONAL wwwmux) # core stream trans utils
|
||||
FIND_WWW_LIBRARY(LIBWWWXML_LIBRARY OPTIONAL wwwxml) # core utils xmlparse
|
||||
FIND_WWW_LIBRARY(LIBWWWZIP_LIBRARY OPTIONAL wwwzip) # core utils
|
||||
FIND_WWW_LIBRARY(LIBXMLPARSE_LIBRARY OPTIONAL xmlparse) # xmltok
|
||||
|
||||
# Other used by other
|
||||
FIND_WWW_LIBRARY(LIBXMLTOK_LIBRARY OPTIONAL xmltok)
|
||||
FIND_WWW_LIBRARY(LIBWWWSSL_LIBRARY OPTIONAL wwwssl)
|
||||
FIND_WWW_LIBRARY(LIBMD5_LIBRARY OPTIONAL md5)
|
||||
FIND_WWW_LIBRARY(LIBPICS_LIBRARY OPTIONAL pics)
|
||||
|
||||
# Other external libraries
|
||||
FIND_PACKAGE(EXPAT QUIET)
|
||||
FIND_PACKAGE(OpenSSL QUIET)
|
||||
FIND_WWW_LIBRARY(LIBREGEX_LIBRARY OPTIONAL gnu_regex)
|
||||
|
||||
# Now link all libs together
|
||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWCACHE_LIBRARY HTLoadCache)
|
||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWCACHE_LIBRARY HTCacheAppend)
|
||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWFTP_LIBRARY HTLoadFTP)
|
||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWGOPHER_LIBRARY HTLoadGopher)
|
||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWNEWS_LIBRARY HTLoadNews)
|
||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWTELNET_LIBRARY HTLoadTelnet)
|
||||
|
||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWSTREAM_LIBRARY HTStreamToChunk)
|
||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWSTREAM_LIBRARY HTGuess_new)
|
||||
LINK_WWW_LIBRARY(LIBWWWFILE_LIBRARY LIBWWWDIR_LIBRARY HTDir_new)
|
||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWINIT_LIBRARY HTProtocolInit)
|
||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWXML_LIBRARY HTXML_new)
|
||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWZIP_LIBRARY HTZLib_inflate)
|
||||
|
||||
# libwwwxml can be linked to xmlparse or expat
|
||||
LINK_WWW_LIBRARY(LIBWWWXML_LIBRARY LIBXMLPARSE_LIBRARY XML_ParserCreate)
|
||||
|
||||
IF(LIBXMLPARSE_LIBRARY_LINKED)
|
||||
LINK_WWW_LIBRARY(LIBXMLPARSE_LIBRARY EXPAT_LIBRARY XmlInitEncoding)
|
||||
ELSE(LIBXMLPARSE_LIBRARY_LINKED)
|
||||
LINK_WWW_LIBRARY(LIBWWWXML_LIBRARY EXPAT_LIBRARY XML_ParserCreate)
|
||||
ENDIF(LIBXMLPARSE_LIBRARY_LINKED)
|
||||
|
||||
LINK_WWW_LIBRARY(LIBWWWHTTP_LIBRARY LIBMD5_LIBRARY MD5Init)
|
||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBREGEX_LIBRARY regexec)
|
||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY OPENSSL_LIBRARIES SSL_new)
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibWWW DEFAULT_MSG
|
||||
LIBWWW_LIBRARIES
|
||||
LIBWWW_INCLUDE_DIR
|
||||
)
|
96
code/CMakeModules/FindLuabind.cmake
Normal file
96
code/CMakeModules/FindLuabind.cmake
Normal file
|
@ -0,0 +1,96 @@
|
|||
# - Locate Luabind library
|
||||
# This module defines
|
||||
# LUABIND_LIBRARIES, the libraries to link against
|
||||
# LUABIND_FOUND, if false, do not try to link to LUABIND
|
||||
# LUABIND_INCLUDE_DIR, where to find headers.
|
||||
|
||||
IF(LUABIND_LIBRARIES AND LUABIND_INCLUDE_DIR)
|
||||
# in cache already
|
||||
SET(Luabind_FIND_QUIETLY TRUE)
|
||||
ENDIF(LUABIND_LIBRARIES AND LUABIND_INCLUDE_DIR)
|
||||
|
||||
FIND_PATH(LUABIND_INCLUDE_DIR
|
||||
luabind/luabind.hpp
|
||||
PATHS
|
||||
$ENV{LUABIND_DIR}/include
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
/opt/csw/include
|
||||
/opt/include
|
||||
)
|
||||
|
||||
SET(LIBRARY_NAME_RELEASE luabind libluabind)
|
||||
SET(LIBRARY_NAME_DEBUG luabind_d luabindd libluabind_d libluabindd)
|
||||
|
||||
IF(WITH_STLPORT)
|
||||
SET(LIBRARY_NAME_RELEASE luabind_stlport ${LIBRARY_NAME_RELEASE})
|
||||
SET(LIBRARY_NAME_DEBUG luabind_stlportd ${LIBRARY_NAME_DEBUG})
|
||||
ENDIF(WITH_STLPORT)
|
||||
|
||||
FIND_LIBRARY(LUABIND_LIBRARY_RELEASE
|
||||
NAMES ${LIBRARY_NAME_RELEASE}
|
||||
PATHS
|
||||
$ENV{LUABIND_DIR}/lib
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/local/X11R6/lib
|
||||
/usr/X11R6/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
FIND_LIBRARY(LUABIND_LIBRARY_DEBUG
|
||||
NAMES ${LIBRARY_NAME_DEBUG}
|
||||
PATHS
|
||||
$ENV{LUABIND_DIR}/lib
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/local/X11R6/lib
|
||||
/usr/X11R6/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
FIND_PACKAGE(Boost REQUIRED)
|
||||
|
||||
IF(LUABIND_INCLUDE_DIR AND Boost_INCLUDE_DIR)
|
||||
IF(LUABIND_LIBRARY_RELEASE AND LUABIND_LIBRARY_DEBUG)
|
||||
# Case where both Release and Debug versions are provided
|
||||
SET(LUABIND_FOUND TRUE)
|
||||
SET(LUABIND_LIBRARIES optimized ${LUABIND_LIBRARY_RELEASE} debug ${LUABIND_LIBRARY_DEBUG})
|
||||
ELSEIF(LUABIND_LIBRARY_RELEASE)
|
||||
# Normal case
|
||||
SET(LUABIND_FOUND TRUE)
|
||||
SET(LUABIND_LIBRARIES ${LUABIND_LIBRARY_RELEASE})
|
||||
ELSEIF(LUABIND_LIBRARY_DEBUG)
|
||||
# Case where Luabind is compiled from sources (debug version is compiled by default)
|
||||
SET(LUABIND_FOUND TRUE)
|
||||
SET(LUABIND_LIBRARIES ${LUABIND_LIBRARY_DEBUG})
|
||||
ENDIF(LUABIND_LIBRARY_RELEASE AND LUABIND_LIBRARY_DEBUG)
|
||||
ENDIF(LUABIND_INCLUDE_DIR AND Boost_INCLUDE_DIR)
|
||||
|
||||
IF(LUABIND_FOUND)
|
||||
SET(LUABIND_INCLUDE_DIR ${LUABIND_INCLUDE_DIR} ${Boost_INCLUDE_DIR})
|
||||
# Check if luabind/version.hpp exists
|
||||
FIND_FILE(LUABIND_VERSION_FILE luabind/version.hpp PATHS ${LUABIND_INCLUDE_DIR})
|
||||
IF(LUABIND_VERSION_FILE)
|
||||
SET(LUABIND_DEFINITIONS "-DHAVE_LUABIND_VERSION")
|
||||
ENDIF(LUABIND_VERSION_FILE)
|
||||
IF(NOT Luabind_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found Luabind: ${LUABIND_LIBRARIES}")
|
||||
ENDIF(NOT Luabind_FIND_QUIETLY)
|
||||
ELSE(LUABIND_FOUND)
|
||||
IF(NOT Luabind_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Warning: Unable to find Luabind!")
|
||||
ENDIF(NOT Luabind_FIND_QUIETLY)
|
||||
ENDIF(LUABIND_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(LUABIND_LIBRARY_RELEASE LUABIND_LIBRARY_DEBUG Boost_LIB_DIAGNOSTIC_DEFINITIONS)
|
74
code/CMakeModules/FindMySQL.cmake
Normal file
74
code/CMakeModules/FindMySQL.cmake
Normal file
|
@ -0,0 +1,74 @@
|
|||
# - Find MySQL
|
||||
# Find the MySQL includes and client library
|
||||
# This module defines
|
||||
# MYSQL_INCLUDE_DIR, where to find mysql.h
|
||||
# MYSQL_LIBRARIES, the libraries needed to use MySQL.
|
||||
# MYSQL_FOUND, If false, do not try to use MySQL.
|
||||
#
|
||||
# Copyright (c) 2006, Jaroslaw Staniek, <js@iidea.pl>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
IF(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
|
||||
SET(MYSQL_FOUND TRUE)
|
||||
|
||||
ELSE(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
|
||||
|
||||
FIND_PATH(MYSQL_INCLUDE_DIR mysql.h
|
||||
/usr/include/mysql
|
||||
/usr/local/include/mysql
|
||||
/opt/local/include/mysql5/mysql
|
||||
$ENV{ProgramFiles}/MySQL/*/include
|
||||
$ENV{SystemDrive}/MySQL/*/include)
|
||||
|
||||
IF(WIN32 AND MSVC)
|
||||
FIND_LIBRARY(MYSQL_LIBRARY_RELEASE NAMES libmysql mysqlclient
|
||||
PATHS
|
||||
$ENV{ProgramFiles}/MySQL/*/lib/opt
|
||||
$ENV{SystemDrive}/MySQL/*/lib/opt)
|
||||
|
||||
FIND_LIBRARY(MYSQL_LIBRARY_DEBUG NAMES libmysqld mysqlclientd
|
||||
PATHS
|
||||
$ENV{ProgramFiles}/MySQL/*/lib/opt
|
||||
$ENV{SystemDrive}/MySQL/*/lib/opt)
|
||||
ELSE(WIN32 AND MSVC)
|
||||
FIND_LIBRARY(MYSQL_LIBRARY_RELEASE NAMES mysqlclient
|
||||
PATHS
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/usr/lib/mysql
|
||||
/usr/local/lib/mysql
|
||||
/opt/local/lib/mysql5/mysql
|
||||
)
|
||||
|
||||
FIND_LIBRARY(MYSQL_LIBRARY_DEBUG NAMES mysqlclientd
|
||||
PATHS
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/usr/lib/mysql
|
||||
/usr/local/lib/mysql
|
||||
/opt/local/lib/mysql5/mysql
|
||||
)
|
||||
ENDIF(WIN32 AND MSVC)
|
||||
|
||||
IF(MYSQL_INCLUDE_DIR)
|
||||
IF(MYSQL_LIBRARY_RELEASE)
|
||||
SET(MYSQL_LIBRARIES "optimized;${MYSQL_LIBRARY_RELEASE}")
|
||||
IF(MYSQL_LIBRARY_DEBUG)
|
||||
SET(MYSQL_LIBRARIES "${MYSQL_LIBRARIES};debug;${MYSQL_LIBRARY_DEBUG}")
|
||||
ENDIF(MYSQL_LIBRARY_DEBUG)
|
||||
ENDIF(MYSQL_LIBRARY_RELEASE)
|
||||
ENDIF(MYSQL_INCLUDE_DIR)
|
||||
|
||||
IF(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
|
||||
SET(MYSQL_FOUND TRUE)
|
||||
MESSAGE(STATUS "Found MySQL: ${MYSQL_INCLUDE_DIR}, ${MYSQL_LIBRARIES}")
|
||||
ELSE(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
|
||||
SET(MYSQL_FOUND FALSE)
|
||||
MESSAGE(STATUS "MySQL not found.")
|
||||
ENDIF(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
|
||||
|
||||
MARK_AS_ADVANCED(MYSQL_LIBRARY_RELEASE MYSQL_LIBRARY_DEBUG)
|
||||
|
||||
ENDIF(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
|
49
code/CMakeModules/FindOgg.cmake
Normal file
49
code/CMakeModules/FindOgg.cmake
Normal file
|
@ -0,0 +1,49 @@
|
|||
# - Locate Ogg library
|
||||
# This module defines
|
||||
# OGG_LIBRARY, the library to link against
|
||||
# OGG_FOUND, if false, do not try to link to OGG
|
||||
# OGG_INCLUDE_DIR, where to find headers.
|
||||
|
||||
IF(OGG_LIBRARY AND OGG_INCLUDE_DIR)
|
||||
# in cache already
|
||||
SET(OGG_FIND_QUIETLY TRUE)
|
||||
ENDIF(OGG_LIBRARY AND OGG_INCLUDE_DIR)
|
||||
|
||||
|
||||
FIND_PATH(OGG_INCLUDE_DIR
|
||||
ogg/ogg.h
|
||||
PATHS
|
||||
$ENV{OGG_DIR}/include
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
/opt/csw/include
|
||||
/opt/include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(OGG_LIBRARY
|
||||
NAMES ogg libogg
|
||||
PATHS
|
||||
$ENV{OGG_DIR}/lib
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/local/X11R6/lib
|
||||
/usr/X11R6/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
IF(OGG_LIBRARY AND OGG_INCLUDE_DIR)
|
||||
SET(OGG_FOUND "YES")
|
||||
IF(NOT OGG_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found Ogg: ${OGG_LIBRARY}")
|
||||
ENDIF(NOT OGG_FIND_QUIETLY)
|
||||
ELSE(OGG_LIBRARY AND OGG_INCLUDE_DIR)
|
||||
IF(NOT OGG_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Warning: Unable to find Ogg!")
|
||||
ENDIF(NOT OGG_FIND_QUIETLY)
|
||||
ENDIF(OGG_LIBRARY AND OGG_INCLUDE_DIR)
|
50
code/CMakeModules/FindS3TC.cmake
Normal file
50
code/CMakeModules/FindS3TC.cmake
Normal file
|
@ -0,0 +1,50 @@
|
|||
# - Locate S3TC library
|
||||
# This module defines
|
||||
# S3TC_LIBRARY, the library to link against
|
||||
# S3TC_FOUND, if false, do not try to link to S3TC
|
||||
# S3TC_INCLUDE_DIR, where to find headers.
|
||||
|
||||
IF(S3TC_LIBRARY AND S3TC_INCLUDE_DIR)
|
||||
# in cache already
|
||||
SET(S3TC_FIND_QUIETLY TRUE)
|
||||
ENDIF(S3TC_LIBRARY AND S3TC_INCLUDE_DIR)
|
||||
|
||||
|
||||
FIND_PATH(S3TC_INCLUDE_DIR
|
||||
s3_intrf.h
|
||||
PATHS
|
||||
$ENV{S3TC_DIR}/include
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
/opt/csw/include
|
||||
/opt/include
|
||||
PATH_SUFFIXES S3TC
|
||||
)
|
||||
|
||||
FIND_LIBRARY(S3TC_LIBRARY
|
||||
NAMES s3tc libs3tc
|
||||
PATHS
|
||||
$ENV{S3TC_DIR}/lib
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/local/X11R6/lib
|
||||
/usr/X11R6/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
IF(S3TC_LIBRARY AND S3TC_INCLUDE_DIR)
|
||||
SET(S3TC_FOUND "YES")
|
||||
IF(NOT S3TC_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found S3TC: ${S3TC_LIBRARY}")
|
||||
ENDIF(NOT S3TC_FIND_QUIETLY)
|
||||
ELSE(S3TC_LIBRARY AND S3TC_INCLUDE_DIR)
|
||||
IF(NOT S3TC_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Warning: Unable to find S3TC!")
|
||||
ENDIF(NOT S3TC_FIND_QUIETLY)
|
||||
ENDIF(S3TC_LIBRARY AND S3TC_INCLUDE_DIR)
|
91
code/CMakeModules/FindSTLport.cmake
Normal file
91
code/CMakeModules/FindSTLport.cmake
Normal file
|
@ -0,0 +1,91 @@
|
|||
# Look for a directory containing STLport.
|
||||
#
|
||||
# The following values are defined
|
||||
# STLPORT_INCLUDE_DIR - where to find vector, etc.
|
||||
# STLPORT_LIBRARIES - link against these to use STLport
|
||||
# STLPORT_FOUND - True if the STLport is available.
|
||||
|
||||
# also defined, but not for general use are
|
||||
IF(STLPORT_LIBRARIES AND STLPORT_INCLUDE_DIR)
|
||||
# in cache already
|
||||
SET(STLPORT_FIND_QUIETLY TRUE)
|
||||
ENDIF(STLPORT_LIBRARIES AND STLPORT_INCLUDE_DIR)
|
||||
|
||||
FIND_PATH(STLPORT_INCLUDE_DIR
|
||||
iostream
|
||||
PATHS
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
/opt/csw/include
|
||||
/opt/include
|
||||
PATH_SUFFIXES stlport
|
||||
)
|
||||
|
||||
FIND_LIBRARY(STLPORT_LIBRARY_DEBUG
|
||||
NAMES
|
||||
stlport_cygwin_debug
|
||||
stlport_cygwin_stldebug
|
||||
stlport_gcc_debug
|
||||
stlport_gcc_stldebug
|
||||
stlportstld_x
|
||||
stlportstld_x.5.2
|
||||
stlportd
|
||||
stlportd_statix
|
||||
stlportd_static
|
||||
PATHS
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/local/X11R6/lib
|
||||
/usr/X11R6/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
FIND_LIBRARY(STLPORT_LIBRARY_RELEASE
|
||||
NAMES
|
||||
stlport_cygwin
|
||||
stlport_gcc
|
||||
stlport
|
||||
stlport_x
|
||||
stlport_x.5.2
|
||||
stlport_statix
|
||||
stlport_static
|
||||
PATHS
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/local/X11R6/lib
|
||||
/usr/X11R6/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
IF(STLPORT_INCLUDE_DIR)
|
||||
IF(STLPORT_LIBRARY_RELEASE)
|
||||
SET(STLPORT_FOUND TRUE)
|
||||
|
||||
SET(STLPORT_LIBRARIES ${STLPORT_LIBRARY_RELEASE})
|
||||
IF(STLPORT_LIBRARY_DEBUG)
|
||||
SET(STLPORT_LIBRARIES optimized ${STLPORT_LIBRARIES} debug ${STLPORT_LIBRARY_DEBUG})
|
||||
ENDIF(STLPORT_LIBRARY_DEBUG)
|
||||
ENDIF(STLPORT_LIBRARY_RELEASE)
|
||||
ENDIF(STLPORT_INCLUDE_DIR)
|
||||
|
||||
IF(STLPORT_FOUND)
|
||||
IF(NOT STLPORT_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found STLport: ${STLPORT_LIBRARIES}")
|
||||
ENDIF(NOT STLPORT_FIND_QUIETLY)
|
||||
ELSE(STLPORT_FOUND)
|
||||
IF(NOT STLPORT_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Warning: Unable to find STLport!")
|
||||
ENDIF(NOT STLPORT_FIND_QUIETLY)
|
||||
ENDIF(STLPORT_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(STLPORT_LIBRARY_RELEASE STLPORT_LIBRARY_DEBUG)
|
76
code/CMakeModules/FindSquish.cmake
Normal file
76
code/CMakeModules/FindSquish.cmake
Normal file
|
@ -0,0 +1,76 @@
|
|||
#
|
||||
# Find the LibSquish includes and library
|
||||
#
|
||||
# This module defines
|
||||
# SQUISH_INCLUDE_DIR, where to find squish.h
|
||||
# SQUISH_LIBRARIES, where to find the Squish libraries.
|
||||
# SQUISH_FOUND, If false, do not try to use Squish.
|
||||
|
||||
# also defined, but not for general use are
|
||||
IF(SQUISH_LIBRARIES AND SQUISH_INCLUDE_DIR)
|
||||
# in cache already
|
||||
SET(SQUISH_FIND_QUIETLY TRUE)
|
||||
ENDIF(SQUISH_LIBRARIES AND SQUISH_INCLUDE_DIR)
|
||||
|
||||
FIND_PATH(SQUISH_INCLUDE_DIR
|
||||
squish.h
|
||||
PATHS
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
/opt/csw/include
|
||||
/opt/include
|
||||
PATH_SUFFIXES cppunit
|
||||
)
|
||||
|
||||
FIND_LIBRARY(SQUISH_LIBRARY_RELEASE
|
||||
squish
|
||||
PATHS
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/local/X11R6/lib
|
||||
/usr/X11R6/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
FIND_LIBRARY(SQUISH_LIBRARY_DEBUG
|
||||
squishd
|
||||
PATHS
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/local/X11R6/lib
|
||||
/usr/X11R6/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
IF(SQUISH_INCLUDE_DIR)
|
||||
IF(SQUISH_LIBRARY_RELEASE)
|
||||
SET(SQUISH_FOUND "YES")
|
||||
|
||||
SET(SQUISH_LIBRARIES "optimized;${SQUISH_LIBRARY_RELEASE}")
|
||||
IF(SQUISH_LIBRARY_DEBUG)
|
||||
SET(SQUISH_LIBRARIES "${SQUISH_LIBRARIES};debug;${SQUISH_LIBRARY_DEBUG}")
|
||||
ENDIF(SQUISH_LIBRARY_DEBUG)
|
||||
ENDIF(SQUISH_LIBRARY_RELEASE)
|
||||
ENDIF(SQUISH_INCLUDE_DIR)
|
||||
|
||||
IF(SQUISH_FOUND)
|
||||
IF(NOT SQUISH_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found Squish: ${SQUISH_LIBRARIES}")
|
||||
ENDIF(NOT SQUISH_FIND_QUIETLY)
|
||||
ELSE(SQUISH_FOUND)
|
||||
IF(NOT SQUISH_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Warning: Unable to find Squish!")
|
||||
ENDIF(NOT SQUISH_FIND_QUIETLY)
|
||||
ENDIF(SQUISH_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(SQUISH_LIBRARY_RELEASE SQUISH_LIBRARY_DEBUG)
|
65
code/CMakeModules/FindVorbis.cmake
Normal file
65
code/CMakeModules/FindVorbis.cmake
Normal file
|
@ -0,0 +1,65 @@
|
|||
# - Locate Vorbis library
|
||||
# This module defines
|
||||
# VORBIS_LIBRARY, the library to link against
|
||||
# VORBIS_FOUND, if false, do not try to link to VORBIS
|
||||
# VORBIS_INCLUDE_DIR, where to find headers.
|
||||
|
||||
IF(VORBIS_LIBRARY AND VORBIS_INCLUDE_DIR)
|
||||
# in cache already
|
||||
SET(VORBIS_FIND_QUIETLY TRUE)
|
||||
ENDIF(VORBIS_LIBRARY AND VORBIS_INCLUDE_DIR)
|
||||
|
||||
|
||||
FIND_PATH(VORBIS_INCLUDE_DIR
|
||||
vorbis/vorbisfile.h
|
||||
PATHS
|
||||
$ENV{VORBIS_DIR}/include
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
/opt/csw/include
|
||||
/opt/include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(VORBIS_LIBRARY
|
||||
NAMES vorbis libvorbis
|
||||
PATHS
|
||||
$ENV{VORBIS_DIR}/lib
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/local/X11R6/lib
|
||||
/usr/X11R6/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
FIND_LIBRARY(VORBISFILE_LIBRARY
|
||||
NAMES vorbisfile libvorbisfile
|
||||
PATHS
|
||||
$ENV{VORBIS_DIR}/lib
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/local/X11R6/lib
|
||||
/usr/X11R6/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
IF(VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBIS_INCLUDE_DIR)
|
||||
SET(VORBIS_FOUND "YES")
|
||||
SET(VORBIS_LIBRARIES ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY})
|
||||
IF(NOT VORBIS_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found Vorbis: ${VORBIS_LIBRARY}")
|
||||
ENDIF(NOT VORBIS_FIND_QUIETLY)
|
||||
ELSE(VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBIS_INCLUDE_DIR)
|
||||
IF(NOT VORBIS_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Warning: Unable to find Vorbis!")
|
||||
ENDIF(NOT VORBIS_FIND_QUIETLY)
|
||||
ENDIF(VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBIS_INCLUDE_DIR)
|
42
code/CMakeModules/FindWindowsSDK.cmake
Normal file
42
code/CMakeModules/FindWindowsSDK.cmake
Normal file
|
@ -0,0 +1,42 @@
|
|||
# - Find Windows Platform SDK
|
||||
# Find the Windows includes
|
||||
#
|
||||
# WINSDK_INCLUDE_DIR - where to find Windows.h
|
||||
# WINSDK_FOUND - True if Windows SDK found.
|
||||
|
||||
IF(WINSDK_INCLUDE_DIR)
|
||||
# Already in cache, be silent
|
||||
SET(WINSDK_FIND_QUIETLY TRUE)
|
||||
ENDIF(WINSDK_INCLUDE_DIR)
|
||||
|
||||
GET_FILENAME_COMPONENT(WINSDK71_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1;InstallationFolder]" ABSOLUTE CACHE)
|
||||
GET_FILENAME_COMPONENT(WINSDK71_VERSION "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1;ProductVersion]" NAME)
|
||||
|
||||
IF(WINSDK71_DIR)
|
||||
IF(NOT WINSDK_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found Windows SDK ${WINSDK71_VERSION} in ${WINSDK71_DIR}")
|
||||
ENDIF(NOT WINSDK_FIND_QUIETLY)
|
||||
ENDIF(WINSDK71_DIR)
|
||||
|
||||
GET_FILENAME_COMPONENT(WINSDKCURRENT_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" ABSOLUTE CACHE)
|
||||
GET_FILENAME_COMPONENT(WINSDKCURRENT_VERSION "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentVersion]" NAME)
|
||||
|
||||
IF(WINSDKCURRENT_DIR)
|
||||
IF(NOT WINSDK_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found Windows SDK ${WINSDKCURRENT_VERSION} in ${WINSDKCURRENT_DIR}")
|
||||
ENDIF(NOT WINSDK_FIND_QUIETLY)
|
||||
ENDIF(WINSDKCURRENT_DIR)
|
||||
|
||||
FIND_PATH(WINSDK_INCLUDE_DIR Windows.h
|
||||
PATHS
|
||||
${WINSDK71_DIR}/Include
|
||||
${WINSDKCURRENT_DIR}/Include
|
||||
)
|
||||
|
||||
IF(WINSDK_INCLUDE_DIR)
|
||||
SET(WINSDK_FOUND TRUE)
|
||||
ELSE(WINSDK_INCLUDE_DIR)
|
||||
IF(NOT WINSDK_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Warning: Unable to find Windows SDK!")
|
||||
ENDIF(NOT WINSDK_FIND_QUIETLY)
|
||||
ENDIF(WINSDK_INCLUDE_DIR)
|
46
code/CMakeModules/FindXF86VidMode.cmake
Normal file
46
code/CMakeModules/FindXF86VidMode.cmake
Normal file
|
@ -0,0 +1,46 @@
|
|||
# - Locate Jpeg library
|
||||
# This module defines
|
||||
# XF86VidMode_LIBRARY, the library to link against
|
||||
# XF86VidMode_FOUND, if false, do not try to link to XF86VidMode
|
||||
# XF86VidMode_INCLUDE_DIR, where to find headers.
|
||||
|
||||
IF(XF86VidMode_LIBRARY AND XF86VidMode_INCLUDE_DIR)
|
||||
# in cache already
|
||||
SET(XF86VidMode_FIND_QUIETLY TRUE)
|
||||
ENDIF(XF86VidMode_LIBRARY AND XF86VidMode_INCLUDE_DIR)
|
||||
|
||||
|
||||
FIND_PATH(XF86VidMode_INCLUDE_DIR
|
||||
xf86vmode.h
|
||||
PATHS
|
||||
$ENV{XF86VidMode_DIR}/include
|
||||
/usr/include/X11/
|
||||
/usr/X11R6/include/
|
||||
PATH_SUFFIXES extensions
|
||||
)
|
||||
|
||||
FIND_LIBRARY(XF86VidMode_LIBRARY
|
||||
Xxf86vm
|
||||
PATHS
|
||||
$ENV{XF86VidMode_DIR}/lib
|
||||
/usr/X11R6/lib
|
||||
/usr/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
IF(XF86VidMode_LIBRARY AND XF86VidMode_INCLUDE_DIR)
|
||||
SET(XF86VidMode_FOUND "YES")
|
||||
SET(XF86VidMode_DEFINITIONS -DXF86VIDMODE)
|
||||
IF(NOT XF86VidMode_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found XF86VidMode: ${XF86VidMode_LIBRARY}")
|
||||
ENDIF(NOT XF86VidMode_FIND_QUIETLY)
|
||||
ELSE(XF86VidMode_LIBRARY AND XF86VidMode_INCLUDE_DIR)
|
||||
IF(NOT XF86VidMode_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Warning: Unable to find XF86VidMode!")
|
||||
ENDIF(NOT XF86VidMode_FIND_QUIETLY)
|
||||
ENDIF(XF86VidMode_LIBRARY AND XF86VidMode_INCLUDE_DIR)
|
||||
|
213
code/CMakeModules/PCHSupport.cmake
Normal file
213
code/CMakeModules/PCHSupport.cmake
Normal file
|
@ -0,0 +1,213 @@
|
|||
# - Try to find precompiled headers support for GCC 3.4 and 4.x (and MSVC)
|
||||
# Once done this will define:
|
||||
#
|
||||
# Variable:
|
||||
# PCHSupport_FOUND
|
||||
#
|
||||
# ADD_PRECOMPILED_HEADER _targetName _inputh _inputcpp
|
||||
# ADD_PRECOMPILED_HEADER_TO_TARGET _targetName _input _pch_output_to_use
|
||||
# ADD_NATIVE_PRECOMPILED_HEADER _targetName _inputh _inputcpp
|
||||
|
||||
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
EXEC_PROGRAM(
|
||||
${CMAKE_CXX_COMPILER}
|
||||
ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
|
||||
OUTPUT_VARIABLE gcc_compiler_version)
|
||||
|
||||
IF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
|
||||
SET(PCHSupport_FOUND TRUE)
|
||||
ELSE(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
|
||||
IF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]")
|
||||
SET(PCHSupport_FOUND TRUE)
|
||||
ENDIF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]")
|
||||
ENDIF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
|
||||
|
||||
SET(_PCH_include_prefix "-I")
|
||||
|
||||
ELSE(CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
IF(WIN32)
|
||||
SET(PCHSupport_FOUND TRUE) # for experimental msvc support
|
||||
SET(_PCH_include_prefix "/I")
|
||||
ELSE(WIN32)
|
||||
SET(PCHSupport_FOUND FALSE)
|
||||
ENDIF(WIN32)
|
||||
|
||||
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
MACRO(_PCH_GET_COMPILE_FLAGS _out_compile_flags)
|
||||
STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name)
|
||||
SET(${_out_compile_flags} ${${_flags_var_name}} )
|
||||
|
||||
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
GET_TARGET_PROPERTY(_targetType ${_PCH_current_target} TYPE)
|
||||
IF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY)
|
||||
LIST(APPEND ${_out_compile_flags} "-fPIC")
|
||||
ENDIF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY)
|
||||
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
GET_DIRECTORY_PROPERTY(DIRINC INCLUDE_DIRECTORIES )
|
||||
FOREACH(item ${DIRINC})
|
||||
LIST(APPEND ${_out_compile_flags} " ${_PCH_include_prefix}\"${item}\"")
|
||||
ENDFOREACH(item)
|
||||
|
||||
GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS)
|
||||
GET_DIRECTORY_PROPERTY(_global_definitions DIRECTORY ${CMAKE_SOURCE_DIR} DEFINITIONS)
|
||||
LIST(APPEND ${_out_compile_flags} ${_directory_flags})
|
||||
LIST(APPEND ${_out_compile_flags} ${_global_definitions})
|
||||
LIST(APPEND ${_out_compile_flags} ${CMAKE_CXX_FLAGS})
|
||||
|
||||
SEPARATE_ARGUMENTS(${_out_compile_flags})
|
||||
ENDMACRO(_PCH_GET_COMPILE_FLAGS)
|
||||
|
||||
MACRO(_PCH_GET_PDB_FILENAME out_filename _target)
|
||||
# determine output directory based on target type
|
||||
GET_TARGET_PROPERTY(_targetType ${_target} TYPE)
|
||||
IF(${_targetType} STREQUAL EXECUTABLE)
|
||||
SET(_targetOutput ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||
ELSEIF(${_targetType} STREQUAL STATIC_LIBRARY)
|
||||
SET(_targetOutput ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
|
||||
ELSE(${_targetType} STREQUAL EXECUTABLE)
|
||||
SET(_targetOutput ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
|
||||
ENDIF(${_targetType} STREQUAL EXECUTABLE)
|
||||
|
||||
# determine target postfix
|
||||
STRING(TOUPPER "${CMAKE_BUILD_TYPE}_POSTFIX" _postfix_var_name)
|
||||
GET_TARGET_PROPERTY(_targetPostfix ${_target} ${_postfix_var_name})
|
||||
IF(${_targetPostfix} MATCHES NOTFOUND)
|
||||
SET(_targetPostfix "")
|
||||
ENDIF(${_targetPostfix} MATCHES NOTFOUND)
|
||||
|
||||
SET(${out_filename} "${_targetOutput}/${_target}${_targetPostfix}.pdb")
|
||||
ENDMACRO(_PCH_GET_PDB_FILENAME)
|
||||
|
||||
MACRO(_PCH_GET_COMPILE_COMMAND out_command _input _inputcpp _output)
|
||||
IF(CMAKE_CXX_COMPILER_ARG1)
|
||||
# remove leading space in compiler argument
|
||||
STRING(REGEX REPLACE "^ +" "" pchsupport_compiler_cxx_arg1 ${CMAKE_CXX_COMPILER_ARG1})
|
||||
ELSE(CMAKE_CXX_COMPILER_ARG1)
|
||||
SET(pchsupport_compiler_cxx_arg1 "")
|
||||
ENDIF(CMAKE_CXX_COMPILER_ARG1)
|
||||
|
||||
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
SET(${out_command}
|
||||
${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} -x c++-header -o ${_output} -c ${_input}
|
||||
)
|
||||
ELSE(CMAKE_COMPILER_IS_GNUCXX)
|
||||
_PCH_GET_PDB_FILENAME(PDB_FILE ${_PCH_current_target})
|
||||
SET(${out_command}
|
||||
${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} /Yc /Fp\"${_output}\" ${_inputcpp} /c /Fd\"${PDB_FILE}\"
|
||||
)
|
||||
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
ENDMACRO(_PCH_GET_COMPILE_COMMAND )
|
||||
|
||||
MACRO(GET_PRECOMPILED_HEADER_OUTPUT _targetName _input _output)
|
||||
IF(MSVC)
|
||||
GET_FILENAME_COMPONENT(_name ${_input} NAME_WE)
|
||||
SET(_output "${CMAKE_CURRENT_BINARY_DIR}/${_name}.pch")
|
||||
ELSE(MSVC)
|
||||
GET_FILENAME_COMPONENT(_name ${_input} NAME)
|
||||
SET(_output "${CMAKE_CURRENT_BINARY_DIR}/${_name}.gch")
|
||||
ENDIF(MSVC)
|
||||
ENDMACRO(GET_PRECOMPILED_HEADER_OUTPUT _targetName _input)
|
||||
|
||||
MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName _input _pch_output_to_use )
|
||||
GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS)
|
||||
IF(${oldProps} MATCHES NOTFOUND)
|
||||
SET(oldProps "")
|
||||
ENDIF(${oldProps} MATCHES NOTFOUND)
|
||||
|
||||
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
# to do: test whether compiler flags match between target _targetName
|
||||
# and _pch_output_to_use
|
||||
FILE(TO_NATIVE_PATH ${_pch_output_to_use} _native_pch_path)
|
||||
|
||||
# for use with distcc and gcc >4.0.1 if preprocessed files are accessible
|
||||
# on all remote machines set
|
||||
# PCH_ADDITIONAL_COMPILER_FLAGS to -fpch-preprocess
|
||||
SET(_target_cflags "${oldProps} ${PCH_ADDITIONAL_COMPILER_FLAGS}-include ${_input} -Winvalid-pch")
|
||||
ELSE(CMAKE_COMPILER_IS_GNUCXX)
|
||||
IF(MSVC)
|
||||
SET(_target_cflags "${oldProps} /Yu\"${_input}\" /FI\"${_input}\" /Fp\"${_pch_output_to_use}\"")
|
||||
ENDIF(MSVC)
|
||||
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS ${_target_cflags})
|
||||
SET_TARGET_PROPERTIES(${_targetName}_pch_dephelp PROPERTIES COMPILE_FLAGS ${_target_cflags})
|
||||
ADD_CUSTOM_TARGET(pch_Generate_${_targetName} DEPENDS ${_pch_output_to_use})
|
||||
ADD_DEPENDENCIES(${_targetName} pch_Generate_${_targetName})
|
||||
ENDMACRO(ADD_PRECOMPILED_HEADER_TO_TARGET)
|
||||
|
||||
MACRO(ADD_PRECOMPILED_HEADER _targetName _inputh _inputcpp)
|
||||
|
||||
SET(_PCH_current_target ${_targetName})
|
||||
|
||||
IF(NOT CMAKE_BUILD_TYPE)
|
||||
MESSAGE(FATAL_ERROR
|
||||
"This is the ADD_PRECOMPILED_HEADER macro. "
|
||||
"You must set CMAKE_BUILD_TYPE!"
|
||||
)
|
||||
ENDIF(NOT CMAKE_BUILD_TYPE)
|
||||
|
||||
GET_PRECOMPILED_HEADER_OUTPUT( ${_targetName} ${_inputh} _output)
|
||||
|
||||
GET_TARGET_PROPERTY(_targetType ${_PCH_current_target} TYPE)
|
||||
|
||||
# always build static library because it doesn't need linking
|
||||
ADD_LIBRARY(${_targetName}_pch_dephelp STATIC ${_inputcpp})
|
||||
|
||||
_PCH_GET_COMPILE_FLAGS(_compile_FLAGS)
|
||||
|
||||
SET_SOURCE_FILES_PROPERTIES(${_inputh} PROPERTIES GENERATED 1)
|
||||
|
||||
_PCH_GET_COMPILE_COMMAND(_command ${_inputh} ${_inputcpp} ${_output})
|
||||
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${_output}
|
||||
COMMAND ${_command}
|
||||
DEPENDS ${_inputh} ${_targetName}_pch_dephelp
|
||||
)
|
||||
|
||||
ADD_PRECOMPILED_HEADER_TO_TARGET(${_targetName} ${_inputh} ${_output})
|
||||
ENDMACRO(ADD_PRECOMPILED_HEADER)
|
||||
|
||||
MACRO(ADD_NATIVE_PRECOMPILED_HEADER _targetName _inputh _inputcpp)
|
||||
IF(CMAKE_GENERATOR MATCHES Visual*)
|
||||
# Auto include the precompile (useful for moc processing, since the use of
|
||||
# precompiled is specified at the target level
|
||||
# and I don't want to specifiy /F- for each moc/res/ui generated files (using Qt)
|
||||
|
||||
GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS)
|
||||
IF(${oldProps} MATCHES NOTFOUND)
|
||||
SET(oldProps "")
|
||||
ENDIF(${oldProps} MATCHES NOTFOUND)
|
||||
|
||||
SET(newProperties "${oldProps} /Yu\"${_inputh}\" /FI\"${_inputh}\"")
|
||||
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS "${newProperties}")
|
||||
|
||||
#also inlude ${oldProps} to have the same compile options
|
||||
SET_SOURCE_FILES_PROPERTIES(${_inputcpp} PROPERTIES COMPILE_FLAGS "${oldProps} /Yc\"${_inputh}\"")
|
||||
ELSE(CMAKE_GENERATOR MATCHES Visual*)
|
||||
IF(CMAKE_GENERATOR MATCHES Xcode)
|
||||
# For Xcode, cmake needs my patch to process
|
||||
# GCC_PREFIX_HEADER and GCC_PRECOMPILE_PREFIX_HEADER as target properties
|
||||
|
||||
GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS)
|
||||
IF(${oldProps} MATCHES NOTFOUND)
|
||||
SET(oldProps "")
|
||||
ENDIF(${oldProps} MATCHES NOTFOUND)
|
||||
|
||||
# When buiding out of the tree, precompiled may not be located
|
||||
# Use full path instead.
|
||||
GET_FILENAME_COMPONENT(fullPath ${_inputh} ABSOLUTE)
|
||||
|
||||
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${fullPath}")
|
||||
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES")
|
||||
ELSE(CMAKE_GENERATOR MATCHES Xcode)
|
||||
#Fallback to the "old" precompiled suppport
|
||||
ADD_PRECOMPILED_HEADER(${_targetName} ${_inputh} ${_inputcpp})
|
||||
ENDIF(CMAKE_GENERATOR MATCHES Xcode)
|
||||
ENDIF(CMAKE_GENERATOR MATCHES Visual*)
|
||||
|
||||
ENDMACRO(ADD_NATIVE_PRECOMPILED_HEADER)
|
498
code/CMakeModules/nel.cmake
Normal file
498
code/CMakeModules/nel.cmake
Normal file
|
@ -0,0 +1,498 @@
|
|||
###
|
||||
# Helper macro that generates .pc and installs it.
|
||||
# Argument: name - the name of the .pc package, e.g. "nel-pacs.pc"
|
||||
###
|
||||
MACRO(NL_GEN_PC name)
|
||||
IF(NOT WIN32)
|
||||
CONFIGURE_FILE(${name}.in "${CMAKE_CURRENT_BINARY_DIR}/${name}")
|
||||
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/${name}" DESTINATION lib/pkgconfig)
|
||||
ENDIF(NOT WIN32)
|
||||
ENDMACRO(NL_GEN_PC)
|
||||
|
||||
###
|
||||
#
|
||||
###
|
||||
MACRO(NL_TARGET_LIB name)
|
||||
IF(WITH_STATIC)
|
||||
ADD_LIBRARY(${name} STATIC ${ARGN})
|
||||
ELSE(WITH_STATIC)
|
||||
ADD_LIBRARY(${name} SHARED ${ARGN})
|
||||
ENDIF(WITH_STATIC)
|
||||
ENDMACRO(NL_TARGET_LIB)
|
||||
|
||||
###
|
||||
#
|
||||
###
|
||||
MACRO(NL_TARGET_DRIVER name)
|
||||
IF(WITH_STATIC_DRIVERS)
|
||||
ADD_LIBRARY(${name} STATIC ${ARGN})
|
||||
ELSE(WITH_STATIC_DRIVERS)
|
||||
ADD_LIBRARY(${name} MODULE ${ARGN})
|
||||
ENDIF(WITH_STATIC_DRIVERS)
|
||||
ENDMACRO(NL_TARGET_DRIVER)
|
||||
|
||||
###
|
||||
# Helper macro that sets the default library properties.
|
||||
# Argument: name - the target name whose properties are being set
|
||||
# Argument:
|
||||
###
|
||||
MACRO(NL_DEFAULT_PROPS name label)
|
||||
IF(NOT MSVC10)
|
||||
SET_TARGET_PROPERTIES(${name} PROPERTIES PROJECT_LABEL ${label})
|
||||
ENDIF(NOT MSVC10)
|
||||
GET_TARGET_PROPERTY(type ${name} TYPE)
|
||||
IF(${type} STREQUAL SHARED_LIBRARY)
|
||||
# Set versions only if target is a shared library
|
||||
SET_TARGET_PROPERTIES(${name} PROPERTIES
|
||||
VERSION ${NL_VERSION} SOVERSION ${NL_VERSION_MAJOR})
|
||||
IF(NL_LIB_PREFIX)
|
||||
SET_TARGET_PROPERTIES(${name} PROPERTIES INSTALL_NAME_DIR ${NL_LIB_PREFIX})
|
||||
ENDIF(NL_LIB_PREFIX)
|
||||
ENDIF(${type} STREQUAL SHARED_LIBRARY)
|
||||
IF(WITH_STLPORT AND WIN32)
|
||||
SET_TARGET_PROPERTIES(${name} PROPERTIES COMPILE_FLAGS "/X")
|
||||
ENDIF(WITH_STLPORT AND WIN32)
|
||||
ENDMACRO(NL_DEFAULT_PROPS)
|
||||
|
||||
###
|
||||
# Adds the target suffix on Windows.
|
||||
# Argument: name - the library's target name.
|
||||
###
|
||||
MACRO(NL_ADD_LIB_SUFFIX name)
|
||||
IF(WIN32)
|
||||
SET_TARGET_PROPERTIES(${name} PROPERTIES DEBUG_POSTFIX "_d" RELEASE_POSTFIX "_r")
|
||||
ENDIF(WIN32)
|
||||
ENDMACRO(NL_ADD_LIB_SUFFIX)
|
||||
|
||||
###
|
||||
# Adds the runtime link flags for Win32 binaries and links STLport.
|
||||
# Argument: name - the target to add the link flags to.
|
||||
###
|
||||
MACRO(NL_ADD_RUNTIME_FLAGS name)
|
||||
IF(WIN32)
|
||||
# SET_TARGET_PROPERTIES(${name} PROPERTIES
|
||||
# LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}"
|
||||
# LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}")
|
||||
ENDIF(WIN32)
|
||||
IF(WITH_STLPORT)
|
||||
TARGET_LINK_LIBRARIES(${name} ${STLPORT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
||||
ENDIF(WITH_STLPORT)
|
||||
ENDMACRO(NL_ADD_RUNTIME_FLAGS)
|
||||
|
||||
MACRO(NL_ADD_STATIC_VID_DRIVERS name)
|
||||
IF(WITH_STATIC_DRIVERS)
|
||||
IF(WIN32)
|
||||
IF(WITH_DRIVER_DIRECT3D)
|
||||
TARGET_LINK_LIBRARIES(${name} nel_drv_direct3d_win)
|
||||
ENDIF(WITH_DRIVER_DIRECT3D)
|
||||
ENDIF(WIN32)
|
||||
|
||||
IF(WITH_DRIVER_OPENGL)
|
||||
IF(WIN32)
|
||||
TARGET_LINK_LIBRARIES(${name} nel_drv_opengl_win)
|
||||
ELSE(WIN32)
|
||||
TARGET_LINK_LIBRARIES(${name} nel_drv_opengl)
|
||||
ENDIF(WIN32)
|
||||
ENDIF(WITH_DRIVER_OPENGL)
|
||||
|
||||
IF(WITH_DRIVER_OPENGLES)
|
||||
IF(WIN32)
|
||||
TARGET_LINK_LIBRARIES(${name} nel_drv_opengles_win)
|
||||
ELSE(WIN32)
|
||||
TARGET_LINK_LIBRARIES(${name} nel_drv_opengles)
|
||||
ENDIF(WIN32)
|
||||
ENDIF(WITH_DRIVER_OPENGLES)
|
||||
ENDIF(WITH_STATIC_DRIVERS)
|
||||
ENDMACRO(NL_ADD_STATIC_VID_DRIVERS)
|
||||
|
||||
MACRO(NL_ADD_STATIC_SND_DRIVERS name)
|
||||
IF(WITH_STATIC_DRIVERS)
|
||||
IF(WIN32)
|
||||
IF(WITH_DRIVER_DSOUND)
|
||||
TARGET_LINK_LIBRARIES(${name} nel_drv_dsound_win)
|
||||
ENDIF(WITH_DRIVER_DSOUND)
|
||||
|
||||
IF(WITH_DRIVER_XAUDIO2)
|
||||
TARGET_LINK_LIBRARIES(${name} nel_drv_xaudio2_win)
|
||||
ENDIF(WITH_DRIVER_XAUDIO2)
|
||||
|
||||
IF(WITH_DRIVER_OPENAL)
|
||||
TARGET_LINK_LIBRARIES(${name} nel_drv_openal_win)
|
||||
ENDIF(WITH_DRIVER_OPENAL)
|
||||
|
||||
IF(WITH_DRIVER_FMOD)
|
||||
TARGET_LINK_LIBRARIES(${name} nel_drv_fmod_win)
|
||||
ENDIF(WITH_DRIVER_FMOD)
|
||||
ELSE(WIN32)
|
||||
IF(WITH_DRIVER_OPENAL)
|
||||
TARGET_LINK_LIBRARIES(${name} nel_drv_openal)
|
||||
ENDIF(WITH_DRIVER_OPENAL)
|
||||
|
||||
IF(WITH_DRIVER_FMOD)
|
||||
TARGET_LINK_LIBRARIES(${name} nel_drv_fmod)
|
||||
ENDIF(WITH_DRIVER_FMOD)
|
||||
ENDIF(WIN32)
|
||||
|
||||
ENDIF(WITH_STATIC_DRIVERS)
|
||||
ENDMACRO(NL_ADD_STATIC_SND_DRIVERS)
|
||||
|
||||
###
|
||||
# Checks build vs. source location. Prevents In-Source builds.
|
||||
###
|
||||
MACRO(CHECK_OUT_OF_SOURCE)
|
||||
IF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||
MESSAGE(FATAL_ERROR "
|
||||
|
||||
CMake generation for this project is not allowed within the source directory!
|
||||
Remove the CMakeCache.txt file and try again from another folder, e.g.:
|
||||
|
||||
rm CMakeCache.txt
|
||||
mkdir cmake
|
||||
cd cmake
|
||||
cmake -G \"Unix Makefiles\" ..
|
||||
")
|
||||
ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||
|
||||
ENDMACRO(CHECK_OUT_OF_SOURCE)
|
||||
|
||||
MACRO(NL_SETUP_DEFAULT_OPTIONS)
|
||||
###
|
||||
# Features
|
||||
###
|
||||
OPTION(WITH_LOGGING "With Logging" ON )
|
||||
OPTION(WITH_COVERAGE "With Code Coverage Support" OFF)
|
||||
OPTION(WITH_PCH "With Precompiled Headers" ON )
|
||||
OPTION(FINAL_VERSION "Build in Final Version mode" ON )
|
||||
|
||||
# Default to static building on Windows.
|
||||
IF(WIN32)
|
||||
OPTION(WITH_STATIC "With static libraries." ON )
|
||||
ELSE(WIN32)
|
||||
OPTION(WITH_STATIC "With static libraries." OFF)
|
||||
ENDIF(WIN32)
|
||||
OPTION(WITH_STATIC_DRIVERS "With static drivers." OFF)
|
||||
|
||||
###
|
||||
# GUI toolkits
|
||||
###
|
||||
OPTION(WITH_GTK "With GTK Support" OFF)
|
||||
OPTION(WITH_QT "With QT Support" OFF)
|
||||
|
||||
IF(WIN32 AND MFC_FOUND)
|
||||
OPTION(WITH_MFC "With MFC Support" ON )
|
||||
ELSE(WIN32 AND MFC_FOUND)
|
||||
OPTION(WITH_MFC "With MFC Support" OFF)
|
||||
ENDIF(WIN32 AND MFC_FOUND)
|
||||
|
||||
###
|
||||
# Optional support
|
||||
###
|
||||
IF(WIN32)
|
||||
OPTION(WITH_STLPORT "With STLport support." ON )
|
||||
ELSE(WIN32)
|
||||
OPTION(WITH_STLPORT "With STLport support." OFF)
|
||||
ENDIF(WIN32)
|
||||
|
||||
OPTION(BUILD_DASHBOARD "Build to the CDash dashboard" OFF)
|
||||
|
||||
OPTION(WITH_NEL "Build NeL (nearly always required)." ON )
|
||||
OPTION(WITH_NELNS "Build NeL Network Services." OFF)
|
||||
OPTION(WITH_RYZOM "Build Ryzom Core." ON )
|
||||
OPTION(WITH_SNOWBALLS "Build Snowballs." OFF)
|
||||
ENDMACRO(NL_SETUP_DEFAULT_OPTIONS)
|
||||
|
||||
MACRO(NL_SETUP_NEL_DEFAULT_OPTIONS)
|
||||
###
|
||||
# Core libraries
|
||||
###
|
||||
OPTION(WITH_NET "Build NLNET" ON )
|
||||
OPTION(WITH_3D "Build NL3D" ON )
|
||||
OPTION(WITH_PACS "Build NLPACS" ON )
|
||||
OPTION(WITH_GEORGES "Build NLGEORGES" ON )
|
||||
OPTION(WITH_LIGO "Build NLLIGO" ON )
|
||||
OPTION(WITH_LOGIC "Build NLLOGIC" ON )
|
||||
OPTION(WITH_SOUND "Build NLSOUND" ON )
|
||||
|
||||
###
|
||||
# Drivers Support
|
||||
###
|
||||
OPTION(WITH_DRIVER_OPENGL "Build OpenGL Driver (3D)" ON )
|
||||
OPTION(WITH_DRIVER_OPENGLES "Build OpenGL ES Driver (3D)" OFF)
|
||||
OPTION(WITH_DRIVER_DIRECT3D "Build Direct3D Driver (3D)" OFF)
|
||||
OPTION(WITH_DRIVER_OPENAL "Build OpenAL Driver (Sound)" ON )
|
||||
OPTION(WITH_DRIVER_FMOD "Build FMOD Driver (Sound)" OFF)
|
||||
OPTION(WITH_DRIVER_DSOUND "Build DirectSound Driver (Sound)" OFF)
|
||||
OPTION(WITH_DRIVER_XAUDIO2 "Build XAudio2 Driver (Sound)" OFF)
|
||||
|
||||
###
|
||||
# Optional support
|
||||
###
|
||||
OPTION(WITH_NEL_CEGUI "Build CEGUI Renderer" OFF)
|
||||
OPTION(WITH_NEL_TOOLS "Build NeL Tools" ON )
|
||||
OPTION(WITH_NEL_MAXPLUGIN "Build NeL 3dsMax Plugin" OFF)
|
||||
OPTION(WITH_NEL_SAMPLES "Build NeL Samples" ON )
|
||||
OPTION(WITH_NEL_TESTS "Build NeL Unit Tests" ON )
|
||||
ENDMACRO(NL_SETUP_NEL_DEFAULT_OPTIONS)
|
||||
|
||||
MACRO(NL_SETUP_NELNS_DEFAULT_OPTIONS)
|
||||
###
|
||||
# Core libraries
|
||||
###
|
||||
OPTION(WITH_NELNS_SERVER "Build NeLNS Services" ON )
|
||||
OPTION(WITH_NELNS_LOGIN_SYSTEM "Build NeLNS Login System Tools" ON )
|
||||
ENDMACRO(NL_SETUP_NELNS_DEFAULT_OPTIONS)
|
||||
|
||||
MACRO(NL_SETUP_RYZOM_DEFAULT_OPTIONS)
|
||||
###
|
||||
# Core libraries
|
||||
###
|
||||
OPTION(WITH_RYZOM_CLIENT "Build Ryzom Core Client" ON )
|
||||
OPTION(WITH_RYZOM_TOOLS "Build Ryzom Core Tools" ON )
|
||||
OPTION(WITH_RYZOM_SERVER "Build Ryzom Core Services" ON )
|
||||
OPTION(WITH_RYZOM_SOUND "Enable Ryzom Core Sound" ON )
|
||||
|
||||
###
|
||||
# Optional support
|
||||
###
|
||||
OPTION(WITH_LUA51 "Build Ryzom Core using Lua51" ON )
|
||||
ENDMACRO(NL_SETUP_RYZOM_DEFAULT_OPTIONS)
|
||||
|
||||
MACRO(NL_SETUP_SNOWBALLS_DEFAULT_OPTIONS)
|
||||
###
|
||||
# Core libraries
|
||||
###
|
||||
OPTION(WITH_SNOWBALLS_CLIENT "Build Snowballs Client" ON )
|
||||
OPTION(WITH_SNOWBALLS_SERVER "Build Snowballs Services" ON )
|
||||
ENDMACRO(NL_SETUP_SNOWBALLS_DEFAULT_OPTIONS)
|
||||
|
||||
MACRO(NL_SETUP_BUILD)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Setup the buildmode variables.
|
||||
#
|
||||
# None = NL_RELEASE
|
||||
# Debug = NL_DEBUG
|
||||
# Release = NL_RELEASE
|
||||
|
||||
SET(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
|
||||
|
||||
IF(CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||
SET(NL_BUILD_MODE "NL_DEBUG")
|
||||
ELSE(CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||
IF(CMAKE_BUILD_TYPE MATCHES "Release")
|
||||
SET(NL_BUILD_MODE "NL_RELEASE")
|
||||
ELSE(CMAKE_BUILD_TYPE MATCHES "Release")
|
||||
SET(NL_BUILD_MODE "NL_RELEASE")
|
||||
# enforce release mode if it's neither Debug nor Release
|
||||
SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
|
||||
ENDIF(CMAKE_BUILD_TYPE MATCHES "Release")
|
||||
ENDIF(CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||
|
||||
# Determine target CPU
|
||||
# IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")
|
||||
IF(NOT CMAKE_SIZEOF_VOID_P)
|
||||
INCLUDE (CheckTypeSize)
|
||||
CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P)
|
||||
ENDIF(NOT CMAKE_SIZEOF_VOID_P)
|
||||
|
||||
# Using 32 or 64 bits libraries
|
||||
SET(TARGET_X86 1)
|
||||
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
SET(ARCH "x86_64")
|
||||
SET(TARGET_X64 1)
|
||||
ADD_DEFINITIONS(-DHAVE_X86_64)
|
||||
ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
SET(ARCH "x86")
|
||||
ADD_DEFINITIONS(-DHAVE_X86)
|
||||
ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
# ADD_DEFINITIONS(-DHAVE_IA64)
|
||||
# ENDIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")
|
||||
|
||||
IF(WIN32)
|
||||
IF(MSVC10)
|
||||
# /Ox is working with VC++ 2010, but custom optimizations don't exist
|
||||
SET(SPEED_OPTIMIZATIONS "/Ox /GF /GS-")
|
||||
# without inlining it's unusable, use custom optimizations again
|
||||
SET(MIN_OPTIMIZATIONS "/Od /Ob1")
|
||||
ELSE(MSVC10)
|
||||
# don't use a /O[012x] flag if you want custom optimizations
|
||||
SET(SPEED_OPTIMIZATIONS "/Ob2 /Oi /Ot /Oy /GT /GF /GS-")
|
||||
# without inlining it's unusable, use custom optimizations again
|
||||
SET(MIN_OPTIMIZATIONS "/Ob1")
|
||||
ENDIF(MSVC10)
|
||||
|
||||
SET(PLATFORM_CFLAGS "/D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /DWIN32 /D_WINDOWS /W3 /Zi /Zm1000 /MP /Gy-")
|
||||
|
||||
# Common link flags
|
||||
SET(PLATFORM_LINKFLAGS "-DEBUG")
|
||||
|
||||
IF(TARGET_X64)
|
||||
# Fix a bug with Intellisense
|
||||
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} /D_WIN64")
|
||||
# Fix a compilation error for some big C++ files
|
||||
SET(MIN_OPTIMIZATIONS "${MIN_OPTIMIZATIONS} /bigobj")
|
||||
ELSE(TARGET_X64)
|
||||
# Allows 32 bits applications to use 3 GB of RAM
|
||||
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /LARGEADDRESSAWARE")
|
||||
ENDIF(TARGET_X64)
|
||||
|
||||
# Exceptions are only set for C++
|
||||
SET(PLATFORM_CXXFLAGS "${PLATFORM_CFLAGS} /EHa")
|
||||
|
||||
SET(NL_DEBUG_CFLAGS "/MDd /RTC1 /D_DEBUG ${MIN_OPTIMIZATIONS}")
|
||||
SET(NL_RELEASE_CFLAGS "/MD /D NDEBUG ${SPEED_OPTIMIZATIONS}")
|
||||
SET(NL_DEBUG_LINKFLAGS "/NODEFAULTLIB:msvcrt /INCREMENTAL:YES")
|
||||
SET(NL_RELEASE_LINKFLAGS "/OPT:REF /OPT:ICF /INCREMENTAL:NO")
|
||||
ELSE(WIN32)
|
||||
SET(PLATFORM_CFLAGS "-g -pipe -ftemplate-depth-48 -D_REENTRANT -Wall -ansi -W -Wpointer-arith -Wsign-compare -Wno-deprecated-declarations -Wno-multichar -Wno-unused -fno-strict-aliasing")
|
||||
IF(WITH_COVERAGE)
|
||||
SET(PLATFORM_CFLAGS "-fprofile-arcs -ftest-coverage ${PLATFORM_CFLAGS}")
|
||||
ENDIF(WITH_COVERAGE)
|
||||
|
||||
IF(APPLE)
|
||||
SET(PLATFORM_CFLAGS "-gdwarf-2 ${PLATFORM_CFLAGS}")
|
||||
ENDIF(APPLE)
|
||||
|
||||
SET(PLATFORM_CXXFLAGS ${PLATFORM_CFLAGS})
|
||||
|
||||
IF(NOT APPLE)
|
||||
SET(PLATFORM_LINKFLAGS "-Wl,--no-undefined -Wl,--as-needed")
|
||||
ENDIF(NOT APPLE)
|
||||
|
||||
SET(NL_DEBUG_CFLAGS "-DNL_DEBUG -D_DEBUG")
|
||||
SET(NL_RELEASE_CFLAGS "-DNL_RELEASE -DNDEBUG -O6")
|
||||
ENDIF(WIN32)
|
||||
ENDMACRO(NL_SETUP_BUILD)
|
||||
|
||||
MACRO(NL_SETUP_BUILD_FLAGS)
|
||||
SET(CMAKE_C_FLAGS ${PLATFORM_CFLAGS} CACHE STRING "" FORCE)
|
||||
SET(CMAKE_CXX_FLAGS ${PLATFORM_CXXFLAGS} CACHE STRING "" FORCE)
|
||||
|
||||
## Debug
|
||||
SET(CMAKE_C_FLAGS_DEBUG ${NL_DEBUG_CFLAGS} CACHE STRING "" FORCE)
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG ${NL_DEBUG_CFLAGS} CACHE STRING "" FORCE)
|
||||
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${PLATFORM_LINKFLAGS} ${NL_DEBUG_LINKFLAGS}" CACHE STRING "" FORCE)
|
||||
SET(CMAKE_MODULE_LINKER_FLAGS_DEBUG "${PLATFORM_LINKFLAGS} ${NL_DEBUG_LINKFLAGS}" CACHE STRING "" FORCE)
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${PLATFORM_LINKFLAGS} ${NL_DEBUG_LINKFLAGS}" CACHE STRING "" FORCE)
|
||||
|
||||
## Release
|
||||
SET(CMAKE_C_FLAGS_RELEASE ${NL_RELEASE_CFLAGS} CACHE STRING "" FORCE)
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE ${NL_RELEASE_CFLAGS} CACHE STRING "" FORCE)
|
||||
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${PLATFORM_LINKFLAGS} ${NL_RELEASE_LINKFLAGS}" CACHE STRING "" FORCE)
|
||||
SET(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${PLATFORM_LINKFLAGS} ${NL_RELEASE_LINKFLAGS}" CACHE STRING "" FORCE)
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${PLATFORM_LINKFLAGS} ${NL_RELEASE_LINKFLAGS}" CACHE STRING "" FORCE)
|
||||
ENDMACRO(NL_SETUP_BUILD_FLAGS)
|
||||
|
||||
MACRO(NL_SETUP_PREFIX_PATHS)
|
||||
## Allow override of install_prefix/etc path.
|
||||
IF(NOT NL_ETC_PREFIX)
|
||||
IF(WIN32)
|
||||
SET(NL_ETC_PREFIX "../etc/nel" CACHE PATH "Installation path for configurations")
|
||||
ELSE(WIN32)
|
||||
SET(NL_ETC_PREFIX "${CMAKE_INSTALL_PREFIX}/etc/nel" CACHE PATH "Installation path for configurations")
|
||||
ENDIF(WIN32)
|
||||
ENDIF(NOT NL_ETC_PREFIX)
|
||||
|
||||
## Allow override of install_prefix/share path.
|
||||
IF(NOT NL_SHARE_PREFIX)
|
||||
IF(WIN32)
|
||||
SET(NL_SHARE_PREFIX "../share/nel" CACHE PATH "Installation path for data.")
|
||||
ELSE(WIN32)
|
||||
SET(NL_SHARE_PREFIX "${CMAKE_INSTALL_PREFIX}/share/nel" CACHE PATH "Installation path for data.")
|
||||
ENDIF(WIN32)
|
||||
ENDIF(NOT NL_SHARE_PREFIX)
|
||||
|
||||
## Allow override of install_prefix/sbin path.
|
||||
IF(NOT NL_SBIN_PREFIX)
|
||||
IF(WIN32)
|
||||
SET(NL_SBIN_PREFIX "../sbin" CACHE PATH "Installation path for admin tools and services.")
|
||||
ELSE(WIN32)
|
||||
SET(NL_SBIN_PREFIX "${CMAKE_INSTALL_PREFIX}/sbin" CACHE PATH "Installation path for admin tools and services.")
|
||||
ENDIF(WIN32)
|
||||
ENDIF(NOT NL_SBIN_PREFIX)
|
||||
|
||||
## Allow override of install_prefix/bin path.
|
||||
IF(NOT NL_BIN_PREFIX)
|
||||
IF(WIN32)
|
||||
SET(NL_BIN_PREFIX "../bin" CACHE PATH "Installation path for tools and applications.")
|
||||
ELSE(WIN32)
|
||||
SET(NL_BIN_PREFIX "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation path for tools and applications.")
|
||||
ENDIF(WIN32)
|
||||
ENDIF(NOT NL_BIN_PREFIX)
|
||||
|
||||
## Allow override of install_prefix/lib path.
|
||||
IF(NOT NL_LIB_PREFIX)
|
||||
IF(WIN32)
|
||||
SET(NL_LIB_PREFIX "../lib" CACHE PATH "Installation path for libraries.")
|
||||
ELSE(WIN32)
|
||||
SET(NL_LIB_PREFIX "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation path for libraries.")
|
||||
ENDIF(WIN32)
|
||||
ENDIF(NOT NL_LIB_PREFIX)
|
||||
|
||||
## Allow override of install_prefix/lib path.
|
||||
IF(NOT NL_DRIVER_PREFIX)
|
||||
IF(WIN32)
|
||||
SET(NL_DRIVER_PREFIX "../lib" CACHE PATH "Installation path for drivers.")
|
||||
ELSE(WIN32)
|
||||
SET(NL_DRIVER_PREFIX "${CMAKE_INSTALL_PREFIX}/lib/nel" CACHE PATH "Installation path for drivers.")
|
||||
ENDIF(WIN32)
|
||||
ENDIF(NOT NL_DRIVER_PREFIX)
|
||||
|
||||
ENDMACRO(NL_SETUP_PREFIX_PATHS)
|
||||
|
||||
MACRO(RYZOM_SETUP_PREFIX_PATHS)
|
||||
## Allow override of install_prefix path.
|
||||
IF(NOT RYZOM_PREFIX)
|
||||
IF(WIN32)
|
||||
SET(RYZOM_PREFIX "." CACHE PATH "Installation path")
|
||||
ELSE(WIN32)
|
||||
SET(RYZOM_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE PATH "Installation path")
|
||||
ENDIF(WIN32)
|
||||
ENDIF(NOT RYZOM_PREFIX)
|
||||
|
||||
## Allow override of install_prefix/etc path.
|
||||
IF(NOT RYZOM_ETC_PREFIX)
|
||||
IF(WIN32)
|
||||
SET(RYZOM_ETC_PREFIX "." CACHE PATH "Installation path for configurations")
|
||||
ELSE(WIN32)
|
||||
SET(RYZOM_ETC_PREFIX "${CMAKE_INSTALL_PREFIX}/etc/ryzom" CACHE PATH "Installation path for configurations")
|
||||
ENDIF(WIN32)
|
||||
ENDIF(NOT RYZOM_ETC_PREFIX)
|
||||
|
||||
## Allow override of install_prefix/share path.
|
||||
IF(NOT RYZOM_SHARE_PREFIX)
|
||||
IF(WIN32)
|
||||
SET(RYZOM_SHARE_PREFIX "." CACHE PATH "Installation path for data.")
|
||||
ELSE(WIN32)
|
||||
SET(RYZOM_SHARE_PREFIX "${CMAKE_INSTALL_PREFIX}/share/ryzom" CACHE PATH "Installation path for data.")
|
||||
ENDIF(WIN32)
|
||||
ENDIF(NOT RYZOM_SHARE_PREFIX)
|
||||
|
||||
## Allow override of install_prefix/sbin path.
|
||||
IF(NOT RYZOM_SBIN_PREFIX)
|
||||
IF(WIN32)
|
||||
SET(RYZOM_SBIN_PREFIX "." CACHE PATH "Installation path for admin tools and services.")
|
||||
ELSE(WIN32)
|
||||
SET(RYZOM_SBIN_PREFIX "${CMAKE_INSTALL_PREFIX}/sbin" CACHE PATH "Installation path for admin tools and services.")
|
||||
ENDIF(WIN32)
|
||||
ENDIF(NOT RYZOM_SBIN_PREFIX)
|
||||
|
||||
## Allow override of install_prefix/bin path.
|
||||
IF(NOT RYZOM_BIN_PREFIX)
|
||||
IF(WIN32)
|
||||
SET(RYZOM_BIN_PREFIX "." CACHE PATH "Installation path for tools and applications.")
|
||||
ELSE(WIN32)
|
||||
SET(RYZOM_BIN_PREFIX "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation path for tools.")
|
||||
ENDIF(WIN32)
|
||||
ENDIF(NOT RYZOM_BIN_PREFIX)
|
||||
|
||||
## Allow override of install_prefix/games path.
|
||||
IF(NOT RYZOM_GAMES_PREFIX)
|
||||
IF(WIN32)
|
||||
SET(RYZOM_GAMES_PREFIX "." CACHE PATH "Installation path for tools and applications.")
|
||||
ELSE(WIN32)
|
||||
SET(RYZOM_GAMES_PREFIX "${CMAKE_INSTALL_PREFIX}/games" CACHE PATH "Installation path for client.")
|
||||
ENDIF(WIN32)
|
||||
ENDIF(NOT RYZOM_GAMES_PREFIX)
|
||||
|
||||
ENDMACRO(RYZOM_SETUP_PREFIX_PATHS)
|
109
code/CMakePackaging.txt
Normal file
109
code/CMakePackaging.txt
Normal file
|
@ -0,0 +1,109 @@
|
|||
cpack_add_install_type(Full DISPLAY_NAME "Full Install")
|
||||
cpack_add_install_type(Developer DISPLAY_NAME "Developer Install")
|
||||
cpack_add_install_type(Runtime DISPLAY_NAME "Runtime Files")
|
||||
|
||||
cpack_add_component_group(Drivers
|
||||
EXPANDED
|
||||
DESCRPTION "The drivers needed to run NeL-based software.")
|
||||
cpack_add_component_group(Samples
|
||||
EXPANDED
|
||||
DESCRPTION "Sample applications and configurations demonstrating NeL.")
|
||||
cpack_add_component_group(Tools
|
||||
EXPANDED
|
||||
DESCRPTION "Tools for NeL development and media creation.")
|
||||
|
||||
|
||||
|
||||
###############
|
||||
# #
|
||||
# Development #
|
||||
# #
|
||||
###############
|
||||
cpack_add_component(libraries
|
||||
DISPLAY_NAME "Libraries"
|
||||
DESCRIPTION "Libraries used to build programs with NeL"
|
||||
GROUP Development
|
||||
INSTALL_TYPES Full Developer)
|
||||
cpack_add_component(headers
|
||||
DISPLAY_NAME "C++ Headers"
|
||||
DESCRIPTION "C++ headers used to build programs with NeL"
|
||||
GROUP Development
|
||||
INSTALL_TYPES Full Developer)
|
||||
|
||||
###########
|
||||
# #
|
||||
# Drivers #
|
||||
# #
|
||||
###########
|
||||
cpack_add_component(drivers3d
|
||||
DISPLAY_NAME "3D Drivers"
|
||||
DESCRIPTION "3D Drivers for running NeL based applications."
|
||||
GROUP Drivers
|
||||
INSTALL_TYPES Full Runtime)
|
||||
cpack_add_component(driverssound
|
||||
DISPLAY_NAME "Sound Drivers"
|
||||
DESCRIPTION "Sound Drivers for running NeL based applications."
|
||||
GROUP Drivers
|
||||
INSTALL_TYPES Full Runtime)
|
||||
|
||||
#########
|
||||
# #
|
||||
# Tools #
|
||||
# #
|
||||
#########
|
||||
cpack_add_component(toolsmisc
|
||||
DISPLAY_NAME "Misc Tools"
|
||||
DESCRIPTION "Misc. NeL Tools"
|
||||
GROUP Tools
|
||||
INSTALL_TYPES Full Runtime)
|
||||
cpack_add_component(tools3d
|
||||
DISPLAY_NAME "3D Tools"
|
||||
DESCRIPTION "3D NeL Tools"
|
||||
GROUP Tools
|
||||
INSTALL_TYPES Full Runtime)
|
||||
cpack_add_component(toolsgeorges
|
||||
DISPLAY_NAME "Georges Tools"
|
||||
DESCRIPTION "NeL Georges Tools"
|
||||
GROUP Tools
|
||||
INSTALL_TYPES Full Runtime)
|
||||
cpack_add_component(toolspacs
|
||||
DISPLAY_NAME "PACS Tools"
|
||||
DESCRIPTION "NeL PACS Tools"
|
||||
GROUP Tools
|
||||
INSTALL_TYPES Full Runtime)
|
||||
|
||||
###########
|
||||
# #
|
||||
# Samples #
|
||||
# #
|
||||
###########
|
||||
cpack_add_component(samplespacs
|
||||
DISPLAY_NAME "PACS Samples"
|
||||
DESCRIPTION "Sample applications demonstrating the PACS collision library."
|
||||
GROUP Samples
|
||||
INSTALL_TYPES Full)
|
||||
cpack_add_component(samples3d
|
||||
DISPLAY_NAME "3D Samples"
|
||||
DESCRIPTION "Sample applications demonstrating the NeL 3D library."
|
||||
GROUP Samples
|
||||
INSTALL_TYPES Full)
|
||||
cpack_add_component(samplesgeorges
|
||||
DISPLAY_NAME "Georges Samples"
|
||||
DESCRIPTION "Sample applications demonstrating the Georges data loading module."
|
||||
GROUP Samples
|
||||
INSTALL_TYPES Full)
|
||||
cpack_add_component(samplesmisc
|
||||
DISPLAY_NAME "Misc Samples"
|
||||
DESCRIPTION "Sample applications demonstrating the core NeL functionality module."
|
||||
GROUP Samples
|
||||
INSTALL_TYPES Full)
|
||||
cpack_add_component(samplesnet
|
||||
DISPLAY_NAME "Net Samples"
|
||||
DESCRIPTION "Sample applications demonstrating the NeL Network functionality."
|
||||
GROUP Samples
|
||||
INSTALL_TYPES Full)
|
||||
cpack_add_component(samplessound
|
||||
DISPLAY_NAME "Sound Samples"
|
||||
DESCRIPTION "Sample applications demonstrating the NeL Sound functionality."
|
||||
GROUP Samples
|
||||
INSTALL_TYPES Full)
|
661
code/COPYING
Normal file
661
code/COPYING
Normal file
|
@ -0,0 +1,661 @@
|
|||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
13
code/CTestConfig.cmake
Normal file
13
code/CTestConfig.cmake
Normal file
|
@ -0,0 +1,13 @@
|
|||
## This file should be placed in the root directory of your project.
|
||||
## Then modify the CMakeLists.txt file in the root directory of your
|
||||
## project to incorporate the testing dashboard.
|
||||
## # The following are required to uses Dart and the Cdash dashboard
|
||||
## ENABLE_TESTING()
|
||||
## INCLUDE(Dart)
|
||||
set(CTEST_PROJECT_NAME "RyzomCore")
|
||||
set(CTEST_NIGHTLY_START_TIME "00:00:00 CST")
|
||||
set(CTEST_UPDATE_TYPE "hg")
|
||||
set(CTEST_DROP_METHOD "http")
|
||||
set(CTEST_DROP_SITE "www.opennel.org")
|
||||
set(CTEST_DROP_LOCATION "/cdash/submit.php?project=RyzomCore")
|
||||
set(CTEST_DROP_SITE_CDASH TRUE)
|
32
code/README
Normal file
32
code/README
Normal file
|
@ -0,0 +1,32 @@
|
|||
Introduction
|
||||
------------
|
||||
|
||||
Ryzom Core is a software platform for creating and running massively multi-user
|
||||
entertainment in a 3D environment over the Internet.
|
||||
|
||||
The Ryzom Core library is further divided into specific modules: network, ai, 3d
|
||||
and misc. If you want to use any of these, you also need to use the misc
|
||||
part of the library, but ai, 3d and network are totally independant from
|
||||
each other so you can use only the parts you really need in your project.
|
||||
|
||||
If you want know more about the library content and functionalities, you
|
||||
should take a look on the documents present in the doc directory.
|
||||
|
||||
Ryzom Core is currently developped and tested under GNU/Linux and Windows
|
||||
environments.
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
Ryzom Core is a Free Software project under the GNU Affero General Public License,
|
||||
which means all its code is available for everyone to download, examine,
|
||||
use, modify, and distribute, subject to the usual restrictions attached
|
||||
to any GPL software. If you are not familiar with the AGPL, see the COPYING
|
||||
file for for more details on license terms and other legal issues.
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Please visit http://dev.ryzom.com for more information.
|
1396
code/acinclude.m4
Normal file
1396
code/acinclude.m4
Normal file
File diff suppressed because it is too large
Load diff
6
code/changelog.template
Normal file
6
code/changelog.template
Normal file
|
@ -0,0 +1,6 @@
|
|||
# To generate ChangeLog files use these commands :
|
||||
# hg log -M --style ./changelog.template nel > nel/ChangeLog
|
||||
# hg log -M --style ./changelog.template ryzom > ryzom/ChangeLog
|
||||
|
||||
header = '\n{date|shortdate} {author}\n\n'
|
||||
changeset = '\t* {desc|fill68|tabindent|strip} [r{rev}]\n'
|
57
code/config.h.cmake
Normal file
57
code/config.h.cmake
Normal file
|
@ -0,0 +1,57 @@
|
|||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#cmakedefine HAVE_DL_H 1
|
||||
#cmakedefine HAVE_EXECINFO_H 1
|
||||
#cmakedefine HAVE_ICONV 1
|
||||
#cmakedefine HAVE_INTTYPES_H 1
|
||||
#cmakedefine HAVE_LANGINFO_CODESET 1
|
||||
#cmakedefine HAVE_LIMITS_H 1
|
||||
#cmakedefine HAVE_MALLOC_H 1
|
||||
#cmakedefine HAVE_PAM_MISC_H 1
|
||||
#cmakedefine HAVE_PAM_PAM_APPL_H 1
|
||||
#cmakedefine HAVE_PTHREAD 1
|
||||
#cmakedefine HAVE_SECURITY_PAM_APPL_H 1
|
||||
#cmakedefine HAVE_SECURITY_PAM_MISC_H 1
|
||||
#cmakedefine HAVE_STDINT_H 1
|
||||
#cmakedefine HAVE_SYS_MOUNT_H 1
|
||||
#cmakedefine HAVE_SYS_PARAM_H 1
|
||||
#cmakedefine HAVE_SYS_STATVFS_H 1
|
||||
#cmakedefine HAVE_SYS_TYPES_H 1
|
||||
#cmakedefine HAVE_UNISTD_H 1
|
||||
#cmakedefine HAVE_UTIME_H 1
|
||||
#cmakedefine HAVE_WCHAR_H 1
|
||||
|
||||
#cmakedefine HAVE_BACKTRACE 1
|
||||
#cmakedefine HAVE_INET_NTOA 1
|
||||
#cmakedefine HAVE_INET_NTOP 1
|
||||
#cmakedefine HAVE_INET_PTON 1
|
||||
#cmakedefine HAVE_STRERROR 1
|
||||
#cmakedefine HAVE_STRLCAT 1
|
||||
#cmakedefine HAVE_STRPTIME 1
|
||||
#cmakedefine HAVE_STRTOK_R 1
|
||||
#cmakedefine HAVE_STRTOULL 1
|
||||
#cmakedefine HAVE_STATVFS 1
|
||||
#cmakedefine HAVE_STAT64 1
|
||||
|
||||
#cmakedefine NL_OPENGL_AVAILABLE ${NL_OPENGL_AVAILABLE}
|
||||
#cmakedefine NL_OPENGLES_AVAILABLE ${NL_OPENGLES_AVAILABLE}
|
||||
#cmakedefine NL_DIRECT3D_AVAILABLE ${NL_DIRECT3D_AVAILABLE}
|
||||
|
||||
#cmakedefine NL_FMOD_AVAILABLE ${NL_FMOD_AVAILABLE}
|
||||
#cmakedefine NL_OPENAL_AVAILABLE ${NL_OPENAL_AVAILABLE}
|
||||
#cmakedefine NL_DSOUND_AVAILABLE ${NL_DSOUND_AVAILABLE}
|
||||
#cmakedefine NL_XAUDIO2_AVAILABLE ${NL_XAUDIO2_AVAILABLE}
|
||||
|
||||
#cmakedefine NL_BIN_PREFIX "${NL_BIN_PREFIX}"
|
||||
#cmakedefine NL_ETC_PREFIX "${NL_ETC_PREFIX}"
|
||||
#cmakedefine NL_SHARE_PREFIX "${NL_SHARE_PREFIX}"
|
||||
#cmakedefine NL_LIB_PREFIX "${NL_LIB_PREFIX}"
|
||||
#cmakedefine NL_DRIVER_PREFIX "${NL_DRIVER_PREFIX}"
|
||||
|
||||
#cmakedefine RYZOM_PREFIX "${RYZOM_PREFIX}"
|
||||
#cmakedefine RYZOM_BIN_PREFIX "${RYZOM_BIN_PREFIX}"
|
||||
#cmakedefine RYZOM_ETC_PREFIX "${RYZOM_ETC_PREFIX}"
|
||||
#cmakedefine RYZOM_SHARE_PREFIX "${RYZOM_SHARE_PREFIX}"
|
||||
|
||||
#endif // CONFIG_H
|
1
code/nel/AUTHORS
Normal file
1
code/nel/AUTHORS
Normal file
|
@ -0,0 +1 @@
|
|||
Please check www.nevrax.org for more information
|
84
code/nel/CMakeLists.txt
Normal file
84
code/nel/CMakeLists.txt
Normal file
|
@ -0,0 +1,84 @@
|
|||
PROJECT(NeL CXX C)
|
||||
|
||||
IF(WITH_STATIC_DRIVERS)
|
||||
ADD_DEFINITIONS(-DNL_STATIC)
|
||||
ENDIF(WITH_STATIC_DRIVERS)
|
||||
|
||||
# On Windows we need to find DirectInput for NLMISC.
|
||||
# This is how we get events.
|
||||
IF(WIN32)
|
||||
FIND_PACKAGE(DirectXSDK REQUIRED)
|
||||
|
||||
# On Win32 we can also build the MAX plugins.
|
||||
IF(WITH_NEL_MAXPLUGIN)
|
||||
FIND_PACKAGE(3dsMaxSDK)
|
||||
ENDIF(WITH_NEL_MAXPLUGIN)
|
||||
ENDIF(WIN32)
|
||||
|
||||
IF(WITH_3D)
|
||||
FIND_PACKAGE(FreeType)
|
||||
|
||||
IF(WITH_DRIVER_OPENGL)
|
||||
FIND_PACKAGE(OpenGL)
|
||||
IF(NOT WIN32)
|
||||
IF(APPLE)
|
||||
FIND_LIBRARY(CARBON NAMES Carbon)
|
||||
FIND_LIBRARY(COCOA NAMES Cocoa)
|
||||
ELSE(APPLE)
|
||||
FIND_PACKAGE(X11)
|
||||
FIND_PACKAGE(XF86VidMode)
|
||||
ENDIF(APPLE)
|
||||
ENDIF(NOT WIN32)
|
||||
ENDIF(WITH_DRIVER_OPENGL)
|
||||
|
||||
IF(WITH_NEL_CEGUI)
|
||||
FIND_PACKAGE(CEGUI)
|
||||
ENDIF(WITH_NEL_CEGUI)
|
||||
|
||||
ENDIF(WITH_3D)
|
||||
|
||||
IF(WITH_SOUND)
|
||||
FIND_PACKAGE(Ogg)
|
||||
FIND_PACKAGE(Vorbis)
|
||||
|
||||
IF(WITH_DRIVER_OPENAL)
|
||||
FIND_PACKAGE(OpenAL)
|
||||
ENDIF(WITH_DRIVER_OPENAL)
|
||||
|
||||
IF(WITH_DRIVER_FMOD)
|
||||
FIND_PACKAGE(FMOD)
|
||||
ENDIF(WITH_DRIVER_FMOD)
|
||||
ENDIF(WITH_SOUND)
|
||||
|
||||
IF(WITH_GTK)
|
||||
FIND_PACKAGE(GTK2)
|
||||
ENDIF(WITH_GTK)
|
||||
|
||||
IF(UNIX)
|
||||
SET(prefix ${CMAKE_INSTALL_PREFIX})
|
||||
SET(exec_prefix ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
SET(libdir ${CMAKE_INSTALL_PREFIX}/lib)
|
||||
SET(includedir ${CMAKE_INSTALL_PREFIX}/include)
|
||||
SET(enable_ligo ${WITH_LIGO})
|
||||
SET(enable_logic ${WITH_LOGIC})
|
||||
SET(enable_georges ${WITH_GEORGES})
|
||||
SET(enable_net ${WITH_NET})
|
||||
SET(enable_3d ${WITH_3D})
|
||||
SET(enable_pacs ${WITH_PACS})
|
||||
SET(enable_sound ${WITH_SOUND})
|
||||
CONFIGURE_FILE(nel-config.in ${CMAKE_CURRENT_BINARY_DIR}/nel-config)
|
||||
|
||||
INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/nel-config DESTINATION bin)
|
||||
ENDIF(UNIX)
|
||||
|
||||
ADD_SUBDIRECTORY(include)
|
||||
ADD_SUBDIRECTORY(src)
|
||||
|
||||
IF(WITH_NEL_SAMPLES)
|
||||
ADD_SUBDIRECTORY(samples)
|
||||
ENDIF(WITH_NEL_SAMPLES)
|
||||
|
||||
IF(WITH_NEL_TOOLS)
|
||||
FIND_PACKAGE(Squish)
|
||||
ADD_SUBDIRECTORY(tools)
|
||||
ENDIF(WITH_NEL_TOOLS)
|
661
code/nel/COPYING
Normal file
661
code/nel/COPYING
Normal file
|
@ -0,0 +1,661 @@
|
|||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
1
code/nel/ChangeLog
Normal file
1
code/nel/ChangeLog
Normal file
|
@ -0,0 +1 @@
|
|||
Please check http://dev.ryzom.com/projects/nel/roadmap for more information.
|
2
code/nel/INSTALL
Normal file
2
code/nel/INSTALL
Normal file
|
@ -0,0 +1,2 @@
|
|||
|
||||
Please check www.nevrax.org for more information
|
46
code/nel/Makefile.am
Normal file
46
code/nel/Makefile.am
Normal file
|
@ -0,0 +1,46 @@
|
|||
#
|
||||
#
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in \
|
||||
configure \
|
||||
libtool \
|
||||
config.guess \
|
||||
config.sub \
|
||||
ltconfig \
|
||||
aclocal.m4 \
|
||||
config.h.in \
|
||||
install-sh \
|
||||
missing \
|
||||
mkinstalldirs \
|
||||
ltmain.sh \
|
||||
include/nelconfig.h \
|
||||
include/nelconfig.h.in \
|
||||
include/nel/nelconfig.h
|
||||
|
||||
DISTCLEANFILES = include/stamp-h \
|
||||
include/stamp-h.in
|
||||
|
||||
SUBDIRS = include src @TOOLS_SUBDIR@ @SAMPLE_SUBDIR@
|
||||
|
||||
bin_SCRIPTS = nel-config
|
||||
|
||||
EXTRA_DIST = nel.dsw \
|
||||
nel.sln \
|
||||
nel_8.sln \
|
||||
autogen.sh \
|
||||
nel.m4 \
|
||||
automacros \
|
||||
doc \
|
||||
kdevelop \
|
||||
tools \
|
||||
samples
|
||||
|
||||
dist-hook:
|
||||
find $(distdir) -name CVS -print | xargs rm -fr
|
||||
find $(distdir) -name .svn -print | xargs rm -fr
|
||||
|
||||
m4datadir = $(datadir)/aclocal
|
||||
m4data_DATA = nel.m4
|
||||
|
||||
# End of Makefile.am
|
||||
|
1
code/nel/NEWS
Normal file
1
code/nel/NEWS
Normal file
|
@ -0,0 +1 @@
|
|||
Please check www.nevrax.org for more information
|
32
code/nel/README
Normal file
32
code/nel/README
Normal file
|
@ -0,0 +1,32 @@
|
|||
Introduction
|
||||
------------
|
||||
|
||||
NeL is a software platform for creating and running massively multi-user
|
||||
entertainment in a 3D environment over the Internet.
|
||||
|
||||
The NeL library is further divided into specific modules: network, ai, 3d
|
||||
and misc. If you want to use any of these, you also need to use the misc
|
||||
part of the library, but ai, 3d and network are totally independant from
|
||||
each other so you can use only the parts you really need in your project.
|
||||
|
||||
If you want know more about the library content and functionalities, you
|
||||
should take a look on the documents present in the doc directory.
|
||||
|
||||
NeL is currently developped and tested under GNU/Linux and Windows
|
||||
environments.
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
NeL is a Free Software project under the GNU Affero General Public License,
|
||||
which means all its code is available for everyone to download, examine,
|
||||
use, modify, and distribute, subject to the usual restrictions attached
|
||||
to any GPL software. If you are not familiar with the AGPL, see the COPYING
|
||||
file for for more details on license terms and other legal issues.
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Please check the dev.ryzom.com for more information
|
1214
code/nel/acinclude.m4
Normal file
1214
code/nel/acinclude.m4
Normal file
File diff suppressed because it is too large
Load diff
32
code/nel/autogen.sh
Executable file
32
code/nel/autogen.sh
Executable file
|
@ -0,0 +1,32 @@
|
|||
#!/bin/sh -
|
||||
|
||||
WANT_AUTOMAKE="1.6"
|
||||
|
||||
case `uname -s` in
|
||||
Darwin)
|
||||
LIBTOOLIZE=glibtoolize
|
||||
;;
|
||||
*)
|
||||
LIBTOOLIZE=libtoolize
|
||||
;;
|
||||
esac
|
||||
|
||||
# be able to customize the aclocal (for example to add extra param)
|
||||
if test "x$ACLOCAL" = "x"
|
||||
then
|
||||
ACLOCAL=aclocal
|
||||
fi
|
||||
|
||||
echo "Creating macros..." && \
|
||||
$ACLOCAL -I automacros/ && \
|
||||
echo "Creating library tools..." && \
|
||||
$LIBTOOLIZE --force && \
|
||||
echo "Creating header templates..." && \
|
||||
autoheader && \
|
||||
echo "Creating Makefile templates..." && \
|
||||
automake --gnu --add-missing && \
|
||||
echo "Creating 'configure'..." && \
|
||||
autoconf && \
|
||||
echo "" && \
|
||||
echo "Run: ./configure; make; make install" && \
|
||||
echo ""
|
196
code/nel/automacros/gtk-2.0.m4
Normal file
196
code/nel/automacros/gtk-2.0.m4
Normal file
|
@ -0,0 +1,196 @@
|
|||
# Configure paths for GTK+
|
||||
# Owen Taylor 1997-2001
|
||||
|
||||
dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
|
||||
dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES,
|
||||
dnl pass to pkg-config
|
||||
dnl
|
||||
AC_DEFUN([AM_PATH_GTK_2_0],
|
||||
[dnl
|
||||
dnl Get the cflags and libraries from pkg-config
|
||||
dnl
|
||||
AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program],
|
||||
, enable_gtktest=yes)
|
||||
|
||||
pkg_config_args=gtk+-2.0
|
||||
for module in . $4
|
||||
do
|
||||
case "$module" in
|
||||
gthread)
|
||||
pkg_config_args="$pkg_config_args gthread-2.0"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
no_gtk=""
|
||||
|
||||
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
||||
|
||||
if test x$PKG_CONFIG != xno ; then
|
||||
if pkg-config --atleast-pkgconfig-version 0.7 ; then
|
||||
:
|
||||
else
|
||||
echo "*** pkg-config too old; version 0.7 or better required."
|
||||
no_gtk=yes
|
||||
PKG_CONFIG=no
|
||||
fi
|
||||
else
|
||||
no_gtk=yes
|
||||
fi
|
||||
|
||||
min_gtk_version=ifelse([$1], ,2.0.0,$1)
|
||||
AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
|
||||
|
||||
if test x$PKG_CONFIG != xno ; then
|
||||
## don't try to run the test against uninstalled libtool libs
|
||||
if $PKG_CONFIG --uninstalled $pkg_config_args; then
|
||||
echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
|
||||
enable_gtktest=no
|
||||
fi
|
||||
|
||||
if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
|
||||
:
|
||||
else
|
||||
no_gtk=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x"$no_gtk" = x ; then
|
||||
GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
|
||||
GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
|
||||
gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
||||
gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
||||
gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
||||
if test "x$enable_gtktest" = "xyes" ; then
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
ac_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $GTK_CFLAGS"
|
||||
LIBS="$GTK_LIBS $LIBS"
|
||||
dnl
|
||||
dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
|
||||
dnl checks the results of pkg-config to some extent)
|
||||
dnl
|
||||
rm -f conf.gtktest
|
||||
AC_TRY_RUN([
|
||||
#include <gtk/gtk.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
int major, minor, micro;
|
||||
char *tmp_version;
|
||||
|
||||
system ("touch conf.gtktest");
|
||||
|
||||
/* HP/UX 9 (%@#!) writes to sscanf strings */
|
||||
tmp_version = g_strdup("$min_gtk_version");
|
||||
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
|
||||
printf("%s, bad version string\n", "$min_gtk_version");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if ((gtk_major_version != $gtk_config_major_version) ||
|
||||
(gtk_minor_version != $gtk_config_minor_version) ||
|
||||
(gtk_micro_version != $gtk_config_micro_version))
|
||||
{
|
||||
printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
|
||||
$gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
|
||||
gtk_major_version, gtk_minor_version, gtk_micro_version);
|
||||
printf ("*** was found! If pkg-config was correct, then it is best\n");
|
||||
printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
|
||||
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
|
||||
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
|
||||
printf("*** required on your system.\n");
|
||||
printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
|
||||
printf("*** to point to the correct configuration files\n");
|
||||
}
|
||||
else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
|
||||
(gtk_minor_version != GTK_MINOR_VERSION) ||
|
||||
(gtk_micro_version != GTK_MICRO_VERSION))
|
||||
{
|
||||
printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
|
||||
GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
|
||||
printf("*** library (version %d.%d.%d)\n",
|
||||
gtk_major_version, gtk_minor_version, gtk_micro_version);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((gtk_major_version > major) ||
|
||||
((gtk_major_version == major) && (gtk_minor_version > minor)) ||
|
||||
((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
|
||||
gtk_major_version, gtk_minor_version, gtk_micro_version);
|
||||
printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
|
||||
major, minor, micro);
|
||||
printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
|
||||
printf("***\n");
|
||||
printf("*** If you have already installed a sufficiently new version, this error\n");
|
||||
printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
|
||||
printf("*** being found. The easiest way to fix this is to remove the old version\n");
|
||||
printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
|
||||
printf("*** correct copy of pkg-config. (In this case, you will have to\n");
|
||||
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
|
||||
printf("*** so that the correct libraries are found at run-time))\n");
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
fi
|
||||
if test "x$no_gtk" = x ; then
|
||||
AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
|
||||
ifelse([$2], , :, [$2])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
if test "$PKG_CONFIG" = "no" ; then
|
||||
echo "*** A new enough version of pkg-config was not found."
|
||||
echo "*** See http://pkgconfig.sourceforge.net"
|
||||
else
|
||||
if test -f conf.gtktest ; then
|
||||
:
|
||||
else
|
||||
echo "*** Could not run GTK+ test program, checking why..."
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
ac_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $GTK_CFLAGS"
|
||||
LIBS="$LIBS $GTK_LIBS"
|
||||
AC_TRY_LINK([
|
||||
#include <gtk/gtk.h>
|
||||
#include <stdio.h>
|
||||
], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
|
||||
[ echo "*** The test program compiled, but did not run. This usually means"
|
||||
echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
|
||||
echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
|
||||
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
|
||||
echo "*** to the installed location Also, make sure you have run ldconfig if that"
|
||||
echo "*** is required on your system"
|
||||
echo "***"
|
||||
echo "*** If you have an old version installed, it is best to remove it, although"
|
||||
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
|
||||
[ echo "*** The test program failed to compile or link. See the file config.log for the"
|
||||
echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
fi
|
||||
GTK_CFLAGS=""
|
||||
GTK_LIBS=""
|
||||
ifelse([$3], , :, [$3])
|
||||
fi
|
||||
AC_SUBST(GTK_CFLAGS)
|
||||
AC_SUBST(GTK_LIBS)
|
||||
rm -f conf.gtktest
|
||||
])
|
102
code/nel/automacros/ogg.m4
Normal file
102
code/nel/automacros/ogg.m4
Normal file
|
@ -0,0 +1,102 @@
|
|||
# Configure paths for libogg
|
||||
# Jack Moffitt <jack@icecast.org> 10-21-2000
|
||||
# Shamelessly stolen from Owen Taylor and Manish Singh
|
||||
|
||||
dnl XIPH_PATH_OGG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
||||
dnl Test for libogg, and define OGG_CFLAGS and OGG_LIBS
|
||||
dnl
|
||||
AC_DEFUN([XIPH_PATH_OGG],
|
||||
[dnl
|
||||
dnl Get the cflags and libraries
|
||||
dnl
|
||||
AC_ARG_WITH(ogg,[ --with-ogg=PFX Prefix where libogg is installed (optional)], ogg_prefix="$withval", ogg_prefix="")
|
||||
AC_ARG_WITH(ogg-libraries,[ --with-ogg-libraries=DIR Directory where libogg library is installed (optional)], ogg_libraries="$withval", ogg_libraries="")
|
||||
AC_ARG_WITH(ogg-includes,[ --with-ogg-includes=DIR Directory where libogg header files are installed (optional)], ogg_includes="$withval", ogg_includes="")
|
||||
AC_ARG_ENABLE(oggtest, [ --disable-oggtest Do not try to compile and run a test Ogg program],, enable_oggtest=yes)
|
||||
|
||||
if test "x$ogg_libraries" != "x" ; then
|
||||
OGG_LIBS="-L$ogg_libraries"
|
||||
elif test "x$ogg_prefix" != "x" ; then
|
||||
OGG_LIBS="-L$ogg_prefix/lib"
|
||||
elif test "x$prefix" != "xNONE" ; then
|
||||
OGG_LIBS="-L$prefix/lib"
|
||||
fi
|
||||
|
||||
OGG_LIBS="$OGG_LIBS -logg"
|
||||
|
||||
if test "x$ogg_includes" != "x" ; then
|
||||
OGG_CFLAGS="-I$ogg_includes"
|
||||
elif test "x$ogg_prefix" != "x" ; then
|
||||
OGG_CFLAGS="-I$ogg_prefix/include"
|
||||
elif test "x$prefix" != "xNONE"; then
|
||||
OGG_CFLAGS="-I$prefix/include"
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for Ogg)
|
||||
no_ogg=""
|
||||
|
||||
|
||||
if test "x$enable_oggtest" = "xyes" ; then
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
ac_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $OGG_CFLAGS"
|
||||
LIBS="$LIBS $OGG_LIBS"
|
||||
dnl
|
||||
dnl Now check if the installed Ogg is sufficiently new.
|
||||
dnl
|
||||
rm -f conf.oggtest
|
||||
AC_TRY_RUN([
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ogg/ogg.h>
|
||||
|
||||
int main ()
|
||||
{
|
||||
system("touch conf.oggtest");
|
||||
return 0;
|
||||
}
|
||||
|
||||
],, no_ogg=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
|
||||
if test "x$no_ogg" = "x" ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
ifelse([$1], , :, [$1])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
if test -f conf.oggtest ; then
|
||||
:
|
||||
else
|
||||
echo "*** Could not run Ogg test program, checking why..."
|
||||
CFLAGS="$CFLAGS $OGG_CFLAGS"
|
||||
LIBS="$LIBS $OGG_LIBS"
|
||||
AC_TRY_LINK([
|
||||
#include <stdio.h>
|
||||
#include <ogg/ogg.h>
|
||||
], [ return 0; ],
|
||||
[ echo "*** The test program compiled, but did not run. This usually means"
|
||||
echo "*** that the run-time linker is not finding Ogg or finding the wrong"
|
||||
echo "*** version of Ogg. If it is not finding Ogg, you'll need to set your"
|
||||
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
|
||||
echo "*** to the installed location Also, make sure you have run ldconfig if that"
|
||||
echo "*** is required on your system"
|
||||
echo "***"
|
||||
echo "*** If you have an old version installed, it is best to remove it, although"
|
||||
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
|
||||
[ echo "*** The test program failed to compile or link. See the file config.log for the"
|
||||
echo "*** exact error that occured. This usually means Ogg was incorrectly installed"
|
||||
echo "*** or that you have moved Ogg since it was installed." ])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
OGG_CFLAGS=""
|
||||
OGG_LIBS=""
|
||||
ifelse([$2], , :, [$2])
|
||||
fi
|
||||
AC_SUBST(OGG_CFLAGS)
|
||||
AC_SUBST(OGG_LIBS)
|
||||
rm -f conf.oggtest
|
||||
])
|
157
code/nel/automacros/pkg.m4
Normal file
157
code/nel/automacros/pkg.m4
Normal file
|
@ -0,0 +1,157 @@
|
|||
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
|
||||
#
|
||||
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
|
||||
# ----------------------------------
|
||||
AC_DEFUN([PKG_PROG_PKG_CONFIG],
|
||||
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
|
||||
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
|
||||
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
|
||||
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
|
||||
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
|
||||
fi
|
||||
if test -n "$PKG_CONFIG"; then
|
||||
_pkg_min_version=m4_default([$1], [0.9.0])
|
||||
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
PKG_CONFIG=""
|
||||
fi
|
||||
|
||||
fi[]dnl
|
||||
])# PKG_PROG_PKG_CONFIG
|
||||
|
||||
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
||||
#
|
||||
# Check to see whether a particular set of modules exists. Similar
|
||||
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
|
||||
#
|
||||
#
|
||||
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
|
||||
# this or PKG_CHECK_MODULES is called, or make sure to call
|
||||
# PKG_CHECK_EXISTS manually
|
||||
# --------------------------------------------------------------
|
||||
AC_DEFUN([PKG_CHECK_EXISTS],
|
||||
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
||||
if test -n "$PKG_CONFIG" && \
|
||||
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
|
||||
m4_ifval([$2], [$2], [:])
|
||||
m4_ifvaln([$3], [else
|
||||
$3])dnl
|
||||
fi])
|
||||
|
||||
|
||||
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
|
||||
# ---------------------------------------------
|
||||
m4_define([_PKG_CONFIG],
|
||||
[if test -n "$PKG_CONFIG"; then
|
||||
if test -n "$$1"; then
|
||||
pkg_cv_[]$1="$$1"
|
||||
else
|
||||
PKG_CHECK_EXISTS([$3],
|
||||
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
|
||||
[pkg_failed=yes])
|
||||
fi
|
||||
else
|
||||
pkg_failed=untried
|
||||
fi[]dnl
|
||||
])# _PKG_CONFIG
|
||||
|
||||
# _PKG_SHORT_ERRORS_SUPPORTED
|
||||
# -----------------------------
|
||||
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
|
||||
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
|
||||
_pkg_short_errors_supported=yes
|
||||
else
|
||||
_pkg_short_errors_supported=no
|
||||
fi[]dnl
|
||||
])# _PKG_SHORT_ERRORS_SUPPORTED
|
||||
|
||||
|
||||
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
|
||||
# [ACTION-IF-NOT-FOUND])
|
||||
#
|
||||
#
|
||||
# Note that if there is a possibility the first call to
|
||||
# PKG_CHECK_MODULES might not happen, you should be sure to include an
|
||||
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
|
||||
#
|
||||
#
|
||||
# --------------------------------------------------------------
|
||||
AC_DEFUN([PKG_CHECK_MODULES],
|
||||
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
||||
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
|
||||
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
|
||||
|
||||
pkg_failed=no
|
||||
AC_MSG_CHECKING([for $1])
|
||||
|
||||
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
|
||||
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
|
||||
|
||||
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
|
||||
and $1[]_LIBS to avoid the need to call pkg-config.
|
||||
See the pkg-config man page for more details.])
|
||||
|
||||
if test $pkg_failed = yes; then
|
||||
_PKG_SHORT_ERRORS_SUPPORTED
|
||||
if test $_pkg_short_errors_supported = yes; then
|
||||
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
|
||||
else
|
||||
$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
|
||||
fi
|
||||
# Put the nasty error message in config.log where it belongs
|
||||
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
|
||||
|
||||
ifelse([$4], , [AC_MSG_ERROR(dnl
|
||||
[Package requirements ($2) were not met:
|
||||
|
||||
$$1_PKG_ERRORS
|
||||
|
||||
Consider adjusting the PKG_CONFIG_PATH environment variable if you
|
||||
installed software in a non-standard prefix.
|
||||
|
||||
_PKG_TEXT
|
||||
])],
|
||||
[AC_MSG_RESULT([no])
|
||||
$4])
|
||||
elif test $pkg_failed = untried; then
|
||||
ifelse([$4], , [AC_MSG_FAILURE(dnl
|
||||
[The pkg-config script could not be found or is too old. Make sure it
|
||||
is in your PATH or set the PKG_CONFIG environment variable to the full
|
||||
path to pkg-config.
|
||||
|
||||
_PKG_TEXT
|
||||
|
||||
To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
|
||||
[$4])
|
||||
else
|
||||
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
|
||||
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
|
||||
AC_MSG_RESULT([yes])
|
||||
ifelse([$3], , :, [$3])
|
||||
fi[]dnl
|
||||
])# PKG_CHECK_MODULES
|
122
code/nel/automacros/vorbis.m4
Normal file
122
code/nel/automacros/vorbis.m4
Normal file
|
@ -0,0 +1,122 @@
|
|||
# Configure paths for libvorbis
|
||||
# Jack Moffitt <jack@icecast.org> 10-21-2000
|
||||
# Shamelessly stolen from Owen Taylor and Manish Singh
|
||||
# thomasvs added check for vorbis_bitrate_addblock which is new in rc3
|
||||
|
||||
dnl XIPH_PATH_VORBIS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
||||
dnl Test for libvorbis, and define VORBIS_CFLAGS and VORBIS_LIBS
|
||||
dnl
|
||||
AC_DEFUN([XIPH_PATH_VORBIS],
|
||||
[dnl
|
||||
dnl Get the cflags and libraries
|
||||
dnl
|
||||
AC_ARG_WITH(vorbis,[ --with-vorbis=PFX Prefix where libvorbis is installed (optional)], vorbis_prefix="$withval", vorbis_prefix="")
|
||||
AC_ARG_WITH(vorbis-libraries,[ --with-vorbis-libraries=DIR Directory where libvorbis library is installed (optional)], vorbis_libraries="$withval", vorbis_libraries="")
|
||||
AC_ARG_WITH(vorbis-includes,[ --with-vorbis-includes=DIR Directory where libvorbis header files are installed (optional)], vorbis_includes="$withval", vorbis_includes="")
|
||||
AC_ARG_ENABLE(vorbistest, [ --disable-vorbistest Do not try to compile and run a test Vorbis program],, enable_vorbistest=yes)
|
||||
|
||||
if test "x$vorbis_libraries" != "x" ; then
|
||||
VORBIS_LIBS="-L$vorbis_libraries"
|
||||
elif test "x$vorbis_prefix" != "x" ; then
|
||||
VORBIS_LIBS="-L$vorbis_prefix/lib"
|
||||
elif test "x$prefix" != "xNONE"; then
|
||||
VORBIS_LIBS="-L$prefix/lib"
|
||||
fi
|
||||
|
||||
VORBIS_LIBS="$VORBIS_LIBS -lvorbis -lm"
|
||||
VORBISFILE_LIBS="-lvorbisfile"
|
||||
VORBISENC_LIBS="-lvorbisenc"
|
||||
|
||||
if test "x$vorbis_includes" != "x" ; then
|
||||
VORBIS_CFLAGS="-I$vorbis_includes"
|
||||
elif test "x$vorbis_prefix" != "x" ; then
|
||||
VORBIS_CFLAGS="-I$vorbis_prefix/include"
|
||||
elif test "x$prefix" != "xNONE"; then
|
||||
VORBIS_CFLAGS="-I$prefix/include"
|
||||
fi
|
||||
|
||||
|
||||
AC_MSG_CHECKING(for Vorbis)
|
||||
no_vorbis=""
|
||||
|
||||
|
||||
if test "x$enable_vorbistest" = "xyes" ; then
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
ac_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $VORBIS_CFLAGS $OGG_CFLAGS"
|
||||
LIBS="$LIBS $VORBIS_LIBS $VORBISENC_LIBS $OGG_LIBS"
|
||||
dnl
|
||||
dnl Now check if the installed Vorbis is sufficiently new.
|
||||
dnl
|
||||
rm -f conf.vorbistest
|
||||
AC_TRY_RUN([
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <vorbis/codec.h>
|
||||
#include <vorbis/vorbisenc.h>
|
||||
|
||||
int main ()
|
||||
{
|
||||
vorbis_block vb;
|
||||
vorbis_dsp_state vd;
|
||||
vorbis_info vi;
|
||||
|
||||
vorbis_info_init (&vi);
|
||||
vorbis_encode_init (&vi, 2, 44100, -1, 128000, -1);
|
||||
vorbis_analysis_init (&vd, &vi);
|
||||
vorbis_block_init (&vd, &vb);
|
||||
/* this function was added in 1.0rc3, so this is what we're testing for */
|
||||
vorbis_bitrate_addblock (&vb);
|
||||
|
||||
system("touch conf.vorbistest");
|
||||
return 0;
|
||||
}
|
||||
|
||||
],, no_vorbis=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
|
||||
if test "x$no_vorbis" = "x" ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
ifelse([$1], , :, [$1])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
if test -f conf.vorbistest ; then
|
||||
:
|
||||
else
|
||||
echo "*** Could not run Vorbis test program, checking why..."
|
||||
CFLAGS="$CFLAGS $VORBIS_CFLAGS"
|
||||
LIBS="$LIBS $VORBIS_LIBS $OGG_LIBS"
|
||||
AC_TRY_LINK([
|
||||
#include <stdio.h>
|
||||
#include <vorbis/codec.h>
|
||||
], [ return 0; ],
|
||||
[ echo "*** The test program compiled, but did not run. This usually means"
|
||||
echo "*** that the run-time linker is not finding Vorbis or finding the wrong"
|
||||
echo "*** version of Vorbis. If it is not finding Vorbis, you'll need to set your"
|
||||
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
|
||||
echo "*** to the installed location Also, make sure you have run ldconfig if that"
|
||||
echo "*** is required on your system"
|
||||
echo "***"
|
||||
echo "*** If you have an old version installed, it is best to remove it, although"
|
||||
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
|
||||
[ echo "*** The test program failed to compile or link. See the file config.log for the"
|
||||
echo "*** exact error that occured. This usually means Vorbis was incorrectly installed"
|
||||
echo "*** or that you have moved Vorbis since it was installed." ])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
VORBIS_CFLAGS=""
|
||||
VORBIS_LIBS=""
|
||||
VORBISFILE_LIBS=""
|
||||
VORBISENC_LIBS=""
|
||||
ifelse([$2], , :, [$2])
|
||||
fi
|
||||
AC_SUBST(VORBIS_CFLAGS)
|
||||
AC_SUBST(VORBIS_LIBS)
|
||||
AC_SUBST(VORBISFILE_LIBS)
|
||||
AC_SUBST(VORBISENC_LIBS)
|
||||
rm -f conf.vorbistest
|
||||
])
|
599
code/nel/configure.ac
Normal file
599
code/nel/configure.ac
Normal file
|
@ -0,0 +1,599 @@
|
|||
# ====================================================================
|
||||
# Configuration script for NeL
|
||||
# ====================================================================
|
||||
#
|
||||
# $Id: configure.ac,v 1.8 2005/04/14 15:54:32 cado Exp $
|
||||
#
|
||||
|
||||
# ====================================================================
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
# ====================================================================
|
||||
|
||||
# If you want to change the version, must must change AC_INIT
|
||||
# *and* AC_SUBST(LIBTOOL_VERSION)
|
||||
|
||||
AC_PREREQ(2.57)
|
||||
AC_INIT([nel],[0.8.0],[nel-all@nevrax.org])
|
||||
AM_INIT_AUTOMAKE([tar-ustar])
|
||||
|
||||
AC_CONFIG_SRCDIR(include/nel/misc/types_nl.h)
|
||||
AM_CONFIG_HEADER(include/nelconfig.h)
|
||||
|
||||
AC_SUBST(LIBTOOL_VERSION, [0:7:0])
|
||||
|
||||
# Checks for programs.
|
||||
AC_CANONICAL_HOST
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CPP
|
||||
AC_PROG_YACC
|
||||
AC_PROG_LEX
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_MAKE_SET
|
||||
AC_PROG_LIBTOOL
|
||||
AM_PROG_LIBTOOL
|
||||
AM_SANITY_CHECK
|
||||
|
||||
AC_SYS_LARGEFILE
|
||||
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
|
||||
# Template needed to generate the nelconfig.h.in
|
||||
AH_TEMPLATE([NEL_DEFAULT_DISPLAYER],[Define to 1 if you want log on standard output])
|
||||
AH_TEMPLATE([NEL_LOG_IN_FILE],[Define to 1 if you want a debug log.log file in the current directory])
|
||||
AH_TEMPLATE([HAVE_X86],[Define to 1 if you are on a INTEL compatible processor])
|
||||
AH_TEMPLATE([HAVE_X86_64],[Define to 1 if you are on AMD opteron 64bits processor])
|
||||
AH_TEMPLATE([NL_USE_GTK], [Define to 1 if you want GTK support])
|
||||
|
||||
# Get host type info
|
||||
if test "$host_cpu" = "i386" -o "$host_cpu" = "i486" -o "$host_cpu" = "i586" \
|
||||
-o "$host_cpu" = "i686" -o "$host_cpu" = "i786" -o "$host_cpu" = "x86_64"
|
||||
then
|
||||
AC_DEFINE([HAVE_X86])
|
||||
fi
|
||||
|
||||
if test "$host_cpu" = "x86_64"
|
||||
then
|
||||
AC_DEFINE([HAVE_X86_64])
|
||||
fi
|
||||
|
||||
# The following hack should ensure that configure doesnt add optimizing
|
||||
# or debugging flags to CFLAGS or CXXFLAGS
|
||||
CXXFLAGS="$CXXFLAGS -fno-strict-aliasing -ftemplate-depth-24 -fno-stack-protector"
|
||||
|
||||
|
||||
# ====================================================================
|
||||
# Checks NeL modules (net, 3d) to install / Disable
|
||||
# ====================================================================
|
||||
|
||||
# The misc is mandatory, it is use by the other modules.
|
||||
|
||||
NEL_SUBDIRS="misc"
|
||||
|
||||
# NeL libraries that are enabled by default
|
||||
|
||||
# Network library
|
||||
AC_ARG_ENABLE([net],
|
||||
AC_HELP_STRING([--disable-net],
|
||||
[disable compilation and install of NeL Network]),
|
||||
[],
|
||||
[enable_net=yes])
|
||||
|
||||
if test "$enable_net" = "no"
|
||||
then
|
||||
AC_MSG_RESULT([disable NeL Network])
|
||||
else
|
||||
NEL_SUBDIRS="$NEL_SUBDIRS net"
|
||||
fi
|
||||
|
||||
# 3D library
|
||||
AC_ARG_ENABLE([3d],
|
||||
AC_HELP_STRING([--disable-3d],
|
||||
[disable compilation and install of NeL 3D]),
|
||||
[],
|
||||
[enable_3d=yes])
|
||||
|
||||
if test "$enable_3d" = "no"
|
||||
then
|
||||
AC_MSG_RESULT([disable NeL 3D])
|
||||
else
|
||||
NEL_SUBDIRS="$NEL_SUBDIRS 3d"
|
||||
fi
|
||||
|
||||
# PACS library
|
||||
AC_ARG_ENABLE([pacs],
|
||||
AC_HELP_STRING([--disable-pacs],
|
||||
[disable compilation and install of NeL PACS]),
|
||||
[],
|
||||
[enable_pacs=yes])
|
||||
|
||||
if test "$enable_pacs" = "no"
|
||||
then
|
||||
AC_MSG_RESULT([disable NeL PACS])
|
||||
else
|
||||
NEL_SUBDIRS="$NEL_SUBDIRS pacs"
|
||||
fi
|
||||
|
||||
# Georges library
|
||||
AC_ARG_ENABLE([georges],
|
||||
AC_HELP_STRING([--disable-georges],
|
||||
[disable compilation and install of NeL Georges]),
|
||||
[],
|
||||
[enable_georges=yes])
|
||||
|
||||
if test "$enable_georges" = "no"
|
||||
then
|
||||
AC_MSG_RESULT([disable NeL Georges])
|
||||
else
|
||||
NEL_SUBDIRS="$NEL_SUBDIRS georges"
|
||||
fi
|
||||
|
||||
# Ligo library
|
||||
AC_ARG_ENABLE([ligo],
|
||||
AC_HELP_STRING([--disable-ligo],
|
||||
[disable compilation and install of NeL Ligo]),
|
||||
[],
|
||||
[enable_ligo=yes])
|
||||
|
||||
if test "$enable_ligo" = "no"
|
||||
then
|
||||
AC_MSG_RESULT([disable NeL Ligo])
|
||||
else
|
||||
NEL_SUBDIRS="$NEL_SUBDIRS ligo"
|
||||
fi
|
||||
|
||||
|
||||
# NeL libraries that are disabled by default
|
||||
|
||||
# Sound library
|
||||
AC_ARG_ENABLE([sound],
|
||||
AC_HELP_STRING([--enable-sound],
|
||||
[enable compilation and install of NeL Sound]),
|
||||
[],
|
||||
[enable_sound=no])
|
||||
|
||||
if test "$enable_sound" = "yes"
|
||||
then
|
||||
AC_MSG_RESULT([enable NeL Sound])
|
||||
NEL_SUBDIRS="$NEL_SUBDIRS sound"
|
||||
fi
|
||||
|
||||
# CEGUI Renderer library
|
||||
AC_ARG_ENABLE([cegui],
|
||||
AC_HELP_STRING([--enable-cegui],
|
||||
[enable compilation and install of NeL CEGUI Renderer]),
|
||||
[],
|
||||
[enable_cegui=no])
|
||||
|
||||
CEGUI_SUBDIR=""
|
||||
if test "$enable_cegui" = "yes"
|
||||
then
|
||||
AC_MSG_RESULT([enable NeL CEGUI Renderer])
|
||||
NEL_SUBDIRS="$NEL_SUBDIRS cegui"
|
||||
CEGUI_SUBDIR="cegui"
|
||||
fi
|
||||
|
||||
# Unit Tests
|
||||
AC_ARG_ENABLE([tests],
|
||||
AC_HELP_STRING([--enable-tests],
|
||||
[enable unit tests of NeL]),
|
||||
[],
|
||||
[enable_tests=no])
|
||||
|
||||
if test "$enable_tests" = "yes"
|
||||
then
|
||||
AC_MSG_RESULT([enable NeL Unit Tests])
|
||||
fi
|
||||
|
||||
# Code Coverage
|
||||
AC_ARG_ENABLE([coverage],
|
||||
AC_HELP_STRING([--enable-coverage],
|
||||
[enable code coverage generation]),
|
||||
[]
|
||||
[enable_coverage=no])
|
||||
|
||||
if test "$enable_coverage" = "yes"
|
||||
then
|
||||
AC_MSG_RESULT([enable Code Coverage generation])
|
||||
|
||||
CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage"
|
||||
fi
|
||||
|
||||
# Enable/disable samples compilation.
|
||||
AC_ARG_ENABLE([samples],
|
||||
AC_HELP_STRING([--disable-samples],
|
||||
[disable sample code]),
|
||||
[],
|
||||
[enable_samples="yes"])
|
||||
|
||||
if test "$enable_samples" = "no"
|
||||
then
|
||||
AC_MSG_RESULT([disable sample code.])
|
||||
SAMPLE_SUBDIR=""
|
||||
else
|
||||
SAMPLE_SUBDIR="samples"
|
||||
fi
|
||||
|
||||
# Enable/disable tools compilation.
|
||||
AC_ARG_ENABLE([tools],
|
||||
AC_HELP_STRING([--disable-tools],
|
||||
[disable tools code]),
|
||||
[],
|
||||
[enable_tools="yes"])
|
||||
|
||||
if test "$enable_tools" = "no"
|
||||
then
|
||||
AC_MSG_RESULT([disable tools code.])
|
||||
TOOLS_SUBDIR=""
|
||||
else
|
||||
TOOLS_SUBDIR="tools"
|
||||
fi
|
||||
|
||||
AC_SUBST([enable_net])
|
||||
AC_SUBST([enable_3d])
|
||||
AC_SUBST([enable_pacs])
|
||||
AC_SUBST([enable_sound])
|
||||
AC_SUBST([enable_georges])
|
||||
AC_SUBST([enable_ligo])
|
||||
AC_SUBST([enable_cegui])
|
||||
|
||||
AC_SUBST([NEL_SUBDIRS])
|
||||
AC_SUBST([SAMPLE_SUBDIR])
|
||||
AC_SUBST([TOOLS_SUBDIR])
|
||||
AC_SUBST([CEGUI_SUBDIR])
|
||||
|
||||
# ====================================================================
|
||||
# Checks for programs.
|
||||
# ====================================================================
|
||||
|
||||
# ====================================================================
|
||||
# Configure Settings
|
||||
# ====================================================================
|
||||
|
||||
# Disable the static linking by default
|
||||
# AC_DISABLE_STATIC
|
||||
|
||||
# Use C++ compiler as a default for the compilation tests.
|
||||
AC_LANG([C++])
|
||||
|
||||
|
||||
# ====================================================================
|
||||
# Debug/optimized compilation mode
|
||||
# ====================================================================
|
||||
|
||||
AM_NEL_DEBUG
|
||||
|
||||
AC_ARG_WITH([logging],
|
||||
AC_HELP_STRING([--without-logging],
|
||||
[be silent on stdout and in no log.log]),
|
||||
[],
|
||||
[with_logging=yes])
|
||||
|
||||
if test "$with_logging" = "yes"
|
||||
then
|
||||
AC_DEFINE([NEL_DEFAULT_DISPLAYER], 1)
|
||||
AC_DEFINE([NEL_LOG_IN_FILE], 1)
|
||||
fi
|
||||
|
||||
# ====================================================================
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
# ====================================================================
|
||||
|
||||
# Test endianness
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
# Supress GCC "multi-character character constant" warnings.
|
||||
if test "$ac_cv_cxx_compiler_gnu" = "yes";
|
||||
then
|
||||
if test "$with_debug" = "yes"
|
||||
then
|
||||
#
|
||||
# When debugging variables are declared for the sole purpose of
|
||||
# inspecting their content with a debugger. They are not used
|
||||
# in the code itself and this is legitimate, hence the -Wno-unused
|
||||
#
|
||||
CXXFLAGS="$CXXFLAGS -Wno-unused"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Add some common define
|
||||
if test "$ac_cv_cxx_compiler_gnu" = "yes";
|
||||
then
|
||||
CXXFLAGS="$CXXFLAGS -D_REENTRANT -Wall -ansi -W -Wpointer-arith -Wsign-compare -Wno-deprecated-declarations -Wno-multichar -Wno-long-long -Wno-unused"
|
||||
fi
|
||||
|
||||
|
||||
# ====================================================================
|
||||
# Checks for header and lib files.
|
||||
# ====================================================================
|
||||
|
||||
AC_FUNC_ALLOCA
|
||||
AC_HEADER_DIRENT
|
||||
AC_HEADER_STDC
|
||||
AC_HEADER_TIME
|
||||
AC_CHECK_HEADERS([arpa/inet.h fcntl.h float.h malloc.h netdb.h netinet/in.h stddef.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h sys/time.h])
|
||||
AC_CHECK_LIB([pthread], [pthread_create])
|
||||
AC_CHECK_LIB([dl], [dlopen])
|
||||
|
||||
|
||||
# ====================================================================
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
# ====================================================================
|
||||
|
||||
AC_HEADER_STDBOOL
|
||||
AC_C_CONST
|
||||
AC_C_INLINE
|
||||
AC_TYPE_SIZE_T
|
||||
AC_HEADER_TIME
|
||||
AC_STRUCT_TM
|
||||
AC_C_VOLATILE
|
||||
AC_CHECK_TYPES([ptrdiff_t])
|
||||
AC_CHECK_TYPES([size_t])
|
||||
AC_CHECK_TYPES([uintptr_t])
|
||||
|
||||
|
||||
# ====================================================================
|
||||
# Checks for library functions.
|
||||
# ====================================================================
|
||||
|
||||
AC_FUNC_CLOSEDIR_VOID
|
||||
AC_FUNC_ERROR_AT_LINE
|
||||
AC_PROG_GCC_TRADITIONAL
|
||||
AC_FUNC_MALLOC
|
||||
AC_FUNC_MEMCMP
|
||||
AC_FUNC_REALLOC
|
||||
AC_FUNC_SELECT_ARGTYPES
|
||||
AC_TYPE_SIGNAL
|
||||
AC_FUNC_STAT
|
||||
AC_FUNC_STRFTIME
|
||||
AC_FUNC_FORK
|
||||
AC_FUNC_VPRINTF
|
||||
AC_CHECK_FUNCS([floor getcwd gethostbyaddr gethostbyname gethostname gettimeofday inet_ntoa memmove memset mkdir pow select socket sqrt strcasecmp strchr strdup strerror strrchr strstr strtoul sys/time.h])
|
||||
|
||||
|
||||
# ====================================================================
|
||||
# X11
|
||||
|
||||
AC_PATH_X
|
||||
|
||||
if test ! "$no_x" = "yes"
|
||||
then
|
||||
if test ! X"$x_libraries" = X
|
||||
then
|
||||
LIBS="$LIBS -L$x_libraries"
|
||||
fi
|
||||
|
||||
if test ! X"$x_includes" = X
|
||||
then
|
||||
CXXFLAGS="$CXXFLAGS -I$x_includes"
|
||||
fi
|
||||
else
|
||||
if test "$enable_3d" = "yes"
|
||||
then
|
||||
AC_MSG_ERROR([X11 must be installed for NeL 3d library, use --disable-3d if you don't need NeL 3d library])
|
||||
fi
|
||||
fi
|
||||
|
||||
# ====================================================================
|
||||
# LibXML
|
||||
|
||||
# Use C compiler as a default for the libxml tests.
|
||||
AC_LANG([C])
|
||||
|
||||
AM_PATH_XML2([2.0.0], [], [AC_MSG_ERROR([libxml2 must be installed])])
|
||||
|
||||
CXXFLAGS="$CXXFLAGS $XML_CFLAGS $XML_CPPFLAGS"
|
||||
|
||||
LIBS="$LIBS $XML_LIBS"
|
||||
|
||||
# Use C++ compiler as a default for the compilation tests.
|
||||
AC_LANG([C++])
|
||||
|
||||
# ====================================================================
|
||||
# libpng
|
||||
|
||||
AC_CHECK_HEADER(png.h, [], AC_MSG_ERROR([libpng must be installed]))
|
||||
|
||||
# ====================================================================
|
||||
# libjpeg
|
||||
|
||||
AC_CHECK_HEADER(jpeglib.h, [], AC_MSG_ERROR([libjpeg must be installed]))
|
||||
|
||||
# ====================================================================
|
||||
# Checks for libraries.
|
||||
# ====================================================================
|
||||
|
||||
# ====================================================================
|
||||
# GTK 2.0+
|
||||
|
||||
AC_ARG_WITH([gtk],
|
||||
AC_HELP_STRING([--with-gtk],
|
||||
[add GTK dependent code like GTK displayer]),
|
||||
[],
|
||||
[with_gtk=no])
|
||||
|
||||
if test "$with_gtk" = "yes"
|
||||
then
|
||||
AC_LANG([C])
|
||||
|
||||
AM_PATH_GTK_2_0([2.0.0],
|
||||
CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
|
||||
LIBS="$LIBS $GTK_LIBS"
|
||||
AC_DEFINE(NL_USE_GTK, [], [Undef if you don't want to use anything GTK based like the GTK Displayer]
|
||||
)
|
||||
)
|
||||
|
||||
AC_LANG([C++])
|
||||
|
||||
AC_SUBST([with_gtk])
|
||||
fi
|
||||
|
||||
# ====================================================================
|
||||
# CEGUI
|
||||
|
||||
if test "$enable_cegui" = "yes"
|
||||
then
|
||||
PKG_CHECK_MODULES(CEGUI, CEGUI >= 0.4,
|
||||
[],
|
||||
[
|
||||
AC_MSG_ERROR([Couldn't find CEGUI or tests failed:
|
||||
$CEGUI_PKG_ERRORS
|
||||
Please go to http://crayzedsgui.sourceforge.net to get the latest, or check
|
||||
config.log to see why the tests failed, and fix it.])
|
||||
])
|
||||
fi
|
||||
|
||||
# ====================================================================
|
||||
# FreeType 2
|
||||
|
||||
AM_PATH_FREETYPE($enable_3d)
|
||||
|
||||
|
||||
# ====================================================================
|
||||
# OpenGL
|
||||
|
||||
AM_PATH_OPENGL($enable_3d)
|
||||
|
||||
|
||||
# ====================================================================
|
||||
# Check for XF86VidMode extension (-lXxf86vm)
|
||||
|
||||
AM_PATH_XF86VIDMODE
|
||||
|
||||
|
||||
# ====================================================================
|
||||
# FMOD, OpenAL
|
||||
|
||||
if test "$enable_sound" = "yes"
|
||||
then
|
||||
AM_PATH_FMOD("no")
|
||||
AM_PATH_OPENAL("no")
|
||||
if test "$have_fmod" = "no" -a "$have_openal" = "no"
|
||||
then
|
||||
AC_MSG_ERROR([Either FMod or OpenAL must be installed to use sound.])
|
||||
fi
|
||||
if test "$have_fmod" = "yes"
|
||||
then
|
||||
SOUND_SUBDIRS="fmod"
|
||||
else
|
||||
SOUND_SUBDIRS=""
|
||||
fi
|
||||
if test "$have_openal" = "yes"
|
||||
then
|
||||
SOUND_SUBDIRS="$SOUND_SUBDIRS openal"
|
||||
|
||||
XIPH_PATH_OGG([], AC_MSG_ERROR([Driver OpenAL Requires libogg!]))
|
||||
XIPH_PATH_VORBIS([], AC_MSG_ERROR([Driver OpenAL Requires libvorbis!]))
|
||||
fi
|
||||
AC_SUBST([SOUND_SUBDIRS])
|
||||
fi
|
||||
|
||||
|
||||
# ====================================================================
|
||||
# CppTest
|
||||
|
||||
#AM_PATH_CPPTEST($enable_tests)
|
||||
|
||||
# ====================================================================
|
||||
# Arrange for the include directory to be in the search path even when
|
||||
# build is done outside the source tree
|
||||
# Put the nelconfig.h define
|
||||
CXXFLAGS="$CXXFLAGS -I\${top_srcdir}/include -DHAVE_NELCONFIG_H"
|
||||
|
||||
# ====================================================================
|
||||
# Checks for library functions.
|
||||
# ====================================================================
|
||||
|
||||
|
||||
# ====================================================================
|
||||
# Output files to generate.
|
||||
# ====================================================================
|
||||
|
||||
AC_CONFIG_FILES([Makefile \
|
||||
include/Makefile \
|
||||
include/nel/Makefile \
|
||||
include/nel/ligo/Makefile \
|
||||
include/nel/misc/Makefile \
|
||||
include/nel/net/Makefile \
|
||||
include/nel/3d/Makefile \
|
||||
include/nel/pacs/Makefile \
|
||||
include/nel/sound/Makefile \
|
||||
include/nel/georges/Makefile \
|
||||
include/nel/cegui/Makefile \
|
||||
src/Makefile \
|
||||
src/misc/Makefile \
|
||||
src/misc/nel-misc.pc \
|
||||
src/misc/config_file/Makefile \
|
||||
src/net/Makefile \
|
||||
src/3d/Makefile \
|
||||
src/3d/nel-3d.pc \
|
||||
src/3d/driver/Makefile \
|
||||
src/3d/driver/opengl/Makefile \
|
||||
src/3d/driver/opengl/nel-driverogl.pc \
|
||||
src/pacs/Makefile \
|
||||
src/sound/Makefile \
|
||||
src/sound/driver/Makefile \
|
||||
src/sound/driver/fmod/Makefile \
|
||||
src/sound/driver/openal/Makefile \
|
||||
src/georges/Makefile \
|
||||
src/ligo/Makefile \
|
||||
src/cegui/Makefile \
|
||||
tools/Makefile \
|
||||
tools/3d/Makefile \
|
||||
tools/3d/build_coarse_mesh/Makefile \
|
||||
tools/3d/build_far_bank/Makefile \
|
||||
tools/3d/build_smallbank/Makefile \
|
||||
tools/3d/ig_lighter/Makefile \
|
||||
tools/3d/ig_lighter_lib/Makefile \
|
||||
tools/3d/panoply_maker/Makefile \
|
||||
tools/3d/zone_dependencies/Makefile \
|
||||
tools/3d/zone_ig_lighter/Makefile \
|
||||
tools/3d/zone_lib/Makefile \
|
||||
tools/3d/zone_lighter/Makefile \
|
||||
tools/3d/zone_welder/Makefile \
|
||||
tools/misc/Makefile \
|
||||
tools/misc/bnp_make/Makefile \
|
||||
tools/misc/disp_sheet_id/Makefile \
|
||||
tools/misc/make_sheet_id/Makefile \
|
||||
tools/misc/xml_packer/Makefile \
|
||||
tools/pacs/Makefile \
|
||||
tools/pacs/build_ig_boxes/Makefile \
|
||||
tools/pacs/build_indoor_rbank/Makefile \
|
||||
tools/pacs/build_rbank/Makefile \
|
||||
samples/Makefile \
|
||||
samples/sound_sources/Makefile \
|
||||
samples/pacs/Makefile \
|
||||
samples/georges/Makefile \
|
||||
samples/3d/Makefile \
|
||||
samples/3d/font/Makefile \
|
||||
samples/3d/cluster_viewer/Makefile \
|
||||
samples/3d/cluster_viewer/shapes/Makefile \
|
||||
samples/3d/cluster_viewer/groups/Makefile \
|
||||
samples/3d/cluster_viewer/fonts/Makefile \
|
||||
samples/3d/cegui/Makefile \
|
||||
samples/misc/Makefile \
|
||||
samples/misc/command/Makefile \
|
||||
samples/misc/configfile/Makefile \
|
||||
samples/misc/debug/Makefile \
|
||||
samples/misc/i18n/Makefile \
|
||||
samples/misc/log/Makefile \
|
||||
samples/misc/strings/Makefile \
|
||||
samples/misc/types_check/Makefile \
|
||||
samples/net/Makefile \
|
||||
samples/net/chat/Makefile \
|
||||
samples/net/udp/Makefile \
|
||||
samples/net/login_system/Makefile \
|
||||
nel-config
|
||||
|
||||
])
|
||||
AC_OUTPUT
|
||||
|
||||
# samples/net/class_transport/Makefile \
|
||||
# tools/nel_unit_test/Makefile \
|
||||
# tools/nel_unit_test/misc_ut/Makefile \
|
||||
# tools/nel_unit_test/ligo_ut/Makefile \
|
||||
# tools/nel_unit_test/net_ut/Makefile \
|
||||
# tools/nel_unit_test/net_ut/net_service_lib_test/Makefile \
|
||||
# tools/nel_unit_test/net_ut/net_module_lib_test/Makefile \
|
||||
# End of configure.in
|
283
code/nel/doc/Doxyfile.cmake.in
Normal file
283
code/nel/doc/Doxyfile.cmake.in
Normal file
|
@ -0,0 +1,283 @@
|
|||
# Doxyfile 1.5.1-KDevelop
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Project related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
PROJECT_NAME = NeL
|
||||
PROJECT_NUMBER = @NL_VERSION@
|
||||
OUTPUT_DIRECTORY = doxygen
|
||||
CREATE_SUBDIRS = YES
|
||||
OUTPUT_LANGUAGE = English
|
||||
USE_WINDOWS_ENCODING = NO
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
REPEAT_BRIEF = YES
|
||||
ABBREVIATE_BRIEF = "The $name class" \
|
||||
"The $name widget" \
|
||||
"The $name file" \
|
||||
is \
|
||||
provides \
|
||||
specifies \
|
||||
contains \
|
||||
represents \
|
||||
a \
|
||||
an \
|
||||
the
|
||||
ALWAYS_DETAILED_SEC = NO
|
||||
INLINE_INHERITED_MEMB = NO
|
||||
FULL_PATH_NAMES = YES
|
||||
STRIP_FROM_PATH = @CMAKE_SOURCE_DIR@
|
||||
STRIP_FROM_INC_PATH =
|
||||
SHORT_NAMES = NO
|
||||
JAVADOC_AUTOBRIEF = NO
|
||||
MULTILINE_CPP_IS_BRIEF = NO
|
||||
DETAILS_AT_TOP = NO
|
||||
INHERIT_DOCS = YES
|
||||
SEPARATE_MEMBER_PAGES = NO
|
||||
TAB_SIZE = 8
|
||||
ALIASES =
|
||||
OPTIMIZE_OUTPUT_FOR_C = NO
|
||||
OPTIMIZE_OUTPUT_JAVA = NO
|
||||
BUILTIN_STL_SUPPORT = NO
|
||||
DISTRIBUTE_GROUP_DOC = NO
|
||||
SUBGROUPING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Build related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
EXTRACT_ALL = NO
|
||||
EXTRACT_PRIVATE = NO
|
||||
EXTRACT_STATIC = NO
|
||||
EXTRACT_LOCAL_CLASSES = YES
|
||||
EXTRACT_LOCAL_METHODS = NO
|
||||
HIDE_UNDOC_MEMBERS = NO
|
||||
HIDE_UNDOC_CLASSES = NO
|
||||
HIDE_FRIEND_COMPOUNDS = NO
|
||||
HIDE_IN_BODY_DOCS = NO
|
||||
INTERNAL_DOCS = NO
|
||||
CASE_SENSE_NAMES = YES
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
SHOW_INCLUDE_FILES = YES
|
||||
INLINE_INFO = YES
|
||||
SORT_MEMBER_DOCS = YES
|
||||
SORT_BRIEF_DOCS = NO
|
||||
SORT_BY_SCOPE_NAME = NO
|
||||
GENERATE_TODOLIST = YES
|
||||
GENERATE_TESTLIST = YES
|
||||
GENERATE_BUGLIST = YES
|
||||
GENERATE_DEPRECATEDLIST= YES
|
||||
ENABLED_SECTIONS =
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
SHOW_USED_FILES = YES
|
||||
SHOW_DIRECTORIES = NO
|
||||
FILE_VERSION_FILTER =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
QUIET = YES
|
||||
WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_NO_PARAMDOC = NO
|
||||
WARN_FORMAT = "$file:$line: $text"
|
||||
WARN_LOGFILE = doxywarn.log
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT = @CMAKE_SOURCE_DIR@
|
||||
FILE_PATTERNS = *.c \
|
||||
*.cc \
|
||||
*.cxx \
|
||||
*.cpp \
|
||||
*.c++ \
|
||||
*.d \
|
||||
*.java \
|
||||
*.ii \
|
||||
*.ixx \
|
||||
*.ipp \
|
||||
*.i++ \
|
||||
*.inl \
|
||||
*.h \
|
||||
*.hh \
|
||||
*.hxx \
|
||||
*.hpp \
|
||||
*.h++ \
|
||||
*.idl \
|
||||
*.odl \
|
||||
*.cs \
|
||||
*.php \
|
||||
*.php3 \
|
||||
*.inc \
|
||||
*.m \
|
||||
*.mm \
|
||||
*.dox \
|
||||
*.py \
|
||||
*.C \
|
||||
*.CC \
|
||||
*.C++ \
|
||||
*.II \
|
||||
*.I++ \
|
||||
*.H \
|
||||
*.HH \
|
||||
*.H++ \
|
||||
*.CS \
|
||||
*.PHP \
|
||||
*.PHP3 \
|
||||
*.M \
|
||||
*.MM \
|
||||
*.PY \
|
||||
*.C \
|
||||
*.H \
|
||||
*.tlh \
|
||||
*.diff \
|
||||
*.patch \
|
||||
*.moc \
|
||||
*.xpm \
|
||||
*.dox
|
||||
RECURSIVE = yes
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS =
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS = *
|
||||
EXAMPLE_RECURSIVE = NO
|
||||
IMAGE_PATH =
|
||||
INPUT_FILTER =
|
||||
FILTER_PATTERNS =
|
||||
FILTER_SOURCE_FILES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to source browsing
|
||||
#---------------------------------------------------------------------------
|
||||
SOURCE_BROWSER = YES
|
||||
INLINE_SOURCES = YES
|
||||
STRIP_CODE_COMMENTS = NO
|
||||
REFERENCED_BY_RELATION = YES
|
||||
REFERENCES_RELATION = YES
|
||||
REFERENCES_LINK_SOURCE = YES
|
||||
USE_HTAGS = NO
|
||||
VERBATIM_HEADERS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the alphabetical class index
|
||||
#---------------------------------------------------------------------------
|
||||
ALPHABETICAL_INDEX = YES
|
||||
COLS_IN_ALPHA_INDEX = 5
|
||||
IGNORE_PREFIX = C
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the HTML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_HTML = YES
|
||||
HTML_OUTPUT = html
|
||||
HTML_FILE_EXTENSION = .html
|
||||
HTML_HEADER =
|
||||
HTML_FOOTER =
|
||||
HTML_STYLESHEET =
|
||||
HTML_ALIGN_MEMBERS = YES
|
||||
GENERATE_HTMLHELP = NO
|
||||
CHM_FILE =
|
||||
HHC_LOCATION =
|
||||
GENERATE_CHI = NO
|
||||
BINARY_TOC = NO
|
||||
TOC_EXPAND = NO
|
||||
DISABLE_INDEX = NO
|
||||
ENUM_VALUES_PER_LINE = 4
|
||||
GENERATE_TREEVIEW = NO
|
||||
TREEVIEW_WIDTH = 250
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the LaTeX output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_LATEX = YES
|
||||
LATEX_OUTPUT = latex
|
||||
LATEX_CMD_NAME = latex
|
||||
MAKEINDEX_CMD_NAME = makeindex
|
||||
COMPACT_LATEX = NO
|
||||
PAPER_TYPE = a4wide
|
||||
EXTRA_PACKAGES =
|
||||
LATEX_HEADER =
|
||||
PDF_HYPERLINKS = NO
|
||||
USE_PDFLATEX = NO
|
||||
LATEX_BATCHMODE = NO
|
||||
LATEX_HIDE_INDICES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_RTF = NO
|
||||
RTF_OUTPUT = rtf
|
||||
COMPACT_RTF = NO
|
||||
RTF_HYPERLINKS = NO
|
||||
RTF_STYLESHEET_FILE =
|
||||
RTF_EXTENSIONS_FILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the man page output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_MAN = NO
|
||||
MAN_OUTPUT = man
|
||||
MAN_EXTENSION = .3
|
||||
MAN_LINKS = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the XML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_XML = yes
|
||||
XML_OUTPUT = xml
|
||||
XML_SCHEMA =
|
||||
XML_DTD =
|
||||
XML_PROGRAMLISTING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options for the AutoGen Definitions output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_AUTOGEN_DEF = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the Perl module output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_PERLMOD = NO
|
||||
PERLMOD_LATEX = NO
|
||||
PERLMOD_PRETTY = YES
|
||||
PERLMOD_MAKEVAR_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
#---------------------------------------------------------------------------
|
||||
ENABLE_PREPROCESSING = YES
|
||||
MACRO_EXPANSION = NO
|
||||
EXPAND_ONLY_PREDEF = NO
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED =
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
TAGFILES =
|
||||
GENERATE_TAGFILE = nel.tag
|
||||
ALLEXTERNALS = NO
|
||||
EXTERNAL_GROUPS = YES
|
||||
PERL_PATH = /usr/bin/perl
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
CLASS_DIAGRAMS = YES
|
||||
HIDE_UNDOC_RELATIONS = YES
|
||||
HAVE_DOT = @HAVE_DOT@
|
||||
CLASS_GRAPH = YES
|
||||
COLLABORATION_GRAPH = YES
|
||||
GROUP_GRAPHS = YES
|
||||
UML_LOOK = NO
|
||||
TEMPLATE_RELATIONS = NO
|
||||
INCLUDE_GRAPH = YES
|
||||
INCLUDED_BY_GRAPH = YES
|
||||
CALL_GRAPH = NO
|
||||
CALLER_GRAPH = NO
|
||||
GRAPHICAL_HIERARCHY = YES
|
||||
DIRECTORY_GRAPH = YES
|
||||
DOT_IMAGE_FORMAT = png
|
||||
DOT_PATH =
|
||||
DOTFILE_DIRS =
|
||||
MAX_DOT_GRAPH_WIDTH = 1024
|
||||
MAX_DOT_GRAPH_HEIGHT = 1024
|
||||
MAX_DOT_GRAPH_DEPTH = 1000
|
||||
DOT_TRANSPARENT = NO
|
||||
DOT_MULTI_TARGETS = NO
|
||||
GENERATE_LEGEND = YES
|
||||
DOT_CLEANUP = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to the search engine
|
||||
#---------------------------------------------------------------------------
|
||||
SEARCHENGINE = YES
|
39
code/nel/doc/html/index.html
Normal file
39
code/nel/doc/html/index.html
Normal file
|
@ -0,0 +1,39 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1>NeL Doxygen Documentations</h1>
|
||||
|
||||
|
||||
|
||||
<table class="list">
|
||||
<thead><tr>
|
||||
<th>Online Doc</th>
|
||||
<th>Windows Help</th>
|
||||
<th>Zipped HTML</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr class="even">
|
||||
<td><a href="nel/index.html">NeL (online)</a></td>
|
||||
<td><a href="download/nel.chm">NeL (chm)</a></td>
|
||||
<td><a href="download/neldox.zip">NeL + NeLNS + NeLTools (zip)</a></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td><a href="nelns/index.html">NeLNS (online)</a></td>
|
||||
<td><a href="download/nelns.chm">NeLNS (chm)</a></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td><a href="tool/index.html">NeLTools (online)</a></td>
|
||||
<td><a href="download/neltools.chm">NeLTools (chm)</a></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
6
code/nel/doc/make_all_dox.sh
Executable file
6
code/nel/doc/make_all_dox.sh
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
./make_nel_dox.sh
|
||||
./make_nelns_dox.sh
|
||||
./make_neltools_dox.sh
|
||||
./make_packages_doc.sh
|
11
code/nel/doc/make_nel_dox.bat
Normal file
11
code/nel/doc/make_nel_dox.bat
Normal file
|
@ -0,0 +1,11 @@
|
|||
@echo off
|
||||
|
||||
del html\nel\*.* /Q
|
||||
set WORKDIR=%CD%
|
||||
|
||||
cd ..
|
||||
set CURDIR=%CD%
|
||||
cd %WORKDIR%
|
||||
doxygen nel.dox -DCURDIR
|
||||
|
||||
pause
|
9
code/nel/doc/make_nel_dox.sh
Executable file
9
code/nel/doc/make_nel_dox.sh
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
rm -rf html/nel
|
||||
WORKDIR=$(pwd)
|
||||
|
||||
cd ..
|
||||
export CURDIR=$(pwd)
|
||||
cd $WORKDIR
|
||||
doxygen nel.dox -DCURDIR
|
11
code/nel/doc/make_nelns_dox.bat
Normal file
11
code/nel/doc/make_nelns_dox.bat
Normal file
|
@ -0,0 +1,11 @@
|
|||
@echo off
|
||||
|
||||
del html\nelns\*.* /Q
|
||||
set WORKDIR=%CD%
|
||||
|
||||
cd ..\..\nelns
|
||||
set CURDIR=%CD%
|
||||
cd %WORKDIR%
|
||||
doxygen nelns.dox -DCURDIR
|
||||
|
||||
pause
|
9
code/nel/doc/make_nelns_dox.sh
Executable file
9
code/nel/doc/make_nelns_dox.sh
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
rm -rf html/nelns
|
||||
WORKDIR=$(pwd)
|
||||
|
||||
cd ../../nelns
|
||||
export CURDIR=$(pwd)
|
||||
cd $WORKDIR
|
||||
doxygen nelns.dox -DCURDIR
|
11
code/nel/doc/make_neltools_dox.bat
Normal file
11
code/nel/doc/make_neltools_dox.bat
Normal file
|
@ -0,0 +1,11 @@
|
|||
@echo off
|
||||
|
||||
del html\tool\*.* /Q
|
||||
set WORKDIR=%CD%
|
||||
|
||||
cd ..\..\tool
|
||||
set CURDIR=%CD%
|
||||
cd %WORKDIR%
|
||||
doxygen neltools.dox -DCURDIR
|
||||
|
||||
pause
|
9
code/nel/doc/make_neltools_dox.sh
Executable file
9
code/nel/doc/make_neltools_dox.sh
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
rm -rf html/tool
|
||||
WORKDIR=$(pwd)
|
||||
|
||||
cd ../../tool
|
||||
export CURDIR=$(pwd)
|
||||
cd $WORKDIR
|
||||
doxygen neltools.dox -DCURDIR
|
12
code/nel/doc/make_packages_doc.bat
Normal file
12
code/nel/doc/make_packages_doc.bat
Normal file
|
@ -0,0 +1,12 @@
|
|||
hhc nel.hhp
|
||||
hhc nelns.hhp
|
||||
hhc neltools.hhp
|
||||
|
||||
del html\download\*.chm
|
||||
move *.chm html\download\
|
||||
|
||||
del html\download\neldox.zip
|
||||
zip -9 -r neldox.zip html\nel html\nelns html\tool html\index.html
|
||||
move neldox.zip html\download\
|
||||
|
||||
pause
|
5
code/nel/doc/make_packages_doc.sh
Executable file
5
code/nel/doc/make_packages_doc.sh
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
rm -f html/download/neldox.zip
|
||||
zip -9 -q -r neldox.zip html/nel html/nelns html/tool html/index.html
|
||||
mv neldox.zip html/download/
|
BIN
code/nel/doc/misc/event_callback.vsd
Normal file
BIN
code/nel/doc/misc/event_callback.vsd
Normal file
Binary file not shown.
BIN
code/nel/doc/misc/event_listener.vsd
Normal file
BIN
code/nel/doc/misc/event_listener.vsd
Normal file
Binary file not shown.
BIN
code/nel/doc/misc/event_pump.vsd
Normal file
BIN
code/nel/doc/misc/event_pump.vsd
Normal file
Binary file not shown.
249
code/nel/doc/nel.dox
Normal file
249
code/nel/doc/nel.dox
Normal file
|
@ -0,0 +1,249 @@
|
|||
# Doxyfile 1.5.6
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Project related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
DOXYFILE_ENCODING = UTF-8
|
||||
PROJECT_NAME = NeL
|
||||
PROJECT_NUMBER =
|
||||
OUTPUT_DIRECTORY =
|
||||
CREATE_SUBDIRS = YES
|
||||
OUTPUT_LANGUAGE = English
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
REPEAT_BRIEF = YES
|
||||
ABBREVIATE_BRIEF = "The $name class" \
|
||||
"The $name widget" \
|
||||
"The $name file" \
|
||||
is \
|
||||
provides \
|
||||
specifies \
|
||||
contains \
|
||||
represents \
|
||||
a \
|
||||
an \
|
||||
the
|
||||
ALWAYS_DETAILED_SEC = NO
|
||||
INLINE_INHERITED_MEMB = NO
|
||||
FULL_PATH_NAMES = YES
|
||||
STRIP_FROM_PATH = $(CURDIR)
|
||||
STRIP_FROM_INC_PATH =
|
||||
SHORT_NAMES = NO
|
||||
JAVADOC_AUTOBRIEF = YES
|
||||
MULTILINE_CPP_IS_BRIEF = NO
|
||||
DETAILS_AT_TOP = NO
|
||||
INHERIT_DOCS = YES
|
||||
SEPARATE_MEMBER_PAGES = NO
|
||||
TAB_SIZE = 4
|
||||
ALIASES =
|
||||
OPTIMIZE_OUTPUT_FOR_C = NO
|
||||
OPTIMIZE_OUTPUT_JAVA = NO
|
||||
BUILTIN_STL_SUPPORT = YES
|
||||
CPP_CLI_SUPPORT = NO
|
||||
DISTRIBUTE_GROUP_DOC = NO
|
||||
SUBGROUPING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Build related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
EXTRACT_ALL = YES
|
||||
EXTRACT_PRIVATE = YES
|
||||
EXTRACT_STATIC = YES
|
||||
EXTRACT_LOCAL_CLASSES = YES
|
||||
EXTRACT_LOCAL_METHODS = NO
|
||||
HIDE_UNDOC_MEMBERS = NO
|
||||
HIDE_UNDOC_CLASSES = NO
|
||||
HIDE_FRIEND_COMPOUNDS = NO
|
||||
HIDE_IN_BODY_DOCS = NO
|
||||
INTERNAL_DOCS = NO
|
||||
CASE_SENSE_NAMES = YES
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
SHOW_INCLUDE_FILES = YES
|
||||
INLINE_INFO = YES
|
||||
SORT_MEMBER_DOCS = YES
|
||||
SORT_BRIEF_DOCS = NO
|
||||
SORT_BY_SCOPE_NAME = NO
|
||||
GENERATE_TODOLIST = YES
|
||||
GENERATE_TESTLIST = YES
|
||||
GENERATE_BUGLIST = YES
|
||||
GENERATE_DEPRECATEDLIST= YES
|
||||
ENABLED_SECTIONS =
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
SHOW_USED_FILES = YES
|
||||
SHOW_DIRECTORIES = YES
|
||||
FILE_VERSION_FILTER =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
QUIET = YES
|
||||
WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = NO
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_NO_PARAMDOC = NO
|
||||
WARN_FORMAT = "$file:$line: $text"
|
||||
WARN_LOGFILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT = ../include/nel \
|
||||
../src
|
||||
|
||||
INPUT_ENCODING = UTF-8
|
||||
FILE_PATTERNS = *.h \
|
||||
*.cpp \
|
||||
*.dxt
|
||||
RECURSIVE = YES
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS = *.lex.* \
|
||||
*.yacc.*
|
||||
EXCLUDE_SYMBOLS =
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS =
|
||||
EXAMPLE_RECURSIVE = NO
|
||||
IMAGE_PATH =
|
||||
INPUT_FILTER =
|
||||
FILTER_PATTERNS =
|
||||
FILTER_SOURCE_FILES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to source browsing
|
||||
#---------------------------------------------------------------------------
|
||||
SOURCE_BROWSER = YES
|
||||
INLINE_SOURCES = NO
|
||||
STRIP_CODE_COMMENTS = YES
|
||||
REFERENCED_BY_RELATION = YES
|
||||
REFERENCES_RELATION = YES
|
||||
REFERENCES_LINK_SOURCE = YES
|
||||
USE_HTAGS = NO
|
||||
VERBATIM_HEADERS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the alphabetical class index
|
||||
#---------------------------------------------------------------------------
|
||||
ALPHABETICAL_INDEX = YES
|
||||
COLS_IN_ALPHA_INDEX = 5
|
||||
IGNORE_PREFIX = C \
|
||||
I \
|
||||
P
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the HTML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_HTML = YES
|
||||
HTML_OUTPUT = html/nel
|
||||
HTML_FILE_EXTENSION = .html
|
||||
HTML_HEADER =
|
||||
HTML_FOOTER =
|
||||
HTML_STYLESHEET =
|
||||
HTML_ALIGN_MEMBERS = YES
|
||||
GENERATE_HTMLHELP = NO
|
||||
CHM_FILE =
|
||||
HHC_LOCATION =
|
||||
GENERATE_CHI = NO
|
||||
BINARY_TOC = NO
|
||||
TOC_EXPAND = NO
|
||||
DISABLE_INDEX = NO
|
||||
ENUM_VALUES_PER_LINE = 4
|
||||
GENERATE_TREEVIEW = YES
|
||||
TREEVIEW_WIDTH = 200
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the LaTeX output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_LATEX = NO
|
||||
LATEX_OUTPUT = latex
|
||||
LATEX_CMD_NAME = latex
|
||||
MAKEINDEX_CMD_NAME = makeindex
|
||||
COMPACT_LATEX = NO
|
||||
PAPER_TYPE = a4wide
|
||||
EXTRA_PACKAGES =
|
||||
LATEX_HEADER =
|
||||
PDF_HYPERLINKS = NO
|
||||
USE_PDFLATEX = NO
|
||||
LATEX_BATCHMODE = NO
|
||||
LATEX_HIDE_INDICES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_RTF = NO
|
||||
RTF_OUTPUT = rtf
|
||||
COMPACT_RTF = NO
|
||||
RTF_HYPERLINKS = NO
|
||||
RTF_STYLESHEET_FILE =
|
||||
RTF_EXTENSIONS_FILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the man page output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_MAN = NO
|
||||
MAN_OUTPUT = man
|
||||
MAN_EXTENSION = .3
|
||||
MAN_LINKS = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the XML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_XML = NO
|
||||
XML_OUTPUT = xml
|
||||
XML_SCHEMA =
|
||||
XML_DTD =
|
||||
XML_PROGRAMLISTING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options for the AutoGen Definitions output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_AUTOGEN_DEF = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the Perl module output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_PERLMOD = NO
|
||||
PERLMOD_LATEX = NO
|
||||
PERLMOD_PRETTY = YES
|
||||
PERLMOD_MAKEVAR_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
#---------------------------------------------------------------------------
|
||||
ENABLE_PREPROCESSING = YES
|
||||
MACRO_EXPANSION = NO
|
||||
EXPAND_ONLY_PREDEF = NO
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED =
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
TAGFILES =
|
||||
GENERATE_TAGFILE = nel.tag
|
||||
ALLEXTERNALS = NO
|
||||
EXTERNAL_GROUPS = NO
|
||||
PERL_PATH = /usr/bin/perl
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
CLASS_DIAGRAMS = NO
|
||||
MSCGEN_PATH =
|
||||
HIDE_UNDOC_RELATIONS = NO
|
||||
HAVE_DOT = YES
|
||||
CLASS_GRAPH = YES
|
||||
COLLABORATION_GRAPH = NO
|
||||
GROUP_GRAPHS = NO
|
||||
UML_LOOK = NO
|
||||
TEMPLATE_RELATIONS = YES
|
||||
|
||||
INCLUDE_GRAPH = YES
|
||||
INCLUDED_BY_GRAPH = YES
|
||||
|
||||
CALL_GRAPH = NO
|
||||
CALLER_GRAPH = NO
|
||||
|
||||
GRAPHICAL_HIERARCHY = NO
|
||||
DIRECTORY_GRAPH = YES
|
||||
|
||||
DOT_IMAGE_FORMAT = png
|
||||
DOT_PATH =
|
||||
DOTFILE_DIRS =
|
||||
DOT_GRAPH_MAX_NODES = 10
|
||||
DOT_TRANSPARENT = NO
|
||||
DOT_MULTI_TARGETS = NO
|
||||
|
||||
GENERATE_LEGEND = YES
|
||||
DOT_CLEANUP = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to the search engine
|
||||
#---------------------------------------------------------------------------
|
||||
SEARCHENGINE = YES
|
14
code/nel/doc/nel.hhp
Normal file
14
code/nel/doc/nel.hhp
Normal file
|
@ -0,0 +1,14 @@
|
|||
[OPTIONS]
|
||||
Auto Index=Yes
|
||||
Compatibility=1.1 or later
|
||||
Compiled file=nel.chm
|
||||
Default topic=html\nel\index.html
|
||||
Display compile progress=Yes
|
||||
Language=0x809 Anglais (Royaume-Uni)
|
||||
|
||||
|
||||
[FILES]
|
||||
html\nel\index.html
|
||||
|
||||
[INFOTYPES]
|
||||
|
248
code/nel/doc/nelns.dox
Normal file
248
code/nel/doc/nelns.dox
Normal file
|
@ -0,0 +1,248 @@
|
|||
# Doxyfile 1.5.6
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Project related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
DOXYFILE_ENCODING = UTF-8
|
||||
PROJECT_NAME = NeLNS
|
||||
PROJECT_NUMBER =
|
||||
OUTPUT_DIRECTORY =
|
||||
CREATE_SUBDIRS = YES
|
||||
OUTPUT_LANGUAGE = English
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
REPEAT_BRIEF = YES
|
||||
ABBREVIATE_BRIEF = "The $name class" \
|
||||
"The $name widget" \
|
||||
"The $name file" \
|
||||
is \
|
||||
provides \
|
||||
specifies \
|
||||
contains \
|
||||
represents \
|
||||
a \
|
||||
an \
|
||||
the
|
||||
ALWAYS_DETAILED_SEC = NO
|
||||
INLINE_INHERITED_MEMB = NO
|
||||
FULL_PATH_NAMES = YES
|
||||
STRIP_FROM_PATH = $(CURDIR)
|
||||
STRIP_FROM_INC_PATH =
|
||||
SHORT_NAMES = NO
|
||||
JAVADOC_AUTOBRIEF = YES
|
||||
MULTILINE_CPP_IS_BRIEF = NO
|
||||
DETAILS_AT_TOP = NO
|
||||
INHERIT_DOCS = YES
|
||||
SEPARATE_MEMBER_PAGES = NO
|
||||
TAB_SIZE = 4
|
||||
ALIASES =
|
||||
OPTIMIZE_OUTPUT_FOR_C = NO
|
||||
OPTIMIZE_OUTPUT_JAVA = NO
|
||||
BUILTIN_STL_SUPPORT = YES
|
||||
CPP_CLI_SUPPORT = NO
|
||||
DISTRIBUTE_GROUP_DOC = NO
|
||||
SUBGROUPING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Build related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
EXTRACT_ALL = YES
|
||||
EXTRACT_PRIVATE = YES
|
||||
EXTRACT_STATIC = YES
|
||||
EXTRACT_LOCAL_CLASSES = YES
|
||||
EXTRACT_LOCAL_METHODS = NO
|
||||
HIDE_UNDOC_MEMBERS = NO
|
||||
HIDE_UNDOC_CLASSES = NO
|
||||
HIDE_FRIEND_COMPOUNDS = NO
|
||||
HIDE_IN_BODY_DOCS = NO
|
||||
INTERNAL_DOCS = NO
|
||||
CASE_SENSE_NAMES = YES
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
SHOW_INCLUDE_FILES = YES
|
||||
INLINE_INFO = YES
|
||||
SORT_MEMBER_DOCS = YES
|
||||
SORT_BRIEF_DOCS = NO
|
||||
SORT_BY_SCOPE_NAME = NO
|
||||
GENERATE_TODOLIST = YES
|
||||
GENERATE_TESTLIST = YES
|
||||
GENERATE_BUGLIST = YES
|
||||
GENERATE_DEPRECATEDLIST= YES
|
||||
ENABLED_SECTIONS =
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
SHOW_USED_FILES = YES
|
||||
SHOW_DIRECTORIES = YES
|
||||
FILE_VERSION_FILTER =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
QUIET = YES
|
||||
WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = NO
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_NO_PARAMDOC = NO
|
||||
WARN_FORMAT = "$file:$line: $text"
|
||||
WARN_LOGFILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT = ../../nelns
|
||||
|
||||
INPUT_ENCODING = UTF-8
|
||||
FILE_PATTERNS = *.h \
|
||||
*.cpp \
|
||||
*.dxt
|
||||
RECURSIVE = YES
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS = *.lex.* \
|
||||
*.yacc.*
|
||||
EXCLUDE_SYMBOLS =
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS =
|
||||
EXAMPLE_RECURSIVE = NO
|
||||
IMAGE_PATH =
|
||||
INPUT_FILTER =
|
||||
FILTER_PATTERNS =
|
||||
FILTER_SOURCE_FILES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to source browsing
|
||||
#---------------------------------------------------------------------------
|
||||
SOURCE_BROWSER = YES
|
||||
INLINE_SOURCES = NO
|
||||
STRIP_CODE_COMMENTS = YES
|
||||
REFERENCED_BY_RELATION = YES
|
||||
REFERENCES_RELATION = YES
|
||||
REFERENCES_LINK_SOURCE = YES
|
||||
USE_HTAGS = NO
|
||||
VERBATIM_HEADERS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the alphabetical class index
|
||||
#---------------------------------------------------------------------------
|
||||
ALPHABETICAL_INDEX = YES
|
||||
COLS_IN_ALPHA_INDEX = 5
|
||||
IGNORE_PREFIX = C \
|
||||
I \
|
||||
P
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the HTML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_HTML = YES
|
||||
HTML_OUTPUT = html/nelns
|
||||
HTML_FILE_EXTENSION = .html
|
||||
HTML_HEADER =
|
||||
HTML_FOOTER =
|
||||
HTML_STYLESHEET =
|
||||
HTML_ALIGN_MEMBERS = YES
|
||||
GENERATE_HTMLHELP = NO
|
||||
CHM_FILE =
|
||||
HHC_LOCATION =
|
||||
GENERATE_CHI = NO
|
||||
BINARY_TOC = NO
|
||||
TOC_EXPAND = NO
|
||||
DISABLE_INDEX = NO
|
||||
ENUM_VALUES_PER_LINE = 4
|
||||
GENERATE_TREEVIEW = YES
|
||||
TREEVIEW_WIDTH = 200
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the LaTeX output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_LATEX = NO
|
||||
LATEX_OUTPUT = latex
|
||||
LATEX_CMD_NAME = latex
|
||||
MAKEINDEX_CMD_NAME = makeindex
|
||||
COMPACT_LATEX = NO
|
||||
PAPER_TYPE = a4wide
|
||||
EXTRA_PACKAGES =
|
||||
LATEX_HEADER =
|
||||
PDF_HYPERLINKS = NO
|
||||
USE_PDFLATEX = NO
|
||||
LATEX_BATCHMODE = NO
|
||||
LATEX_HIDE_INDICES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_RTF = NO
|
||||
RTF_OUTPUT = rtf
|
||||
COMPACT_RTF = NO
|
||||
RTF_HYPERLINKS = NO
|
||||
RTF_STYLESHEET_FILE =
|
||||
RTF_EXTENSIONS_FILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the man page output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_MAN = NO
|
||||
MAN_OUTPUT = man
|
||||
MAN_EXTENSION = .3
|
||||
MAN_LINKS = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the XML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_XML = NO
|
||||
XML_OUTPUT = xml
|
||||
XML_SCHEMA =
|
||||
XML_DTD =
|
||||
XML_PROGRAMLISTING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options for the AutoGen Definitions output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_AUTOGEN_DEF = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the Perl module output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_PERLMOD = NO
|
||||
PERLMOD_LATEX = NO
|
||||
PERLMOD_PRETTY = YES
|
||||
PERLMOD_MAKEVAR_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
#---------------------------------------------------------------------------
|
||||
ENABLE_PREPROCESSING = YES
|
||||
MACRO_EXPANSION = NO
|
||||
EXPAND_ONLY_PREDEF = NO
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED =
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
TAGFILES = nel.tag=../nel
|
||||
GENERATE_TAGFILE = nelns.tag
|
||||
ALLEXTERNALS = NO
|
||||
EXTERNAL_GROUPS = NO
|
||||
PERL_PATH = /usr/bin/perl
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
CLASS_DIAGRAMS = NO
|
||||
MSCGEN_PATH =
|
||||
HIDE_UNDOC_RELATIONS = NO
|
||||
HAVE_DOT = YES
|
||||
CLASS_GRAPH = YES
|
||||
COLLABORATION_GRAPH = NO
|
||||
GROUP_GRAPHS = NO
|
||||
UML_LOOK = NO
|
||||
TEMPLATE_RELATIONS = YES
|
||||
|
||||
INCLUDE_GRAPH = YES
|
||||
INCLUDED_BY_GRAPH = YES
|
||||
|
||||
CALL_GRAPH = NO
|
||||
CALLER_GRAPH = NO
|
||||
|
||||
GRAPHICAL_HIERARCHY = NO
|
||||
DIRECTORY_GRAPH = YES
|
||||
|
||||
DOT_IMAGE_FORMAT = png
|
||||
DOT_PATH =
|
||||
DOTFILE_DIRS =
|
||||
DOT_GRAPH_MAX_NODES = 10
|
||||
DOT_TRANSPARENT = NO
|
||||
DOT_MULTI_TARGETS = NO
|
||||
|
||||
GENERATE_LEGEND = YES
|
||||
DOT_CLEANUP = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to the search engine
|
||||
#---------------------------------------------------------------------------
|
||||
SEARCHENGINE = YES
|
14
code/nel/doc/nelns.hhp
Normal file
14
code/nel/doc/nelns.hhp
Normal file
|
@ -0,0 +1,14 @@
|
|||
[OPTIONS]
|
||||
Auto Index=Yes
|
||||
Compatibility=1.1 or later
|
||||
Compiled file=nelns.chm
|
||||
Default topic=html\nelns\index.html
|
||||
Display compile progress=Yes
|
||||
Language=0x809 Anglais (Royaume-Uni)
|
||||
|
||||
|
||||
[FILES]
|
||||
html\nelns\index.html
|
||||
|
||||
[INFOTYPES]
|
||||
|
248
code/nel/doc/neltools.dox
Normal file
248
code/nel/doc/neltools.dox
Normal file
|
@ -0,0 +1,248 @@
|
|||
# Doxyfile 1.5.6
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Project related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
DOXYFILE_ENCODING = UTF-8
|
||||
PROJECT_NAME = NeLTools
|
||||
PROJECT_NUMBER =
|
||||
OUTPUT_DIRECTORY =
|
||||
CREATE_SUBDIRS = YES
|
||||
OUTPUT_LANGUAGE = English
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
REPEAT_BRIEF = YES
|
||||
ABBREVIATE_BRIEF = "The $name class" \
|
||||
"The $name widget" \
|
||||
"The $name file" \
|
||||
is \
|
||||
provides \
|
||||
specifies \
|
||||
contains \
|
||||
represents \
|
||||
a \
|
||||
an \
|
||||
the
|
||||
ALWAYS_DETAILED_SEC = NO
|
||||
INLINE_INHERITED_MEMB = NO
|
||||
FULL_PATH_NAMES = YES
|
||||
STRIP_FROM_PATH = $(CURDIR)
|
||||
STRIP_FROM_INC_PATH =
|
||||
SHORT_NAMES = NO
|
||||
JAVADOC_AUTOBRIEF = YES
|
||||
MULTILINE_CPP_IS_BRIEF = NO
|
||||
DETAILS_AT_TOP = NO
|
||||
INHERIT_DOCS = YES
|
||||
SEPARATE_MEMBER_PAGES = NO
|
||||
TAB_SIZE = 4
|
||||
ALIASES =
|
||||
OPTIMIZE_OUTPUT_FOR_C = NO
|
||||
OPTIMIZE_OUTPUT_JAVA = NO
|
||||
BUILTIN_STL_SUPPORT = YES
|
||||
CPP_CLI_SUPPORT = NO
|
||||
DISTRIBUTE_GROUP_DOC = NO
|
||||
SUBGROUPING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Build related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
EXTRACT_ALL = YES
|
||||
EXTRACT_PRIVATE = YES
|
||||
EXTRACT_STATIC = YES
|
||||
EXTRACT_LOCAL_CLASSES = YES
|
||||
EXTRACT_LOCAL_METHODS = NO
|
||||
HIDE_UNDOC_MEMBERS = NO
|
||||
HIDE_UNDOC_CLASSES = NO
|
||||
HIDE_FRIEND_COMPOUNDS = NO
|
||||
HIDE_IN_BODY_DOCS = NO
|
||||
INTERNAL_DOCS = NO
|
||||
CASE_SENSE_NAMES = YES
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
SHOW_INCLUDE_FILES = YES
|
||||
INLINE_INFO = YES
|
||||
SORT_MEMBER_DOCS = YES
|
||||
SORT_BRIEF_DOCS = NO
|
||||
SORT_BY_SCOPE_NAME = NO
|
||||
GENERATE_TODOLIST = YES
|
||||
GENERATE_TESTLIST = YES
|
||||
GENERATE_BUGLIST = YES
|
||||
GENERATE_DEPRECATEDLIST= YES
|
||||
ENABLED_SECTIONS =
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
SHOW_USED_FILES = YES
|
||||
SHOW_DIRECTORIES = YES
|
||||
FILE_VERSION_FILTER =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
QUIET = YES
|
||||
WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = NO
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_NO_PARAMDOC = NO
|
||||
WARN_FORMAT = "$file:$line: $text"
|
||||
WARN_LOGFILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT = ../../tool
|
||||
|
||||
INPUT_ENCODING = UTF-8
|
||||
FILE_PATTERNS = *.h \
|
||||
*.cpp \
|
||||
*.dxt
|
||||
RECURSIVE = YES
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS = *.lex.* \
|
||||
*.yacc.*
|
||||
EXCLUDE_SYMBOLS =
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS =
|
||||
EXAMPLE_RECURSIVE = NO
|
||||
IMAGE_PATH =
|
||||
INPUT_FILTER =
|
||||
FILTER_PATTERNS =
|
||||
FILTER_SOURCE_FILES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to source browsing
|
||||
#---------------------------------------------------------------------------
|
||||
SOURCE_BROWSER = YES
|
||||
INLINE_SOURCES = NO
|
||||
STRIP_CODE_COMMENTS = YES
|
||||
REFERENCED_BY_RELATION = YES
|
||||
REFERENCES_RELATION = YES
|
||||
REFERENCES_LINK_SOURCE = YES
|
||||
USE_HTAGS = NO
|
||||
VERBATIM_HEADERS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the alphabetical class index
|
||||
#---------------------------------------------------------------------------
|
||||
ALPHABETICAL_INDEX = YES
|
||||
COLS_IN_ALPHA_INDEX = 5
|
||||
IGNORE_PREFIX = C \
|
||||
I \
|
||||
P
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the HTML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_HTML = YES
|
||||
HTML_OUTPUT = html/tool
|
||||
HTML_FILE_EXTENSION = .html
|
||||
HTML_HEADER =
|
||||
HTML_FOOTER =
|
||||
HTML_STYLESHEET =
|
||||
HTML_ALIGN_MEMBERS = YES
|
||||
GENERATE_HTMLHELP = NO
|
||||
CHM_FILE =
|
||||
HHC_LOCATION =
|
||||
GENERATE_CHI = NO
|
||||
BINARY_TOC = NO
|
||||
TOC_EXPAND = NO
|
||||
DISABLE_INDEX = NO
|
||||
ENUM_VALUES_PER_LINE = 4
|
||||
GENERATE_TREEVIEW = YES
|
||||
TREEVIEW_WIDTH = 200
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the LaTeX output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_LATEX = NO
|
||||
LATEX_OUTPUT = latex
|
||||
LATEX_CMD_NAME = latex
|
||||
MAKEINDEX_CMD_NAME = makeindex
|
||||
COMPACT_LATEX = NO
|
||||
PAPER_TYPE = a4wide
|
||||
EXTRA_PACKAGES =
|
||||
LATEX_HEADER =
|
||||
PDF_HYPERLINKS = NO
|
||||
USE_PDFLATEX = NO
|
||||
LATEX_BATCHMODE = NO
|
||||
LATEX_HIDE_INDICES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_RTF = NO
|
||||
RTF_OUTPUT = rtf
|
||||
COMPACT_RTF = NO
|
||||
RTF_HYPERLINKS = NO
|
||||
RTF_STYLESHEET_FILE =
|
||||
RTF_EXTENSIONS_FILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the man page output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_MAN = NO
|
||||
MAN_OUTPUT = man
|
||||
MAN_EXTENSION = .3
|
||||
MAN_LINKS = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the XML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_XML = NO
|
||||
XML_OUTPUT = xml
|
||||
XML_SCHEMA =
|
||||
XML_DTD =
|
||||
XML_PROGRAMLISTING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options for the AutoGen Definitions output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_AUTOGEN_DEF = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the Perl module output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_PERLMOD = NO
|
||||
PERLMOD_LATEX = NO
|
||||
PERLMOD_PRETTY = YES
|
||||
PERLMOD_MAKEVAR_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
#---------------------------------------------------------------------------
|
||||
ENABLE_PREPROCESSING = YES
|
||||
MACRO_EXPANSION = NO
|
||||
EXPAND_ONLY_PREDEF = NO
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED =
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
TAGFILES = nel.tag=../nel
|
||||
GENERATE_TAGFILE = tool.tag
|
||||
ALLEXTERNALS = NO
|
||||
EXTERNAL_GROUPS = NO
|
||||
PERL_PATH = /usr/bin/perl
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
CLASS_DIAGRAMS = NO
|
||||
MSCGEN_PATH =
|
||||
HIDE_UNDOC_RELATIONS = NO
|
||||
HAVE_DOT = YES
|
||||
CLASS_GRAPH = YES
|
||||
COLLABORATION_GRAPH = NO
|
||||
GROUP_GRAPHS = NO
|
||||
UML_LOOK = NO
|
||||
TEMPLATE_RELATIONS = YES
|
||||
|
||||
INCLUDE_GRAPH = YES
|
||||
INCLUDED_BY_GRAPH = YES
|
||||
|
||||
CALL_GRAPH = NO
|
||||
CALLER_GRAPH = NO
|
||||
|
||||
GRAPHICAL_HIERARCHY = NO
|
||||
DIRECTORY_GRAPH = YES
|
||||
|
||||
DOT_IMAGE_FORMAT = png
|
||||
DOT_PATH =
|
||||
DOTFILE_DIRS =
|
||||
DOT_GRAPH_MAX_NODES = 10
|
||||
DOT_TRANSPARENT = NO
|
||||
DOT_MULTI_TARGETS = NO
|
||||
|
||||
GENERATE_LEGEND = YES
|
||||
DOT_CLEANUP = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to the search engine
|
||||
#---------------------------------------------------------------------------
|
||||
SEARCHENGINE = YES
|
14
code/nel/doc/neltools.hhp
Normal file
14
code/nel/doc/neltools.hhp
Normal file
|
@ -0,0 +1,14 @@
|
|||
[OPTIONS]
|
||||
Auto Index=Yes
|
||||
Compatibility=1.1 or later
|
||||
Compiled file=neltools.chm
|
||||
Default topic=html\tool\index.html
|
||||
Display compile progress=Yes
|
||||
Language=0x809 Anglais (Royaume-Uni)
|
||||
|
||||
|
||||
[FILES]
|
||||
html\tool\index.html
|
||||
|
||||
[INFOTYPES]
|
||||
|
BIN
code/nel/doc/net/login_system.vsd
Normal file
BIN
code/nel/doc/net/login_system.vsd
Normal file
Binary file not shown.
BIN
code/nel/doc/net/nelnet-layer1-server-obj.png
Normal file
BIN
code/nel/doc/net/nelnet-layer1-server-obj.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
222
code/nel/doc/net/net.dxt
Normal file
222
code/nel/doc/net/net.dxt
Normal file
|
@ -0,0 +1,222 @@
|
|||
/**
|
||||
\page network Network engine (until May 1, 2001)
|
||||
|
||||
\author Olivier Cado
|
||||
|
||||
Warning: this document describes the network engine as it was available in the NeL CVS tree until May 1, 2001. The updated documentation is available at http://www.nevrax.org/docs/nelnet.php3
|
||||
|
||||
\section networkintro Introduction
|
||||
|
||||
Conceptually, the network subsystem is divided into layers :
|
||||
-# Layer 1 is the socket layer : it allows to send/receive any data synchronously using a network, either reliably or not.
|
||||
-# Layer 2 is the message transfer layer : it allows to send/receive messages synchronously.
|
||||
-# Layer 3 is the message handling layer : it allows to listen for messages and to call event-driven callback functions.
|
||||
-# The recipient of a connection need not be an Internet address. It can be pointed to as a specific service using a Naming Service.
|
||||
-# Any object can be serialized to/from a message.
|
||||
-# Server software are called services and have a common interface.
|
||||
|
||||
Here is the implementation point of view :
|
||||
-# Layer 1 is implemented by NLNET::CBaseSocket.
|
||||
-# Layer 2 is implemented by NLNET::CSocket.
|
||||
-# Layer 3 is implemented by NLNET::CMsgSocket.
|
||||
-# The class NLNET::CNamingClient allows using the Naming Service. It is used by NLNET::CMsgSocket for service lookup. The addresses are implemented by NLNET::CInetAddress.
|
||||
-# The class NLNET::CMessage inherits from NLMISC::IStream.
|
||||
-# All services inherit from NLNET::IService. It provides the basic functionnalities such as registration to the Naming Service, server start-up and shutdown (see \ref new_service_howto).
|
||||
|
||||
To use the layer 3, you need to #include "nel/net/msg_socket.h".
|
||||
|
||||
\section networkusing Using the network engine
|
||||
|
||||
Example : I want to ask the "family service" (let's call it "FMLS") the age of Toto. Let's say the family service
|
||||
understands a message of type "AGEREQ" and answers back a message of type "AGE" :
|
||||
|
||||
- How to send a synchronous request to a host, using CSocket (layer 2) ?
|
||||
|
||||
\code
|
||||
#include "nel/net/socket.h"
|
||||
#include "nel/net/naming_client.h"
|
||||
(...)
|
||||
|
||||
uint16 validitytime;
|
||||
CSocket client;
|
||||
// Connect to the family service
|
||||
if ( CNamingClient::lookupAndConnect( "FMLS", client, validitytime ) )
|
||||
{
|
||||
// Send request
|
||||
CMessage msgout( "AGEREQ" );
|
||||
msgout.serial( Toto.name() );
|
||||
client.send( msgout );
|
||||
|
||||
// Receive answer
|
||||
uint16 age;
|
||||
CMessage msgin( "", true );
|
||||
client.receive( msgin );
|
||||
msgin.serial( age );
|
||||
Toto.setAge( age );
|
||||
}
|
||||
|
||||
\endcode
|
||||
|
||||
- How to send an asynchronous request to a host, using CMsgSocket, the message handling system (layer 3) ?
|
||||
|
||||
\code
|
||||
#include "nel/net/msg_socket.h"
|
||||
(...)
|
||||
|
||||
// Callback to process the answer
|
||||
void cbProcessAge( CMessage& msgin, TSenderId idfrom )
|
||||
{
|
||||
uint16 age;
|
||||
msgin.serial( age );
|
||||
Toto.setAge( age );
|
||||
}
|
||||
|
||||
// Callback array
|
||||
TCallbackItem ClientCallbacks [] =
|
||||
{
|
||||
{ "AGE", cbProcessAge }
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
// Connect to the family service
|
||||
CMsgSocket client ( ClientCallbacks, sizeof(ClientCallbacks)/sizeof(TCallbackItem), "FMLS" );
|
||||
|
||||
// Send request
|
||||
CMessage msgout ( "AGEREQ" ); // The server should have a callback associated to "AGEREQ"
|
||||
msgout.serial( Toto.name() );
|
||||
client.send( msgout );
|
||||
|
||||
while ( true )
|
||||
{
|
||||
client.update(); // tests if a message has been received, and if the associated callback is called back
|
||||
// Same as CMsgSocket::update()
|
||||
}
|
||||
}
|
||||
\endcode
|
||||
|
||||
- How to send a container or an object ?
|
||||
|
||||
Symply serialize your container or your object in a message.
|
||||
|
||||
Example :
|
||||
\code
|
||||
vector<CMyClass> myvector;
|
||||
CMessage msgout ( false );
|
||||
msgout.serialCont( myvector );
|
||||
client.send( msgout );
|
||||
\endcode
|
||||
This code serializes all objects contained in \e myvector. For this to work, you need to provide a method serial()
|
||||
in your class CMyClass. This is explained in NLMISC::IStream. For a map or a multimap, use serialMap() instead of serialCont().
|
||||
|
||||
\section netenginev1 Features and implementation
|
||||
|
||||
\subsection msgtypebinding Message type binding
|
||||
|
||||
Let's study a communication between two machines, A and B, where A sends several messages, of the same type, to B. In the following, we explain the 4 steps. Steps (1) and (4) correspond to the sending of the messages from A to B.
|
||||
|
||||
- Step 1: The first time a type of message is sent by A, its header contains its "message name" (or message type as string).
|
||||
- Step 2: The remote machine B, when it receives it, sends back a binding message with the index of its associated callback, i.e. the binded "message number" (or message type as number).
|
||||
- Step 3: A processes the binding message by remembering the binding "message name" -> "message number" for this connection.
|
||||
- Step 4: Next time A sents this type of message, the header contains the message number.
|
||||
|
||||
The data structures need to implement this protocol are listed below.
|
||||
|
||||
\subsection netlayers Network layers
|
||||
|
||||
-# Socket Layer:
|
||||
- CBaseSocket
|
||||
- Allows to send/receive any data (uint8*) synchronously over the network, either reliably or not (TCP streams or UDP datagrams)
|
||||
|
||||
-# Message Transfer Layer:
|
||||
- CSocket
|
||||
- Allows to send/receive messages (CMessage objects, in which you can serialize data) synchronously. TCP/UDP (not fully tested with UDP)
|
||||
- Implements the encoding/decoding of message headers
|
||||
- Implementation:
|
||||
- Contains a set (_MsgsToBind : CMsgBindSet) that knows which messages have not been binded on the other side yet (when this set is empty, it means all bind messages have been set to the remote host (see step 2))
|
||||
- Contains a map (_BindMapForSends : CMsgMap) that saves the message type bindings understood by the remote connection (see step 3),
|
||||
|
||||
-# Message Handling Layer:
|
||||
- CMsgSocket
|
||||
- Allows to listen for messages and to call event-driven callback functions.
|
||||
- Initializing:
|
||||
- A CMsgSocket object can be a server object or a client object. There is at most one server object by process, but there can be several client objects.
|
||||
- When creating a server object, a passive listening socket is created, waiting for incoming connection requests.
|
||||
- A client object connects to a server which is specified either by its address or by its service name. In the latter the Naming Service is asked for the service address.
|
||||
- Anyone who creates a CMsgSocket object is required to define some callbacks and a callback array of the following form (its contents is only a sample):
|
||||
\code
|
||||
TCallbackItem MyCallbackArray [] =
|
||||
{
|
||||
{ "CHAT", cbDisplayChatMsg },
|
||||
{ "PING", cbPing },
|
||||
{ "PONG", cbPong },
|
||||
{ "D", cbHandleDisconnection }
|
||||
};
|
||||
\endcode
|
||||
- A method (addCallbackArray()) is provided for appending another callback array to the one specified at the beginning. Consequently you can provide callbacks in different modules of your program.
|
||||
|
||||
- Receiving messages and handling connections:
|
||||
- When a message is received, the callback corresponding to its message name (if any) is called. Sample:
|
||||
\code
|
||||
void cbDisplayChatMsg( CMessage& inputmsg, TSenderId connectionid )
|
||||
{
|
||||
string line;
|
||||
inputmsg.serial( line );
|
||||
ChatOutput.addLine( line );
|
||||
}
|
||||
\endcode
|
||||
- Two special message names are reserved : "C" and "D". C is called when a new connection is accepted by a server CMsgSocket object, and D is called when a connection is closed (either gracefully closed or broken). In both cases, an input message containing the address (CInetAddress) of the concerned remote host is passed to the callback (use serial() to get the address).
|
||||
- The user can deliberately close a connection by calling close().
|
||||
- Each connection is handled by a CSocket object. The list of connections is static, so that only one select() is performed for all connections, in the static method CMsgSocket::update(). This method receives only one message per socket at most.
|
||||
|
||||
- Sending messages:
|
||||
- To send a message to a particular host, call clientsocket->send( outputmsg ) if you are a client of the remote host (i.e. you have created a client object) or call CMsgSocket::send( outputmsg, connectionid ).
|
||||
- To send a message to all connected hosts, call sendToAll( outputmsg ) or sendToAllExceptHost( outputmsg, excludedhostid ) or even sendToAllExceptHosts( outputmsg, excludedhostidset ) if you want to exclude one host or more from the destination list.
|
||||
|
||||
- Controlling access:
|
||||
- The class provides basic features for allowing/disallowing a specified host to access to the callbacks. In the "C" callback (called when a connection is accepted), you can call authorizeOnly( authcallback, hostid ) so that the specified host cannot call any callback but authcallback. If this host tries to call another callback (i.e. it sends a message with a wrong message type), it will be disconnected. In authcallback you can then allow the client to access the other callbacks, calling authorizeAll( hostid ).
|
||||
|
||||
- Gathering statistics:
|
||||
- There are several methods used to gather statistic about the network traffic. The static ones (bytesSent(), bytesReceived(), newBytesSent(), newBytesReceived()) give the total amount of input/output transferred data. The others (the same, with the suffix -FromHost()) are relative to one particular host.
|
||||
|
||||
- Misc:
|
||||
- To know about the other methods, read the Doxygen documentation of CMsgSocket or the header file.
|
||||
|
||||
- Implementation:
|
||||
- Contains a static set (_SearchSet: CSearchSet) and one set (_ClientSearchSet) per client object, allowing a fast search in the callback array. This set is optimized by not storing the message names but the pointers to the items in the callback array, even sorting by comparing the names.
|
||||
|
||||
\subsection theservices Services
|
||||
|
||||
You can use the class CMsgSocket directly, as in the Snowballs client, but a framework is provided for building server applications (see the class IService and the Doxygen related page "How to create a new service").
|
||||
|
||||
\subsection dtcs Distributed Components Toolkit System (DTC System)
|
||||
|
||||
A set of services are available:
|
||||
- The Naming Service (NS) locates a service by name/service identifier. It can also allocate port numbers. In NeL, the class CNamingClient allows the programmer to use the NS without writing network operations.
|
||||
- The Log Service (LOGS) is a centralized logger for all services (client class: CNetDisplayer used by CLog, and CNetLog that logs to the Network Viewer tool)
|
||||
- The Time Service (TS) is a centralized time reference manager (client class: CUniTime).
|
||||
- The Login Service (LS) is a centralized user account manager for all shards. It is the only service that does not connect to the NS because it is not part of a shard.
|
||||
- The Admin Executor Service (AES) collects stats about a physical machine.
|
||||
- The Agent Service (AS) routes messages for inter-agent communication over several machines.
|
||||
|
||||
In CVS:/code/server you will find another service, the Moves Service (DRServer) which is the main server for Snowballs.
|
||||
|
||||
\subsection deadreck Dead Reckoning
|
||||
|
||||
NLNET contains a framework to handle networked virtual environments containing moving entities physically controlled on different computers. In the future, this framework may be removed from NeL and put somewhere else.
|
||||
|
||||
Here are the involved classes:
|
||||
- IMovingEntity:
|
||||
- CLocalEntity: a locally-controlled entity
|
||||
- CReplica: an entity not controlled directly:
|
||||
- CRemoteEntity: an remote-controlled replica, with convergency
|
||||
|
||||
- IEntityInterpolator: base class for convergency:
|
||||
- LinearEntityInterpolator
|
||||
- CubicEntityInterpolator: Bézier interpolation
|
||||
|
||||
- CLocalArea: a local entity and a list of remote entities. Call update() to update the position of the entities using dead reckoning.
|
||||
|
||||
A good example of usage can be found in the Snowballs source code (client.cpp and move_listener.cpp).
|
||||
|
||||
*/
|
2
code/nel/include/CMakeLists.txt
Normal file
2
code/nel/include/CMakeLists.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
SUBDIRS(nel)
|
||||
|
10
code/nel/include/Makefile.am
Normal file
10
code/nel/include/Makefile.am
Normal file
|
@ -0,0 +1,10 @@
|
|||
#
|
||||
#
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
SUBDIRS = nel
|
||||
|
||||
pkginclude_HEADERS = nelconfig.h
|
||||
|
||||
# End of Makefile.am
|
3
code/nel/include/nel/3d/CMakeLists.txt
Normal file
3
code/nel/include/nel/3d/CMakeLists.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
FILE(GLOB HEADERS *.h)
|
||||
|
||||
INSTALL(FILES ${HEADERS} DESTINATION include/nel/3d COMPONENT headers)
|
343
code/nel/include/nel/3d/Makefile.am
Normal file
343
code/nel/include/nel/3d/Makefile.am
Normal file
|
@ -0,0 +1,343 @@
|
|||
#
|
||||
#
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
includedir = ${prefix}/include/nel/3d
|
||||
|
||||
include_HEADERS = \
|
||||
animatable.h \
|
||||
animated_lightmap.h \
|
||||
animated_material.h \
|
||||
animated_morph.h \
|
||||
animated_value.h \
|
||||
animation.h \
|
||||
animation_optimizer.h \
|
||||
animation_playlist.h \
|
||||
animation_set.h \
|
||||
animation_set_user.h \
|
||||
animation_time.h \
|
||||
anim_ctrl.h \
|
||||
anim_detail_trav.h \
|
||||
async_file_manager_3d.h \
|
||||
async_texture_block.h \
|
||||
async_texture_manager.h \
|
||||
bezier_patch.h \
|
||||
bloom_effect.h \
|
||||
bone.h \
|
||||
bsp_tree.h \
|
||||
camera_col.h \
|
||||
camera.h \
|
||||
channel_mixer.h \
|
||||
clip_trav.h \
|
||||
cloud.h \
|
||||
cloud_scape.h \
|
||||
cloud_scape_user.h \
|
||||
cluster.h \
|
||||
coarse_mesh_build.h \
|
||||
coarse_mesh_manager.h \
|
||||
computed_string.h \
|
||||
cube_grid.h \
|
||||
cube_map_builder.h \
|
||||
debug_vb.h \
|
||||
deform_2d.h \
|
||||
driver.h \
|
||||
driver_material_inline.h \
|
||||
driver_user.h \
|
||||
dru.h \
|
||||
event_mouse_listener.h \
|
||||
fasthls_modifier.h \
|
||||
fast_ptr_list.h \
|
||||
flare_model.h \
|
||||
flare_shape.h \
|
||||
font_generator.h \
|
||||
font_manager.h \
|
||||
frustum.h \
|
||||
heat_haze.h \
|
||||
height_map.h \
|
||||
hls_color_texture.h \
|
||||
hls_texture_bank.h \
|
||||
hls_texture_manager.h \
|
||||
hrc_trav.h \
|
||||
ig_surface_light_build.h \
|
||||
ig_surface_light.h \
|
||||
index_buffer.h \
|
||||
init_3d.h \
|
||||
instance_group_user.h \
|
||||
instance_lighter.h \
|
||||
key.h \
|
||||
landscape_collision_grid.h \
|
||||
landscape_def.h \
|
||||
landscape_face_vector_manager.h \
|
||||
landscape.h \
|
||||
landscapeig_manager.h \
|
||||
landscape_model.h \
|
||||
landscape_profile.h \
|
||||
landscape_user.h \
|
||||
landscapevb_allocator.h \
|
||||
landscapevb_info.h \
|
||||
landscape_vegetable_block.h \
|
||||
layered_ordering_table.h \
|
||||
light_contribution.h \
|
||||
light.h \
|
||||
light_influence_interpolator.h \
|
||||
lighting_manager.h \
|
||||
light_trav.h \
|
||||
light_user.h \
|
||||
load_balancing_trav.h \
|
||||
lod_character_builder.h \
|
||||
lod_character_instance.h \
|
||||
lod_character_manager.h \
|
||||
lod_character_shape_bank.h \
|
||||
lod_character_shape.h \
|
||||
lod_character_texture.h \
|
||||
logic_info.h \
|
||||
material.h \
|
||||
matrix_3x4.h \
|
||||
mesh_base.h \
|
||||
mesh_base_instance.h \
|
||||
mesh_blender.h \
|
||||
mesh_block_manager.h \
|
||||
mesh_geom.h \
|
||||
mesh.h \
|
||||
mesh_instance.h \
|
||||
mesh_morpher.h \
|
||||
mesh_mrm.h \
|
||||
mesh_mrm_instance.h \
|
||||
mesh_mrm_skinned.h \
|
||||
mesh_mrm_skinned_instance.h \
|
||||
mesh_multi_lod.h \
|
||||
mesh_multi_lod_instance.h \
|
||||
mesh_vertex_program.h \
|
||||
meshvp_per_pixel_light.h \
|
||||
meshvp_wind_tree.h \
|
||||
mini_col.h \
|
||||
motion_blur.h \
|
||||
mrm_builder.h \
|
||||
mrm_internal.h \
|
||||
mrm_level_detail.h \
|
||||
mrm_mesh.h \
|
||||
mrm_parameters.h \
|
||||
nelu.h \
|
||||
noise_3d.h \
|
||||
occlusion_query.h \
|
||||
ordering_table.h \
|
||||
packed_world.h \
|
||||
packed_zone.h \
|
||||
particle_system.h \
|
||||
particle_system_manager.h \
|
||||
particle_system_model.h \
|
||||
particle_system_process.h \
|
||||
particle_system_shape.h \
|
||||
patchdlm_context.h \
|
||||
patch.h \
|
||||
patch_rdr_pass.h \
|
||||
patchuv_locator.h \
|
||||
play_list_manager.h \
|
||||
play_list_manager_user.h \
|
||||
play_list_user.h \
|
||||
point_light.h \
|
||||
point_light_influence.h \
|
||||
point_light_model.h \
|
||||
point_light_named_array.h \
|
||||
point_light_named.h \
|
||||
portal.h \
|
||||
primitive_profile.h \
|
||||
ps_allocator.h \
|
||||
ps_attrib.h \
|
||||
ps_attrib_maker_bin_op.h \
|
||||
ps_attrib_maker_bin_op_inline.h \
|
||||
ps_attrib_maker.h \
|
||||
ps_attrib_maker_helper.h \
|
||||
ps_attrib_maker_iterators.h \
|
||||
ps_attrib_maker_template.h \
|
||||
ps_color.h \
|
||||
ps_direction.h \
|
||||
ps_dot.h \
|
||||
ps_edit.h \
|
||||
ps_emitter.h \
|
||||
ps_face.h \
|
||||
ps_face_look_at.h \
|
||||
ps_fan_light.h \
|
||||
ps_float.h \
|
||||
ps_force.h \
|
||||
ps_int.h \
|
||||
ps_iterator.h \
|
||||
ps_light.h \
|
||||
ps_located.h \
|
||||
ps_lod.h \
|
||||
ps_macro.h \
|
||||
ps_mesh.h \
|
||||
ps_misc.h \
|
||||
ps_particle2.h \
|
||||
ps_particle_basic.h \
|
||||
ps_particle.h \
|
||||
ps_plane_basis.h \
|
||||
ps_plane_basis_maker.h \
|
||||
ps_quad.h \
|
||||
ps_register_color_attribs.h \
|
||||
ps_register_float_attribs.h \
|
||||
ps_register_int_attribs.h \
|
||||
ps_register_plane_basis_attribs.h \
|
||||
ps_ribbon_base.h \
|
||||
ps_ribbon.h \
|
||||
ps_ribbon_look_at.h \
|
||||
ps_shockwave.h \
|
||||
ps_sound.h \
|
||||
ps_spawn_info.h \
|
||||
ps_tail_dot.h \
|
||||
ps_util.h \
|
||||
ps_zone.h \
|
||||
ptr_set.h \
|
||||
quad_effect.h \
|
||||
quad_grid_clip_cluster.h \
|
||||
quad_grid_clip_manager.h \
|
||||
quad_grid.h \
|
||||
quad_tree.h \
|
||||
radix_sort.h \
|
||||
raw_skin.h \
|
||||
raw_skinned.h \
|
||||
ray_mesh.h \
|
||||
register_3d.h \
|
||||
render_trav.h \
|
||||
root_model.h \
|
||||
scene_group.h \
|
||||
scene.h \
|
||||
scene_user.h \
|
||||
scissor.h \
|
||||
seg_remanence.h \
|
||||
seg_remanence_shape.h \
|
||||
shader.h \
|
||||
shadow_map.h \
|
||||
shadow_map_manager.h \
|
||||
shadow_poly_receiver.h \
|
||||
shadow_skin.h \
|
||||
shape_bank.h \
|
||||
shape_bank_user.h \
|
||||
shape.h \
|
||||
shape_info.h \
|
||||
shifted_triangle_cache.h \
|
||||
skeleton_model.h \
|
||||
skeleton_shape.h \
|
||||
skeleton_spawn_script.h \
|
||||
skeleton_weight.h \
|
||||
static_quad_grid.h \
|
||||
stripifier.h \
|
||||
surface_light_grid.h \
|
||||
tangent_space_build.h \
|
||||
target_anim_ctrl.h \
|
||||
tess_block.h \
|
||||
tessellation.h \
|
||||
tess_face_priority_list.h \
|
||||
tess_list.h \
|
||||
text_context.h \
|
||||
text_context_user.h \
|
||||
texture_blank.h \
|
||||
texture_blend.h \
|
||||
texture_bloom.h \
|
||||
texture_bump.h \
|
||||
texture_cube.h \
|
||||
texture_dlm.h \
|
||||
texture_emboss.h \
|
||||
texture_far.h \
|
||||
texture_file.h \
|
||||
texture_font.h \
|
||||
texture_grouped.h \
|
||||
texture.h \
|
||||
texture_mem.h \
|
||||
texture_multi_file.h \
|
||||
texture_near.h \
|
||||
texture_user.h \
|
||||
tile_bank.h \
|
||||
tile_color.h \
|
||||
tile_element.h \
|
||||
tile_far_bank.h \
|
||||
tile_light_influence.h \
|
||||
tile_lumel.h \
|
||||
tile_noise_map.h \
|
||||
tile_vegetable_desc.h \
|
||||
track_bezier.h \
|
||||
track.h \
|
||||
track_keyframer.h \
|
||||
track_sampled_common.h \
|
||||
track_sampled_quat.h \
|
||||
track_sampled_quat_small_header.h \
|
||||
track_sampled_vector.h \
|
||||
track_tcb.h \
|
||||
transformable.h \
|
||||
transform.h \
|
||||
transform_shape.h \
|
||||
trav_scene.h \
|
||||
u_3d_mouse_listener.h \
|
||||
u_animation.h \
|
||||
u_animation_set.h \
|
||||
u_bone.h \
|
||||
u_camera.h \
|
||||
u_cloud_scape.h \
|
||||
u_driver.h \
|
||||
u_instance_group.h \
|
||||
u_instance.h \
|
||||
u_instance_material.h \
|
||||
u_landscape.h \
|
||||
u_light.h \
|
||||
u_material.h \
|
||||
u_particle_system_instance.h \
|
||||
u_particle_system_sound.h \
|
||||
u_play_list.h \
|
||||
u_play_list_manager.h \
|
||||
u_point_light.h \
|
||||
u_ps_sound_impl.h \
|
||||
u_ps_sound_interface.h \
|
||||
u_scene.h \
|
||||
u_shape_bank.h \
|
||||
u_shape.h \
|
||||
u_skeleton.h \
|
||||
u_text_context.h \
|
||||
u_texture.h \
|
||||
u_track.h \
|
||||
u_transformable.h \
|
||||
u_transform.h \
|
||||
u_visual_collision_entity.h \
|
||||
u_visual_collision_manager.h \
|
||||
u_visual_collision_mesh.h \
|
||||
u_water_env_map.h \
|
||||
u_water.h \
|
||||
vegetable_blend_layer_model.h \
|
||||
vegetable_clip_block.h \
|
||||
vegetable_def.h \
|
||||
vegetable.h \
|
||||
vegetable_instance_group.h \
|
||||
vegetable_light_ex.h \
|
||||
vegetable_manager.h \
|
||||
vegetable_quadrant.h \
|
||||
vegetable_shape.h \
|
||||
vegetable_sort_block.h \
|
||||
vegetable_uv8.h \
|
||||
vegetablevb_allocator.h \
|
||||
vertex_buffer.h \
|
||||
vertex_buffer_heap.h \
|
||||
vertex_program.h \
|
||||
vertex_program_parse.h \
|
||||
vertex_stream_manager.h \
|
||||
viewport.h \
|
||||
visual_collision_entity.h \
|
||||
visual_collision_entity_user.h \
|
||||
visual_collision_manager.h \
|
||||
visual_collision_manager_user.h \
|
||||
visual_collision_mesh.h \
|
||||
water_env_map.h \
|
||||
water_env_map_user.h \
|
||||
water_height_map.h \
|
||||
water_model.h \
|
||||
water_pool_manager.h \
|
||||
water_shape.h \
|
||||
zone_corner_smoother.h \
|
||||
zone.h \
|
||||
zone_lighter.h \
|
||||
zone_manager.h \
|
||||
zone_search.h \
|
||||
zone_smoother.h \
|
||||
zone_symmetrisation.h \
|
||||
zone_tgt_smoother.h
|
||||
|
||||
# End of Makefile.am
|
71
code/nel/include/nel/3d/anim_ctrl.h
Normal file
71
code/nel/include/nel/3d/anim_ctrl.h
Normal file
|
@ -0,0 +1,71 @@
|
|||
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef NL_ANIM_CTRL_H
|
||||
#define NL_ANIM_CTRL_H
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
class CBone;
|
||||
class CSkeletonModel;
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
/**
|
||||
* This is a handler for extra Animation behavior on Skeleton Models.
|
||||
* When a bone has ended his compute, if it has an attached AnimCtrl, it calls its ::execute() code
|
||||
* The AnimCtrl may modify all or part of the skeleton, knowing that the sons of the bone animCtrled are still not
|
||||
* computed.
|
||||
* Typically, animCtrls should modify the matrix parts of the bone, and then call bone->compute(..,..,NULL)
|
||||
*
|
||||
* Note: for convenience, when execute() is called on a bone, the LocalSkeletonMatrix and WorldMatrix
|
||||
* of this bone are already computed.
|
||||
*
|
||||
* Important Note about Bone Loding:
|
||||
* - AnimCtrl are not called if the bone is loded (ie not animated/computed)
|
||||
* - AnimCtrl is called BEFORE Bone Lod interpolation, resulting in the excepted behavior.
|
||||
*
|
||||
* Note about UserInterface logic: CSkeletonModel and CBone appears here but are used only for the derivers of this
|
||||
* class (that are still in 3D), so the UserInterface don't need and don't use it.
|
||||
* Therefore, there is no way (for now) with the strict UserInterface scheme to implements new AnimCtrls.
|
||||
* But the user is allowed to use the Layer2 (ie CScene, CSkeletonModel etc classes) to create its own AnimCtrls.
|
||||
* \author Lionel Berenguier
|
||||
* \author Nevrax France
|
||||
* \date 2003
|
||||
*/
|
||||
class IAnimCtrl
|
||||
{
|
||||
public:
|
||||
virtual ~IAnimCtrl() {}
|
||||
|
||||
/// Called at compute() time.
|
||||
virtual void execute(CSkeletonModel *model, CBone *bone) =0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
} // NL3D
|
||||
|
||||
|
||||
#endif // NL_ANIM_CTRL_H
|
||||
|
||||
/* End of anim_ctrl.h */
|
102
code/nel/include/nel/3d/anim_detail_trav.h
Normal file
102
code/nel/include/nel/3d/anim_detail_trav.h
Normal file
|
@ -0,0 +1,102 @@
|
|||
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef NL_ANIM_DETAIL_TRAV_H
|
||||
#define NL_ANIM_DETAIL_TRAV_H
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/matrix.h"
|
||||
#include "nel/misc/plane.h"
|
||||
#include "nel/3d/trav_scene.h"
|
||||
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
|
||||
using NLMISC::CVector;
|
||||
using NLMISC::CPlane;
|
||||
using NLMISC::CMatrix;
|
||||
|
||||
|
||||
class CTransform;
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
/**
|
||||
* The AnimDetail traversal.
|
||||
* There is no AnimDetail graph. traverse() use the clipTrav VisibilityList to traverse all models.
|
||||
*
|
||||
* NB: see CScene for 3d conventions (orthonormal basis...)
|
||||
* \author Lionel Berenguier
|
||||
* \author Nevrax France
|
||||
* \date 2000
|
||||
*/
|
||||
class CAnimDetailTrav : public CTraversal
|
||||
{
|
||||
public:
|
||||
|
||||
/// Constructor
|
||||
CAnimDetailTrav();
|
||||
|
||||
|
||||
/// \name ITrav/ITravScene Implementation.
|
||||
//@{
|
||||
/** render after Clip and before light.
|
||||
* This order is important for possible lights sticked to bones of skeletons.
|
||||
*/
|
||||
void traverse();
|
||||
//@}
|
||||
|
||||
|
||||
public:
|
||||
// ONLY FOR MODEL TRAVERSING.
|
||||
|
||||
sint64 CurrentDate; // The current date of the traversal, useful for evaldetail just one time..
|
||||
|
||||
|
||||
// For clipTrav. cleared at beginning of CClipTrav::traverse
|
||||
void clearVisibleList();
|
||||
|
||||
// For ClipTrav only. NB: list is cleared at begining of traverse(). NB: only CTransform are supported
|
||||
void addVisibleModel(CTransform *model)
|
||||
{
|
||||
_VisibleList[_CurrentNumVisibleModels]= model;
|
||||
_CurrentNumVisibleModels++;
|
||||
}
|
||||
|
||||
// for createModel().
|
||||
void reserveVisibleList(uint numModels);
|
||||
|
||||
|
||||
// ********************
|
||||
private:
|
||||
/// traverse the model recursively, following Hrc hierarchy
|
||||
void traverseHrcRecurs(CTransform *model);
|
||||
|
||||
// traverse list of model visible and useful to animDetail.
|
||||
std::vector<CTransform*> _VisibleList;
|
||||
uint32 _CurrentNumVisibleModels;
|
||||
|
||||
};
|
||||
|
||||
|
||||
} // NL3D
|
||||
|
||||
|
||||
#endif // NL_ANIM_DETAIL_TRAV_H
|
||||
|
||||
/* End of anim_detail_trav.h */
|
242
code/nel/include/nel/3d/animatable.h
Normal file
242
code/nel/include/nel/3d/animatable.h
Normal file
|
@ -0,0 +1,242 @@
|
|||
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef NL_ANIMATABLE_H
|
||||
#define NL_ANIMATABLE_H
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/bit_set.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
class ITrack;
|
||||
class CChannelMixer;
|
||||
class IAnimatedValue;
|
||||
|
||||
/**
|
||||
* An animatable object.
|
||||
*
|
||||
* This object can have a set of animated values. At Max 32 animated values can be set (because of bit and touch mgt)
|
||||
* Animated values are animated by a CChannelMixer object.
|
||||
* Each value have a name and a default track.
|
||||
*
|
||||
* An IAnimatable may have IAnimatable sons (list of bones, list of materials etc...). The value count and valueId of
|
||||
* the IAnimatable DO NOT count those sons, but register() should register his sons too.
|
||||
* A father propagated touch system (setFather()) is implemented. When a son is touched, he touchs his fathers, his grandfather
|
||||
* and so on.
|
||||
*
|
||||
* When a class derives from IAnimatable, it must implement all the
|
||||
* interface's methods:
|
||||
*
|
||||
* extend TAnimValues enum, beginning to BaseClass::AnimValueLast, and add a bit OwnerBit.
|
||||
* ctor(): just type "IAnimatable::resize (AnimValueLast);"
|
||||
* virtual IAnimatedValue* getValue (uint valueId);
|
||||
* virtual const char *getValueName (uint valueId) const;
|
||||
* virtual ITrack* getDefaultTrack (uint valueId);
|
||||
*
|
||||
* virtual register(CChannelMixer *, const string &prefix);
|
||||
*
|
||||
*
|
||||
* Watch NL3D::ITransformable and NL3D::CTransform for a good example.
|
||||
*
|
||||
* \author Cyril 'Hulud' Corvazier
|
||||
* \author Nevrax France
|
||||
* \date 2001
|
||||
*/
|
||||
class IAnimatable : public NLMISC::CRefCount
|
||||
{
|
||||
friend class IAnimatedValue;
|
||||
public:
|
||||
|
||||
/**
|
||||
* Default Constructor. Set number of value to 0.
|
||||
* Deriver: should just write: IAnimatable::resize (getValueCount());
|
||||
*
|
||||
*/
|
||||
IAnimatable ()
|
||||
{
|
||||
_Father= NULL;
|
||||
_BitSet= 0;
|
||||
}
|
||||
|
||||
virtual ~IAnimatable() {}
|
||||
/// \name Interface
|
||||
// @{
|
||||
/**
|
||||
* The enum of animated values. (same system in CMOT). Deriver should extend this enum, beginning with OwnerBit= BaseClass::AnimValueLast.
|
||||
* The number of values MUST NOT EXCEED 32, for fast touch() system.
|
||||
* "OwnerBit" system: each deriver of IAnimatable should had an entry "OwnerBit" in this TAnimValues. This bit will be set when
|
||||
* an IAnimatedValue of this deriver part is touched, or if one of his IAnimatable sons is touched (see setFather()).
|
||||
*/
|
||||
enum TAnimValues
|
||||
{
|
||||
AnimValueLast=0,
|
||||
};
|
||||
|
||||
/**
|
||||
* Get a value pointer.
|
||||
*
|
||||
* \param valueId is the animated value ID in the object. IGNORING IANIMATABLE SONS (eg: bones, materials...).
|
||||
* \return The pointer on the animated value.
|
||||
*/
|
||||
virtual IAnimatedValue* getValue (uint valueId) =0;
|
||||
|
||||
/**
|
||||
* Get animated value name.
|
||||
*
|
||||
* \param valueId is the animated value ID in the object we want the name. IGNORING IANIMATABLE SONS (eg: bones, materials...).
|
||||
* \return the name of the animated value.
|
||||
*/
|
||||
virtual const char *getValueName (uint valueId) const =0;
|
||||
|
||||
/**
|
||||
* Get default track pointer.
|
||||
*
|
||||
* \param valueId is the animated value ID in the object we want the default track. IGNORING IANIMATABLE SONS (eg: bones, materials...).
|
||||
* \return The pointer on the default track of the value.
|
||||
*/
|
||||
virtual ITrack* getDefaultTrack (uint valueId) =0;
|
||||
|
||||
/**
|
||||
* register the Animatable to a channelMixer (using CChannelMixer::addChannel()). You MUST use this method to register Animatable.
|
||||
* This method should:
|
||||
* - call is BaseClass method.
|
||||
* - register local AnimatableValues, with channel name: prefix+getValueName().
|
||||
* - register local sons!!. eg: matlist[0]->registerToChannelMixer(chanMixer, prefix+"mat0.").
|
||||
*
|
||||
* \param chanMixer is the channel mixer. Should not be NULL. for anim detail purpose , the IAnimatable may store a RefPtr on this channel mixer.
|
||||
* \param prefix prefix to be append to valueNames
|
||||
*/
|
||||
virtual void registerToChannelMixer(CChannelMixer *chanMixer, const std::string &prefix=std::string()) =0;
|
||||
|
||||
// @}
|
||||
|
||||
|
||||
|
||||
/// \name Touch flags management
|
||||
// @{
|
||||
|
||||
/**
|
||||
* Say which (if any) IAnimatable owns this one. This is important for Touch propagation.
|
||||
* By this system, Fathers and ancestors know if they must check their sons (isTouched() return true).
|
||||
*
|
||||
* \param father the father we must inform of our update.
|
||||
* \param fatherOwnerBit What bit of father we must set when we are updated
|
||||
*/
|
||||
void setFather(IAnimatable *father, uint fatherOwnerBit)
|
||||
{
|
||||
_Father= father; _FatherOwnerBit= fatherOwnerBit;
|
||||
|
||||
// propagate the touch to the fathers.
|
||||
propagateTouch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Touch a value because it has been modified.
|
||||
*
|
||||
* \param valueId is the animated value ID in the object we want to touch.
|
||||
* \param ownerValueId is the bit of the IAnimatable part which owns this animated value.
|
||||
*/
|
||||
void touch (uint valueId, uint ownerValueId)
|
||||
{
|
||||
// Set the bit
|
||||
setFlag(valueId);
|
||||
// Set the owner bit
|
||||
setFlag(ownerValueId);
|
||||
|
||||
// propagate the touch to the fathers.
|
||||
propagateTouch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return non 0 int if the value as been touched else 0.
|
||||
*
|
||||
* \param valueId is the animated value ID in the object we want to test the touch flag. or it may be an OwnerBit.
|
||||
*/
|
||||
uint32 isTouched (uint valueId) const
|
||||
{
|
||||
return _BitSet&(1<<valueId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Change value count, bit are set to 0
|
||||
*
|
||||
* \param count is the new value count.
|
||||
*/
|
||||
void resize (uint count)
|
||||
{
|
||||
// with the "uint32 _BitSet" implementation, juste check the size is correct
|
||||
nlassert(count<=32);
|
||||
}
|
||||
// @}
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Use a uint32 to manage the flags
|
||||
uint32 _BitSet;
|
||||
// The owner of this IAnimatable.
|
||||
IAnimatable *_Father;
|
||||
// What bit of father which must set when we are updated.
|
||||
uint _FatherOwnerBit;
|
||||
|
||||
void propagateTouch()
|
||||
{
|
||||
IAnimatable *pCur= this;
|
||||
// Stop when no father, or when father is already touched (and so the grandfather...!!!).
|
||||
while(pCur->_Father && !pCur->_Father->isTouched(_FatherOwnerBit))
|
||||
{
|
||||
// The Owner bit is the "something is touched" flag. touch it.
|
||||
pCur->_Father->setFlag(pCur->_FatherOwnerBit);
|
||||
pCur= pCur->_Father;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
/** This is a tool function which add a given value to a channel.
|
||||
* \return -1 if the track was not found in the animationSet, else it return the channelId
|
||||
* as if returned by CAnimationSet::getChannelIdByName(channelName).
|
||||
*/
|
||||
sint addValue(CChannelMixer *chanMixer, uint valueId, uint ownerValueId, const std::string &prefix, bool detail);
|
||||
|
||||
/// This method clear a bit in the bitset.
|
||||
void clearFlag(uint valueId)
|
||||
{
|
||||
_BitSet&= ~(1<<valueId);
|
||||
}
|
||||
|
||||
/// This method set a bit in the bitset.
|
||||
void setFlag(uint valueId)
|
||||
{
|
||||
_BitSet|= (1<<valueId);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
} // NL3D
|
||||
|
||||
#endif // NL_ANIMATABLE_H
|
||||
|
||||
/* End of animatable.h */
|
107
code/nel/include/nel/3d/animated_lightmap.h
Normal file
107
code/nel/include/nel/3d/animated_lightmap.h
Normal file
|
@ -0,0 +1,107 @@
|
|||
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef NL_ANIMATED_LIGHTMAP_H
|
||||
#define NL_ANIMATED_LIGHTMAP_H
|
||||
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/smart_ptr.h"
|
||||
#include "nel/3d/animatable.h"
|
||||
#include "nel/3d/track.h"
|
||||
#include <map>
|
||||
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
// ***************************************************************************
|
||||
/**
|
||||
* An animated lightmap
|
||||
* \author Matthieu Besson
|
||||
* \author Nevrax France
|
||||
* \date 2001
|
||||
*/
|
||||
class CAnimatedLightmap : public IAnimatable
|
||||
{
|
||||
public:
|
||||
|
||||
/// \name ctor / setup.
|
||||
// @{
|
||||
/** Constructor.
|
||||
*/
|
||||
CAnimatedLightmap (uint lightmapGroup);
|
||||
virtual ~CAnimatedLightmap() {}
|
||||
// @}
|
||||
|
||||
|
||||
/// \name Herited from IAnimatable
|
||||
// @{
|
||||
/// Added values.
|
||||
enum TAnimValues
|
||||
{
|
||||
OwnerBit= IAnimatable::AnimValueLast,
|
||||
FactorValue,
|
||||
AnimValueLast
|
||||
};
|
||||
|
||||
/// From IAnimatable
|
||||
virtual IAnimatedValue* getValue (uint valueId);
|
||||
|
||||
/// From IAnimatable
|
||||
virtual const char *getValueName (uint valueId) const;
|
||||
|
||||
/// From IAnimatable.
|
||||
virtual ITrack* getDefaultTrack (uint valueId);
|
||||
|
||||
/// From IAnimatable.
|
||||
virtual void registerToChannelMixer(CChannelMixer *chanMixer, const std::string &prefix);
|
||||
|
||||
// @}
|
||||
|
||||
void setName( const std::string &s ) { _Name = s; }
|
||||
std::string getName() const { return _Name; }
|
||||
|
||||
// Update the group color with the scene
|
||||
void updateGroupColors (class NL3D::CScene &scene);
|
||||
|
||||
NLMISC::CRGBA getFactor (uint group) const
|
||||
{
|
||||
if (group < _GroupColor.size ())
|
||||
return _GroupColor[group];
|
||||
else
|
||||
return _Factor.Value;
|
||||
}
|
||||
|
||||
// ********************
|
||||
private:
|
||||
|
||||
std::string _Name;
|
||||
|
||||
// AnimValues.
|
||||
|
||||
CAnimatedValueRGBA _Factor;
|
||||
CTrackDefaultRGBA _DefaultFactor;
|
||||
std::vector<NLMISC::CRGBA> _GroupColor;
|
||||
};
|
||||
|
||||
|
||||
} // NL3D
|
||||
|
||||
|
||||
#endif // NL_ANIMATED_LIGHTMAP_H
|
||||
|
||||
/* End of animated_lightmap.h */
|
281
code/nel/include/nel/3d/animated_material.h
Normal file
281
code/nel/include/nel/3d/animated_material.h
Normal file
|
@ -0,0 +1,281 @@
|
|||
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef NL_ANIMATED_MATERIAL_H
|
||||
#define NL_ANIMATED_MATERIAL_H
|
||||
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/smart_ptr.h"
|
||||
#include "nel/3d/animatable.h"
|
||||
#include "nel/3d/material.h"
|
||||
#include "nel/3d/track.h"
|
||||
#include <map>
|
||||
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
/**
|
||||
* An material Reference for Animated reference. This object is stored in the mesh, and is serialised.
|
||||
* NB: formated for 3ds Max :). Emissive anim is a float, with a constant RGB factor.
|
||||
* \author Cyril 'Hulud' Corvazier
|
||||
* \author Nevrax France
|
||||
* \date 2001
|
||||
*/
|
||||
class CMaterialBase : public NLMISC::CRefCount
|
||||
{
|
||||
public:
|
||||
|
||||
CMaterialBase();
|
||||
|
||||
/** setup the default tracks from a material
|
||||
* This method:
|
||||
* - copy the material contents into the Defaults tracks values.
|
||||
*
|
||||
* NB: for emissive part, emissive defaut track value is set to 1, and emissive factor is set to the
|
||||
* RGB emissive value stored into pMat.
|
||||
*/
|
||||
void copyFromMaterial(CMaterial *pMat);
|
||||
|
||||
|
||||
// Name of this material, for Animation access.
|
||||
std::string Name;
|
||||
|
||||
|
||||
// Default tracks.
|
||||
CTrackDefaultRGBA DefaultAmbient;
|
||||
CTrackDefaultRGBA DefaultDiffuse;
|
||||
CTrackDefaultRGBA DefaultSpecular;
|
||||
CTrackDefaultFloat DefaultShininess;
|
||||
CTrackDefaultRGBA DefaultEmissive;
|
||||
CTrackDefaultFloat DefaultOpacity;
|
||||
CTrackDefaultInt DefaultTexture;
|
||||
|
||||
// Texture animation
|
||||
struct CTexAnimTracks
|
||||
{
|
||||
|
||||
CTrackDefaultFloat DefaultUTrans; // u translation
|
||||
CTrackDefaultFloat DefaultVTrans; // v translation
|
||||
CTrackDefaultFloat DefaultUScale; // u scale
|
||||
CTrackDefaultFloat DefaultVScale; // u scale
|
||||
CTrackDefaultFloat DefaultWRot; // v scale
|
||||
|
||||
|
||||
// number of default tracks
|
||||
enum { NumTexAnimatedValues = 5 };
|
||||
|
||||
|
||||
void setDefaultValue()
|
||||
{
|
||||
DefaultUTrans.setDefaultValue(0);
|
||||
DefaultVTrans.setDefaultValue(0);
|
||||
DefaultUScale.setDefaultValue(1);
|
||||
DefaultVScale.setDefaultValue(1);
|
||||
DefaultWRot.setDefaultValue(0);
|
||||
}
|
||||
|
||||
void serial(NLMISC::IStream &f)
|
||||
{
|
||||
(void)f.serialVersion(0);
|
||||
f.serial(DefaultUTrans, DefaultVTrans, DefaultUScale, DefaultVScale);
|
||||
}
|
||||
};
|
||||
CTexAnimTracks DefaultTexAnimTracks[IDRV_MAT_MAXTEXTURES];
|
||||
|
||||
/// save/load.
|
||||
void serial(NLMISC::IStream &f);
|
||||
|
||||
|
||||
/// \name Texture Animation mgt.
|
||||
/** Animated materials support Texture animation. This is the place where you define your list of texture.
|
||||
* This list of animated texture is serialised. AnimatedMaterial animate texture with sint32 Tracks. If the id is not
|
||||
* found in CMaterialBase, then the CMaterial texture is left as before.
|
||||
*
|
||||
* NB: id 0x7FFFFFFF is a reserved id, used as default to indicate no valid Animated texture.
|
||||
*/
|
||||
// @{
|
||||
/// assign a specific texture for an id (a uint32). It is valid to give a NULL ptr (=> untextured). Sorted as a SmartPtr.
|
||||
void setAnimatedTexture(uint32 id, CSmartPtr<ITexture> pText);
|
||||
/// is this Id valid?
|
||||
bool validAnimatedTexture(uint32 id);
|
||||
/// return the texture for this Id. return NULL either if NULL texture for this id or if(!validAnimatedTexture()).
|
||||
ITexture* getAnimatedTexture(uint32 id);
|
||||
|
||||
// @}
|
||||
|
||||
// *********************
|
||||
private:
|
||||
|
||||
struct CAnimatedTexture
|
||||
{
|
||||
CSmartPtr<ITexture> Texture;
|
||||
|
||||
// serial.
|
||||
void serial(NLMISC::IStream &f);
|
||||
};
|
||||
|
||||
typedef std::map<uint32, CAnimatedTexture> TAnimatedTextureMap;
|
||||
TAnimatedTextureMap _AnimatedTextures;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
/**
|
||||
* An animated material Instance of CMaterialBase
|
||||
* NB: formated for 3ds Max :). Emissive anim is a float, with a constant RGB factor.
|
||||
* Texture animation: see update().
|
||||
* \author Cyril 'Hulud' Corvazier
|
||||
* \author Nevrax France
|
||||
* \date 2001
|
||||
*/
|
||||
class CAnimatedMaterial : public IAnimatable
|
||||
{
|
||||
public:
|
||||
|
||||
/// \name ctor / setup.
|
||||
// @{
|
||||
/** Constructor.
|
||||
* This ctor:
|
||||
* - store a RefPtr on the BaseMaterial (for getDefaultTracks() method).
|
||||
* - copy the material default track value into Animated Values.
|
||||
*/
|
||||
CAnimatedMaterial(CMaterialBase *baseMat);
|
||||
|
||||
|
||||
/** setup the material context for this animated material.
|
||||
* This method:
|
||||
* - store a RefPtr on the material, for future anim update.
|
||||
*/
|
||||
void setMaterial(CMaterial *pMat);
|
||||
|
||||
/** Return the name of this material (stored in CMaterialBase).
|
||||
*/
|
||||
std::string getMaterialName() const;
|
||||
// @}
|
||||
|
||||
|
||||
/** Check if the animated material is touched, and if necessary update the stored material (if any).
|
||||
* Texture animation: for now, texture animation is possible only on stage 0. If TextureValue flag is touched (ie
|
||||
* a texture anim track is linked to the animated value), update() look into the CMaterialBase what texture to set.
|
||||
* If the track gives a bad Id for the texture, no-op.
|
||||
*/
|
||||
void update();
|
||||
|
||||
|
||||
/// \name Get some track name
|
||||
// @{
|
||||
static const char *getAmbientValueName() {return "ambient";}
|
||||
static const char *getDiffuseValueName() {return "diffuse";}
|
||||
static const char *getSpecularValueName() {return "specular";}
|
||||
static const char *getShininessValueName() {return "shininess";}
|
||||
static const char *getEmissiveValueName() {return "emissive";}
|
||||
static const char *getOpacityValueName() {return "opacity";}
|
||||
static const char *getTextureValueName() {return "texture";}
|
||||
//
|
||||
static const char *getTexMatUTransName(uint stage);
|
||||
static const char *getTexMatVTransName(uint stage);
|
||||
static const char *getTexMatUScaleName(uint stage);
|
||||
static const char *getTexMatVScaleName(uint stage);
|
||||
static const char *getTexMatWRotName(uint stage);
|
||||
|
||||
// @}
|
||||
|
||||
/// number of animated values for each animated texture, taken from CMaterialBase
|
||||
enum { NumTexAnimatedValues = CMaterialBase::CTexAnimTracks::NumTexAnimatedValues };
|
||||
|
||||
/// \name Herited from IAnimatable
|
||||
// @{
|
||||
/// Added values.
|
||||
enum TAnimValues
|
||||
{
|
||||
OwnerBit= IAnimatable::AnimValueLast,
|
||||
AmbientValue,
|
||||
DiffuseValue,
|
||||
SpecularValue,
|
||||
ShininessValue,
|
||||
EmissiveValue,
|
||||
OpacityValue,
|
||||
TextureValue,
|
||||
TextureMatValues,
|
||||
AnimValueLast = TextureMatValues + NumTexAnimatedValues * IDRV_MAT_MAXTEXTURES /* texture matrix anim */
|
||||
};
|
||||
|
||||
/// From IAnimatable
|
||||
virtual IAnimatedValue* getValue (uint valueId);
|
||||
|
||||
/// From IAnimatable
|
||||
virtual const char *getValueName (uint valueId) const;
|
||||
|
||||
/// From IAnimatable.
|
||||
virtual ITrack* getDefaultTrack (uint valueId);
|
||||
|
||||
/// From IAnimatable.
|
||||
virtual void registerToChannelMixer(CChannelMixer *chanMixer, const std::string &prefix);
|
||||
|
||||
// @}
|
||||
|
||||
|
||||
// ********************
|
||||
private:
|
||||
|
||||
// The material instantiator.
|
||||
CRefPtr<CMaterialBase> _MaterialBase;
|
||||
// The material.
|
||||
CRefPtr<CMaterial> _Material;
|
||||
|
||||
// AnimValues.
|
||||
CAnimatedValueRGBA _Ambient;
|
||||
CAnimatedValueRGBA _Diffuse;
|
||||
CAnimatedValueRGBA _Specular;
|
||||
CAnimatedValueFloat _Shininess;
|
||||
CAnimatedValueRGBA _Emissive;
|
||||
CAnimatedValueFloat _Opacity;
|
||||
CAnimatedValueInt _Texture;
|
||||
|
||||
struct CTexAnimatedMatValues
|
||||
{
|
||||
CAnimatedValueFloat _UTrans;
|
||||
CAnimatedValueFloat _VTrans;
|
||||
CAnimatedValueFloat _UScale;
|
||||
CAnimatedValueFloat _VScale;
|
||||
CAnimatedValueFloat _WRot;
|
||||
|
||||
void affect(CMaterialBase::CTexAnimTracks &at)
|
||||
{
|
||||
_UTrans.Value= at.DefaultUTrans.getDefaultValue();
|
||||
_VTrans.Value= at.DefaultVTrans.getDefaultValue();
|
||||
_UScale.Value= at.DefaultUScale.getDefaultValue();
|
||||
_VScale.Value= at.DefaultVScale.getDefaultValue();
|
||||
_WRot.Value= at.DefaultWRot.getDefaultValue();
|
||||
}
|
||||
};
|
||||
CTexAnimatedMatValues _TexAnimatedMatValues[IDRV_MAT_MAXTEXTURES];
|
||||
};
|
||||
|
||||
|
||||
} // NL3D
|
||||
|
||||
|
||||
#endif // NL_ANIMATED_MATERIAL_H
|
||||
|
||||
/* End of animated_material.h */
|
116
code/nel/include/nel/3d/animated_morph.h
Normal file
116
code/nel/include/nel/3d/animated_morph.h
Normal file
|
@ -0,0 +1,116 @@
|
|||
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef NL_ANIMATED_MORPH_H
|
||||
#define NL_ANIMATED_MORPH_H
|
||||
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/smart_ptr.h"
|
||||
#include "nel/3d/animatable.h"
|
||||
#include "nel/3d/track.h"
|
||||
#include <map>
|
||||
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
// ***************************************************************************
|
||||
/**
|
||||
* An animated morph (blend shape) base
|
||||
* \author Matthieu Besson
|
||||
* \author Nevrax France
|
||||
* \date 2001
|
||||
*/
|
||||
class CMorphBase : public NLMISC::CRefCount
|
||||
{
|
||||
public:
|
||||
|
||||
CMorphBase();
|
||||
|
||||
// Name of this material, for Animation access.
|
||||
std::string Name;
|
||||
|
||||
// Default tracks.
|
||||
CTrackDefaultFloat DefaultFactor;
|
||||
|
||||
/// save/load.
|
||||
void serial(NLMISC::IStream &f);
|
||||
};
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
/**
|
||||
* An animated morph (blend shape)
|
||||
* \author Matthieu Besson
|
||||
* \author Nevrax France
|
||||
* \date 2001
|
||||
*/
|
||||
class CAnimatedMorph : public IAnimatable
|
||||
{
|
||||
public:
|
||||
|
||||
/// \name ctor / setup.
|
||||
// @{
|
||||
/** Constructor.
|
||||
*/
|
||||
CAnimatedMorph (CMorphBase*mb);
|
||||
// @}
|
||||
|
||||
|
||||
/// \name Herited from IAnimatable
|
||||
// @{
|
||||
/// Added values.
|
||||
enum TAnimValues
|
||||
{
|
||||
OwnerBit= IAnimatable::AnimValueLast,
|
||||
FactorValue,
|
||||
AnimValueLast
|
||||
};
|
||||
|
||||
/// From IAnimatable
|
||||
virtual IAnimatedValue* getValue (uint valueId);
|
||||
|
||||
/// From IAnimatable
|
||||
virtual const char *getValueName (uint valueId) const;
|
||||
|
||||
/// From IAnimatable.
|
||||
virtual ITrack* getDefaultTrack (uint valueId);
|
||||
|
||||
/// From IAnimatable.
|
||||
virtual void registerToChannelMixer(CChannelMixer *chanMixer, const std::string &prefix);
|
||||
|
||||
// @}
|
||||
|
||||
float getFactor() const { return _Factor.Value; }
|
||||
void setFactor (float rFactor) { _Factor.Value = rFactor; }
|
||||
|
||||
const std::string& getName() const { return _MorphBase->Name; }
|
||||
|
||||
// ********************
|
||||
private:
|
||||
CMorphBase *_MorphBase;
|
||||
|
||||
CAnimatedValueFloat _Factor;
|
||||
};
|
||||
|
||||
|
||||
} // NL3D
|
||||
|
||||
|
||||
#endif // NL_ANIMATED_MORPH_H
|
||||
|
||||
/* End of animated_morph.h */
|
297
code/nel/include/nel/3d/animated_value.h
Normal file
297
code/nel/include/nel/3d/animated_value.h
Normal file
|
@ -0,0 +1,297 @@
|
|||
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef NL_ANIMATED_VALUE_H
|
||||
#define NL_ANIMATED_VALUE_H
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/vector.h"
|
||||
#include "nel/misc/quat.h"
|
||||
#include "nel/misc/rgba.h"
|
||||
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* A value handled by the animation system.
|
||||
* This value must be managed by a IAnimatable object.
|
||||
*
|
||||
* \author Cyril 'Hulud' Corvazier
|
||||
* \author Nevrax France
|
||||
* \date 2001
|
||||
*/
|
||||
class IAnimatedValue
|
||||
{
|
||||
public:
|
||||
virtual ~IAnimatedValue() {}
|
||||
|
||||
/**
|
||||
* The blend method. This method blend two animated values and store the result
|
||||
* in the object. The two first args can be reference on the object itself.
|
||||
* Idealy, it performs the operation this->value=(this->value*blendFactor + value*(1.f-blendFactor))
|
||||
*
|
||||
* \param value is the first value in the blend operation.
|
||||
* \param blendFactor must be in the range [0..1].
|
||||
*/
|
||||
virtual void blend (const IAnimatedValue& value, float blendFactor) =0;
|
||||
|
||||
/**
|
||||
* An assignation method. This method assign a value to the object.
|
||||
*
|
||||
* \param value is the new value.
|
||||
*/
|
||||
virtual void affect (const IAnimatedValue& value) =0;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* A template implementation of IAnimatedValue.
|
||||
*
|
||||
* \author Cyril 'Hulud' Corvazier
|
||||
* \author Nevrax France
|
||||
* \date 2001
|
||||
*/
|
||||
template<class T>
|
||||
class CAnimatedValueBlendable : public IAnimatedValue
|
||||
{
|
||||
public:
|
||||
// NOT TESTED, JUST COMPILED. FOR PURPOSE ONLY.
|
||||
/// A default blend method. Doesn't work for all type.
|
||||
virtual void blend (const IAnimatedValue& value, float blendFactor)
|
||||
{
|
||||
// Check types of value. typeid is slow, assert only in debug
|
||||
#ifdef NL_DEBUG
|
||||
nlassert (typeid (value)==typeid(*this));
|
||||
#endif
|
||||
|
||||
// Cast
|
||||
CAnimatedValueBlendable<T> *pValue=(CAnimatedValueBlendable<T>*)&value;
|
||||
|
||||
// Blend
|
||||
Value=(T) (Value*blendFactor+pValue->Value*(1.f-blendFactor));
|
||||
}
|
||||
|
||||
/**
|
||||
* An assignation method. This method assign a value to the object.
|
||||
*
|
||||
* \param value is the new value.
|
||||
*/
|
||||
virtual void affect (const IAnimatedValue& value)
|
||||
{
|
||||
// Check types of value. typeid is slow, assert only in debug
|
||||
#ifdef NL_DEBUG
|
||||
nlassert (typeid (value)==typeid(*this));
|
||||
#endif
|
||||
|
||||
// Cast
|
||||
CAnimatedValueBlendable<T> *pValue=(CAnimatedValueBlendable<T>*)&value;
|
||||
|
||||
// Blend
|
||||
Value=pValue->Value;
|
||||
}
|
||||
|
||||
// The value read and write
|
||||
T Value;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A QUATERNION implementation of IAnimatedValue.
|
||||
*
|
||||
* \author Cyril 'Hulud' Corvazier
|
||||
* \author Nevrax France
|
||||
* \date 2001
|
||||
*/
|
||||
template<> class CAnimatedValueBlendable<NLMISC::CQuat> : public IAnimatedValue
|
||||
{
|
||||
public:
|
||||
/// A quat blend method.
|
||||
virtual void blend (const IAnimatedValue& value, float blendFactor)
|
||||
{
|
||||
// Check types of value. typeid is slow, assert only in debug
|
||||
#ifdef NL_DEBUG
|
||||
nlassert (typeid (value)==typeid(*this));
|
||||
#endif
|
||||
|
||||
// Cast.
|
||||
CAnimatedValueBlendable<NLMISC::CQuat> *pValue=(CAnimatedValueBlendable<NLMISC::CQuat>*)&value;
|
||||
|
||||
// blend.
|
||||
// Yoyo: no makeClosest is done, because the result seems to be better when done
|
||||
// before: for all blend values, and not one after one.
|
||||
Value= NLMISC::CQuat::slerp(Value, pValue->Value, 1-blendFactor);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* An assignation method. This method assign a value to the object.
|
||||
*
|
||||
* \param value is the new value.
|
||||
*/
|
||||
virtual void affect (const IAnimatedValue& value)
|
||||
{
|
||||
// Check types of value. typeid is slow, assert only in debug
|
||||
#ifdef NL_DEBUG
|
||||
nlassert (typeid (value)==typeid(*this));
|
||||
#endif
|
||||
|
||||
// Cast
|
||||
CAnimatedValueBlendable<NLMISC::CQuat> *pValue=(CAnimatedValueBlendable<NLMISC::CQuat>*)&value;
|
||||
|
||||
// Blend
|
||||
Value=pValue->Value;
|
||||
}
|
||||
|
||||
// The value
|
||||
NLMISC::CQuat Value;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* A CRGBA implementation of IAnimatedValue.
|
||||
*
|
||||
* \author Cyril 'Hulud' Corvazier
|
||||
* \author Nevrax France
|
||||
* \date 2001
|
||||
*/
|
||||
template<> class CAnimatedValueBlendable<NLMISC::CRGBA> : public IAnimatedValue
|
||||
{
|
||||
public:
|
||||
/// A quat blend method.
|
||||
virtual void blend (const IAnimatedValue& value, float blendFactor)
|
||||
{
|
||||
// Check types of value. typeid is slow, assert only in debug
|
||||
#ifdef NL_DEBUG
|
||||
nlassert (typeid (value)==typeid(*this));
|
||||
#endif
|
||||
|
||||
// Cast.
|
||||
CAnimatedValueBlendable<NLMISC::CRGBA> *pValue=(CAnimatedValueBlendable<NLMISC::CRGBA>*)&value;
|
||||
|
||||
// blend.
|
||||
Value.blendFromui (pValue->Value, this->Value, (uint)(256.f*blendFactor));
|
||||
}
|
||||
|
||||
/**
|
||||
* An assignation method. This method assign a value to the object.
|
||||
*
|
||||
* \param value is the new value.
|
||||
*/
|
||||
virtual void affect (const IAnimatedValue& value)
|
||||
{
|
||||
// Check types of value. typeid is slow, assert only in debug
|
||||
#ifdef NL_DEBUG
|
||||
nlassert (typeid (value)==typeid(*this));
|
||||
#endif
|
||||
|
||||
// Cast
|
||||
CAnimatedValueBlendable<NLMISC::CRGBA> *pValue=(CAnimatedValueBlendable<NLMISC::CRGBA>*)&value;
|
||||
|
||||
// Blend
|
||||
Value=pValue->Value;
|
||||
}
|
||||
|
||||
// The value
|
||||
NLMISC::CRGBA Value;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* A template implementation of IAnimatedValue not blendable.
|
||||
*
|
||||
* \author Cyril 'Hulud' Corvazier
|
||||
* \author Nevrax France
|
||||
* \date 2001
|
||||
*/
|
||||
template<class T>
|
||||
class CAnimatedValueNotBlendable : public IAnimatedValue
|
||||
{
|
||||
public:
|
||||
/// A default blend method. Doesn't work for all type.
|
||||
virtual void blend (const IAnimatedValue& value, float blendFactor)
|
||||
{
|
||||
// Check types of value. typeid is slow, assert only in debug
|
||||
#ifdef NL_DEBUG
|
||||
nlassert (typeid (value)==typeid(*this));
|
||||
#endif
|
||||
|
||||
// Cast
|
||||
CAnimatedValueNotBlendable<T> *pValue=(CAnimatedValueNotBlendable<T>*)&value;
|
||||
|
||||
// Boolean blend
|
||||
if (blendFactor<0.5f)
|
||||
Value=pValue->Value;
|
||||
}
|
||||
|
||||
/**
|
||||
* An assignation method. This method assign a value to the object.
|
||||
*
|
||||
* \param value is the new value.
|
||||
*/
|
||||
virtual void affect (const IAnimatedValue& value)
|
||||
{
|
||||
// Check types of value. typeid is slow, assert only in debug
|
||||
#ifdef NL_DEBUG
|
||||
nlassert (typeid (value)==typeid(*this));
|
||||
#endif
|
||||
|
||||
// Cast
|
||||
CAnimatedValueNotBlendable<T> *pValue=(CAnimatedValueNotBlendable<T>*)&value;
|
||||
|
||||
// Blend
|
||||
Value=pValue->Value;
|
||||
}
|
||||
|
||||
// The value
|
||||
T Value;
|
||||
};
|
||||
|
||||
|
||||
typedef CAnimatedValueNotBlendable<bool> CAnimatedValueBool;
|
||||
typedef CAnimatedValueBlendable<sint32> CAnimatedValueInt;
|
||||
typedef CAnimatedValueBlendable<float> CAnimatedValueFloat;
|
||||
typedef CAnimatedValueBlendable<NLMISC::CVector> CAnimatedValueVector;
|
||||
typedef CAnimatedValueNotBlendable<std::string> CAnimatedValueString;
|
||||
typedef CAnimatedValueBlendable<NLMISC::CQuat> CAnimatedValueQuat;
|
||||
typedef CAnimatedValueBlendable<NLMISC::CRGBA> CAnimatedValueRGBA;
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
/** This class must contain all the possible AnimatedValue, so the system can work
|
||||
* It is used at ITrack evaluation to fill one of these values
|
||||
*/
|
||||
class CAnimatedValueBlock
|
||||
{
|
||||
public:
|
||||
CAnimatedValueBool ValBool;
|
||||
CAnimatedValueInt ValInt;
|
||||
CAnimatedValueFloat ValFloat;
|
||||
CAnimatedValueVector ValVector;
|
||||
CAnimatedValueString ValString;
|
||||
CAnimatedValueQuat ValQuat;
|
||||
CAnimatedValueRGBA ValRGBA;
|
||||
};
|
||||
|
||||
|
||||
} // NL3D
|
||||
|
||||
|
||||
#endif // NL_ANIMATED_VALUE_H
|
||||
|
||||
/* End of animated_value.h */
|
208
code/nel/include/nel/3d/animation.h
Normal file
208
code/nel/include/nel/3d/animation.h
Normal file
|
@ -0,0 +1,208 @@
|
|||
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef NL_ANIMATION_H
|
||||
#define NL_ANIMATION_H
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
|
||||
#include "nel/3d/animation_time.h"
|
||||
#include "nel/3d/u_animation.h"
|
||||
|
||||
#include <memory>
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
namespace NLMISC
|
||||
{
|
||||
class IStream;
|
||||
struct EStream;
|
||||
}
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
class ITrack;
|
||||
class CAnimationSet;
|
||||
|
||||
/**
|
||||
* This class describes animations for several tracks. Each track works
|
||||
* with a IAnimatedValue for the IAnimatable objects.
|
||||
*
|
||||
* \author Cyril 'Hulud' Corvazier
|
||||
* \author Nevrax France
|
||||
* \date 2001
|
||||
*/
|
||||
class CAnimation : public UAnimation
|
||||
{
|
||||
public:
|
||||
/// ctor
|
||||
CAnimation();
|
||||
/// Destructor
|
||||
virtual ~CAnimation ();
|
||||
|
||||
/// \name Public interface.
|
||||
|
||||
enum { NotFound=0xffffffff };
|
||||
|
||||
/** Get track with its name.
|
||||
*
|
||||
* WARNING: slower if applyAnimHeaderCompression() has been called. try use getIdTrackByChannelId() instead
|
||||
*
|
||||
* \param name is the name of the desired track.
|
||||
* \return CAnimation::NotFound if the track doesn't exist else the id of the track.
|
||||
*/
|
||||
uint getIdTrackByName (const std::string& name) const;
|
||||
|
||||
/**
|
||||
* Fill the set of string with the name of the channels.
|
||||
*
|
||||
* \return the count of track in this animation
|
||||
*/
|
||||
void getTrackNames (std::set<std::string>& setString) const;
|
||||
|
||||
/** see applyAnimHeaderCompression()
|
||||
* \return CAnimation::NotFound if the track doesn't exist (or anim header not compressed)
|
||||
* else return the id of the track.
|
||||
*/
|
||||
uint getIdTrackByChannelId (uint16 channelId) const;
|
||||
|
||||
/** Get a const track pointer
|
||||
*
|
||||
* \param channelId is the id of the desired channel.
|
||||
*/
|
||||
const ITrack* getTrack (uint trackId) const
|
||||
{
|
||||
// Get the trackId-th track pointer
|
||||
return _TrackVector[trackId];
|
||||
}
|
||||
|
||||
/** Get a track pointer
|
||||
*
|
||||
* \param channelId is the id of the desired channel.
|
||||
*/
|
||||
ITrack* getTrack (uint trackId)
|
||||
{
|
||||
// Get the trackId-th track pointer
|
||||
return _TrackVector[trackId];
|
||||
}
|
||||
|
||||
/** Add a track at the end of the track list.
|
||||
*
|
||||
* This method is used to insert tracks in the animation.
|
||||
* Tracks must be allocated with new. The pointer is then handeled
|
||||
* by the CAnimation.
|
||||
*/
|
||||
void addTrack (const std::string& name, ITrack* pChannel);
|
||||
|
||||
/// Serial the template
|
||||
void serial (NLMISC::IStream& f);
|
||||
|
||||
/// Set animation min end time
|
||||
void setMinEndTime (TAnimationTime minEndTime);
|
||||
|
||||
/// \name From UAnimation
|
||||
// @{
|
||||
|
||||
virtual UTrack* getTrackByName (const char* name);
|
||||
virtual void releaseTrack (UTrack* track);
|
||||
virtual TAnimationTime getBeginTime () const;
|
||||
virtual TAnimationTime getEndTime () const;
|
||||
virtual bool allTrackLoop() const;
|
||||
|
||||
// @}
|
||||
|
||||
|
||||
/** For SkeletonSpawnScript (SSS) animation.
|
||||
* Add manualy the shapes that can be spawned by the channel "spawn_script" in this animation
|
||||
* This add into a vector (avoid duplicates)
|
||||
*
|
||||
* Then CAnimationSet::preloadSSSShapes() can be used after CAnimationSet::build() to force loading
|
||||
* into the ShapeBank/Texture of thoses shapes, so there is no problem of shape loading during animation
|
||||
*/
|
||||
void addSSSShape(const std::string &shape);
|
||||
const std::vector<std::string> &getSSSShapes() const {return _SSSShapes;}
|
||||
|
||||
|
||||
/// \name CAnimationSet private
|
||||
// @{
|
||||
/** For each track that support it (CTrackSampled for instance), divide its number of sampled keys,
|
||||
* to lower the memory lod. Used typically by CAnimationSet
|
||||
*/
|
||||
void applySampleDivisor(uint sampleDivisor);
|
||||
|
||||
/** For CTrackSampledQuat only, compress header. Used typically by CAnimationSet
|
||||
* NB: Animation cannot be serialized after this operation (unserialisable tracks)
|
||||
*/
|
||||
void applyTrackQuatHeaderCompression();
|
||||
|
||||
/** Used by CAnimationSet to lower the memory Size. After this, you can
|
||||
* (and should for better performances) use getIdTrackByChannelId()
|
||||
* Does not support more than 65536 channels (nlassert)
|
||||
*/
|
||||
void applyAnimHeaderCompression(CAnimationSet *animationSetOwner, const std::map <std::string, uint32> &channelMap);
|
||||
|
||||
// @}
|
||||
|
||||
|
||||
private:
|
||||
/// \name Members
|
||||
typedef std::map<std::string, uint32> TMapStringUInt;
|
||||
typedef std::vector<ITrack* > TVectAPtrTrack;
|
||||
|
||||
// Animation name
|
||||
std::string _Name;
|
||||
|
||||
// Map to get a channel id with a name. EMPTY if applyAnimHeaderCompression() called
|
||||
TMapStringUInt _IdByName;
|
||||
|
||||
// Vector of channel pointer.
|
||||
TVectAPtrTrack _TrackVector;
|
||||
|
||||
// Force animation min end time
|
||||
TAnimationTime _MinEndTime;
|
||||
|
||||
/// \name Anim time caching
|
||||
// @{
|
||||
mutable TAnimationTime _BeginTime;
|
||||
mutable TAnimationTime _EndTime;
|
||||
mutable bool _AnimLoop;
|
||||
mutable bool _BeginTimeTouched;
|
||||
mutable bool _EndTimeTouched;
|
||||
mutable bool _AnimLoopTouched;
|
||||
// @}
|
||||
|
||||
/// CTrackSampledQuat header compression
|
||||
class CTrackSamplePack *_TrackSamplePack;
|
||||
|
||||
// Sorted array of ChannelId. Same size as _TrackVector. EMPTY if applyAnimHeaderCompression() NOT called
|
||||
std::vector<uint16> _IdByChannelId;
|
||||
// The AnimationSet. NULL if applyAnimHeaderCompression() NOT called
|
||||
class CAnimationSet *_AnimationSetOwner;
|
||||
|
||||
// see addSSSShape()
|
||||
std::vector<std::string> _SSSShapes;
|
||||
|
||||
};
|
||||
|
||||
|
||||
} // NL3D
|
||||
|
||||
|
||||
#endif // NL_ANIMATION_H
|
||||
|
||||
/* End of animation.h */
|
187
code/nel/include/nel/3d/animation_optimizer.h
Normal file
187
code/nel/include/nel/3d/animation_optimizer.h
Normal file
|
@ -0,0 +1,187 @@
|
|||
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef NL_ANIMATION_OPTIMIZER_H
|
||||
#define NL_ANIMATION_OPTIMIZER_H
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/quat.h"
|
||||
#include "nel/misc/vectord.h"
|
||||
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
using NLMISC::CQuat;
|
||||
using NLMISC::CQuatD;
|
||||
using NLMISC::CVector;
|
||||
using NLMISC::CVectorD;
|
||||
|
||||
class CAnimation;
|
||||
class ITrack;
|
||||
|
||||
// ***************************************************************************
|
||||
/**
|
||||
* Purpose of this class is to optimize for memory and speed a CAnimation.
|
||||
* Quaternion tracks are optimized. They are transformed to CTrackSampledQuat or CTrackDefaultQuat.
|
||||
* Vector tracks are optimized. They are transformed to CTrackSampledVector or CTrackDefaultVector.
|
||||
* \author Lionel Berenguier
|
||||
* \author Nevrax France
|
||||
* \date 2002
|
||||
*/
|
||||
class CAnimationOptimizer
|
||||
{
|
||||
public:
|
||||
|
||||
/// Constructor
|
||||
CAnimationOptimizer();
|
||||
|
||||
/** Set the Quaternion Error Thresholds. must be >=0.
|
||||
* Default is 0.0001 and 0.000001. Above this value, 2 quaternions are said different.
|
||||
* NB: comparing 2 quaternions is made by multiplying the one with the inverse of the other.
|
||||
* the W component is then tested and must be >1-threshold (modulo sign) to conclude to equality.
|
||||
* Since quat.W=cos(angle/2), you can deduce the angle threshold with angleThre=acos(1-thre)*2
|
||||
*
|
||||
* Give 2 values, one For Low precision and High precision. Default setup use high precision. Use
|
||||
* addLowPrecisionTrack() to drive low precision tracks.
|
||||
*/
|
||||
void setQuaternionThreshold(double lowPrecThre, double highPrecThre);
|
||||
|
||||
/** Same principle as for setQuaternionThreshold(), but for vector tracks (positions/scale).
|
||||
* Default is 0.001 and 0.0001. Above this value, 2 vectors are said different.
|
||||
* NB: comparing 2 vectors is made by geting the norm of the difference
|
||||
*
|
||||
* Give 2 values, one For Low precision and High precision. Default setup use high precision. Use
|
||||
* addLowPrecisionTrack() to drive low precision tracks.
|
||||
*/
|
||||
void setVectorThreshold(double lowPrecThre, double highPrecThre);
|
||||
|
||||
/** see setQuaternionThreshold(). Any track which contains this name will be considered as a
|
||||
* low precision track. Default setup is empty, so all tracks are "high precision" tracks.
|
||||
* A good setup is for example addLowPrecisionTrack("Finger") and addLowPrecisionTrack("Ponytail")
|
||||
* Warning: case sensitive
|
||||
*/
|
||||
void addLowPrecisionTrack(const std::string &name);
|
||||
|
||||
/// see addLowPrecisionTrack. This clears the array.
|
||||
void clearLowPrecisionTracks();
|
||||
|
||||
/** Set the Sample Frame Rate (>0)
|
||||
* Default is 30 fps. NB: final numSamples must be <65535, else assert at optimize() time.
|
||||
*/
|
||||
void setSampleFrameRate(float frameRate);
|
||||
|
||||
|
||||
/** optimize an animation
|
||||
* animOut is the same as animIn, but optimized.
|
||||
* If a track can't be optimized, it is just duplicated in animOut.
|
||||
*/
|
||||
void optimize(const CAnimation &animIn, CAnimation &animOut);
|
||||
|
||||
|
||||
// ******************
|
||||
private:
|
||||
float _SampleFrameRate;
|
||||
double _QuaternionThresholdLowPrec;
|
||||
double _QuaternionThresholdHighPrec;
|
||||
double _QuaternionThreshold;
|
||||
double _VectorThresholdLowPrec;
|
||||
double _VectorThresholdHighPrec;
|
||||
double _VectorThreshold;
|
||||
|
||||
|
||||
// see addLowPrecisionTrack
|
||||
std::vector<std::string> _LowPrecTrackKeyName;
|
||||
|
||||
// For Sampling of Quaternion Tracks.
|
||||
std::vector<uint16> _TimeList;
|
||||
std::vector<CQuat> _QuatKeyList;
|
||||
|
||||
// For Sampling of Vector Tracks.
|
||||
std::vector<CVector> _VectorKeyList;
|
||||
|
||||
private:
|
||||
|
||||
// Clone a ITrack (using a CMemStream)
|
||||
ITrack *cloneTrack(const ITrack *trackIn);
|
||||
|
||||
// true if the track can be optimized.
|
||||
bool isTrackOptimisable(const ITrack *trackIn);
|
||||
|
||||
// return an optimized version of trackIn. Type returned should be different (eg: CTrackSampledQuat)
|
||||
ITrack *optimizeTrack(const ITrack *trackIn);
|
||||
|
||||
// see addLowPrecisionTrack()
|
||||
bool isLowPrecisionTrack(const std::string &trackName);
|
||||
|
||||
|
||||
/// Quaternion optimisation.
|
||||
// @{
|
||||
|
||||
/** sample the track from beginTime to endTime, sample to numSamples, such that
|
||||
* key[0].Time==beginTime and key[numSamples-1].Time==endTime.
|
||||
* NB: quaternions are normalized, and are makeClosest()-ed from sample to the next.
|
||||
*/
|
||||
void sampleQuatTrack(const ITrack *trackIn, float beginTime, float endTime, uint numSamples);
|
||||
|
||||
/** Test if the current track is constant (ie always same quaternion value)
|
||||
* NB: test if q==qRef or q==-qRef of course.
|
||||
*/
|
||||
bool testConstantQuatTrack();
|
||||
|
||||
/** optimze the current track
|
||||
*/
|
||||
void optimizeQuatTrack();
|
||||
|
||||
/** return true if suppose same quaternion. NB: quaternion must be normalized.
|
||||
* NB: test if quat1==quat0 or quat1==-quat0 of course.
|
||||
*/
|
||||
bool nearlySameQuaternion(const CQuatD &quat0, const CQuatD &quat1);
|
||||
|
||||
// @}
|
||||
|
||||
|
||||
/// Vector optimisation.
|
||||
// @{
|
||||
|
||||
/** sample the track from beginTime to endTime, sample to numSamples, such that
|
||||
* key[0].Time==beginTime and key[numSamples-1].Time==endTime.
|
||||
*/
|
||||
void sampleVectorTrack(const ITrack *trackIn, float beginTime, float endTime, uint numSamples);
|
||||
|
||||
/** Test if the current track is constant (ie always same Vector value)
|
||||
*/
|
||||
bool testConstantVectorTrack();
|
||||
|
||||
/** optimze the current track
|
||||
*/
|
||||
void optimizeVectorTrack();
|
||||
|
||||
/** return true if suppose same vector.
|
||||
*/
|
||||
bool nearlySameVector(const CVectorD &v0, const CVectorD &v1);
|
||||
|
||||
// @}
|
||||
|
||||
};
|
||||
|
||||
|
||||
} // NL3D
|
||||
|
||||
|
||||
#endif // NL_ANIMATION_OPTIMIZER_H
|
||||
|
||||
/* End of animation_optimizer.h */
|
304
code/nel/include/nel/3d/animation_playlist.h
Normal file
304
code/nel/include/nel/3d/animation_playlist.h
Normal file
|
@ -0,0 +1,304 @@
|
|||
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef NL_ANIMATION_PLAYLIST_H
|
||||
#define NL_ANIMATION_PLAYLIST_H
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/3d/channel_mixer.h"
|
||||
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* This class
|
||||
* \author Cyril 'Hulud' Corvazier
|
||||
* \author Nevrax France
|
||||
* \date 2001
|
||||
*/
|
||||
class CAnimationPlaylist : public NLMISC::CRefCount
|
||||
{
|
||||
public:
|
||||
enum
|
||||
{
|
||||
//
|
||||
empty=0xffffffff
|
||||
};
|
||||
|
||||
/// Wrap mode for the play list
|
||||
enum TWrapMode
|
||||
{
|
||||
/// Clamp the animation time. (default)
|
||||
Clamp=0,
|
||||
|
||||
/// Repeat the animation.
|
||||
Repeat,
|
||||
|
||||
/// Disable the animation.
|
||||
Disable,
|
||||
|
||||
WrapModeCount
|
||||
};
|
||||
|
||||
/// Constructor
|
||||
CAnimationPlaylist();
|
||||
|
||||
/**
|
||||
* Empty the playlist. Each slot is set to its default value.
|
||||
*/
|
||||
void emptyPlayList ();
|
||||
|
||||
/**
|
||||
* Set the animation of a slot. Default value is empty.
|
||||
*
|
||||
* \param slot is the id of the slot to set.
|
||||
* \param animation is the animation number to use in this slot. To empty the slot, use CAnimationPlaylist::empty.
|
||||
*/
|
||||
void setAnimation (uint8 slot, uint animation);
|
||||
|
||||
/**
|
||||
* Get the animation of a slot. Default value is empty.
|
||||
*
|
||||
* \param slot is the id of the slot to set.
|
||||
* \return the animation number in use in this slot. Return CAnimationPlaylist::empty if the slot is empty.
|
||||
*/
|
||||
uint getAnimation (uint8 slot) const;
|
||||
|
||||
/**
|
||||
* Set the skeleton weight animation of a slot. Default value is empty.
|
||||
*
|
||||
* \param slot is the id of the slot to set.
|
||||
* \param skeletonId is the skeleton weight number to use in this slot. To empty the slot, use CAnimationPlaylist::empty.
|
||||
* \param inverted is false if the weights must be used as they are, true if the weights to used are 1.f - weight.
|
||||
*/
|
||||
void setSkeletonWeight (uint8 slot, uint skeletonId, bool inverted=false);
|
||||
|
||||
/**
|
||||
* Get the skeleton weight of a slot. Default value is empty.
|
||||
*
|
||||
* \param slot is the id of the slot to set.
|
||||
* \param inverted will receive the invert flag.
|
||||
* \return the skeleton weight number in use in this slot. Return CAnimationPlaylist::empty if the slot is empty.
|
||||
*/
|
||||
uint getSkeletonWeight (uint8 slot, bool &inverted) const;
|
||||
|
||||
/**
|
||||
* Set animation time origin, ie, the time in the playlist for which slot time is the startTime of the slot animation.
|
||||
* Default value is 0.f.
|
||||
*
|
||||
* \param slot is the id of the slot to set.
|
||||
* \param timeOrigin time origin to use in the slot.
|
||||
*/
|
||||
void setTimeOrigin (uint8 slot, TGlobalAnimationTime timeOrigin);
|
||||
|
||||
/**
|
||||
* Get animation time origin, ie, the time in the playlist for which slot time is the startTime of the slot animation.
|
||||
* Default value is 0.f.
|
||||
*
|
||||
* \param slot is the id to get the slot.
|
||||
* \return time origin used in the slot.
|
||||
*/
|
||||
TGlobalAnimationTime getTimeOrigin (uint8 slot) const;
|
||||
|
||||
/**
|
||||
* Set animation speed factor.
|
||||
* Default value is 1.f.
|
||||
*
|
||||
* \param slot is the id of the slot to set.
|
||||
* \param speedFactor is the factor to use in this slot. The animation will go speedFactor* faster.
|
||||
*/
|
||||
void setSpeedFactor (uint8 slot, float speedFactor);
|
||||
|
||||
/**
|
||||
* Get animation speed factor.
|
||||
* Default value is 1.f.
|
||||
*
|
||||
* \param slot is the id to get the slot.
|
||||
* \return the speed factor used in the slot.
|
||||
*/
|
||||
float getSpeedFactor (uint8 slot) const;
|
||||
|
||||
/**
|
||||
* Set animation start weight. This is the weight for this animation use at the beginning of the animation slot.
|
||||
* Default value is 1.f.
|
||||
*
|
||||
* \param slot is the id of the slot to set.
|
||||
* \param startWeight is the factor to use in this slot.
|
||||
* \param time is the playlist time for which the start weight is set. Default is 0.f.
|
||||
*/
|
||||
void setStartWeight (uint8 slot, float startWeight, TGlobalAnimationTime time);
|
||||
|
||||
/**
|
||||
* Get animation start weight.
|
||||
* Default value is 1.f.
|
||||
*
|
||||
* \param slot is the id to get the slot.
|
||||
* \param time will get the playlist time for which the start weight is set. Default time is 0.f.
|
||||
* \return the start weight used in the slot.
|
||||
*/
|
||||
float getStartWeight (uint8 slot, TGlobalAnimationTime& time) const;
|
||||
|
||||
/**
|
||||
* Set animation end weight. This is the weight for this animation use at the end of the animation slot.
|
||||
* Default value is 1.f.
|
||||
*
|
||||
* \param slot is the id of the slot to set.
|
||||
* \param time is the playlist time for which the end weight is set. Default time is 0.f.
|
||||
* \param endWeight is the factor to use in this slot.
|
||||
*/
|
||||
void setEndWeight (uint8 slot, float endWeight, TGlobalAnimationTime time);
|
||||
|
||||
/**
|
||||
* Get animation end weight.
|
||||
* Default value is 1.f.
|
||||
*
|
||||
* \param slot is the id to get the slot.
|
||||
* \param time will get the playlist time for which the start weight is set. Default is 0.f.
|
||||
* \return the end weight used in the slot.
|
||||
*/
|
||||
float getEndWeight (uint8 slot, TGlobalAnimationTime& time) const;
|
||||
|
||||
/**
|
||||
* Set weight smoothness.
|
||||
* This is the smoothness of the weight interpolation.
|
||||
* Must be between 0.f and 1.f. 0.f is a sharp interpolation (linear), 1.f is a smooth interpolation (quadratic).
|
||||
* Default value is 0.f.
|
||||
*
|
||||
* \param slot is the id of the slot to set.
|
||||
* \param smoothness is the smoothness value.
|
||||
*/
|
||||
void setWeightSmoothness (uint8 slot, float smoothness);
|
||||
|
||||
/**
|
||||
* Get weight smoothness.
|
||||
* This is the smoothness of the weight interpolation.
|
||||
* Must be between 0.f and 1.f. 0.f is a sharp interpolation (linear), 1.f is a smooth interpolation (quadratic).
|
||||
* Default value is 0.f.
|
||||
*
|
||||
* \param slot is the id of the slot to set.
|
||||
* \return the smoothness value.
|
||||
*/
|
||||
float getWeightSmoothness (uint8 slot) const;
|
||||
|
||||
/**
|
||||
* Setup a channel mixer.
|
||||
*
|
||||
* For each slot, it sets :
|
||||
* * the animation id used by the slot.
|
||||
* * the animation time according with the begin time of each slot, the speed factor of each slot and the current time passed in parameter.
|
||||
* * the skeleton weight id.
|
||||
* * the weight interpolated with the start and end values. The weight value are clamped before and after the animation.
|
||||
*/
|
||||
void setupMixer (CChannelMixer& mixer, TGlobalAnimationTime time) const;
|
||||
|
||||
/**
|
||||
* Static interpolation method of blend value
|
||||
*
|
||||
* \param startBlendTime is the time when the blend starts.
|
||||
* \param endBlendTime is the time when the blend ends.
|
||||
* \param time is the current time.
|
||||
* \param startBlend is the blend value at start.
|
||||
* \param endBlend is the blend value at end.
|
||||
* \param smoothness is the smoothnes value. (Must be between 0 and 1)
|
||||
*/
|
||||
static float getWeightValue (TGlobalAnimationTime startWeightTime, TGlobalAnimationTime endWeightTime, TGlobalAnimationTime time, float startWeight, float endWeight, float smoothness);
|
||||
|
||||
/**
|
||||
* Set the wrap mode to use in the play list.
|
||||
*
|
||||
* Wrap mode tells the play list how to use an animation when current time is not in the animation.
|
||||
* \param wrapMode is the mode to use.
|
||||
*/
|
||||
void setWrapMode (uint8 slot, TWrapMode wrapMode);
|
||||
|
||||
/**
|
||||
* Get the wrap mode in use in the play list.
|
||||
*
|
||||
* Wrap mode tells the play list how to use an animation when current time is not in the animation.
|
||||
* \return the wrap mode in use.
|
||||
*/
|
||||
TWrapMode getWrapMode (uint8 slot) const;
|
||||
|
||||
/**
|
||||
* Convert a playlist global time in local time in a slot animation including wrap evaluation.
|
||||
*
|
||||
* \param slot is the slot in which the local time must be computed
|
||||
* \param time is the global time of the playlist
|
||||
*
|
||||
* \return the local time in the slot. If no animation are set in the slot, globalTime is returned.
|
||||
*/
|
||||
TAnimationTime getLocalTime (uint8 slot, TGlobalAnimationTime globalTime, const CAnimationSet& animSet) const;
|
||||
|
||||
/**
|
||||
* Compute weight of a slot at a given global playlist time
|
||||
*
|
||||
* \param slot is the slot in which the weight must be computed
|
||||
* \param time is the global time of the playlist
|
||||
*
|
||||
* \return the weight of the slot for the given time.
|
||||
*/
|
||||
float getLocalWeight (uint8 slot, TGlobalAnimationTime globalTime) const;
|
||||
|
||||
/**
|
||||
* Serial
|
||||
*/
|
||||
void serial (NLMISC::IStream& f);
|
||||
|
||||
private:
|
||||
|
||||
// Animation in slot
|
||||
uint32 _Animations[CChannelMixer::NumAnimationSlot];
|
||||
|
||||
// Skeleton weight in slot
|
||||
uint32 _SkeletonWeight[CChannelMixer::NumAnimationSlot];
|
||||
|
||||
// Invert Skeleton weight in slot
|
||||
bool _InvertWeight[CChannelMixer::NumAnimationSlot];
|
||||
|
||||
// Time origin in slot
|
||||
TGlobalAnimationTime _TimeOrigin[CChannelMixer::NumAnimationSlot];
|
||||
|
||||
// Speed factor in slot
|
||||
float _SpeedFactor[CChannelMixer::NumAnimationSlot];
|
||||
|
||||
// Start weight
|
||||
float _StartWeight[CChannelMixer::NumAnimationSlot];
|
||||
|
||||
// Start weight time
|
||||
TGlobalAnimationTime _StartWeightTime[CChannelMixer::NumAnimationSlot];
|
||||
|
||||
// End weight
|
||||
float _EndWeight[CChannelMixer::NumAnimationSlot];
|
||||
|
||||
// End weight time
|
||||
TGlobalAnimationTime _EndWeightTime[CChannelMixer::NumAnimationSlot];
|
||||
|
||||
// Smoothness of the weight interpolation
|
||||
float _Smoothness[CChannelMixer::NumAnimationSlot];
|
||||
|
||||
// Wrap mode
|
||||
TWrapMode _WrapMode[CChannelMixer::NumAnimationSlot];
|
||||
};
|
||||
|
||||
|
||||
} // NL3D
|
||||
|
||||
|
||||
#endif // NL_ANIMATION_PLAYLIST_H
|
||||
|
||||
/* End of animation_playlist.h */
|
287
code/nel/include/nel/3d/animation_set.h
Normal file
287
code/nel/include/nel/3d/animation_set.h
Normal file
|
@ -0,0 +1,287 @@
|
|||
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef NL_ANIMATION_SET_H
|
||||
#define NL_ANIMATION_SET_H
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/3d/animation.h"
|
||||
#include "nel/3d/skeleton_weight.h"
|
||||
#include "nel/misc/smart_ptr.h"
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace NLMISC
|
||||
{
|
||||
class IStream;
|
||||
struct EStream;
|
||||
}
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
class IDriver;
|
||||
class CShapeBank;
|
||||
|
||||
/**
|
||||
* An CAnimationSet is set of CAnimation. It manages global channel ID for a set of
|
||||
* animations with many tracks. An Id is associed with each track name.
|
||||
*
|
||||
* \author Cyril 'Hulud' Corvazier
|
||||
* \author Nevrax France
|
||||
* \date 2001
|
||||
*/
|
||||
class CAnimationSet : public NLMISC::CRefCount
|
||||
{
|
||||
public:
|
||||
|
||||
enum { NotFound=0xffffffff };
|
||||
|
||||
/**
|
||||
* \param headerOptim if true, the animationSet cannot be serialized (nlassert), but could save
|
||||
* lot of memory load: CTrackSampleQuat memory are optimized (48 bytes to 12) and map<string, id>
|
||||
* per animation is replaced with a (IdChannelInAnimSet, IdTrackInAnim) association
|
||||
*/
|
||||
CAnimationSet (bool headerOptim= false);
|
||||
~CAnimationSet ();
|
||||
|
||||
/**
|
||||
* Get channel ID count. This number is the count of different track name in the animation set.
|
||||
*/
|
||||
uint getNumChannelId () const;
|
||||
|
||||
/** Get a channel Name by its Id.
|
||||
*/
|
||||
const std::string &getChannelName(uint channelId) const
|
||||
{
|
||||
nlassert(channelId<_ChannelName.size());
|
||||
return _ChannelName[channelId];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a channel ID with its name. If no channel is found, method returns NotFound.
|
||||
*/
|
||||
uint getChannelIdByName (const std::string& name) const
|
||||
{
|
||||
// Look for an id with this name
|
||||
std::map <std::string, uint32>::const_iterator ite=_ChannelIdByName.find (name);
|
||||
if (ite!=_ChannelIdByName.end ())
|
||||
return ite->second;
|
||||
else
|
||||
return NotFound;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a animation ID by name. If no channel is found, method returns NotFound.
|
||||
*/
|
||||
uint getAnimationIdByName (const std::string& name) const
|
||||
{
|
||||
// Look for an id with this name
|
||||
std::map <std::string, uint32>::const_iterator ite=_AnimationIdByName.find (name);
|
||||
if (ite!=_AnimationIdByName.end ())
|
||||
return ite->second;
|
||||
else
|
||||
return NotFound;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get animations count.
|
||||
*/
|
||||
uint getNumAnimation () const
|
||||
{
|
||||
return (uint)_Animation.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get animation name.
|
||||
*/
|
||||
const std::string& getAnimationName (uint animationId) const
|
||||
{
|
||||
nlassert(animationId<_AnimationName.size());
|
||||
return _AnimationName[animationId];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a read only animation pointer.
|
||||
*/
|
||||
const CAnimation* getAnimation (uint animationId) const
|
||||
{
|
||||
nlassert(animationId<_Animation.size());
|
||||
return _Animation[animationId];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a writable animation pointer.
|
||||
*/
|
||||
CAnimation* getAnimation (uint animationId)
|
||||
{
|
||||
nlassert(animationId<_Animation.size());
|
||||
return _Animation[animationId];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get skeleton weight count.
|
||||
*/
|
||||
uint getNumSkeletonWeight () const
|
||||
{
|
||||
return (uint)_SkeletonWeight.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a skeleton weight ID by name. If no skeleton weight is found, method returns NotFound.
|
||||
*/
|
||||
uint getSkeletonWeightIdByName (const std::string& name) const
|
||||
{
|
||||
// Look for an id with this name
|
||||
std::map <std::string, uint32>::const_iterator ite=_SkeletonWeightIdByName.find (name);
|
||||
if (ite!=_SkeletonWeightIdByName.end ())
|
||||
return ite->second;
|
||||
else
|
||||
return NotFound;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get skeleton template name.
|
||||
*/
|
||||
const std::string& getSkeletonWeightName (uint skeletonId) const
|
||||
{
|
||||
nlassert(skeletonId<_SkeletonWeightName.size());
|
||||
return _SkeletonWeightName[skeletonId];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a read only skeleton weight pointer.
|
||||
*/
|
||||
const CSkeletonWeight* getSkeletonWeight (uint skeletonId) const
|
||||
{
|
||||
nlassert(skeletonId<_SkeletonWeight.size());
|
||||
return _SkeletonWeight[skeletonId];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a writable skeleton weight pointer.
|
||||
*/
|
||||
CSkeletonWeight* getSkeletonWeight (uint skeletonId)
|
||||
{
|
||||
nlassert(skeletonId<_SkeletonWeight.size());
|
||||
return _SkeletonWeight[skeletonId];
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an animation to the set. The pointer of the animation must be allocated with new.
|
||||
* It is then handled by the animation set.
|
||||
*
|
||||
* WARNING: it assert if you call addAnimation() after build(), while the animation set is in HeadOptim mode
|
||||
*
|
||||
* \param name is the name of the animation.
|
||||
* \param animation is the animation pointer.
|
||||
* \return the id of the new animation.
|
||||
*/
|
||||
uint addAnimation (const char* name, CAnimation* animation);
|
||||
|
||||
/**
|
||||
* Add a skeleton weight to the set. The pointer of the skeletonWeight must be allocated with new.
|
||||
* It is then handled by the animation set.
|
||||
*
|
||||
* \return the id of the new skeleton.
|
||||
*/
|
||||
uint addSkeletonWeight (const char* name, CSkeletonWeight* skeletonWeight);
|
||||
|
||||
/**
|
||||
* Reset the animation set.
|
||||
*/
|
||||
void reset ();
|
||||
|
||||
/**
|
||||
* Final build of the animation set.
|
||||
*
|
||||
* First, for each animation you want to add to the set, you must add the animation in the set.
|
||||
*
|
||||
* When all animations are built, call this method to finalize the set.
|
||||
*
|
||||
* NoOp if already built
|
||||
*/
|
||||
void build ();
|
||||
|
||||
/// Serial the template
|
||||
void serial (NLMISC::IStream& f);
|
||||
|
||||
/**
|
||||
* Helper method.
|
||||
* Load an animation set from animation files in a directory, then call build().
|
||||
* \param path Path to look at for animations
|
||||
* \param recurse whether to recurse to load animation in sub folders
|
||||
* \param ext the extension for animation files
|
||||
* \param wantWarningMessage displays warning if some of the files could not be loaded
|
||||
* \return true if everything loaded ok
|
||||
*/
|
||||
bool loadFromFiles
|
||||
(
|
||||
const std::string &path,
|
||||
bool recurse = true,
|
||||
const char *ext = "anim",
|
||||
bool wantWarningMessage = true
|
||||
);
|
||||
|
||||
/** Set the animation Set in "Low Memory" mode by skipping some keys
|
||||
* Each added animation will loose some keys for CTrackSampledQuat and CTrackSampledVector
|
||||
* \param sampleDivisor if set to 5 for instance, the number of keys will be divided (ideally) by 5.
|
||||
* if 0, set to 1. if 1 => no key skip (default to 1)
|
||||
*/
|
||||
void setAnimationSampleDivisor(uint sampleDivisor);
|
||||
|
||||
/** see setAnimationSampleDivisor
|
||||
*/
|
||||
uint getAnimationSampleDivisor() const;
|
||||
|
||||
/// see CAnimationSet ctor
|
||||
bool isAnimHeaderOptimized() const {return _AnimHeaderOptimisation;}
|
||||
|
||||
/** For SkeletonSpawnScript (SSS) animation.
|
||||
* call this after build(). This method preload ALL the shapes/texture
|
||||
* that can be spawned due to any animation
|
||||
*/
|
||||
void preloadSSSShapes(IDriver &drv, CShapeBank &shapeBank);
|
||||
|
||||
|
||||
private:
|
||||
std::vector <CAnimation*> _Animation;
|
||||
std::vector <CSkeletonWeight*> _SkeletonWeight;
|
||||
std::vector <std::string> _ChannelName;
|
||||
std::vector <std::string> _AnimationName;
|
||||
std::vector <std::string> _SkeletonWeightName;
|
||||
std::map <std::string, uint32> _ChannelIdByName;
|
||||
std::map <std::string, uint32> _AnimationIdByName;
|
||||
std::map <std::string, uint32> _SkeletonWeightIdByName;
|
||||
uint _SampleDivisor;
|
||||
bool _AnimHeaderOptimisation;
|
||||
bool _Built;
|
||||
/// All Shapes that can be spawned in any animation
|
||||
std::set<std::string> _SSSShapes;
|
||||
|
||||
|
||||
void buildChannelNameFromMap();
|
||||
|
||||
};
|
||||
|
||||
|
||||
} // NL3D
|
||||
|
||||
|
||||
#endif // NL_ANIMATION_SET_H
|
||||
|
||||
/* End of animation_set.h */
|
239
code/nel/include/nel/3d/animation_set_user.h
Normal file
239
code/nel/include/nel/3d/animation_set_user.h
Normal file
|
@ -0,0 +1,239 @@
|
|||
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef NL_ANIMATION_SET_USER_H
|
||||
#define NL_ANIMATION_SET_USER_H
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/stream.h"
|
||||
#include "nel/misc/smart_ptr.h"
|
||||
#include "nel/misc/file.h"
|
||||
#include "nel/misc/path.h"
|
||||
|
||||
#include "nel/3d/u_animation_set.h"
|
||||
|
||||
#include "nel/3d/animation_set.h"
|
||||
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
|
||||
class CPlayListManagerUser;
|
||||
class CDriverUser;
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
/**
|
||||
* UAnimationSet implementation
|
||||
* \author Lionel Berenguier
|
||||
* \author Nevrax France
|
||||
* \date 2001
|
||||
*/
|
||||
class CAnimationSetUser : public UAnimationSet
|
||||
{
|
||||
private:
|
||||
NLMISC::CSmartPtr<CAnimationSet> _AnimationSet;
|
||||
CDriverUser *_Owner;
|
||||
friend class CPlayListManagerUser;
|
||||
friend class CSceneUser;
|
||||
|
||||
public:
|
||||
|
||||
/// Constructor
|
||||
CAnimationSetUser(CDriverUser *owner, bool headerOptim = true)
|
||||
{
|
||||
nlassert(owner);
|
||||
_Owner= owner;
|
||||
|
||||
nlassert((uint)UAnimationSet::NotFound == (uint)CAnimationSet::NotFound );
|
||||
|
||||
// create a smartptred animation set. Allow header compression
|
||||
_AnimationSet= new CAnimationSet(headerOptim);
|
||||
}
|
||||
|
||||
/// Constructor
|
||||
CAnimationSetUser(CDriverUser *owner, NLMISC::IStream &f)
|
||||
{
|
||||
nlassert(owner);
|
||||
_Owner= owner;
|
||||
|
||||
nlassert((uint)UAnimationSet::NotFound == (uint)CAnimationSet::NotFound );
|
||||
|
||||
// create a smartptred animation set. DO NOT Allow header compression, cause serial()
|
||||
_AnimationSet= new CAnimationSet(false);
|
||||
|
||||
_AnimationSet->serial(f);
|
||||
}
|
||||
|
||||
virtual void setAnimationSampleDivisor(uint sampleDivisor);
|
||||
|
||||
virtual uint getAnimationSampleDivisor() const;
|
||||
|
||||
/**
|
||||
* Add an animation in the animation set. After adding all your animations, call build().
|
||||
*
|
||||
* \param fileName is the animation filename
|
||||
* \param animName is the name of the animation in the animation set.
|
||||
* \return NotFound if the file is not found.
|
||||
*/
|
||||
uint addAnimation (const char* fileName, const char* animName, bool displayMissingFileWarning = true)
|
||||
{
|
||||
// Allocate an animation
|
||||
std::auto_ptr<CAnimation> anim (new CAnimation);
|
||||
|
||||
// Read it
|
||||
NLMISC::CIFile file;
|
||||
std::string path = NLMISC::CPath::lookup (fileName, false, displayMissingFileWarning);
|
||||
if (path.empty())
|
||||
path = fileName;
|
||||
if ( file.open ( path ) )
|
||||
{
|
||||
// Serial the animation
|
||||
file.serial (*anim);
|
||||
|
||||
// Add the animation
|
||||
uint id=_AnimationSet->addAnimation (animName, anim.release());
|
||||
|
||||
// Return id
|
||||
return id;
|
||||
}
|
||||
else return UAnimationSet::NotFound;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the animation set. Call build after adding all your animations.
|
||||
*/
|
||||
virtual void build ();
|
||||
|
||||
/**
|
||||
* Add a skeleton weight in the animation set.
|
||||
* This method use CPath to search the skeleton file.
|
||||
*
|
||||
* \param fileName is the skeleton weight filename
|
||||
* \param animName is the name of the skeleton weight in the animation set.
|
||||
* \return the id of the new skeleton or NotFound if the file is not found.
|
||||
*/
|
||||
virtual uint addSkeletonWeight (const char* fileName, const char* skelName)
|
||||
{
|
||||
// Allocate an animation
|
||||
std::auto_ptr<CSkeletonWeight> skeletonWeight (new CSkeletonWeight);
|
||||
|
||||
// Read it
|
||||
NLMISC::CIFile file;
|
||||
if (file.open ( NLMISC::CPath::lookup( fileName ) ) )
|
||||
{
|
||||
// Serial the animation
|
||||
file.serial (*skeletonWeight);
|
||||
|
||||
// Add the animation
|
||||
uint id=_AnimationSet->addSkeletonWeight (skelName, skeletonWeight.release());
|
||||
|
||||
// Return id
|
||||
return id;
|
||||
}
|
||||
else return UAnimationSet::NotFound;
|
||||
}
|
||||
|
||||
/// \name Animations mgt.
|
||||
// @{
|
||||
/**
|
||||
* Get animations count.
|
||||
*/
|
||||
virtual uint getNumAnimation () const
|
||||
{
|
||||
return _AnimationSet->getNumAnimation();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an animation ID by name. If no animation is found, method returns NotFound.
|
||||
*/
|
||||
virtual uint getAnimationIdByName (const std::string& name) const
|
||||
{
|
||||
return _AnimationSet->getAnimationIdByName(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get animation name.
|
||||
*/
|
||||
virtual const std::string& getAnimationName (uint animationId) const
|
||||
{
|
||||
if(animationId>=getNumAnimation())
|
||||
nlerror("getAnimation*(): bad animation Id");
|
||||
return _AnimationSet->getAnimationName(animationId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a writable animation pointer.
|
||||
*
|
||||
* \return the end time.
|
||||
*/
|
||||
virtual UAnimation* getAnimation (uint animationId);
|
||||
|
||||
// @}
|
||||
|
||||
|
||||
/// \name SkeletonWeight mgt.
|
||||
// @{
|
||||
/**
|
||||
* Get skeleton weight count.
|
||||
*/
|
||||
virtual uint getNumSkeletonWeight () const
|
||||
{
|
||||
return _AnimationSet->getNumSkeletonWeight();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a SkeletonWeight ID by name. If no SkeletonWeight is found, method returns NotFound.
|
||||
*/
|
||||
virtual uint getSkeletonWeightIdByName (const std::string& name) const
|
||||
{
|
||||
return _AnimationSet->getSkeletonWeightIdByName(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get skeleton template name.
|
||||
*/
|
||||
virtual const std::string& getSkeletonWeightName (uint skeletonId) const
|
||||
{
|
||||
if(skeletonId>=getNumSkeletonWeight())
|
||||
nlerror("getSkeletonWeight*(): bad SkeletonWeight Id");
|
||||
return _AnimationSet->getSkeletonWeightName(skeletonId);
|
||||
}
|
||||
|
||||
// @}
|
||||
|
||||
|
||||
/// \name Channel mgt.
|
||||
// @{
|
||||
|
||||
virtual uint getChannelIdByName (const std::string& name) const
|
||||
{
|
||||
return _AnimationSet->getChannelIdByName(name);
|
||||
}
|
||||
|
||||
// @}
|
||||
|
||||
// Access the animation set
|
||||
const CAnimationSet* getAnimationSet () const;
|
||||
};
|
||||
|
||||
} // NL3D
|
||||
|
||||
|
||||
#endif // NL_ANIMATION_SET_USER_H
|
||||
|
||||
/* End of animation_set_user.h */
|
44
code/nel/include/nel/3d/animation_time.h
Normal file
44
code/nel/include/nel/3d/animation_time.h
Normal file
|
@ -0,0 +1,44 @@
|
|||
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef NL_ANIMATION_TIME_H
|
||||
#define NL_ANIMATION_TIME_H
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* Animation time in second.
|
||||
*
|
||||
* \author Cyril 'Hulud' Corvazier
|
||||
* \author Nevrax France
|
||||
* \date 2001
|
||||
*/
|
||||
typedef float CAnimationTime;
|
||||
typedef float TAnimationTime;
|
||||
typedef double TGlobalAnimationTime;
|
||||
|
||||
|
||||
} // NL3D
|
||||
|
||||
|
||||
#endif // NL_ANIMATION_TIME_H
|
||||
|
||||
/* End of animation_time.h */
|
143
code/nel/include/nel/3d/async_file_manager_3d.h
Normal file
143
code/nel/include/nel/3d/async_file_manager_3d.h
Normal file
|
@ -0,0 +1,143 @@
|
|||
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef NL_ASYNC_FILE_MANAGER_3D_H
|
||||
#define NL_ASYNC_FILE_MANAGER_3D_H
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/thread.h"
|
||||
#include "nel/misc/async_file_manager.h"
|
||||
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
class IShape;
|
||||
class IDriver;
|
||||
class CInstanceGroup;
|
||||
class UInstanceGroup;
|
||||
class CTextureFile;
|
||||
|
||||
/**
|
||||
* CAsyncFileManager is a class that manage file loading in a seperate thread
|
||||
* \author Matthieu Besson
|
||||
* \author Nevrax France
|
||||
* \date 2002
|
||||
*/
|
||||
class CAsyncFileManager3D
|
||||
{
|
||||
|
||||
NLMISC_SAFE_SINGLETON_DECL(CAsyncFileManager3D);
|
||||
CAsyncFileManager3D();
|
||||
public:
|
||||
|
||||
// static CAsyncFileManager3D &getInstance (); // Must be called instead of constructing the object
|
||||
static void terminate (); // release singleton
|
||||
|
||||
void loadMesh (const std::string &sMeshName, IShape **ppShp, IDriver *pDriver, const NLMISC::CVector &position, uint textureSlot);
|
||||
bool cancelLoadMesh (const std::string& sMeshName);
|
||||
|
||||
void loadIG (const std::string &igName, CInstanceGroup **ppIG);
|
||||
void loadIGUser (const std::string &igName, UInstanceGroup **ppIG);
|
||||
|
||||
void loadTexture (CTextureFile *textureFile, bool *pSgn, const NLMISC::CVector &position);
|
||||
bool cancelLoadTexture (CTextureFile *textFile);
|
||||
|
||||
|
||||
// Do not use these methods with the bigfile manager
|
||||
void loadFile (const std::string &fileName, uint8 **pPtr);
|
||||
void loadFiles (const std::vector<std::string> &vFileNames, const std::vector<uint8**> &vPtrs);
|
||||
|
||||
|
||||
void signal (bool *pSgn); // Signal a end of loading for a group of "mesh or file" added
|
||||
void cancelSignal (bool *pSgn);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
// CAsyncFileManager3D (); // Singleton mode -> access it with the getInstance function
|
||||
|
||||
// static CAsyncFileManager3D *_Singleton;
|
||||
|
||||
|
||||
friend class CLoadMeshCancel;
|
||||
friend class CLoadTextureCancel;
|
||||
|
||||
// All the tasks
|
||||
// -------------
|
||||
|
||||
// Load a .shape
|
||||
class CMeshLoad : public NLMISC::IRunnablePos
|
||||
{
|
||||
IShape **_ppShp;
|
||||
IDriver *_pDriver;
|
||||
uint _SelectedTexture;
|
||||
public:
|
||||
std::string MeshName;
|
||||
public:
|
||||
CMeshLoad (const std::string &meshName, IShape **ppShp, IDriver *pDriver, const CVector &position, uint selectedTexture);
|
||||
void run (void);
|
||||
void getName (std::string &result) const;
|
||||
};
|
||||
|
||||
// Load a .ig
|
||||
class CIGLoad : public NLMISC::IRunnable
|
||||
{
|
||||
std::string _IGName;
|
||||
CInstanceGroup **_ppIG;
|
||||
public:
|
||||
CIGLoad (const std::string& meshName, CInstanceGroup **ppIG);
|
||||
void run (void);
|
||||
void getName (std::string &result) const;
|
||||
};
|
||||
|
||||
// Load a .ig User Interface
|
||||
class CIGLoadUser : public NLMISC::IRunnable
|
||||
{
|
||||
std::string _IGName;
|
||||
UInstanceGroup **_ppIG;
|
||||
public:
|
||||
CIGLoadUser (const std::string& meshName, UInstanceGroup **ppIG);
|
||||
void run (void);
|
||||
void getName (std::string &result) const;
|
||||
};
|
||||
|
||||
// Load a texture
|
||||
class CTextureLoad : public NLMISC::IRunnablePos
|
||||
{
|
||||
public:
|
||||
CTextureFile *TextureFile;
|
||||
bool *Signal;
|
||||
public:
|
||||
CTextureLoad(CTextureFile *textureFile, bool *psgn, const CVector &position)
|
||||
: TextureFile(textureFile), Signal(psgn)
|
||||
{
|
||||
Position = position;
|
||||
}
|
||||
|
||||
void run();
|
||||
void getName (std::string &result) const;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
} // NL3D
|
||||
|
||||
|
||||
#endif // NL_ASYNC_FILE_MANAGER_3D_H
|
||||
|
||||
/* End of async_file_manager.h */
|
70
code/nel/include/nel/3d/async_texture_block.h
Normal file
70
code/nel/include/nel/3d/async_texture_block.h
Normal file
|
@ -0,0 +1,70 @@
|
|||
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef NL_ASYNC_TEXTURE_BLOCK_H
|
||||
#define NL_ASYNC_TEXTURE_BLOCK_H
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/3d/material.h"
|
||||
|
||||
#include <limits>
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
|
||||
class CMeshBaseInstance;
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
/**
|
||||
* Descriptor of TextureFile Names.
|
||||
* \author Lionel Berenguier
|
||||
* \author Nevrax France
|
||||
* \date 2002
|
||||
*/
|
||||
class CAsyncTextureBlock
|
||||
{
|
||||
public:
|
||||
// List of texture file names for a material
|
||||
std::string TextureNames[IDRV_MAT_MAXTEXTURES];
|
||||
|
||||
CAsyncTextureBlock()
|
||||
{
|
||||
for(uint i=0;i<IDRV_MAT_MAXTEXTURES;i++)
|
||||
{
|
||||
TextIds[i]= std::numeric_limits<uint>::max();
|
||||
IsTextureFile[i]= false;
|
||||
}
|
||||
}
|
||||
bool isTextureFile(uint stage) const {return IsTextureFile[stage];}
|
||||
|
||||
private:
|
||||
friend class CMeshBaseInstance;
|
||||
// Ids in the CAsyncTextureManager
|
||||
uint TextIds[IDRV_MAT_MAXTEXTURES];
|
||||
// true if the texture in the stage is really a texture file.
|
||||
bool IsTextureFile[IDRV_MAT_MAXTEXTURES];
|
||||
|
||||
};
|
||||
|
||||
|
||||
} // NL3D
|
||||
|
||||
|
||||
#endif // NL_ASYNC_TEXTURE_BLOCK_H
|
||||
|
||||
/* End of async_texture_block.h */
|
250
code/nel/include/nel/3d/async_texture_manager.h
Normal file
250
code/nel/include/nel/3d/async_texture_manager.h
Normal file
|
@ -0,0 +1,250 @@
|
|||
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef NL_ASYNC_TEXTURE_MANAGER_H
|
||||
#define NL_ASYNC_TEXTURE_MANAGER_H
|
||||
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/3d/texture_file.h"
|
||||
#include "nel/3d/hls_texture_manager.h"
|
||||
#include <vector>
|
||||
#include "nel/misc/bitmap.h"
|
||||
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
|
||||
class CMeshBaseInstance;
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
/**
|
||||
* Async Loader of textures and Texture Load Balancer.
|
||||
* Additionaly, store in RAM for each texture load a very low, DXTC1 compressed version of the texture.
|
||||
* Used for some Lod systems.
|
||||
* \author Lionel Berenguier
|
||||
* \author Nevrax France
|
||||
* \date 2002
|
||||
*/
|
||||
class CAsyncTextureManager
|
||||
{
|
||||
public:
|
||||
/// User is free to add bank to this manager. Other methods are used by the async manager
|
||||
CHLSTextureManager HLSManager;
|
||||
|
||||
public:
|
||||
|
||||
/// Constructor
|
||||
CAsyncTextureManager();
|
||||
~CAsyncTextureManager();
|
||||
|
||||
/** setup the mipMap levels.
|
||||
* \baseLevel When the texture is first added, it is loaded skipping the baseLevel
|
||||
* first mipmap
|
||||
* \maxLevel During time, further mipmap are loaded, according to instance position etc... maxLevel
|
||||
* tells where to stop. If 0, the texture will finally be entirely uploaded.
|
||||
* Default is 3,1.
|
||||
*/
|
||||
void setupLod(uint baseLevel, uint maxLevel);
|
||||
/// Setup max texture upload in driver per update() call (in bytes). Default to 64K
|
||||
void setupMaxUploadPerFrame(uint maxup);
|
||||
/// Setup max texture HLS Coloring per update() call (in bytes). Default to 20K.
|
||||
void setupMaxHLSColoringPerFrame(uint maxCol);
|
||||
/// Setup max total texture size allowed. Default is 10Mo
|
||||
void setupMaxTotalTextureSize(uint maxText);
|
||||
|
||||
/** Add a reference to a texture owned by an instance.
|
||||
* If the texture still exists, only the refcount is incremented
|
||||
* Else if texture is found in the HLSTextureManager, it is builded (async) from it, else Begin Async loading
|
||||
*
|
||||
* Therefore, only CTextureFile are possible. Also note that the texture is uploaded with mipmap by default, and
|
||||
* UpLoadFormat is also default (say ITexture::Auto)
|
||||
*
|
||||
* If the texture file is not a DDS with mipmap, this is an error. But the system doesn't fail and
|
||||
* the file is entirely loaded and uploaded. The problem is that upload is not cut according to maxUpLoadPerFrame, so
|
||||
* some freeze may occur.
|
||||
*/
|
||||
uint addTextureRef(const std::string &textName, CMeshBaseInstance *instance, const NLMISC::CVector &position);
|
||||
|
||||
/// release a texture-instance tuple. The texture is released if no more instance use it.
|
||||
void releaseTexture(uint id, CMeshBaseInstance *instance);
|
||||
|
||||
/// tells if a texture is loaded in the driver (ie. ready to use)
|
||||
bool isTextureUpLoaded(uint id) const;
|
||||
|
||||
/** get the RAM LowDef version of a texture. Used For CLodCharacters
|
||||
* return NULL if bad Id or if the texture is still not loaded.
|
||||
* The bitmap returned has no mipmaps and should be in DXTC1 (not guaranteed).
|
||||
*/
|
||||
const NLMISC::CBitmap *getCoarseBitmap(uint id) const;
|
||||
|
||||
|
||||
/** update the manager. New loaded textures are uploaded. Instances are updated to know if all their
|
||||
* pending textures have been uploaded.
|
||||
*/
|
||||
void update(IDriver *pDriver);
|
||||
|
||||
|
||||
/// get the async texture size asked (ie. maybe bigger than MaxTotalTextureSize).
|
||||
uint getTotalTextureSizeAsked() const {return _TotalTextureSizeAsked;}
|
||||
/// get what the system really allows
|
||||
uint getLastTextureSizeGot() const {return _LastTextureSizeGot;}
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
private:
|
||||
|
||||
typedef std::map<std::string, uint> TTextureEntryMap;
|
||||
typedef TTextureEntryMap::iterator ItTextureEntryMap;
|
||||
|
||||
|
||||
// A base texture uploadable.
|
||||
class CTextureBase
|
||||
{
|
||||
public:
|
||||
// the texture currently loaded / uploaded.
|
||||
NLMISC::CSmartPtr<CTextureFile> Texture;
|
||||
|
||||
bool isTextureEntry() const {return IsTextureEntry;}
|
||||
protected:
|
||||
bool IsTextureEntry;
|
||||
};
|
||||
|
||||
|
||||
class CTextureEntry;
|
||||
|
||||
// A Lod version of a texture entry.
|
||||
class CTextureLod : public CTextureBase
|
||||
{
|
||||
public:
|
||||
CTextureLod();
|
||||
|
||||
// A Ptr on the real texture used.
|
||||
CTextureEntry *TextureEntry;
|
||||
// Weight of the lod, according to distance and level.
|
||||
float Weight;
|
||||
// the level of this Lod. 0 means full original texture resolution.
|
||||
uint8 Level;
|
||||
// True if loading has ended
|
||||
bool Loaded;
|
||||
// True if TextureEntry has at least this lod in VRAM
|
||||
bool UpLoaded;
|
||||
// The size that this lod takes in VRAM (minus TextureEntry->BaseSize)
|
||||
uint ExtraSize;
|
||||
};
|
||||
|
||||
|
||||
struct CTextureLodToSort
|
||||
{
|
||||
CTextureLod *Lod;
|
||||
CVector Position;
|
||||
bool operator<(const CTextureLodToSort &other) const
|
||||
{
|
||||
return Lod->Weight<other.Lod->Weight;
|
||||
}
|
||||
};
|
||||
|
||||
// A texture entry
|
||||
class CTextureEntry : public CTextureBase
|
||||
{
|
||||
public:
|
||||
// The it in the map.
|
||||
ItTextureEntryMap ItMap;
|
||||
// true if async loading has ended
|
||||
bool Loaded;
|
||||
// true if the texture is loaded in the driver (at least the coarsest level).
|
||||
bool UpLoaded;
|
||||
// true if first loading ended, and if DXTC with mipmap
|
||||
bool CanHaveLOD;
|
||||
// true if this texture must be built from the HLSManager (at first load)
|
||||
bool BuildFromHLSManager;
|
||||
// if BuildFromHLSManager, gives the text id in the manager
|
||||
sint HLSManagerTextId;
|
||||
|
||||
// Base Size of the texture, without HDLod
|
||||
uint BaseSize;
|
||||
// list of instances currently using this texture.
|
||||
std::vector<CMeshBaseInstance*> Instances;
|
||||
// min distance of all Instances.
|
||||
float MinDistance;
|
||||
// min position.
|
||||
NLMISC::CVector MinPosition;
|
||||
// with all mipmaps loaded, what place this takes.
|
||||
uint TotalTextureSizeAsked;
|
||||
|
||||
// The High Def Lod.
|
||||
CTextureLod HDLod;
|
||||
|
||||
// The Coarse Bitmap stored in RAM for CLod
|
||||
NLMISC::CBitmap CoarseBitmap;
|
||||
|
||||
public:
|
||||
CTextureEntry();
|
||||
|
||||
void createCoarseBitmap();
|
||||
};
|
||||
|
||||
|
||||
private:
|
||||
uint _BaseLodLevel, _MaxLodLevel;
|
||||
uint _MaxUploadPerFrame;
|
||||
uint _MaxHLSColoringPerFrame;
|
||||
uint _MaxTotalTextureSize;
|
||||
uint _TotalTextureSizeAsked;
|
||||
uint _LastTextureSizeGot;
|
||||
|
||||
// Textures Entries.
|
||||
std::vector<CTextureEntry*> _TextureEntries;
|
||||
std::vector<uint> _FreeTextureIds;
|
||||
TTextureEntryMap _TextureEntryMap;
|
||||
std::vector<uint> _WaitingTextures;
|
||||
|
||||
// Upload of texture piece by piece.
|
||||
CTextureBase *_CurrentUploadTexture;
|
||||
uint _CurrentUploadTextureMipMap;
|
||||
uint _CurrentUploadTextureLine;
|
||||
|
||||
// The current HDLod async loaded (NB: loaded / or upLoaded)
|
||||
CTextureLod *_CurrentTextureLodLoaded;
|
||||
|
||||
// For texture profiling
|
||||
NLMISC::CSmartPtr<ITexture::CTextureCategory> _TextureCategory;
|
||||
|
||||
private:
|
||||
|
||||
static bool validDXTCMipMap(ITexture *pText);
|
||||
|
||||
// delete the texture and all references in map/array, instance refcount etc...
|
||||
void deleteTexture(uint id);
|
||||
|
||||
// Fill _CurrentUploadTexture with next texture to upload, or set NULL if none
|
||||
void getNextTextureToUpLoad(uint &nTotalColored, IDriver *pDriver);
|
||||
bool uploadTexturePart(ITexture *pText, IDriver *pDriver, uint &nTotalUpload);
|
||||
|
||||
// update list of texture lods.
|
||||
void updateTextureLodSystem(IDriver *pDriver);
|
||||
|
||||
};
|
||||
|
||||
|
||||
} // NL3D
|
||||
|
||||
|
||||
#endif // NL_ASYNC_TEXTURE_MANAGER_H
|
||||
|
||||
/* End of async_texture_manager.h */
|
136
code/nel/include/nel/3d/bezier_patch.h
Normal file
136
code/nel/include/nel/3d/bezier_patch.h
Normal file
|
@ -0,0 +1,136 @@
|
|||
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef NL_BEZIER_PATCH_H
|
||||
#define NL_BEZIER_PATCH_H
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/vector.h"
|
||||
#include "nel/misc/vectord.h"
|
||||
#include "nel/misc/matrix.h"
|
||||
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
|
||||
using NLMISC::CVector;
|
||||
using NLMISC::CVectorD;
|
||||
using NLMISC::CMatrix;
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
/**
|
||||
* A standard bezier patch of float. (quadpatch only).
|
||||
* QuadPatch layout (same notations as 3ds Max SDK).
|
||||
*
|
||||
*
|
||||
*
|
||||
* 0 ---s---> 3
|
||||
*
|
||||
* A---> ad ---- da <---D
|
||||
* | |
|
||||
* | | |
|
||||
* | v v
|
||||
* | ab ia id dc
|
||||
* t
|
||||
* | | |
|
||||
* | | |
|
||||
* v
|
||||
* ba ib ic cd
|
||||
* ^ ^
|
||||
* | |
|
||||
* | |
|
||||
* B---> bc ---- cb <---C
|
||||
* 1 2
|
||||
*
|
||||
* \author Lionel Berenguier
|
||||
* \author Nevrax France
|
||||
* \date 2000
|
||||
*/
|
||||
class CBezierPatch
|
||||
{
|
||||
public:
|
||||
/// The vertices a,b,c,d of the quad patch.
|
||||
CVector Vertices[4];
|
||||
/// The tangents ab, ba, bc, cb, cd, dc, da, ad. NB: tangents are points, not vectors.
|
||||
CVector Tangents[8];
|
||||
/// The interiors, ia,ib,ic,id. NB: interiors are points, not vectors.
|
||||
CVector Interiors[4];
|
||||
|
||||
|
||||
public:
|
||||
/// Constructor: undefined Bezier patch!!
|
||||
CBezierPatch() {}
|
||||
|
||||
/// complete computation of Vertices, Tangents, and Interiors, providing the vertices and vertex normals.
|
||||
void make(CVector vertices[4], CVector normals[4]);
|
||||
/// make default Interiors, according to Vertices and Tangents.
|
||||
void makeInteriors();
|
||||
/// Do the matrix transformation m*patch.
|
||||
void applyMatrix(const CMatrix &m);
|
||||
|
||||
/// Evaluate.
|
||||
CVector eval(float s, float t) const; // s,t coordinates for quad.
|
||||
/// Evaluate, but return a vector double.
|
||||
CVectorD evalDouble(double s, double t) const; // s,t coordinates for quad.
|
||||
/// Evaluate the normal at (s,t). returned vector is normalized.
|
||||
CVector evalNormal(float s, float t) const; // s,t coordinates for quad.
|
||||
/// Evaluate the tangentS at (s,t). returned vector is normalized.
|
||||
CVector evalTangentS(float s, float t) const; // s,t coordinates for quad.
|
||||
/// Evaluate the tangentT at (s,t). returned vector is normalized.
|
||||
CVector evalTangentT(float s, float t) const; // s,t coordinates for quad.
|
||||
|
||||
|
||||
/// \name Subdivision.
|
||||
// @{
|
||||
/** Subdivide the bezier patch in 2 bezier patches along s, at s (beetween [0,1]).
|
||||
* NB: left goes from 0 to s, right goes from s to 1.
|
||||
*/
|
||||
void subdivideS(CBezierPatch &left, CBezierPatch &right, float s=0.5f) const;
|
||||
/** Subdivide the bezier patch in 2 bezier patches along t, at t (beetween [0,1]).
|
||||
* NB: top goes from 0 to t, bottom goes from t to 1.
|
||||
*/
|
||||
void subdivideT(CBezierPatch &top, CBezierPatch &bottom, float t=0.5f) const;
|
||||
// @}
|
||||
|
||||
|
||||
// **********************************
|
||||
private:
|
||||
struct CBezierCurve
|
||||
{
|
||||
CVector P0, P1, P2, P3;
|
||||
void subdivide(CBezierCurve &left, CBezierCurve &right, float t);
|
||||
void set(const CVector &a, const CVector &b, const CVector &c, const CVector &d)
|
||||
{
|
||||
P0= a; P1= b; P2= c; P3= d;
|
||||
}
|
||||
void get(CVector &a, CVector &b, CVector &c, CVector &d)
|
||||
{
|
||||
a= P0; b= P1; c= P2; d= P3;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
} // NL3D
|
||||
|
||||
|
||||
#endif // NL_BEZIER_PATCH_H
|
||||
|
||||
/* End of bezier_patch.h */
|
178
code/nel/include/nel/3d/bloom_effect.h
Normal file
178
code/nel/include/nel/3d/bloom_effect.h
Normal file
|
@ -0,0 +1,178 @@
|
|||
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef NL_BLOOM_EFFECT_H
|
||||
#define NL_BLOOM_EFFECT_H
|
||||
|
||||
// Misc
|
||||
#include "nel/misc/singleton.h"
|
||||
#include "nel/misc/vector_2f.h"
|
||||
#include "nel/misc/geom_ext.h"
|
||||
|
||||
// 3D
|
||||
#include "nel/3d/u_material.h"
|
||||
#include "nel/3d/texture.h"
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
class UDriver;
|
||||
class UScene;
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------
|
||||
//---------------------------------------- CBloomEffect -----------------------------------------------------
|
||||
//-----------------------------------------------------------------------------------------------------------
|
||||
// CBloomEffect class apply a bloom effect on the whole scene. The whole scene is rendered in a
|
||||
// render target (a Frame Buffer Object on OpengL, the normal back buffer in Direct3D) which is stretched
|
||||
// in a 256*256 another render target.
|
||||
// We apply a horizontal blur on this 256*256 render target, then a vertical blur on the result of this first pass.
|
||||
// The final blurred render target is blend with the initial render target of scene, with a dest + src - dest*src
|
||||
// blend operation.
|
||||
//-----------------------------------------------------------------------------------------------------------
|
||||
class CBloomEffect : public NLMISC::CSingleton<CBloomEffect>
|
||||
{
|
||||
public:
|
||||
|
||||
/// Constructor
|
||||
CBloomEffect();
|
||||
|
||||
// Destructor
|
||||
~CBloomEffect();
|
||||
|
||||
// Called after the Driver initialization to indicate if OpenGL or Direct3D is used.
|
||||
// They are some differences in bloom algorithm depending on this API choice.
|
||||
// If bloom effect is activated and supported, private method init() is called to initialize
|
||||
// textures and materials.
|
||||
// initBloomEffect = false => directx
|
||||
// initBloomEffect = true => opengl
|
||||
void init(bool initBloomEffect);
|
||||
|
||||
// must be called before init
|
||||
void setDriver(UDriver *driver) { _Driver = driver; }
|
||||
UDriver* getDriver() const { return _Driver; }
|
||||
|
||||
// must be called before initBloom
|
||||
void setScene(UScene *scene) { _Scene = scene; }
|
||||
UScene* getScene() const { return _Scene; }
|
||||
|
||||
// enable or disable square bloom
|
||||
void setSquareBloom(bool squareBloom) { _SquareBloom = squareBloom; }
|
||||
bool getSquareBloom() const { return _SquareBloom; }
|
||||
|
||||
// set bloom density
|
||||
void setDensityBloom(uint8 densityBloom) { _DensityBloom = densityBloom; }
|
||||
uint8 getDensityBloom() const { return _DensityBloom; }
|
||||
|
||||
// Called at the beginning of renderAll method in the main loop, if window has been resized,
|
||||
// reinitialize bloom textures according to new window size.
|
||||
// The bloom texture (_InitText attribute) which is used as render target during scene render
|
||||
// is reinitialized with window dimensions.
|
||||
// If window size exceeds 256*256 the textures used to apply blur are reinitialized with
|
||||
// 256*256 size. If a dimension is less than 256, the texture is initialized with the nearer
|
||||
// power of 2, lower than this window dimension.
|
||||
void initBloom();
|
||||
|
||||
// Called at the end of renderAll method in the main loop, recover stretched texture, apply
|
||||
// both blur passes, and the blending operation between initial render target and the blured one.
|
||||
void endBloom();
|
||||
|
||||
// In OpenGL, the use of FBO implies that Z buffer values of scene render have been stored in
|
||||
// a depth render target. Then, to display 3D interfaces, we must display them in the same FBO,
|
||||
// to keep Z tests correct.
|
||||
// This method is called at the end of interfaces display in the main loop, to display final render target
|
||||
// (with added interfaces) in the color frame buffer.
|
||||
// NB : In Direct3D, the final render target is displayed at the end of endBloom call.
|
||||
void endInterfacesDisplayBloom();
|
||||
|
||||
private:
|
||||
|
||||
// Initialize textures and materials.
|
||||
void init();
|
||||
|
||||
// Initialize a bloom texture with new dimensions.
|
||||
void initTexture(NLMISC::CSmartPtr<NL3D::ITexture> & tex, bool isMode2D, uint32 width, uint32 height);
|
||||
|
||||
// Called in endBloom method to build a blurred texture. Two passes (then two calls)
|
||||
// are necessary : horizontal and vertical.
|
||||
// For the first pass, blur is applied horizontally to stretched texture _BlurFinalTex and recover in
|
||||
// _BlurHorizontalTex render target texture.
|
||||
// For the second pass, blur is applied vertically to precedent _BlurHorizontalTex texture and recover
|
||||
// in _BlurFinalTex render target texture.
|
||||
// For each pass, thanks to a vertex program, first texture is displayed with several little decals
|
||||
// in order to obtain in the render target texture a mix of color of a texel and its neighboured texels
|
||||
// on the axis of the pass.
|
||||
void doBlur(bool horizontalBlur);
|
||||
|
||||
// Called in endBloom method after the both doBlur passes. Apply blend operation between initial render target
|
||||
// texture _InitText of scene and the blurred texture _BlurFinalTex.
|
||||
void applyBlur();
|
||||
|
||||
// the driver to use
|
||||
UDriver* _Driver;
|
||||
// the scene to use
|
||||
UScene* _Scene;
|
||||
|
||||
// use square bloom
|
||||
bool _SquareBloom;
|
||||
// density of bloom
|
||||
uint8 _DensityBloom;
|
||||
|
||||
// render target textures
|
||||
// used to display scene
|
||||
NLMISC::CSmartPtr<NL3D::ITexture> _InitText;
|
||||
// used as stretched texture from _InitText, as displayed texture in first blur pass,
|
||||
// and as render target in second blur pass.
|
||||
NLMISC::CSmartPtr<NL3D::ITexture> _BlurFinalTex;
|
||||
// used as render target in first blur pass, and as displayed texture on second blur pass.
|
||||
NLMISC::CSmartPtr<NL3D::ITexture> _BlurHorizontalTex;
|
||||
|
||||
|
||||
// materials
|
||||
// used to display first texture in doBlur passes.
|
||||
NL3D::UMaterial _BlurMat;
|
||||
// used to display final render target texture in endInterfacesDisplayBloom call (OpenGL).
|
||||
NL3D::UMaterial _DisplayInitMat;
|
||||
// used to blend initial scene render target texture and blur texture according to a
|
||||
// dest+src - dest*src blend operation.
|
||||
NL3D::UMaterial _DisplayBlurMat;
|
||||
// used to blend initial scene render target texture and blur texture according to a
|
||||
// dest+src - dest*src blend operation, with a square stage operation.
|
||||
NL3D::UMaterial _DisplaySquareBlurMat;
|
||||
|
||||
// quads
|
||||
NLMISC::CQuadUV _BlurQuad;
|
||||
NLMISC::CQuadUV _DisplayQuad;
|
||||
|
||||
// openGL or Direct3D?
|
||||
bool _InitBloomEffect;
|
||||
|
||||
// textures and materials already initialized?
|
||||
bool _Init;
|
||||
|
||||
// current window dimensions
|
||||
uint32 _WndWidth;
|
||||
uint32 _WndHeight;
|
||||
|
||||
// current blur texture dimensions
|
||||
uint32 _BlurWidth;
|
||||
uint32 _BlurHeight;
|
||||
};
|
||||
|
||||
} // NL3D
|
||||
|
||||
#endif // NL_BLOOM_EFFECT_H
|
||||
|
||||
/* End of bloom_effect.h */
|
220
code/nel/include/nel/3d/bone.h
Normal file
220
code/nel/include/nel/3d/bone.h
Normal file
|
@ -0,0 +1,220 @@
|
|||
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef NL_BONE_H
|
||||
#define NL_BONE_H
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/3d/transformable.h"
|
||||
#include "nel/3d/channel_mixer.h"
|
||||
#include "nel/misc/smart_ptr.h"
|
||||
#include "nel/misc/bsphere.h"
|
||||
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
class IAnimCtrl;
|
||||
class CSkeletonModel;
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
/**
|
||||
* This is a bone default value. This object is stored in the SkeletonShape, and is serialised.
|
||||
* For hierarchy of bones, it contains the id of his father.
|
||||
* \author Lionel Berenguier
|
||||
* \author Nevrax France
|
||||
* \date 2001
|
||||
*/
|
||||
class CBoneBase : public NLMISC::CRefCount
|
||||
{
|
||||
public:
|
||||
/// Name of this bone, for Animation access.
|
||||
std::string Name;
|
||||
|
||||
/// The Inverse of bindpos for this bone.
|
||||
CMatrix InvBindPos;
|
||||
|
||||
/// The Father of this bone. -1 means no one.
|
||||
sint32 FatherId;
|
||||
|
||||
/// true if unheritScale from father (default==true).
|
||||
bool UnheritScale;
|
||||
|
||||
/// Default tracks.
|
||||
CTrackDefaultVector DefaultPos;
|
||||
CTrackDefaultVector DefaultRotEuler;
|
||||
CTrackDefaultQuat DefaultRotQuat;
|
||||
CTrackDefaultVector DefaultScale;
|
||||
CTrackDefaultVector DefaultPivot;
|
||||
|
||||
/// The distance at which the bone is disabled in the skeleton. If 0, never disable.
|
||||
float LodDisableDistance;
|
||||
|
||||
/** Additionally to the standard scale, you can multiply the effect on the skin with a special SkinScale
|
||||
* This scale is applied only on the skin (even son bones positions won't be affected)
|
||||
* Default to (1,1,1)
|
||||
*/
|
||||
CVector SkinScale;
|
||||
|
||||
public:
|
||||
|
||||
/// ctor, with default pos as NULL (but scale as 1,1,1).
|
||||
CBoneBase();
|
||||
|
||||
/// save/load.
|
||||
void serial(NLMISC::IStream &f);
|
||||
|
||||
};
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
/**
|
||||
* This is a bone, for skeleton animation, with information for result WorldMatrix.
|
||||
* \author Lionel Berenguier
|
||||
* \author Nevrax France
|
||||
* \date 2001
|
||||
*/
|
||||
class CBone : public ITransformable
|
||||
{
|
||||
public:
|
||||
|
||||
/** Constructor. build a bone from a CBoneBase*.
|
||||
* By default, a bone is in RotQuat transform mode.
|
||||
* This ctor:
|
||||
* - store a RefPtr on the bonebase (for getDefaultTracks() method). the refptr is just for nlassert.
|
||||
* - copy the bonebase default track value into Animated Values Pos/Rot etc....
|
||||
*/
|
||||
CBone(CBoneBase *boneBase);
|
||||
|
||||
|
||||
/// retrieve the boneName from BoneBase.
|
||||
const std::string &getBoneName() const {nlassert(_BoneBase); return _BoneBase->Name;}
|
||||
/// retrieve the fatherId from BoneBase.
|
||||
sint32 getFatherId() const {nlassert(_BoneBase); return _BoneBase->FatherId;}
|
||||
/// retrieve the boneBase
|
||||
CBoneBase &getBoneBase() const {nlassert(_BoneBase); return *_BoneBase;}
|
||||
|
||||
|
||||
/// \name Herited from ITransformable
|
||||
// @{
|
||||
/// retrieve the default track from skeleton shape.
|
||||
virtual ITrack* getDefaultTrack (uint valueId);
|
||||
|
||||
/// register the ITransformable channels as detailled channels.
|
||||
virtual void registerToChannelMixer(CChannelMixer *chanMixer, const std::string &prefix);
|
||||
// @}
|
||||
|
||||
|
||||
/** Compute the LocalSkeletonMatrix, the WorldMatrix, and the BoneSkinMatrix (for skinning).
|
||||
* NB: the result localSkeletonMatrix depends on BoneBase::UnheritScale. \n
|
||||
* NB: the result worldMatrix depends on BoneBase::UnheritScale. \n
|
||||
* NB: the result boneSkinMatrix depends on BoneBase::InvBindPos. \n
|
||||
* \param parent the parent of this bone (maybe NULL if root). His WorldMatrix is used, so it should be computed before.
|
||||
* \param rootMatrix is used as father worldmatrix if parent==NULL. Useful for computing WorldMatrix.
|
||||
* \param skeletonForAnimCtrl if NULL, no AnimCtrl is performed, else skeletonForAnimCtrl->getWorldMAtrix() should be == to rootMatrix
|
||||
*/
|
||||
void compute(CBone *parent, const CMatrix &rootMatrix, CSkeletonModel *skeletonForAnimCtrl);
|
||||
|
||||
/** Interpolate the current result of _BoneSkinMatrix with otherMatrix.
|
||||
* when interp==0.f, _BoneSkinMatrix= otherMatrix.
|
||||
* NB: the interpolation is made on per-vector basis => bad matrix interpolation.
|
||||
*/
|
||||
void interpolateBoneSkinMatrix(const CMatrix &otherMatrix, float interp);
|
||||
|
||||
/// retrieve the matrix local to the skeleton, computed in compute().
|
||||
const CMatrix &getLocalSkeletonMatrix() const {return _LocalSkeletonMatrix;}
|
||||
|
||||
/// retrieve the WorldMatrix computed in compute().
|
||||
const CMatrix &getWorldMatrix() const {return _WorldMatrix;}
|
||||
|
||||
/// retrieve the BoneSkinMatrix computed in compute().
|
||||
const CMatrix &getBoneSkinMatrix() const {return _BoneSkinMatrix;}
|
||||
|
||||
|
||||
/// enable the channels (lodEnable) associated to this bone in the channelMixer.
|
||||
void lodEnableChannels(CChannelMixer *chanMixer, bool enable);
|
||||
|
||||
/** Force to eval the animation of that bone
|
||||
* Useful when a bone position is needed, and if the father skeleton has been clipped (and thus not detail-animated)
|
||||
* \param chanMixer the channel mixer to which that bone has been registered
|
||||
*/
|
||||
inline void forceAnimate(CChannelMixer &chanMixer);
|
||||
|
||||
|
||||
/** Additionally to the standard scale, you can multiply the effect on the skin with a special SkinScale
|
||||
* This scale is applied only on the skin (even son bones positions won't be affected)
|
||||
* Default to (1,1,1)
|
||||
*/
|
||||
void setSkinScale(CVector &skinScale);
|
||||
const CVector &getSkinScale() const {return _SkinScale;}
|
||||
|
||||
// *************************
|
||||
public:
|
||||
// Private to SkeletonModel. You should not set this ptr directly. see CSkeletonModel::setBoneAnimCtrl()
|
||||
// The extra controller (IK...) on this bone
|
||||
IAnimCtrl *_AnimCtrl;
|
||||
|
||||
// Private to SkeletonModel. This represent the max sphere for all skins around this bone
|
||||
NLMISC::CBSphere _MaxSphere;
|
||||
|
||||
private:
|
||||
// the boneBase of the skeletonShape which create this bone..
|
||||
NLMISC::CRefPtr<CBoneBase> _BoneBase;
|
||||
|
||||
// The result Matrix, local to the skeleton.
|
||||
CMatrix _LocalSkeletonMatrix;
|
||||
// The result WorldMatrix.
|
||||
CMatrix _WorldMatrix;
|
||||
// The result Disaplcement _LocalSkeletonMatrix, local to the skeleton.
|
||||
CMatrix _BoneSkinMatrix;
|
||||
|
||||
// The bkuped channelIds for each channel of the bone. -1 if not registered (or no tracks in animationSet).
|
||||
sint _PosChannelId;
|
||||
sint _RotEulerChannelId;
|
||||
sint _RotQuatChannelId;
|
||||
sint _ScaleChannelId;
|
||||
sint _PivotChannelId;
|
||||
|
||||
// see setSkinScale()
|
||||
CVector _SkinScale;
|
||||
};
|
||||
|
||||
|
||||
/////////////
|
||||
// INLINES //
|
||||
/////////////
|
||||
inline void CBone::forceAnimate(CChannelMixer &chanMixer)
|
||||
{
|
||||
sint ids[] =
|
||||
{
|
||||
_PosChannelId,
|
||||
_RotEulerChannelId,
|
||||
_RotQuatChannelId,
|
||||
_ScaleChannelId,
|
||||
_PivotChannelId
|
||||
};
|
||||
chanMixer.evalChannels(ids, sizeof(ids) / sizeof(ids[0]));
|
||||
}
|
||||
|
||||
} // NL3D
|
||||
|
||||
|
||||
#endif // NL_BONE_H
|
||||
|
||||
/* End of bone.h */
|
293
code/nel/include/nel/3d/bsp_tree.h
Normal file
293
code/nel/include/nel/3d/bsp_tree.h
Normal file
|
@ -0,0 +1,293 @@
|
|||
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
#ifndef NL_BSP_TREE_H
|
||||
#define NL_BSP_TREE_H
|
||||
|
||||
#include "nel/misc/debug.h"
|
||||
#include "nel/misc/vector.h"
|
||||
#include "nel/misc/plane.h"
|
||||
#include "nel/misc/matrix.h"
|
||||
#include "nel/misc/triangle.h"
|
||||
#include <list>
|
||||
#include <vector>
|
||||
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* class: CBSPTree.
|
||||
*
|
||||
*
|
||||
* A template CBSPTree.
|
||||
*
|
||||
*/
|
||||
template<class T> class CBSPTree
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
/// Default constructor, use axes XZ
|
||||
CBSPTree();
|
||||
|
||||
/// dtor.
|
||||
~CBSPTree();
|
||||
|
||||
public:
|
||||
|
||||
void insert( NLMISC::CTriangle &tri, T &value );
|
||||
sint32 select( CVector &v1, CVector &v2 );
|
||||
T getSelection( sint32 i );
|
||||
sint32 getNbNode();
|
||||
|
||||
private:
|
||||
|
||||
class CBSPNode;
|
||||
std::vector<CBSPNode*> _Selection;
|
||||
|
||||
private:
|
||||
|
||||
class CBSPNode
|
||||
{
|
||||
CBSPNode *pBack, *pFront;
|
||||
CPlane p;
|
||||
|
||||
public:
|
||||
|
||||
T Value;
|
||||
|
||||
public:
|
||||
|
||||
CBSPNode( NLMISC::CTriangle &tri, T &val ) : Value(val), pBack(NULL), pFront(NULL)
|
||||
{
|
||||
p.make( tri.V0, tri.V1, tri.V2 );
|
||||
p.normalize();
|
||||
}
|
||||
|
||||
~CBSPNode()
|
||||
{
|
||||
if( pBack != NULL )
|
||||
delete pBack;
|
||||
if( pFront != NULL )
|
||||
delete pFront;
|
||||
}
|
||||
|
||||
void insert( NLMISC::CTriangle &tri, T &val )
|
||||
{
|
||||
float f[3];
|
||||
CBSPNode *pCurrent = this;
|
||||
|
||||
while( true )
|
||||
{
|
||||
f[0] = pCurrent->p*tri.V0;
|
||||
f[1] = pCurrent->p*tri.V1,
|
||||
f[2] = pCurrent->p*tri.V2;
|
||||
if( fabs( f[0] ) < 0.00001 ) f[0] = 0.0f;
|
||||
if( fabs( f[1] ) < 0.00001 ) f[1] = 0.0f;
|
||||
if( fabs( f[2] ) < 0.00001 ) f[2] = 0.0f;
|
||||
if( ( f[0] >= 0.0f ) && ( f[1] >= 0.0f ) && ( f[2] >= 0.0f ) )
|
||||
{ // All front
|
||||
if( pCurrent->pFront == NULL )
|
||||
{
|
||||
pCurrent->pFront = new CBSPNode( tri, val );
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
pCurrent = pCurrent->pFront;
|
||||
}
|
||||
}
|
||||
else
|
||||
if( ( f[0] <= 0.0f ) && ( f[1] <= 0.0f ) && ( f[2] <= 0.0f ) )
|
||||
{ // All back
|
||||
if( pCurrent->pBack == NULL )
|
||||
{
|
||||
pCurrent->pBack = new CBSPNode( tri, val );
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
pCurrent = pCurrent->pBack;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( pCurrent->pFront == NULL )
|
||||
{
|
||||
pCurrent->pFront = new CBSPNode( tri, val );
|
||||
}
|
||||
else
|
||||
{
|
||||
pCurrent->pFront->insert( tri, val );
|
||||
}
|
||||
if( pCurrent->pBack == NULL )
|
||||
{
|
||||
pCurrent->pBack = new CBSPNode( tri, val );
|
||||
}
|
||||
else
|
||||
{
|
||||
pCurrent->pBack->insert( tri, val );
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sint32 getNbNode()
|
||||
{
|
||||
sint32 nBack = 0, nFront= 0;
|
||||
if( pBack != NULL )
|
||||
nBack = pBack->getNbNode();
|
||||
if( pFront != NULL )
|
||||
nFront = pFront->getNbNode();
|
||||
return 1+nBack+nFront;
|
||||
}
|
||||
|
||||
|
||||
void select( std::vector<CBSPNode*> &sel, CVector &v1, CVector &v2 )
|
||||
{
|
||||
float f[2];
|
||||
CBSPNode *pCurrent = this;
|
||||
|
||||
while( true )
|
||||
{
|
||||
f[0] = pCurrent->p*v1;
|
||||
f[1] = pCurrent->p*v2;
|
||||
if( fabs( f[0] ) < 0.00001 ) f[0] = 0.0;
|
||||
if( fabs( f[1] ) < 0.00001 ) f[1] = 0.0;
|
||||
if( ( f[0] >= 0.0 ) && ( f[1] >= 0.0 ) )
|
||||
{ // All front
|
||||
if( pCurrent->pFront == NULL )
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
pCurrent = pCurrent->pFront;
|
||||
}
|
||||
}
|
||||
else
|
||||
if( ( f[0] <= 0.0 ) && ( f[1] <= 0.0 ) )
|
||||
{ // All back
|
||||
if( pCurrent->pBack == NULL )
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
pCurrent = pCurrent->pBack;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( sel.size() == sel.capacity() )
|
||||
sel.reserve( sel.size() + 64 );
|
||||
sel.push_back( this );
|
||||
if( pCurrent->pFront == NULL )
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
//CVector newV1 = v1;
|
||||
//CVector newV2 = v2;
|
||||
//pCurrent->p.clipSegmentFront( newV1, newV2 );
|
||||
//pCurrent->pFront->select( sel, newV1, newV2 );
|
||||
pCurrent->pFront->select( sel, v1, v2 );
|
||||
}
|
||||
if( pCurrent->pBack == NULL )
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
//CVector newV1 = v1;
|
||||
//CVector newV2 = v2;
|
||||
//pCurrent->p.clipSegmentBack( newV1, newV2 );
|
||||
//pCurrent->pBack->select( sel, newV1, newV2 );
|
||||
pCurrent->pBack->select( sel, v1, v2 );
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
CBSPNode *_Root;
|
||||
|
||||
};
|
||||
|
||||
// ============================================================================================
|
||||
// ============================================================================================
|
||||
// Template CBSPTree implementation. Construction/Destruction.
|
||||
// ============================================================================================
|
||||
// ============================================================================================
|
||||
|
||||
template<class T> CBSPTree<T>::CBSPTree() : _Root(NULL)
|
||||
{
|
||||
_Selection.reserve( 64 );
|
||||
}
|
||||
|
||||
template<class T> CBSPTree<T>::~CBSPTree()
|
||||
{
|
||||
if( _Root != NULL )
|
||||
delete _Root;
|
||||
}
|
||||
|
||||
// ============================================================================================
|
||||
// ============================================================================================
|
||||
// Template CBSPTree implementation.
|
||||
// ============================================================================================
|
||||
// ============================================================================================
|
||||
|
||||
template<class T> void CBSPTree<T>::insert( NLMISC::CTriangle &tri, T &val )
|
||||
{
|
||||
if( _Root == NULL )
|
||||
_Root = new CBSPNode( tri, val );
|
||||
else
|
||||
_Root->insert( tri, val );
|
||||
}
|
||||
|
||||
template<class T> sint32 CBSPTree<T>::select( CVector &v1, CVector &v2 )
|
||||
{
|
||||
_Selection.clear();
|
||||
if( _Root != NULL )
|
||||
{
|
||||
_Root->select( _Selection, v1, v2 );
|
||||
return _Selection.size();
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
template<class T> T CBSPTree<T>::getSelection( sint32 i )
|
||||
{
|
||||
return _Selection[i]->Value;
|
||||
}
|
||||
|
||||
template<class T> sint32 CBSPTree<T>::getNbNode()
|
||||
{
|
||||
return _Root->getNbNode();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // NL_BSP_TREE_H
|
263
code/nel/include/nel/3d/camera.h
Normal file
263
code/nel/include/nel/3d/camera.h
Normal file
|
@ -0,0 +1,263 @@
|
|||
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef NL_CAMERA_H
|
||||
#define NL_CAMERA_H
|
||||
|
||||
#include "nel/3d/frustum.h"
|
||||
#include "nel/3d/transform.h"
|
||||
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// ClassIds.
|
||||
const NLMISC::CClassId CameraId=NLMISC::CClassId(0x5752634c, 0x6abe76f5);
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
/**
|
||||
* A camera descriptor
|
||||
*
|
||||
* Used to export or build a CCamera.
|
||||
*/
|
||||
class CCameraInfo
|
||||
{
|
||||
public:
|
||||
CCameraInfo ();
|
||||
NLMISC::CVector Pos;
|
||||
NLMISC::CVector TargetPos;
|
||||
float Roll;
|
||||
float Fov;
|
||||
bool TargetMode;
|
||||
bool UseFov;
|
||||
|
||||
void serial (NLMISC::IStream &s);
|
||||
};
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
/**
|
||||
* A Camera node, based on a CTransform node.
|
||||
* The camera looks in his local Y direction (see CScene).
|
||||
*
|
||||
* No special traverse*()
|
||||
* - has default behavior of a transform.
|
||||
* - can't be clipped (well... :) ).
|
||||
* - is not lightable
|
||||
* - is not renderable
|
||||
* \author Lionel Berenguier
|
||||
* \author Nevrax France
|
||||
* \date 2000
|
||||
*/
|
||||
class CCamera : public CTransform
|
||||
{
|
||||
public:
|
||||
/// Call at the begining of the program, to register the model
|
||||
static void registerBasic();
|
||||
|
||||
|
||||
public:
|
||||
|
||||
/// Build a camera
|
||||
void build (const CCameraInfo &info);
|
||||
|
||||
/// Set the frustum of the camera.
|
||||
void setFrustum(const CFrustum &f) {_Frustum= f;}
|
||||
/// Get the frustum of the camera.
|
||||
const CFrustum& getFrustum() const {return _Frustum;}
|
||||
/// Setup the camera mode as a perspective/ortho camera. NB: znear and zfar must be >0 (if perspective).
|
||||
void setFrustum(float left, float right, float bottom, float top, float znear, float zfar, bool perspective= true);
|
||||
/// Setup the camera mode as a perspective/ortho camera. NB: znear and zfar must be >0 (if perspective).
|
||||
void setFrustum(float width, float height, float znear, float zfar, bool perspective= true);
|
||||
/// Get the camera frustum.
|
||||
void getFrustum(float &left, float &right, float &bottom, float &top, float &znear, float &zfar) const;
|
||||
/// Is a ortho camera?
|
||||
bool isOrtho() const;
|
||||
/// Is a perspective camera?
|
||||
bool isPerspective() const;
|
||||
/** Setup a perspective camera, giving a fov in radians.
|
||||
* \param fov the horizontal angle of view, in radians. (Pi/2 as example)
|
||||
* \param aspectRatio the ratio horizontal/vertical (1.33 as example).
|
||||
* \param znear the front clipping plane distance.
|
||||
* \param zfar the back clipping plane distance.
|
||||
*/
|
||||
void setPerspective(float fov, float aspectRatio, float znear, float zfar);
|
||||
|
||||
|
||||
/** enable FOV animation. (default is false). see setPerspective(). znear and zfar are kept from previous setup.
|
||||
* NB: as setPerspective(), fov is the full horizontal angle of camera (in radians).
|
||||
*/
|
||||
bool enableFovAnimation(bool en, float aspectRatio= 4.0f / 3.0f)
|
||||
{
|
||||
_FovAnimationEnabled= en;
|
||||
if(en)
|
||||
_FovAnimationAspectRatio= aspectRatio;
|
||||
return true;
|
||||
}
|
||||
/** enable Target/Roll animation. (default is false). TTransform mode is forced to RotQuatMode. Roll is forced to 0.
|
||||
* The camera builds the rot matrix from the animated target/roll.
|
||||
*/
|
||||
bool enableTargetAnimation(bool en)
|
||||
{
|
||||
setTransformMode(ITransformable::RotQuat);
|
||||
_TargetAnimationEnabled= en;
|
||||
_Roll.Value= 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
/// \name Get / Set some values
|
||||
/// Works only if enableTargetAnimation.
|
||||
void setTargetPos(const CVector &pos)
|
||||
{
|
||||
nlassert(_TargetAnimationEnabled);
|
||||
_Target.Value= pos;
|
||||
touch(TargetValue, OwnerBit);
|
||||
}
|
||||
/// Works only if enableTargetAnimation.
|
||||
void setTargetPos(float x, float y, float z)
|
||||
{
|
||||
setTargetPos(CVector(x,y,z));
|
||||
}
|
||||
/// Works only if enableTargetAnimation.
|
||||
void setRoll(float roll)
|
||||
{
|
||||
nlassert(_TargetAnimationEnabled);
|
||||
_Roll.Value = roll;
|
||||
touch(RollValue, OwnerBit);
|
||||
}
|
||||
/// Works only if enableFovAnimation.
|
||||
void setFov(float fov)
|
||||
{
|
||||
nlassert(_FovAnimationEnabled);
|
||||
_Fov.Value = fov;
|
||||
touch(FovValue, OwnerBit);
|
||||
}
|
||||
/// Works only if enableTargetAnimation.
|
||||
void getTargetPos(CVector &pos) const
|
||||
{
|
||||
nlassert(_TargetAnimationEnabled);
|
||||
pos=_Target.Value;
|
||||
}
|
||||
/// Works only if enableTargetAnimation.
|
||||
float getRoll() const
|
||||
{
|
||||
nlassert(_TargetAnimationEnabled);
|
||||
return _Roll.Value;
|
||||
}
|
||||
/// Works only if enableFovAnimation.
|
||||
float getFov() const
|
||||
{
|
||||
nlassert(_FovAnimationEnabled);
|
||||
return _Fov.Value;
|
||||
}
|
||||
|
||||
/// \name Get some track name
|
||||
// @{
|
||||
/** Return the name of the fov track.
|
||||
* NB: as setPerspective(), fov is the full horizontal angle of camera (in radians).
|
||||
*/
|
||||
static const char *getFovValueName() {return "fov";}
|
||||
/// Return the name of the target track. This target is in the parent space of camera.
|
||||
static const char *getTargetValueName() {return "target";}
|
||||
/// Return the name of the roll track
|
||||
static const char *getRollValueName() {return "roll";}
|
||||
// @}
|
||||
|
||||
|
||||
/// \name From Ianimatable.
|
||||
// @{
|
||||
enum TAnimValues
|
||||
{
|
||||
OwnerBit= CTransform::AnimValueLast,
|
||||
FovValue ,
|
||||
TargetValue,
|
||||
RollValue, // Roll is the roll angle in radians.
|
||||
|
||||
AnimValueLast,
|
||||
};
|
||||
|
||||
/// From IAnimatable
|
||||
virtual IAnimatedValue* getValue (uint valueId);
|
||||
/// From IAnimatable
|
||||
virtual const char *getValueName (uint valueId) const;
|
||||
/// Default Track Values for are identity (roll= 0, target= CVector::Null, fov=Pi/2).
|
||||
virtual ITrack* getDefaultTrack (uint valueId);
|
||||
/// register camera channels (in global anim mode).
|
||||
virtual void registerToChannelMixer(CChannelMixer *chanMixer, const std::string &prefix);
|
||||
|
||||
// @}
|
||||
|
||||
/// \name access default tracks.
|
||||
// @{
|
||||
CTrackDefaultVector* getDefaultPos () {return &_DefaultPos;}
|
||||
CTrackDefaultVector* getDefaultTargetPos () {return &_DefaultTargetPos;}
|
||||
// @}
|
||||
|
||||
/// Build the camera Pyramid from current worldMatrix, and frustum
|
||||
void buildCameraPyramid(std::vector<NLMISC::CPlane> &pyramid, bool useWorldMatrix);
|
||||
|
||||
/// Compute corners of the camera Pyramid from current worldMatrix, and frustum
|
||||
void buildCameraPyramidCorners(std::vector<NLMISC::CVector> &pyramidCorners, bool useWorldMatrix);
|
||||
|
||||
protected:
|
||||
/// Constructor
|
||||
CCamera();
|
||||
/// Destructor
|
||||
virtual ~CCamera() {}
|
||||
|
||||
// NB: znear and zfar are be >0 (if perspective).
|
||||
CFrustum _Frustum;
|
||||
|
||||
|
||||
/// Implement the update method.
|
||||
virtual void update();
|
||||
|
||||
|
||||
private:
|
||||
static CTransform *creator() {return new CCamera;}
|
||||
|
||||
|
||||
private:
|
||||
bool _FovAnimationEnabled;
|
||||
bool _TargetAnimationEnabled;
|
||||
float _FovAnimationAspectRatio;
|
||||
|
||||
// AnimValues.
|
||||
CAnimatedValueFloat _Fov;
|
||||
CAnimatedValueVector _Target;
|
||||
CAnimatedValueFloat _Roll;
|
||||
|
||||
CTrackDefaultVector _DefaultPos;
|
||||
CTrackDefaultVector _DefaultTargetPos;
|
||||
|
||||
// Default tracks.
|
||||
static CTrackDefaultFloat DefaultFov; //( NLMISC::Pi/2 );
|
||||
static CTrackDefaultFloat DefaultRoll; //( 0 );
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif // NL_CAMERA_H
|
||||
|
||||
/* End of camera.h */
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue