mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-22 07:06:13 +00:00
Update: #842 Updating the CMake build, getting rid of bad stuff like DECORATE_NEL_LIB
This commit is contained in:
commit
d483e75527
11389 changed files with 2762245 additions and 0 deletions
168
.hgignore
Normal file
168
.hgignore
Normal file
|
@ -0,0 +1,168 @@
|
|||
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
|
||||
default_c
|
||||
*.string_cache
|
||||
|
||||
# Windows compile
|
||||
*.exe
|
||||
*.dll
|
||||
*.lib
|
||||
*.obj
|
||||
|
||||
# Linux compile
|
||||
*.a
|
||||
*.la
|
||||
*.lo
|
||||
*.Po
|
||||
*.Plo
|
||||
*.o
|
||||
*.so.*
|
||||
*_debug
|
||||
|
||||
# Log dump files
|
||||
report_refused
|
||||
report_failed
|
||||
exception_catched
|
||||
*.stat
|
||||
*.log
|
||||
log.txt
|
||||
|
||||
# Max plugin extensions
|
||||
*.dlx
|
||||
*.dlm
|
||||
*.dlu
|
||||
|
||||
#cmake build files & directories
|
||||
CMakeFiles
|
||||
*.cmake
|
||||
CMakeCache.txt
|
||||
.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
|
||||
|
||||
# Vim and kwrite cache
|
||||
*~
|
||||
|
||||
# Kdevelop4 garbage
|
||||
*.kdev4
|
||||
.kdev4
|
||||
|
||||
# Python cache
|
||||
*.pyd
|
||||
*.pyc
|
||||
|
||||
# Qt compiler
|
||||
moc_*.cpp
|
||||
*.moc
|
||||
|
||||
# Misc garbage
|
||||
*.orig
|
||||
*.cachefile
|
||||
*.cache
|
||||
*.7z
|
||||
|
||||
# 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
|
5
code/.hgignore
Normal file
5
code/.hgignore
Normal file
|
@ -0,0 +1,5 @@
|
|||
syntax: glob
|
||||
code/nel/build/*
|
||||
code/nelns/build/*
|
||||
code/snowballs/build/*
|
||||
code/ryzom/build/*
|
1396
code/acinclude.m4
Normal file
1396
code/acinclude.m4
Normal file
File diff suppressed because it is too large
Load diff
1
code/nel/AUTHORS
Normal file
1
code/nel/AUTHORS
Normal file
|
@ -0,0 +1 @@
|
|||
Please check www.nevrax.org for more information
|
283
code/nel/CMakeLists.txt
Normal file
283
code/nel/CMakeLists.txt
Normal file
|
@ -0,0 +1,283 @@
|
|||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# NeL
|
||||
# Authors: Nevrax and the NeL Community
|
||||
# Version: 0.6.1
|
||||
#
|
||||
# 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)
|
||||
# * 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}")
|
||||
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/nel.cmake)
|
||||
INCLUDE(${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL)
|
||||
|
||||
# Force out of source builds.
|
||||
CHECK_OUT_OF_SOURCE()
|
||||
|
||||
IF(WIN32)
|
||||
SET(CMAKE_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/include;${CMAKE_INCLUDE_PATH}")
|
||||
# Stupid hack for FindOpenAL.cmake
|
||||
SET(CMAKE_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty;${CMAKE_INCLUDE_PATH}")
|
||||
SET(CMAKE_LIBRARY_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/lib;${CMAKE_LIBRARY_PATH}")
|
||||
IF(NOT DEFINED ENV{QTDIR})
|
||||
SET(ENV{QTDIR} "c:/qt/4.5.0")
|
||||
ENDIF(NOT DEFINED ENV{QTDIR})
|
||||
ENDIF(WIN32)
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||
PROJECT(NeL CXX C)
|
||||
SET(NL_VERSION_MAJOR 0)
|
||||
SET(NL_VERSION_MINOR 7)
|
||||
SET(NL_VERSION_PATCH 0)
|
||||
SET(NL_VERSION "${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}.${NL_VERSION_PATCH}")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Redirect output files
|
||||
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
|
||||
SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Set CMake 2.6 Policies.
|
||||
IF(COMMAND cmake_policy)
|
||||
# Works around warnings libraries linked against that don't
|
||||
# have absolute paths (e.g. -lpthreads)
|
||||
cmake_policy(SET CMP0003 NEW)
|
||||
|
||||
# Works around warnings about escaped quotes in ADD_DEFINITIONS
|
||||
# statements
|
||||
cmake_policy(SET CMP0005 OLD)
|
||||
ENDIF(COMMAND cmake_policy)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Set default config options
|
||||
#
|
||||
NL_SETUP_DEFAULT_OPTIONS()
|
||||
NL_SETUP_PREFIX_PATHS()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#Platform specifics
|
||||
|
||||
FIND_PACKAGE(Threads REQUIRED)
|
||||
FIND_PACKAGE(LibXml2 REQUIRED)
|
||||
FIND_PACKAGE(PNG REQUIRED)
|
||||
FIND_PACKAGE(Jpeg)
|
||||
|
||||
NL_SETUP_BUILD()
|
||||
|
||||
# On Windows we need to find DirectInput for NLMISC.
|
||||
# This is how we get events.
|
||||
IF(WIN32)
|
||||
FIND_PACKAGE(DirectXSDK)
|
||||
|
||||
# On Win32 we can also build the MAX plugins.
|
||||
IF(WITH_MAXPLUGIN)
|
||||
FIND_PACKAGE(3dsMaxSDK)
|
||||
ENDIF(WITH_MAXPLUGIN)
|
||||
ENDIF(WIN32)
|
||||
|
||||
IF(WITH_3D)
|
||||
FIND_PACKAGE(FreeType)
|
||||
|
||||
IF(WITH_DRIVER_OPENGL)
|
||||
FIND_PACKAGE(OpenGL)
|
||||
ENDIF(WITH_DRIVER_OPENGL)
|
||||
|
||||
IF(WITH_CEGUI)
|
||||
FIND_PACKAGE(CEGUI)
|
||||
ENDIF(WITH_CEGUI)
|
||||
|
||||
ENDIF(WITH_3D)
|
||||
|
||||
IF(WITH_SOUND)
|
||||
IF(WITH_DRIVER_OPENAL)
|
||||
FIND_PACKAGE(OpenAL)
|
||||
ENDIF(WITH_DRIVER_OPENAL)
|
||||
|
||||
IF(WITH_DRIVER_FMOD)
|
||||
FIND_PACKAGE(FMOD)
|
||||
ENDIF(WITH_DRIVER_FMOD)
|
||||
|
||||
IF(WITH_DRIVER_XAUDIO2)
|
||||
FIND_PACKAGE(Ogg)
|
||||
FIND_PACKAGE(Vorbis)
|
||||
ENDIF(WITH_DRIVER_XAUDIO2)
|
||||
ENDIF(WITH_SOUND)
|
||||
|
||||
IF(WITH_GTK)
|
||||
FIND_PACKAGE(GTK2)
|
||||
ENDIF(WITH_GTK)
|
||||
|
||||
IF(WITH_QT)
|
||||
FIND_PACKAGE(Qt4 REQUIRED)
|
||||
ENDIF(WITH_QT)
|
||||
|
||||
IF(WITH_TESTS)
|
||||
FIND_PACKAGE(CppTest)
|
||||
|
||||
|
||||
ENABLE_TESTING()
|
||||
ADD_TEST(nel_unit_test ${EXECUTABLE_OUTPUT_PATH}/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_TESTS)
|
||||
|
||||
IF(UNIX)
|
||||
SET(prefix ${CMAKE_INSTALL_PREFIX})
|
||||
SET(exec_prefix ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
SET(libdir "${CMAKE_INSTALL_PREFIX}/lib ${PLATFORM_LINKFLAGS}")
|
||||
SET(includedir "${CMAKE_INSTALL_PREFIX}/include ${PLATFORM_CFLAGS}")
|
||||
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 nel-config)
|
||||
|
||||
INSTALL(PROGRAMS ${CMAKE_BINARY_DIR}/nel-config DESTINATION bin)
|
||||
ENDIF(UNIX)
|
||||
|
||||
IF(WIN32)
|
||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake)
|
||||
|
||||
SET(WINSOCK2_LIB ws2_32.lib)
|
||||
|
||||
ENDIF(WIN32)
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||
|
||||
NL_SETUP_BUILD_FLAGS()
|
||||
|
||||
ADD_SUBDIRECTORY(src)
|
||||
ADD_SUBDIRECTORY(include)
|
||||
|
||||
IF(WITH_SAMPLES)
|
||||
ADD_SUBDIRECTORY(samples)
|
||||
ENDIF(WITH_SAMPLES)
|
||||
|
||||
IF(WITH_TOOLS)
|
||||
IF(WIN32)
|
||||
FIND_PACKAGE(S3TC)
|
||||
ENDIF(WIN32)
|
||||
ADD_SUBDIRECTORY(tools)
|
||||
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)
|
||||
|
||||
# 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}/QtGuid4.dll"
|
||||
"${QT_LIBRARY_DIR}/QtXmld4.dll"
|
||||
"${QT_LIBRARY_DIR}/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}/QtGui4.dll"
|
||||
"${QT_LIBRARY_DIR}/QtXml4.dll"
|
||||
"${QT_LIBRARY_DIR}/QtCore4.dll"
|
||||
DESTINATION bin)
|
||||
ENDIF(WITH_QT)
|
||||
ENDIF(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
|
||||
# Install CEGUI and its dependencies.
|
||||
IF(WITH_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_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)
|
70
code/nel/CMakeModules/Find3dsMaxSDK.cmake
Normal file
70
code/nel/CMakeModules/Find3dsMaxSDK.cmake
Normal file
|
@ -0,0 +1,70 @@
|
|||
# - 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"
|
||||
)
|
||||
|
||||
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"
|
||||
)
|
||||
|
||||
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"
|
||||
)
|
||||
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/nel/CMakeModules/FindCEGUI.cmake
Normal file
53
code/nel/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)
|
51
code/nel/CMakeModules/FindCppTest.cmake
Normal file
51
code/nel/CMakeModules/FindCppTest.cmake
Normal file
|
@ -0,0 +1,51 @@
|
|||
#
|
||||
# Find the CppTest includes and library
|
||||
#
|
||||
# This module defines
|
||||
# CPPTEST_INCLUDE_DIR, where to find tiff.h, etc.
|
||||
# CPPTEST_LIBRARY, where to find the CppTest library.
|
||||
# CPPTEST_FOUND, If false, do not try to use CppTest.
|
||||
|
||||
# also defined, but not for general use are
|
||||
IF(CPPTEST_LIBRARY AND CPPTEST_INCLUDE_DIR)
|
||||
# in cache already
|
||||
SET(CPPTEST_FIND_QUIETLY TRUE)
|
||||
ENDIF(CPPTEST_LIBRARY 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
|
||||
)
|
||||
|
||||
FIND_LIBRARY(CPPTEST_LIBRARY
|
||||
cpptest
|
||||
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_LIBRARY AND CPPTEST_INCLUDE_DIR)
|
||||
SET(CPPTEST_FOUND "YES")
|
||||
IF(NOT CPPTEST_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found CppTest: ${CPPTEST_LIBRARY}")
|
||||
ENDIF(NOT CPPTEST_FIND_QUIETLY)
|
||||
ELSE(CPPTEST_LIBRARY AND CPPTEST_INCLUDE_DIR)
|
||||
IF(NOT CPPTEST_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Warning: Unable to find CppTest!")
|
||||
ENDIF(NOT CPPTEST_FIND_QUIETLY)
|
||||
ENDIF(CPPTEST_LIBRARY AND CPPTEST_INCLUDE_DIR)
|
||||
|
38
code/nel/CMakeModules/FindDInput.cmake
Normal file
38
code/nel/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/nel/CMakeModules/FindDSound.cmake
Normal file
36
code/nel/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)
|
61
code/nel/CMakeModules/FindDirectXSDK.cmake
Normal file
61
code/nel/CMakeModules/FindDirectXSDK.cmake
Normal file
|
@ -0,0 +1,61 @@
|
|||
# - 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_INCLUDE_DIR)
|
||||
# Already in cache, be silent
|
||||
set(DXSDK_FIND_QUIETLY TRUE)
|
||||
endif(DXSDK_INCLUDE_DIR)
|
||||
|
||||
find_path(DXSDK_INCLUDE_DIR dxsdkver.h
|
||||
PATHS
|
||||
"$ENV{DXSDK_DIR}"
|
||||
"$ENV{DXSDK_DIR}/Include"
|
||||
)
|
||||
|
||||
MACRO(FIND_DXSDK_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
||||
FIND_LIBRARY(${MYLIBRARY}
|
||||
NAMES ${MYLIBRARYNAME}
|
||||
PATHS
|
||||
"$ENV{DXSDK_DIR}"
|
||||
"$ENV{DXSDK_DIR}/Lib"
|
||||
"$ENV{DXSDK_DIR}/Lib/x86"
|
||||
)
|
||||
ENDMACRO(FIND_DXSDK_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
||||
|
||||
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)
|
||||
|
||||
# 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_INCLUDE_DIR DXSDK_GUID_LIBRARY)
|
||||
|
||||
if(DirectXSDK_FOUND)
|
||||
message(status " directx found.")
|
||||
SET(DXSDK_LIBRARIES
|
||||
${DXSDK_GUID_LIBRARY}
|
||||
${DXSDK_DINPUT_LIBRARY}
|
||||
${DXSDK_DSOUND_LIBRARY}
|
||||
${DXSDK_D3DX9_LIBRARY}
|
||||
${DXSDK_D3D9_LIBRARY})
|
||||
|
||||
else(DirectXSDK_FOUND)
|
||||
set(DXSDK_LIBRARIES)
|
||||
endif(DirectXSDK_FOUND)
|
||||
|
||||
mark_as_advanced(DXSDK_INCLUDE_DIR DXSDK_LIBRARIES)
|
50
code/nel/CMakeModules/FindFMOD.cmake
Normal file
50
code/nel/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
|
||||
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)
|
50
code/nel/CMakeModules/FindFreeType.cmake
Normal file
50
code/nel/CMakeModules/FindFreeType.cmake
Normal file
|
@ -0,0 +1,50 @@
|
|||
# - 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
|
||||
)
|
||||
|
||||
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/nel/CMakeModules/FindGTK2.cmake
Normal file
452
code/nel/CMakeModules/FindGTK2.cmake
Normal file
|
@ -0,0 +1,452 @@
|
|||
# - Try to find GTK2
|
||||
# Once done this will define
|
||||
#
|
||||
# GTK2_FOUND - System has Boost
|
||||
# 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)
|
||||
|
50
code/nel/CMakeModules/FindJpeg.cmake
Normal file
50
code/nel/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)
|
50
code/nel/CMakeModules/FindOgg.cmake
Normal file
50
code/nel/CMakeModules/FindOgg.cmake
Normal file
|
@ -0,0 +1,50 @@
|
|||
# - 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.h
|
||||
PATHS
|
||||
$ENV{OGG_DIR}/include
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
/opt/csw/include
|
||||
/opt/include
|
||||
PATH_SUFFIXES ogg
|
||||
)
|
||||
|
||||
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/nel/CMakeModules/FindS3TC.cmake
Normal file
50
code/nel/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)
|
66
code/nel/CMakeModules/FindVorbis.cmake
Normal file
66
code/nel/CMakeModules/FindVorbis.cmake
Normal file
|
@ -0,0 +1,66 @@
|
|||
# - 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
|
||||
vorbisfile.h
|
||||
PATHS
|
||||
$ENV{VORBIS_DIR}/include
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
/opt/csw/include
|
||||
/opt/include
|
||||
PATH_SUFFIXES vorbis
|
||||
)
|
||||
|
||||
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)
|
212
code/nel/CMakeModules/nel.cmake
Normal file
212
code/nel/CMakeModules/nel.cmake
Normal file
|
@ -0,0 +1,212 @@
|
|||
###
|
||||
# Build Library Name
|
||||
#
|
||||
# Arguments: name - undecorated library name
|
||||
# Sets: LIBNAME - decorated library name
|
||||
###
|
||||
MACRO(DECORATE_NEL_LIB name)
|
||||
|
||||
IF(WIN32)
|
||||
IF(NL_BUILD_MODE MATCHES "NL_RELEASE_DEBUG")
|
||||
SET(LIBNAME "${name}")
|
||||
ELSE(NL_BUILD_MODE MATCHES "NL_RELEASE_DEBUG")
|
||||
IF(NL_BUILD_MODE MATCHES "NL_DEBUG")
|
||||
SET(LIBNAME "${name}")
|
||||
ELSE(NL_BUILD_MODE MATCHES "NL_DEBUG")
|
||||
SET(LIBNAME "${name}")
|
||||
ENDIF(NL_BUILD_MODE MATCHES "NL_DEBUG")
|
||||
ENDIF(NL_BUILD_MODE MATCHES "NL_RELEASE_DEBUG")
|
||||
ELSE(WIN32)
|
||||
SET(LIBNAME "${name}")
|
||||
ENDIF(WIN32)
|
||||
|
||||
ENDMACRO(DECORATE_NEL_LIB)
|
||||
|
||||
###
|
||||
# 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)
|
||||
|
||||
###
|
||||
# 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_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_CEGUI "Build CEGUI Renderer" OFF)
|
||||
OPTION(WITH_TOOLS "Build NeL Tools" ON )
|
||||
OPTION(WITH_MAXPLUGIN "Build NeL 3dsMax Plugin" OFF)
|
||||
OPTION(WITH_SAMPLES "Build NeL Samples" ON )
|
||||
OPTION(WITH_TESTS "Build NeL Unit Tests" ON )
|
||||
OPTION(WITH_GTK "With GTK Support" OFF)
|
||||
OPTION(WITH_QT "With QT Support" OFF)
|
||||
OPTION(BUILD_DASHBOARD "Build to the CDash dashboard" OFF)
|
||||
ENDMACRO(NL_SETUP_DEFAULT_OPTIONS)
|
||||
|
||||
MACRO(NL_SETUP_BUILD)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Setup the buildmode variables.
|
||||
#
|
||||
# None = NL_RELEASE_DEBUG
|
||||
# Debug = NL_DEBUG
|
||||
# Release = NL_RELEASE
|
||||
# RelWithDebInfo = NL_RELEASE_DEBUG
|
||||
# MinSizeRel = NL_RELEASE_DEBUG
|
||||
|
||||
# None = NL_RELEASE
|
||||
# Debug = NL_DEBUG
|
||||
# Release = NL_RELEASE, NL_NO_DEBUG
|
||||
# RelWithDebInfo = NL_RELEASE
|
||||
# MinSizeRel = NL_RELEASE, NL_NO_DEBUG
|
||||
|
||||
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")
|
||||
ENDIF(CMAKE_BUILD_TYPE MATCHES "Release")
|
||||
ENDIF(CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||
|
||||
IF(WIN32)
|
||||
SET(NL_DEBUG_CFLAGS "/ZI /Gy /GS-")
|
||||
SET(NL_RELEASE_CFLAGS "/Ox /Ob2 /Oi /Ot /Oy /GT /GF")
|
||||
SET(NL_RELEASEDEBUG_CFLAGS "/DNL_RELEASE_DEBUG /Ob2 /GF")
|
||||
ELSE(WIN32)
|
||||
SET(PLATFORM_CFLAGS "-ftemplate-depth-24 -D_REENTRANT -Wall -ansi -W -Wpointer-arith -Wsign-compare -Wno-deprecated-declarations -Wno-multichar -Wno-long-long -Wno-unused")
|
||||
IF(WITH_COVERAGE)
|
||||
SET(PLATFORM_CFLAGS "-fprofile-arcs -ftest-coverage ${PLATFORM_CFLAGS}")
|
||||
ENDIF(WITH_COVERAGE)
|
||||
SET(PLATFORM_LINKFLAGS "${CMAKE_THREAD_LIBS_INIT} -lc -lm -lstdc++ -lrt")
|
||||
SET(NL_DEBUG_CFLAGS "-DNL_DEBUG -g")
|
||||
SET(NL_RELEASE_CFLAGS "-DNL_RELEASE -O6")
|
||||
SET(NL_RELEASEDEBUG_CFLAGS "-DNL_RELEASE_DEBUG -g -finline-functions -O3 ")
|
||||
SET(NL_NONE_CFLAGS "-DNL_RELEASE -g -finline-functions -O2 ")
|
||||
ENDIF(WIN32)
|
||||
|
||||
# Determine host CPU
|
||||
IF(UNIX AND NOT WIN32)
|
||||
FIND_PROGRAM(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
|
||||
IF(CMAKE_UNAME)
|
||||
EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_SYSTEM_PROCESSOR)
|
||||
SET(CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR} CACHE INTERNAL "processor type (i386 and x86_64)")
|
||||
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
|
||||
ADD_DEFINITIONS(-DHAVE_X86_64)
|
||||
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "ia64")
|
||||
ADD_DEFINITIONS(-DHAVE_IA64)
|
||||
ELSE(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
|
||||
ADD_DEFINITIONS(-DHAVE_X86)
|
||||
ENDIF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
|
||||
ELSE(CMAKE_UNAME) # Assume that if uname is not found that we're x86.
|
||||
ADD_DEFINITIONS(-DHAVE_X86)
|
||||
ENDIF(CMAKE_UNAME)
|
||||
ENDIF(UNIX AND NOT WIN32)
|
||||
|
||||
ENDMACRO(NL_SETUP_BUILD)
|
||||
|
||||
MACRO(NL_SETUP_BUILD_FLAGS)
|
||||
#SET(CMAKE_DEBUG_POSTFIX "_d")
|
||||
#SET(CMAKE_RELEASE_POSTFIX "_r")
|
||||
|
||||
## None
|
||||
#SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${NL_NONE_CFLAGS} ${PLATFORM_CFLAGS} ")
|
||||
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${NL_NONE_CFLAGS} ${PLATFORM_CFLAGS} ")
|
||||
|
||||
## Debug
|
||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${NL_DEBUG_CFLAGS} ${PLATFORM_CFLAGS} ")
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${NL_DEBUG_CFLAGS} ${PLATFORM_CFLAGS} ")
|
||||
|
||||
## Release
|
||||
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${NL_RELEASE_CFLAGS} ${PLATFORM_CFLAGS} ")
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${NL_RELEASE_CFLAGS} ${PLATFORM_CFLAGS} ")
|
||||
|
||||
## RelWithDebInfo
|
||||
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${NL_RELEASEDEBUG_CFLAGS} ${PLATFORM_CFLAGS} ")
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${NL_RELEASEDEBUG_CFLAGS} ${PLATFORM_CFLAGS} ")
|
||||
|
||||
## MinSizeRel
|
||||
SET(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} ${NL_RELEASEDEBUG_CFLAGS} ${PLATFORM_CFLAGS} ")
|
||||
SET(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${NL_RELEASEDEBUG_CFLAGS} ${PLATFORM_CFLAGS} ")
|
||||
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)
|
||||
|
||||
ENDMACRO(NL_SETUP_PREFIX_PATHS)
|
109
code/nel/CMakePackaging.txt
Normal file
109
code/nel/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/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/>.
|
13
code/nel/CTestConfig.cmake
Normal file
13
code/nel/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 "NeL")
|
||||
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
|
||||
|
||||
set(CTEST_DROP_METHOD "http")
|
||||
set(CTEST_DROP_SITE "www.opennel.org")
|
||||
set(CTEST_DROP_LOCATION "/cdash/submit.php?project=NeL")
|
||||
set(CTEST_DROP_SITE_CDASH TRUE)
|
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.5.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 samples 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 _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 _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)
|
||||
{
|
||||
nlassert(owner);
|
||||
_Owner= owner;
|
||||
|
||||
nlassert((uint)UAnimationSet::NotFound == (uint)CAnimationSet::NotFound );
|
||||
|
||||
// create a smartptred animation set. Allow header compression
|
||||
_AnimationSet= new CAnimationSet(true);
|
||||
}
|
||||
|
||||
/// 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 */
|
113
code/nel/include/nel/3d/camera_col.h
Normal file
113
code/nel/include/nel/3d/camera_col.h
Normal file
|
@ -0,0 +1,113 @@
|
|||
// 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_COL_H
|
||||
#define NL_CAMERA_COL_H
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/vector.h"
|
||||
#include "nel/misc/plane.h"
|
||||
|
||||
|
||||
namespace NL3D {
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
/**
|
||||
* A tool class used to compute differents info for camera collision
|
||||
* \author Lionel Berenguier
|
||||
* \author Nevrax France
|
||||
* \date 2003
|
||||
*/
|
||||
class CCameraCol
|
||||
{
|
||||
public:
|
||||
CCameraCol();
|
||||
|
||||
/** build the camera collision as a cone or a cylinder
|
||||
*/
|
||||
void build(const CVector &start, const CVector &end, float radius, bool cone);
|
||||
|
||||
/** build the camera collision as a simple ray
|
||||
*/
|
||||
void buildRay(const CVector &start, const CVector &end);
|
||||
|
||||
/** compute the intersection of the Camera Volume against the triangle, and minimize
|
||||
* minDist (actual square of distance) with min sqr distance of the poly.
|
||||
*/
|
||||
void minimizeDistanceAgainstTri(const CVector &p0, const CVector &p1, const CVector &p2, float &sqrMinDist);
|
||||
|
||||
/** Compute into this the camera collision 'other' mul by 'matrix'
|
||||
* NB: for cone Radius, suppose uniform scale, else will have strange result (a uniform scale is deduced)
|
||||
*/
|
||||
void setApplyMatrix(const CCameraCol &other, const NLMISC::CMatrix &matrix);
|
||||
|
||||
/** Get The World Bbox enclosing the camera collision volume
|
||||
*/
|
||||
const NLMISC::CAABBox &getBBox() const {return _BBox;}
|
||||
|
||||
/** Get the length of the ray built
|
||||
*/
|
||||
float getRayLen() const {return _RayLen;}
|
||||
|
||||
bool isSimpleRay() const { return _SimpleRay; }
|
||||
|
||||
private:
|
||||
enum {MaxNPlanes=6};
|
||||
|
||||
// The start of the camera raycast
|
||||
CVector _Start;
|
||||
// The end of the camera raycast
|
||||
CVector _End;
|
||||
// The radius (at end only if cone)
|
||||
float _Radius;
|
||||
// cone or cylinder?
|
||||
bool _Cone;
|
||||
// Simple Ray?
|
||||
bool _SimpleRay;
|
||||
|
||||
// The World Bbox enclosing the camera collision volume
|
||||
NLMISC::CAABBox _BBox;
|
||||
|
||||
// Temp Data for minimizeDistanceAgainstTri
|
||||
CVector _ArrayIn[3+MaxNPlanes];
|
||||
CVector _ArrayOut[3+MaxNPlanes];
|
||||
|
||||
// The pyramid representing the camera collision volume. Nb: local to start for precision problems
|
||||
NLMISC::CPlane _Pyramid[MaxNPlanes];
|
||||
uint _NPlanes;
|
||||
|
||||
// For Camera smoothing. => the pyramid is bigger
|
||||
float _MaxRadius;
|
||||
// projection of the radius at 1 meter
|
||||
float _MinRadiusProj;
|
||||
float _MaxRadiusProj;
|
||||
float _OODeltaRadiusProj;
|
||||
float _RayLen;
|
||||
CVector _RayNorm;
|
||||
|
||||
// simpler method for simple ray
|
||||
void intersectRay(const CVector &p0, const CVector &p1, const CVector &p2, float &sqrMinDist);
|
||||
|
||||
};
|
||||
|
||||
|
||||
} // NL3D
|
||||
|
||||
|
||||
#endif // NL_CAMERA_COL_H
|
||||
|
||||
/* End of camera_col.h */
|
484
code/nel/include/nel/3d/channel_mixer.h
Normal file
484
code/nel/include/nel/3d/channel_mixer.h
Normal file
|
@ -0,0 +1,484 @@
|
|||
// 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_CHANNEL_MIXER_H
|
||||
#define NL_CHANNEL_MIXER_H
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/debug.h"
|
||||
#include "nel/misc/smart_ptr.h"
|
||||
#include "nel/3d/animation_time.h"
|
||||
#include "nel/3d/animation_set.h"
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
class CAnimation;
|
||||
class IAnimatable;
|
||||
class IAnimatedValue;
|
||||
class ITrack;
|
||||
class CAnimationSet;
|
||||
|
||||
/**
|
||||
* A channel mixer. Animated value are registred in it.
|
||||
* Each animated value create a channel in the mixer. Then, mixer animates
|
||||
* all those channels with 1 to CChannelMixer::NumAnimationSlot animations.
|
||||
*
|
||||
* Animation are referenced in an animation slot (CSlot).
|
||||
*
|
||||
* Each slot have an IAnimation pointer, a weight for this animation
|
||||
* between [0.f ~ 1.f] and a time for this animation.
|
||||
*
|
||||
* Each CChannel have a weight on each animation slot between [0.f ~ 1.f].
|
||||
*
|
||||
* Blending is normalized internaly so, weight sum have not to be == 1.f.
|
||||
*
|
||||
* \author Cyril 'Hulud' Corvazier
|
||||
* \author Nevrax France
|
||||
* \date 2001
|
||||
*/
|
||||
class CChannelMixer : public NLMISC::CRefCount
|
||||
{
|
||||
public:
|
||||
|
||||
/// \name Const values
|
||||
|
||||
enum
|
||||
{
|
||||
/// Number of animation slot in the CChannelMixer
|
||||
NumAnimationSlot=8
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
/// \name Internal classes
|
||||
|
||||
/// An animation slot.
|
||||
class CSlot
|
||||
{
|
||||
friend class CChannelMixer;
|
||||
|
||||
/// Default Ctor
|
||||
CSlot ()
|
||||
{
|
||||
// Not modified
|
||||
_Dirt=false;
|
||||
|
||||
// default is 1.
|
||||
_Weight= 1.f;
|
||||
|
||||
// Set it empty
|
||||
empty ();
|
||||
}
|
||||
|
||||
/// Empty the slot
|
||||
void empty ()
|
||||
{
|
||||
_Animation=NULL;
|
||||
_SkeletonWeight=NULL;
|
||||
_InvertedSkeletonWeight=false;
|
||||
}
|
||||
|
||||
/// Is the slot empty ?
|
||||
bool isEmpty ()
|
||||
{
|
||||
return _Animation==NULL;
|
||||
}
|
||||
|
||||
private:
|
||||
/// Animation pointer to use by this slot. If NULL, slot is empty.
|
||||
const CAnimation* _Animation;
|
||||
|
||||
/// Skeleton weight pointer
|
||||
const CSkeletonWeight* _SkeletonWeight;
|
||||
|
||||
/// Skeleton weight pointer inverted or not
|
||||
bool _InvertedSkeletonWeight;
|
||||
|
||||
/// Time to use to eval the animation.
|
||||
TAnimationTime _Time;
|
||||
|
||||
/**
|
||||
* Global weight to apply to the animation of this slot.
|
||||
* This weight can be given in any range because renormalisation is done in final
|
||||
* weight evaluation. If weight is 0.f, the final mix is not influenced by the animation
|
||||
* of this slot.
|
||||
*/
|
||||
float _Weight;
|
||||
|
||||
/// Dirt flag. True if the animation of this slot as been modified
|
||||
bool _Dirt;
|
||||
};
|
||||
|
||||
/**
|
||||
* An animated channel of the CChannelMixer. This class is used internaly in the
|
||||
* CChannelMixer.
|
||||
*
|
||||
* \author Cyril 'Hulud' Corvazier
|
||||
* \author Nevrax France
|
||||
* \date 2001
|
||||
*/
|
||||
class CChannel
|
||||
{
|
||||
friend class CChannelMixer;
|
||||
public:
|
||||
enum {EnableUserFlag= 1, EnableLodFlag= 2, EnableAllFlag= 3};
|
||||
|
||||
public:
|
||||
/// Default ctor
|
||||
CChannel ()
|
||||
{
|
||||
// not in the list
|
||||
_InTheList=false;
|
||||
// enabled by default.
|
||||
_EnableFlags= EnableAllFlag;
|
||||
}
|
||||
private:
|
||||
/// True if this channel is in the list
|
||||
bool _InTheList;
|
||||
|
||||
/// the detail mode.
|
||||
bool _Detail;
|
||||
|
||||
/// enabled Flags. User | Lod
|
||||
uint8 _EnableFlags;
|
||||
|
||||
/// Is this Animated Value a CQuat Animated Value???
|
||||
bool _IsQuat;
|
||||
|
||||
|
||||
/// Name of the channel in the channel mixer. Must be the same than the animated value name.
|
||||
std::string _ChannelName;
|
||||
|
||||
/// A pointer on the IAnimatable object that handles the channel value. (ref ptr to ensure Animated value access)
|
||||
NLMISC::CRefPtr<IAnimatable> _Object;
|
||||
|
||||
/// A pointer on the IAnimatedValue animated by this channel. If NULL, the channel is empty
|
||||
IAnimatedValue* _Value;
|
||||
|
||||
/// The id of the animated value in the IAnimatable object.
|
||||
uint32 _ValueId;
|
||||
|
||||
/// The id of the OwnerBit to touch the IAnimatable object. Useful for IAnimatable derivation.
|
||||
uint32 _OwnerValueId;
|
||||
|
||||
/// The default track pointer used when track are missing in the animation. Can't be NULL.
|
||||
const ITrack* _DefaultTracks;
|
||||
|
||||
/**
|
||||
* A track pointer on each slot CAnimation. Can't be NULL. If no track found for this
|
||||
* channel, the pointer is _DefaultTracks.
|
||||
*/
|
||||
const ITrack* _Tracks[NumAnimationSlot];
|
||||
|
||||
/**
|
||||
* A weight array for to blend each slot.
|
||||
* This value must be between 0.f and 1.f. If it is 0.f, the slot is not used. If it is 1.f,
|
||||
* the slot is used at 100%. This weight can be set using a "skeleton template weight".
|
||||
* Default value is 1.f.
|
||||
*/
|
||||
float _Weights[NumAnimationSlot];
|
||||
|
||||
/**
|
||||
* Pointer on the next channel selected for the animations selected in the slots
|
||||
*
|
||||
* This list is used to only visit the channels animated by the animations set in the slots
|
||||
* of the mixer
|
||||
*/
|
||||
CChannel* _Next;
|
||||
|
||||
};
|
||||
public:
|
||||
/// Constructor. The default constructor resets the slots and the channels.
|
||||
CChannelMixer();
|
||||
~CChannelMixer();
|
||||
|
||||
/// \name Setup the mixer
|
||||
|
||||
/**
|
||||
* Set the animation set used by this channel mixer.
|
||||
* The pointer is hold by the channel mixer until it changes.
|
||||
*/
|
||||
void setAnimationSet (const CAnimationSet* animationSet);
|
||||
|
||||
/**
|
||||
* Get the animation set used by this channel mixer.
|
||||
* The pointer is hold by the channel mixer until it changes. Return NULL if no animationSet defined.
|
||||
*/
|
||||
const CAnimationSet* getAnimationSet () const;
|
||||
|
||||
/**
|
||||
* Launch evaluation of all channels.
|
||||
*
|
||||
* This is the main method. It evals animations selected in the slots for listed
|
||||
* channels.
|
||||
*
|
||||
* Only the channels that are animated by animations selected in the slots are evaluated.
|
||||
* They are stored in a linked list managed by the channel array.
|
||||
*
|
||||
* Others are initialized with the default channel value.
|
||||
*
|
||||
* \param detail true if eval the detail part of animation. (done after clipping).
|
||||
* \param evalDetailDate chann mixer store the last date of anim detail evaluated. if same, do nothing,
|
||||
* else if < or >, compute the anim. ingored if detail is false.
|
||||
*/
|
||||
void eval (bool detail, uint64 evalDetailDate=0);
|
||||
|
||||
/**
|
||||
* Launch evaluation of some channels.
|
||||
*
|
||||
* \param channelIdArray array that contains the id of the channel to eval.
|
||||
* \param numID number of ids in the array
|
||||
*
|
||||
*/
|
||||
void evalChannels(sint *channelIdArray, uint numID);
|
||||
|
||||
/**
|
||||
* Force evaluation of a single channel
|
||||
*/
|
||||
inline void evalSingleChannel(sint channelId);
|
||||
|
||||
/// \name Channel access
|
||||
|
||||
/**
|
||||
* Add a channel for a specific value of an IAnimatable object.
|
||||
* Warning: this method will assign the default value in the animated value.
|
||||
*
|
||||
* \param channelName is the name of the channel.
|
||||
* \param animatable is a pointer on the IAnimatable object in which the value is stored. It will be kept
|
||||
* by the CChannelMixer until it is removed from the channel.
|
||||
* \param value is a pointer on the value the channel works with. It will be kept
|
||||
* by the CChannelMixer until it is removed from the channel.
|
||||
* \param defaultValue is a track used by default if a track is not presents in the animation for this channel.
|
||||
* It will be kept by the CChannelMixer until it is removed from the channel.
|
||||
* \param valueId is the value ID in the IAnimatable object.
|
||||
* \param ownerId is the owner Bit of the animated vlaue, in the IAnimatable object. touched when the animatedvalue is touched.
|
||||
* \param detail true if this channel must be evaluated in detail mode (see eval()).
|
||||
* \return -1 if the track was not found in the animationSet, else it return the channelId
|
||||
* as if returned by CAnimationSet::getChannelIdByName(channelName).
|
||||
*/
|
||||
sint addChannel (const std::string& channelName, IAnimatable* animatable, IAnimatedValue* value, ITrack* defaultValue, uint32 valueId, uint32 ownerValueId, bool detail);
|
||||
|
||||
/// Reset the channel list if the mixer. All channels are removed from the mixer.
|
||||
void resetChannels ();
|
||||
|
||||
|
||||
/** disabling a channel means it is no more modified during animation. Default is enabled.
|
||||
* NB: this channel must have been added (via addChannel()....).
|
||||
* \param channelId channelId get from CAnimationSet::getChannelIdByName() or addChannel()
|
||||
*/
|
||||
void enableChannel (uint channelId, bool enable);
|
||||
|
||||
/** see enableChannel(). return false if channel does not exist...
|
||||
* \param channelId channelId get from CAnimationSet::getChannelIdByName() or addChannel()
|
||||
*/
|
||||
bool isChannelEnabled (uint channelId) const;
|
||||
|
||||
/** Same as enableChannel but for Animation Lod system. The channel is animated only if both
|
||||
* enableChannel() and lodEnableChannel() are true. Default is enabled.
|
||||
* NB: this channel must have been added (via addChannel()....).
|
||||
* \param channelId channelId get from CAnimationSet::getChannelIdByName() or addChannel()
|
||||
*/
|
||||
void lodEnableChannel (uint channelId, bool enable);
|
||||
|
||||
/** see enableChannel(). return false if channel does not exist...
|
||||
* \param channelId channelId get from CAnimationSet::getChannelIdByName() or addChannel()
|
||||
*/
|
||||
bool isChannelLodEnabled (uint channelId) const;
|
||||
|
||||
|
||||
/// \name Slots acces
|
||||
|
||||
/**
|
||||
* Set slot animation.
|
||||
*
|
||||
* You must set an animationSet in the channel mixer before calling this.
|
||||
*
|
||||
* Calling this method will dirt the mixer, ie, all the mixer's channels will
|
||||
* be visited to check if they are used by the new animation. If they are, they
|
||||
* will be linked in the internal CChannel list.
|
||||
*
|
||||
* \param slot is the slot number to change the animation. Must be >= 0 and < NumAnimationSlot.
|
||||
* \param animation is the new animation index in the animationSet use by this slot.
|
||||
* \see CAnimationSet, CAnimation
|
||||
*/
|
||||
void setSlotAnimation (uint slot, uint animation);
|
||||
|
||||
/// Get the animation used by a given slot
|
||||
const CAnimation *getSlotAnimation(uint slot) const;
|
||||
|
||||
/**
|
||||
* Set time of a slot.
|
||||
*
|
||||
* This time will be used to eval the animation set in this slot.
|
||||
* Each slot can have different time.
|
||||
*
|
||||
* Calling this method won't dirt the mixer.
|
||||
*
|
||||
* \param slot is the slot number to change the time. Must be >= 0 and < NumAnimationSlot.
|
||||
* \param time is the new time to use in the slot.
|
||||
* \see TAnimationTime
|
||||
*/
|
||||
void setSlotTime (uint slot, TAnimationTime time)
|
||||
{
|
||||
// Check alot arg
|
||||
nlassert (slot<NumAnimationSlot);
|
||||
|
||||
// Set the time
|
||||
_SlotArray[slot]._Time=time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set slot weight.
|
||||
*
|
||||
* This weight will be used to eval the animation set in this slot.
|
||||
* Each slot can have different weight. Calling this method won't dirt the mixer.
|
||||
*
|
||||
* By default the weight of the slot is 1.0f.
|
||||
*
|
||||
* \param slot is the slot number to change the weight.
|
||||
* \param weight is the new weight to use in the slot. No range for this weight. If the weight == 0.f,
|
||||
* the slot have no effect on the final mix.
|
||||
*/
|
||||
void setSlotWeight (uint slot, float weight)
|
||||
{
|
||||
// Check alot arg
|
||||
nlassert (slot<NumAnimationSlot);
|
||||
|
||||
// Set the time
|
||||
_SlotArray[slot]._Weight=weight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Empty a slot.
|
||||
*
|
||||
* Calling this method will dirt the mixer, ie, all the mixer's channels will
|
||||
* be visited to check if they are used by the old animation. If they are, they
|
||||
* will be linked in the internal CChannel list.
|
||||
*
|
||||
* Warning: this method will assign the default value in the animated value that are removed from the active channel queue.
|
||||
*
|
||||
* \param slot is the slot number to empty. Must be >= 0 and < NumAnimationSlot.
|
||||
*/
|
||||
void emptySlot (uint slot);
|
||||
|
||||
/**
|
||||
* Reset the slot of the mixer. All slot will be empty.
|
||||
*
|
||||
* Calling this method will dirt the mixer, ie, all the mixer's channels will
|
||||
* be visited to check if they are used by the old animation. If they are, they
|
||||
* will be linked in the internal CChannel list.
|
||||
*
|
||||
*/
|
||||
void resetSlots ();
|
||||
|
||||
/**
|
||||
* Apply a skeleton template weight on a specific slot.
|
||||
*
|
||||
* This method apply the weight of each node contains in skelWeight to the channel's slot weight.
|
||||
*
|
||||
* \param slot is the slot number to empty. Must be >= 0 and < NumAnimationSlot.
|
||||
* \param skeleton is the index of a skeleton in the animationSet.
|
||||
* \param invert is true if the weights to attach to the channels are the weights of the skeleton template.
|
||||
* false if the weights to attach to the channels are the 1.f-weights of the skeleton template.
|
||||
*/
|
||||
void applySkeletonWeight (uint slot, uint skeleton, bool invert=false);
|
||||
|
||||
/**
|
||||
* Reset the skeleton weight for a specific slot.
|
||||
*
|
||||
* This method apply set each channel's slot weight to 1.f.
|
||||
*
|
||||
* \param slot is the slot number to empty. Must be >= 0 and < NumAnimationSlot.
|
||||
*/
|
||||
void resetSkeletonWeight (uint slot);
|
||||
|
||||
/// reset to -1 the evalDetailDate. Hence next eval(true,..) will be forced to compute
|
||||
void resetEvalDetailDate();
|
||||
|
||||
private:
|
||||
|
||||
/// /name Internal methods
|
||||
|
||||
/// Clean the mixer
|
||||
void cleanAll ();
|
||||
|
||||
/// Dirt all slots
|
||||
void dirtAll ();
|
||||
|
||||
/// Refresh channel list
|
||||
void refreshList ();
|
||||
|
||||
// The slot array
|
||||
CSlot _SlotArray[NumAnimationSlot];
|
||||
|
||||
// The animation set
|
||||
const CAnimationSet* _AnimationSet;
|
||||
|
||||
// The set of CChannel infos. Only channels added by addChannel are present.
|
||||
std::map<uint, CChannel> _Channels;
|
||||
|
||||
// The first Global channel. If NULL, no channel to animate. (animed in eval(false))
|
||||
CChannel* _FirstChannelGlobal;
|
||||
|
||||
// The first detail channel. If NULL, no channel to animate. (animed in eval(true))
|
||||
CChannel* _FirstChannelDetail;
|
||||
|
||||
// last date of evalDetail().
|
||||
sint64 _LastEvalDetailDate;
|
||||
|
||||
// The channels list is dirty if true.
|
||||
bool _Dirt;
|
||||
|
||||
// true if must update animateList. (set in refreshList())
|
||||
bool _ListToEvalDirt;
|
||||
|
||||
// Raw lists of channels to animate, acording to _EnableFlags
|
||||
std::vector<CChannel*> _GlobalListToEval;
|
||||
std::vector<CChannel*> _DetailListToEval;
|
||||
|
||||
/// Refresh animate list
|
||||
void refreshListToEval ();
|
||||
|
||||
/**
|
||||
* Force evaluation of a single channel
|
||||
*
|
||||
* \param chan the channel to eval
|
||||
* \param numActiveSlots number of active slots
|
||||
* \param activeSlot array of contiguous slots ids (there are 'numActiveSlots' of them)
|
||||
*/
|
||||
void evalSingleChannel (CChannel &chan, uint numActiveSlots, uint activeSlot[NumAnimationSlot]);
|
||||
};
|
||||
|
||||
|
||||
/////////////
|
||||
// INLINES //
|
||||
/////////////
|
||||
|
||||
inline void CChannelMixer::evalSingleChannel(sint channelId)
|
||||
{
|
||||
evalChannels(&channelId, 1);
|
||||
}
|
||||
|
||||
|
||||
} // NL3D
|
||||
|
||||
|
||||
#endif // NL_CHANNEL_MIXER_H
|
||||
|
||||
/* End of channel_mixer.h */
|
190
code/nel/include/nel/3d/clip_trav.h
Normal file
190
code/nel/include/nel/3d/clip_trav.h
Normal file
|
@ -0,0 +1,190 @@
|
|||
// 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_CLIP_TRAV_H
|
||||
#define NL_CLIP_TRAV_H
|
||||
|
||||
#include "nel/3d/trav_scene.h"
|
||||
#include "nel/3d/quad_grid.h"
|
||||
#include "nel/3d/transform.h"
|
||||
#include "nel/misc/vector.h"
|
||||
#include "nel/misc/plane.h"
|
||||
#include "nel/misc/matrix.h"
|
||||
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
using NLMISC::CVector;
|
||||
using NLMISC::CPlane;
|
||||
using NLMISC::CMatrix;
|
||||
|
||||
|
||||
class CRenderTrav;
|
||||
class CAnimDetailTrav;
|
||||
class CLoadBalancingTrav;
|
||||
class CHrcTrav;
|
||||
class CLightTrav;
|
||||
class CCluster;
|
||||
class CInstanceGroup;
|
||||
class CCamera;
|
||||
class CQuadGridClipManager;
|
||||
class CTransform;
|
||||
class CSkeletonModel;
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// This is the order of clip planes.
|
||||
#define NL3D_CLIP_PLANE_NEAR 0
|
||||
#define NL3D_CLIP_PLANE_FAR 1
|
||||
#define NL3D_CLIP_PLANE_LEFT 2
|
||||
#define NL3D_CLIP_PLANE_TOP 3
|
||||
#define NL3D_CLIP_PLANE_RIGHT 4
|
||||
#define NL3D_CLIP_PLANE_BOTTOM 5
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
/**
|
||||
* The clip traversal.
|
||||
* The purpose of this traversal is to insert in the post-clip Traversal the models which are
|
||||
* said to be not clipped.
|
||||
*
|
||||
* Models should use the CTransform->clip() method to implement their models, or completly redefine the traverseClip() method.
|
||||
*
|
||||
* \b USER \b RULES: Before using traverse() on a clip traversal, you should:
|
||||
* - setFrustum() the camera shape (focale....)
|
||||
* - setCamMatrix() for the camera transform
|
||||
*
|
||||
* NB: see CScene for 3d conventions (orthonormal basis...)
|
||||
* \author Lionel Berenguier
|
||||
* \author Nevrax France
|
||||
* \date 2000
|
||||
*/
|
||||
class CClipTrav : public CTravCameraScene
|
||||
{
|
||||
public:
|
||||
|
||||
/// Constructor
|
||||
CClipTrav();
|
||||
~CClipTrav();
|
||||
|
||||
/// traverse
|
||||
void traverse ();
|
||||
|
||||
void registerCluster (CCluster* pCluster);
|
||||
void unregisterCluster (CCluster* pCluster);
|
||||
|
||||
/// Setup the render traversal (else traverse() won't work)
|
||||
void setQuadGridClipManager(CQuadGridClipManager *mgr);
|
||||
const CQuadGridClipManager *getQuadGridClipManager() const {return _QuadGridClipManager;}
|
||||
|
||||
/// \name Visible List mgt. Those visible models are updated each traverse().
|
||||
//@{
|
||||
// NB: list is cleared at begining of traverse().
|
||||
void addVisibleModel(CTransform *model)
|
||||
{
|
||||
model->_IndexInVisibleList= _CurrentNumVisibleModels;
|
||||
_VisibleList[_CurrentNumVisibleModels]= model;
|
||||
_CurrentNumVisibleModels++;
|
||||
}
|
||||
// for createModel().
|
||||
void reserveVisibleList(uint numModels);
|
||||
//@}
|
||||
|
||||
|
||||
/// \name Cluster system related methods.
|
||||
//@{
|
||||
/** Retrieve a list of clusters for which the position is inside. At least return the RootCluster one
|
||||
*/
|
||||
bool fullSearch (std::vector<CCluster*>& result, const CVector& pos);
|
||||
|
||||
/// Set cluster tracking on/off (ie storage of the visible cluster during clip traversal)
|
||||
void setClusterVisibilityTracking(bool track);
|
||||
/// Check the activation of cluster visibility tracking.
|
||||
bool getClusterVisibilityTracking();
|
||||
/// Add a visible cluster to the list
|
||||
void addVisibleCluster(CCluster *cluster);
|
||||
/** Return the list of cluster visible after the clip traversal
|
||||
* You must activate the cluster tracking to obtain a result.
|
||||
*/
|
||||
const std::vector<CCluster*> &getVisibleClusters();
|
||||
|
||||
bool _TrackClusterVisibility;
|
||||
std::vector<CCluster*> _VisibleClusters;
|
||||
//@}
|
||||
|
||||
|
||||
public:
|
||||
|
||||
/** \name FOR MODEL TRAVERSAL ONLY. (Read only)
|
||||
* Those variables are valid only in traverse*().
|
||||
*/
|
||||
//@{
|
||||
/// Vision Pyramid (6 normalized planes) in the view basis.
|
||||
std::vector<CPlane> ViewPyramid;
|
||||
/// Vision Pyramid (6 normalized planes) in the world basis. NB: NOT modified by the ClusterSystem.
|
||||
std::vector<CPlane> WorldFrustumPyramid;
|
||||
/// Vision Pyramid in the world basis. NB: may be modified by the ClusterSystem.
|
||||
std::vector<CPlane> WorldPyramid;
|
||||
//@}
|
||||
sint64 CurrentDate;
|
||||
|
||||
CCluster *RootCluster;
|
||||
CCamera *Camera;
|
||||
|
||||
CQuadGrid<CCluster*> Accel;
|
||||
|
||||
/** for CQuadGridClipClusterClip only. This flag means models traversed do not need to clip,
|
||||
* they are sure to be visible.
|
||||
*/
|
||||
bool ForceNoFrustumClip;
|
||||
|
||||
|
||||
// **********************
|
||||
private:
|
||||
friend class CTransform;
|
||||
std::vector<CTransform*> _VisibleList;
|
||||
uint32 _CurrentNumVisibleModels;
|
||||
|
||||
CQuadGridClipManager *_QuadGridClipManager;
|
||||
|
||||
// For skeleton CLod Load balancing
|
||||
struct CSkeletonKey
|
||||
{
|
||||
uint Priority;
|
||||
CSkeletonModel *SkeletonModel;
|
||||
|
||||
bool operator<(const CSkeletonKey &k) const
|
||||
{
|
||||
return Priority<k.Priority;
|
||||
}
|
||||
};
|
||||
std::vector<CSkeletonKey> _TmpSortSkeletons;
|
||||
|
||||
void loadBalanceSkeletonCLod();
|
||||
|
||||
// clip the shadow casters to know if they still need some process
|
||||
void clipShadowCasters();
|
||||
};
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif // NL_CLIP_TRAV_H
|
||||
|
||||
/* End of clip_trav.h */
|
162
code/nel/include/nel/3d/cloud.h
Normal file
162
code/nel/include/nel/3d/cloud.h
Normal file
|
@ -0,0 +1,162 @@
|
|||
// 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_CLOUD_H
|
||||
#define NL_CLOUD_H
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
||||
#include "nel/3d/camera.h"
|
||||
#include "nel/3d/material.h"
|
||||
#include "nel/3d/texture.h"
|
||||
#include "nel/3d/texture_mem.h"
|
||||
#include "nel/3d/vertex_buffer.h"
|
||||
#include "nel/misc/smart_ptr.h"
|
||||
#include "nel/misc/geom_ext.h"
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
class CNoise3d;
|
||||
class CCloudScape;
|
||||
struct SCloudTexture3D;
|
||||
struct SCloudTextureClamp;
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
class CCloud
|
||||
{
|
||||
public:
|
||||
|
||||
CCloud (CCloudScape *pCloudScape);
|
||||
|
||||
~CCloud ();
|
||||
|
||||
void init (uint32 nVoxelW, uint32 nVoxelH, uint32 nVoxelD, float rBaseFreq, uint32 nNbOctave);
|
||||
void generate (CNoise3d &noise);
|
||||
void light ();
|
||||
|
||||
void reset (NL3D::CCamera *pViewer);
|
||||
|
||||
void anim (double dt, double dt2);
|
||||
|
||||
// Debug
|
||||
void disp ();
|
||||
void dispXYZ (NL3D::CMaterial *pMat = NULL);
|
||||
// Debug
|
||||
|
||||
// Create the billboard (in the screen at pos (NbW*Width, 0)
|
||||
void genBill (NL3D::CCamera *pViewer, uint32 nBillSize=128);
|
||||
|
||||
// Display billboard to the screen
|
||||
void dispBill (NL3D::CCamera *pViewer);
|
||||
|
||||
// Accessors
|
||||
|
||||
float getX() { return _Pos.x; }
|
||||
float getLastX() { return _LastX; }
|
||||
float getY() { return _Pos.y; }
|
||||
float getZ() { return _Pos.z; }
|
||||
|
||||
float getSizeX() { return _Size.x; }
|
||||
float getSizeY() { return _Size.y; }
|
||||
float getSizeZ() { return _Size.z; }
|
||||
|
||||
void setX(float x) { _Pos.x = x; _LastX = x; }
|
||||
void setY(float y) { _Pos.y = y; }
|
||||
void setZ(float z) { _Pos.z = z; }
|
||||
|
||||
void setSizeX(float x) { _Size.x = x; }
|
||||
void setSizeY(float y) { _Size.y = y; }
|
||||
void setSizeZ(float z) { _Size.z = z; }
|
||||
|
||||
void setTexClamp (SCloudTextureClamp &t) { _CloudTexClamp = &t; }
|
||||
void setTex3DTemp (SCloudTexture3D &t) { _CloudTexTmp = &t; }
|
||||
|
||||
void setLooping () { _WaitState = 2; }
|
||||
|
||||
uint32 getBillSize() { return _BillSize; }
|
||||
|
||||
uint32 getMemSize ()
|
||||
{
|
||||
return _OldBillSize*_OldBillSize*4 + _BillSize*_BillSize*4;
|
||||
}
|
||||
|
||||
//uint32 Trans, TransTotal;
|
||||
double Time, FuturTime;
|
||||
|
||||
NLMISC::CRGBA CloudDiffuse;
|
||||
NLMISC::CRGBA CloudAmbient;
|
||||
uint8 CloudPower;
|
||||
uint8 CloudDistAtt;
|
||||
|
||||
uint8 LastCloudPower; // Cloud power of the old bill board
|
||||
private:
|
||||
|
||||
void setMode2D ();
|
||||
|
||||
// in ; viewer, center
|
||||
// out I,J,K, left,right,top,bottom,near,far
|
||||
void calcBill (const NLMISC::CVector &Viewer, const NLMISC::CVector &Center, const NLMISC::CVector &Size,
|
||||
NLMISC::CVector &I, NLMISC::CVector &J, NLMISC::CVector &K,
|
||||
float &Left, float &Right, float &Top, float &Bottom, float &Near, float &Far);
|
||||
|
||||
private:
|
||||
|
||||
uint32 _Width, _Height, _Depth;
|
||||
uint32 _NbW, _NbH; // Number of slice in width and height (NbW*NbH = Depth
|
||||
|
||||
NLMISC::CVector _Size;
|
||||
NLMISC::CVector _Pos;
|
||||
float _LastX;
|
||||
|
||||
float _BaseFreq; // 1 -> 1 voxel is 1 noise3d pixel 0.5 -> 2 voxels are 1 noise3d pixel (Lowest octave freq)
|
||||
uint32 _NbOctave;
|
||||
double *_UStart, *_VStart, *_WStart; // 1st Lowest octave
|
||||
|
||||
CCloudScape *_CloudScape;
|
||||
SCloudTexture3D *_CloudTexTmp; // Temporary cloud texture 3D
|
||||
SCloudTextureClamp *_CloudTexClamp;
|
||||
|
||||
// BillBoard
|
||||
public:
|
||||
// The billboard is a texture where the cloud is rendered
|
||||
uint32 _BillSize; // ( The texture is always sqare)
|
||||
uint8 *_MemBill;
|
||||
NLMISC::CSmartPtr<NL3D::CTextureMem> _TexBill;
|
||||
|
||||
// The last texture
|
||||
uint32 _OldBillSize;
|
||||
uint8 *_MemOldBill;
|
||||
NLMISC::CSmartPtr<NL3D::CTextureMem> _TexOldBill;
|
||||
|
||||
uint8 _WaitState;
|
||||
|
||||
// Accel for calc bill
|
||||
|
||||
NLMISC::CVector _BillViewer, _BillCenter, _BillOldCenter;
|
||||
|
||||
private:
|
||||
|
||||
NL3D::IDriver *_Driver;
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
||||
} // namespace NL3D
|
||||
|
||||
#endif // NL_CLOUD_H
|
||||
|
196
code/nel/include/nel/3d/cloud_scape.h
Normal file
196
code/nel/include/nel/3d/cloud_scape.h
Normal file
|
@ -0,0 +1,196 @@
|
|||
// 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_CLOUD_SCAPE_H
|
||||
#define NL_CLOUD_SCAPE_H
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
||||
#include "nel/3d/material.h"
|
||||
#include "nel/3d/texture.h"
|
||||
#include "nel/3d/texture_mem.h"
|
||||
#include "nel/3d/vertex_buffer.h"
|
||||
#include "nel/misc/smart_ptr.h"
|
||||
#include "nel/misc/geom_ext.h"
|
||||
#include "nel/misc/value_smoother.h"
|
||||
#include "nel/3d/cloud.h"
|
||||
#include "nel/3d/noise_3d.h"
|
||||
#include "nel/3d/u_cloud_scape.h"
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
struct SCloudTexture3D
|
||||
{
|
||||
uint32 Width, Height, Depth;
|
||||
uint32 NbW, NbH; // Number of slice in width and height (NbW*NbH = Depth)
|
||||
uint8 *Mem;
|
||||
uint8 *Mem2;
|
||||
uint8 *MemBuffer;
|
||||
NLMISC::CSmartPtr<NL3D::CTextureMem> Tex;
|
||||
NLMISC::CSmartPtr<NL3D::CTextureMem> Tex2;
|
||||
NLMISC::CSmartPtr<NL3D::CTextureMem> TexBuffer;
|
||||
NL3D::CMaterial ToLightRGB;
|
||||
NL3D::CMaterial ToLightAlpha;
|
||||
NL3D::CMaterial ToBill;
|
||||
NL3D::CMaterial MatCopy;
|
||||
|
||||
SCloudTexture3D ();
|
||||
void init (uint32 nWidth, uint32 nHeight, uint32 nDepth);
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
struct SCloudTextureClamp
|
||||
{
|
||||
uint32 Width, Height, Depth;
|
||||
uint32 NbW, NbH; // Number of slice in width and height (NbW*NbH = Depth)
|
||||
uint8 *Mem;
|
||||
NLMISC::CSmartPtr<NL3D::CTextureMem> Tex;
|
||||
NL3D::CMaterial ToClamp;
|
||||
|
||||
SCloudTextureClamp ();
|
||||
void init (uint32 nWidth, uint32 nHeight, uint32 nDepth, const std::string &filename);
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
class CCloudScape
|
||||
{
|
||||
public:
|
||||
|
||||
CCloudScape (NL3D::IDriver *pDriver);
|
||||
|
||||
~CCloudScape ();
|
||||
|
||||
void init (SCloudScapeSetup *pCSS = NULL, NL3D::CCamera *pCamera = NULL);
|
||||
|
||||
void set (SCloudScapeSetup &css);
|
||||
|
||||
// Function that make cloud scape (work with screeen as temp buffer)
|
||||
void anim (double dt, NL3D::CCamera *pCamera);
|
||||
|
||||
// Render all clouds to the screen
|
||||
void render ();
|
||||
|
||||
uint32 getMemSize();
|
||||
|
||||
void setQuality (float threshold) { _LODQualityThreshold = threshold; }
|
||||
|
||||
void setNbCloudToUpdateIn80ms (uint32 n) { _NbHalfCloudToUpdate = n; }
|
||||
|
||||
bool isDebugQuadEnabled () { return _DebugQuad; }
|
||||
void setDebugQuad (bool b) { _DebugQuad = b; }
|
||||
|
||||
private:
|
||||
|
||||
void makeHalfCloud ();
|
||||
|
||||
private:
|
||||
|
||||
uint32 _NbHalfCloudToUpdate; // In 40 ms
|
||||
double _GlobalTime;
|
||||
double _DeltaTime;
|
||||
double _DTRest;
|
||||
NLMISC::CValueSmoother _AverageFrameRate;
|
||||
bool _Generate; // or light ?
|
||||
CCloud *_CurrentCloudInProcess; // Current cloud that is processing
|
||||
double _CurrentCloudInProcessFuturTime;
|
||||
|
||||
std::vector<uint8> _CloudPower;
|
||||
std::vector<bool> _ShouldProcessCloud;
|
||||
|
||||
SCloudScapeSetup _CurrentCSS;
|
||||
SCloudScapeSetup _NewCSS;
|
||||
SCloudScapeSetup _OldCSS;
|
||||
double _TimeNewCSS;
|
||||
|
||||
bool _IsIncomingCSS;
|
||||
SCloudScapeSetup _IncomingCSS;
|
||||
|
||||
CNoise3d _Noise3D;
|
||||
|
||||
std::vector<CCloud> _AllClouds;
|
||||
|
||||
// Cloud scheduler
|
||||
struct SCloudSchedulerEntry
|
||||
{
|
||||
sint32 CloudIndex;
|
||||
sint32 DeltaNextCalc;
|
||||
uint32 Frame;
|
||||
NLMISC::CRGBA Ambient;
|
||||
NLMISC::CRGBA Diffuse;
|
||||
uint8 Power;
|
||||
SCloudSchedulerEntry()
|
||||
{
|
||||
CloudIndex = DeltaNextCalc = -1;
|
||||
}
|
||||
};
|
||||
struct SCloudSchedulerAccel
|
||||
{
|
||||
bool ValidPos;
|
||||
std::list<SCloudSchedulerEntry>::iterator Pos;
|
||||
// uint32 Frame;
|
||||
|
||||
SCloudSchedulerAccel()
|
||||
{
|
||||
ValidPos = false;
|
||||
}
|
||||
};
|
||||
// std::deque<SCloudSchedulerEntry> _CloudScheduler;
|
||||
std::list<SCloudSchedulerEntry> _CloudScheduler;
|
||||
uint32 _CloudSchedulerSize;
|
||||
std::vector<SCloudSchedulerAccel> _CloudSchedulerLastAdded;
|
||||
uint32 _FrameCounter;
|
||||
std::vector<float> _ExtrapolatedPriorities;
|
||||
|
||||
|
||||
// Cloud sort
|
||||
struct SSortedCloudEntry
|
||||
{
|
||||
CCloud *Cloud;
|
||||
float Distance;
|
||||
};
|
||||
std::vector<SSortedCloudEntry> _SortedClouds;
|
||||
|
||||
|
||||
|
||||
float _LODQualityThreshold;
|
||||
bool _DebugQuad;
|
||||
|
||||
NL3D::IDriver *_Driver;
|
||||
NL3D::CVertexBuffer _VertexBuffer;
|
||||
NL3D::CMaterial _MatClear;
|
||||
NL3D::CMaterial _MatBill;
|
||||
|
||||
NL3D::CCamera *_ViewerCam;
|
||||
|
||||
SCloudTexture3D Tex3DTemp;
|
||||
SCloudTextureClamp TexClamp;
|
||||
|
||||
// Driver reset counter initial value
|
||||
uint _ResetCounter;
|
||||
|
||||
friend class CCloud;
|
||||
|
||||
double _LastAnimRenderTime;
|
||||
double _MaxDeltaTime;
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
} // namespace NL3D
|
||||
|
||||
#endif // NL_CLOUD_SCAPE_H
|
||||
|
58
code/nel/include/nel/3d/cloud_scape_user.h
Normal file
58
code/nel/include/nel/3d/cloud_scape_user.h
Normal file
|
@ -0,0 +1,58 @@
|
|||
// 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/>.
|
||||
|
||||
#include "nel/3d/u_cloud_scape.h"
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
class UDriver;
|
||||
class UCamera;
|
||||
class CCloudScape;
|
||||
|
||||
/// implementation of UWaterInstance methods
|
||||
class CCloudScapeUser : public UCloudScape
|
||||
{
|
||||
public:
|
||||
|
||||
CCloudScapeUser(CScene *scene);
|
||||
virtual ~CCloudScapeUser();
|
||||
|
||||
virtual void init (SCloudScapeSetup *pCSS = NULL);
|
||||
|
||||
virtual void set (SCloudScapeSetup &css);
|
||||
|
||||
virtual void anim (double dt);
|
||||
|
||||
virtual void render ();
|
||||
|
||||
virtual uint32 getMemSize();
|
||||
|
||||
virtual void setQuality (float threshold);
|
||||
|
||||
virtual void setNbCloudToUpdateIn80ms (uint32 n);
|
||||
|
||||
virtual bool isDebugQuadEnabled ();
|
||||
|
||||
virtual void setDebugQuad (bool b);
|
||||
|
||||
CCloudScape *_CS;
|
||||
CScene *_Scene;
|
||||
};
|
||||
|
||||
|
||||
} // NL3D
|
||||
|
218
code/nel/include/nel/3d/cluster.h
Normal file
218
code/nel/include/nel/3d/cluster.h
Normal file
|
@ -0,0 +1,218 @@
|
|||
// 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_CLUSTER_H
|
||||
#define NL_CLUSTER_H
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/string_mapper.h"
|
||||
#include "nel/misc/plane.h"
|
||||
#include "nel/misc/aabbox.h"
|
||||
|
||||
#include "nel/3d/transform.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace NLMISC
|
||||
{
|
||||
class CRGBA;
|
||||
class IStream;
|
||||
struct EStream;
|
||||
}
|
||||
|
||||
namespace NL3D {
|
||||
|
||||
|
||||
class CPortal;
|
||||
class CInstanceGroup;
|
||||
|
||||
const NLMISC::CClassId ClusterId=NLMISC::CClassId(0x13f37e46, 0x3e880780);
|
||||
|
||||
/**
|
||||
* CCluster
|
||||
*
|
||||
* The objects are in the MOT clip traversal
|
||||
*
|
||||
* \author Matthieu Besson
|
||||
* \author Nevrax France
|
||||
* \date 2001
|
||||
*/
|
||||
class CCluster : public CTransform
|
||||
{
|
||||
/* ***********************************************
|
||||
* WARNING: This Class/Method must be thread-safe (ctor/dtor/serial): no static access for instance
|
||||
* It can be loaded/called through CAsyncFileManager for instance
|
||||
* ***********************************************/
|
||||
|
||||
|
||||
public:
|
||||
|
||||
static void registerBasic ();
|
||||
|
||||
public:
|
||||
|
||||
CCluster();
|
||||
|
||||
~CCluster();
|
||||
|
||||
/**
|
||||
* Make the cluster volume from a plane made with 3 points
|
||||
* All the faces passed must be connected with at least one of the others
|
||||
* return false if the plane we want to add make the volume concave
|
||||
*/
|
||||
bool makeVolume (const NLMISC::CVector& p1, const NLMISC::CVector& p2, const NLMISC::CVector& p3);
|
||||
|
||||
|
||||
/// Apply the given matrix to this cluster local / world volume & bbox
|
||||
void applyMatrix(const NLMISC::CMatrix &m);
|
||||
|
||||
/**
|
||||
* return true if the vertex is in the cluster volume
|
||||
*/
|
||||
bool isIn (const NLMISC::CVector& p);
|
||||
|
||||
/**
|
||||
* return true if the Bounding box intersect the cluster
|
||||
*/
|
||||
bool isIn (const NLMISC::CAABBox& b);
|
||||
|
||||
/**
|
||||
* return true if the Sphere intersect the cluster
|
||||
*/
|
||||
bool isIn (const NLMISC::CVector& center, float size);
|
||||
|
||||
/**
|
||||
* return true if the segment intersect the cluster
|
||||
* start / end are the input and ouptut clipped segment
|
||||
*/
|
||||
bool clipSegment (NLMISC::CVector &p0, NLMISC::CVector &p1);
|
||||
|
||||
|
||||
NLMISC::CAABBox& getBBox() { return _BBox; }
|
||||
|
||||
/// Linking
|
||||
|
||||
// reset all links to portals.
|
||||
void resetPortalLinks ();
|
||||
|
||||
void link (CPortal* portal);
|
||||
void unlink (CPortal* portal);
|
||||
|
||||
uint32 getNbPortals() {return _Portals.size();}
|
||||
CPortal* getPortal(uint32 pos) {return _Portals[pos];}
|
||||
|
||||
/// Serial
|
||||
|
||||
void serial (NLMISC::IStream& f);
|
||||
|
||||
void setWorldMatrix (const NLMISC::CMatrix &WM);
|
||||
|
||||
bool isRoot() { return _LocalVolume.size() == 0; }
|
||||
|
||||
//\name Sound related.
|
||||
//@{
|
||||
void setSoundGroup(const std::string &soundGroup);
|
||||
void setSoundGroup(const NLMISC::TStringId &soundGroupId);
|
||||
const std::string &getSoundGroup();
|
||||
NLMISC::TStringId getSoundGroupId();
|
||||
void setEnvironmentFx(const std::string &environmentFx);
|
||||
void setEnvironmentFx(const NLMISC::TStringId &environmentFxId);
|
||||
const std::string &getEnvironmentFx();
|
||||
NLMISC::TStringId getEnvironmentFxId();
|
||||
//@}
|
||||
|
||||
|
||||
/// \name CTransform Specialisation
|
||||
// @{
|
||||
virtual void traverseHrc();
|
||||
virtual void traverseClip();
|
||||
virtual bool clip();
|
||||
// For ClipTrav only.
|
||||
void setCameraIn(bool state) {_CameraIn= state;}
|
||||
bool isCameraIn() const {return _CameraIn;}
|
||||
// @}
|
||||
|
||||
// clusters to clusters calls
|
||||
void recursTraverseClip(CTransform *caller);
|
||||
|
||||
// Cluster Graph parsing with a ray (for CScene::findCameraClusterSystemFromRay())
|
||||
void cameraRayClip(const CVector &start, const CVector &end, std::vector<CCluster*> &clusterVisited);
|
||||
|
||||
private:
|
||||
|
||||
static CTransform *creator () {return new CCluster;}
|
||||
|
||||
public:
|
||||
// Moving cluster
|
||||
CQuadGrid<CCluster*>::CIterator AccelIt;
|
||||
|
||||
// Additionnal properties
|
||||
std::string Name;
|
||||
bool FatherVisible;
|
||||
bool VisibleFromFather;
|
||||
bool FatherAudible;
|
||||
bool AudibleFromFather;
|
||||
CCluster *Father;
|
||||
std::vector<CCluster*> Children;
|
||||
CInstanceGroup *Group;
|
||||
|
||||
private:
|
||||
|
||||
/// Portals list
|
||||
std::vector<CPortal*> _Portals;
|
||||
|
||||
/// Local bounding box and volume
|
||||
/// -----------------------------
|
||||
/// The bounding box of the volume
|
||||
NLMISC::CAABBox _LocalBBox;
|
||||
/// All planes are oriented to the exterior of the volume
|
||||
std::vector<NLMISC::CPlane> _LocalVolume;
|
||||
|
||||
/// World bounding box and volume (valid after hrc trav)
|
||||
/// -----------------------------
|
||||
NLMISC::CAABBox _BBox;
|
||||
/// All planes are oriented to the exterior of the volume
|
||||
std::vector<NLMISC::CPlane> _Volume;
|
||||
|
||||
/// Sound group name id
|
||||
NLMISC::TStringId _SoundGroupId;
|
||||
/// Environement Fx name Id (using CStringMapper)
|
||||
NLMISC::TStringId _EnvironmentFxId;
|
||||
|
||||
private:
|
||||
// This unlink this cluster from its sons and its parents
|
||||
void unlinkFromClusterTree();
|
||||
// unlink this cluster from its parent
|
||||
void unlinkFromParent();
|
||||
// unlink this cluster sons
|
||||
void unlinkSons();
|
||||
|
||||
/// ***** Clip Traversal
|
||||
bool _Visited;
|
||||
// true if in clip pass the camera is in. valid only during clip pass...
|
||||
bool _CameraIn;
|
||||
|
||||
/// Friends classes
|
||||
friend class CInstanceGroup;
|
||||
};
|
||||
|
||||
|
||||
} // NL3D
|
||||
|
||||
|
||||
#endif // NL_CLUSTER_H
|
||||
|
||||
/* End of cluster.h */
|
137
code/nel/include/nel/3d/coarse_mesh_build.h
Normal file
137
code/nel/include/nel/3d/coarse_mesh_build.h
Normal file
|
@ -0,0 +1,137 @@
|
|||
// 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_COARSE_MESH_BUILD_H
|
||||
#define NL_COARSE_MESH_BUILD_H
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/bitmap.h"
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
class CMeshGeom;
|
||||
class CMeshBase;
|
||||
class ITexture;
|
||||
|
||||
/**
|
||||
* Class used to build the coarse meshes
|
||||
*
|
||||
* The build method take an array of CMeshGeom an a bitmap.
|
||||
* This class will compute a single texture used to map every
|
||||
* coarse mesh passed in the array.
|
||||
*
|
||||
* Each mesh geom should be a coarse mesh.
|
||||
*
|
||||
* The uv texture coordinates of those coarse meshes will be adjusted to fit
|
||||
* in a single texture.
|
||||
*
|
||||
* \author Cyril 'Hulud' Corvazier
|
||||
* \author Nevrax France
|
||||
* \date 2001
|
||||
*/
|
||||
class CCoarseMeshBuild
|
||||
{
|
||||
public:
|
||||
|
||||
/// Coarse mesh descriptor
|
||||
class CCoarseMeshDesc
|
||||
{
|
||||
public:
|
||||
// Constructor
|
||||
CCoarseMeshDesc (CMeshGeom *meshGeom, const CMeshBase *baseMesh)
|
||||
{
|
||||
MeshGeom=meshGeom;
|
||||
MeshBase=baseMesh;
|
||||
}
|
||||
|
||||
/**
|
||||
* The pointer on the geom mesh of the coarse mesh.
|
||||
* This mesh will be modified.
|
||||
*/
|
||||
CMeshGeom *MeshGeom;
|
||||
|
||||
/**
|
||||
* The pointer on the base mesh used by the coarse mesh.
|
||||
* This class won't be modified.
|
||||
*/
|
||||
const CMeshBase *MeshBase;
|
||||
};
|
||||
|
||||
/// Statistics about the build process
|
||||
class CStats
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Ratio of texture used. Between 0~1. 0, the texture is empty, 1
|
||||
* the texture is totaly used.
|
||||
*/
|
||||
float TextureUsed;
|
||||
};
|
||||
|
||||
/**
|
||||
* The build method. This method will build a single texture and adjust
|
||||
* the UV texture coordinates of each mesh geom.
|
||||
*
|
||||
* \param coarseMeshes is a vector of coarse mesh to compute.
|
||||
* \param bitmap will receive the final bitmap.
|
||||
* \param start will receive various statistics about the build process.
|
||||
* \param mulArea is the mul factor used to increase to theorical global texture size.
|
||||
*/
|
||||
bool build (const std::vector<CCoarseMeshDesc>& coarseMeshes, std::vector<NLMISC::CBitmap> &bitmaps, CStats& stats, float mulArea);
|
||||
|
||||
private:
|
||||
|
||||
class CBitmapDesc
|
||||
{
|
||||
public:
|
||||
// Coordinates of the bitmap in the global bitmap
|
||||
float U;
|
||||
float V;
|
||||
|
||||
// Coordinates ratio
|
||||
float FactorU;
|
||||
float FactorV;
|
||||
|
||||
// Pointer on the textures
|
||||
std::vector<NLMISC::CBitmap> Bitmaps;
|
||||
|
||||
// Pointer on the texture
|
||||
std::string Name;
|
||||
};
|
||||
|
||||
typedef std::map<std::string, CBitmapDesc> MapBitmapDesc;
|
||||
|
||||
// Expand the border of a bitmap.
|
||||
void expand (NLMISC::CBitmap& bitmap);
|
||||
|
||||
// Build the bitmap. Return false if the bitmap size is too small
|
||||
bool buildBitmap (const std::vector<CCoarseMeshDesc>& coarseMeshes, std::vector<NLMISC::CBitmap> &bitmaps, CStats& stats, MapBitmapDesc& desc, float mulArea);
|
||||
|
||||
// Remap the coordinate
|
||||
void remapCoordinates (const std::vector<CCoarseMeshDesc>& coarseMeshes, const MapBitmapDesc& desc, uint outputBitmapCount);
|
||||
};
|
||||
|
||||
|
||||
} // NL3D
|
||||
|
||||
|
||||
#endif // NL_COARSE_MESH_BUILD_H
|
||||
|
||||
/* End of coarse_mesh_build.h */
|
148
code/nel/include/nel/3d/coarse_mesh_manager.h
Normal file
148
code/nel/include/nel/3d/coarse_mesh_manager.h
Normal file
|
@ -0,0 +1,148 @@
|
|||
// 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_COARSE_MESH_MANAGER_H
|
||||
#define NL_COARSE_MESH_MANAGER_H
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/rgba.h"
|
||||
|
||||
#include "nel/3d/transform.h"
|
||||
#include "nel/3d/material.h"
|
||||
#include "nel/3d/index_buffer.h"
|
||||
#include "nel/3d/vertex_buffer.h"
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
// Number of vertices that can be rendered in one pass
|
||||
#define NL3D_COARSEMESH_VERTEXBUFFER_SIZE 20000
|
||||
// Number of triangles that can be rendered in one pass
|
||||
#define NL3D_COARSEMESH_TRIANGLE_SIZE 10000
|
||||
// The vertex Format used by the coarseMesh manager
|
||||
#define NL3D_COARSEMESH_VERTEX_FORMAT_MGR (CVertexBuffer::PositionFlag|CVertexBuffer::TexCoord0Flag|CVertexBuffer::PrimaryColorFlag)
|
||||
// The Vertex Format used for export CoarseMesh. MUST NOT HAVE color (important for material coloring/alphaTrans)
|
||||
#define NL3D_COARSEMESH_VERTEX_FORMAT_EXPORT (CVertexBuffer::PositionFlag|CVertexBuffer::TexCoord0Flag)
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
class CMeshGeom;
|
||||
class CTransformShape;
|
||||
class CTextureFile;
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
/**
|
||||
* Management of coarse meshes.
|
||||
*
|
||||
* This container will render meshes with very low polygon count efficiently.
|
||||
*
|
||||
* All coarse meshes must use a common vertex format. It is a pos + UV vertex format.
|
||||
* (NL3D_COARSEMESH_VERTEX_FORMAT_EXPORT)
|
||||
*
|
||||
* Internally the CCoarseMeshManager store meshes with pos + UV + color vertex format, to color instances
|
||||
* (NL3D_COARSEMESH_VERTEX_FORMAT_MGR)
|
||||
*
|
||||
* Coarse meshes must use indexed triangle primitive in a single render pass in a single matrix block.
|
||||
*
|
||||
* All coarse meshes musts use a single material. It is a simple mapping with alpha test rendering and a common
|
||||
* texture.
|
||||
*
|
||||
* The coarse meshes must have been preprocessed to build the common texture and remap the UV mapping coordinates
|
||||
* in the new common texture.
|
||||
*
|
||||
* The manager must have been setuped with the common texture.
|
||||
*
|
||||
* \author Cyril 'Hulud' Corvazier, Lionel Berenguier
|
||||
* \author Nevrax France
|
||||
* \date 2001
|
||||
*/
|
||||
class CCoarseMeshManager
|
||||
{
|
||||
public:
|
||||
|
||||
/// Constructor
|
||||
CCoarseMeshManager ();
|
||||
|
||||
/// Set texture file to use with this coarse mesh
|
||||
void setTextureFile (const char* file);
|
||||
|
||||
/**
|
||||
* Add a coarse mesh in the manager. If an error occured, it returns CantAddCoarseMesh.
|
||||
* \param vBuffer the VertexBuffer pre-transformed / Colored. Size MUST be numVertices*NL3D_COARSEMESH_VERTEX_FORMAT_MGR
|
||||
* \param indexBuffer containing triangles that will be inserted.
|
||||
* \return false if the mesh can't be added to this pass BECAUSE OF TOO MANY VERTICES or TOO MANY PRIMITIVES reason
|
||||
* You may call flushRender(), then restart a block.
|
||||
* NB: if numVertices>NL3D_COARSEMESH_VERTEXBUFFER_SIZE or if numTriangles>NL3D_COARSEMESH_TRIANGLE_SIZE, it will always
|
||||
* NB: the color of vbUffer must already be correct against IDriver::getVertexColorFormat()
|
||||
* return false
|
||||
*/
|
||||
bool addMesh (uint numVertices, const uint8 *vBuffer, uint numTris, const TCoarseMeshIndexType *indexBuffer);
|
||||
|
||||
/**
|
||||
* Render the container
|
||||
*/
|
||||
void flushRender (IDriver *drv);
|
||||
|
||||
/**
|
||||
* Get material of the container. For rendering purpose only.
|
||||
*/
|
||||
CMaterial &getMaterial() {return _Material;}
|
||||
|
||||
/// Get the VertexSize of the MGR format
|
||||
uint getVertexSize() const {return _VBuffer.getVertexSize();}
|
||||
uint getUVOff() const {return (uint)_VBuffer.getTexCoordOff(0);}
|
||||
uint getColorOff() const {return (uint)_VBuffer.getColorOff();}
|
||||
|
||||
private:
|
||||
|
||||
CVertexBuffer _VBuffer;
|
||||
CIndexBuffer _Triangles;
|
||||
uint _CurrentNumVertices;
|
||||
uint _CurrentNumTriangles;
|
||||
|
||||
// The unique texture used by all the coarse object inserted in the container.
|
||||
CSmartPtr<CTextureFile> _Texture;
|
||||
|
||||
// The unique material used by all the coarse object inserted in the container.
|
||||
CMaterial _Material;
|
||||
|
||||
// Texture category for profilings
|
||||
NLMISC::CSmartPtr<ITexture::CTextureCategory> _TextureCategory;
|
||||
//
|
||||
CIndexBufferReadWrite _IBA;
|
||||
CVertexBufferReadWrite _VBA;
|
||||
|
||||
struct CMeshInfo
|
||||
{
|
||||
uint NumVertices;
|
||||
const uint8 *VBuffer;
|
||||
uint NumTris;
|
||||
const TCoarseMeshIndexType *IndexBuffer;
|
||||
};
|
||||
std::vector<CMeshInfo> _Meshs;
|
||||
};
|
||||
|
||||
|
||||
} // NL3D
|
||||
|
||||
|
||||
#endif // NL_COARSE_MESH_MANAGER_H
|
||||
|
||||
/* End of coarse_mesh_manager.h */
|
301
code/nel/include/nel/3d/computed_string.h
Normal file
301
code/nel/include/nel/3d/computed_string.h
Normal file
|
@ -0,0 +1,301 @@
|
|||
// 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_COMPUTED_STRING_H
|
||||
#define NL_COMPUTED_STRING_H
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/smart_ptr.h"
|
||||
#include "nel/3d/index_buffer.h"
|
||||
#include "nel/3d/driver.h"
|
||||
#include "nel/3d/vertex_buffer.h"
|
||||
#include "nel/3d/material.h"
|
||||
#include "nel/3d/u_text_context.h"
|
||||
#include <vector>
|
||||
#include <limits>
|
||||
|
||||
|
||||
|
||||
namespace NL3D {
|
||||
|
||||
class CTextureFont;
|
||||
class CMatrix;
|
||||
struct CComputedString;
|
||||
|
||||
// ***************************************************************************
|
||||
/**
|
||||
* A Buffer to render batch of computed string.
|
||||
*/
|
||||
class CRenderStringBuffer : public URenderStringBuffer
|
||||
{
|
||||
public:
|
||||
CVertexBuffer Vertices;
|
||||
uint NumQuads;
|
||||
|
||||
public:
|
||||
CRenderStringBuffer();
|
||||
virtual ~CRenderStringBuffer();
|
||||
|
||||
/// render and make empty the render string buffer. see CComputedString::render2DClip()
|
||||
void flush(IDriver& driver, CMaterial *fontMat);
|
||||
|
||||
/** render and make empty the render string buffer. see CComputedString::render2DProjected()
|
||||
* The driver view and model matrices have to be setuped as material zbuffer flags by the user.
|
||||
* This method only render string quads.
|
||||
*/
|
||||
void flushUnProjected(IDriver& driver, CMaterial *fontMat, bool zwrite);
|
||||
};
|
||||
|
||||
|
||||
|
||||
class CLetterColors : public ULetterColors
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
struct SLetterColor
|
||||
{
|
||||
uint Index;
|
||||
NLMISC::CRGBA Color;
|
||||
|
||||
SLetterColor(uint index, const NLMISC::CRGBA & color)
|
||||
{
|
||||
Index = index;
|
||||
Color = color;
|
||||
}
|
||||
|
||||
bool operator == ( const SLetterColor lc ) const
|
||||
{
|
||||
return (Index==lc.Index && Color==lc.Color);
|
||||
}
|
||||
};
|
||||
|
||||
CLetterColors() {}
|
||||
virtual ~CLetterColors() {}
|
||||
|
||||
void clear()
|
||||
{
|
||||
_indexedColors.clear();
|
||||
}
|
||||
|
||||
bool empty() const
|
||||
{
|
||||
return _indexedColors.empty();
|
||||
}
|
||||
|
||||
uint size() const
|
||||
{
|
||||
return _indexedColors.size();
|
||||
}
|
||||
|
||||
uint getIndex(uint i) const
|
||||
{
|
||||
if(i<_indexedColors.size())
|
||||
return _indexedColors[i].Index;
|
||||
|
||||
return std::numeric_limits<uint>::max();
|
||||
}
|
||||
|
||||
const CRGBA & getColor(uint i) const
|
||||
{
|
||||
if(i<_indexedColors.size())
|
||||
return _indexedColors[i].Color;
|
||||
|
||||
return CRGBA::Black;
|
||||
}
|
||||
|
||||
const SLetterColor & getLetterColor(uint i) const
|
||||
{
|
||||
if(i<_indexedColors.size())
|
||||
return _indexedColors[i];
|
||||
|
||||
static SLetterColor defaultLetterColor(0, CRGBA::Black);
|
||||
return defaultLetterColor;
|
||||
}
|
||||
|
||||
bool isSameLetterColors(ULetterColors * letterColors)
|
||||
{
|
||||
CLetterColors * letterCol = static_cast<CLetterColors*>(letterColors);
|
||||
bool sameLetterColors = false;
|
||||
if(_indexedColors.size()==letterCol->size())
|
||||
{
|
||||
sameLetterColors= true;
|
||||
for(uint i=0;i<_indexedColors.size();i++)
|
||||
{
|
||||
if(!(_indexedColors[i] == letterCol->getLetterColor(i)))
|
||||
{
|
||||
sameLetterColors = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return sameLetterColors;
|
||||
}
|
||||
|
||||
void pushLetterColor(uint index, const NLMISC::CRGBA & color)
|
||||
{
|
||||
_indexedColors.push_back(SLetterColor(index, color));
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector< SLetterColor > _indexedColors;
|
||||
};
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
/**
|
||||
* CComputedString
|
||||
* A CComputedString is a structure which permits to render a string
|
||||
* in a driver. It computes 4 vertices per char the renderer draw quads from them.
|
||||
*
|
||||
* \author Stephane Coutelas
|
||||
* \author Nevrax France
|
||||
* \date 2000
|
||||
*/
|
||||
struct CComputedString
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
CVertexBuffer Vertices;
|
||||
CMaterial *Material;
|
||||
CRGBA Color;
|
||||
/// The width of the string, in pixels (eg: 30)
|
||||
float StringWidth;
|
||||
/// The height of the string, in pixels (eg: 10)
|
||||
float StringHeight;
|
||||
/// The BBox of all vertices. used for render2DClip()
|
||||
float XMin, ZMin, XMax, ZMax;
|
||||
|
||||
/** StringLine is the size from bottom of the whole string image to the hotspot in pixels.
|
||||
* for instance if the hotspot is bottomLeft the imaginary line of the string "bpc"
|
||||
* is under the b, under the loop of the p but over the leg of the p. So StringLine
|
||||
* is a positive value in this case. It may be a negative value for the string "^" for example.
|
||||
*/
|
||||
float StringLine;
|
||||
|
||||
/// Optionnal: each render*() method can draw a subset of letters. Default is 0/FFFFFFFF
|
||||
uint32 SelectStart;
|
||||
uint32 SelectSize;
|
||||
|
||||
CLetterColors LetterColors;
|
||||
|
||||
/**
|
||||
* Hotspot positions (origin for the string placement)
|
||||
* You should take care that for vertical hotspot, an imaginary line is defined under
|
||||
* letters with no leg (like m,b,c etc..) between the leg of p and the loop of the p.
|
||||
*/
|
||||
enum THotSpot
|
||||
{
|
||||
BottomLeft=0,
|
||||
MiddleLeft,
|
||||
TopLeft,
|
||||
MiddleBottom,
|
||||
MiddleMiddle,
|
||||
MiddleTop,
|
||||
BottomRight,
|
||||
MiddleRight,
|
||||
TopRight,
|
||||
|
||||
HotSpotCount
|
||||
};
|
||||
|
||||
/**
|
||||
* Default constructor
|
||||
*/
|
||||
CComputedString (bool bSetupVB=true)
|
||||
{
|
||||
StringWidth = 0;
|
||||
StringHeight = 0;
|
||||
if (bSetupVB)
|
||||
{
|
||||
Vertices.setVertexFormat (CVertexBuffer::PositionFlag | CVertexBuffer::TexCoord0Flag);
|
||||
Vertices.setPreferredMemory (CVertexBuffer::RAMVolatile, true);
|
||||
Vertices.setName("CComputedString");
|
||||
}
|
||||
SelectStart= 0;
|
||||
SelectSize= ~0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the string's origin
|
||||
* \param hotspot the origin of the string
|
||||
*/
|
||||
CVector getHotSpotVector (THotSpot hotspot);
|
||||
|
||||
/**
|
||||
* Render the unicode string in a driver.
|
||||
* \param driver the driver where to render the primitives
|
||||
* \param x abscissa
|
||||
* \param y ordinate
|
||||
* \param hotspot position of string origine
|
||||
* \param scaleX abscissa scale
|
||||
* \param scaleY ordinate scale
|
||||
* \param rotateY rotation angle (axe perpendicular to screen)
|
||||
* \param useScreenAR43 if false then string is displayed with a pixel Ratio 1:1 (independent of window resolution).
|
||||
* if true, the string is scaled according to window width and height, to support 4:3 aspect ratio even on weird
|
||||
* screen resolution such as 640*240 (ie the char still look square, but the pixel ratio is 2:1)
|
||||
* \param roundToNearestPixel if true, snap the final string position to the nearest pixel. if set to true, and if
|
||||
* useScreenAR43= false, you are sure that texels of the fonts fit exactly on centers of pixels (no apparent bi-linear).
|
||||
*/
|
||||
void render2D (IDriver& driver,
|
||||
float x, float z,
|
||||
THotSpot hotspot = BottomLeft,
|
||||
float scaleX = 1, float scaleZ = 1,
|
||||
float rotateY = 0,
|
||||
bool useScreenAR43= false,
|
||||
bool roundToNearestPixel= true
|
||||
);
|
||||
|
||||
/** Special for interface. same as render2D but clip the quads to xmin,ymin/xmax,ymax.
|
||||
* NB: behavior is same as render2D with: Hotspot = bottomLeft, scaleX=1, scaleZ=1, rotateY=0,
|
||||
* useScreenAR43= false, roundToNearestPixel= false
|
||||
* Additionnaly, this method doesn't render directly to the driver but add primitives to a CRenderStringBuffer
|
||||
* Use the method CRenderStringBuffer::flush() to flush it all.
|
||||
*/
|
||||
void render2DClip (IDriver& driver, CRenderStringBuffer &rdrBuffer,
|
||||
float x, float z,
|
||||
float xmin=0, float ymin=0, float xmax=1, float ymax=1
|
||||
);
|
||||
|
||||
/** Special for interface. same as render2DClip but unproject the vertices using a frustum and a scale matrix
|
||||
* Use the method CRenderStringBuffer::flush() to flush it all.
|
||||
*/
|
||||
void render2DUnProjected (IDriver& driver, CRenderStringBuffer &rdrBuffer, class NL3D::CFrustum &frustum,
|
||||
const NLMISC::CMatrix &scaleMatrix,
|
||||
float x, float z, float depth, float xmin=0, float ymin=0, float xmax=1, float ymax=1);
|
||||
|
||||
/**
|
||||
* Render the unicode string in a driver, in 3D with a user matrix.
|
||||
* NB: size of the string is first scaled by 1/windowHeight.
|
||||
* \param driver the driver where to render the primitives
|
||||
* \param matrix transformation matrix
|
||||
* \param hotspot position of string origine
|
||||
*/
|
||||
void render3D (IDriver& driver,CMatrix matrix,THotSpot hotspot = MiddleMiddle);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
} // NL3D
|
||||
|
||||
|
||||
#endif // NL_COMPUTED_STRING_H
|
||||
|
||||
/* End of computed_string.h */
|
||||
|
368
code/nel/include/nel/3d/cube_grid.h
Normal file
368
code/nel/include/nel/3d/cube_grid.h
Normal file
|
@ -0,0 +1,368 @@
|
|||
// 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_CUBE_GRID_H
|
||||
#define NL_CUBE_GRID_H
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/triangle.h"
|
||||
#include "nel/misc/plane.h"
|
||||
#include "nel/3d/quad_grid.h"
|
||||
#include "nel/3d/static_quad_grid.h"
|
||||
|
||||
|
||||
namespace NL3D {
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
/**
|
||||
* Class used to classify elements in space around a point (good for pointlight raytracing)
|
||||
* Elements are copied at insertion, and are duplicated at compilation along the grids.
|
||||
* Therefore TCell should be small (ie a pointer). This constraint help because memory is much more
|
||||
* reduced when compile is called.
|
||||
*
|
||||
* \author Matthieu Besson
|
||||
* \author Lionel Berenguier
|
||||
* \author Nevrax France
|
||||
* \date 2001
|
||||
*/
|
||||
template <class TCell>
|
||||
class CCubeGrid
|
||||
{
|
||||
public:
|
||||
|
||||
CCubeGrid ();
|
||||
~CCubeGrid ();
|
||||
|
||||
/** Create the cubeGrid, specifying center of this one, and number of Cells per side.
|
||||
*
|
||||
*/
|
||||
void create (const CVector ¢er, int nSize);
|
||||
void insert (const NLMISC::CTriangle &tri, const TCell &cell);
|
||||
/// compile the container, storing in CStaticQuadGrid.
|
||||
void compile();
|
||||
|
||||
// Selection. CubeGrid must be compilated. NB: it clear old selection.
|
||||
void select (const NLMISC::CVector &v);
|
||||
TCell getSel ();
|
||||
void nextSel ();
|
||||
bool isEndSel ();
|
||||
|
||||
// ************************
|
||||
private:
|
||||
|
||||
NLMISC::CVector _Center;
|
||||
|
||||
enum gridPos { kUp = 0, kDown, kLeft, kRight, kFront, kBack };
|
||||
// This is temp used at element insertion. freed at compile() time
|
||||
NL3D::CQuadGrid<TCell> _Grids[6];
|
||||
// For fast selection, and minimum memory overhead.
|
||||
NL3D::CStaticQuadGrid<TCell> _StaticGrids[6];
|
||||
|
||||
|
||||
bool _Compiled;
|
||||
|
||||
// Selection.
|
||||
const TCell *_Selection;
|
||||
uint _CurSel;
|
||||
uint _NumSels;
|
||||
|
||||
private:
|
||||
|
||||
void project (const NLMISC::CTriangle &tri, NLMISC::CPlane pyr[4], NLMISC::CPlane &gridPlane,
|
||||
sint32 nGridNb, const TCell &cell);
|
||||
|
||||
};
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// ***************************************************************************
|
||||
// Implementation
|
||||
// ***************************************************************************
|
||||
// ***************************************************************************
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
template<class TCell>
|
||||
CCubeGrid<TCell>::CCubeGrid ()
|
||||
{
|
||||
NLMISC::CMatrix tmp;
|
||||
NLMISC::CVector I, J, K;
|
||||
|
||||
// grids[kUp].changeBase( );
|
||||
I = NLMISC::CVector( 1, 0, 0 );
|
||||
J = NLMISC::CVector( 0, -1, 0 );
|
||||
K = NLMISC::CVector( 0, 0, -1 );
|
||||
tmp.identity(); tmp.setRot( I, J, K, true );
|
||||
_Grids[kDown].changeBase( tmp );
|
||||
|
||||
I = NLMISC::CVector( 0, 0, 1 );
|
||||
J = NLMISC::CVector( 0, 1, 0 );
|
||||
K = NLMISC::CVector( -1, 0, 0 );
|
||||
tmp.identity(); tmp.setRot( I, J, K, true);
|
||||
_Grids[kLeft].changeBase( tmp );
|
||||
|
||||
I = NLMISC::CVector( 0, 0, -1 );
|
||||
J = NLMISC::CVector( 0, 1, 0 );
|
||||
K = NLMISC::CVector( 1, 0, 0 );
|
||||
tmp.identity(); tmp.setRot( I, J, K, true);
|
||||
_Grids[kRight].changeBase( tmp );
|
||||
|
||||
I = NLMISC::CVector( 1, 0, 0 );
|
||||
J = NLMISC::CVector( 0, 0, 1 );
|
||||
K = NLMISC::CVector( 0, -1, 0 );
|
||||
tmp.identity(); tmp.setRot( I, J, K, true);
|
||||
_Grids[kFront].changeBase( tmp );
|
||||
|
||||
I = NLMISC::CVector( 1, 0, 0 );
|
||||
J = NLMISC::CVector( 0, 0, -1 );
|
||||
K = NLMISC::CVector( 0, 1, 0 );
|
||||
tmp.identity(); tmp.setRot( I, J, K, true);
|
||||
_Grids[kBack].changeBase( tmp );
|
||||
|
||||
|
||||
_Compiled= false;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
template<class TCell>
|
||||
CCubeGrid<TCell>::~CCubeGrid ()
|
||||
{
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
template<class TCell>
|
||||
void CCubeGrid<TCell>::create (const CVector ¢er, int nSize)
|
||||
{
|
||||
nlassert(!_Compiled);
|
||||
_Center= center;
|
||||
|
||||
_Grids[kUp].create ( nSize, 1.0f / ((float)nSize) );
|
||||
_Grids[kDown].create ( nSize, 1.0f / ((float)nSize) );
|
||||
_Grids[kLeft].create ( nSize, 1.0f / ((float)nSize) );
|
||||
_Grids[kRight].create ( nSize, 1.0f / ((float)nSize) );
|
||||
_Grids[kFront].create ( nSize, 1.0f / ((float)nSize) );
|
||||
_Grids[kBack].create ( nSize, 1.0f / ((float)nSize) );
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
template<class TCell>
|
||||
void CCubeGrid<TCell>::insert (const NLMISC::CTriangle &triIn, const TCell &cell)
|
||||
{
|
||||
nlassert(!_Compiled);
|
||||
// Center triangle on _Center.
|
||||
NLMISC::CTriangle tri= triIn;
|
||||
tri.V0-= _Center;
|
||||
tri.V1-= _Center;
|
||||
tri.V2-= _Center;
|
||||
|
||||
NLMISC::CPlane p[4], gp;
|
||||
// Construct clip pyramid for grid : UP
|
||||
p[0].make( NLMISC::CVector(0,0,0), NLMISC::CVector( -1,-1,+1 ), NLMISC::CVector( +1,-1,+1 ) );
|
||||
p[1].make( NLMISC::CVector(0,0,0), NLMISC::CVector( +1,-1,+1 ), NLMISC::CVector( +1,+1,+1 ) );
|
||||
p[2].make( NLMISC::CVector(0,0,0), NLMISC::CVector( +1,+1,+1 ), NLMISC::CVector( -1,+1,+1 ) );
|
||||
p[3].make( NLMISC::CVector(0,0,0), NLMISC::CVector( -1,+1,+1 ), NLMISC::CVector( -1,-1,+1 ) );
|
||||
gp.make( NLMISC::CVector(0,0,1), NLMISC::CVector(0,0,0.5) );
|
||||
project( tri, p, gp, kUp, cell );
|
||||
// Construct clip pyramid for grid : DOWN
|
||||
p[0].make( NLMISC::CVector(0,0,0), NLMISC::CVector( +1,-1,-1 ), NLMISC::CVector( -1,-1,-1 ) );
|
||||
p[1].make( NLMISC::CVector(0,0,0), NLMISC::CVector( -1,-1,-1 ), NLMISC::CVector( -1,+1,-1 ) );
|
||||
p[2].make( NLMISC::CVector(0,0,0), NLMISC::CVector( -1,+1,-1 ), NLMISC::CVector( +1,+1,-1 ) );
|
||||
p[3].make( NLMISC::CVector(0,0,0), NLMISC::CVector( +1,+1,-1 ), NLMISC::CVector( +1,-1,-1 ) );
|
||||
gp.make( NLMISC::CVector(0,0,-1), NLMISC::CVector(0,0,-0.5) );
|
||||
project( tri, p, gp, kDown, cell );
|
||||
// Construct clip pyramid for grid : LEFT
|
||||
p[0].make( NLMISC::CVector(0,0,0), NLMISC::CVector( -1,-1,-1 ), NLMISC::CVector( -1,-1,+1 ) );
|
||||
p[1].make( NLMISC::CVector(0,0,0), NLMISC::CVector( -1,-1,+1 ), NLMISC::CVector( -1,+1,+1 ) );
|
||||
p[2].make( NLMISC::CVector(0,0,0), NLMISC::CVector( -1,+1,+1 ), NLMISC::CVector( -1,+1,-1 ) );
|
||||
p[3].make( NLMISC::CVector(0,0,0), NLMISC::CVector( -1,+1,-1 ), NLMISC::CVector( -1,-1,-1 ) );
|
||||
gp.make( NLMISC::CVector(-1,0,0), NLMISC::CVector(-0.5,0,0) );
|
||||
project( tri, p, gp, kLeft, cell );
|
||||
// Construct clip pyramid for grid : RIGHT
|
||||
p[0].make( NLMISC::CVector(0,0,0), NLMISC::CVector( +1,-1,+1 ), NLMISC::CVector( +1,-1,-1 ) );
|
||||
p[1].make( NLMISC::CVector(0,0,0), NLMISC::CVector( +1,-1,-1 ), NLMISC::CVector( +1,+1,-1 ) );
|
||||
p[2].make( NLMISC::CVector(0,0,0), NLMISC::CVector( +1,+1,-1 ), NLMISC::CVector( +1,+1,+1 ) );
|
||||
p[3].make( NLMISC::CVector(0,0,0), NLMISC::CVector( +1,+1,+1 ), NLMISC::CVector( +1,-1,+1 ) );
|
||||
gp.make( NLMISC::CVector(1,0,0), NLMISC::CVector(0.5,0,0) );
|
||||
project( tri, p, gp, kRight, cell );
|
||||
// Construct clip pyramid for grid : FRONT
|
||||
p[0].make( NLMISC::CVector(0,0,0), NLMISC::CVector( -1,-1,-1 ), NLMISC::CVector( +1,-1,-1 ) );
|
||||
p[1].make( NLMISC::CVector(0,0,0), NLMISC::CVector( +1,-1,-1 ), NLMISC::CVector( +1,-1,+1 ) );
|
||||
p[2].make( NLMISC::CVector(0,0,0), NLMISC::CVector( +1,-1,+1 ), NLMISC::CVector( -1,-1,+1 ) );
|
||||
p[3].make( NLMISC::CVector(0,0,0), NLMISC::CVector( -1,-1,+1 ), NLMISC::CVector( -1,-1,-1 ) );
|
||||
gp.make( NLMISC::CVector(0,-1,0), NLMISC::CVector(0,-0.5,0) );
|
||||
project( tri, p, gp, kFront, cell );
|
||||
// Construct clip pyramid for grid : BACK
|
||||
p[0].make( NLMISC::CVector(0,0,0), NLMISC::CVector( +1,+1,+1 ), NLMISC::CVector( +1,+1,-1 ) );
|
||||
p[1].make( NLMISC::CVector(0,0,0), NLMISC::CVector( +1,+1,-1 ), NLMISC::CVector( -1,+1,-1 ) );
|
||||
p[2].make( NLMISC::CVector(0,0,0), NLMISC::CVector( -1,+1,-1 ), NLMISC::CVector( -1,+1,+1 ) );
|
||||
p[3].make( NLMISC::CVector(0,0,0), NLMISC::CVector( -1,+1,+1 ), NLMISC::CVector( +1,+1,+1 ) );
|
||||
gp.make( NLMISC::CVector(0,1,0), NLMISC::CVector(0,0.5,0) );
|
||||
project( tri, p, gp, kBack, cell );
|
||||
}
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
template<class TCell>
|
||||
void CCubeGrid<TCell>::compile()
|
||||
{
|
||||
nlassert(!_Compiled);
|
||||
// For all Grids.
|
||||
uint i;
|
||||
for(i=0; i<6; i++)
|
||||
{
|
||||
// build the _StaticGrid
|
||||
_StaticGrids[i].build(_Grids[i]);
|
||||
// And reset the grid. contReset is necessary to clean the CBlockMemory.
|
||||
contReset(_Grids[i]);
|
||||
}
|
||||
|
||||
// done
|
||||
_Compiled= true;
|
||||
|
||||
// Clear the Selection
|
||||
_Selection= NULL;
|
||||
_CurSel= 0;
|
||||
_NumSels= 0;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
template<class TCell>
|
||||
void CCubeGrid<TCell>::select (const NLMISC::CVector &vIn)
|
||||
{
|
||||
nlassert(_Compiled);
|
||||
// Center triangle on _Center.
|
||||
NLMISC::CVector v= vIn-_Center;
|
||||
|
||||
|
||||
sint nSelGrid= -1;
|
||||
NLMISC::CPlane gp;
|
||||
// Get the plane
|
||||
if( ( -v.z <= v.x ) && ( v.x <= v.z ) &&
|
||||
( -v.z <= v.y ) && ( v.y <= v.z ) &&
|
||||
( 0.0f <= v.z ) )
|
||||
{
|
||||
nSelGrid = kUp;
|
||||
gp.make( NLMISC::CVector(0,0,1), NLMISC::CVector(0,0,0.5) );
|
||||
}
|
||||
if( ( v.z <= v.x ) && ( v.x <= -v.z ) &&
|
||||
( v.z <= v.y ) && ( v.y <= -v.z ) &&
|
||||
( v.z <= 0.0f ) )
|
||||
{
|
||||
nSelGrid = kDown;
|
||||
gp.make( NLMISC::CVector(0,0,-1), NLMISC::CVector(0,0,-0.5) );
|
||||
}
|
||||
if( ( v.x <= 0.0f ) &&
|
||||
( v.x <= v.y ) && ( v.y <= -v.x ) &&
|
||||
( v.x <= v.z ) && ( v.z <= -v.x ) )
|
||||
{
|
||||
nSelGrid = kLeft;
|
||||
gp.make( NLMISC::CVector(-1,0,0), NLMISC::CVector(-0.5,0,0) );
|
||||
}
|
||||
if( ( 0.0f <= v.x ) &&
|
||||
( -v.x <= v.y ) && ( v.y <= v.x ) &&
|
||||
( -v.x <= v.z ) && ( v.z <= v.x ) )
|
||||
{
|
||||
nSelGrid = kRight;
|
||||
gp.make( NLMISC::CVector(1,0,0), NLMISC::CVector(0.5,0,0) );
|
||||
}
|
||||
if( ( v.y <= v.x ) && ( v.x <= -v.y ) &&
|
||||
( v.y <= 0.0f ) &&
|
||||
( v.y <= v.z ) && ( v.z <= -v.y ) )
|
||||
{
|
||||
nSelGrid = kFront;
|
||||
gp.make( NLMISC::CVector(0,-1,0), NLMISC::CVector(0,-0.5,0) );
|
||||
}
|
||||
if( ( -v.y <= v.x ) && ( v.x <= v.y ) &&
|
||||
( 0.0f <= v.y ) &&
|
||||
( -v.y <= v.z ) && ( v.z <= v.y ) )
|
||||
{
|
||||
nSelGrid = kBack;
|
||||
gp.make( NLMISC::CVector(0,1,0), NLMISC::CVector(0,0.5,0) );
|
||||
}
|
||||
nlassert(nSelGrid!=-1);
|
||||
NLMISC::CVector newV = gp.intersect( NLMISC::CVector(0,0,0), v );
|
||||
_Selection= _StaticGrids[nSelGrid].select(newV, _NumSels);
|
||||
_CurSel = 0;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
template<class TCell>
|
||||
TCell CCubeGrid<TCell>::getSel ()
|
||||
{
|
||||
nlassert(_Compiled);
|
||||
return _Selection[_CurSel];
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
template<class TCell>
|
||||
void CCubeGrid<TCell>::nextSel ()
|
||||
{
|
||||
nlassert(_Compiled);
|
||||
++_CurSel;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
template<class TCell>
|
||||
bool CCubeGrid<TCell>::isEndSel ()
|
||||
{
|
||||
nlassert(_Compiled);
|
||||
return (_CurSel == _NumSels);
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
template<class TCell>
|
||||
void CCubeGrid<TCell>::project (const NLMISC::CTriangle &tri, NLMISC::CPlane pyr[4], NLMISC::CPlane &gridPlane, sint32 nGridNb, const TCell &cell)
|
||||
{
|
||||
NLMISC::CVector vIn[7], vOut[7];
|
||||
sint32 i, nOut;
|
||||
vIn[0] = tri.V0; vIn[1] = tri.V1; vIn[2] = tri.V2;
|
||||
nOut = pyr[0].clipPolygonFront( vIn, vOut, 3 );
|
||||
if( nOut == 0 ) return;
|
||||
for( i = 0; i < nOut; ++i ) vIn[i] = vOut[i];
|
||||
nOut = pyr[1].clipPolygonFront( vIn, vOut, nOut );
|
||||
if( nOut == 0 ) return;
|
||||
for( i = 0; i < nOut; ++i ) vIn[i] = vOut[i];
|
||||
nOut = pyr[2].clipPolygonFront( vIn, vOut, nOut );
|
||||
if( nOut == 0 ) return;
|
||||
for( i = 0; i < nOut; ++i ) vIn[i] = vOut[i];
|
||||
nOut = pyr[3].clipPolygonFront( vIn, vOut, nOut );
|
||||
if( nOut >= 3 )
|
||||
{
|
||||
NLMISC::CVector vMin(1, 1, 1), vMax(-1, -1, -1);
|
||||
for( i = 0; i < nOut; ++i )
|
||||
{
|
||||
vOut[i] = gridPlane.intersect( NLMISC::CVector(0, 0, 0), vOut[i] );
|
||||
if( vMin.x > vOut[i].x ) vMin.x = vOut[i].x;
|
||||
if( vMin.y > vOut[i].y ) vMin.y = vOut[i].y;
|
||||
if( vMin.z > vOut[i].z ) vMin.z = vOut[i].z;
|
||||
if( vMax.x < vOut[i].x ) vMax.x = vOut[i].x;
|
||||
if( vMax.y < vOut[i].y ) vMax.y = vOut[i].y;
|
||||
if( vMax.z < vOut[i].z ) vMax.z = vOut[i].z;
|
||||
}
|
||||
// Create the bbox
|
||||
_Grids[nGridNb].insert( vMin, vMax, cell );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // NL3D
|
||||
|
||||
|
||||
#endif // NL_CUBE_GRID_H
|
||||
|
||||
/* End of cube_grid.h */
|
55
code/nel/include/nel/3d/cube_map_builder.h
Normal file
55
code/nel/include/nel/3d/cube_map_builder.h
Normal file
|
@ -0,0 +1,55 @@
|
|||
// 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 CUBE_MAP_BUILDER_H
|
||||
#define CUBE_MAP_BUILDER_H
|
||||
|
||||
#include "nel/misc/rgba.h"
|
||||
|
||||
namespace NLMISC
|
||||
{
|
||||
class CVector;
|
||||
}
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
class CTextureCube;
|
||||
|
||||
/** A cube map functor should return a color from a vector (with each coordinate ranging from [-1..1]
|
||||
*/
|
||||
struct ICubeMapFunctor
|
||||
{
|
||||
virtual ~ICubeMapFunctor() {}
|
||||
virtual NLMISC::CRGBA operator()(const NLMISC::CVector &v) = 0;
|
||||
};
|
||||
|
||||
/** Build a cube map by using the given functor. This also avoid headaches :)
|
||||
* Each face is encoded in a memory texture
|
||||
* \param mapSize the size of each tface of the cube map
|
||||
* \param f a functor that helps to build the cube map.
|
||||
* \param luminanceOnly When set to true, a luminance cube map is build. The luminance is taken from the alpha component of the color produced by the functor.
|
||||
* Warning : this isn't supported anywhere.
|
||||
* \param shareName a prefix for sharename. If not empty this allow each face of the cube map to be sharable (a number is appended to the given string)
|
||||
*/
|
||||
CTextureCube *BuildCubeMap(sint mapSize, ICubeMapFunctor &f, bool luminanceOnly = false, const std::string &shareName = "");
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
66
code/nel/include/nel/3d/debug_vb.h
Normal file
66
code/nel/include/nel/3d/debug_vb.h
Normal file
|
@ -0,0 +1,66 @@
|
|||
|
||||
// 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_DEBUG_VB_H
|
||||
#define NL_DEBUG_VB_H
|
||||
|
||||
// helper macro for debug
|
||||
/// this macro is used to see whether a write in a vertex buffer is correct
|
||||
|
||||
#ifdef NL_DEBUG
|
||||
//#define NL_DEBUG_VB
|
||||
#endif
|
||||
|
||||
#ifdef NL_DEBUG_VB
|
||||
|
||||
#define CHECK_VERTEX_BUFFER(vb, pt) nlCheckVertexBuffer((vb), (const uint8 *) (pt));
|
||||
#define CHECK_VBA(vba, pt) nlCheckVBA((vba), (const uint8 *) (pt));
|
||||
#define CHECK_VBA_RANGE(vba, ptStart, length) nlCheckVBARange((vba), (const uint8 *) (ptStart), (uint) (length));
|
||||
#define CHECK_IBA_RANGE(iba, ptStart, length) nlCheckIBARange((iba), (const uint8 *) (ptStart), (uint) (length));
|
||||
#define CHECK_IBA(iba, ptStart) nlCheckIBA((iba), (const uint8 *) (ptStart));
|
||||
|
||||
#else
|
||||
#define CHECK_VERTEX_BUFFER(a,b)
|
||||
#define CHECK_VBA(vbA, pt)
|
||||
#define CHECK_VBA_RANGE(vba, ptStart, length)
|
||||
#define CHECK_IBA_RANGE(iba, ptStart, length)
|
||||
#define CHECK_IBA(iba, ptStart)
|
||||
#endif
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
class CVertexBuffer;
|
||||
class CVertexBufferRead;
|
||||
class CVertexBufferReadWrite;
|
||||
class CIndexBufferRead;
|
||||
class CIndexBufferReadWrite;
|
||||
|
||||
void nlCheckVertexBuffer(const CVertexBuffer &vb, const uint8 *ptr);
|
||||
void nlCheckVBA(CVertexBufferRead &vbr, const uint8 *ptr);
|
||||
void nlCheckVBA(CVertexBufferReadWrite &vbrw, const uint8 *ptr);
|
||||
void nlCheckVBARange(CVertexBufferRead &vbr, const uint8 *ptStart, uint length);
|
||||
void nlCheckVBARange(CVertexBufferReadWrite &vbrw, const uint8 *ptStart, uint length);
|
||||
void nlCheckIBARange(CIndexBufferReadWrite &ibrw, const uint8 *ptStart, uint length);
|
||||
void nlCheckIBARange(CIndexBufferRead &ibr, const uint8 *ptStart, uint length);
|
||||
void nlCheckIBA(CIndexBufferReadWrite &ibrw, const uint8 *ptStart);
|
||||
void nlCheckIBA(CIndexBufferRead &ibrw, const uint8 *ptStart);
|
||||
|
||||
|
||||
} // NL3D
|
||||
|
||||
#endif
|
87
code/nel/include/nel/3d/deform_2d.h
Normal file
87
code/nel/include/nel/3d/deform_2d.h
Normal file
|
@ -0,0 +1,87 @@
|
|||
// 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_DEFORM_2D_H
|
||||
#define NL_DEFORM_2D_H
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/smart_ptr.h"
|
||||
#include "nel/misc/vector_2f.h"
|
||||
#include "nel/3d/vertex_buffer.h"
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
class IDriver ;
|
||||
class ITexture ;
|
||||
/**
|
||||
* This perform a 2d deformation effect on the frame buffer, by using the given function and surface.
|
||||
* This is intended to be used on small surfaces only (getting back data from the frame buffer to build
|
||||
* a texture is really slow...)
|
||||
* \author Nicolas Vizerie
|
||||
* \author Nevrax France
|
||||
* \date 2001
|
||||
*/
|
||||
class CDeform2d
|
||||
{
|
||||
public:
|
||||
typedef std::vector<NLMISC::CVector2f> TPoint2DVect ;
|
||||
|
||||
/// an interface to compute the u,v perturbations at a given point (x and and y range from 0 to 1)
|
||||
struct IPerturbUV
|
||||
{
|
||||
virtual ~IPerturbUV() {}
|
||||
virtual void perturbUV(float x, float y, float &du, float &dv) const = 0 ;
|
||||
};
|
||||
|
||||
// perform the fx on the given surface of the screen
|
||||
static void doDeform(const TPoint2DVect &surf, IDriver *drv, IPerturbUV *uvp) ;
|
||||
/** resize the granularity of buffers for fxs
|
||||
* \param width frameBuffer width
|
||||
* \param height framebuffer height
|
||||
* \param xGranularity width of the quads taken from the framebuffer
|
||||
* \param yGranularity height of the quads taken from the framebuffer
|
||||
* \param xQuad width of the quads used to draw the fx (this is usually lower than xGanularity)
|
||||
* \param yQuad height of the quads used to draw the fx (this is usually lower than yGanularity)
|
||||
*/
|
||||
static void setupBuffer(uint width, uint height, uint xGranularity, uint yGranularity
|
||||
, uint xQuad, uint yQuad) ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
static uint _Width;
|
||||
static uint _Height;
|
||||
static uint _XGranularity;
|
||||
static uint _YGranularity;
|
||||
static uint _XQuad;
|
||||
static uint _YQuad;
|
||||
static NLMISC::CSmartPtr<ITexture> _Tex ; // the texture used to get back datas from the framebuffer
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
} // NL3D
|
||||
|
||||
|
||||
#endif // NL_DEFORM_2D_H
|
||||
|
||||
/* End of deform_2d.h */
|
1256
code/nel/include/nel/3d/driver.h
Normal file
1256
code/nel/include/nel/3d/driver.h
Normal file
File diff suppressed because it is too large
Load diff
431
code/nel/include/nel/3d/driver_material_inline.h
Normal file
431
code/nel/include/nel/3d/driver_material_inline.h
Normal file
|
@ -0,0 +1,431 @@
|
|||
// 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_DRIVER_MATERIAL_INLINE_H
|
||||
#define NL_DRIVER_MATERIAL_INLINE_H
|
||||
|
||||
#include "nel/misc/debug.h"
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
// --------------------------------------------------
|
||||
|
||||
inline bool CMaterial::texturePresent(uint8 n) const
|
||||
{
|
||||
nlassert(n<IDRV_MAT_MAXTEXTURES);
|
||||
if (_Textures[n])
|
||||
{
|
||||
return(true);
|
||||
}
|
||||
return(false);
|
||||
}
|
||||
|
||||
inline ITexture* CMaterial::getTexture(uint8 n) const
|
||||
{
|
||||
nlassert(n<IDRV_MAT_MAXTEXTURES);
|
||||
return(_Textures[n]);
|
||||
}
|
||||
|
||||
inline void CMaterial::setSrcBlend(TBlend val)
|
||||
{
|
||||
_SrcBlend=val;
|
||||
_Touched|=IDRV_TOUCHED_BLENDFUNC;
|
||||
}
|
||||
|
||||
inline void CMaterial::setDstBlend(TBlend val)
|
||||
{
|
||||
_DstBlend=val;
|
||||
_Touched|=IDRV_TOUCHED_BLENDFUNC;
|
||||
}
|
||||
|
||||
inline void CMaterial::setBlend(bool active)
|
||||
{
|
||||
if (active) _Flags|=IDRV_MAT_BLEND;
|
||||
else _Flags&=~IDRV_MAT_BLEND;
|
||||
_Touched|=IDRV_TOUCHED_BLEND;
|
||||
}
|
||||
|
||||
inline void CMaterial::setDoubleSided(bool active)
|
||||
{
|
||||
if (active) _Flags|=IDRV_MAT_DOUBLE_SIDED;
|
||||
else _Flags&=~IDRV_MAT_DOUBLE_SIDED;
|
||||
_Touched|=IDRV_TOUCHED_DOUBLE_SIDED;
|
||||
}
|
||||
|
||||
inline void CMaterial::setAlphaTest(bool active)
|
||||
{
|
||||
if (active) _Flags|=IDRV_MAT_ALPHA_TEST;
|
||||
else _Flags&=~IDRV_MAT_ALPHA_TEST;
|
||||
_Touched|=IDRV_TOUCHED_ALPHA_TEST;
|
||||
}
|
||||
|
||||
inline void CMaterial::setAlphaTestThreshold(float thre)
|
||||
{
|
||||
_AlphaTestThreshold= thre;
|
||||
_Touched|=IDRV_TOUCHED_ALPHA_TEST_THRE;
|
||||
}
|
||||
|
||||
inline void CMaterial::setBlendFunc(TBlend src, TBlend dst)
|
||||
{
|
||||
_SrcBlend=src;
|
||||
_DstBlend=dst;
|
||||
_Touched|=IDRV_TOUCHED_BLENDFUNC;
|
||||
}
|
||||
|
||||
|
||||
inline void CMaterial::setZFunc(ZFunc val)
|
||||
{
|
||||
_ZFunction=val;
|
||||
_Touched|=IDRV_TOUCHED_ZFUNC;
|
||||
}
|
||||
|
||||
inline void CMaterial::setZWrite(bool active)
|
||||
{
|
||||
if (active) _Flags|=IDRV_MAT_ZWRITE;
|
||||
else _Flags&=~IDRV_MAT_ZWRITE;
|
||||
_Touched|=IDRV_TOUCHED_ZWRITE;
|
||||
}
|
||||
|
||||
inline void CMaterial::setZBias(float val)
|
||||
{
|
||||
_ZBias=val;
|
||||
_Touched|=IDRV_TOUCHED_ZBIAS;
|
||||
}
|
||||
|
||||
inline void CMaterial::setColor(NLMISC::CRGBA rgba)
|
||||
{
|
||||
if (_Color != rgba)
|
||||
{
|
||||
_Color=rgba;
|
||||
_Touched|=IDRV_TOUCHED_COLOR;
|
||||
}
|
||||
}
|
||||
|
||||
inline void CMaterial::setLighting( bool active,
|
||||
NLMISC::CRGBA emissive,
|
||||
NLMISC::CRGBA ambient,
|
||||
NLMISC::CRGBA diffuse,
|
||||
NLMISC::CRGBA specular,
|
||||
float shininess)
|
||||
{
|
||||
if (active)
|
||||
{
|
||||
_Flags|=IDRV_MAT_LIGHTING;
|
||||
}
|
||||
else
|
||||
{
|
||||
_Flags&=~IDRV_MAT_LIGHTING;
|
||||
}
|
||||
_Emissive=emissive;
|
||||
_Ambient=ambient;
|
||||
_Diffuse=diffuse;
|
||||
_Specular=specular;
|
||||
_Shininess= shininess;
|
||||
_Touched|=IDRV_TOUCHED_LIGHTING;
|
||||
}
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
inline void CMaterial::setEmissive( CRGBA emissive)
|
||||
{
|
||||
_Emissive= emissive;
|
||||
_Touched|=IDRV_TOUCHED_LIGHTING;
|
||||
}
|
||||
// ***************************************************************************
|
||||
inline void CMaterial::setAmbient( CRGBA ambient)
|
||||
{
|
||||
_Ambient= ambient;
|
||||
_Touched|=IDRV_TOUCHED_LIGHTING;
|
||||
}
|
||||
// ***************************************************************************
|
||||
inline void CMaterial::setDiffuse( CRGBA diffuse)
|
||||
{
|
||||
// Keep opacity.
|
||||
_Diffuse.R= diffuse.R;
|
||||
_Diffuse.G= diffuse.G;
|
||||
_Diffuse.B= diffuse.B;
|
||||
_Touched|=IDRV_TOUCHED_LIGHTING;
|
||||
}
|
||||
// ***************************************************************************
|
||||
inline void CMaterial::setOpacity( uint8 opa )
|
||||
{
|
||||
_Diffuse.A= opa;
|
||||
_Touched|=IDRV_TOUCHED_LIGHTING;
|
||||
}
|
||||
// ***************************************************************************
|
||||
inline void CMaterial::setSpecular( CRGBA specular)
|
||||
{
|
||||
_Specular= specular;
|
||||
_Touched|=IDRV_TOUCHED_LIGHTING;
|
||||
}
|
||||
// ***************************************************************************
|
||||
inline void CMaterial::setShininess( float shininess )
|
||||
{
|
||||
_Shininess= shininess;
|
||||
_Touched|=IDRV_TOUCHED_LIGHTING;
|
||||
}
|
||||
// ***************************************************************************
|
||||
inline void CMaterial::setLightedVertexColor( bool useLightedVertexColor )
|
||||
{
|
||||
if (useLightedVertexColor)
|
||||
_Flags |= IDRV_MAT_LIGHTED_VERTEX_COLOR;
|
||||
else
|
||||
_Flags &= ~IDRV_MAT_LIGHTED_VERTEX_COLOR;
|
||||
_Touched|=IDRV_TOUCHED_LIGHTING;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
inline bool CMaterial::getLightedVertexColor () const
|
||||
{
|
||||
return (_Flags & IDRV_MAT_LIGHTED_VERTEX_COLOR) != 0;
|
||||
}
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// ***************************************************************************
|
||||
// ***************************************************************************
|
||||
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
inline void CMaterial::texEnvOpRGB(uint stage, TTexOperator ope)
|
||||
{
|
||||
nlassert(_ShaderType==CMaterial::Normal);
|
||||
nlassert(stage<IDRV_MAT_MAXTEXTURES);
|
||||
_TexEnvs[stage].Env.OpRGB= ope;
|
||||
_Touched|=IDRV_TOUCHED_TEXENV;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
inline CMaterial::TTexOperator CMaterial::getTexEnvOpRGB(uint stage) const
|
||||
{
|
||||
nlassert(_ShaderType==CMaterial::Normal);
|
||||
nlassert(stage<IDRV_MAT_MAXTEXTURES);
|
||||
return (TTexOperator) _TexEnvs[stage].Env.OpRGB;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
inline void CMaterial::texEnvArg0RGB(uint stage, TTexSource src, TTexOperand oper)
|
||||
{
|
||||
nlassert(_ShaderType==CMaterial::Normal);
|
||||
nlassert(stage<IDRV_MAT_MAXTEXTURES);
|
||||
_TexEnvs[stage].Env.SrcArg0RGB= src;
|
||||
_TexEnvs[stage].Env.OpArg0RGB= oper;
|
||||
_Touched|=IDRV_TOUCHED_TEXENV;
|
||||
}
|
||||
// ***************************************************************************
|
||||
inline void CMaterial::texEnvArg1RGB(uint stage, TTexSource src, TTexOperand oper)
|
||||
{
|
||||
nlassert(_ShaderType==CMaterial::Normal);
|
||||
nlassert(stage<IDRV_MAT_MAXTEXTURES);
|
||||
_TexEnvs[stage].Env.SrcArg1RGB= src;
|
||||
_TexEnvs[stage].Env.OpArg1RGB= oper;
|
||||
_Touched|=IDRV_TOUCHED_TEXENV;
|
||||
}
|
||||
// ***************************************************************************
|
||||
inline void CMaterial::texEnvArg2RGB(uint stage, TTexSource src, TTexOperand oper)
|
||||
{
|
||||
nlassert(_ShaderType==CMaterial::Normal);
|
||||
nlassert(stage<IDRV_MAT_MAXTEXTURES);
|
||||
_TexEnvs[stage].Env.SrcArg2RGB= src;
|
||||
_TexEnvs[stage].Env.OpArg2RGB= oper;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
inline void CMaterial::texEnvOpAlpha(uint stage, TTexOperator ope)
|
||||
{
|
||||
nlassert(_ShaderType==CMaterial::Normal);
|
||||
nlassert(stage<IDRV_MAT_MAXTEXTURES);
|
||||
_TexEnvs[stage].Env.OpAlpha= ope;
|
||||
_Touched|=IDRV_TOUCHED_TEXENV;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
inline CMaterial::TTexOperator CMaterial::getTexEnvOpAlpha(uint stage) const
|
||||
{
|
||||
nlassert(_ShaderType==CMaterial::Normal);
|
||||
nlassert(stage<IDRV_MAT_MAXTEXTURES);
|
||||
return (TTexOperator) _TexEnvs[stage].Env.OpAlpha;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
inline void CMaterial::texEnvArg0Alpha(uint stage, TTexSource src, TTexOperand oper)
|
||||
{
|
||||
nlassert(_ShaderType==CMaterial::Normal);
|
||||
nlassert(stage<IDRV_MAT_MAXTEXTURES);
|
||||
nlassert(oper==SrcAlpha || oper==InvSrcAlpha);
|
||||
_TexEnvs[stage].Env.SrcArg0Alpha= src;
|
||||
_TexEnvs[stage].Env.OpArg0Alpha= oper;
|
||||
_Touched|=IDRV_TOUCHED_TEXENV;
|
||||
}
|
||||
// ***************************************************************************
|
||||
inline void CMaterial::texEnvArg1Alpha(uint stage, TTexSource src, TTexOperand oper)
|
||||
{
|
||||
nlassert(_ShaderType==CMaterial::Normal);
|
||||
nlassert(stage<IDRV_MAT_MAXTEXTURES);
|
||||
nlassert(oper==SrcAlpha || oper==InvSrcAlpha);
|
||||
_TexEnvs[stage].Env.SrcArg1Alpha= src;
|
||||
_TexEnvs[stage].Env.OpArg1Alpha= oper;
|
||||
_Touched|=IDRV_TOUCHED_TEXENV;
|
||||
}
|
||||
// ***************************************************************************
|
||||
inline void CMaterial::texEnvArg2Alpha(uint stage, TTexSource src, TTexOperand oper)
|
||||
{
|
||||
nlassert(_ShaderType==CMaterial::Normal);
|
||||
nlassert(stage<IDRV_MAT_MAXTEXTURES);
|
||||
nlassert(oper==SrcAlpha || oper==InvSrcAlpha);
|
||||
_TexEnvs[stage].Env.SrcArg2Alpha= src;
|
||||
_TexEnvs[stage].Env.OpArg2Alpha= oper;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
inline void CMaterial::texConstantColor(uint stage, CRGBA color)
|
||||
{
|
||||
nlassert(_ShaderType==CMaterial::Normal);
|
||||
nlassert(stage<IDRV_MAT_MAXTEXTURES);
|
||||
_TexEnvs[stage].ConstantColor= color;
|
||||
_Touched|=IDRV_TOUCHED_TEXENV;
|
||||
}
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
inline uint32 CMaterial::getTexEnvMode(uint stage)
|
||||
{
|
||||
nlassert(_ShaderType==CMaterial::Normal);
|
||||
nlassert(stage<IDRV_MAT_MAXTEXTURES);
|
||||
return _TexEnvs[stage].EnvPacked;
|
||||
}
|
||||
// ***************************************************************************
|
||||
inline void CMaterial::setTexEnvMode(uint stage, uint32 packed)
|
||||
{
|
||||
nlassert(_ShaderType==CMaterial::Normal);
|
||||
nlassert(stage<IDRV_MAT_MAXTEXTURES);
|
||||
_TexEnvs[stage].EnvPacked= packed;
|
||||
_Touched|=IDRV_TOUCHED_TEXENV;
|
||||
}
|
||||
// ***************************************************************************
|
||||
inline CRGBA CMaterial::getTexConstantColor(uint stage)
|
||||
{
|
||||
nlassert(_ShaderType==CMaterial::Normal);
|
||||
nlassert(stage<IDRV_MAT_MAXTEXTURES);
|
||||
return _TexEnvs[stage].ConstantColor;
|
||||
}
|
||||
// ***************************************************************************
|
||||
inline bool CMaterial::getTexCoordGen(uint stage) const
|
||||
{
|
||||
nlassert(stage<IDRV_MAT_MAXTEXTURES);
|
||||
return (_Flags&(IDRV_MAT_GEN_TEX_0<<stage))!=0;
|
||||
}
|
||||
// ***************************************************************************
|
||||
inline void CMaterial::setTexCoordGen(uint stage, bool generate)
|
||||
{
|
||||
nlassert(stage<IDRV_MAT_MAXTEXTURES);
|
||||
if (generate)
|
||||
_Flags|=(IDRV_MAT_GEN_TEX_0<<stage);
|
||||
else
|
||||
_Flags&=~(IDRV_MAT_GEN_TEX_0<<stage);
|
||||
_Touched|=IDRV_TOUCHED_TEXGEN;
|
||||
}
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// ***************************************************************************
|
||||
// ***************************************************************************
|
||||
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
inline void CMaterial::setUserColor(CRGBA userColor)
|
||||
{
|
||||
nlassert(_ShaderType==CMaterial::UserColor);
|
||||
// setup stage 0 constant color (don't use texConstantColor() because of assert).
|
||||
_TexEnvs[0].ConstantColor= userColor;
|
||||
_Touched|=IDRV_TOUCHED_TEXENV;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
inline CRGBA CMaterial::getUserColor() const
|
||||
{
|
||||
nlassert(_ShaderType==CMaterial::UserColor);
|
||||
// setup stage 0 constant color (don't use getTexConstantColor() because of assert).
|
||||
return _TexEnvs[0].ConstantColor;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
inline void CMaterial::enableUserTexMat(uint stage, bool enabled /*= true*/)
|
||||
{
|
||||
nlassert(stage < IDRV_MAT_MAXTEXTURES);
|
||||
if (enabled)
|
||||
{
|
||||
if (!(_Flags & IDRV_MAT_USER_TEX_MAT_ALL)) // not usr tex mat setupped before?
|
||||
{
|
||||
nlassert(_TexUserMat.get() == NULL);
|
||||
_TexUserMat.reset(new CUserTexMat);
|
||||
}
|
||||
_Flags |= (IDRV_MAT_USER_TEX_0_MAT << stage);
|
||||
_TexUserMat->TexMat[stage].identity();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(_Flags & IDRV_MAT_USER_TEX_MAT_ALL)) return; // nothing to do
|
||||
_Flags &= ~(IDRV_MAT_USER_TEX_0_MAT << stage); // clear the stage flag
|
||||
if (!(_Flags & IDRV_MAT_USER_TEX_MAT_ALL)) // no more user textures used ?
|
||||
{
|
||||
_TexUserMat.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
inline bool CMaterial::isUserTexMatEnabled(uint stage) const
|
||||
{
|
||||
nlassert(stage < IDRV_MAT_MAXTEXTURES);
|
||||
return (_Flags & (IDRV_MAT_USER_TEX_0_MAT << stage)) != 0;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
inline void CMaterial::setUserTexMat(uint stage, const NLMISC::CMatrix &m)
|
||||
{
|
||||
nlassert(isUserTexMatEnabled(stage));
|
||||
nlassert(_TexUserMat.get() != NULL);
|
||||
_TexUserMat->TexMat[stage] = m;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
inline const NLMISC::CMatrix &CMaterial::getUserTexMat(uint stage) const
|
||||
{
|
||||
nlassert(isUserTexMatEnabled(stage));
|
||||
nlassert(_TexUserMat.get() != NULL);
|
||||
return _TexUserMat->TexMat[stage];
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
inline void CMaterial::setTexCoordGenMode(uint stage, TTexCoordGenMode mode)
|
||||
{
|
||||
if(stage>=IDRV_MAT_MAXTEXTURES)
|
||||
return;
|
||||
_TexCoordGenMode&= ~ (IDRV_MAT_TEX_GEN_MASK << (stage*IDRV_MAT_TEX_GEN_SHIFT));
|
||||
_TexCoordGenMode|= ((mode&IDRV_MAT_TEX_GEN_MASK) << (stage*IDRV_MAT_TEX_GEN_SHIFT));
|
||||
_Touched|=IDRV_TOUCHED_TEXGEN;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
591
code/nel/include/nel/3d/driver_user.h
Normal file
591
code/nel/include/nel/3d/driver_user.h
Normal file
|
@ -0,0 +1,591 @@
|
|||
// 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_DRIVER_USER_H
|
||||
#define NL_DRIVER_USER_H
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/common.h"
|
||||
#include "nel/misc/hierarchical_timer.h"
|
||||
#include "nel/3d/u_driver.h"
|
||||
#include "nel/3d/u_material.h"
|
||||
#include "nel/3d/event_mouse_listener.h"
|
||||
#include "nel/3d/driver.h"
|
||||
#include "nel/3d/register_3d.h"
|
||||
#include "nel/3d/vertex_buffer.h"
|
||||
#include "nel/3d/index_buffer.h"
|
||||
#include "nel/3d/font_manager.h"
|
||||
#include "nel/3d/ptr_set.h"
|
||||
#include "nel/3d/shape_bank_user.h"
|
||||
#include "nel/3d/light_user.h"
|
||||
#include "nel/3d/vertex_stream_manager.h"
|
||||
#include "nel/3d/async_texture_manager.h"
|
||||
#include "nel/3d/lod_character_manager.h"
|
||||
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
|
||||
class CTextureUser;
|
||||
class CTextContextUser;
|
||||
class CSceneUser;
|
||||
class CAnimationSetUser;
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
/** UDriver implementation.
|
||||
* \author Lionel Berenguier
|
||||
* \author Nevrax France
|
||||
* \date 2001
|
||||
*/
|
||||
class CDriverUser : public UDriver
|
||||
{
|
||||
// **********************
|
||||
protected:
|
||||
struct CMatrixContext
|
||||
{
|
||||
CScissor Scissor; // Init to fullscreen.
|
||||
CViewport Viewport; // Init to fullscreen.
|
||||
CFrustum Frustum;
|
||||
CMatrix ViewMatrix;
|
||||
CMatrix ModelMatrix;
|
||||
};
|
||||
|
||||
|
||||
protected:
|
||||
IDriver *_Driver;
|
||||
bool _WindowInit;
|
||||
CMatrixContext _CurrentMatrixContext;
|
||||
CFontManager _FontManager;
|
||||
// Components List.
|
||||
typedef CPtrSet<CTextureUser> TTextureSet;
|
||||
typedef CPtrSet<CTextContextUser> TTextContextSet;
|
||||
typedef CPtrSet<CSceneUser> TSceneSet;
|
||||
typedef CPtrSet<CAnimationSetUser> TAnimationSetSet;
|
||||
TTextureSet _Textures;
|
||||
TTextContextSet _TextContexts;
|
||||
TSceneSet _Scenes;
|
||||
TAnimationSetSet _AnimationSets;
|
||||
CShapeBankUser _ShapeBank;
|
||||
// There is one MeshSkin Vertex Stream per driver, and for all scenes.
|
||||
CVertexStreamManager _MeshSkinManager;
|
||||
// Special MeshSkin Vertex Stream for shadow generation
|
||||
CVertexStreamManager _ShadowMeshSkinManager;
|
||||
// There is one AsyncTextureManager per driver, and for all scenes
|
||||
CAsyncTextureManager _AsyncTextureManager;
|
||||
// There is one LodCharacterManager per driver, and for all scenes
|
||||
CLodCharacterManager _LodCharacterManager;
|
||||
|
||||
// For 2D/3D Interface.
|
||||
CVertexBuffer _VBFlat;
|
||||
CVertexBuffer _VBColor;
|
||||
CVertexBuffer _VBUv;
|
||||
CVertexBuffer _VBColorUv;
|
||||
CIndexBuffer _PBLine, _PBTri;
|
||||
|
||||
CVertexBuffer _VBQuadsColUv;
|
||||
CVertexBuffer _VBQuadsColUv2;
|
||||
CVertexBuffer _VBTrisColUv;
|
||||
// For security, texture are initUnlit() at init()/release().
|
||||
UMaterial _MatFlat;
|
||||
UMaterial _MatText;
|
||||
UMaterial _MatStretchText;
|
||||
CMaterial _MatFlatInternal;
|
||||
CMaterial _MatTextInternal;
|
||||
CMaterial _MatTextStretchInternal;
|
||||
|
||||
|
||||
// StaticInit
|
||||
static bool _StaticInit;
|
||||
|
||||
protected:
|
||||
void setupMatrixContext();
|
||||
CMaterial &convMat(UMaterial &mat);
|
||||
|
||||
|
||||
// **********************
|
||||
public:
|
||||
|
||||
|
||||
/// \name Object
|
||||
// @{
|
||||
CDriverUser (uint windowIcon = 0, bool direct3d = false, emptyProc exitFunc = 0);
|
||||
virtual ~CDriverUser();
|
||||
// @}
|
||||
|
||||
virtual bool isLost() const;
|
||||
|
||||
/// \name Window / driver management.
|
||||
// @{
|
||||
|
||||
virtual void disableHardwareVertexProgram();
|
||||
virtual void disableHardwareVertexArrayAGP();
|
||||
virtual void disableHardwareTextureShader();
|
||||
|
||||
/// create the window.
|
||||
virtual bool setDisplay(const CMode &mode, bool show, bool resizeable);
|
||||
virtual bool setDisplay(void *wnd, const CMode &mode, bool show, bool resizeable);
|
||||
virtual bool setMode(const CMode& mode);
|
||||
virtual bool getModes(std::vector<CMode> &modes);
|
||||
virtual bool getCurrentScreenMode(CMode &mode);
|
||||
virtual void beginDialogMode();
|
||||
virtual void endDialogMode();
|
||||
|
||||
/// Set the title of the NeL window
|
||||
virtual void setWindowTitle(const ucstring &title);
|
||||
|
||||
/// Set the position of the NeL window
|
||||
virtual void setWindowPos(uint32 x, uint32 y);
|
||||
|
||||
/// Show or hide the NeL window
|
||||
virtual void showWindow(bool show);
|
||||
|
||||
/// Release the window.
|
||||
virtual void release();
|
||||
|
||||
/// Before rendering via a driver in a thread, must activate() (per thread).
|
||||
virtual bool activate(void);
|
||||
/// Return true if driver is still active. Return false else. If he user close the window, must return false.
|
||||
virtual bool isActive();
|
||||
/// Return an OS dependent window handle. Under Win32, it is a HWND.
|
||||
virtual void *getDisplay ();
|
||||
|
||||
// @}
|
||||
|
||||
|
||||
/// \name Buffers.
|
||||
// @{
|
||||
/// This clear only the RGBA back buffer
|
||||
virtual void clearRGBABuffer(CRGBA col= CRGBA(255,255,255,255));
|
||||
/// This clear only the RGBA back buffer
|
||||
virtual void clearZBuffer();
|
||||
/// This clear the buffers (ALL the buffer :) )
|
||||
virtual void clearBuffers(CRGBA col= CRGBA(255,255,255,255));
|
||||
/// This swap the back and front buffer (ALL the buffer :) ).
|
||||
virtual void swapBuffers();
|
||||
virtual void finish();
|
||||
virtual void flush();
|
||||
|
||||
virtual void setSwapVBLInterval(uint interval);
|
||||
virtual uint getSwapVBLInterval();
|
||||
|
||||
// @}
|
||||
|
||||
|
||||
|
||||
/// \name Fog support.
|
||||
// @{
|
||||
virtual bool fogEnabled();
|
||||
virtual void enableFog(bool enable);
|
||||
/// setup fog parameters. fog must enabled to see result. start and end are in [0,1] range.
|
||||
virtual void setupFog(float start, float end, CRGBA color);
|
||||
// @}
|
||||
|
||||
/// \name Light support.
|
||||
// @{
|
||||
virtual void setLight (uint8 num, const ULight& light);
|
||||
virtual void enableLight (uint8 num, bool enable=true);
|
||||
virtual void setAmbientColor (CRGBA color);
|
||||
// @}
|
||||
|
||||
/// \name Cull mode
|
||||
// @{
|
||||
virtual void setCullMode(TCullMode cullMode);
|
||||
virtual TCullMode getCullMode() const;
|
||||
// @}
|
||||
|
||||
/// \name Stencil support
|
||||
// @{
|
||||
virtual void enableStencilTest(bool enable);
|
||||
virtual bool isStencilTestEnabled() const;
|
||||
virtual void stencilFunc(TStencilFunc stencilFunc, int ref, uint mask);
|
||||
virtual void stencilOp(TStencilOp fail, TStencilOp zfail, TStencilOp zpass);
|
||||
virtual void stencilMask(uint mask);
|
||||
// @}
|
||||
|
||||
/// \name Scene gestion.
|
||||
// @{
|
||||
/// Create a new scene.
|
||||
virtual UScene *createScene(bool bSmallScene);
|
||||
/// Delete a scene.
|
||||
virtual void deleteScene(UScene *scene);
|
||||
// @}
|
||||
|
||||
|
||||
/// \name AnimationSet gestion.
|
||||
// @{
|
||||
/// Create an empty AnimationSet.
|
||||
virtual UAnimationSet *createAnimationSet();
|
||||
/// Create a new AnimationSet, load it from a file. Use CPath to search the animation set. exception EPathNotFound if not found.
|
||||
virtual UAnimationSet *createAnimationSet(const std::string &animationSetFile);
|
||||
/// Delete a AnimationSet.
|
||||
virtual void deleteAnimationSet(UAnimationSet *animationSet);
|
||||
// @}
|
||||
|
||||
|
||||
/// \name Components gestion for Interface 2D/3D.
|
||||
// @{
|
||||
|
||||
/// create a new TextContext, for a given font.
|
||||
virtual UTextContext *createTextContext(const std::string fontFileName, const std::string fontExFileName = "");
|
||||
/// delete a TextContext.
|
||||
virtual void deleteTextContext(UTextContext *textContext);
|
||||
/// Set the maxMemory used for the FontManager
|
||||
virtual void setFontManagerMaxMemory(uint maxMem);
|
||||
/// get cahce information.
|
||||
virtual std::string getFontManagerCacheInformation() const ;
|
||||
|
||||
|
||||
/** Create a new texture file, searching in CPath.
|
||||
* \param file filename, local to CPath paths.
|
||||
*/
|
||||
virtual UTextureFile *createTextureFile(const std::string &file);
|
||||
/// Delete a texture file. This one will be really deleted in memory when no material point to it.
|
||||
virtual void deleteTextureFile(UTextureFile *textfile);
|
||||
/// Create a new Raw texture, to be filled by user.
|
||||
virtual UTextureMem *createTextureMem(uint width, uint height, CBitmap::TType texType = CBitmap::RGBA);
|
||||
/// Delete a Raw texture. This one will be really deleted in memory when no material point to it.
|
||||
virtual void deleteTextureMem(UTextureMem *textraw);
|
||||
/// Create a new Material, to be filled by user.
|
||||
virtual UMaterial createMaterial();
|
||||
/// Delete a Material.
|
||||
virtual void deleteMaterial(UMaterial &mat);
|
||||
// @}
|
||||
|
||||
|
||||
/// \name Matrix context for Interface 2D/3D.
|
||||
/** UScene ignore those function (use camera parameters instead), and do not disturb this active Matrix context.
|
||||
* (after a scene rendering, the Matrix context for this interface is restored).
|
||||
*/
|
||||
// @{
|
||||
|
||||
/** Set the active scissor for rendering. Default to fullscreen.
|
||||
*/
|
||||
virtual void setScissor(const CScissor &);
|
||||
virtual CScissor getScissor();
|
||||
/** Set the active viewport for rendering. Default to fullscreen.
|
||||
*/
|
||||
virtual void setViewport(const CViewport &);
|
||||
virtual CViewport getViewport();
|
||||
/** Set the active Frustum for rendering.
|
||||
*/
|
||||
virtual void setFrustum(const CFrustum &frust);
|
||||
virtual CFrustum getFrustum();
|
||||
virtual void setFrustumMatrix(CMatrix &frust);
|
||||
virtual CMatrix getFrustumMatrix();
|
||||
|
||||
virtual float getClipSpaceZMin() const;
|
||||
/** Set the active ViewMatrix for rendering.
|
||||
* NB: this is the view matrix, which is the inverse of camera matrix.
|
||||
*/
|
||||
virtual void setViewMatrix(const CMatrix &mat);
|
||||
virtual CMatrix getViewMatrix();
|
||||
/** Set the active ModelMatrix for rendering. NB: UScene ignore this function (use camera parameters instead).
|
||||
*/
|
||||
virtual void setModelMatrix(const CMatrix &mat);
|
||||
virtual CMatrix getModelMatrix();
|
||||
|
||||
|
||||
/** Tool function: Setup frustum/viewmatrix/modelmatrix for 2D.
|
||||
* ModelMatrix is setup to identity. ViewMatrix is setup so that (x,y) of vectors maps to x,y screen!!!
|
||||
*/
|
||||
virtual void setMatrixMode2D(const CFrustum &frust);
|
||||
/** Tool function: Setup frustum/viewmatrix/modelmatrix for 3D, using parameters of a UCamera.
|
||||
* ModelMatrix setuped to identity. ViewMatrix setuped to the inverse of camera 's LocalMatrix.
|
||||
* Frustum setuped to UCamera frustum.
|
||||
*/
|
||||
virtual void setMatrixMode3D(UCamera &camera);
|
||||
virtual void setDepthRange(float znear, float zfar);
|
||||
virtual void getDepthRange(float & znear, float & zfar);
|
||||
|
||||
/// Set the color mask filter through where the operation done will pass
|
||||
virtual void setColorMask (bool bRed, bool bGreen, bool bBlue, bool bAlpha);
|
||||
|
||||
|
||||
// @}
|
||||
|
||||
|
||||
/// \name Interface 2D/3D.
|
||||
/** All of those render primitives are unlit! You must use UScene to render lighted meshes.
|
||||
* NB: If you set a texture to your material, the primitives are textured, even if no Uvs are provided. \n
|
||||
* NB: All rendering are done in current viewport / current matrix context.
|
||||
*/
|
||||
// @{
|
||||
|
||||
/// Draw the Line, taking color from material.
|
||||
virtual void drawLine(const NLMISC::CLine &tri, UMaterial &mat);
|
||||
/// Draw the Line, taking color from primitive.
|
||||
virtual void drawLine(const NLMISC::CLineColor &tri, UMaterial &mat);
|
||||
/// Draw the Line, taking color from material. With UV for texture.
|
||||
virtual void drawLine(const NLMISC::CLineUV &tri, UMaterial &mat);
|
||||
/// Draw the Line, taking color from primitive. With UV for texture.
|
||||
virtual void drawLine(const NLMISC::CLineColorUV &tri, UMaterial &mat);
|
||||
|
||||
/// Draw the Triangle, taking color from material.
|
||||
virtual void drawTriangle(const NLMISC::CTriangle &tri, UMaterial &mat);
|
||||
/// Draw the Triangle, taking color from primitive.
|
||||
virtual void drawTriangle(const NLMISC::CTriangleColor &tri, UMaterial &mat);
|
||||
/// Draw the Triangle, taking color from material. With UV for texture.
|
||||
virtual void drawTriangle(const NLMISC::CTriangleUV &tri, UMaterial &mat);
|
||||
/// Draw the Triangle, taking color from primitive. With UV for texture.
|
||||
virtual void drawTriangle(const NLMISC::CTriangleColorUV &tri, UMaterial &mat);
|
||||
|
||||
/// Draw the Quad, taking color from material.
|
||||
virtual void drawQuad(const NLMISC::CQuad &tri, UMaterial &mat);
|
||||
/// Draw the Quad, taking color from primitive.
|
||||
virtual void drawQuad(const NLMISC::CQuadColor &tri, UMaterial &mat);
|
||||
/// Draw the Quad, taking color from material. With UV for texture.
|
||||
virtual void drawQuad(const NLMISC::CQuadUV &tri, UMaterial &mat);
|
||||
/// Draw the Quad, taking color from primitive. With UV for texture.
|
||||
virtual void drawQuad(const NLMISC::CQuadColorUV &tri, UMaterial &mat);
|
||||
|
||||
virtual void drawQuads(const std::vector<NLMISC::CQuadColorUV> &quad, UMaterial &mat);
|
||||
virtual void drawQuads(const std::vector<NLMISC::CQuadColorUV2> &quad, UMaterial &mat);
|
||||
virtual void drawTriangles(const std::vector<NLMISC::CTriangleColorUV> &tris, UMaterial &mat);
|
||||
virtual void drawQuads(const NLMISC::CQuadColorUV *quads, uint32 nbQuads, UMaterial &mat);
|
||||
virtual void drawQuads(const NLMISC::CQuadColorUV2 *quads, uint32 nbQuads, UMaterial &mat);
|
||||
virtual void drawTriangles(const NLMISC::CTriangleColorUV *tris, uint32 nbTris, UMaterial &mat);
|
||||
|
||||
// @}
|
||||
|
||||
|
||||
/// \name Tools for Interface 2D.
|
||||
/** For all those function, setMatrixMode2D*() should have been called (else strange results!!).
|
||||
*/
|
||||
// @{
|
||||
|
||||
/// Draw a bitmap 2D. Warning: this is slow...
|
||||
virtual void drawBitmap (float x, float y, float width, float height, class UTexture& texture, bool blend=true, CRGBA col= CRGBA(255,255,255,255));
|
||||
/// Draw a line in 2D. Warning: this is slow...
|
||||
virtual void drawLine (float x0, float y0, float x1, float y1, CRGBA col= CRGBA(255,255,255,255));
|
||||
/// Draw a Triangle in 2D. Warning: this is slow...
|
||||
virtual void drawTriangle (float x0, float y0, float x1, float y1, float x2, float y2, CRGBA col);
|
||||
/// Draw a Quad in 2D. Warning: this is slow...
|
||||
virtual void drawQuad (float x0, float y0, float x1, float y1, CRGBA col);
|
||||
/// Draw a Quad in 2D. Warning: this is slow...
|
||||
virtual void drawQuad (float xcenter, float ycenter, float radius, CRGBA col);
|
||||
/// Draw a Quad in 2D. Warning: this is slow...
|
||||
virtual void drawWiredQuad (float x0, float y0, float x1, float y1, CRGBA col);
|
||||
/// Draw a Quad in 2D. Warning: this is slow...
|
||||
virtual void drawWiredQuad (float xcenter, float ycenter, float radius, CRGBA col);
|
||||
|
||||
// @}
|
||||
|
||||
|
||||
|
||||
/// \name Driver information/Queries
|
||||
// @{
|
||||
virtual uint32 getImplementationVersion () const;
|
||||
virtual const char* getDriverInformation ();
|
||||
virtual const char* getVideocardInformation ();
|
||||
virtual uint getNbTextureStages();
|
||||
virtual void getWindowSize (uint32 &width, uint32 &height);
|
||||
virtual uint getWindowWidth ();
|
||||
virtual uint getWindowHeight ();
|
||||
virtual void getWindowPos (uint32 &x, uint32 &y);
|
||||
virtual uint32 getAvailableVertexAGPMemory ();
|
||||
virtual uint32 getAvailableVertexVRAMMemory ();
|
||||
virtual void getBuffer (CBitmap &bitmap);
|
||||
virtual void getZBuffer (std::vector<float> &zbuffer);
|
||||
virtual void getBufferPart (CBitmap &bitmap, NLMISC::CRect &rect);
|
||||
virtual void getZBufferPart (std::vector<float> &zbuffer, NLMISC::CRect &rect);
|
||||
virtual bool fillBuffer (CBitmap &bitmap);
|
||||
// @}
|
||||
|
||||
|
||||
/// \name Mouse / Keyboards / Game devices
|
||||
// @{
|
||||
virtual NLMISC::IMouseDevice *enableLowLevelMouse(bool enable, bool exclusive);
|
||||
//
|
||||
virtual NLMISC::IKeyboardDevice *enableLowLevelKeyboard(bool enable);
|
||||
virtual NLMISC::IInputDeviceManager *getLowLevelInputDeviceManager();
|
||||
virtual uint getDoubleClickDelay(bool hardwareMouse);
|
||||
|
||||
/// show cursor if b is true, or hide it if b is false
|
||||
virtual void showCursor (bool b);
|
||||
/// x and y must be between 0.0 and 1.0
|
||||
virtual void setMousePos (float x, float y);
|
||||
/// If true, capture the mouse to force it to stay under the window.
|
||||
virtual void setCapture (bool b);
|
||||
// @}
|
||||
|
||||
|
||||
/// \name Misc.
|
||||
// @{
|
||||
|
||||
/** Output a system message box and print a message with an icon. This method can be call even if the driver is not initialized.
|
||||
* This method is used to return internal driver problem when string can't be displayed in the driver window.
|
||||
* If the driver can't open a messageBox, it should not override this method and let the IDriver class manage it with the ASCII console.
|
||||
*
|
||||
* \param message This is the message to display in the message box.
|
||||
* \param title This is the title of the message box.
|
||||
* \param type This is the type of the message box, ie number of button and label of buttons.
|
||||
* \param icon This is the icon of the message box should use like warning, error etc...
|
||||
*/
|
||||
virtual TMessageBoxId systemMessageBox (const char* message, const char* title, TMessageBoxType type=okType, TMessageBoxIcon icon=noIcon);
|
||||
|
||||
|
||||
/** Set the global polygon mode. Can be filled, line or point. The implementation driver must
|
||||
* call IDriver::setPolygonMode and active this mode.
|
||||
*
|
||||
* \param polygon mode choose in this driver.
|
||||
* \see getPolygonMode(), TPolygonMode
|
||||
*/
|
||||
virtual void setPolygonMode (TPolygonMode mode);
|
||||
virtual U3dMouseListener* create3dMouseListener ();
|
||||
virtual void delete3dMouseListener (U3dMouseListener *listener);
|
||||
virtual TPolygonMode getPolygonMode ();
|
||||
virtual void forceDXTCCompression(bool dxtcComp);
|
||||
virtual void forceTextureResize(uint divisor);
|
||||
virtual void forceNativeFragmentPrograms(bool nativeOnly);
|
||||
virtual bool setMonitorColorProperties (const CMonitorColorProperties &properties);
|
||||
// @}
|
||||
|
||||
/// \name Shape Bank
|
||||
// @{
|
||||
///
|
||||
virtual UShapeBank* getShapeBank()
|
||||
{
|
||||
return &_ShapeBank;
|
||||
}
|
||||
// @}
|
||||
|
||||
|
||||
/// \name Profiling.
|
||||
// @{
|
||||
|
||||
virtual void profileRenderedPrimitives(CPrimitiveProfile &pIn, CPrimitiveProfile &pOut);
|
||||
|
||||
virtual uint32 profileAllocatedTextureMemory();
|
||||
|
||||
virtual uint32 profileSetupedMaterials() const;
|
||||
|
||||
virtual uint32 profileSetupedModelMatrix() const;
|
||||
|
||||
virtual void enableUsedTextureMemorySum (bool enable);
|
||||
|
||||
virtual uint32 getUsedTextureMemory() const;
|
||||
|
||||
virtual void startProfileVBHardLock();
|
||||
|
||||
virtual void endProfileVBHardLock(std::vector<std::string> &result);
|
||||
|
||||
virtual void profileVBHardAllocation(std::vector<std::string> &result);
|
||||
|
||||
virtual void startProfileIBLock();
|
||||
|
||||
virtual void endProfileIBLock(std::vector<std::string> &result);
|
||||
|
||||
virtual void profileIBAllocation(std::vector<std::string> &result);
|
||||
|
||||
virtual void profileTextureUsage(std::vector<std::string> &result);
|
||||
|
||||
// @}
|
||||
|
||||
|
||||
/// \name Async Texture loading mgt
|
||||
// @{
|
||||
virtual void setupAsyncTextureLod(uint baseLevel, uint maxLevel);
|
||||
virtual void setupAsyncTextureMaxUploadPerFrame(uint maxup);
|
||||
virtual void setupMaxTotalAsyncTextureSize(uint maxText);
|
||||
virtual void setupMaxHLSColoringPerFrame(uint maxCol);
|
||||
virtual void updateAsyncTexture();
|
||||
virtual uint getTotalAsyncTextureSizeAsked() const;
|
||||
virtual uint getLastAsyncTextureSizeGot() const;
|
||||
virtual void loadHLSBank(const std::string &fileName);
|
||||
// @}
|
||||
|
||||
virtual bool supportMADOperator() const;
|
||||
|
||||
virtual bool supportBloomEffect() const;
|
||||
|
||||
/// \name Bench
|
||||
// @{
|
||||
virtual void startBench (bool wantStandardDeviation = false, bool quick = false, bool reset = true);
|
||||
virtual void endBench ();
|
||||
virtual void displayBench (class NLMISC::CLog *log);
|
||||
// @}
|
||||
|
||||
/// \name Water envmap
|
||||
// @{
|
||||
virtual UWaterEnvMap *createWaterEnvMap();
|
||||
virtual void deleteWaterEnvMap(UWaterEnvMap *map);
|
||||
// @}
|
||||
|
||||
|
||||
virtual uint64 getSwapBufferCounter();
|
||||
|
||||
// copy the first texture in a second one of different dimensions
|
||||
virtual bool stretchRect(UScene * scene, class UTexture & srcUText, NLMISC::CRect &srcRect,
|
||||
class UTexture & destUText, NLMISC::CRect &destRect);
|
||||
|
||||
virtual bool setRenderTarget(class UTexture & uTex,
|
||||
uint32 x = 0,
|
||||
uint32 y = 0,
|
||||
uint32 width = 0,
|
||||
uint32 height = 0,
|
||||
uint32 mipmapLevel = 0,
|
||||
uint32 cubeFace = 0);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
/// \name Accessor for CSeneUser.
|
||||
// @{
|
||||
IDriver *getDriver()
|
||||
{
|
||||
return _Driver;
|
||||
}
|
||||
void restoreMatrixContext()
|
||||
{
|
||||
setupMatrixContext();
|
||||
}
|
||||
// same as restoreMatrixContext(), but don't reset Viewport/Scissor
|
||||
void restoreMatrixContextMatrixOnly();
|
||||
|
||||
// @}
|
||||
|
||||
};
|
||||
|
||||
|
||||
} // NL3D
|
||||
|
||||
|
||||
#endif // NL_DRIVER_USER_H
|
||||
|
||||
/* End of driver_user.h */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
173
code/nel/include/nel/3d/dru.h
Normal file
173
code/nel/include/nel/3d/dru.h
Normal file
|
@ -0,0 +1,173 @@
|
|||
// 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_DRU_H
|
||||
#define NL_DRU_H
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/common.h"
|
||||
#include "nel/3d/driver.h"
|
||||
#include "nel/3d/viewport.h"
|
||||
#include "nel/misc/geom_ext.h"
|
||||
#include "nel/misc/line.h"
|
||||
|
||||
|
||||
#ifdef NL_OS_WINDOWS
|
||||
# define NL3D_GL_DLL_NAME "nel_drv_opengl_win"
|
||||
# define NL3D_D3D_DLL_NAME "nel_drv_direct3d_win"
|
||||
#elif defined (NL_OS_UNIX)
|
||||
# define NL3D_GL_DLL_NAME "nel_drv_opengl"
|
||||
#else
|
||||
# error "Unknown system"
|
||||
#endif
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
|
||||
/// Exception thrown by CDru::createGlDriver.
|
||||
struct EDru : public NLMISC::Exception
|
||||
{
|
||||
EDru(const std::string &reason) : Exception(reason) {}
|
||||
};
|
||||
|
||||
struct EDruOpenglDriverNotFound : public EDru
|
||||
{
|
||||
EDruOpenglDriverNotFound() : EDru( NL3D_GL_DLL_NAME " not found" ) {}
|
||||
};
|
||||
|
||||
struct EDruOpenglDriverCorrupted : public EDru
|
||||
{
|
||||
EDruOpenglDriverCorrupted() : EDru( "Can't get NL3D_createIDriverInstance from " NL3D_GL_DLL_NAME " (Bad dll?)" ) {}
|
||||
};
|
||||
|
||||
struct EDruOpenglDriverOldVersion : public EDru
|
||||
{
|
||||
EDruOpenglDriverOldVersion() : EDru( NL3D_GL_DLL_NAME " is a too old version. Ask for a more recent file" ) {}
|
||||
};
|
||||
|
||||
struct EDruOpenglDriverUnknownVersion : public EDru
|
||||
{
|
||||
EDruOpenglDriverUnknownVersion() : EDru( NL3D_GL_DLL_NAME " is more recent than the application" ) {}
|
||||
};
|
||||
|
||||
struct EDruOpenglDriverCantCreateDriver : public EDru
|
||||
{
|
||||
EDruOpenglDriverCantCreateDriver() : EDru( NL3D_GL_DLL_NAME " can't create driver" ) {}
|
||||
};
|
||||
|
||||
#ifdef NL_OS_WINDOWS
|
||||
struct EDruDirect3dDriverNotFound : public EDru
|
||||
{
|
||||
EDruDirect3dDriverNotFound() : EDru( NL3D_D3D_DLL_NAME " not found" ) {}
|
||||
};
|
||||
|
||||
struct EDruDirect3dDriverCorrupted : public EDru
|
||||
{
|
||||
EDruDirect3dDriverCorrupted() : EDru( "Can't get NL3D_createIDriverInstance from " NL3D_D3D_DLL_NAME " (Bad dll?)" ) {}
|
||||
};
|
||||
|
||||
struct EDruDirect3dDriverOldVersion : public EDru
|
||||
{
|
||||
EDruDirect3dDriverOldVersion() : EDru( NL3D_D3D_DLL_NAME " is a too old version. Ask for a more recent file" ) {}
|
||||
};
|
||||
|
||||
struct EDruDirect3dDriverUnknownVersion : public EDru
|
||||
{
|
||||
EDruDirect3dDriverUnknownVersion() : EDru( NL3D_D3D_DLL_NAME " is more recent than the application" ) {}
|
||||
};
|
||||
|
||||
struct EDruDirect3dDriverCantCreateDriver : public EDru
|
||||
{
|
||||
EDruDirect3dDriverCantCreateDriver() : EDru( NL3D_D3D_DLL_NAME " can't create driver" ) {}
|
||||
};
|
||||
#endif // NL_OS_WINDOWS
|
||||
|
||||
/// The driver Utilities class of static.
|
||||
class CDRU
|
||||
{
|
||||
public:
|
||||
|
||||
/// Portable Function which create a GL Driver (using gl dll...).
|
||||
static IDriver *createGlDriver() throw(EDru);
|
||||
|
||||
#ifdef NL_OS_WINDOWS
|
||||
/// Windows Function which create a Direct3d Driver.
|
||||
static IDriver *createD3DDriver() throw(EDru);
|
||||
#endif // NL_OS_WINDOWS
|
||||
|
||||
/// \name 2D render.
|
||||
// @{
|
||||
/// Draw a bitmap 2D. Warning: this is slow...
|
||||
static void drawBitmap (float x, float y, float width, float height, class ITexture& texture, IDriver& driver, CViewport viewport=CViewport(), bool blend=true);
|
||||
/// Draw a line in 2D. Warning: this is slow...
|
||||
static void drawLine (float x0, float y0, float x1, float y1, IDriver& driver, CRGBA col= CRGBA(255,255,255,255), CViewport viewport=CViewport());
|
||||
/// Draw a Triangle in 2D. Warning: this is slow...
|
||||
static void drawTriangle (float x0, float y0, float x1, float y1, float x2, float y2, IDriver& driver, CRGBA col, CViewport viewport);
|
||||
/// Draw a Quad in 2D. Warning: this is slow...
|
||||
static void drawQuad (float x0, float y0, float x1, float y1, IDriver& driver, CRGBA col, CViewport viewport);
|
||||
/**
|
||||
* Draw a color Quad in 2D. Warning: this is slow...
|
||||
*
|
||||
* \param x0 is the x coordinate of the lower left corner.
|
||||
* \param y0 is the y coordinate of the lower left corner.
|
||||
* \param x1 is the x coordinate of the upper right corner.
|
||||
* \param y1 is the y coordinate of the upper right corner.
|
||||
* \param col0 is the color of the lower left corner.
|
||||
* \param col0 is the color of the lower right corner.
|
||||
* \param col0 is the color of the upper right corner.
|
||||
* \param col0 is the color of the upper left corner.
|
||||
* \param driver is the driver to use to render the quad.
|
||||
* \param viewport is the viewport to use to render the quad.
|
||||
*/
|
||||
static void drawQuad (float x0, float y0, float x1, float y1, CRGBA col0, CRGBA col1, CRGBA col2, CRGBA col3, IDriver& driver, CViewport viewport);
|
||||
/// Draw a Quad in 2D. Warning: this is slow...
|
||||
static void drawQuad (float xcenter, float ycenter, float radius, IDriver& driver, CRGBA col, CViewport viewport);
|
||||
/// Draw a Quad in 2D. Warning: this is slow...
|
||||
static void drawWiredQuad (float x0, float y0, float x1, float y1, IDriver& driver, CRGBA col, CViewport viewport);
|
||||
/// Draw a Quad in 2D. Warning: this is slow...
|
||||
static void drawWiredQuad (float xcenter, float ycenter, float radius, IDriver& driver, CRGBA col, CViewport viewport);
|
||||
|
||||
// @}
|
||||
|
||||
/// \name Easy render (2D or 3D).
|
||||
/** Those render methods work in the current driver viewport/frustum/matrixes.
|
||||
* Since no vertex sharing is performed, their use may be slower than direct use of VBuffer/PBlock etc...
|
||||
* Also, A VBuffer and a PBlock is created, and copies are made from the list of primitives to the driver...
|
||||
*/
|
||||
// @{
|
||||
/// Draw the triangles, with Vertex and 1 UV. "mat" should not be a lighted material since no normal is computed.
|
||||
static void drawTrianglesUnlit(const NLMISC::CTriangleUV *trilist, sint ntris, CMaterial &mat, IDriver& driver);
|
||||
/// Draw the triangles, with Vertex and 1 UV. "mat" should not be a lighted material since no normal is computed.
|
||||
static void drawTrianglesUnlit(const std::vector<NLMISC::CTriangleUV> &trilist, CMaterial &mat, IDriver& driver);
|
||||
|
||||
/// Draw the Lines, with Vertex only. "mat" should not be a lighted material since no normal is computed.
|
||||
static void drawLinesUnlit(const NLMISC::CLine *linelist, sint nlines, CMaterial &mat, IDriver& driver);
|
||||
/// Draw the Lines, with Vertex only. "mat" should not be a lighted material since no normal is computed.
|
||||
static void drawLinesUnlit(const std::vector<NLMISC::CLine> &linelist, CMaterial &mat, IDriver& driver);
|
||||
/// Draw one line in 3D only, with a specific color.
|
||||
static void drawLine(const CVector &a, const CVector &b, CRGBA color, IDriver& driver);
|
||||
/// Draw a wired box in 3D, with a specific color.
|
||||
static void drawWiredBox(const CVector &corner, const CVector &vi, const CVector &vj, const CVector &vk, CRGBA color, IDriver& driver);
|
||||
// @}
|
||||
|
||||
};
|
||||
|
||||
} // NL3D
|
||||
|
||||
|
||||
#endif // NL_DRU_H
|
||||
|
||||
/* End of dru.h */
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue