diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..3fd6967c7 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +; Top-most EditorConfig file +root = true + +; 4-column tab indentation +[*.cpp] +indent_style = tab +indent_size = 4 + +[*.c] +indent_style = tab +indent_size = 4 + +[*.h] +indent_style = tab +indent_size = 4 + +[*.py] +indent_style = tab +indent_size = 4 diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..1d7b8efd4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,266 @@ +syntax: glob + +# Various build directories +bin +obj +Debug +Release +ReleaseDebug +DebugFast +ReleaseDebugStatic +DebugFastStatic + +# Test and application directories +screenshots +release +test +Temp + +# NeL cache +*.packed_sheets + +# Ryzom save +save_shard +last_loaded_char.bin +*.binprim +*.string_cache +graphs_output +default_c + +# Windows compile +*.exe +*.dll +*.lib +*.obj + +# Linux compile +*.a +*.la +*.lo +*.Po +*.Plo +*.o +*.so +*.so.* +*_debug +*.pc +*.gch + +# Mac OS X compile +*.dylib + +# Log dump files +report_refused +report_failed +exception_catched +*.stat +*.log +log.txt + +# Max plugin extensions +*.dlx +*.dlm +*.dlu + +# makeall build +.mode_static + +# cmake build files & directories +CMakeFiles +CMakeCache.txt +cmake_install.cmake +CTestTestfile.cmake +CPackConfig.cmake +CPackSourceConfig.cmake +.libs + +# Linux garbage +Makefile* +aclocal.m4 +config.guess +config.sub +configure +depcomp +config.h.in +nelconfig.h.in +install-sh +ltmain.sh +missing +ylwrap +*.mk + +# Visual Studio garbage +*.opensdf +UpgradeLog*.XML +_UpgradeReport_Files +BuildLog.htm +mt.dep +ipch +*.suo +*.ncb +*.user +*.ilk +*.pdb +*.aps +*.exp +*.idb +*.sdf + +# Mac OS X garbage +.DS_Store + +# Ryzom server garbage +aes_alias_name.cfg +aes_nagios_report.txt +aes_state.txt +*.launch_ctrl +*.state +*.start_count + +# Vim and kwrite cache +*~ + +# Kdevelop4 garbage +*.kdev4 +.kdev4 + +# intellij project folder +.idea/ + +# Python cache +*.pyd +*.pyc + +# Qt compiler +moc_*.cpp +*.moc + +# Misc garbage +*.rej +*.orig +*.cachefile +*.cache +*.patch +*.7z +3rdParty +.svn +thumbs.db +Thumbs.db +*.tpl.php +.SyncID +.SyncIgnore +.SyncArchive + +# build +code/nel/build/* +code/nelns/build/* +code/snowballs/build/* +code/ryzom/build/* +code/build/* +code/build-2010/* +build/* +install/* +build_vc* +code/nel/tools/build_gamedata/configuration/buildsite.py + +# 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 + +# WebTT temp dir +code/ryzom/tools/server/www/webtt/app/tmp + +# AMS ignore +code/web/public_php/ams/is_installed +code/web/docs/ams/html +code/web/public_php/ams/templates_c +code/ryzom/tools/server/ryzom_ams/drupal +code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/autoload +code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/configs +code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/cron +code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/img +code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/plugins +code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/smarty +code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/translations +code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/libinclude.php +code/ryzom/tools/server/ryzom_ams/old + + + +# Tools and external directories +external +external_stlport +nel_tools* +ryzom_tools* + +# Dumps +*.dmp + +code/nel/tools/build_gamedata/processes/ai_wmap/ai_build_wmap.cfg +code/nel/tools/build_gamedata/processes/sheets/sheets_packer.cfg +code/nel/tools/build_gamedata/processes/rbank/build_rbank.cfg +code/nel/tools/build_gamedata/processes/zone/debug_zone_dependencies.cfg +code/web/public_php/config.php +code/web/public_php/is_installed +code/web/public_php/ams/files +code/web/public_php/db_version_lib +code/web/public_php/db_version_shard +code/web/public_php/db_version_tool +code/web/public_php/db_version_web +code/web/public_php/role_service +code/web/public_php/role_support +code/web/public_php/role_domain +code/web/public_php/db_version_ring +code/web/public_php/config_user.php +code/nel/tools/build_gamedata/processes/pz/build_world_packed_col.cfg +code/nel/tools/build_gamedata/processes/cartographer/island_screenshots.cfg diff --git a/.hgeol b/.hgeol index c7a59fec5..a9766f577 100644 --- a/.hgeol +++ b/.hgeol @@ -14,6 +14,8 @@ **.font = native **.scheme = native +**.tpl = native + **.xsd = native **.dox = native diff --git a/.hgignore b/.hgignore index 16e7f1eef..990487a2a 100644 --- a/.hgignore +++ b/.hgignore @@ -124,6 +124,9 @@ aes_state.txt *.kdev4 .kdev4 +# intellij project folder +.idea/ + # Python cache *.pyd *.pyc @@ -139,8 +142,6 @@ moc_*.cpp *.cache *.patch *.7z -external -external_stlport 3rdParty .svn thumbs.db @@ -241,6 +242,9 @@ external_stlport nel_tools* ryzom_tools* +#personal projects +personal/ + #Dumps *.dmp @@ -260,3 +264,5 @@ code/web/public_php/role_support code/web/public_php/role_domain code/web/public_php/db_version_ring code/web/public_php/config_user.php +code/nel/tools/build_gamedata/processes/pz/build_world_packed_col.cfg +code/nel/tools/build_gamedata/processes/cartographer/island_screenshots.cfg diff --git a/.hgtags b/.hgtags index 106c1e722..6a404b346 100644 --- a/.hgtags +++ b/.hgtags @@ -2,3 +2,15 @@ 4eddbaff0c5e5d685db96ee3e8427aa0fd96ac83 ryzomcore/v0.8.0 00d9b6e29e95f56785fbf85abe60afd34674f402 ryzomcore/v0.9.0 79776c337176dd5b02e1a74fe5dfb703b91747aa ryzomcore/v0.9.1 +fedf2aa443d09707beed814b0f499c6a5519cc84 ryzomcore/v0.10.0 +edaa3624a56420b02ccc64c26059801a389927ee ryzomcore/v0.11.0 +e3fe4855f22c3e75722e015dc33c091c340b3ad7 ryzomcore/v0.11.1 +9e583b717fd63be0be9fd60b99087abf1691ea49 ryzomcore/v0.11.2 +bfe5628e14a024ba7ea32e4b326ae433a07856b9 ryzomcore/v0.11.3 +9a6120735daa97c96ac5d85ca35c7f21f607bd87 ryzomcore/v0.12.0 +3e17907af67e8d66d80e6b714707bbf912607f2a ryzom-patch-3.0.0 +153e0b605c9e0c83ba05b6428c62838b49cc84b2 ryzom-patch-3.0.1 +4300cc14aad098b1f86ea4c55577b7fa4a4cb5d2 ryzom-patch-3.1.0 +043aaeb3d8a2a54177581b57bda87a9deaad510e ryzom-patch-3.1.0-april_patch +00dde390a394fce9da06c2f3264140282158d39f 3.3.0 +dcd4c4d161ef775136e18c7e8f5072b75dede27e ryzom-patch-3.3.1 diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..33b3d0f8d --- /dev/null +++ b/.travis.yml @@ -0,0 +1,48 @@ +sudo: false +language: cpp + +compiler: + - gcc + +os: + - linux +matrix: + fast_finish: true +env: + - CMAKE_CONFIGURE_OPTIONS="-DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=ON -DWITH_LUA51=ON -DWITH_RYZOM_SERVER=OFF -DWITH_RYZOM_TOOLS=OFF -DWITH_NEL_TOOLS=OFF" + - CMAKE_CONFIGURE_OPTIONS="-DCPPTEST_LIBRARY_DEBUG:STRING=/usr/lib/libcpptest.so" + CMAKE_BUILD_OPTIONS="--target nel_unit_test -- -j 2" + RUN="build/bin/nel_unit_test" + +addons: + apt: + packages: + - liblua5.1-dev + - libluabind-dev + - libcpptest-dev + - libogg-dev + - libvorbis-dev + - libopenal-dev + - libgif-dev + - libfreetype6-dev + - libxml2-dev + +before_script: + - mkdir build + - cmake --version + - cmake -Hcode -Bbuild $CMAKE_CONFIGURE_OPTIONS + - cat build/CMakeCache.txt + +script: + - cmake --build build $CMAKE_BUILD_OPTIONS + - $RUN + +notifications: + irc: + channels: + - $NOTIFICATION_IRC_CHANNEL + template: + - "%{repository}#%{build_number} (%{branch} - %{commit} : %{author}): %{message}" + - "Description : %{commit_message}" + - "Change view : %{compare_url}" + - "Build details : %{build_url}" diff --git a/README.md b/README.md index 19e5bef3a..c60d1bc0b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ +# Ryzom Core [![Build Status](https://travis-ci.org/ryzom/ryzomcore.svg)](https://travis-ci.org/ryzom/ryzomcore) + Ryzom Core is the open-source project related to Ryzom Game. Written in C++, Ryzom Core contains the whole code (client, server, tools) used to make the commercial MMORPG Ryzom. Ryzom Core is a toolkit for the development of massively multiplayer online universes. It provides the base technologies and a set of development methodologies for the development of both client and server code. - -Ryzom Core is open source and released under the terms of the GNU Affero General Public License 3.0 (GNU/AGPLv3) for the source code and the Creative Commons Attributions-ShareAlike 3.0 (CC-BY-SA) for the art assets. Which means you can create your own game using Ryzom Core, for more information on doing so check out Creating Your Own Game Using Ryzom Core. \ No newline at end of file + +Ryzom Core is open source and released under the terms of the GNU Affero General Public License 3.0 (GNU/AGPLv3) for the source code and the Creative Commons Attributions-ShareAlike 3.0 (CC-BY-SA) for the art assets. Which means you can create your own game using Ryzom Core, for more information on doing so check out Creating Your Own Game Using Ryzom Core. diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..6e0f2b2a7 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,34 @@ +jobs: + - job: ubuntu16 + pool: + vmImage: 'Ubuntu-16.04' + steps: + - script: | + sudo apt-get update + sudo apt-get install -y software-properties-common + sudo add-apt-repository ppa:ubuntu-toolchain-r/test + sudo apt-get update + sudo apt-get install cmake build-essential -y + sudo apt-get install gcc-8 g++-8 -y + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 60 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 60 + sudo apt-get install libmysqlclient-dev -y + sudo apt-get install bison autoconf automake -y + sudo apt-get install libpng12-dev libjpeg62-dev -y + sudo apt-get install liblua5.1-dev libluabind-dev libcpptest-dev -y + sudo apt-get install libogg-dev libvorbis-dev libopenal-dev -y + sudo apt-get install libgif-dev libfreetype6-dev -y + sudo apt-get install libxml2-dev -y + sudo apt-get install libcurl4-openssl-dev -y + displayName: 'Dependencies' + - script: | + mkdir build + cmake --version + cd build + cmake -DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=ON -DWITH_LUA51=ON -DWITH_RYZOM_SERVER=ON -DWITH_RYZOM_TOOLS=OFF -DWITH_NEL_TOOLS=OFF ../code + cat CMakeCache.txt + displayName: 'CMake' + - script: | + cd build + make -j`nproc` + displayName: 'Make' \ No newline at end of file diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index c0552eb54..681f7a959 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -1,8 +1,8 @@ #----------------------------------------------------------------------------- # -# NeL -# Authors: Nevrax and the NeL Community -# Version: 0.9.1 +# Ryzom Core +# Authors: Nevrax and the Ryzom Core Community +# Version: 0.12.0 # # Notes: # * Changing install location: add -DCMAKE_INSTALL_PREFIX:PATH=/my/new/path @@ -28,14 +28,15 @@ IF(COMMAND cmake_policy) # have absolute paths (e.g. -lpthread) cmake_policy(SET CMP0003 NEW) - # Works around warnings about escaped quotes in ADD_DEFINITIONS - # statements - cmake_policy(SET CMP0005 OLD) -ENDIF(COMMAND cmake_policy) + # allow to link to qtmain automatically under Windows + IF(POLICY CMP0020) + CMAKE_POLICY(SET CMP0020 NEW) + ENDIF() +ENDIF() -INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/nel.cmake) -INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/ConfigureChecks.cmake) -INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/CheckDepends.cmake) +INCLUDE(nel) +INCLUDE(ConfigureChecks) +INCLUDE(CheckDepends) INCLUDE(${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL) # Force out of source builds. @@ -44,12 +45,19 @@ CHECK_OUT_OF_SOURCE() # To be able to specify a different deployment target on Mac OS X : # export MACOSX_DEPLOYMENT_TARGET=10.6 +IF(CMAKE_VERSION VERSION_GREATER "2.8.10") + STRING(TIMESTAMP CURRENT_YEAR "%Y") +ELSE() + SET(CURRENT_YEAR "2016") +ENDIF() + CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(RyzomCore CXX C) -SET(NL_VERSION_MAJOR 0) -SET(NL_VERSION_MINOR 9) -SET(NL_VERSION_PATCH 1) -SET(NL_VERSION "${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}.${NL_VERSION_PATCH}") +SET(NL_VERSION_MAJOR 1) +SET(NL_VERSION_MINOR 0) +SET(NL_VERSION_PATCH 0) +SET(YEAR "2004-${CURRENT_YEAR}") +SET(AUTHOR "Winch Gate and The Ryzom Core Community") #----------------------------------------------------------------------------- # Redirect output files @@ -59,19 +67,15 @@ SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) # DLL should be in the same directory as EXE under Windows IF(WIN32) SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) -ELSE(WIN32) +ELSE() SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) -ENDIF(WIN32) +ENDIF() IF(WIN32) IF(WITH_MFC) FIND_PACKAGE(MFC QUIET) - ENDIF(WITH_MFC) - - IF(NOT DEFINED ENV{QTDIR}) - SET(ENV{QTDIR} "c:/qt/4.6.3") - ENDIF(NOT DEFINED ENV{QTDIR}) -ENDIF(WIN32) + ENDIF() +ENDIF() #----------------------------------------------------------------------------- # Set default config options @@ -82,139 +86,242 @@ NL_SETUP_NELNS_DEFAULT_OPTIONS() NL_SETUP_RYZOM_DEFAULT_OPTIONS() NL_SETUP_SNOWBALLS_DEFAULT_OPTIONS() -NL_SETUP_PREFIX_PATHS() -RYZOM_SETUP_PREFIX_PATHS() - -NL_CONFIGURE_CHECKS() - NL_SETUP_BUILD() NL_SETUP_BUILD_FLAGS() +NL_SETUP_PREFIX_PATHS() +RYZOM_SETUP_PREFIX_PATHS() + #----------------------------------------------------------------------------- #Platform specifics SETUP_EXTERNAL() -NL_GEN_REVISION_H() IF(WIN32) SET(WINSOCK2_LIB ws2_32.lib) IF(WITH_MFC) FIND_PACKAGE(CustomMFC REQUIRED) - ENDIF(WITH_MFC) -ENDIF(WIN32) + ENDIF() +ENDIF() +FIND_PACKAGE(ZLIB REQUIRED) FIND_PACKAGE(LibXml2 REQUIRED) FIND_PACKAGE(PNG REQUIRED) +FIND_PACKAGE(OpenSSL REQUIRED) +FIND_PACKAGE(GIF) FIND_PACKAGE(Jpeg) +IF(WIN32) + SET(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} Crypt32.lib) +ENDIF() + +IF(WITH_LIBOVR) + FIND_PACKAGE(LibOVR) +ENDIF() + +IF(WITH_LIBVR) + FIND_PACKAGE(LibVR) +ENDIF() + +NL_CONFIGURE_CHECKS() + IF(WITH_STATIC_LIBXML2) SET(LIBXML2_DEFINITIONS ${LIBXML2_DEFINITIONS} -DLIBXML_STATIC) -ENDIF(WITH_STATIC_LIBXML2) +ENDIF() + +IF(WITH_LIBXML2_ICONV) + FIND_PACKAGE(Iconv REQUIRED) + INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR}) + SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${ICONV_LIBRARIES}) +ENDIF() IF(WITH_STATIC) # libxml2 could need winsock2 library - SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${WINSOCK2_LIB}) - - # on Mac OS X libxml2 requires iconv and liblzma - IF(APPLE) - FIND_PACKAGE(Iconv REQUIRED) - FIND_PACKAGE(LibLZMA REQUIRED) - SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${ICONV_LIBRARIES} ${LIBLZMA_LIBRARIES}) - INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR}) - ENDIF(APPLE) -ENDIF(WITH_STATIC) + IF(WINSOCK2_LIB) + SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${WINSOCK2_LIB}) + ENDIF() + + IF(UNIX) + # under Linux and OS X, recent libxml2 versions are linked against liblzma + FIND_PACKAGE(LibLZMA) + IF(LIBLZMA_LIBRARIES) + SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${LIBLZMA_LIBRARIES}) + ENDIF() + ENDIF() +ENDIF() INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/PCHSupport.cmake) IF(FINAL_VERSION) ADD_DEFINITIONS(-DFINAL_VERSION=1) -ENDIF(FINAL_VERSION) +ENDIF() IF(WITH_SSE2) ADD_DEFINITIONS(-DNL_HAS_SSE2) IF(WITH_SSE3) ADD_DEFINITIONS(-DNL_HAS_SSE3) - ENDIF(WITH_SSE3) -ENDIF(WITH_SSE2) + ENDIF() +ENDIF() + +IF(APPLE) + FIND_LIBRARY(CARBON_FRAMEWORK Carbon) + FIND_LIBRARY(FOUNDATION_FRAMEWORK Foundation) + FIND_LIBRARY(SECURITY_FRAMEWORK Security) + + IF(APPLE_CERTIFICATE) + # Find codesign_allocate + + # Xcode 7.0 and later versions + SET(CODESIGN_ALLOCATE ${OSX_DEVELOPER_ROOT}/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate) + + IF(NOT EXISTS "${CODESIGN_ALLOCATE}") + # Xcode 6.4 and previous versions + SET(CODESIGN_ALLOCATE ${CMAKE_OSX_SYSROOT}/usr/bin/codesign_allocate) + ENDIF() + + IF(NOT EXISTS "${CODESIGN_ALLOCATE}") + # System path + SET(CODESIGN_ALLOCATE /usr/bin/codesign_allocate) + ENDIF() + + IF(NOT EXISTS "${CODESIGN_ALLOCATE}") + MESSAGE(WARNING "Unable to find codesign_allocate in standard directories") + SET(CODESIGN_ALLOCATE) + ENDIF() + ENDIF() +ENDIF() + +INCLUDE(FindHelpers) + +IF(WITH_QT5) + FIND_QT5() +ENDIF() IF(WITH_QT) + SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${QTDIR} $ENV{QTDIR}) + + # Use Qt 4 FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtXml QtOpenGL REQUIRED) -ENDIF(WITH_QT) +ENDIF() + +IF(WITH_ASSIMP) + FIND_PACKAGE(assimp REQUIRED) +ENDIF() IF(WITH_NEL) IF(WITH_NEL_TESTS) FIND_PACKAGE(CppTest) - ENDIF(WITH_NEL_TESTS) + ENDIF() IF(WITH_GUI) - FIND_PACKAGE(Libwww REQUIRED) FIND_PACKAGE(Luabind REQUIRED) FIND_PACKAGE(CURL REQUIRED) - IF(WIN32 OR CURL_LIBRARIES MATCHES "\\.a") + IF((WIN32 OR CURL_LIBRARIES MATCHES "\\.a") AND WITH_STATIC_CURL) SET(CURL_STATIC ON) - ENDIF(WIN32 OR CURL_LIBRARIES MATCHES "\\.a") + ELSE() + SET(CURL_STATIC OFF) + ENDIF() IF(CURL_STATIC) SET(CURL_DEFINITIONS -DCURL_STATICLIB) - FIND_PACKAGE(OpenSSL QUIET) - - IF(OPENSSL_FOUND) - SET(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR}) - SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES}) - ENDIF(OPENSSL_FOUND) + LIST(APPEND CURL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR}) + LIST(APPEND CURL_LIBRARIES ${OPENSSL_LIBRARIES}) - # CURL Macports version depends on libidn, libintl and libiconv too - IF(APPLE) + IF(WIN32) + LIST(APPEND CURL_LIBRARIES Crypt32 Cryptui) + ELSE() + # CURL depends on libidn FIND_LIBRARY(IDN_LIBRARY idn) - FIND_LIBRARY(INTL_LIBRARY intl) - - SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${IDN_LIBRARY} ${INTL_LIBRARY}) - ENDIF(APPLE) - ENDIF(CURL_STATIC) - ENDIF(WITH_GUI) - - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/nel/include ${LIBXML2_INCLUDE_DIR}) - ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) + IF(IDN_LIBRARY) + LIST(APPEND CURL_LIBRARIES ${IDN_LIBRARY}) + ENDIF() + + # CURL Macports version can depend on libidn, libidn2, libintl, libpsl and libiconv too + IF(APPLE) + FIND_LIBRARY(INTL_LIBRARY intl) + IF(INTL_LIBRARY) + LIST(APPEND CURL_LIBRARIES ${INTL_LIBRARY}) + ENDIF() + + FIND_LIBRARY(IDN2_LIBRARY idn2) + IF(IDN2_LIBRARY) + LIST(APPEND CURL_LIBRARIES ${IDN2_LIBRARY}) + ENDIF() + + FIND_LIBRARY(PSL_LIBRARY psl) + IF(PSL_LIBRARY) + LIST(APPEND CURL_LIBRARIES ${PSL_LIBRARY}) + ENDIF() + + FIND_LIBRARY(UNISTRING_LIBRARY unistring) + IF(UNISTRING_LIBRARY) + LIST(APPEND CURL_LIBRARIES ${UNISTRING_LIBRARY}) + ENDIF() + + LIST(APPEND CURL_LIBRARIES ${SECURITY_FRAMEWORK}) + ENDIF() + ENDIF() + ENDIF() + ENDIF() + + INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/nel/include) ADD_SUBDIRECTORY(nel) -ENDIF(WITH_NEL) + + # Aliases for targets + SET(NELMISC_LIBRARIES nelmisc) + SET(NELNET_LIBRARIES nelnet) + SET(NELLIGO_LIBRARIES nelligo) + SET(NELGEORGES_LIBRARIES nelgeorges) + SET(NEL3D_LIBRARIES nel3d) + SET(NELGUI_LIBRARIES nelgui) + SET(NELSOUND_LIBRARIES nelsound) +ELSE() +# FIND_PACKAGE(NeL COMPONENTS 3d misc pacs sound nimp REQUIRED) + FIND_PACKAGE(NeL REQUIRED) + INCLUDE_DIRECTORIES(${NEL_INCLUDE_DIRS}) +ENDIF() IF(WITH_RYZOM) ADD_SUBDIRECTORY(ryzom) -ENDIF(WITH_RYZOM) +ENDIF() IF(WITH_NELNS) ADD_SUBDIRECTORY(nelns) -ENDIF(WITH_NELNS) +ENDIF() IF(WITH_SNOWBALLS) ADD_SUBDIRECTORY(snowballs2) -ENDIF(WITH_SNOWBALLS) +ENDIF() IF(WITH_TOOLS) ADD_SUBDIRECTORY(tool) -ENDIF(WITH_TOOLS) +ENDIF() IF(WITH_STUDIO) ADD_SUBDIRECTORY(studio) -ENDIF(WITH_STUDIO) +ENDIF() + +IF(WITH_PERSONAL) + ADD_SUBDIRECTORY(personal) +ENDIF() # 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) + ELSE() SET(HAVE_DOT NO) - ENDIF(DOT) + ENDIF() # 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) +ENDIF() IF(WITH_NEL_TESTS) ENABLE_TESTING() @@ -224,42 +331,43 @@ IF(WITH_NEL_TESTS) SET(SVNCOMMAND svn) SET(SVNSOURCEDIR http://dev.ryzom.com/svn/trunk/nel) SET(GENERATELOGS svn2cl) - ENDIF(BUILD_DASHBOARD) -ENDIF(WITH_NEL_TESTS) + ENDIF() +ENDIF() # packaging information -SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "NeL MMORPG Framework") -SET(CPACK_PACKAGE_VENDOR "NeL") +SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Ryzom Core MMORPG Framework") +SET(CPACK_PACKAGE_VENDOR "Ryzom Core") 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") +SET(CPACK_PACKAGE_EXECUTABLES "ryzomcore${NL_VERSION}" "ryzomcore") +SET(CPACK_SET_DESTDIR TRUE) # NSIS Specific Packing Setup -SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "NeL") +SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "RyzomCore") 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_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} RyzomCore") 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}") +SET(CPACK_PACKAGE_FILE_NAME "ryzomcore-${NL_VERSION}") +SET(CPACK_SOURCE_PACKAGE_FILE_NAME "ryzomcore-${NL_VERSION}") IF(WIN32) #SET(CPACK_GENERATOR "NSIS") SET(CPACK_GENERATOR "NSIS;ZIP") SET(CPACK_SOURCE_GENERATOR "ZIP") -ELSE(WIN32) +ELSE() SET(CPACK_GENERATOR "TGZ") SET(CPACK_SOURCE_GENERATOR "TGZ") -ENDIF(WIN32) +ENDIF() set(CPACK_SOURCE_IGNORE_FILES "~$" "\\\\.cvsignore$" @@ -277,8 +385,8 @@ IF(WIN32) "${QT_LIBRARY_DIR}/../bin/QtXmld4.dll" "${QT_LIBRARY_DIR}/../bin/QtCored4.dll" DESTINATION ${NL_BIN_PREFIX}) - ENDIF(WITH_QT) - ELSE(NOT CMAKE_BUILD_TYPE STREQUAL "Release") + ENDIF() + ELSE() IF(WITH_QT) INCLUDE(${QT_USE_FILE}) INSTALL(FILES @@ -286,8 +394,8 @@ IF(WIN32) "${QT_LIBRARY_DIR}/../bin/QtXml4.dll" "${QT_LIBRARY_DIR}/../bin/QtCore4.dll" DESTINATION ${NL_BIN_PREFIX}) - ENDIF(WITH_QT) - ENDIF(NOT CMAKE_BUILD_TYPE STREQUAL "Release") + ENDIF() + ENDIF() # Install CEGUI and its dependencies. IF(WITH_NEL_CEGUI) @@ -297,14 +405,14 @@ IF(WIN32) INSTALL(FILES "${CEGUI_LIB_DIR}/CEGUIFalagardWRBase.dll" DESTINATION ${NL_BIN_PREFIX}) INSTALL(FILES "${CEGUI_LIB_DIR}/Devil.dll" DESTINATION ${NL_BIN_PREFIX}) INSTALL(FILES "${CEGUI_LIB_DIR}/ILU.dll" DESTINATION ${NL_BIN_PREFIX}) - ENDIF(WITH_NEL_CEGUI) + ENDIF() # Only the tools require MFC. IF(WITH_TOOLS) SET(CMAKE_INSTALL_MFC_LIBRARIES TRUE) - ENDIF(WITH_TOOLS) + ENDIF() #INCLUDE(InstallRequiredSystemLibraries) -ENDIF(WIN32) +ENDIF() INCLUDE(CPack) @@ -314,4 +422,4 @@ INCLUDE(CMakePackaging.txt) #INCLUDE(UseDebian) #IF(DEBIAN_FOUND) # ADD_DEBIAN_TARGETS(nel) -#ENDIF(DEBIAN_FOUND) +#ENDIF() diff --git a/code/CMakeModules/AndroidToolChain.cmake b/code/CMakeModules/AndroidToolChain.cmake index 049c39adf..4ca702295 100644 --- a/code/CMakeModules/AndroidToolChain.cmake +++ b/code/CMakeModules/AndroidToolChain.cmake @@ -15,135 +15,204 @@ IF(NOT NDK_ROOT) IF(CMAKE_HOST_WIN32) FILE(TO_CMAKE_PATH ${NDK_ROOT} NDK_ROOT) - ENDIF(CMAKE_HOST_WIN32) -ENDIF(NOT NDK_ROOT) + ENDIF() +ENDIF() IF(NOT TARGET_CPU) SET(TARGET_CPU "armv7") -ENDIF(NOT TARGET_CPU) +ENDIF() IF(TARGET_CPU STREQUAL "armv7") SET(LIBRARY_ARCHITECTURE "armeabi-v7a") SET(CMAKE_SYSTEM_PROCESSOR "armv7") SET(TOOLCHAIN_ARCH "arm") - SET(TOOLCHAIN_PREFIX "arm-linux-androideabi") - SET(TOOLCHAIN_BIN_PREFIX "arm") - SET(MINIMUM_NDK_TARGET 4) + SET(GCC_TOOLCHAIN_PREFIX "arm-linux-androideabi") + SET(TOOLCHAIN_BIN_PREFIX "arm-linux-androideabi") + SET(MINIMUM_NDK_TARGET 9) ELSEIF(TARGET_CPU STREQUAL "armv5") SET(LIBRARY_ARCHITECTURE "armeabi") SET(CMAKE_SYSTEM_PROCESSOR "armv5") SET(TOOLCHAIN_ARCH "arm") - SET(TOOLCHAIN_PREFIX "arm-linux-androideabi") - SET(TOOLCHAIN_BIN_PREFIX "arm") - SET(MINIMUM_NDK_TARGET 4) + SET(GCC_TOOLCHAIN_PREFIX "arm-linux-androideabi") + SET(TOOLCHAIN_BIN_PREFIX "arm-linux-androideabi") + SET(MINIMUM_NDK_TARGET 9) +ELSEIF(TARGET_CPU STREQUAL "arm64") + SET(LIBRARY_ARCHITECTURE "arm64-v8a") + SET(CMAKE_SYSTEM_PROCESSOR "arm64") + SET(TOOLCHAIN_ARCH "arm64") + SET(GCC_TOOLCHAIN_PREFIX "aarch64-linux-android") + SET(TOOLCHAIN_BIN_PREFIX "aarch64-linux-android") + SET(MINIMUM_NDK_TARGET 21) ELSEIF(TARGET_CPU STREQUAL "x86") SET(LIBRARY_ARCHITECTURE "x86") SET(CMAKE_SYSTEM_PROCESSOR "x86") SET(TOOLCHAIN_ARCH "x86") - SET(TOOLCHAIN_PREFIX "x86") - SET(TOOLCHAIN_BIN_PREFIX "i686") + SET(GCC_TOOLCHAIN_PREFIX "x86") + SET(TOOLCHAIN_BIN_PREFIX "i686-linux-android") SET(MINIMUM_NDK_TARGET 9) +ELSEIF(TARGET_CPU STREQUAL "x86_64") + SET(LIBRARY_ARCHITECTURE "x86_64") + SET(CMAKE_SYSTEM_PROCESSOR "x86_64") + SET(TOOLCHAIN_ARCH "x86_64") + SET(GCC_TOOLCHAIN_PREFIX "x86_64") + SET(TOOLCHAIN_BIN_PREFIX "x86_64-linux-android") + SET(MINIMUM_NDK_TARGET 21) ELSEIF(TARGET_CPU STREQUAL "mips") SET(LIBRARY_ARCHITECTURE "mips") SET(CMAKE_SYSTEM_PROCESSOR "mips") SET(TOOLCHAIN_ARCH "mips") - SET(TOOLCHAIN_PREFIX "mipsel-linux-android") - SET(TOOLCHAIN_BIN_PREFIX "mipsel") + SET(GCC_TOOLCHAIN_PREFIX "mipsel-linux-android") + SET(TOOLCHAIN_BIN_PREFIX "mipsel-linux-android") SET(MINIMUM_NDK_TARGET 9) -ENDIF(TARGET_CPU STREQUAL "armv7") +ELSEIF(TARGET_CPU STREQUAL "mips64") + SET(LIBRARY_ARCHITECTURE "mips64") + SET(CMAKE_SYSTEM_PROCESSOR "mips64") + SET(TOOLCHAIN_ARCH "mips64") + SET(GCC_TOOLCHAIN_PREFIX "mips64el-linux-android") + SET(TOOLCHAIN_BIN_PREFIX "mips64el-linux-android") + SET(MINIMUM_NDK_TARGET 21) +ELSE() + MESSAGE(FATAL_ERROR "Unable to process TARGET_CPU ${TARGET_CPU}") +ENDIF() + +SET(CLANG_TOOLCHAIN_PREFIX "llvm") +SET(ANDROID_COMPILER "clang") +SET(ANDROID_COMPILER "clang") +SET(CLANG ON) IF(NOT NDK_TARGET) SET(NDK_TARGET ${MINIMUM_NDK_TARGET}) -ENDIF(NOT NDK_TARGET) +ELSE() + IF(NDK_TARGET LESS MINIMUM_NDK_TARGET) + SET(NDK_TARGET ${MINIMUM_NDK_TARGET}) + ENDIF() +ENDIF() -FILE(GLOB _TOOLCHAIN_VERSIONS "${NDK_ROOT}/toolchains/${TOOLCHAIN_PREFIX}-*") +IF(CMAKE_HOST_WIN32) + SET(TOOLCHAIN_HOST "windows-x86_64") + SET(TOOLCHAIN_BIN_SUFFIX ".exe") +ELSEIF(CMAKE_HOST_APPLE) + SET(TOOLCHAIN_HOST "apple") + SET(TOOLCHAIN_BIN_SUFFIX "") +ELSEIF(CMAKE_HOST_UNIX) + SET(TOOLCHAIN_HOST "linux-x86_64") + SET(TOOLCHAIN_BIN_SUFFIX "") +ENDIF() + +# clang +SET(CLANG_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${CLANG_TOOLCHAIN_PREFIX}/prebuilt/${TOOLCHAIN_HOST}") + +IF(EXISTS ${CLANG_TOOLCHAIN_ROOT}) + MESSAGE(STATUS "Found LLVM toolchain in ${CLANG_TOOLCHAIN_ROOT}") +ELSE() + MESSAGE(FATAL_ERROR "No LLVM toolchain found in default search path ${CLANG_TOOLCHAIN_ROOT}") +ENDIF() + +# gcc +SET(GCC_TOOLCHAIN_VERSIONS) +FILE(GLOB _TOOLCHAIN_VERSIONS "${NDK_ROOT}/toolchains/${GCC_TOOLCHAIN_PREFIX}-*") IF(_TOOLCHAIN_VERSIONS) LIST(SORT _TOOLCHAIN_VERSIONS) LIST(REVERSE _TOOLCHAIN_VERSIONS) FOREACH(_TOOLCHAIN_VERSION ${_TOOLCHAIN_VERSIONS}) - STRING(REGEX REPLACE ".+${TOOLCHAIN_PREFIX}-([0-9.]+)" "\\1" _TOOLCHAIN_VERSION "${_TOOLCHAIN_VERSION}") + STRING(REGEX REPLACE ".+${_PREFIX}-([0-9.]+)" "\\1" _TOOLCHAIN_VERSION "${_TOOLCHAIN_VERSION}") IF(_TOOLCHAIN_VERSION MATCHES "^([0-9.]+)$") - LIST(APPEND NDK_TOOLCHAIN_VERSIONS ${_TOOLCHAIN_VERSION}) - ENDIF(_TOOLCHAIN_VERSION MATCHES "^([0-9.]+)$") - ENDFOREACH(_TOOLCHAIN_VERSION) -ENDIF(_TOOLCHAIN_VERSIONS) + LIST(APPEND GCC_TOOLCHAIN_VERSIONS ${_TOOLCHAIN_VERSION}) + ENDIF() + ENDFOREACH() +ENDIF() -IF(NOT NDK_TOOLCHAIN_VERSIONS) - MESSAGE(FATAL_ERROR "No Android toolchain found in default search path ${NDK_ROOT}/toolchains") -ENDIF(NOT NDK_TOOLCHAIN_VERSIONS) +IF(NOT GCC_TOOLCHAIN_VERSIONS) + MESSAGE(FATAL_ERROR "No GCC version found in default search path ${NDK_ROOT}/toolchains") +ENDIF() -IF(NDK_TOOLCHAIN_VERSION) - LIST(FIND NDK_TOOLCHAIN_VERSIONS "${NDK_TOOLCHAIN_VERSION}" _INDEX) +IF(GCC_TOOLCHAIN_VERSIONS) + LIST(FIND GCC_TOOLCHAIN_VERSIONS "${GCC_TOOLCHAIN_VERSION}" _INDEX) IF(_INDEX EQUAL -1) - LIST(GET NDK_TOOLCHAIN_VERSIONS 0 NDK_TOOLCHAIN_VERSION) - ENDIF(_INDEX EQUAL -1) -ELSE(NDK_TOOLCHAIN_VERSION) - LIST(GET NDK_TOOLCHAIN_VERSIONS 0 NDK_TOOLCHAIN_VERSION) -ENDIF(NDK_TOOLCHAIN_VERSION) + LIST(GET GCC_TOOLCHAIN_VERSIONS 0 GCC_TOOLCHAIN_VERSION) + ENDIF() +ELSE() + LIST(GET GCC_TOOLCHAIN_VERSIONS 0 GCC_TOOLCHAIN_VERSION) +ENDIF() -MESSAGE(STATUS "Target Android NDK ${NDK_TARGET} and use GCC ${NDK_TOOLCHAIN_VERSION}") +SET(GCC_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${GCC_TOOLCHAIN_PREFIX}-${GCC_TOOLCHAIN_VERSION}/prebuilt/${TOOLCHAIN_HOST}") -IF(CMAKE_HOST_WIN32) - SET(TOOLCHAIN_HOST "windows") - SET(TOOLCHAIN_BIN_SUFFIX ".exe") -ELSEIF(CMAKE_HOST_APPLE) - SET(TOOLCHAIN_HOST "apple") - SET(TOOLCHAIN_BIN_SUFFIX "") -ELSEIF(CMAKE_HOST_UNIX) - SET(TOOLCHAIN_HOST "linux") - SET(TOOLCHAIN_BIN_SUFFIX "") -ENDIF(CMAKE_HOST_WIN32) +IF(NOT EXISTS "${GCC_TOOLCHAIN_ROOT}") + FILE(GLOB _TOOLCHAIN_PREFIXES "${GCC_TOOLCHAIN_ROOT}*") + IF(_TOOLCHAIN_PREFIXES) + LIST(GET _TOOLCHAIN_PREFIXES 0 GCC_TOOLCHAIN_ROOT) + ENDIF() +ENDIF() -SET(TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${TOOLCHAIN_PREFIX}-${NDK_TOOLCHAIN_VERSION}/prebuilt/${TOOLCHAIN_HOST}") -SET(PLATFORM_ROOT "${NDK_ROOT}/platforms/android-${NDK_TARGET}/arch-${TOOLCHAIN_ARCH}") +IF(EXISTS "${GCC_TOOLCHAIN_ROOT}") + MESSAGE(STATUS "Found GCC toolchain in ${GCC_TOOLCHAIN_ROOT}") +ELSE() + MESSAGE(FATAL_ERROR "No GCC toolchain found in default search path ${GCC_TOOLCHAIN_ROOT}") +ENDIF() -IF(NOT EXISTS "${TOOLCHAIN_ROOT}") - FILE(GLOB _TOOLCHAIN_PREFIXES "${TOOLCHAIN_ROOT}*") - IF(_TOOLCHAIN_PREFIXES) - LIST(GET _TOOLCHAIN_PREFIXES 0 TOOLCHAIN_ROOT) - ENDIF(_TOOLCHAIN_PREFIXES) -ENDIF(NOT EXISTS "${TOOLCHAIN_ROOT}") +# NDK +SET(PLATFORM_ROOT "${NDK_ROOT}/platforms/android-${NDK_TARGET}/arch-${TOOLCHAIN_ARCH}") -MESSAGE(STATUS "Found Android toolchain in ${TOOLCHAIN_ROOT}") -MESSAGE(STATUS "Found Android platform in ${PLATFORM_ROOT}") +MESSAGE(STATUS "Target Android NDK ${NDK_TARGET} found in ${PLATFORM_ROOT}") # include dirs SET(PLATFORM_INCLUDE_DIR "${PLATFORM_ROOT}/usr/include") SET(STL_DIR "${NDK_ROOT}/sources/cxx-stl/gnu-libstdc++") -IF(EXISTS "${STL_DIR}/${NDK_TOOLCHAIN_VERSION}") +IF(EXISTS "${STL_DIR}/${GCC_TOOLCHAIN_VERSION}") # NDK version >= 8b - SET(STL_DIR "${STL_DIR}/${NDK_TOOLCHAIN_VERSION}") -ENDIF(EXISTS "${STL_DIR}/${NDK_TOOLCHAIN_VERSION}") - -# Determine bin prefix for toolchain -FILE(GLOB _TOOLCHAIN_BIN_PREFIXES "${TOOLCHAIN_ROOT}/bin/${TOOLCHAIN_BIN_PREFIX}-*-gcc${TOOLCHAIN_BIN_SUFFIX}") -IF(_TOOLCHAIN_BIN_PREFIXES) - LIST(GET _TOOLCHAIN_BIN_PREFIXES 0 _TOOLCHAIN_BIN_PREFIX) - STRING(REGEX REPLACE "${TOOLCHAIN_ROOT}/bin/([a-z0-9-]+)-gcc${TOOLCHAIN_BIN_SUFFIX}" "\\1" TOOLCHAIN_BIN_PREFIX "${_TOOLCHAIN_BIN_PREFIX}") -ENDIF(_TOOLCHAIN_BIN_PREFIXES) + SET(STL_DIR "${STL_DIR}/${GCC_TOOLCHAIN_VERSION}") +ENDIF() SET(STL_INCLUDE_DIR "${STL_DIR}/include") SET(STL_LIBRARY_DIR "${STL_DIR}/libs/${LIBRARY_ARCHITECTURE}") SET(STL_INCLUDE_CPU_DIR "${STL_LIBRARY_DIR}/include") SET(STL_LIBRARY "${STL_LIBRARY_DIR}/libgnustl_static.a") -SET(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_ROOT} ${PLATFORM_ROOT}/usr ${CMAKE_PREFIX_PATH} ${CMAKE_INSTALL_PREFIX} $ENV{EXTERNAL_ANDROID_PATH} CACHE string "Android find search path root") +MESSAGE(STATUS "STL include dir: ${STL_INCLUDE_DIR}") +MESSAGE(STATUS "STL library dir: ${STL_LIBRARY_DIR}") + +SET(CMAKE_FIND_ROOT_PATH ${CLANG_TOOLCHAIN_ROOT} ${GCC_TOOLCHAIN_ROOT} ${PLATFORM_ROOT}/usr ${CMAKE_PREFIX_PATH} ${CMAKE_INSTALL_PREFIX} $ENV{EXTERNAL_ANDROID_PATH} CACHE string "Android find search path root") SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -INCLUDE_DIRECTORIES(${STL_INCLUDE_DIR} ${STL_INCLUDE_CPU_DIR}) +MACRO(SET_TOOLCHAIN_BINARY_LLVM _NAME _BINARY) + SET(${_NAME} ${CLANG_TOOLCHAIN_ROOT}/bin/${_BINARY}${TOOLCHAIN_BIN_SUFFIX} CACHE PATH "" FORCE) +ENDMACRO() + +MACRO(SET_TOOLCHAIN_BINARY_GCC _NAME _BINARY) + SET(${_NAME} ${GCC_TOOLCHAIN_ROOT}/bin/${TOOLCHAIN_BIN_PREFIX}-${_BINARY}${TOOLCHAIN_BIN_SUFFIX} CACHE PATH "" FORCE) +ENDMACRO() + +SET(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) + +SET_TOOLCHAIN_BINARY_LLVM(CMAKE_C_COMPILER clang) +SET_TOOLCHAIN_BINARY_LLVM(CMAKE_CXX_COMPILER clang++) -MACRO(SET_TOOLCHAIN_BINARY _NAME _BINARY) - SET(${_NAME} ${TOOLCHAIN_ROOT}/bin/${TOOLCHAIN_BIN_PREFIX}-${_BINARY}${TOOLCHAIN_BIN_SUFFIX}) -ENDMACRO(SET_TOOLCHAIN_BINARY) +SET(CMAKE_C_COMPILER ${CMAKE_C_COMPILER}) +SET(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN_BIN_PREFIX}) +SET(CMAKE_C_COMPILER_FORCED TRUE) -SET_TOOLCHAIN_BINARY(CMAKE_C_COMPILER gcc) -SET_TOOLCHAIN_BINARY(CMAKE_CXX_COMPILER g++) +SET(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER}) +SET(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN_BIN_PREFIX}) +SET(CMAKE_CXX_COMPILER_FORCED TRUE) + +SET_TOOLCHAIN_BINARY_LLVM(CMAKE_ASM_COMPILER llvm-as) +SET_TOOLCHAIN_BINARY_LLVM(CMAKE_AR llvm-ar) +SET_TOOLCHAIN_BINARY_LLVM(CMAKE_LINKER clang++) + +IF(NOT EXISTS "${CMAKE_ASM_COMPILER}") + SET_TOOLCHAIN_BINARY_GCC(CMAKE_ASM_COMPILER as) +ENDIF() + +IF(NOT EXISTS "${CMAKE_AR}") + SET_TOOLCHAIN_BINARY_GCC(CMAKE_AR ar) +ENDIF() -# Force the compilers to GCC for Android -include (CMakeForceCompiler) -CMAKE_FORCE_C_COMPILER(${CMAKE_C_COMPILER} GNU) -CMAKE_FORCE_CXX_COMPILER(${CMAKE_CXX_COMPILER} GNU) +SET_TOOLCHAIN_BINARY_GCC(CMAKE_STRIP strip) +SET_TOOLCHAIN_BINARY_GCC(CMAKE_NM nm) +SET_TOOLCHAIN_BINARY_GCC(CMAKE_OBJCOPY objcopy) +SET_TOOLCHAIN_BINARY_GCC(CMAKE_OBJDUMP objdump) +SET_TOOLCHAIN_BINARY_GCC(CMAKE_RANLIB ranlib) diff --git a/code/CMakeModules/CheckDepends.cmake b/code/CMakeModules/CheckDepends.cmake index d2fbe06e1..701dcd48b 100644 --- a/code/CMakeModules/CheckDepends.cmake +++ b/code/CMakeModules/CheckDepends.cmake @@ -24,8 +24,8 @@ MACRO(CHECK_UNDEFINED_SYMBOL MYLIBRARY SYMBOL SYMBOL_FOUND) IF(NOT NM_SYMBOL MATCHES ${SYMBOL}) SET(${SYMBOL_FOUND} FALSE) # MESSAGE(STATUS "Defined symbol ${SYMBOL} detected in ${${MYLIBRARY}}") - ENDIF(NOT NM_SYMBOL MATCHES ${SYMBOL}) - ENDIF(CMAKE_NM) + ENDIF() + ENDIF() ELSEIF(UNIX) SET(CMAKE_OBJDUMP objdump) IF(CMAKE_OBJDUMP) @@ -35,11 +35,11 @@ MACRO(CHECK_UNDEFINED_SYMBOL MYLIBRARY SYMBOL SYMBOL_FOUND) IF(NOT OBJDUMP_SYMBOL MATCHES "UND") #MESSAGE(STATUS "${${MYLIBRARY}} does not use symbol ${SYMBOL}") SET(${SYMBOL_FOUND} FALSE) - ELSE(NOT OBJDUMP_SYMBOL MATCHES "UND") + ELSE() #MESSAGE(STATUS "${${MYLIBRARY}} uses symbol ${SYMBOL}") - ENDIF(NOT OBJDUMP_SYMBOL MATCHES "UND") - ENDIF(CMAKE_OBJDUMP) - ENDIF(WIN32) + ENDIF() + ENDIF() + ENDIF() ENDMACRO(CHECK_UNDEFINED_SYMBOL) # CHECK_LINKED_LIBRARY @@ -66,8 +66,8 @@ MACRO(CHECK_LINKED_LIBRARY MYLIBRARY OTHERLIBRARY LIBRARY_FOUND) IF(OTOOL_LIBRARY MATCHES "${LIBNAME}") SET(${LIBRARY_FOUND} TRUE) # MESSAGE(STATUS "Library ${LIBNAME} already linked to ${${MYLIBRARY}}") - ENDIF(OTOOL_LIBRARY MATCHES "${LIBNAME}") - ENDIF(CMAKE_OTOOL) + ENDIF() + ENDIF() ELSEIF(UNIX) SET(CMAKE_OBJDUMP objdump) IF(CMAKE_OBJDUMP) @@ -79,11 +79,11 @@ MACRO(CHECK_LINKED_LIBRARY MYLIBRARY OTHERLIBRARY LIBRARY_FOUND) IF(OBJDUMP_LIBRARY MATCHES "NEEDED") #MESSAGE(STATUS "${${MYLIBRARY}} references to ${LIBNAME}.") SET(${LIBRARY_FOUND} TRUE) - ELSE(OBJDUMP_LIBRARY MATCHES "NEEDED") + ELSE() #MESSAGE(STATUS "${${MYLIBRARY}} does not reference to ${LIBNAME}!") - ENDIF(OBJDUMP_LIBRARY MATCHES "NEEDED") - ENDIF(CMAKE_OBJDUMP) - ENDIF(WIN32) + ENDIF() + ENDIF() + ENDIF() ENDMACRO(CHECK_LINKED_LIBRARY) MACRO(CHECK_DEPENDS MYLIBRARY OTHERLIBRARY SYMBOL MUSTLINK) @@ -91,13 +91,13 @@ MACRO(CHECK_DEPENDS MYLIBRARY OTHERLIBRARY SYMBOL MUSTLINK) IF(SYMBOL_FOUND) CHECK_LINKED_LIBRARY(MYLIBRARY OTHERLIBRARY LIBRARY_FOUND) - ENDIF(SYMBOL_FOUND) + ENDIF() IF(SYMBOL_FOUND AND NOT LIBRARY_FOUND) SET(${MUSTLINK} YES) - ELSE(SYMBOL_FOUND AND NOT LIBRARY_FOUND) + ELSE() SET(${MUSTLINK} NO) - ENDIF(SYMBOL_FOUND AND NOT LIBRARY_FOUND) + ENDIF() ENDMACRO(CHECK_DEPENDS) # LINK_DEPENDS @@ -116,23 +116,23 @@ MACRO(LINK_DEPENDS LIBRARIES MYLIBRARY OTHERLIBRARY SYMBOL) IF(WIN32 OR WITH_STATIC) # In static, we link all libraries because it will keep only used symbols SET(MUST_LINK TRUE) - ELSE(WIN32 OR WITH_STATIC) + ELSE() CHECK_UNDEFINED_SYMBOL(${MYLIBRARY} ${SYMBOL} SYMBOL_FOUND) IF(SYMBOL_FOUND) CHECK_LINKED_LIBRARY(${MYLIBRARY} ${OTHERLIBRARY} LIBRARY_FOUND) - ENDIF(SYMBOL_FOUND) + ENDIF() IF(SYMBOL_FOUND AND NOT LIBRARY_FOUND) MESSAGE(STATUS "Underlinking found: ${${MYLIBRARY}} needs ${${OTHERLIBRARY}} but is not linked to, manually linking...") SET(MUST_LINK TRUE) - ENDIF(SYMBOL_FOUND AND NOT LIBRARY_FOUND) - ENDIF(WIN32 OR WITH_STATIC) - ENDIF(${MYLIBRARY} AND ${OTHERLIBRARY} AND NOT ${OTHERLIBRARY}_LINKED) + ENDIF() + ENDIF() + ENDIF() IF(MUST_LINK) MESSAGE(STATUS "Linking with ${${OTHERLIBRARY}}") SET(${LIBRARIES} ${${LIBRARIES}} ${${OTHERLIBRARY}}) SET(${OTHERLIBRARY}_LINKED TRUE) - ENDIF(MUST_LINK) + ENDIF() ENDMACRO(LINK_DEPENDS) diff --git a/code/CMakeModules/ConfigureChecks.cmake b/code/CMakeModules/ConfigureChecks.cmake index baf6e0e7c..1eade142c 100644 --- a/code/CMakeModules/ConfigureChecks.cmake +++ b/code/CMakeModules/ConfigureChecks.cmake @@ -1,79 +1,57 @@ MACRO(NL_CONFIGURE_CHECKS) - INCLUDE(CheckIncludeFiles) - INCLUDE(CheckFunctionExists) - INCLUDE(CheckLibraryExists) - INCLUDE(CheckTypeSize) - - CHECK_INCLUDE_FILES ("execinfo.h" HAVE_EXECINFO_H) - CHECK_INCLUDE_FILES ("stdint.h" HAVE_STDINT_H) - CHECK_INCLUDE_FILES ("sys/types.h" HAVE_SYS_TYPES_H) - CHECK_INCLUDE_FILES ("inttypes.h" HAVE_INTTYPES_H) - CHECK_INCLUDE_FILES ("unistd.h" HAVE_UNISTD_H) - CHECK_INCLUDE_FILES ("utime.h" HAVE_UTIME_H) - - CHECK_INCLUDE_FILES ("dl.h" HAVE_DL_H) - CHECK_INCLUDE_FILES ("limits.h" HAVE_LIMITS_H) - CHECK_INCLUDE_FILES ("malloc.h" HAVE_MALLOC_H) - CHECK_INCLUDE_FILES ("sys/param.h" HAVE_SYS_PARAM_H) - CHECK_INCLUDE_FILES ("sys/param.h;sys/mount.h" HAVE_SYS_MOUNT_H) - CHECK_INCLUDE_FILES ("sys/statvfs.h" HAVE_SYS_STATVFS_H) - - CHECK_INCLUDE_FILES ("pthread.h" HAVE_PTHREAD) - - CHECK_TYPE_SIZE("size_t" SIZEOF_SIZE_T) - #if (NOT HAVE_SIZEOF_SIZE_T) - # MESSAGE(FATAL_ERROR "size_t is not present on this architecture - aborting") - #endif (NOT HAVE_SIZEOF_SIZE_T) - MESSAGE(STATUS "DEBUG size_t is ${SIZEOF_SIZE_T}") - - CHECK_TYPE_SIZE("off_t" SIZEOF_OFF_T) - MESSAGE(STATUS "DEBUG off_t is ${SIZEOF_OFF_T}") - - CHECK_FUNCTION_EXISTS("backtrace" HAVE_BACKTRACE) - CHECK_FUNCTION_EXISTS("getsockname" HAVE_GETSOCKNAME) - CHECK_FUNCTION_EXISTS("inet_ntoa" HAVE_INET_NTOA) - CHECK_FUNCTION_EXISTS("inet_ntop" HAVE_INET_NTOP) - CHECK_FUNCTION_EXISTS("inet_pton" HAVE_INET_PTON) - CHECK_FUNCTION_EXISTS("regcomp" HAVE_REGCOMP) - CHECK_FUNCTION_EXISTS("strerror" HAVE_STRERROR) - CHECK_FUNCTION_EXISTS("strlcat" HAVE_STRLCAT) - CHECK_FUNCTION_EXISTS("strptime" HAVE_STRPTIME) - CHECK_FUNCTION_EXISTS("strtok_r" HAVE_STRTOK_R) - CHECK_FUNCTION_EXISTS("strtoull" HAVE_STRTOULL) - CHECK_FUNCTION_EXISTS("statvfs" HAVE_STATVFS) - CHECK_FUNCTION_EXISTS("stat64" HAVE_STAT64) + INCLUDE(GetRevision) # 3D drivers IF(WITH_DRIVER_OPENGL) SET(NL_OPENGL_AVAILABLE 1) - ENDIF(WITH_DRIVER_OPENGL) + ENDIF() IF(WITH_DRIVER_OPENGLES) SET(NL_OPENGLES_AVAILABLE 1) - ENDIF(WITH_DRIVER_OPENGLES) - + ENDIF() + IF(WITH_DRIVER_DIRECT3D) SET(NL_DIRECT3D_AVAILABLE 1) - ENDIF(WITH_DRIVER_DIRECT3D) + ENDIF() # sound drivers IF(WITH_DRIVER_FMOD) SET(NL_FMOD_AVAILABLE 1) - ENDIF(WITH_DRIVER_FMOD) + ENDIF() IF(WITH_DRIVER_OPENAL) SET(NL_OPENAL_AVAILABLE 1) - ENDIF(WITH_DRIVER_OPENAL) + ENDIF() IF(WITH_DRIVER_DSOUND) SET(NL_DSOUND_AVAILABLE 1) - ENDIF(WITH_DRIVER_DSOUND) + ENDIF() IF(WITH_DRIVER_XAUDIO2) SET(NL_XAUDIO2_AVAILABLE 1) - ENDIF(WITH_DRIVER_XAUDIO2) + ENDIF() + + IF(NOT RYZOM_VERSION_MAJOR) + SET(RYZOM_VERSION_MAJOR ${NL_VERSION_MAJOR}) + SET(RYZOM_VERSION_MINOR ${NL_VERSION_MINOR}) + SET(RYZOM_VERSION_PATCH ${NL_VERSION_PATCH}) + ENDIF() + + SET(NL_VERSION "${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}.${NL_VERSION_PATCH}.${REVISION}") + SET(NL_VERSION_RC "${NL_VERSION_MAJOR},${NL_VERSION_MINOR},${NL_VERSION_PATCH},${REVISION}") + + SET(RYZOM_VERSION_SHORT "${RYZOM_VERSION_MAJOR}.${RYZOM_VERSION_MINOR}.${RYZOM_VERSION_PATCH}") + SET(RYZOM_VERSION "${RYZOM_VERSION_SHORT}.${REVISION}") + SET(RYZOM_VERSION_RC "${RYZOM_VERSION_MAJOR},${RYZOM_VERSION_MINOR},${RYZOM_VERSION_PATCH},${REVISION}") + NOW(BUILD_DATE) + + SET(COPYRIGHT "${YEAR} ${AUTHOR}") + + IF(NOT RYZOM_CLIENT_ICON) + SET(RYZOM_CLIENT_ICON "ryzom_client") + ENDIF() - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) + CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h) + INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}) ADD_DEFINITIONS(-DHAVE_CONFIG_H) -ENDMACRO(NL_CONFIGURE_CHECKS) +ENDMACRO() diff --git a/code/CMakeModules/Find3dsMaxSDK.cmake b/code/CMakeModules/Find3dsMaxSDK.cmake index 0510d3a6e..cf49a90d3 100644 --- a/code/CMakeModules/Find3dsMaxSDK.cmake +++ b/code/CMakeModules/Find3dsMaxSDK.cmake @@ -9,7 +9,7 @@ if(MAXSDK_INCLUDE_DIR) # Already in cache, be silent SET(MAXSDK_FIND_QUIETLY TRUE) -endif(MAXSDK_INCLUDE_DIR) +endif() FIND_PATH(MAXSDK_DIR "include/maxversion.h" @@ -18,6 +18,7 @@ FIND_PATH(MAXSDK_DIR PATHS "$ENV{ADSK_3DSMAX_SDK_2012}/maxsdk" "$ENV{3DSMAX_2011_SDK_PATH}/maxsdk" + "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2017 SDK/maxsdk" "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2010 SDK/maxsdk" "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2009 SDK/maxsdk" "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2008 SDK/maxsdk" @@ -36,18 +37,18 @@ FIND_PATH(MAXSDK_CS_INCLUDE_DIR bipexp.h ) IF(TARGET_X64) - SET(MAXSDK_LIBRARY_DIRS ${MAXSDK_DIR}/x64/lib) -ELSE(TARGET_X64) + SET(MAXSDK_LIBRARY_DIRS ${MAXSDK_DIR}/x64/lib ${MAXSDK_DIR}/lib/x64/Release) +ELSE() SET(MAXSDK_LIBRARY_DIRS ${MAXSDK_DIR}/lib) -ENDIF(TARGET_X64) +ENDIF() -MACRO(FIND_3DS_LIBRARY MYLIBRARY MYLIBRARYNAME) +MACRO(FIND_3DS_LIBRARY MYLIBRARY MYLIBRARYNAME) FIND_LIBRARY(${MYLIBRARY} NAMES ${MYLIBRARYNAME} HINTS ${MAXSDK_LIBRARY_DIRS} ) -ENDMACRO(FIND_3DS_LIBRARY MYLIBRARY MYLIBRARYNAME) +ENDMACRO() FIND_3DS_LIBRARY(MAXSDK_CORE_LIBRARY core) FIND_3DS_LIBRARY(MAXSDK_GEOM_LIBRARY geom) @@ -73,10 +74,28 @@ if(MAXSDK_FOUND) ${MAXSDK_MAXUTIL_LIBRARY} ${MAXSDK_MAXSCRIPT_LIBRARY} ${MAXSDK_PARAMBLK2_LIBRARY} - ${MAXSDK_BMM_LIBRARY} ) + ${MAXSDK_BMM_LIBRARY}) -else(MAXSDK_FOUND) + # parse maxversion.h to determine SDK version + IF(EXISTS "${MAXSDK_DIR}/include/maxversion.h") + FILE(STRINGS "${MAXSDK_DIR}/include/maxversion.h" LINES REGEX "#define MAX_PRODUCT_YEAR_NUMBER ([0-9]+)") + + STRING(REGEX REPLACE ".+MAX_PRODUCT_YEAR_NUMBER ([0-9]+)" "\\1" MAXSDK_VERSION "${LINES}") + UNSET(LINES) + ELSE() + SET(MAXSDK_VERSION "Unknown") + ENDIF() + + MESSAGE(STATUS "Found 3dsmax version ${MAXSDK_VERSION} in ${MAXSDK_DIR}") + + # 3ds Max 2013 and later are always Unicode + IF(MAXSDK_VERSION VERSION_GREATER 2012) + SET(MAXSDK_DEFINITIONS -DUNICODE -D_UNICODE) + ELSE() + SET(MAXSDK_DEFINITIONS) + ENDIF() +ELSE() set(MAXSDK_LIBRARIES) -endif(MAXSDK_FOUND) +ENDIF() mark_as_advanced(MAXSDK_INCLUDE_DIR MAXSDK_LIBRARY) diff --git a/code/CMakeModules/FindCEGUI.cmake b/code/CMakeModules/FindCEGUI.cmake index a939ebfb7..3259574fc 100644 --- a/code/CMakeModules/FindCEGUI.cmake +++ b/code/CMakeModules/FindCEGUI.cmake @@ -7,7 +7,7 @@ IF(CEGUI_LIBRARY AND CEGUI_INCLUDE_DIRS) # in cache already SET(CEGUI_FIND_QUIETLY TRUE) -ENDIF(CEGUI_LIBRARY AND CEGUI_INCLUDE_DIRS) +ENDIF() FIND_PATH(CEGUI_INCLUDE_DIRS @@ -45,9 +45,9 @@ IF(CEGUI_LIBRARY AND CEGUI_INCLUDE_DIRS) 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) + ENDIF() +ELSE() IF(NOT CEGUI_FIND_QUIETLY) MESSAGE(STATUS "Warning: Unable to find CEGUI!") - ENDIF(NOT CEGUI_FIND_QUIETLY) -ENDIF(CEGUI_LIBRARY AND CEGUI_INCLUDE_DIRS) + ENDIF() +ENDIF() diff --git a/code/CMakeModules/FindCppTest.cmake b/code/CMakeModules/FindCppTest.cmake index f5f823f69..7dc2aa35d 100644 --- a/code/CMakeModules/FindCppTest.cmake +++ b/code/CMakeModules/FindCppTest.cmake @@ -10,7 +10,7 @@ IF(CPPTEST_LIBRARIES AND CPPTEST_INCLUDE_DIR) # in cache already SET(CPPTEST_FIND_QUIETLY TRUE) -ENDIF(CPPTEST_LIBRARIES AND CPPTEST_INCLUDE_DIR) +ENDIF() FIND_PATH(CPPTEST_INCLUDE_DIR cpptest.h @@ -30,7 +30,7 @@ SET(LIBRARY_NAME_DEBUG cpptestd) IF(WITH_STLPORT) SET(LIBRARY_NAME_RELEASE cpptest_stlport ${LIBRARY_NAME_RELEASE}) SET(LIBRARY_NAME_DEBUG cpptest_stlportd ${LIBRARY_NAME_DEBUG}) -ENDIF(WITH_STLPORT) +ENDIF() FIND_LIBRARY(CPPTEST_LIBRARY_RELEASE ${LIBRARY_NAME_RELEASE} @@ -67,18 +67,18 @@ IF(CPPTEST_INCLUDE_DIR) SET(CPPTEST_LIBRARIES "optimized;${CPPTEST_LIBRARY_RELEASE}") IF(CPPTEST_LIBRARY_DEBUG) SET(CPPTEST_LIBRARIES "${CPPTEST_LIBRARIES};debug;${CPPTEST_LIBRARY_DEBUG}") - ENDIF(CPPTEST_LIBRARY_DEBUG) - ENDIF(CPPTEST_LIBRARY_RELEASE) -ENDIF(CPPTEST_INCLUDE_DIR) + ENDIF() + ENDIF() +ENDIF() IF(CPPTEST_FOUND) IF(NOT CPPTEST_FIND_QUIETLY) MESSAGE(STATUS "Found CppTest: ${CPPTEST_LIBRARIES}") - ENDIF(NOT CPPTEST_FIND_QUIETLY) -ELSE(CPPTEST_FOUND) + ENDIF() +ELSE() IF(NOT CPPTEST_FIND_QUIETLY) MESSAGE(STATUS "Warning: Unable to find CppTest!") - ENDIF(NOT CPPTEST_FIND_QUIETLY) -ENDIF(CPPTEST_FOUND) + ENDIF() +ENDIF() MARK_AS_ADVANCED(CPPTEST_LIBRARY_RELEASE CPPTEST_LIBRARY_DEBUG) diff --git a/code/CMakeModules/FindCustomMFC.cmake b/code/CMakeModules/FindCustomMFC.cmake index 621bf49ae..b71e4a8d8 100644 --- a/code/CMakeModules/FindCustomMFC.cmake +++ b/code/CMakeModules/FindCustomMFC.cmake @@ -6,20 +6,20 @@ IF(CustomMFC_FIND_REQUIRED) SET(MFC_FIND_REQUIRED TRUE) -ENDIF(CustomMFC_FIND_REQUIRED) +ENDIF() IF(NOT MFC_DIR) # If MFC have been found, remember their directory IF(VC_DIR) SET(MFC_STANDARD_DIR "${VC_DIR}/atlmfc") - ENDIF(VC_DIR) + ENDIF() FIND_PATH(MFC_DIR include/afxwin.h HINTS ${MFC_STANDARD_DIR} ) -ENDIF(NOT MFC_DIR) +ENDIF() # Display an error message if MFC are not found, MFC_FOUND is updated # User will be able to update MFC_DIR to the correct directory @@ -33,18 +33,18 @@ IF(MFC_FOUND) # Using 32 or 64 bits libraries IF(TARGET_X64) SET(MFC_LIBRARY_DIR "${MFC_DIR}/lib/amd64") - ELSE(TARGET_X64) + ELSE() SET(MFC_LIBRARY_DIR "${MFC_DIR}/lib") - ENDIF(TARGET_X64) + ENDIF() # Add MFC libraries directory to default library path LINK_DIRECTORIES(${MFC_LIBRARY_DIR}) # Set definitions for using MFC in DLL - SET(MFC_DEFINITIONS -D_AFXDLL) + SET(MFC_DEFINITIONS -D_AFXDLL -DUNICODE -D_UNICODE) # Set CMake flag to use MFC DLL SET(CMAKE_MFC_FLAG 2) -ENDIF(MFC_FOUND) +ENDIF() # TODO: create a macro which set MFC_DEFINITIONS, MFC_LIBRARY_DIR and MFC_INCLUDE_DIR for a project diff --git a/code/CMakeModules/FindDSound.cmake b/code/CMakeModules/FindDSound.cmake index beddf7f99..dde5212ab 100644 --- a/code/CMakeModules/FindDSound.cmake +++ b/code/CMakeModules/FindDSound.cmake @@ -8,7 +8,7 @@ if(DSOUND_INCLUDE_DIR) # Already in cache, be silent set(DSOUND_FIND_QUIETLY TRUE) -endif(DSOUND_INCLUDE_DIR) +ENDIF() find_path(DSOUND_INCLUDE_DIR dsound.h "$ENV{DXSDK_DIR}" @@ -29,8 +29,8 @@ find_package_handle_standard_args(DSOUND DEFAULT_MSG if(DSOUND_FOUND) set(DSOUND_LIBRARIES ${DSOUND_LIBRARY}) -else(DSOUND_FOUND) +ELSE() set(DSOUND_LIBRARIES) -endif(DSOUND_FOUND) +ENDIF() mark_as_advanced(DSOUND_INCLUDE_DIR DSOUND_LIBRARY) diff --git a/code/CMakeModules/FindDirectXSDK.cmake b/code/CMakeModules/FindDirectXSDK.cmake index 3cf91ec3c..4519ef16d 100644 --- a/code/CMakeModules/FindDirectXSDK.cmake +++ b/code/CMakeModules/FindDirectXSDK.cmake @@ -8,7 +8,7 @@ IF(DXSDK_DIR) # Already in cache, be silent SET(DXSDK_FIND_QUIETLY TRUE) -ENDIF(DXSDK_DIR) +ENDIF() FIND_PATH(DXSDK_DIR "Include/dxsdkver.h" @@ -30,16 +30,16 @@ MACRO(FIND_DXSDK_LIBRARY MYLIBRARY MYLIBRARYNAME) HINTS "${DXSDK_LIBRARY_DIR}" ) -ENDMACRO(FIND_DXSDK_LIBRARY MYLIBRARY MYLIBRARYNAME) +ENDMACRO() IF(DXSDK_DIR) SET(DXSDK_INCLUDE_DIR "${DXSDK_DIR}/Include") IF(TARGET_X64) SET(DXSDK_LIBRARY_DIRS ${DXSDK_DIR}/Lib/x64 ${DXSDK_DIR}/lib/amd64) - ELSE(TARGET_X64) + ELSE() SET(DXSDK_LIBRARY_DIRS ${DXSDK_DIR}/Lib/x86 ${DXSDK_DIR}/lib) - ENDIF(TARGET_X64) + ENDIF() FIND_PATH(DXSDK_LIBRARY_DIR dxguid.lib @@ -52,13 +52,7 @@ IF(DXSDK_DIR) FIND_DXSDK_LIBRARY(DXSDK_XAUDIO_LIBRARY x3daudio) FIND_DXSDK_LIBRARY(DXSDK_D3DX9_LIBRARY d3dx9) FIND_DXSDK_LIBRARY(DXSDK_D3D9_LIBRARY d3d9) - - #FIND_DXSDK_LIBRARY(DXSDK_MESH_LIBRARY mesh) - #FIND_DXSDK_LIBRARY(DXSDK_MAXUTIL_LIBRARY maxutil) - #FIND_DXSDK_LIBRARY(DXSDK_MAXSCRIPT_LIBRARY maxscrpt) - #FIND_DXSDK_LIBRARY(DXSDK_PARAMBLK2_LIBRARY paramblk2) - #FIND_DXSDK_LIBRARY(DXSDK_BMM_LIBRARY bmm) -ENDIF(DXSDK_DIR) +ENDIF() # Handle the QUIETLY and REQUIRED arguments and set DXSDK_FOUND to TRUE if # all listed variables are TRUE. diff --git a/code/CMakeModules/FindEFXUtil.cmake b/code/CMakeModules/FindEFXUtil.cmake index 5e2f410b0..628a0eba5 100644 --- a/code/CMakeModules/FindEFXUtil.cmake +++ b/code/CMakeModules/FindEFXUtil.cmake @@ -7,7 +7,7 @@ IF(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR) # in cache already SET(EFXUTIL_FIND_QUIETLY TRUE) -ENDIF(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR) +ENDIF() FIND_PATH(EFXUTIL_INCLUDE_DIR @@ -42,9 +42,9 @@ IF(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR) SET(EFXUTIL_FOUND "YES") IF(NOT EFXUTIL_FIND_QUIETLY) MESSAGE(STATUS "Found EFX-Util: ${EFXUTIL_LIBRARY}") - ENDIF(NOT EFXUTIL_FIND_QUIETLY) -ELSE(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR) + ENDIF() +ELSE() IF(NOT EFXUTIL_FIND_QUIETLY) MESSAGE(STATUS "Warning: Unable to find EFX-Util!") - ENDIF(NOT EFXUTIL_FIND_QUIETLY) -ENDIF(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR) + ENDIF() +ENDIF() diff --git a/code/CMakeModules/FindExternal.cmake b/code/CMakeModules/FindExternal.cmake index 5d6086bc6..8364026cd 100644 --- a/code/CMakeModules/FindExternal.cmake +++ b/code/CMakeModules/FindExternal.cmake @@ -8,7 +8,7 @@ # EXTERNAL_FOUND - True if the external libraries are available SET(EXTERNAL_TEMP_PATH ${CMAKE_CURRENT_SOURCE_DIR}/external ${CMAKE_CURRENT_SOURCE_DIR}/../external ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty ${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty ${EXTERNAL_PATH}) -SET(EXTERNAL_TEMP_FILE "include/wwwconf.h") +SET(EXTERNAL_TEMP_FILE "include/zlib.h") SET(EXTERNAL_NAME "external") # If using STLport preprend external_stlport @@ -16,7 +16,7 @@ IF(WITH_STLPORT) SET(EXTERNAL_TEMP_PATH ${CMAKE_CURRENT_SOURCE_DIR}/external_stlport ${CMAKE_CURRENT_SOURCE_DIR}/../external_stlport ${EXTERNAL_TEMP_PATH}) SET(EXTERNAL_TEMP_FILE "include/stlport/string") SET(EXTERNAL_NAME "external with STLport") -ENDIF(WITH_STLPORT) +ENDIF() FIND_PATH(EXTERNAL_PATH ${EXTERNAL_TEMP_FILE} @@ -38,35 +38,35 @@ IF(EXTERNAL_PATH) # Using 32 or 64 bits binaries IF(TARGET_X64 AND WIN32) SET(EXTERNAL_BINARY_PATH "${EXTERNAL_PATH}/bin64") - ELSE(TARGET_X64 AND WIN32) + ELSE() SET(EXTERNAL_BINARY_PATH "${EXTERNAL_PATH}/bin") - ENDIF(TARGET_X64 AND WIN32) + ENDIF() # Using 32 or 64 bits libraries IF(TARGET_X64 AND WIN32) SET(EXTERNAL_LIBRARY_PATH "${EXTERNAL_PATH}/lib64") - ELSE(TARGET_X64 AND WIN32) + ELSE() SET(EXTERNAL_LIBRARY_PATH "${EXTERNAL_PATH}/lib") - ENDIF(TARGET_X64 AND WIN32) + ENDIF() SET(CMAKE_INCLUDE_PATH "${EXTERNAL_INCLUDE_PATH};${CMAKE_INCLUDE_PATH}") # Stupid hack for FindOpenAL.cmake SET(CMAKE_INCLUDE_PATH "${EXTERNAL_PATH};${CMAKE_INCLUDE_PATH}") SET(CMAKE_LIBRARY_PATH "${EXTERNAL_LIBRARY_PATH};${CMAKE_LIBRARY_PATH}") -ENDIF(EXTERNAL_PATH) +ENDIF() IF(EXTERNAL_FOUND) IF(NOT External_FIND_QUIETLY) MESSAGE(STATUS "Found ${EXTERNAL_NAME}: ${EXTERNAL_PATH}") - ENDIF(NOT External_FIND_QUIETLY) -ELSE(EXTERNAL_FOUND) + ENDIF() +ELSE() IF(External_FIND_REQUIRED) MESSAGE(FATAL_ERROR "Unable to find ${EXTERNAL_NAME}!") - ELSE(External_FIND_REQUIRED) + ELSE() IF(NOT External_FIND_QUIETLY) MESSAGE(STATUS "Warning: Unable to find ${EXTERNAL_NAME}!") - ENDIF(NOT External_FIND_QUIETLY) - ENDIF(External_FIND_REQUIRED) -ENDIF(EXTERNAL_FOUND) + ENDIF() + ENDIF() +ENDIF() MARK_AS_ADVANCED(EXTERNAL_INCLUDE_PATH EXTERNAL_BINARY_PATH EXTERNAL_LIBRARY_PATH) diff --git a/code/CMakeModules/FindFFmpeg.cmake b/code/CMakeModules/FindFFmpeg.cmake new file mode 100644 index 000000000..96cbb6ed0 --- /dev/null +++ b/code/CMakeModules/FindFFmpeg.cmake @@ -0,0 +1,173 @@ +# vim: ts=2 sw=2 +# - Try to find the required ffmpeg components(default: AVFORMAT, AVUTIL, AVCODEC) +# +# Once done this will define +# FFMPEG_FOUND - System has the all required components. +# FFMPEG_INCLUDE_DIRS - Include directory necessary for using the required components headers. +# FFMPEG_LIBRARIES - Link these to use the required ffmpeg components. +# FFMPEG_DEFINITIONS - Compiler switches required for using the required ffmpeg components. +# +# For each of the components it will additionaly set. +# - AVCODEC +# - AVDEVICE +# - AVFORMAT +# - AVUTIL +# - POSTPROC +# - SWSCALE +# - SWRESAMPLE +# the following variables will be defined +# _FOUND - System has +# _INCLUDE_DIRS - Include directory necessary for using the headers +# _LIBRARIES - Link these to use +# _DEFINITIONS - Compiler switches required for using +# _VERSION - The components version +# +# Copyright (c) 2006, Matthias Kretz, +# Copyright (c) 2008, Alexander Neundorf, +# Copyright (c) 2011, Michael Jansen, +# +# Redistribution and use is allowed according to the terms of the BSD license. + +include(FindPackageHandleStandardArgs) + +if(NOT FFmpeg_FIND_COMPONENTS) + set(FFmpeg_FIND_COMPONENTS AVFORMAT AVCODEC AVUTIL) +endif() + +# +### Macro: set_component_found +# +# Marks the given component as found if both *_LIBRARIES AND *_INCLUDE_DIRS is present. +# +macro(set_component_found _component) + if(${_component}_LIBRARIES AND ${_component}_INCLUDE_DIRS) + # message(STATUS " - ${_component} found.") + set(${_component}_FOUND TRUE) + else() + # message(STATUS " - ${_component} not found.") + endif() +endmacro() + +# +### Macro: find_component +# +# Checks for the given component by invoking pkgconfig and then looking up the libraries and +# include directories. +# +macro(find_component _component _pkgconfig _library _header) + if(NOT WIN32) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_${_component} ${_pkgconfig}) + endif() + endif() + + find_path(${_component}_INCLUDE_DIRS ${_header} + HINTS + ${FFMPEGSDK_INC} + ${PC_LIB${_component}_INCLUDEDIR} + ${PC_LIB${_component}_INCLUDE_DIRS} + PATH_SUFFIXES + ffmpeg + ) + + find_library(${_component}_LIBRARIES NAMES ${_library} + HINTS + ${FFMPEGSDK_LIB} + ${PC_LIB${_component}_LIBDIR} + ${PC_LIB${_component}_LIBRARY_DIRS} + ) + + STRING(REGEX REPLACE "/.*" "/version.h" _ver_header ${_header}) + if(EXISTS "${${_component}_INCLUDE_DIRS}/${_ver_header}") + file(STRINGS "${${_component}_INCLUDE_DIRS}/${_ver_header}" version_str REGEX "^#define[\t ]+LIB${_component}_VERSION_M.*") + + foreach(_str "${version_str}") + if(NOT version_maj) + string(REGEX REPLACE "^.*LIB${_component}_VERSION_MAJOR[\t ]+([0-9]*).*$" "\\1" version_maj "${_str}") + endif() + if(NOT version_min) + string(REGEX REPLACE "^.*LIB${_component}_VERSION_MINOR[\t ]+([0-9]*).*$" "\\1" version_min "${_str}") + endif() + if(NOT version_mic) + string(REGEX REPLACE "^.*LIB${_component}_VERSION_MICRO[\t ]+([0-9]*).*$" "\\1" version_mic "${_str}") + endif() + endforeach() + unset(version_str) + + set(${_component}_VERSION "${version_maj}.${version_min}.${version_mic}" CACHE STRING "The ${_component} version number.") + unset(version_maj) + unset(version_min) + unset(version_mic) + endif(EXISTS "${${_component}_INCLUDE_DIRS}/${_ver_header}") + set(${_component}_VERSION ${PC_${_component}_VERSION} CACHE STRING "The ${_component} version number.") + set(${_component}_DEFINITIONS ${PC_${_component}_CFLAGS_OTHER} CACHE STRING "The ${_component} CFLAGS.") + + set_component_found(${_component}) + + mark_as_advanced( + ${_component}_INCLUDE_DIRS + ${_component}_LIBRARIES + ${_component}_DEFINITIONS + ${_component}_VERSION) +endmacro() + + +set(FFMPEGSDK $ENV{FFMPEG_HOME}) +if(FFMPEGSDK) + set(FFMPEGSDK_INC "${FFMPEGSDK}/include") + set(FFMPEGSDK_LIB "${FFMPEGSDK}/lib") +endif() + +# Check for all possible components. +find_component(AVCODEC libavcodec avcodec libavcodec/avcodec.h) +find_component(AVFORMAT libavformat avformat libavformat/avformat.h) +find_component(AVDEVICE libavdevice avdevice libavdevice/avdevice.h) +find_component(AVUTIL libavutil avutil libavutil/avutil.h) +find_component(SWSCALE libswscale swscale libswscale/swscale.h) +find_component(SWRESAMPLE libswresample swresample libswresample/swresample.h) +find_component(POSTPROC libpostproc postproc libpostproc/postprocess.h) + +# Check if the required components were found and add their stuff to the FFMPEG_* vars. +foreach(_component ${FFmpeg_FIND_COMPONENTS}) + if(${_component}_FOUND) + # message(STATUS "Required component ${_component} present.") + set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${${_component}_LIBRARIES}) + set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} ${${_component}_DEFINITIONS}) + list(APPEND FFMPEG_INCLUDE_DIRS ${${_component}_INCLUDE_DIRS}) + else() + # message(STATUS "Required component ${_component} missing.") + endif() +endforeach() + +# Build the include path and library list with duplicates removed. +if(FFMPEG_INCLUDE_DIRS) + list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS) +endif() + +if(FFMPEG_LIBRARIES) + list(REMOVE_DUPLICATES FFMPEG_LIBRARIES) +endif() + +# cache the vars. +set(FFMPEG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIRS} CACHE STRING "The FFmpeg include directories." FORCE) +set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} CACHE STRING "The FFmpeg libraries." FORCE) +set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} CACHE STRING "The FFmpeg cflags." FORCE) + +mark_as_advanced(FFMPEG_INCLUDE_DIRS FFMPEG_LIBRARIES FFMPEG_DEFINITIONS) + +# Now set the noncached _FOUND vars for the components. +foreach(_component AVCODEC AVDEVICE AVFORMAT AVUTIL POSTPROCESS SWRESAMPLE SWSCALE) + set_component_found(${_component}) +endforeach () + +# Compile the list of required vars +set(_FFmpeg_REQUIRED_VARS FFMPEG_LIBRARIES FFMPEG_INCLUDE_DIRS) +foreach(_component ${FFmpeg_FIND_COMPONENTS}) + list(APPEND _FFmpeg_REQUIRED_VARS ${_component}_LIBRARIES ${_component}_INCLUDE_DIRS) +endforeach() + +# Give a nice error message if some of the required vars are missing. +find_package_handle_standard_args(FFmpeg DEFAULT_MSG ${_FFmpeg_REQUIRED_VARS}) diff --git a/code/CMakeModules/FindFMOD.cmake b/code/CMakeModules/FindFMOD.cmake index f85795142..b28f77b1e 100644 --- a/code/CMakeModules/FindFMOD.cmake +++ b/code/CMakeModules/FindFMOD.cmake @@ -7,7 +7,7 @@ IF(FMOD_LIBRARY AND FMOD_INCLUDE_DIR) # in cache already SET(FMOD_FIND_QUIETLY TRUE) -ENDIF(FMOD_LIBRARY AND FMOD_INCLUDE_DIR) +ENDIF() FIND_PATH(FMOD_INCLUDE_DIR @@ -25,9 +25,9 @@ FIND_PATH(FMOD_INCLUDE_DIR IF(TARGET_X64) SET(FMOD_LIBRARY_NAMES fmod64 fmod) -ELSE(TARGET_X64) +ELSE() SET(FMOD_LIBRARY_NAMES fmodvc fmod) -ENDIF(TARGET_X64) +ENDIF() FIND_LIBRARY(FMOD_LIBRARY NAMES @@ -49,9 +49,9 @@ 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) + ENDIF() +ELSE() IF(NOT FMOD_FIND_QUIETLY) MESSAGE(STATUS "Warning: Unable to find FMOD!") - ENDIF(NOT FMOD_FIND_QUIETLY) -ENDIF(FMOD_LIBRARY AND FMOD_INCLUDE_DIR) + ENDIF() +ENDIF() diff --git a/code/CMakeModules/FindFreeType.cmake b/code/CMakeModules/FindFreeType.cmake index f6b827899..d101607b4 100644 --- a/code/CMakeModules/FindFreeType.cmake +++ b/code/CMakeModules/FindFreeType.cmake @@ -7,7 +7,7 @@ IF(FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIRS) # in cache already SET(Freetype_FIND_QUIETLY TRUE) -ENDIF(FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIRS) +ENDIF() FIND_PATH(FREETYPE_INCLUDE_DIRS freetype @@ -24,7 +24,7 @@ FIND_PATH(FREETYPE_INCLUDE_DIRS IF(NOT FREETYPE_INCLUDE_DIRS) SET(FREETYPE_INCLUDE_DIRS "") -ENDIF(NOT FREETYPE_INCLUDE_DIRS) +ENDIF() # ft2build.h does not reside in the freetype include dir FIND_PATH(FREETYPE_ADDITIONAL_INCLUDE_DIR @@ -42,7 +42,7 @@ FIND_PATH(FREETYPE_ADDITIONAL_INCLUDE_DIR # combine both include directories into one variable IF(FREETYPE_ADDITIONAL_INCLUDE_DIR) SET(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS} ${FREETYPE_ADDITIONAL_INCLUDE_DIR}) -ENDIF(FREETYPE_ADDITIONAL_INCLUDE_DIR) +ENDIF() FIND_LIBRARY(FREETYPE_LIBRARY_RELEASE NAMES freetype libfreetype freetype219 freetype246 @@ -89,8 +89,8 @@ IF(FREETYPE_INCLUDE_DIRS) # Case where Freetype is compiled from sources (debug version is compiled by default) SET(FREETYPE_FOUND ON) SET(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY_DEBUG}) - ENDIF(FREETYPE_LIBRARY_RELEASE AND FREETYPE_LIBRARY_DEBUG) -ENDIF(FREETYPE_INCLUDE_DIRS) + ENDIF() +ENDIF() IF(FREETYPE_FOUND) IF(WITH_STATIC_EXTERNAL AND APPLE) @@ -98,13 +98,13 @@ IF(FREETYPE_FOUND) IF(BZIP2_FOUND) SET(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS} ${BZIP2_INCLUDE_DIR}) SET(FREETYPE_LIBRARIES ${FREETYPE_LIBRARIES} ${BZIP2_LIBRARIES}) - ENDIF(BZIP2_FOUND) - ENDIF(WITH_STATIC_EXTERNAL AND APPLE) + ENDIF() + ENDIF() IF(NOT Freetype_FIND_QUIETLY) MESSAGE(STATUS "Found FreeType: ${FREETYPE_LIBRARIES}") - ENDIF(NOT Freetype_FIND_QUIETLY) -ELSE(FREETYPE_LIBRARY AND FREETYPE_INCLUDE_DIRS) + ENDIF() +ELSE() IF(NOT Freetype_FIND_QUIETLY) MESSAGE(STATUS "Warning: Unable to find FreeType!") - ENDIF(NOT Freetype_FIND_QUIETLY) -ENDIF(FREETYPE_FOUND) + ENDIF() +ENDIF() diff --git a/code/CMakeModules/FindHelpers.cmake b/code/CMakeModules/FindHelpers.cmake new file mode 100644 index 000000000..bc38354f4 --- /dev/null +++ b/code/CMakeModules/FindHelpers.cmake @@ -0,0 +1,959 @@ +MACRO(CONVERT_NUMBER_VERSION _VERSION_NUMBER _BASE _OUT) + SET(${_OUT}) + SET(_NUMBER ${_VERSION_NUMBER}) + WHILE(_NUMBER GREATER 0) + MATH(EXPR _TEMP "${_NUMBER} % ${_BASE}") + LIST(APPEND ${_OUT} ${_TEMP}) + MATH(EXPR _NUMBER "${_NUMBER} / ${_BASE}") + ENDWHILE() +ENDMACRO(CONVERT_NUMBER_VERSION) + +FUNCTION(JOIN VALUES GLUE OUTPUT) + STRING(REGEX REPLACE "([^\\]|^);" "\\1${GLUE}" _TMP_STR "${VALUES}") + STRING(REGEX REPLACE "[\\](.)" "\\1" _TMP_STR "${_TMP_STR}") #fixes escaping + SET(${OUTPUT} "${_TMP_STR}" PARENT_SCOPE) +ENDFUNCTION() + +MACRO(PARSE_VERSION_OTHER FILENAME) + IF(EXISTS ${FILENAME}) + SET(_FILTER_ARRAY ${ARGN}) + JOIN("${_FILTER_ARRAY}" "|" _FILTER_REGEX) + FILE(STRINGS ${FILENAME} _FILE REGEX "(${_FILTER_REGEX})[: \t=\(\)\"]+([0-9.]+)") + + IF(_FILE) + FOREACH(_LINE ${_FILE}) + FOREACH(_VAR ${_FILTER_ARRAY}) + IF("${${_VAR}}" STREQUAL "") + STRING(REGEX REPLACE "^.*${_VAR}[: \t=\(\)\"]+([0-9.]+).*$" "\\1" ${_VAR} "${_LINE}") + IF(${_VAR} STREQUAL "${_LINE}") + SET(${_VAR}) + ENDIF() + IF(NOT ${_VAR} AND NOT STREQUAL "0") + SET(${_VAR} 0) + ENDIF() + ENDIF() + ENDFOREACH() + ENDFOREACH() + ENDIF() + ENDIF() +ENDMACRO() + +# macro to define FIND_PACKAGE options with a different package name +MACRO(FIX_PACKAGE_OPTIONS OLDNAME NEWNAME) + # append other options if needed + SET(_OPTIONS COMPONENTS REQUIRED QUIETLY) + + # process each options + FOREACH(_OPTION ${_OPTIONS}) + SET(OLD_OPTION ${OLDNAME}_FIND_${_OPTION}) + IF(DEFINED ) + SET(NEW_OPTION ${NEWNAME}_FIND_${_OPTION}) + SET(${NEW_OPTION} ${OLD_OPTION}) + ENDIF() + ENDFOREACH() +ENDMACRO() + +MACRO(FIND_PACKAGE_HELPER NAME INCLUDE) + # Looks for a directory containing NAME. + # + # NAME is the name of the library, lowercase and uppercase can be mixed + # It should be EXACTLY (same case) the same part as XXXX in FindXXXX.cmake + # + # INCLUDE is the file to check for includes + # + # Following parameters are optional variables and must be prefixed by: + # + # RELEASE is the list of libraries to check in release mode + # DEBUG is the list of libraries to check in debug mode + # SUFFIXES is the PATH_SUFFIXES to check for include file + # QUIET don't display anything + # VERBOSE display more details if not found + # REQUIRED throw an error if not found + # DIR is the base directory where to look for + # + # The first match will be used in the specified order and next matches will be ignored + # + # The following values are defined + # NAME_INCLUDE_DIR - where to find NAME + # NAME_LIBRARIES - link against these to use NAME + # NAME_FOUND - True if NAME is available. + + SET(_PARAMS ${ARGN}) + + SET(_RELEASE_LIBRARIES) + SET(_DEBUG_LIBRARIES) + SET(_SUFFIXES) + SET(_BASE_DIRECTORIES) + + SET(_IS_RELEASE OFF) + SET(_IS_DEBUG OFF) + SET(_IS_SUFFIXES OFF) + SET(_IS_VERBOSE OFF) + SET(_IS_DIR OFF) + + IF(_PARAMS) + FOREACH(_PARAM ${_PARAMS}) + IF(_PARAM STREQUAL "RELEASE") + SET(_IS_RELEASE ON) + SET(_IS_DEBUG OFF) + SET(_IS_SUFFIXES OFF) + SET(_IS_DIR OFF) + ELSEIF(_PARAM STREQUAL "DEBUG") + SET(_IS_RELEASE OFF) + SET(_IS_DEBUG ON) + SET(_IS_SUFFIXES OFF) + SET(_IS_DIR OFF) + ELSEIF(_PARAM STREQUAL "SUFFIXES") + SET(_IS_RELEASE OFF) + SET(_IS_DEBUG OFF) + SET(_IS_DIR OFF) + SET(_IS_SUFFIXES ON) + ELSEIF(_PARAM STREQUAL "QUIET") + SET(_IS_RELEASE OFF) + SET(_IS_DEBUG OFF) + SET(_IS_SUFFIXES OFF) + SET(_IS_DIR OFF) + SET(${NAME}_FIND_QUIETLY ON) + ELSEIF(_PARAM STREQUAL "VERBOSE") + SET(_IS_RELEASE OFF) + SET(_IS_DEBUG OFF) + SET(_IS_SUFFIXES OFF) + SET(_IS_DIR OFF) + SET(_IS_VERBOSE ON) + ELSEIF(_PARAM STREQUAL "REQUIRED") + SET(_IS_RELEASE OFF) + SET(_IS_DEBUG OFF) + SET(_IS_SUFFIXES OFF) + SET(_IS_DIR OFF) + SET(${NAME}_FIND_REQUIRED ON) + ELSEIF(_PARAM STREQUAL "DIR") + SET(_IS_RELEASE OFF) + SET(_IS_DEBUG OFF) + SET(_IS_SUFFIXES OFF) + SET(_IS_DIR ON) + ELSE() + IF(_IS_RELEASE) + LIST(APPEND _RELEASE_LIBRARIES ${_PARAM}) + ELSEIF(_IS_DEBUG) + LIST(APPEND _DEBUG_LIBRARIES ${_PARAM}) + ELSEIF(_IS_SUFFIXES) + LIST(APPEND _SUFFIXES ${_PARAM}) + ELSEIF(_IS_DIR) + LIST(APPEND _BASE_DIRECTORIES ${_PARAM}) + ELSE() + MESSAGE(STATUS "parameter ${_PARAM} with no prefix") + ENDIF() + ENDIF() + ENDFOREACH() + ENDIF() + + # Fixes names if invalid characters are found + IF("${NAME}" MATCHES "^[a-zA-Z0-9]+$") + SET(_NAME_FIXED ${NAME}) + ELSE() + # if invalid characters are detected, replace them by valid ones + STRING(REPLACE "+" "p" _NAME_FIXED ${NAME}) + ENDIF() + + # Create uppercase and lowercase versions of NAME + STRING(TOUPPER ${NAME} _UPNAME) + STRING(TOLOWER ${NAME} _LOWNAME) + + STRING(TOUPPER ${_NAME_FIXED} _UPNAME_FIXED) + STRING(TOLOWER ${_NAME_FIXED} _LOWNAME_FIXED) + + SET(_SUFFIXES ${_SUFFIXES} ${_LOWNAME} ${_LOWNAME_FIXED} ${NAME}) + +# Don't use pkg-config +# IF(NOT WIN32 AND NOT IOS) +# FIND_PACKAGE(PkgConfig QUIET) +# SET(_MODULES ${_LOWNAME} ${_RELEASE_LIBRARIES}) +# LIST(REMOVE_DUPLICATES _MODULES) +# IF(PKG_CONFIG_EXECUTABLE) +# PKG_SEARCH_MODULE(PKG_${_NAME_FIXED} QUIET ${_MODULES}) +# ENDIF() +# ENDIF() + + SET(_INCLUDE_PATHS) + SET(_LIBRARY_PATHS) + + # Check for root directories passed to CMake with -DXXX_DIR=... + IF(DEFINED ${_UPNAME_FIXED}_DIR) + SET(_TMP ${${_UPNAME_FIXED}_DIR}) + GET_FILENAME_COMPONENT(_TMP ${_TMP} ABSOLUTE) + LIST(APPEND _INCLUDE_PATHS ${_TMP}/include ${_TMP}) + LIST(APPEND _LIBRARY_PATHS ${_TMP}/lib${LIB_SUFFIX}) + + IF(_IS_VERBOSE) + MESSAGE(STATUS "Using ${_UPNAME_FIXED}_DIR as root directory ${_TMP}") + ENDIF() + ENDIF() + + IF(DEFINED ${_UPNAME}_DIR) + SET(_TMP ${${_UPNAME}_DIR}) + LIST(APPEND _INCLUDE_PATHS ${_TMP}/include ${_TMP}) + LIST(APPEND _LIBRARY_PATHS ${_TMP}/lib${LIB_SUFFIX}) + + IF(_IS_VERBOSE) + MESSAGE(STATUS "Using ${_UPNAME_FIXED}_DIR as root directory ${_TMP}") + ENDIF() + ENDIF() + + IF(_BASE_DIRECTORIES) + FOREACH(_DIR ${_BASE_DIRECTORIES}) + IF(_DIR) + LIST(APPEND _INCLUDE_PATHS ${_DIR}/include ${_DIR}) + LIST(APPEND _LIBRARY_PATHS ${_DIR}/lib${LIB_SUFFIX}) + + IF(_IS_VERBOSE) + MESSAGE(STATUS "Using ${_DIR} as root directory") + ENDIF() + ENDIF() + ENDFOREACH() + ENDIF() + + IF(UNIX) + # Append UNIX standard include paths + SET(_UNIX_INCLUDE_PATHS) + + # Append multiarch include paths + IF(CMAKE_LIBRARY_ARCHITECTURE) + LIST(APPEND _UNIX_INCLUDE_PATHS + /usr/local/include/${CMAKE_LIBRARY_ARCHITECTURE} + /usr/include/${CMAKE_LIBRARY_ARCHITECTURE}) + ENDIF() + + LIST(APPEND _UNIX_INCLUDE_PATHS + /usr/local/include + /usr/include + /sw/include + /opt/local/include + /opt/csw/include + /opt/include) + ENDIF() + + IF(_IS_VERBOSE) + MESSAGE(STATUS "Searching header ${INCLUDE} in: ${_INCLUDE_PATHS} with suffixes ${_SUFFIXES}") + ENDIF() + + # Search for include directory + FIND_PATH(${_UPNAME_FIXED}_INCLUDE_DIR + NAMES ${INCLUDE} + HINTS + ${PKG_${_NAME_FIXED}_INCLUDE_DIRS} + ${_INCLUDE_PATHS} + $ENV{${_UPNAME}_DIR}/include + $ENV{${_UPNAME_FIXED}_DIR}/include + $ENV{${_UPNAME}_DIR} + $ENV{${_UPNAME_FIXED}_DIR} + PATHS + ${_UNIX_INCLUDE_PATHS} + PATH_SUFFIXES + ${_SUFFIXES} + DOC "Include path for ${NAME}" + ) + + IF(_IS_VERBOSE) + IF(${_UPNAME_FIXED}_INCLUDE_DIR) + MESSAGE(STATUS "${INCLUDE} found in ${${_UPNAME_FIXED}_INCLUDE_DIR}") + ELSE() + MESSAGE(STATUS "${INCLUDE} not found") + ENDIF() + ENDIF() + + # Append environment variables XXX_DIR + LIST(APPEND _LIBRARY_PATHS + $ENV{${_UPNAME}_DIR}/lib${LIB_SUFFIX} + $ENV{${_UPNAME_FIXED}_DIR}/lib${LIB_SUFFIX}) + + IF(UNIX) + SET(_UNIX_LIBRARY_PATHS) + + # Append multiarch libraries paths + IF(CMAKE_LIBRARY_ARCHITECTURE) + LIST(APPEND _UNIX_LIBRARY_PATHS + /usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE} + /lib/${CMAKE_LIBRARY_ARCHITECTURE} + /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}) + ENDIF() + + # Append UNIX standard libraries paths + LIST(APPEND _UNIX_LIBRARY_PATHS + /usr/local/lib + /usr/lib + /lib + /usr/local/X11R6/lib + /usr/X11R6/lib + /sw/lib + /opt/local/lib + /opt/csw/lib + /opt/lib + /usr/freeware/lib${LIB_SUFFIX}) + ENDIF() + + LIST(APPEND _RELEASE_LIBRARIES ${_LOWNAME} ${_LOWNAME_FIXED} ${NAME} ${_NAME_FIXED}) + LIST(APPEND _DEBUG_LIBRARIES ${_LOWNAME}d ${_LOWNAME_FIXED}d ${NAME}d ${_NAME_FIXED}d) + + # Under Windows, some libs may need the lib prefix + IF(WIN32) + SET(_LIBS ${_RELEASE_LIBRARIES}) + FOREACH(_LIB ${_LIBS}) + LIST(APPEND _RELEASE_LIBRARIES lib${_LIB}) + ENDFOREACH() + + SET(_LIBS ${_DEBUG_LIBRARIES}) + FOREACH(_LIB ${_LIBS}) + LIST(APPEND _DEBUG_LIBRARIES lib${_LIB}) + ENDFOREACH() + ENDIF() + + LIST(REMOVE_DUPLICATES _RELEASE_LIBRARIES) + LIST(REMOVE_DUPLICATES _DEBUG_LIBRARIES) + + # Search for release library + FIND_LIBRARY(${_UPNAME_FIXED}_LIBRARY_RELEASE + NAMES + ${_RELEASE_LIBRARIES} + HINTS ${PKG_${_NAME_FIXED}_LIBRARY_DIRS} + PATHS + ${_LIBRARY_PATHS} + ${_UNIX_LIBRARY_PATHS} + NO_CMAKE_SYSTEM_PATH + ) + + IF(_IS_VERBOSE) + IF(${_UPNAME_FIXED}_LIBRARY_RELEASE) + MESSAGE(STATUS "${NAME} release library found: ${${_UPNAME_FIXED}_LIBRARY_RELEASE}") + ELSE() + MESSAGE(STATUS "${NAME} release library not found in ${_LIBRARY_PATHS};${_UNIX_LIBRARY_PATHS}") + ENDIF() + ENDIF() + + # Search for debug library + FIND_LIBRARY(${_UPNAME_FIXED}_LIBRARY_DEBUG + NAMES + ${_DEBUG_LIBRARIES} + HINTS ${PKG_${_NAME_FIXED}_LIBRARY_DIRS} + PATHS + ${_LIBRARY_PATHS} + ${_UNIX_LIBRARY_PATHS} + NO_CMAKE_SYSTEM_PATH + ) + + IF(_IS_VERBOSE) + IF(${_UPNAME_FIXED}_LIBRARY_DEBUG) + MESSAGE(STATUS "${NAME} debug library found: ${${_UPNAME_FIXED}_LIBRARY_DEBUG}") + ELSE() + MESSAGE(STATUS "${NAME} debug library not found") + ENDIF() + ENDIF() + + SET(${_UPNAME_FIXED}_FOUND OFF) + + IF(${_UPNAME_FIXED}_INCLUDE_DIR) + # Set also _INCLUDE_DIRS + SET(${_UPNAME_FIXED}_INCLUDE_DIRS ${${_UPNAME_FIXED}_INCLUDE_DIR}) + ENDIF() + + # Library has been found if at least only one library and include are found + IF(${_UPNAME_FIXED}_LIBRARY_RELEASE AND ${_UPNAME_FIXED}_LIBRARY_DEBUG) + # Release and debug libraries found + SET(${_UPNAME_FIXED}_FOUND ON) + SET(${_UPNAME_FIXED}_LIBRARIES optimized ${${_UPNAME_FIXED}_LIBRARY_RELEASE} debug ${${_UPNAME_FIXED}_LIBRARY_DEBUG}) + SET(${_UPNAME_FIXED}_LIBRARY ${${_UPNAME_FIXED}_LIBRARY_RELEASE}) + ELSEIF(${_UPNAME_FIXED}_LIBRARY_RELEASE) + # Release library found + SET(${_UPNAME_FIXED}_FOUND ON) + SET(${_UPNAME_FIXED}_LIBRARIES ${${_UPNAME_FIXED}_LIBRARY_RELEASE}) + SET(${_UPNAME_FIXED}_LIBRARY ${${_UPNAME_FIXED}_LIBRARY_RELEASE}) + ELSEIF(${_UPNAME_FIXED}_LIBRARY_DEBUG) + # Debug library found + SET(${_UPNAME_FIXED}_FOUND ON) + SET(${_UPNAME_FIXED}_LIBRARIES ${${_UPNAME_FIXED}_LIBRARY_DEBUG}) + SET(${_UPNAME_FIXED}_LIBRARY ${${_UPNAME_FIXED}_LIBRARY_DEBUG}) + ENDIF() + + IF(${_UPNAME_FIXED}_FOUND) + IF(NOT ${NAME}_FIND_QUIETLY) + MESSAGE(STATUS "Found ${NAME}: ${${_UPNAME_FIXED}_LIBRARIES}") + ENDIF() + ELSE() + IF(${NAME}_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Error: Unable to find ${NAME}!") + ENDIF() + IF(NOT ${NAME}_FIND_QUIETLY) + MESSAGE(STATUS "Warning: Unable to find ${NAME}!") + ENDIF() + ENDIF() + + MARK_AS_ADVANCED(${_UPNAME_FIXED}_LIBRARY_RELEASE ${_UPNAME_FIXED}_LIBRARY_DEBUG) +ENDMACRO() + +MACRO(MESSAGE_VERSION_PACKAGE_HELPER NAME VERSION) + MESSAGE(STATUS "Found ${NAME} ${VERSION}: ${ARGN}") +ENDMACRO() + +MACRO(FIND_LIBRARY_HELPER NAME) + # Looks for libraries. + # + # NAME is the name of the library, lowercase and uppercase can be mixed + # + # Following parameters are optional variables and must be prefixed by: + # + # RELEASE is the list of libraries to check in release mode + # DEBUG is the list of libraries to check in debug mode + # VERBOSE display more details if not found + # REQUIRED throw an error if not found + # DIR is the base directory where to look for + # + # The first match will be used in the specified order and next matches will be ignored + # + # The following values are defined + # NAME_LIBRARIES - link against these to use NAME + + SET(_PARAMS ${ARGN}) + + SET(_RELEASE_LIBRARIES) + SET(_DEBUG_LIBRARIES) + SET(_BASE_DIRECTORIES) + + SET(_IS_RELEASE OFF) + SET(_IS_DEBUG OFF) + SET(_IS_VERBOSE OFF) + SET(_IS_DIR OFF) + + IF(_PARAMS) + FOREACH(_PARAM ${_PARAMS}) + IF(_PARAM STREQUAL "RELEASE") + SET(_IS_RELEASE ON) + SET(_IS_DEBUG OFF) + SET(_IS_DIR OFF) + ELSEIF(_PARAM STREQUAL "DEBUG") + SET(_IS_RELEASE OFF) + SET(_IS_DEBUG ON) + SET(_IS_DIR OFF) + ELSEIF(_PARAM STREQUAL "VERBOSE") + SET(_IS_RELEASE OFF) + SET(_IS_DEBUG OFF) + SET(_IS_DIR OFF) + SET(_IS_VERBOSE ON) + ELSEIF(_PARAM STREQUAL "REQUIRED") + SET(_IS_RELEASE OFF) + SET(_IS_DEBUG OFF) + SET(_IS_DIR OFF) + SET(${NAME}_FIND_REQUIRED ON) + ELSEIF(_PARAM STREQUAL "DIR") + SET(_IS_RELEASE OFF) + SET(_IS_DEBUG OFF) + SET(_IS_DIR ON) + ELSE() + IF(_IS_RELEASE) + LIST(APPEND _RELEASE_LIBRARIES ${_PARAM}) + ELSEIF(_IS_DEBUG) + LIST(APPEND _DEBUG_LIBRARIES ${_PARAM}) + ELSEIF(_IS_DIR) + LIST(APPEND _BASE_DIRECTORIES ${_PARAM}) + ELSE() + MESSAGE(STATUS "parameter ${_PARAM} with no prefix") + ENDIF() + ENDIF() + ENDFOREACH() + ENDIF() + + # Fixes names if invalid characters are found + IF("${NAME}" MATCHES "^[a-zA-Z0-9]+$") + SET(_NAME_FIXED ${NAME}) + ELSE() + # if invalid characters are detected, replace them by valid ones + STRING(REPLACE "+" "p" _NAME_FIXED ${NAME}) + ENDIF() + + # Create uppercase and lowercase versions of NAME + STRING(TOUPPER ${NAME} _UPNAME) + STRING(TOLOWER ${NAME} _LOWNAME) + + STRING(TOUPPER ${_NAME_FIXED} _UPNAME_FIXED) + STRING(TOLOWER ${_NAME_FIXED} _LOWNAME_FIXED) + + SET(_LIBRARY_PATHS) + + # Check for root directories passed to CMake with -DXXX_DIR=... + IF(DEFINED ${_UPNAME_FIXED}_DIR) + SET(_TMP ${${_UPNAME_FIXED}_DIR}) + GET_FILENAME_COMPONENT(_TMP ${_TMP} ABSOLUTE) + LIST(APPEND _LIBRARY_PATHS ${_TMP}/lib${LIB_SUFFIX}) + + IF(_IS_VERBOSE) + MESSAGE(STATUS "Using ${_UPNAME_FIXED}_DIR as root directory ${_TMP}") + ENDIF() + ENDIF() + + IF(DEFINED ${_UPNAME}_DIR) + SET(_TMP ${${_UPNAME}_DIR}) + LIST(APPEND _LIBRARY_PATHS ${_TMP}/lib${LIB_SUFFIX}) + + IF(_IS_VERBOSE) + MESSAGE(STATUS "Using ${_UPNAME_FIXED}_DIR as root directory ${_TMP}") + ENDIF() + ENDIF() + + IF(_BASE_DIRECTORIES) + FOREACH(_DIR ${_BASE_DIRECTORIES}) + IF(_DIR) + LIST(APPEND _LIBRARY_PATHS ${_DIR}/lib${LIB_SUFFIX}) + + IF(_IS_VERBOSE) + MESSAGE(STATUS "Using ${_DIR} as root directory") + ENDIF() + ENDIF() + ENDFOREACH() + ENDIF() + + # Append environment variables XXX_DIR + LIST(APPEND _LIBRARY_PATHS + $ENV{${_UPNAME}_DIR}/lib${LIB_SUFFIX} + $ENV{${_UPNAME_FIXED}_DIR}/lib${LIB_SUFFIX}) + + IF(UNIX) + SET(_UNIX_LIBRARY_PATHS) + + # Append multiarch libraries paths + IF(CMAKE_LIBRARY_ARCHITECTURE) + LIST(APPEND _UNIX_LIBRARY_PATHS + /usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE} + /lib/${CMAKE_LIBRARY_ARCHITECTURE} + /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}) + ENDIF() + + # Append UNIX standard libraries paths + LIST(APPEND _UNIX_LIBRARY_PATHS + /usr/local/lib + /usr/lib + /lib + /usr/local/X11R6/lib + /usr/X11R6/lib + /sw/lib + /opt/local/lib + /opt/csw/lib + /opt/lib + /usr/freeware/lib${LIB_SUFFIX}) + ENDIF() + + LIST(APPEND _RELEASE_LIBRARIES ${_LOWNAME} ${_LOWNAME_FIXED} ${NAME} ${_NAME_FIXED}) + LIST(APPEND _DEBUG_LIBRARIES ${_LOWNAME}d ${_LOWNAME_FIXED}d ${NAME}d ${_NAME_FIXED}d) + + # Under Windows, some libs may need the lib prefix + IF(WIN32) + SET(_LIBS ${_RELEASE_LIBRARIES}) + FOREACH(_LIB ${_LIBS}) + LIST(APPEND _RELEASE_LIBRARIES lib${_LIB}) + ENDFOREACH() + + SET(_LIBS ${_DEBUG_LIBRARIES}) + FOREACH(_LIB ${_LIBS}) + LIST(APPEND _DEBUG_LIBRARIES lib${_LIB}) + ENDFOREACH() + ENDIF() + + LIST(REMOVE_DUPLICATES _RELEASE_LIBRARIES) + LIST(REMOVE_DUPLICATES _DEBUG_LIBRARIES) + + # Search for release library + FIND_LIBRARY(${_UPNAME_FIXED}_LIBRARY_RELEASE + NAMES + ${_RELEASE_LIBRARIES} + HINTS ${PKG_${_NAME_FIXED}_LIBRARY_DIRS} + PATHS + ${_LIBRARY_PATHS} + ${_UNIX_LIBRARY_PATHS} + NO_CMAKE_SYSTEM_PATH + ) + + IF(_IS_VERBOSE) + IF(${_UPNAME_FIXED}_LIBRARY_RELEASE) + MESSAGE(STATUS "${NAME} release library found: ${${_UPNAME_FIXED}_LIBRARY_RELEASE}") + ELSE() + MESSAGE(STATUS "${NAME} release library not found in ${_LIBRARY_PATHS};${_UNIX_LIBRARY_PATHS}") + ENDIF() + ENDIF() + + # Search for debug library + FIND_LIBRARY(${_UPNAME_FIXED}_LIBRARY_DEBUG + NAMES + ${_DEBUG_LIBRARIES} + HINTS ${PKG_${_NAME_FIXED}_LIBRARY_DIRS} + PATHS + ${_LIBRARY_PATHS} + ${_UNIX_LIBRARY_PATHS} + NO_CMAKE_SYSTEM_PATH + ) + + IF(_IS_VERBOSE) + IF(${_UPNAME_FIXED}_LIBRARY_DEBUG) + MESSAGE(STATUS "${NAME} debug library found: ${${_UPNAME_FIXED}_LIBRARY_DEBUG}") + ELSE() + MESSAGE(STATUS "${NAME} debug library not found") + ENDIF() + ENDIF() + + # Library has been found if at least only one library and include are found + IF(${_UPNAME_FIXED}_LIBRARY_RELEASE AND ${_UPNAME_FIXED}_LIBRARY_DEBUG) + # Release and debug libraries found + SET(${_UPNAME_FIXED}_LIBRARIES optimized ${${_UPNAME_FIXED}_LIBRARY_RELEASE} debug ${${_UPNAME_FIXED}_LIBRARY_DEBUG}) + SET(${_UPNAME_FIXED}_LIBRARY ${${_UPNAME_FIXED}_LIBRARY_RELEASE}) + ELSEIF(${_UPNAME_FIXED}_LIBRARY_RELEASE) + # Release library found + SET(${_UPNAME_FIXED}_LIBRARIES ${${_UPNAME_FIXED}_LIBRARY_RELEASE}) + SET(${_UPNAME_FIXED}_LIBRARY ${${_UPNAME_FIXED}_LIBRARY_RELEASE}) + ELSEIF(${_UPNAME_FIXED}_LIBRARY_DEBUG) + # Debug library found + SET(${_UPNAME_FIXED}_LIBRARIES ${${_UPNAME_FIXED}_LIBRARY_DEBUG}) + SET(${_UPNAME_FIXED}_LIBRARY ${${_UPNAME_FIXED}_LIBRARY_DEBUG}) + ENDIF() + + MARK_AS_ADVANCED(${_UPNAME_FIXED}_LIBRARY_RELEASE ${_UPNAME_FIXED}_LIBRARY_DEBUG) +ENDMACRO() + +MACRO(FIND_LIBCURL) + IF(NOT CURL_FOUND) + FIND_PACKAGE(CURL REQUIRED) + + IF(WIN32 OR CURL_LIBRARY MATCHES "\\.a" OR WITH_STATIC_CURL) + SET(CURL_STATIC ON) + ELSE() + SET(CURL_STATIC OFF) + ENDIF() + + IF(CURL_STATIC) + SET(CURL_DEFINITIONS -DCURL_STATICLIB) + + IF(UNIX) + # CURL can depend on libidn + FIND_LIBRARY(IDN_LIBRARY idn) + IF(IDN_LIBRARY) + LIST(APPEND CURL_LIBRARIES ${IDN_LIBRARY}) + ENDIF() + + # CURL Macports version can depend on libidn, libintl and libiconv too + IF(APPLE) + FIND_LIBRARY(INTL_LIBRARY intl) + IF(INTL_LIBRARY) + LIST(APPEND CURL_LIBRARIES ${INTL_LIBRARY}) + ENDIF() + ELSE() + # Only used by libcurl under Linux + FIND_PACKAGE(OpenSSL REQUIRED) + + #IF(WIN32) + # SET(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} Crypt32.lib) + #ENDIF() + + # Only Linux version of libcurl depends on OpenSSL + LIST(APPEND CURL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR}) + LIST(APPEND CURL_LIBRARIES ${OPENSSL_LIBRARIES}) + ENDIF() + ENDIF() + ENDIF() + ENDIF() +ENDMACRO() + +MACRO(FIND_LIBXML2) + IF(NOT LIBXML2_FOUND) + FIND_PACKAGE(LibXml2 REQUIRED) + + IF(WIN32 OR WITH_STATIC_LIBXML2) + LIST(APPEND LIBXML2_DEFINITIONS -DLIBXML_STATIC) + ENDIF() + + IF(WITH_LIBXML2_ICONV) + FIND_PACKAGE(Iconv REQUIRED) +# LIST(APPEND CURL_INCLUDE_DIRS ${ICONV_INCLUDE_DIR}) + LIST(APPEND LIBXML2_LIBRARIES ${ICONV_LIBRARIES}) + ENDIF() + + IF(WITH_STATIC) + # libxml2 could need winsock2 library + IF(WIN32) + FIND_LIBRARY(WINSOCK2_LIB ws2_32) + + IF(WINSOCK2_LIB) + LIST(APPEND LIBXML2_LIBRARIES ${WINSOCK2_LIB}) + ENDIF() + + FIND_LIBRARY(CRYPT32_LIB Crypt32) + + IF(CRYPT32_LIB) + LIST(APPEND LIBXML2_LIBRARIES ${CRYPT32_LIB}) + ENDIF() + ELSE() + # under Linux and OS X, recent libxml2 versions are linked against liblzma + FIND_PACKAGE(LibLZMA) + + IF(LIBLZMA_LIBRARIES) + LIST(APPEND LIBXML2_LIBRARIES ${LIBLZMA_LIBRARIES}) + ENDIF() + ENDIF() + ENDIF() + ENDIF() +ENDMACRO() + +MACRO(ADD_QT_LIBRARY _NAME) + IF(WIN32) + SET(_PREFIX "Qt5") + SET(_EXT "lib") + ELSE() + SET(_PREFIX "libQt5") + SET(_EXT "a") + ENDIF() + SET(_LIB "${QT_LIBRARY_DIR}/${_PREFIX}${_NAME}.${_EXT}") + IF(EXISTS ${_LIB}) + LIST(APPEND QT_LIBRARIES optimized ${_LIB}) + ENDIF() + SET(_LIB "${QT_LIBRARY_DIR}/${_PREFIX}${_NAME}d.${_EXT}") + IF(EXISTS ${_LIB}) + LIST(APPEND QT_LIBRARIES debug ${_LIB}) + ENDIF() +ENDMACRO() + +MACRO(ADD_QT_PLUGIN _TYPE _NAME) + IF(WIN32) + SET(_PREFIX "") + SET(_EXT "lib") + ELSE() + SET(_PREFIX "lib") + SET(_EXT "a") + ENDIF() + SET(_LIB "${QT_PLUGINS_DIR}/${_TYPE}/${_PREFIX}${_NAME}.${_EXT}") + IF(EXISTS ${_LIB}) + LIST(APPEND QT_LIBRARIES optimized ${_LIB}) + ENDIF() + SET(_LIB "${QT_PLUGINS_DIR}/${_TYPE}/${_PREFIX}${_NAME}d.${_EXT}") + IF(EXISTS ${_LIB}) + LIST(APPEND QT_LIBRARIES debug ${_LIB}) + ENDIF() +ENDMACRO() + +MACRO(ADD_QT_SYSTEM_LIBRARY _NAME) + # Save default suffixes + SET(_OLD_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) + + # Define specific suffixes + SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX}) + + # Find the library with specified suffixes + FIND_LIBRARY(${_NAME}_LIBRARY NAMES ${_NAME}) + + # Restore default suffixes + SET(CMAKE_FIND_LIBRARY_SUFFIXES ${_OLD_SUFFIXES}) + + IF(${_NAME}_LIBRARY) + MESSAGE(STATUS "Found ${${_NAME}_LIBRARY} ${_NAME}") + + LIST(APPEND QT_LIBRARIES ${${_NAME}_LIBRARY}) + ELSE() + MESSAGE(STATUS "Didn't find ${_NAME}") + ENDIF() +ENDMACRO() + +MACRO(FIND_QT5) + CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11 FATAL_ERROR) + + SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${QTDIR} $ENV{QTDIR}) + + FIND_PACKAGE(Qt5Core QUIET) + + IF(Qt5Core_FOUND) + # Check if we are using Qt static or shared libraries + GET_TARGET_PROPERTY(_FILE Qt5::Core IMPORTED_LOCATION_RELEASE) + + SET(QT_VERSION "${Qt5Core_VERSION_STRING}") + SET(_VERSION "${QT_VERSION}") + + IF(_FILE MATCHES "\\.(lib|a)$") + SET(QT_STATIC ON) + SET(_VERSION "${_VERSION} static version") + ELSE() + SET(QT_STATIC OFF) + SET(_VERSION "${_VERSION} shared version") + ENDIF() + + MESSAGE(STATUS "Found Qt ${_VERSION}") + + # These variables are not defined with Qt5 CMake modules + SET(QT_BINARY_DIR "${_qt5Core_install_prefix}/bin") + SET(QT_LIBRARY_DIR "${_qt5Core_install_prefix}/lib") + SET(QT_PLUGINS_DIR "${_qt5Core_install_prefix}/plugins") + SET(QT_TRANSLATIONS_DIR "${_qt5Core_install_prefix}/translations") + + # Fix wrong include directories with Qt 5 under Mac OS X + INCLUDE_DIRECTORIES("${_qt5Core_install_prefix}/include") + + FIND_PACKAGE(Qt5Gui) + FIND_PACKAGE(Qt5Widgets) + FIND_PACKAGE(Qt5OpenGL) + FIND_PACKAGE(Qt5Xml) + FIND_PACKAGE(Qt5LinguistTools) + FIND_PACKAGE(Qt5Network) + + IF(QT_STATIC) + FIND_PACKAGE(PNG REQUIRED) + FIND_PACKAGE(Jpeg REQUIRED) + + ADD_DEFINITIONS(-DQT_STATICPLUGIN) + + SET(QT_LIBRARIES Qt5::Widgets) + + # Gui + LIST(APPEND QT_LIBRARIES Qt5::Gui Qt5::OpenGL) + + ADD_QT_LIBRARY(PrintSupport) + + IF(WIN32) + LIST(APPEND QT_LIBRARIES + ${WINSDK_LIBRARY_DIR}/Imm32.lib + ${WINSDK_LIBRARY_DIR}/OpenGL32.lib + ${WINSDK_LIBRARY_DIR}/WinMM.Lib) + ADD_QT_PLUGIN(platforms qwindows) + ADD_QT_LIBRARY(PlatformSupport) + ELSEIF(APPLE) + # Cups needs .dylib + SET(OLD_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) + SET(CMAKE_FIND_LIBRARY_SUFFIXES .dylib) + FIND_LIBRARY(CUPS_LIBRARY cups) + SET(CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_CMAKE_FIND_LIBRARY_SUFFIXES}) + + FIND_LIBRARY(IOKIT_FRAMEWORK IOKit) + FIND_LIBRARY(COCOA_FRAMEWORK Cocoa) + FIND_LIBRARY(SYSTEMCONFIGURATION_FRAMEWORK SystemConfiguration) + FIND_LIBRARY(OPENGL_FRAMEWORK NAMES OpenGL) + + LIST(APPEND QT_LIBRARIES + ${CUPS_LIBRARY} + ${COCOA_FRAMEWORK} + ${SYSTEMCONFIGURATION_FRAMEWORK} + ${IOKIT_FRAMEWORK} + ${OPENGL_FRAMEWORK}) + + ADD_QT_PLUGIN(printsupport cocoaprintersupport) + ADD_QT_PLUGIN(platforms qcocoa) + ADD_QT_LIBRARY(PlatformSupport) + ELSE() + # order is very important there + ADD_QT_PLUGIN(platforms qxcb) + ADD_QT_PLUGIN(xcbglintegrations qxcb-glx-integration) + + ADD_QT_LIBRARY(XcbQpa) + ADD_QT_LIBRARY(GlxSupport) + ADD_QT_LIBRARY(ServiceSupport) + ADD_QT_LIBRARY(EdidSupport) + ADD_QT_LIBRARY(FontDatabaseSupport) + ADD_QT_LIBRARY(ThemeSupport) + ADD_QT_LIBRARY(EventDispatcherSupport) + ADD_QT_LIBRARY(PlatformSupport) + + ADD_QT_LIBRARY(DBus) + + IF(EXISTS "${QT_LIBRARY_DIR}/libxcb-static.a") + LIST(APPEND QT_LIBRARIES "${QT_LIBRARY_DIR}/libxcb-static.a") + ENDIF() + + # always link these in dynamic, API never changes + ADD_QT_SYSTEM_LIBRARY(X11) + ADD_QT_SYSTEM_LIBRARY(Xmu) + ADD_QT_SYSTEM_LIBRARY(X11-xcb) + ADD_QT_SYSTEM_LIBRARY(Xi) + ADD_QT_SYSTEM_LIBRARY(SM) + ADD_QT_SYSTEM_LIBRARY(ICE) + ADD_QT_SYSTEM_LIBRARY(xcb) + ADD_QT_SYSTEM_LIBRARY(GL) + ADD_QT_SYSTEM_LIBRARY(xcb-glx) + ADD_QT_SYSTEM_LIBRARY(fontconfig) + ADD_QT_SYSTEM_LIBRARY(Xrender) + ENDIF() + + ADD_QT_PLUGIN(imageformats qgif) + ADD_QT_PLUGIN(imageformats qicns) + ADD_QT_PLUGIN(imageformats qico) + ADD_QT_PLUGIN(imageformats qjpeg) + + # harfbuzz is needed since Qt 5.3 + IF(UNIX) + SET(HB_LIB "${QT_LIBRARY_DIR}/libqtharfbuzzng.a") + IF(NOT EXISTS ${HB_LIB}) + SET(HB_LIB "${QT_LIBRARY_DIR}/libqtharfbuzz.a") + ENDIF() + ELSEIF(WIN32) + SET(HB_LIB "${QT_LIBRARY_DIR}/qtharfbuzzng.lib") + ENDIF() + IF(EXISTS ${HB_LIB}) + LIST(APPEND QT_LIBRARIES ${HB_LIB}) + ENDIF() + + # freetype is needed since Qt 5.5 + FIND_PACKAGE(Freetype) + + IF(FREETYPE_FOUND) + LIST(APPEND QT_LIBRARIES ${FREETYPE_LIBRARIES}) + ELSE() + IF(UNIX) + SET(FREETYPE_LIB "${QT_LIBRARY_DIR}/libqtfreetype.a") + ELSEIF(WIN32) + SET(FREETYPE_LIB "${QT_LIBRARY_DIR}/qtfreetype.lib") + ENDIF() + IF(EXISTS ${FREETYPE_LIB}) + LIST(APPEND QT_LIBRARIES ${FREETYPE_LIB}) + ENDIF() + ENDIF() + + ADD_QT_PLUGIN(accessible qtaccessiblewidgets) + + LIST(APPEND QT_LIBRARIES ${PNG_LIBRARIES} ${JPEG_LIBRARY}) + + # Network + LIST(APPEND QT_LIBRARIES Qt5::Network Qt5::Xml) + LIST(APPEND QT_LIBRARIES ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES}) + + IF(WIN32) + LIST(APPEND QT_LIBRARIES + ${WINSDK_LIBRARY_DIR}/Crypt32.lib + ${WINSDK_LIBRARY_DIR}/WS2_32.Lib + ${WINSDK_LIBRARY_DIR}/IPHlpApi.Lib) + ENDIF() + + # Core + LIST(APPEND QT_LIBRARIES Qt5::Core) + + # pcre is needed since Qt 5.5 + IF(UNIX) + SET(PCRE_LIB "${QT_LIBRARY_DIR}/libqtpcre.a") + IF(NOT EXISTS ${PCRE_LIB}) + SET(PCRE_LIB "${QT_LIBRARY_DIR}/libqtpcre2.a") + ENDIF() + ELSEIF(WIN32) + SET(PCRE_LIB "${QT_LIBRARY_DIR}/qtpcre.lib") + ENDIF() + IF(EXISTS ${PCRE_LIB}) + LIST(APPEND QT_LIBRARIES ${PCRE_LIB}) + ENDIF() + + IF(APPLE) + FIND_LIBRARY(PCRE_LIBRARY pcre16 pcre) + + FIND_LIBRARY(SECURITY_FRAMEWORK Security) + + LIST(APPEND QT_LIBRARIES + ${PCRE_LIBRARY} + ${FOUNDATION_FRAMEWORK} + ${CARBON_FRAMEWORK} + ${SECURITY_FRAMEWORK}) + ELSEIF(UNIX) + FIND_PACKAGE(Threads) + LIST(APPEND QT_LIBRARIES ${ZLIB_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS} -lrt) + ENDIF() + ELSE() + SET(QT_LIBRARIES Qt5::Widgets Qt5::Network Qt5::Xml Qt5::Gui Qt5::OpenGL Qt5::Core) + ENDIF() + ELSE() + MESSAGE(WARNING "Unable to find Qt 5") + ENDIF() +ENDMACRO() diff --git a/code/CMakeModules/FindIconv.cmake b/code/CMakeModules/FindIconv.cmake index 5e9e48250..e96fe4054 100644 --- a/code/CMakeModules/FindIconv.cmake +++ b/code/CMakeModules/FindIconv.cmake @@ -1,4 +1,4 @@ -# - Try to find Iconv on Mac OS X +# - Try to find Iconv # Once done this will define # # ICONV_FOUND - system has Iconv @@ -6,78 +6,59 @@ # ICONV_LIBRARIES - Link these to use Iconv # ICONV_SECOND_ARGUMENT_IS_CONST - the second argument for iconv() is const # +include(CheckCCompilerFlag) +include(CheckCSourceCompiles) -IF(APPLE) - include(CheckCCompilerFlag) - include(CheckCSourceCompiles) - - IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) - # Already in cache, be silent - SET(ICONV_FIND_QUIETLY TRUE) - ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) - - IF(APPLE) - FIND_PATH(ICONV_INCLUDE_DIR iconv.h - PATHS - /opt/local/include/ - NO_CMAKE_SYSTEM_PATH - ) - - FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv c - PATHS - /opt/local/lib/ - NO_CMAKE_SYSTEM_PATH - ) - ENDIF(APPLE) - - FIND_PATH(ICONV_INCLUDE_DIR iconv.h PATHS /opt/local/include /sw/include) - - string(REGEX REPLACE "(.*)/include/?" "\\1" ICONV_INCLUDE_BASE_DIR "${ICONV_INCLUDE_DIR}") - - FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv c HINTS "${ICONV_INCLUDE_BASE_DIR}/lib" PATHS /opt/local/lib) - - IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) - SET(ICONV_FOUND TRUE) - ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) - - set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR}) - set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES}) - IF(ICONV_FOUND) - check_c_compiler_flag("-Werror" ICONV_HAVE_WERROR) - set (CMAKE_C_FLAGS_BACKUP "${CMAKE_C_FLAGS}") - if(ICONV_HAVE_WERROR) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") - endif(ICONV_HAVE_WERROR) - check_c_source_compiles(" - #include - int main(){ - iconv_t conv = 0; - const char* in = 0; - size_t ilen = 0; - char* out = 0; - size_t olen = 0; - iconv(conv, &in, &ilen, &out, &olen); - return 0; - } - " ICONV_SECOND_ARGUMENT_IS_CONST ) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BACKUP}") - ENDIF(ICONV_FOUND) - set(CMAKE_REQUIRED_INCLUDES) - set(CMAKE_REQUIRED_LIBRARIES) - - IF(ICONV_FOUND) - IF(NOT ICONV_FIND_QUIETLY) - MESSAGE(STATUS "Found Iconv: ${ICONV_LIBRARIES}") - ENDIF(NOT ICONV_FIND_QUIETLY) - ELSE(ICONV_FOUND) - IF(Iconv_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find Iconv") - ENDIF(Iconv_FIND_REQUIRED) - ENDIF(ICONV_FOUND) - - MARK_AS_ADVANCED( - ICONV_INCLUDE_DIR - ICONV_LIBRARIES - ICONV_SECOND_ARGUMENT_IS_CONST - ) -ENDIF(APPLE) +IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) + # Already in cache, be silent + SET(ICONV_FIND_QUIETLY TRUE) +ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) + +FIND_PATH(ICONV_INCLUDE_DIR iconv.h HINTS /sw/include/ PATHS /opt/local) + +FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv c PATHS /opt/local) + +IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) + SET(ICONV_FOUND TRUE) +ENDIF() + +set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR}) +set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES}) +IF(ICONV_FOUND) + check_c_compiler_flag("-Werror" ICONV_HAVE_WERROR) + set (CMAKE_C_FLAGS_BACKUP "${CMAKE_C_FLAGS}") + if(ICONV_HAVE_WERROR) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") + ENDIF() + check_c_source_compiles(" + #include + int main(){ + iconv_t conv = 0; + const char* in = 0; + size_t ilen = 0; + char* out = 0; + size_t olen = 0; + iconv(conv, &in, &ilen, &out, &olen); + return 0; + } +" ICONV_SECOND_ARGUMENT_IS_CONST ) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BACKUP}") +ENDIF() +set(CMAKE_REQUIRED_INCLUDES) +set(CMAKE_REQUIRED_LIBRARIES) + +IF(ICONV_FOUND) + IF(NOT ICONV_FIND_QUIETLY) + MESSAGE(STATUS "Found Iconv: ${ICONV_LIBRARIES}") + ENDIF() +ELSE() + IF(Iconv_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find Iconv") + ENDIF() +ENDIF() + +MARK_AS_ADVANCED( + ICONV_INCLUDE_DIR + ICONV_LIBRARIES + ICONV_SECOND_ARGUMENT_IS_CONST +) diff --git a/code/CMakeModules/FindJpeg.cmake b/code/CMakeModules/FindJpeg.cmake index 454f0fdc2..b77eba41b 100644 --- a/code/CMakeModules/FindJpeg.cmake +++ b/code/CMakeModules/FindJpeg.cmake @@ -7,7 +7,7 @@ IF(JPEG_LIBRARY AND JPEG_INCLUDE_DIR) # in cache already SET(JPEG_FIND_QUIETLY TRUE) -ENDIF(JPEG_LIBRARY AND JPEG_INCLUDE_DIR) +ENDIF() FIND_PATH(JPEG_INCLUDE_DIR @@ -42,9 +42,9 @@ 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) + ENDIF() +ELSE() IF(NOT JPEG_FIND_QUIETLY) MESSAGE(STATUS "Warning: Unable to find Jpeg!") - ENDIF(NOT JPEG_FIND_QUIETLY) -ENDIF(JPEG_LIBRARY AND JPEG_INCLUDE_DIR) + ENDIF() +ENDIF() diff --git a/code/CMakeModules/FindLibOVR.cmake b/code/CMakeModules/FindLibOVR.cmake index 1403a4b2c..081fa0bca 100644 --- a/code/CMakeModules/FindLibOVR.cmake +++ b/code/CMakeModules/FindLibOVR.cmake @@ -7,10 +7,11 @@ IF(LIBOVR_LIBRARIES AND LIBOVR_INCLUDE_DIR) # in cache already SET(LIBOVR_FIND_QUIETLY TRUE) -ENDIF(LIBOVR_LIBRARIES AND LIBOVR_INCLUDE_DIR) +ENDIF() FIND_PATH(LIBOVR_INCLUDE_DIR - OVR.h + NAMES + OVR.h OVR_CAPI.h PATHS $ENV{LIBOVR_DIR}/Include /usr/local/include @@ -24,21 +25,21 @@ FIND_PATH(LIBOVR_INCLUDE_DIR IF(UNIX) IF(TARGET_X64) SET(LIBOVR_LIBRARY_BUILD_PATH "Lib/Linux/Release/x86_64") - ELSE(TARGET_X64) + ELSE() SET(LIBOVR_LIBRARY_BUILD_PATH "Lib/Linux/Release/i386") - ENDIF(TARGET_X64) + ENDIF() ELSEIF(APPLE) SET(LIBOVR_LIBRARY_BUILD_PATH "Lib/MacOS/Release") ELSEIF(WIN32) IF(TARGET_X64) SET(LIBOVR_LIBRARY_BUILD_PATH "Lib/x64") - ELSE(TARGET_X64) + ELSE() SET(LIBOVR_LIBRARY_BUILD_PATH "Lib/Win32") - ENDIF(TARGET_X64) -ENDIF(UNIX) + ENDIF() +ENDIF() FIND_LIBRARY(LIBOVR_LIBRARY - NAMES ovr + NAMES ovr libovr PATHS $ENV{LIBOVR_DIR}/${LIBOVR_LIBRARY_BUILD_PATH} /usr/local/lib @@ -55,16 +56,17 @@ FIND_LIBRARY(LIBOVR_LIBRARY IF(LIBOVR_LIBRARY AND LIBOVR_INCLUDE_DIR) IF(NOT LIBOVR_FIND_QUIETLY) MESSAGE(STATUS "Found LibOVR: ${LIBOVR_LIBRARY}") - ENDIF(NOT LIBOVR_FIND_QUIETLY) + ENDIF() SET(LIBOVR_FOUND "YES") SET(LIBOVR_DEFINITIONS "-DHAVE_LIBOVR") + SET(NL_STEREO_AVAILABLE ON) IF(UNIX) SET(LIBOVR_LIBRARIES ${LIBOVR_LIBRARY} X11 Xinerama udev pthread) - ELSE(UNIX) + ELSE() SET(LIBOVR_LIBRARIES ${LIBOVR_LIBRARY}) - ENDIF(UNIX) -ELSE(LIBOVR_LIBRARY AND LIBOVR_INCLUDE_DIR) + ENDIF() +ELSE() IF(NOT LIBOVR_FIND_QUIETLY) MESSAGE(STATUS "Warning: Unable to find LibOVR!") - ENDIF(NOT LIBOVR_FIND_QUIETLY) -ENDIF(LIBOVR_LIBRARY AND LIBOVR_INCLUDE_DIR) + ENDIF() +ENDIF() diff --git a/code/CMakeModules/FindLibVR.cmake b/code/CMakeModules/FindLibVR.cmake index eba9c347e..5e9da0342 100644 --- a/code/CMakeModules/FindLibVR.cmake +++ b/code/CMakeModules/FindLibVR.cmake @@ -7,7 +7,7 @@ IF(LIBVR_LIBRARIES AND LIBVR_INCLUDE_DIR) # in cache already SET(LIBVR_FIND_QUIETLY TRUE) -ENDIF(LIBVR_LIBRARIES AND LIBVR_INCLUDE_DIR) +ENDIF() FIND_PATH(LIBVR_INCLUDE_DIR hmd.h PATH_SUFFIXES include/LibVR @@ -22,11 +22,12 @@ FIND_LIBRARY(LIBVR_LIBRARY IF(LIBVR_LIBRARY AND LIBVR_INCLUDE_DIR) IF(NOT LIBVR_FIND_QUIETLY) MESSAGE(STATUS "Found LibVR: ${LIBVR_LIBRARY}") - ENDIF(NOT LIBVR_FIND_QUIETLY) + ENDIF() SET(LIBVR_FOUND "YES") SET(LIBVR_DEFINITIONS "-DHAVE_LIBVR") -ELSE(LIBVR_LIBRARY AND LIBVR_INCLUDE_DIR) + SET(NL_STEREO_AVAILABLE ON) +ELSE() IF(NOT LIBVR_FIND_QUIETLY) MESSAGE(STATUS "Warning: Unable to find LibVR!") - ENDIF(NOT LIBVR_FIND_QUIETLY) -ENDIF(LIBVR_LIBRARY AND LIBVR_INCLUDE_DIR) + ENDIF() +ENDIF() diff --git a/code/CMakeModules/FindLibwww.cmake b/code/CMakeModules/FindLibwww.cmake deleted file mode 100644 index e742c6ae5..000000000 --- a/code/CMakeModules/FindLibwww.cmake +++ /dev/null @@ -1,190 +0,0 @@ -# -# Find the W3C libwww includes and library -# -# This module defines -# LIBWWW_INCLUDE_DIR, where to find tiff.h, etc. -# LIBWWW_LIBRARY, where to find the Libwww library. -# LIBWWW_FOUND, If false, do not try to use Libwww. - -OPTION(WITH_LIBWWW_STATIC "Use only static libraries for libwww" OFF) - -# also defined, but not for general use are -IF(LIBWWW_LIBRARIES AND LIBWWW_INCLUDE_DIR) - # in cache already - SET(Libwww_FIND_QUIETLY TRUE) -ENDIF(LIBWWW_LIBRARIES AND LIBWWW_INCLUDE_DIR) - -FIND_PATH(LIBWWW_INCLUDE_DIR - WWWInit.h - PATHS - /usr/local/include - /usr/include - /sw/include - /opt/local/include - /opt/csw/include - /opt/include - PATH_SUFFIXES libwww w3c-libwww -) - -# when installing libwww on mac os x using macports the file wwwconf.h resides -# in /opt/local/include and not in the real libwww include dir :/ -FIND_PATH(LIBWWW_ADDITIONAL_INCLUDE_DIR - wwwconf.h - PATHS - /usr/local/include - /usr/include - /sw/include - /opt/local/include - /opt/csw/include - /opt/include -) - -# combine both include directories into one variable -IF(LIBWWW_ADDITIONAL_INCLUDE_DIR) - SET(LIBWWW_INCLUDE_DIR ${LIBWWW_INCLUDE_DIR} ${LIBWWW_ADDITIONAL_INCLUDE_DIR}) -ENDIF(LIBWWW_ADDITIONAL_INCLUDE_DIR) - -# helper to find all the libwww sub libraries -MACRO(FIND_WWW_LIBRARY MYLIBRARY OPTION FILE) - IF(WITH_LIBWWW_STATIC AND UNIX AND NOT APPLE AND NOT WITH_STATIC_EXTERNAL) - SET(CMAKE_FIND_LIBRARY_SUFFIXES_OLD ${CMAKE_FIND_LIBRARY_SUFFIXES}) - SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a") - ENDIF(WITH_LIBWWW_STATIC AND UNIX AND NOT APPLE AND NOT WITH_STATIC_EXTERNAL) - - FIND_LIBRARY(${MYLIBRARY}_RELEASE - NAMES ${FILE} - PATHS - /usr/local/lib - /usr/lib - /usr/lib/x86_64-linux-gnu - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 - ) - - FIND_LIBRARY(${MYLIBRARY}_DEBUG - NAMES ${FILE}d - PATHS - /usr/local/lib - /usr/lib - /usr/lib/x86_64-linux-gnu - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 - ) - - IF(CMAKE_FIND_LIBRARY_SUFFIXES_OLD) - SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_OLD}) - ENDIF(CMAKE_FIND_LIBRARY_SUFFIXES_OLD) - - IF(${MYLIBRARY}_RELEASE AND ${MYLIBRARY}_DEBUG) - IF(${OPTION} STREQUAL REQUIRED OR WITH_STATIC OR WITH_LIBWWW_STATIC) - SET(LIBWWW_LIBRARIES ${LIBWWW_LIBRARIES} optimized ${${MYLIBRARY}_RELEASE} debug ${${MYLIBRARY}_DEBUG}) - ENDIF(${OPTION} STREQUAL REQUIRED OR WITH_STATIC OR WITH_LIBWWW_STATIC) - ELSEIF(${MYLIBRARY}_RELEASE) - IF(${OPTION} STREQUAL REQUIRED OR WITH_STATIC OR WITH_LIBWWW_STATIC) - SET(LIBWWW_LIBRARIES ${LIBWWW_LIBRARIES} ${${MYLIBRARY}_RELEASE}) - ENDIF(${OPTION} STREQUAL REQUIRED OR WITH_STATIC OR WITH_LIBWWW_STATIC) - ELSEIF(${MYLIBRARY}_DEBUG) - IF(${OPTION} STREQUAL REQUIRED OR WITH_STATIC OR WITH_LIBWWW_STATIC) - SET(LIBWWW_LIBRARIES ${LIBWWW_LIBRARIES} ${${MYLIBRARY}_DEBUG}) - ENDIF(${OPTION} STREQUAL REQUIRED OR WITH_STATIC OR WITH_LIBWWW_STATIC) - ELSE(${MYLIBRARY}_RELEASE AND ${MYLIBRARY}_DEBUG) - IF(NOT Libwww_FIND_QUIETLY AND NOT WIN32) - MESSAGE(STATUS "Warning: Libwww: Library not found: ${MYLIBRARY}") - ENDIF(NOT Libwww_FIND_QUIETLY AND NOT WIN32) - ENDIF(${MYLIBRARY}_RELEASE AND ${MYLIBRARY}_DEBUG) - - MARK_AS_ADVANCED(${MYLIBRARY}_RELEASE ${MYLIBRARY}_DEBUG) -ENDMACRO(FIND_WWW_LIBRARY) - -MACRO(LINK_WWW_LIBRARY MYLIBRARY OTHERLIBRARY SYMBOL) - IF(NOT WITH_LIBWWW_STATIC AND NOT WITH_STATIC_EXTERNAL) - LINK_DEPENDS(LIBWWW_LIBRARIES ${MYLIBRARY} ${OTHERLIBRARY} ${SYMBOL}) - ENDIF(NOT WITH_LIBWWW_STATIC AND NOT WITH_STATIC_EXTERNAL) -ENDMACRO(LINK_WWW_LIBRARY) - -# Find and link required libs for static or dynamic -FIND_WWW_LIBRARY(LIBWWWAPP_LIBRARY REQUIRED wwwapp) # cache core file ftp gopher html http mime news stream telnet trans utils zip xml xmlparse -FIND_WWW_LIBRARY(LIBWWWCORE_LIBRARY REQUIRED wwwcore) # utils -FIND_WWW_LIBRARY(LIBWWWFILE_LIBRARY REQUIRED wwwfile) # core trans utils html -FIND_WWW_LIBRARY(LIBWWWHTML_LIBRARY REQUIRED wwwhtml) # core utils -FIND_WWW_LIBRARY(LIBWWWHTTP_LIBRARY REQUIRED wwwhttp) # md5 core mime stream utils -FIND_WWW_LIBRARY(LIBWWWMIME_LIBRARY REQUIRED wwwmime) # core cache stream utils - -# Required for static or if underlinking -FIND_WWW_LIBRARY(LIBWWWCACHE_LIBRARY OPTIONAL wwwcache) # core trans utils -FIND_WWW_LIBRARY(LIBWWWSTREAM_LIBRARY OPTIONAL wwwstream) # core file utils - -FIND_WWW_LIBRARY(LIBWWWTRANS_LIBRARY REQUIRED wwwtrans) # core utils -FIND_WWW_LIBRARY(LIBWWWUTILS_LIBRARY REQUIRED wwwutils) - - -# Required only if underlinking - -# Unused protocols -FIND_WWW_LIBRARY(LIBWWWFTP_LIBRARY OPTIONAL wwwftp) # core file utils -FIND_WWW_LIBRARY(LIBWWWGOPHER_LIBRARY OPTIONAL wwwgopher) # core html utils file -FIND_WWW_LIBRARY(LIBWWWNEWS_LIBRARY OPTIONAL wwwnews) # core html mime stream utils -FIND_WWW_LIBRARY(LIBWWWTELNET_LIBRARY OPTIONAL wwwtelnet) # core utils - -# Other used by app -FIND_WWW_LIBRARY(LIBWWWDIR_LIBRARY OPTIONAL wwwdir) # file -FIND_WWW_LIBRARY(LIBWWWINIT_LIBRARY OPTIONAL wwwinit) # app cache core file html utils -FIND_WWW_LIBRARY(LIBWWWMUX_LIBRARY OPTIONAL wwwmux) # core stream trans utils -FIND_WWW_LIBRARY(LIBWWWXML_LIBRARY OPTIONAL wwwxml) # core utils xmlparse -FIND_WWW_LIBRARY(LIBWWWZIP_LIBRARY OPTIONAL wwwzip) # core utils -FIND_WWW_LIBRARY(LIBXMLPARSE_LIBRARY OPTIONAL xmlparse) # xmltok - -# Other used by other -FIND_WWW_LIBRARY(LIBXMLTOK_LIBRARY OPTIONAL xmltok) -FIND_WWW_LIBRARY(LIBWWWSSL_LIBRARY OPTIONAL wwwssl) -FIND_WWW_LIBRARY(LIBMD5_LIBRARY OPTIONAL md5) -FIND_WWW_LIBRARY(LIBPICS_LIBRARY OPTIONAL pics) - -# Other external libraries -FIND_PACKAGE(EXPAT QUIET) -FIND_PACKAGE(OpenSSL QUIET) -FIND_WWW_LIBRARY(LIBREGEX_LIBRARY OPTIONAL gnu_regex) - -# Now link all libs together -LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWCACHE_LIBRARY HTLoadCache) -LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWCACHE_LIBRARY HTCacheAppend) -LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWFTP_LIBRARY HTLoadFTP) -LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWGOPHER_LIBRARY HTLoadGopher) -LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWNEWS_LIBRARY HTLoadNews) -LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWTELNET_LIBRARY HTLoadTelnet) - -LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWSTREAM_LIBRARY HTStreamToChunk) -LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWSTREAM_LIBRARY HTGuess_new) -LINK_WWW_LIBRARY(LIBWWWFILE_LIBRARY LIBWWWDIR_LIBRARY HTDir_new) -LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWINIT_LIBRARY HTProtocolInit) -LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWXML_LIBRARY HTXML_new) -LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWZIP_LIBRARY HTZLib_inflate) - -# libwwwxml can be linked to xmlparse or expat -LINK_WWW_LIBRARY(LIBWWWXML_LIBRARY LIBXMLPARSE_LIBRARY XML_ParserCreate) - -IF(LIBXMLPARSE_LIBRARY_LINKED) - LINK_WWW_LIBRARY(LIBXMLPARSE_LIBRARY EXPAT_LIBRARY XmlInitEncoding) -ELSE(LIBXMLPARSE_LIBRARY_LINKED) - LINK_WWW_LIBRARY(LIBWWWXML_LIBRARY EXPAT_LIBRARY XML_ParserCreate) -ENDIF(LIBXMLPARSE_LIBRARY_LINKED) - -LINK_WWW_LIBRARY(LIBWWWHTTP_LIBRARY LIBMD5_LIBRARY MD5Init) -LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBREGEX_LIBRARY regexec) -LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY OPENSSL_LIBRARIES SSL_new) - -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Libwww DEFAULT_MSG - LIBWWW_LIBRARIES - LIBWWW_INCLUDE_DIR -) diff --git a/code/CMakeModules/FindLua53.cmake b/code/CMakeModules/FindLua53.cmake new file mode 100644 index 000000000..012f27c3f --- /dev/null +++ b/code/CMakeModules/FindLua53.cmake @@ -0,0 +1,81 @@ +# Locate Lua library +# This module defines +# LUA53_FOUND, if false, do not try to link to Lua +# LUA_LIBRARIES +# LUA_INCLUDE_DIR, where to find lua.h +# LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8) +# +# Note that the expected include convention is +# #include "lua.h" +# and not +# #include +# This is because, the lua location is not standardized and may exist +# in locations other than lua/ + +#============================================================================= +# Copyright 2007-2009 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +find_path(LUA_INCLUDE_DIR lua.h + HINTS + ENV LUA_DIR + PATH_SUFFIXES include/lua53 include/lua5.3 include/lua-5.3 include/lua include + PATHS + ~/Library/Frameworks + /Library/Frameworks + /sw # Fink + /opt/local # DarwinPorts + /opt/csw # Blastwave + /opt +) + +find_library(LUA_LIBRARY + NAMES lua53 lua5.3 lua-5.3 lua + HINTS + ENV LUA_DIR + PATH_SUFFIXES lib + PATHS + ~/Library/Frameworks + /Library/Frameworks + /sw + /opt/local + /opt/csw + /opt +) + +if(LUA_LIBRARY) + # include the math library for Unix + if(UNIX AND NOT APPLE AND NOT BEOS) + find_library(LUA_MATH_LIBRARY m) + set( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries") + # For Windows and Mac, don't need to explicitly include the math library + else() + set( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries") + endif() +endif() + +if(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h") + file(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"") + + string(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}") + unset(lua_version_str) +endif() + +include(FindPackageHandleStandardArgs) +# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if +# all listed variables are TRUE +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua53 + REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR + VERSION_VAR LUA_VERSION_STRING) + +mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY) + diff --git a/code/CMakeModules/FindLuabind.cmake b/code/CMakeModules/FindLuabind.cmake index f61885be8..5511379a3 100644 --- a/code/CMakeModules/FindLuabind.cmake +++ b/code/CMakeModules/FindLuabind.cmake @@ -9,47 +9,81 @@ MACRO(FIND_CORRECT_LUA_VERSION) IF(LUABIND_LIBRARY_RELEASE MATCHES "\\.so") INCLUDE(CheckDepends) - SET(LUA52_LIBRARY "liblua5.2") - CHECK_LINKED_LIBRARY(LUABIND_LIBRARY_RELEASE LUA52_LIBRARY LUALIB_FOUND) - - IF(LUALIB_FOUND) - MESSAGE(STATUS "Luabind is using Lua 5.2") - FIND_PACKAGE(Lua52 REQUIRED) - ELSE(LUALIB_FOUND) - SET(LUA51_LIBRARY "liblua5.1") - CHECK_LINKED_LIBRARY(LUABIND_LIBRARY_RELEASE LUA51_LIBRARY LUALIB_FOUND) + # check for Lua 5.3 + SET(LUA53_LIBRARIES liblua5.3 liblua-5.3 liblua.so.5.3) + FOREACH(_LIB ${LUA53_LIBRARIES}) + CHECK_LINKED_LIBRARY(LUABIND_LIBRARY_RELEASE _LIB LUALIB_FOUND) IF(LUALIB_FOUND) - MESSAGE(STATUS "Luabind is using Lua 5.1") - FIND_PACKAGE(Lua51 REQUIRED) - ELSE(LUALIB_FOUND) - SET(LUA50_LIBRARY "liblua5.0") - CHECK_LINKED_LIBRARY(LUABIND_LIBRARY_RELEASE LUA50_LIBRARY LUALIB_FOUND) - + MESSAGE(STATUS "Luabind is using Lua 5.3") + FIND_PACKAGE(Lua53 REQUIRED) + BREAK() + ENDIF() + ENDFOREACH() + + IF(NOT LUALIB_FOUND) + # check for Lua 5.2 + SET(LUA52_LIBRARIES liblua5.2 liblua-5.2 liblua.so.5.2) + + FOREACH(_LIB ${LUA52_LIBRARIES}) + CHECK_LINKED_LIBRARY(LUABIND_LIBRARY_RELEASE _LIB LUALIB_FOUND) + IF(LUALIB_FOUND) + MESSAGE(STATUS "Luabind is using Lua 5.2") + FIND_PACKAGE(Lua52 REQUIRED) + BREAK() + ENDIF() + ENDFOREACH() + ENDIF() + + IF(NOT LUALIB_FOUND) + # check for Lua 5.1 + SET(LUA51_LIBRARIES liblua5.1 liblua-5.1 liblua.so.5.1) + + FOREACH(_LIB ${LUA51_LIBRARIES}) + CHECK_LINKED_LIBRARY(LUABIND_LIBRARY_RELEASE _LIB LUALIB_FOUND) + IF(LUALIB_FOUND) + MESSAGE(STATUS "Luabind is using Lua 5.1") + FIND_PACKAGE(Lua51 REQUIRED) + BREAK() + ENDIF() + ENDFOREACH() + ENDIF() + + IF(NOT LUALIB_FOUND) + # check for Lua 5.0 + SET(LUA50_LIBRARIES liblua5.0 liblua-5.0 liblua.so.5.0) + + FOREACH(_LIB ${LUA50_LIBRARIES}) + CHECK_LINKED_LIBRARY(LUABIND_LIBRARY_RELEASE _LIB LUALIB_FOUND) IF(LUALIB_FOUND) MESSAGE(STATUS "Luabind is using Lua 5.0") FIND_PACKAGE(Lua50 REQUIRED) - ELSE(LUALIB_FOUND) - MESSAGE(FATAL_ERROR "Can't determine Lua version used by Luabind") - ENDIF(LUALIB_FOUND) - ENDIF(LUALIB_FOUND) - ENDIF(LUALIB_FOUND) - ELSE(LUABIND_LIBRARY_RELEASE MATCHES "\\.so") + BREAK() + ENDIF() + ENDFOREACH() + ENDIF() + + IF(NOT LUALIB_FOUND) + MESSAGE(FATAL_ERROR "Can't determine Lua version used by Luabind") + ENDIF() + ELSE() # TODO: find a way to detect Lua version - IF(WITH_LUA52) + IF(WITH_LUA53) + FIND_PACKAGE(Lua53 REQUIRED) + ELSEIF(WITH_LUA52) FIND_PACKAGE(Lua52 REQUIRED) ELSEIF(WITH_LUA51) FIND_PACKAGE(Lua51 REQUIRED) - ELSE(WITH_LUA52) + ELSE() FIND_PACKAGE(Lua50 REQUIRED) - ENDIF(WITH_LUA52) - ENDIF(LUABIND_LIBRARY_RELEASE MATCHES "\\.so") -ENDMACRO(FIND_CORRECT_LUA_VERSION) + ENDIF() + ENDIF() +ENDMACRO() IF(LUABIND_LIBRARIES AND LUABIND_INCLUDE_DIR) # in cache already SET(Luabind_FIND_QUIETLY TRUE) -ENDIF(LUABIND_LIBRARIES AND LUABIND_INCLUDE_DIR) +ENDIF() FIND_PATH(LUABIND_INCLUDE_DIR luabind/luabind.hpp @@ -63,13 +97,57 @@ FIND_PATH(LUABIND_INCLUDE_DIR /opt/include ) -SET(LIBRARY_NAME_RELEASE luabind libluabind) -SET(LIBRARY_NAME_DEBUG luabind_d luabindd libluabind_d libluabindd) +SET(LIBRARY_NAME_RELEASE) +SET(LIBRARY_NAME_DEBUG) + +IF(WITH_LUA53) + IF(WITH_STLPORT) + LIST(APPEND LIBRARY_NAME_RELEASE luabind_stlport_lua53) + LIST(APPEND LIBRARY_NAME_DEBUG luabind_stlport_lua53d) + ENDIF() + + LIST(APPEND LIBRARY_NAME_RELEASE luabind_lua53) + LIST(APPEND LIBRARY_NAME_DEBUG luabind_lua53d) +ENDIF() + +IF(WITH_LUA52) + IF(WITH_STLPORT) + LIST(APPEND LIBRARY_NAME_RELEASE luabind_stlport_lua52) + LIST(APPEND LIBRARY_NAME_DEBUG luabind_stlport_lua52d) + ENDIF() + + LIST(APPEND LIBRARY_NAME_RELEASE luabind_lua52) + LIST(APPEND LIBRARY_NAME_DEBUG luabind_lua52d) +ENDIF() + +IF(WITH_LUA51) + IF(WITH_STLPORT) + LIST(APPEND LIBRARY_NAME_RELEASE luabind_stlport_lua51) + LIST(APPEND LIBRARY_NAME_DEBUG luabind_stlport_lua51d) + ENDIF() + + LIST(APPEND LIBRARY_NAME_RELEASE luabind_lua51) + LIST(APPEND LIBRARY_NAME_DEBUG luabind_lua51d) +ENDIF() + +IF(WITH_LUA50) + IF(WITH_STLPORT) + LIST(APPEND LIBRARY_NAME_RELEASE luabind_stlport_lua50) + LIST(APPEND LIBRARY_NAME_DEBUG luabind_stlport_lua50d) + ENDIF() + + LIST(APPEND LIBRARY_NAME_RELEASE luabind_lua50) + LIST(APPEND LIBRARY_NAME_DEBUG luabind_lua50d) +ENDIF() IF(WITH_STLPORT) - SET(LIBRARY_NAME_RELEASE luabind_stlport ${LIBRARY_NAME_RELEASE}) - SET(LIBRARY_NAME_DEBUG luabind_stlportd ${LIBRARY_NAME_DEBUG}) -ENDIF(WITH_STLPORT) + LIST(APPEND LIBRARY_NAME_RELEASE luabind_stlport) + LIST(APPEND LIBRARY_NAME_DEBUG luabind_stlportd) +ENDIF() + +# generic libraries names +LIST(APPEND LIBRARY_NAME_RELEASE luabind libluabind) +LIST(APPEND LIBRARY_NAME_DEBUG luabind_d luabindd libluabind_d libluabindd) FIND_LIBRARY(LUABIND_LIBRARY_RELEASE NAMES ${LIBRARY_NAME_RELEASE} @@ -116,8 +194,8 @@ IF(LUABIND_INCLUDE_DIR AND Boost_INCLUDE_DIR) # Case where Luabind is compiled from sources (debug version is compiled by default) SET(LUABIND_FOUND TRUE) SET(LUABIND_LIBRARIES ${LUABIND_LIBRARY_DEBUG}) - ENDIF(LUABIND_LIBRARY_RELEASE AND LUABIND_LIBRARY_DEBUG) -ENDIF(LUABIND_INCLUDE_DIR AND Boost_INCLUDE_DIR) + ENDIF() +ENDIF() IF(LUABIND_FOUND) SET(LUABIND_INCLUDE_DIR ${LUABIND_INCLUDE_DIR} ${Boost_INCLUDE_DIR}) @@ -125,17 +203,17 @@ IF(LUABIND_FOUND) FIND_FILE(LUABIND_VERSION_FILE luabind/version.hpp PATHS ${LUABIND_INCLUDE_DIR}) IF(LUABIND_VERSION_FILE) SET(LUABIND_DEFINITIONS "-DHAVE_LUABIND_VERSION") - ENDIF(LUABIND_VERSION_FILE) + ENDIF() FIND_CORRECT_LUA_VERSION() IF(NOT Luabind_FIND_QUIETLY) MESSAGE(STATUS "Found Luabind: ${LUABIND_LIBRARIES}") - ENDIF(NOT Luabind_FIND_QUIETLY) -ELSE(LUABIND_FOUND) + ENDIF() +ELSE() IF(NOT Luabind_FIND_QUIETLY) MESSAGE(STATUS "Warning: Unable to find Luabind!") - ENDIF(NOT Luabind_FIND_QUIETLY) -ENDIF(LUABIND_FOUND) + ENDIF() +ENDIF() MARK_AS_ADVANCED(LUABIND_LIBRARY_RELEASE LUABIND_LIBRARY_DEBUG Boost_LIB_DIAGNOSTIC_DEFINITIONS) diff --git a/code/CMakeModules/FindMSVC.cmake b/code/CMakeModules/FindMSVC.cmake index 16455b02d..5dbc4f6a8 100644 --- a/code/CMakeModules/FindMSVC.cmake +++ b/code/CMakeModules/FindMSVC.cmake @@ -5,6 +5,24 @@ # VC_LIBRARY_DIR - where to find libraries # VC_FOUND - True if MSVC found. +MACRO(ADD_TRAILING_SLASH _FILENAME_VAR) + # put content in a new variable + SET(_FILENAME ${${_FILENAME_VAR}}) + # get length of the string + STRING(LENGTH ${_FILENAME} _LEN) + # convert length to last pos + MATH(EXPR _POS "${_LEN}-1") + # get last character of the string + STRING(SUBSTRING ${_FILENAME} ${_POS} 1 _FILENAME_END) + # compare it with a slash + IF(NOT _FILENAME_END STREQUAL "/") + # not a slash, append it + SET(${_FILENAME_VAR} "${_FILENAME}/") + ELSE() + # already a slash + ENDIF() +ENDMACRO() + MACRO(DETECT_VC_VERSION_HELPER _ROOT _VERSION) # Software/Wow6432Node/... GET_FILENAME_COMPONENT(VC${_VERSION}_DIR "[${_ROOT}\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;${_VERSION}]" ABSOLUTE) @@ -12,10 +30,14 @@ MACRO(DETECT_VC_VERSION_HELPER _ROOT _VERSION) IF(VC${_VERSION}_DIR AND VC${_VERSION}_DIR STREQUAL "/registry") SET(VC${_VERSION}_DIR) GET_FILENAME_COMPONENT(VC${_VERSION}_DIR "[${_ROOT}\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7;${_VERSION}]" ABSOLUTE) + IF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry") + # be sure it's finishing by a / + ADD_TRAILING_SLASH(VC${_VERSION}_DIR) + SET(VC${_VERSION}_DIR "${VC${_VERSION}_DIR}VC/") - ENDIF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry") - ENDIF(VC${_VERSION}_DIR AND VC${_VERSION}_DIR STREQUAL "/registry") + ENDIF() + ENDIF() IF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry") SET(VC${_VERSION}_FOUND ON) @@ -24,73 +46,137 @@ MACRO(DETECT_VC_VERSION_HELPER _ROOT _VERSION) SET(_VERSION_STR ${_VERSION}) IF(MSVC_EXPRESS) SET(_VERSION_STR "${_VERSION_STR} Express") - ENDIF(MSVC_EXPRESS) + ENDIF() MESSAGE(STATUS "Found Visual C++ ${_VERSION_STR} in ${VC${_VERSION}_DIR}") - ENDIF(NOT MSVC_FIND_QUIETLY) + ENDIF() ELSEIF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry") SET(VC${_VERSION}_FOUND OFF) SET(VC${_VERSION}_DIR "") - ENDIF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry") -ENDMACRO(DETECT_VC_VERSION_HELPER) + ENDIF() +ENDMACRO() MACRO(DETECT_VC_VERSION _VERSION) - SET(VC${_VERSION}_FOUND OFF) - DETECT_VC_VERSION_HELPER("HKEY_CURRENT_USER" ${_VERSION}) + IF(NOT VC_FOUND) + SET(VC${_VERSION}_FOUND OFF) + DETECT_VC_VERSION_HELPER("HKEY_CURRENT_USER" ${_VERSION}) - IF(NOT VC${_VERSION}_FOUND) - DETECT_VC_VERSION_HELPER("HKEY_LOCAL_MACHINE" ${_VERSION}) - ENDIF(NOT VC${_VERSION}_FOUND) + IF(NOT VC${_VERSION}_FOUND) + DETECT_VC_VERSION_HELPER("HKEY_LOCAL_MACHINE" ${_VERSION}) + ENDIF() - IF(VC${_VERSION}_FOUND) - SET(VC_FOUND ON) - SET(VC_DIR "${VC${_VERSION}_DIR}") - ENDIF(VC${_VERSION}_FOUND) -ENDMACRO(DETECT_VC_VERSION) + IF(VC${_VERSION}_FOUND) + SET(VC_FOUND ON) + SET(VC_DIR "${VC${_VERSION}_DIR}") + ENDIF() + ENDIF() +ENDMACRO() MACRO(DETECT_EXPRESS_VERSION _VERSION) GET_FILENAME_COMPONENT(MSVC_EXPRESS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\${_VERSION}\\Setup\\VC;ProductDir]" ABSOLUTE) IF(MSVC_EXPRESS AND NOT MSVC_EXPRESS STREQUAL "/registry") SET(MSVC_EXPRESS ON) - ENDIF(MSVC_EXPRESS AND NOT MSVC_EXPRESS STREQUAL "/registry") -ENDMACRO(DETECT_EXPRESS_VERSION) + ENDIF() +ENDMACRO() -IF(MSVC12) - DETECT_VC_VERSION("12.0") +IF(MSVC_VERSION GREATER 1909) + DETECT_VC_VERSION("15.0") + SET(MSVC_TOOLSET "140") - IF(NOT MSVC12_REDIST_DIR) - # If you have VC++ 2013 Express, put x64/Microsoft.VC120.CRT/*.dll in ${EXTERNAL_PATH}/redist - SET(MSVC12_REDIST_DIR "${EXTERNAL_PATH}/redist") - ENDIF(NOT MSVC11_REDIST_DIR) + SET(VC_DIR "${VC_DIR}Tools/MSVC") + + FILE(GLOB MSVC_TOOLCHAIN_VERSIONS RELATIVE ${VC_DIR} "${VC_DIR}/*") + + IF(MSVC_TOOLCHAIN_VERSIONS) + LIST(SORT MSVC_TOOLCHAIN_VERSIONS) + LIST(REVERSE MSVC_TOOLCHAIN_VERSIONS) + ENDIF() + + IF(NOT MSVC_TOOLCHAIN_VERSIONS) + MESSAGE(FATAL_ERROR "No MSVC version found in default search path ${VC_DIR}") + ENDIF() + + LIST(GET MSVC_TOOLCHAIN_VERSIONS 0 MSVC_TOOLCHAIN_VERSION) + + SET(VC_DIR "${VC_DIR}/${MSVC_TOOLCHAIN_VERSION}") + SET(VC_INCLUDE_DIR "${VC_DIR}/include") +ELSEIF(MSVC14) + DETECT_VC_VERSION("14.0") + SET(MSVC_TOOLSET "140") +ELSEIF(MSVC12) + DETECT_VC_VERSION("12.0") + SET(MSVC_TOOLSET "120") ELSEIF(MSVC11) DETECT_VC_VERSION("11.0") - - IF(NOT MSVC11_REDIST_DIR) - # If you have VC++ 2012 Express, put x64/Microsoft.VC110.CRT/*.dll in ${EXTERNAL_PATH}/redist - SET(MSVC11_REDIST_DIR "${EXTERNAL_PATH}/redist") - ENDIF(NOT MSVC11_REDIST_DIR) + SET(MSVC_TOOLSET "110") ELSEIF(MSVC10) DETECT_VC_VERSION("10.0") - - IF(NOT MSVC10_REDIST_DIR) - # If you have VC++ 2010 Express, put x64/Microsoft.VC100.CRT/*.dll in ${EXTERNAL_PATH}/redist - SET(MSVC10_REDIST_DIR "${EXTERNAL_PATH}/redist") - ENDIF(NOT MSVC10_REDIST_DIR) + SET(MSVC_TOOLSET "100") ELSEIF(MSVC90) DETECT_VC_VERSION("9.0") + SET(MSVC_TOOLSET "90") ELSEIF(MSVC80) DETECT_VC_VERSION("8.0") -ENDIF(MSVC12) + SET(MSVC_TOOLSET "80") +ENDIF() # If you plan to use VC++ compilers with WINE, set VC_DIR environment variable IF(NOT VC_DIR) SET(VC_DIR $ENV{VC_DIR}) -ENDIF(NOT VC_DIR) + # Fix path + FILE(TO_CMAKE_PATH ${VC_DIR} VC_DIR) +ENDIF() IF(NOT VC_DIR) - STRING(REGEX REPLACE "/bin/.+" "" VC_DIR ${CMAKE_CXX_COMPILER}) -ENDIF(NOT VC_DIR) + IF(CMAKE_CXX_COMPILER) + SET(_COMPILER ${CMAKE_CXX_COMPILER}) + ELSE() + SET(_COMPILER ${CMAKE_C_COMPILER}) + ENDIF() + STRING(REGEX REPLACE "/(bin|BIN|Bin)/.+" "" VC_DIR ${_COMPILER}) +ENDIF() + +IF(NOT VC_INCLUDE_DIR AND VC_DIR AND EXISTS "${VC_DIR}") + SET(VC_INCLUDE_DIR "${VC_DIR}/include") + IF(EXISTS "${VC_INCLUDE_DIR}") + SET(VC_FOUND ON) + ENDIF() +ENDIF() + +SET(MSVC_REDIST_DIR "${EXTERNAL_PATH}/redist") + +IF(NOT EXISTS "${MSVC_REDIST_DIR}") + SET(MSVC_REDIST_DIR "${VC_DIR}/redist") + + IF(NOT EXISTS "${MSVC_REDIST_DIR}") + SET(MSVC_REDIST_DIR) + ENDIF() +ENDIF() + +IF(MSVC_REDIST_DIR) + IF(MSVC1411 OR MSVC1410) + # If you have VC++ 2017 Express, put x64/Microsoft.VC141.CRT/*.dll in ${EXTERNAL_PATH}/redist + # original files whould be in ${VC_DIR}/Redist/MSVC/14.11.25325/x64/Microsoft.VC141.CRT + SET(MSVC14_REDIST_DIR "${MSVC_REDIST_DIR}") + ELSEIF(MSVC14) + SET(MSVC14_REDIST_DIR "${MSVC_REDIST_DIR}") + ELSEIF(MSVC12) + # If you have VC++ 2013 Express, put x64/Microsoft.VC120.CRT/*.dll in ${EXTERNAL_PATH}/redist + SET(MSVC12_REDIST_DIR "${MSVC_REDIST_DIR}") + ELSEIF(MSVC11) + # If you have VC++ 2012 Express, put x64/Microsoft.VC110.CRT/*.dll in ${EXTERNAL_PATH}/redist + SET(MSVC11_REDIST_DIR "${MSVC_REDIST_DIR}") + ELSEIF(MSVC10) + # If you have VC++ 2010 Express, put x64/Microsoft.VC100.CRT/*.dll in ${EXTERNAL_PATH}/redist + SET(MSVC10_REDIST_DIR "${MSVC_REDIST_DIR}") + ELSEIF(MSVC90) + SET(MSVC90_REDIST_DIR "${MSVC_REDIST_DIR}") + ELSEIF(MSVC80) + SET(MSVC80_REDIST_DIR "${MSVC_REDIST_DIR}") + ENDIF() +ENDIF() + +MESSAGE(STATUS "Using headers from ${VC_INCLUDE_DIR}") -SET(VC_INCLUDE_DIR "${VC_DIR}/include") SET(VC_INCLUDE_DIRS ${VC_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${VC_INCLUDE_DIR}) diff --git a/code/CMakeModules/FindMercurial.cmake b/code/CMakeModules/FindMercurial.cmake index dbb2110ff..4e6429357 100644 --- a/code/CMakeModules/FindMercurial.cmake +++ b/code/CMakeModules/FindMercurial.cmake @@ -31,7 +31,7 @@ # MESSAGE("Current revision is ${Project_WC_REVISION}") # Mercurial_WC_LOG(${PROJECT_SOURCE_DIR} Project) # MESSAGE("Last changed log is ${Project_LAST_CHANGED_LOG}") -# ENDIF(MERCURIAL_FOUND) +# ENDIF() #============================================================================= # Copyright 2006-2009 Kitware, Inc. @@ -60,12 +60,12 @@ IF(Mercurial_HG_EXECUTABLE) EXECUTE_PROCESS(COMMAND ${Mercurial_HG_EXECUTABLE} --version OUTPUT_VARIABLE Mercurial_VERSION_HG OUTPUT_STRIP_TRAILING_WHITESPACE) - + STRING(REGEX REPLACE ".*version ([\\.0-9]+).*" "\\1" Mercurial_VERSION_HG "${Mercurial_VERSION_HG}") MACRO(Mercurial_WC_INFO dir prefix) - EXECUTE_PROCESS(COMMAND ${Mercurial_HG_EXECUTABLE} tip --template "{rev};{node};{tags};{author}" + EXECUTE_PROCESS(COMMAND ${Mercurial_HG_EXECUTABLE} log -r . --template "{rev};{node};{tags};{author}" WORKING_DIRECTORY ${dir} OUTPUT_VARIABLE ${prefix}_WC_INFO ERROR_VARIABLE Mercurial_hg_info_error @@ -73,23 +73,23 @@ IF(Mercurial_HG_EXECUTABLE) OUTPUT_STRIP_TRAILING_WHITESPACE) IF(NOT ${Mercurial_hg_info_result} EQUAL 0) - MESSAGE(SEND_ERROR "Command \"${Mercurial_HG_EXECUTABLE} tip\" failed with output:\n${Mercurial_hg_info_error}") - ELSE(NOT ${Mercurial_hg_info_result} EQUAL 0) + MESSAGE(SEND_ERROR "Command \"${Mercurial_HG_EXECUTABLE} log\" failed with output:\n${Mercurial_hg_info_error}") + ELSE() LIST(LENGTH ${prefix}_WC_INFO _COUNT) IF(_COUNT EQUAL 4) LIST(GET ${prefix}_WC_INFO 0 ${prefix}_WC_REVISION) LIST(GET ${prefix}_WC_INFO 1 ${prefix}_WC_CHANGESET) LIST(GET ${prefix}_WC_INFO 2 ${prefix}_WC_BRANCH) LIST(GET ${prefix}_WC_INFO 3 ${prefix}_WC_LAST_CHANGED_AUTHOR) - ELSE(_COUNT EQUAL 4) + ELSE() MESSAGE(STATUS "Bad output from HG") SET(${prefix}_WC_REVISION "unknown") SET(${prefix}_WC_CHANGESET "unknown") SET(${prefix}_WC_BRANCH "unknown") - ENDIF(_COUNT EQUAL 4) - ENDIF(NOT ${Mercurial_hg_info_result} EQUAL 0) + ENDIF() + ENDIF() - ENDMACRO(Mercurial_WC_INFO) + ENDMACRO() MACRO(Mercurial_WC_LOG dir prefix) # This macro can block if the certificate is not signed: @@ -105,9 +105,9 @@ IF(Mercurial_HG_EXECUTABLE) IF(NOT ${Mercurial_hg_log_result} EQUAL 0) MESSAGE(SEND_ERROR "Command \"${Mercurial_HG_EXECUTABLE} log -r BASE ${dir}\" failed with output:\n${Mercurial_hg_log_error}") - ENDIF(NOT ${Mercurial_hg_log_result} EQUAL 0) - ENDMACRO(Mercurial_WC_LOG) -ENDIF(Mercurial_HG_EXECUTABLE) + ENDIF() + ENDMACRO() +ENDIF() INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Mercurial DEFAULT_MSG Mercurial_HG_EXECUTABLE) diff --git a/code/CMakeModules/FindMySQL.cmake b/code/CMakeModules/FindMySQL.cmake index eb2102c8d..8a92cb0c4 100644 --- a/code/CMakeModules/FindMySQL.cmake +++ b/code/CMakeModules/FindMySQL.cmake @@ -13,13 +13,16 @@ IF(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES) SET(MYSQL_FOUND TRUE) -ELSE(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES) +ELSE() FIND_PATH(MYSQL_INCLUDE_DIR mysql.h PATH_SUFFIXES mysql + PATHS /usr/include/mysql /usr/local/include/mysql /opt/local/include/mysql5/mysql + /opt/local/include/mysql55/mysql + /opt/local/include/mysql51/mysql $ENV{ProgramFiles}/MySQL/*/include $ENV{SystemDrive}/MySQL/*/include) @@ -33,7 +36,7 @@ ELSE(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES) PATHS $ENV{ProgramFiles}/MySQL/*/lib/opt $ENV{SystemDrive}/MySQL/*/lib/opt) - ELSE(WIN32 AND MSVC) + ELSE() FIND_LIBRARY(MYSQL_LIBRARY_RELEASE NAMES mysqlclient PATHS /usr/lib @@ -41,6 +44,8 @@ ELSE(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES) /usr/lib/mysql /usr/local/lib/mysql /opt/local/lib/mysql5/mysql + /opt/local/lib/mysql55/mysql + /opt/local/lib/mysql51/mysql ) FIND_LIBRARY(MYSQL_LIBRARY_DEBUG NAMES mysqlclientd @@ -50,32 +55,36 @@ ELSE(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES) /usr/lib/mysql /usr/local/lib/mysql /opt/local/lib/mysql5/mysql + /opt/local/lib/mysql55/mysql + /opt/local/lib/mysql51/mysql ) - ENDIF(WIN32 AND MSVC) + ENDIF() IF(MYSQL_INCLUDE_DIR) IF(MYSQL_LIBRARY_RELEASE) - SET(MYSQL_LIBRARIES optimized ${MYSQL_LIBRARY_RELEASE}) IF(MYSQL_LIBRARY_DEBUG) - SET(MYSQL_LIBRARIES ${MYSQL_LIBRARIES} debug ${MYSQL_LIBRARY_DEBUG}) - ELSE(MYSQL_LIBRARY_DEBUG) - SET(MYSQL_LIBRARIES ${MYSQL_LIBRARIES} debug ${MYSQL_LIBRARY_RELEASE}) - ENDIF(MYSQL_LIBRARY_DEBUG) + SET(MYSQL_LIBRARIES optimized ${MYSQL_LIBRARY_RELEASE} debug ${MYSQL_LIBRARY_DEBUG}) + ELSE() + SET(MYSQL_LIBRARIES ${MYSQL_LIBRARY_RELEASE}) + ENDIF() FIND_PACKAGE(OpenSSL) IF(OPENSSL_FOUND) + IF(WIN32) + SET(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} Crypt32.lib) + ENDIF() SET(MYSQL_LIBRARIES ${MYSQL_LIBRARIES} ${OPENSSL_LIBRARIES}) - ENDIF(OPENSSL_FOUND) - ENDIF(MYSQL_LIBRARY_RELEASE) - ENDIF(MYSQL_INCLUDE_DIR) + ENDIF() + ENDIF() + ENDIF() IF(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES) SET(MYSQL_FOUND TRUE) MESSAGE(STATUS "Found MySQL: ${MYSQL_INCLUDE_DIR}, ${MYSQL_LIBRARIES}") - ELSE(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES) + ELSE() SET(MYSQL_FOUND FALSE) MESSAGE(STATUS "MySQL not found.") - ENDIF(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES) + ENDIF() MARK_AS_ADVANCED(MYSQL_LIBRARY_RELEASE MYSQL_LIBRARY_DEBUG) -ENDIF(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES) +ENDIF() diff --git a/code/CMakeModules/FindNeL.cmake b/code/CMakeModules/FindNeL.cmake new file mode 100644 index 000000000..e75163cce --- /dev/null +++ b/code/CMakeModules/FindNeL.cmake @@ -0,0 +1,398 @@ +# NEL_DIR can be specified as root directory + +# Returned variables +# NELDRIVER_XXX_BINARY_DEBUG +# NELDRIVER_XXX_BINARY_RELEASE +# NELDRIVER_XXX_LIBRARY_DEBUG +# NELDRIVER_XXX_LIBRARY_RELEASE +# NELDRIVER_XXX_FOUND +# NEL_DEFINITIONS +# NEL_INCLUDE_DIR +# NEL_INCLUDE_DIRS +# NEL_LIBRARIES +# NELXXX_FOUND +# NELXXX_LIBRARIES + + +INCLUDE(FindHelpers) + +# Init all variables we'll set +SET(NEL_LIBRARIES) +SET(NEL_INCLUDE_DIR) +SET(NEL_INCLUDE_DIRS) +SET(NEL_VERSION) +SET(NEL_STATIC) +SET(NEL_STATIC_DRIVERS) +SET(NEL_VERSION_MAJOR) +SET(NEL_VERSION_MINOR) +SET(NEL_VERSION_PATCH) +SET(NEL_REVISION) +SET(NEL_VERSION) + +SET(NEL_MODULES_FOUND) +SET(NEL_MODULES_AVAILABLE 3d georges gui ligo logic net pacs sound) # cegui pipeline + +SET(NEL_DRIVERS_FOUND) +SET(NEL_DRIVERS_AVAILABLE opengl opengles direct3d dsound fmod openal xaudio2) + +SET(NELMISC_FIND_REQUIRED ${NeL_FIND_REQUIRED}) + +# Force search of NELMISC +FIND_PACKAGE_HELPER(nelmisc nel/misc/types_nl.h RELEASE nelmisc_r nelmisc DEBUG nelmisc_d DIR ${NEL_DIR} VERBOSE QUIET) + +IF(NELMISC_FOUND) + # define NEL_DIR if not specified + IF(NOT NEL_DIR) + GET_FILENAME_COMPONENT(NEL_DIR ${NELMISC_INCLUDE_DIR}/.. ABSOLUTE) + ENDIF() + + # Aliases for include directory + SET(NEL_INCLUDE_DIR ${NELMISC_INCLUDE_DIR}) + SET(NEL_INCLUDE_DIRS ${NEL_INCLUDE_DIR}) + + MESSAGE(STATUS "Found NeL headers in ${NEL_INCLUDE_DIR}") + + GET_FILENAME_COMPONENT(NEL_LIBRARY_DIR ${NELMISC_LIBRARY} DIRECTORY) + + MESSAGE(STATUS "Found NeL library in ${NEL_LIBRARY_DIR}") + + # TODO: implement static version checks for Windows + + # static libraries + IF(UNIX) + GET_FILENAME_COMPONENT(_LIBEXT ${NELMISC_LIBRARY} EXT) + + IF(_LIBEXT STREQUAL ".a") + SET(NEL_STATIC ON) + MESSAGE(STATUS "NeL is using static libraries") + ENDIF() + ENDIF() + + IF(WIN32) + SET(NELDRIVER_DIRS_TO_CHECK + ${NEL_DIR}/bin${LIB_SUFFIX} + ${NEL_DIR} + ) + ELSE() + SET(NELDRIVER_DIRS_TO_CHECK + /usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}/nel + /usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE} + /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/nel + /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} + /usr/lib/nel + /usr/lib + ) + ENDIF() + + # check for static drivers + FOREACH(_DRIVER ${NEL_DRIVERS_AVAILABLE}) + IF(WIN32) + SET(_DRIVER_RELASE_FILE "nel_drv_${_DRIVER}_win_r") + SET(_DRIVER_DEBUG_FILE "nel_drv_${_DRIVER}_win_d") + SET(_DRIVER_SHARED_EXT dll) + SET(_DRIVER_STATIC_EXT lib) + ELSE() + SET(_DRIVER_RELEASE_FILE "nel_drv_${_DRIVER}") + SET(_DRIVER_DEBUG_FILE) + SET(_DRIVER_SHARED_EXT so) + SET(_DRIVER_STATIC_EXT a) + ENDIF() + + STRING(TOUPPER ${_DRIVER} _UPDRIVER) + + FOREACH(_DIR ${NELDRIVER_DIRS_TO_CHECK}) + SET(_FOUND OFF) + + IF(_DRIVER_RELASE_FILE) + SET(_FILE "${_DIR}/${_DRIVER_RELASE_FILE}.${_DRIVER_SHARED_EXT}") + IF(EXISTS ${_FILE}) + SET(NELDRIVER_${_UPDRIVER}_BINARY_RELEASE ${_FILE}) + + MESSAGE(STATUS "Found NeL release shared driver ${_DRIVER}: ${_FILE}") + + SET(NEL_STATIC_DRIVERS OFF) + + IF(NOT NEL_DRIVER_DIR) + SET(NEL_DRIVER_DIR ${_DIR}) + ENDIF() + ENDIF() + + SET(_FILE "${_DIR}/${_DRIVER_RELASE_FILE}.${_DRIVER_STATIC_EXT}") + IF(EXISTS ${_FILE}) + SET(NELDRIVER_${_UPDRIVER}_LIBRARY_RELEASE ${_FILE}) + + MESSAGE(STATUS "Found NeL release static driver ${_DRIVER}: ${_FILE}") + + SET(NEL_STATIC_DRIVERS ON) + + IF(NOT NEL_DRIVER_DIR) + SET(NEL_DRIVER_DIR ${_DIR}) + ENDIF() + ENDIF() + ENDIF() + + IF(_DRIVER_DEBUG_FILE) + SET(_FILE "${_DIR}/${_DRIVER_RELASE_FILE}.${_DRIVER_SHARED_EXT}") + IF(EXISTS ${_FILE}) + SET(NELDRIVER_${_UPDRIVER}_BINARY_DEBUG ${_FILE}) + + MESSAGE(STATUS "Found NeL debug shared driver ${_DRIVER}: ${_FILE}") + + SET(NEL_STATIC_DRIVERS OFF) + + IF(NOT NEL_DRIVER_DIR) + SET(NEL_DRIVER_DIR ${_DIR}) + ENDIF() + ENDIF() + + SET(_FILE "${_DIR}/${_DRIVER_RELASE_FILE}.${_DRIVER_STATIC_EXT}") + IF(EXISTS ${_FILE}) + SET(NELDRIVER_${_UPDRIVER}_LIBRARY_DEBUG ${_FILE}) + + MESSAGE(STATUS "Found NeL debug static driver ${_DRIVER}: ${_FILE}") + + SET(NEL_STATIC_DRIVERS ON) + + IF(NOT NEL_DRIVER_DIR) + SET(NEL_DRIVER_DIR ${_DIR}) + ENDIF() + ENDIF() + + IF(_FOUND) + SET(NELDRIVER_${_UPDRIVER}_FOUND ON) + LIST(APPEND NEL_DRIVERS_FOUND ${_DRIVER}) + ENDIF() + ENDIF() + ENDFOREACH() + ENDFOREACH() + + MESSAGE(STATUS "Found NeL driver in ${NEL_DRIVER_DIR}") + + PARSE_VERSION_OTHER(${NEL_INCLUDE_DIR}/nel/misc/version_nl.h NL_VERSION_MAJOR NL_VERSION_MINOR NL_VERSION_PATCH NL_REVISION) + + SET(NEL_VERSION_MAJOR ${NL_VERSION_MAJOR}) + SET(NEL_VERSION_MINOR ${NL_VERSION_MINOR}) + SET(NEL_VERSION_PATCH ${NL_VERSION_PATCH}) + SET(NEL_REVISION ${NL_REVISION}) + + IF(NOT NEL_VERSION) + IF(NEL_VERSION_MAJOR OR NEL_VERSION_MINOR} OR NEL_VERSION_PATCH) + SET(NEL_VERSION "${NEL_VERSION_MAJOR}.${NEL_VERSION_MINOR}.${NEL_VERSION_PATCH}") + ELSE() + SET(NEL_VERSION "0.5.0") + ENDIF() + + IF(NEL_REVISION) + SET(NEL_VERSION "${NEL_VERSION}.${NEL_REVISION}") + ENDIF() + ENDIF() + + FIND_PACKAGE(PNG REQUIRED) + IF(PNG_FOUND) + LIST(APPEND NELMISC_LIBRARIES ${PNG_LIBRARIES}) + ENDIF() + + FIND_PACKAGE(Jpeg REQUIRED) + IF(JPEG_FOUND) + LIST(APPEND NELMISC_LIBRARIES ${JPEG_LIBRARY}) + ENDIF() + + FIND_PACKAGE(GIF) + + IF(GIF_FOUND) + LIST(APPEND NELMISC_LIBRARIES ${GIF_LIBRARY}) + ENDIF() + + FIND_LIBXML2() + + IF(LIBXML2_FOUND) + LIST(APPEND NELMISC_LIBRARIES ${LIBXML2_LIBRARIES}) + ENDIF() + + LIST(REMOVE_ITEM NeL_FIND_COMPONENTS misc) + + LIST(APPEND NEL_MODULES_FOUND misc) + LIST(APPEND NEL_LIBRARIES ${NELMISC_LIBRARIES}) +ENDIF() + +IF(NOT NeL_FIND_COMPONENTS) + SET(NeL_FIND_COMPONENTS ${NEL_MODULES_AVAILABLE}) + + # We can skip not installed modules + SET(NeL_FIND_REQUIRED OFF) +ENDIF() + +FOREACH(COMPONENT ${NeL_FIND_COMPONENTS}) + SET(_NAME NeL${COMPONENT}) + STRING(TOUPPER ${_NAME} _UPNAME) + + # module is required + SET(${_NAME}_FIND_REQUIRED ${NeL_FIND_REQUIRED}) + + IF(COMPONENT STREQUAL "3d") + SET(HEADER_FILE shape.h) +# ELSEIF(COMPONENT STREQUAL "cegui") +# SET(HEADER_FILE shape.h) + ELSEIF(COMPONENT STREQUAL "georges") + SET(HEADER_FILE form.h) + ELSEIF(COMPONENT STREQUAL "gui") + SET(HEADER_FILE reflect.h) + ELSEIF(COMPONENT STREQUAL "ligo") + SET(HEADER_FILE primitive.h) + ELSEIF(COMPONENT STREQUAL "logic") + SET(HEADER_FILE logic_state.h) + ELSEIF(COMPONENT STREQUAL "net") + SET(HEADER_FILE sock.h) + ELSEIF(COMPONENT STREQUAL "pacs") + SET(HEADER_FILE primitive_block.h) +# ELSEIF(COMPONENT STREQUAL "pipeline") +# SET(HEADER_FILE shape.h) + ELSEIF(COMPONENT STREQUAL "sound") + SET(HEADER_FILE shape.h) + ELSE() + SET(HEADER_FILE) + ENDIF() + + # display if a component has a wrong name + IF(NOT HEADER_FILE) + MESSAGE(STATUS "NeL module ${COMPONENT} not supported, ignoring it...") + CONTINUE() + ENDIF() + + FIND_PACKAGE_HELPER(${_NAME} nel/${COMPONENT}/${HEADER_FILE} + RELEASE nel${COMPONENT}_r nel${COMPONENT} + DEBUG nel${COMPONENT}_d + QUIET) + + IF(${_UPNAME}_FOUND) + LIST(APPEND NEL_MODULES_FOUND ${COMPONENT}) + + IF(COMPONENT STREQUAL "3d") + IF(NEL_STATIC) + # 3rd party dependencies + FIND_PACKAGE(Freetype REQUIRED) + IF(FREETYPE_FOUND) + LIST(APPEND ${_UPNAME}_LIBRARIES ${FREETYPE_LIBRARIES}) + ENDIF() + + # Append static 3D drivers + IF(NEL_STATIC_DRIVERS) + # Direct3D driver (only under Windows) + IF(WIN32) + IF(NELDRIVER_DIRECT3D_LIBRARY_DEBUG) + LIST(APPEND ${_UPNAME}_LIBRARIES debug ${NELDRIVER_DIRECT3D_LIBRARY_DEBUG}) + ENDIF() + + IF(NELDRIVER_DIRECT3D_LIBRARY_RELEASE) + LIST(APPEND ${_UPNAME}_LIBRARIES optimized ${NELDRIVER_DIRECT3D_LIBRARY_RELEASE}) + ENDIF() + ENDIF() + + # OpenGL driver + IF(NELDRIVER_OPENGL_LIBRARY_DEBUG) + LIST(APPEND ${_UPNAME}_LIBRARIES debug ${NELDRIVER_OPENGL_LIBRARY_DEBUG}) + ENDIF() + + IF(NELDRIVER_OPENGL_LIBRARY_RELEASE) + LIST(APPEND ${_UPNAME}_LIBRARIES optimized ${NELDRIVER_OPENGL_LIBRARY_RELEASE}) + ENDIF() + ENDIF() + ENDIF() + ELSEIF(COMPONENT STREQUAL "gui") + FIND_PACKAGE(Luabind REQUIRED) + + LIST(APPEND ${_UPNAME}_LIBRARIES ${LUABIND_LIBRARIES}) + + FIND_LIBCURL() + + IF(CURL_FOUND) + LIST(APPEND ${_UPNAME}_LIBRARIES ${CURL_LIBRARIES}) + LIST(APPEND ${_UPNAME}_DEFINITIONS ${CURL_DEFINITIONS}) + ENDIF() + + # TODO: remove complately OpenSSL requirement on Windows + + # Only used by libcurl under Linux + FIND_PACKAGE(OpenSSL REQUIRED) + + IF(WIN32) + LIST(APPEND OPENSSL_LIBRARIES Crypt32.lib) + ENDIF() + + # Only Linux version of libcurl depends on OpenSSL + LIST(APPEND CURL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR}) + LIST(APPEND CURL_LIBRARIES ${OPENSSL_LIBRARIES}) + + LIST(APPEND ${_UPNAME}_LIBRARIES ${LUABIND_LIBRARIES} ${CURL_LIBRARIES}) + LIST(APPEND NEL_DEFINITIONS ${${_UPNAME}_DEFINITIONS}) + ELSEIF(COMPONENT STREQUAL "sound") + FIND_PACKAGE(Ogg REQUIRED) + + IF(OGG_FOUND) + LIST(APPEND ${_UPNAME}_LIBRARIES ${OGG_LIBRARY}) + ENDIF() + + FIND_PACKAGE(Vorbis REQUIRED) + + IF(VORBIS_FOUND) + LIST(APPEND ${_UPNAME}_LIBRARIES ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY}) + ENDIF() + + IF(NEL_STATIC) + # Link to snd_lowlevel + FIND_LIBRARY_HELPER(nelsnd_lowlevel RELEASE nelsnd_lowlevel_r DEBUG nelsnd_lowlevel_d DIR ${NEL_DIR} REQUIRED) + + IF(NELSND_LOWLEVEL_LIBRARIES) + MESSAGE(STATUS "Found NeL sound lowlevel ${NELSND_LOWLEVEL_LIBRARIES}") + + LIST(APPEND NELSOUND_LIBRARIES ${NELSND_LOWLEVEL_LIBRARIES}) + + IF(NEL_STATIC_DRIVERS) + # DirectSound, XAudio2 and FMod drivers (only under Windows) + IF(WIN32) + # DirectSound + IF(NELDRIVER_DIRECTSOUND_LIBRARY_DEBUG) + LIST(APPEND NELSOUND_LIBRARIES debug ${NELDRIVER_DIRECTSOUND_LIBRARY_DEBUG}) + ENDIF() + + IF(NELDRIVER_DIRECTSOUND_LIBRARY_RELEASE) + LIST(APPEND NELSOUND_LIBRARIES optimized ${NELDRIVER_DIRECTSOUND_LIBRARY_RELEASE}) + ENDIF() + + # FMod + IF(NELDRIVER_FMOD_LIBRARY_DEBUG) + LIST(APPEND NELSOUND_LIBRARIES debug ${NELDRIVER_FMOD_LIBRARY_DEBUG}) + ENDIF() + + IF(NELDRIVER_FMOD_LIBRARY_RELEASE) + LIST(APPEND NELSOUND_LIBRARIES optimized ${NELDRIVER_FMOD_LIBRARY_RELEASE}) + ENDIF() + + # XAudio2 + IF(NELDRIVER_XAUDIO2_LIBRARY_DEBUG) + LIST(APPEND NELSOUND_LIBRARIES debug ${NELDRIVER_XAUDIO2_LIBRARY_DEBUG}) + ENDIF() + + IF(NELDRIVER_XAUDIO2_LIBRARY_RELEASE) + LIST(APPEND NELSOUND_LIBRARIES optimized ${NELDRIVER_XAUDIO2_LIBRARY_RELEASE}) + ENDIF() + ENDIF() + + # OpenAL driver + IF(NELDRIVER_OPENAL_LIBRARY_DEBUG) + LIST(APPEND NELSOUND_LIBRARIES debug ${NELDRIVER_OPENAL_LIBRARY_DEBUG}) + ENDIF() + + IF(NELDRIVER_OPENAL_LIBRARY_RELEASE) + LIST(APPEND NELSOUND_LIBRARIES optimized ${NELDRIVER_OPENAL_LIBRARY_RELEASE}) + ENDIF() + ENDIF() + ENDIF() + ENDIF() + ENDIF() + + LIST(APPEND NEL_LIBRARIES ${${_UPNAME}_LIBRARIES}) + ENDIF() +ENDFOREACH() + +MESSAGE_VERSION_PACKAGE_HELPER(NeL ${NEL_VERSION} ${NEL_MODULES_FOUND}) diff --git a/code/CMakeModules/FindOgg.cmake b/code/CMakeModules/FindOgg.cmake index 8762afc5d..c1f4492e1 100644 --- a/code/CMakeModules/FindOgg.cmake +++ b/code/CMakeModules/FindOgg.cmake @@ -7,7 +7,7 @@ IF(OGG_LIBRARY AND OGG_INCLUDE_DIR) # in cache already SET(OGG_FIND_QUIETLY TRUE) -ENDIF(OGG_LIBRARY AND OGG_INCLUDE_DIR) +ENDIF() FIND_PATH(OGG_INCLUDE_DIR @@ -41,9 +41,9 @@ 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) + ENDIF() +ELSE() IF(NOT OGG_FIND_QUIETLY) MESSAGE(STATUS "Warning: Unable to find Ogg!") - ENDIF(NOT OGG_FIND_QUIETLY) -ENDIF(OGG_LIBRARY AND OGG_INCLUDE_DIR) + ENDIF() +ENDIF() diff --git a/code/CMakeModules/FindOpenGLES.cmake b/code/CMakeModules/FindOpenGLES.cmake index 35157b95b..74a5b4021 100644 --- a/code/CMakeModules/FindOpenGLES.cmake +++ b/code/CMakeModules/FindOpenGLES.cmake @@ -43,7 +43,7 @@ IF(OPENGLES_GLES_LIBRARY) IF(OPENGLES_EGL_LIBRARY) SET(OPENGLES_EGL_FOUND "YES") SET(OPENGLES_LIBRARIES ${OPENGLES_EGL_LIBRARY} ${OPENGLES_LIBRARIES}) - ELSE(OPENGLES_EGL_LIBRARY) + ELSE() SET(OPENGLES_EGL_FOUND "NO") - ENDIF(OPENGLES_EGL_LIBRARY) -ENDIF(OPENGLES_GLES_LIBRARY) + ENDIF() +ENDIF() diff --git a/code/CMakeModules/FindRyzomGameShare.cmake b/code/CMakeModules/FindRyzomGameShare.cmake new file mode 100644 index 000000000..f76e4dd93 --- /dev/null +++ b/code/CMakeModules/FindRyzomGameShare.cmake @@ -0,0 +1,14 @@ +INCLUDE(FindHelpers) + +FIND_PACKAGE_HELPER(RyzomGameShare game_share/continent.h RELEASE ryzom_gameshare_r ryzom_gameshare DEBUG ryzom_gameshare_d DIR ${NEL_DIR} ${RYZOM_DIR} SUFFIXES ryzom) + +IF(RYZOMGAMESHARE_FOUND) + FIND_PACKAGE(NeL REQUIRED) + LIST(APPEND RYZOMGAMESHARE_INCLUDE_DIRS ${NEL_INCLUDE_DIRS}) + LIST(APPEND RYZOMGAMESHARE_LIBRARIES ${NELMISC_LIBRARIES} ${NELLIGO_LIBRARIES} ${NELNET_LIBRARIES} ${NELGEORGES_LIBRARIES}) + + SET(RYZOM_GAMESHARE_LIBRARIES ${RYZOMGAMESHARE_LIBRARIES}) + SET(RYZOM_GAMESHARE_FOUND ${RYZOMGAMESHARE_FOUND}) + SET(RYZOM_GAMESHARE_INCLUDE_DIR ${RYZOMGAMESHARE_INCLUDE_DIR}) + SET(RYZOM_GAMESHARE_INCLUDE_DIRS ${RYZOMGAMESHARE_INCLUDE_DIRS}) +ENDIF() diff --git a/code/CMakeModules/FindSTLport.cmake b/code/CMakeModules/FindSTLport.cmake index 22e0745ba..68e542ea5 100644 --- a/code/CMakeModules/FindSTLport.cmake +++ b/code/CMakeModules/FindSTLport.cmake @@ -9,7 +9,7 @@ IF(STLPORT_LIBRARIES AND STLPORT_INCLUDE_DIR) # in cache already SET(STLPORT_FIND_QUIETLY TRUE) -ENDIF(STLPORT_LIBRARIES AND STLPORT_INCLUDE_DIR) +ENDIF() FIND_PATH(STLPORT_INCLUDE_DIR iostream @@ -74,18 +74,18 @@ IF(STLPORT_INCLUDE_DIR) SET(STLPORT_LIBRARIES ${STLPORT_LIBRARY_RELEASE}) IF(STLPORT_LIBRARY_DEBUG) SET(STLPORT_LIBRARIES optimized ${STLPORT_LIBRARIES} debug ${STLPORT_LIBRARY_DEBUG}) - ENDIF(STLPORT_LIBRARY_DEBUG) - ENDIF(STLPORT_LIBRARY_RELEASE) -ENDIF(STLPORT_INCLUDE_DIR) + ENDIF() + ENDIF() +ENDIF() IF(STLPORT_FOUND) IF(NOT STLPORT_FIND_QUIETLY) MESSAGE(STATUS "Found STLport: ${STLPORT_LIBRARIES}") - ENDIF(NOT STLPORT_FIND_QUIETLY) -ELSE(STLPORT_FOUND) + ENDIF() +ELSE() IF(NOT STLPORT_FIND_QUIETLY) MESSAGE(STATUS "Warning: Unable to find STLport!") - ENDIF(NOT STLPORT_FIND_QUIETLY) -ENDIF(STLPORT_FOUND) + ENDIF() +ENDIF() MARK_AS_ADVANCED(STLPORT_LIBRARY_RELEASE STLPORT_LIBRARY_DEBUG) diff --git a/code/CMakeModules/FindSquish.cmake b/code/CMakeModules/FindSquish.cmake index ad0f7ce80..4242f4055 100644 --- a/code/CMakeModules/FindSquish.cmake +++ b/code/CMakeModules/FindSquish.cmake @@ -10,7 +10,7 @@ IF(SQUISH_LIBRARIES AND SQUISH_INCLUDE_DIR) # in cache already SET(SQUISH_FIND_QUIETLY TRUE) -ENDIF(SQUISH_LIBRARIES AND SQUISH_INCLUDE_DIR) +ENDIF() FIND_PATH(SQUISH_INCLUDE_DIR squish.h @@ -55,27 +55,29 @@ FIND_LIBRARY(SQUISH_LIBRARY_DEBUG IF(SQUISH_INCLUDE_DIR) IF(SQUISH_LIBRARY_RELEASE) SET(SQUISH_FOUND "YES") - SET(SQUISH_LIBRARIES "optimized;${SQUISH_LIBRARY_RELEASE}") IF(SQUISH_LIBRARY_DEBUG) SET(SQUISH_LIBRARIES "${SQUISH_LIBRARIES};debug;${SQUISH_LIBRARY_DEBUG}") - ENDIF(SQUISH_LIBRARY_DEBUG) - ENDIF(SQUISH_LIBRARY_RELEASE) -ENDIF(SQUISH_INCLUDE_DIR) + ELSE() + SET(SQUISH_LIBRARIES "${SQUISH_LIBRARIES};debug;${SQUISH_LIBRARY_RELEASE}") + MESSAGE("Debug Squish NOT found, using the release version!") + ENDIF() + ENDIF() +ENDIF() IF(SQUISH_FOUND) IF(NOT SQUISH_FIND_QUIETLY) MESSAGE(STATUS "Found Squish: ${SQUISH_LIBRARIES}") - ENDIF(NOT SQUISH_FIND_QUIETLY) + ENDIF() FILE(STRINGS ${SQUISH_INCLUDE_DIR}/squish.h METRIC REGEX "metric = 0") IF(METRIC) SET(SQUISH_COMPRESS_HAS_METRIC ON) SET(SQUISH_DEFINITIONS -DSQUISH_COMPRESS_HAS_METRIC) - ENDIF(METRIC) -ELSE(SQUISH_FOUND) + ENDIF() +ELSE() IF(NOT SQUISH_FIND_QUIETLY) MESSAGE(STATUS "Warning: Unable to find Squish!") - ENDIF(NOT SQUISH_FIND_QUIETLY) -ENDIF(SQUISH_FOUND) + ENDIF() +ENDIF() MARK_AS_ADVANCED(SQUISH_LIBRARY_RELEASE SQUISH_LIBRARY_DEBUG) diff --git a/code/CMakeModules/FindSteam.cmake b/code/CMakeModules/FindSteam.cmake new file mode 100644 index 000000000..8d9b12372 --- /dev/null +++ b/code/CMakeModules/FindSteam.cmake @@ -0,0 +1,74 @@ +# - Locate Steam API +# This module defines +# STEAM_LIBRARY, the library to link against +# STEAM_FOUND, if false, do not try to link to STEAM +# STEAM_INCLUDE_DIR, where to find headers. + +IF(STEAM_LIBRARY AND STEAM_INCLUDE_DIR) + # in cache already + SET(Steam_FIND_QUIETLY TRUE) +ENDIF() + + +FIND_PATH(STEAM_INCLUDE_DIR + steam_api.h + PATH_SUFFIXES steam + PATHS + $ENV{STEAM_DIR}/public +) + +IF(WIN32) + IF(TARGET_X64) + SET(STEAM_LIBNAME steam_api64) + SET(STEAM_RUNTIMENAME steam_api64.dll) + SET(STEAM_PATHNAME redistributable_bin/win64) + ELSE() + SET(STEAM_LIBNAME steam_api) + SET(STEAM_RUNTIMENAME steam_api.dll) + SET(STEAM_PATHNAME redistributable_bin) + ENDIF() +ELSEIF(APPLE) + # universal binary + SET(STEAM_LIBNAME steam_api) + SET(STEAM_RUNTIMENAME libsteam_api.dylib) + SET(STEAM_PATHNAME redistributable_bin/osx32) +ELSE() + SET(STEAM_LIBNAME steam_api) + SET(STEAM_RUNTIMENAME libsteam_api.so) + IF(TARGET_X64) + SET(STEAM_PATHNAME redistributable_bin/linux64) + ELSE() + SET(STEAM_PATHNAME redistributable_bin/linux32) + ENDIF() +ENDIF() + +FIND_LIBRARY(STEAM_LIBRARY + NAMES ${STEAM_LIBNAME} + HINTS + $ENV{STEAM_DIR}/${STEAM_PATHNAME} +) + +FIND_FILE(STEAM_RUNTIME + NAMES ${STEAM_RUNTIMENAME} + HINTS + $ENV{STEAM_DIR}/${STEAM_PATHNAME} + PATHS + ${EXTERNAL_BINARY_PATH} + ${CMAKE_LIBRARY_PATH} + /usr/local/lib + /usr/lib +) + +# Don't need to check STEAM_LIBRARY because we're dynamically loading Steam DLL +IF(STEAM_INCLUDE_DIR) + SET(STEAM_FOUND ON) + SET(STEAM_LIBRARIES ${STEAM_LIBRARY}) + SET(STEAM_INCLUDE_DIRS ${STEAM_INCLUDE_DIR}) + IF(NOT Steam_FIND_QUIETLY) + MESSAGE(STATUS "Found Steam: ${STEAM_INCLUDE_DIR} and ${STEAM_RUNTIME}") + ENDIF() +ELSE() + IF(NOT Steam_FIND_QUIETLY) + MESSAGE(STATUS "Warning: Unable to find Steam!") + ENDIF() +ENDIF() diff --git a/code/CMakeModules/FindVorbis.cmake b/code/CMakeModules/FindVorbis.cmake index 95883fa59..234d2d31a 100644 --- a/code/CMakeModules/FindVorbis.cmake +++ b/code/CMakeModules/FindVorbis.cmake @@ -7,7 +7,7 @@ IF(VORBIS_LIBRARY AND VORBIS_INCLUDE_DIR) # in cache already SET(VORBIS_FIND_QUIETLY TRUE) -ENDIF(VORBIS_LIBRARY AND VORBIS_INCLUDE_DIR) +ENDIF() FIND_PATH(VORBIS_INCLUDE_DIR @@ -57,9 +57,9 @@ IF(VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBIS_INCLUDE_DIR) 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) + ENDIF() +ELSE() 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) + ENDIF() +ENDIF() diff --git a/code/CMakeModules/FindWindowsSDK.cmake b/code/CMakeModules/FindWindowsSDK.cmake index 2e72af9e5..3d9c43bd9 100644 --- a/code/CMakeModules/FindWindowsSDK.cmake +++ b/code/CMakeModules/FindWindowsSDK.cmake @@ -9,7 +9,7 @@ IF(WINSDK_FOUND) # If Windows SDK already found, skip it RETURN() -ENDIF(WINSDK_FOUND) +ENDIF() # Values can be CURRENT or any existing versions 7.1, 8.0A, etc... SET(WINSDK_VERSION "CURRENT" CACHE STRING "Windows SDK version to prefer") @@ -17,16 +17,31 @@ SET(WINSDK_VERSION "CURRENT" CACHE STRING "Windows SDK version to prefer") MACRO(DETECT_WINSDK_VERSION_HELPER _ROOT _VERSION) GET_FILENAME_COMPONENT(WINSDK${_VERSION}_DIR "[${_ROOT}\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v${_VERSION};InstallationFolder]" ABSOLUTE) - IF(WINSDK${_VERSION}_DIR AND NOT WINSDK${_VERSION}_DIR STREQUAL "/registry") + IF(WINSDK${_VERSION}_DIR AND NOT WINSDK${_VERSION}_DIR STREQUAL "/registry" AND EXISTS "${WINSDK${_VERSION}_DIR}/Include") SET(WINSDK${_VERSION}_FOUND ON) GET_FILENAME_COMPONENT(WINSDK${_VERSION}_VERSION_FULL "[${_ROOT}\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v${_VERSION};ProductVersion]" NAME) IF(NOT WindowsSDK_FIND_QUIETLY) MESSAGE(STATUS "Found Windows SDK ${_VERSION} in ${WINSDK${_VERSION}_DIR}") - ENDIF(NOT WindowsSDK_FIND_QUIETLY) - ELSE(WINSDK${_VERSION}_DIR AND NOT WINSDK${_VERSION}_DIR STREQUAL "/registry") + ENDIF() + ELSE() + SET(WINSDK${_VERSION}_DIR "") + ENDIF() +ENDMACRO() + +MACRO(DETECT_WINKIT_VERSION _VERSION _SUFFIX) + GET_FILENAME_COMPONENT(WINSDK${_VERSION}_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot${_SUFFIX}]" ABSOLUTE) + + IF(WINSDK${_VERSION}_DIR AND NOT WINSDK${_VERSION}_DIR STREQUAL "/registry") + SET(WINSDK${_VERSION}_FOUND ON) + SET(WINSDK${_VERSION}_VERSION_FULL "${_VERSION}") + IF(NOT WindowsSDK_FIND_QUIETLY) + MESSAGE(STATUS "Found Windows Kit ${_VERSION} in ${WINSDK${_VERSION}_DIR}") + ENDIF() + LIST(APPEND WINSDK_DETECTED_VERSIONS ${_VERSION}) + ELSE() SET(WINSDK${_VERSION}_DIR "") - ENDIF(WINSDK${_VERSION}_DIR AND NOT WINSDK${_VERSION}_DIR STREQUAL "/registry") -ENDMACRO(DETECT_WINSDK_VERSION_HELPER) + ENDIF() +ENDMACRO() MACRO(DETECT_WINSDK_VERSION _VERSION) SET(WINSDK${_VERSION}_FOUND OFF) @@ -34,40 +49,53 @@ MACRO(DETECT_WINSDK_VERSION _VERSION) IF(NOT WINSDK${_VERSION}_FOUND) DETECT_WINSDK_VERSION_HELPER("HKEY_LOCAL_MACHINE" ${_VERSION}) - ENDIF(NOT WINSDK${_VERSION}_FOUND) -ENDMACRO(DETECT_WINSDK_VERSION) + ENDIF() +ENDMACRO() -SET(WINSDK_VERSIONS "8.0" "8.0A" "7.1" "7.1A" "7.0" "7.0A" "6.1" "6.0" "6.0A") SET(WINSDK_DETECTED_VERSIONS) +# Fixed versions for Windows Kits (VC++ from 2012) +DETECT_WINKIT_VERSION("10.0" "10") +DETECT_WINKIT_VERSION("8.1" "81") +DETECT_WINKIT_VERSION("8.0" "") + +# For VC++ up to 2010 +SET(WINSDK_VERSIONS "7.1" "7.1A" "7.0" "7.0A" "6.1" "6.0" "6.0A") + # Search all supported Windows SDKs FOREACH(_VERSION ${WINSDK_VERSIONS}) DETECT_WINSDK_VERSION(${_VERSION}) IF(WINSDK${_VERSION}_FOUND) LIST(APPEND WINSDK_DETECTED_VERSIONS ${_VERSION}) - ENDIF(WINSDK${_VERSION}_FOUND) -ENDFOREACH(_VERSION) + ENDIF() +ENDFOREACH() -SET(WINSDK_SUFFIX) +SET(WINSDK_SUFFIXES) -IF(TARGET_ARM) +IF(TARGET_ARM64) + SET(WINSDK8_SUFFIX "arm64") +ELSEIF(TARGET_ARM) SET(WINSDK8_SUFFIX "arm") ELSEIF(TARGET_X64) SET(WINSDK8_SUFFIX "x64") - SET(WINSDK_SUFFIX "x64") + SET(WINSDK_SUFFIXES "x64" "amd64") ELSEIF(TARGET_X86) SET(WINSDK8_SUFFIX "x86") -ENDIF(TARGET_ARM) +ENDIF() SET(WINSDKCURRENT_VERSION_INCLUDE $ENV{INCLUDE}) IF(WINSDKCURRENT_VERSION_INCLUDE) FILE(TO_CMAKE_PATH "${WINSDKCURRENT_VERSION_INCLUDE}" WINSDKCURRENT_VERSION_INCLUDE) -ENDIF(WINSDKCURRENT_VERSION_INCLUDE) +ENDIF() SET(WINSDKENV_DIR $ENV{WINSDK_DIR}) +IF(NOT WINSDKENV_DIR) + SET(WINSDKENV_DIR $ENV{WindowsSDKDir}) +ENDIF() + MACRO(FIND_WINSDK_VERSION_HEADERS) IF(WINSDK_DIR AND NOT WINSDK_VERSION) # Search version in headers @@ -78,18 +106,28 @@ MACRO(FIND_WINSDK_VERSION_HEADERS) ) IF(_MSI_FILE) + IF(NOT WINSDK_VERSION) + # Look for Windows SDK 8.1 + FILE(STRINGS ${_MSI_FILE} _CONTENT REGEX "^#ifndef NTDDI_WINBLUE") - # Look for Windows SDK 8.0 - FILE(STRINGS ${_MSI_FILE} _CONTENT REGEX "^#ifndef NTDDI_WIN8") + IF(_CONTENT) + SET(WINSDK_VERSION "8.1") + ENDIF() + ENDIF() + + IF(NOT WINSDK_VERSION) + # Look for Windows SDK 8.0 + FILE(STRINGS ${_MSI_FILE} _CONTENT REGEX "^#ifndef NTDDI_WIN8") + + IF(_CONTENT) + SET(WINSDK_VERSION "8.0") + ENDIF() + ENDIF() - IF(_CONTENT) - SET(WINSDK_VERSION "8.0") - ENDIF(_CONTENT) - IF(NOT WINSDK_VERSION) # Look for Windows SDK 7.0 FILE(STRINGS ${_MSI_FILE} _CONTENT REGEX "^#ifndef NTDDI_WIN7") - + IF(_CONTENT) FIND_FILE(_WINSDKVER_FILE winsdkver.h WinSDKVer.h PATHS @@ -109,23 +147,23 @@ MACRO(FIND_WINSDK_VERSION_HEADERS) SET(WINSDK_VERSION "7.1") ELSEIF(_WINSDKVER STREQUAL "0601") SET(WINSDK_VERSION "7.0A") - ELSE(_WINSDKVER STREQUAL "06010000") + ELSE() MESSAGE(FATAL_ERROR "Can't determine Windows SDK version with NTDDI_MAXVER 0x${_WINSDKVER}") - ENDIF(_WINSDKVER STREQUAL "06010000") - ELSE(_WINSDKVER_FILE) + ENDIF() + ELSE() SET(WINSDK_VERSION "7.0") - ENDIF(_WINSDKVER_FILE) - ENDIF(_CONTENT) - ENDIF(NOT WINSDK_VERSION) + ENDIF() + ENDIF() + ENDIF() IF(NOT WINSDK_VERSION) # Look for Windows SDK 6.0 FILE(STRINGS ${_MSI_FILE} _CONTENT REGEX "^#ifndef NTDDI_VISTA") - + IF(_CONTENT) SET(WINSDK_VERSION "6.0") - ENDIF(_CONTENT) - ENDIF(NOT WINSDK_VERSION) + ENDIF() + ENDIF() IF(NOT WINSDK_VERSION) # Look for Windows SDK 5.2 @@ -133,8 +171,8 @@ MACRO(FIND_WINSDK_VERSION_HEADERS) IF(_CONTENT) SET(WINSDK_VERSION "5.2") - ENDIF(_CONTENT) - ENDIF(NOT WINSDK_VERSION) + ENDIF() + ENDIF() IF(NOT WINSDK_VERSION) # Look for Windows SDK 5.1 @@ -142,8 +180,8 @@ MACRO(FIND_WINSDK_VERSION_HEADERS) IF(_CONTENT) SET(WINSDK_VERSION "5.1") - ENDIF(_CONTENT) - ENDIF(NOT WINSDK_VERSION) + ENDIF() + ENDIF() IF(NOT WINSDK_VERSION) # Look for Windows SDK 5.0 @@ -151,13 +189,13 @@ MACRO(FIND_WINSDK_VERSION_HEADERS) IF(_CONTENT) SET(WINSDK_VERSION "5.0") - ENDIF(_CONTENT) - ENDIF(NOT WINSDK_VERSION) - ELSE(_MSI_FILE) + ENDIF() + ENDIF() + ELSE() MESSAGE(FATAL_ERROR "Unable to find Msi.h in ${WINSDK_DIR}") - ENDIF(_MSI_FILE) - ENDIF(WINSDK_DIR AND NOT WINSDK_VERSION) -ENDMACRO(FIND_WINSDK_VERSION_HEADERS) + ENDIF() + ENDIF() +ENDMACRO() MACRO(USE_CURRENT_WINSDK) SET(WINSDK_DIR "") @@ -171,7 +209,7 @@ MACRO(USE_CURRENT_WINSDK) ${WINSDKENV_DIR}/Include/um ${WINSDKENV_DIR}/Include ) - ENDIF(WINSDKENV_DIR) + ENDIF() # Use INCLUDE environment variable IF(NOT WINSDK_DIR AND WINSDKCURRENT_VERSION_INCLUDE) @@ -181,11 +219,11 @@ MACRO(USE_CURRENT_WINSDK) # Look for Windows.h because there are several paths IF(EXISTS ${_INCLUDE}/Windows.h) STRING(REGEX REPLACE "/(include|INCLUDE|Include)(.*)" "" WINSDK_DIR ${_INCLUDE}) - MESSAGE(STATUS "Found Windows SDK from include environment variable in ${WINSDK_DIR}") + MESSAGE(STATUS "Found Windows SDK in INCLUDE environment variable: ${WINSDK_DIR}") BREAK() - ENDIF(EXISTS ${_INCLUDE}/Windows.h) - ENDFOREACH(_INCLUDE) - ENDIF(NOT WINSDK_DIR AND WINSDKCURRENT_VERSION_INCLUDE) + ENDIF() + ENDFOREACH() + ENDIF() IF(WINSDK_DIR) # Compare WINSDK_DIR with registered Windows SDKs @@ -194,38 +232,59 @@ MACRO(USE_CURRENT_WINSDK) SET(WINSDK_VERSION ${_VERSION}) SET(WINSDK_VERSION_FULL "${WINSDK${WINSDK_VERSION}_VERSION_FULL}") BREAK() - ENDIF(WINSDK_DIR STREQUAL "${WINSDK${_VERSION}_DIR}") - ENDFOREACH(_VERSION) + ENDIF() + ENDFOREACH() FIND_WINSDK_VERSION_HEADERS() - ENDIF(WINSDK_DIR) + ENDIF() IF(NOT WINSDK_DIR) # Use Windows SDK versions installed with VC++ when possible - IF(MSVC12) - SET(WINSDK_VERSION "8.1A") + IF(MSVC_VERSION GREATER 1909) + # Special case, use Kits for SDK + SET(WINSDK_VERSION "10.0") + SET(WINSDK_DIR ${WINSDK_UCRT_DIR}) + ELSEIF(MSVC14) + SET(WINSDK_VERSION "8.1") + ELSEIF(MSVC12) + SET(WINSDK_VERSION "8.1") ELSEIF(MSVC11) - SET(WINSDK_VERSION "8.0A") + SET(WINSDK_VERSION "8.0") ELSEIF(MSVC10) IF(NOT TARGET_X64 OR NOT MSVC_EXPRESS) SET(WINSDK_VERSION "7.0A") - ENDIF(NOT TARGET_X64 OR NOT MSVC_EXPRESS) + ENDIF() ELSEIF(MSVC90) IF(NOT MSVC_EXPRESS) SET(WINSDK_VERSION "6.0A") - ENDIF(NOT MSVC_EXPRESS) + ENDIF() ELSEIF(MSVC80) - IF(NOT MSVC_EXPRESS) - # TODO: fix this version + SET(WINSDK_MSVC80_COMPATIBLES "7.1" "7.1A" "7.0" "7.0A" "6.1" "6.0" "6.0A" "5.2A") + + # look for each Windows SDK supported by VC++ 2005 (7.1 is the latest) + FOREACH(_VERSION ${WINSDK_DETECTED_VERSIONS}) + # look if this version of Windows SDK is installed + LIST(FIND WINSDK_MSVC80_COMPATIBLES ${_VERSION} _FOUND) + IF(NOT _FOUND EQUAL -1) + SET(WINSDK_VERSION "${_VERSION}") + BREAK() + ENDIF() + ENDFOREACH() + + IF(NOT MSVC_EXPRESS AND NOT WINSDK_VERSION) SET(WINSDK_VERSION "5.2A") - ENDIF(NOT MSVC_EXPRESS) - ELSE(MSVC12) + ENDIF() + ELSE() MESSAGE(FATAL_ERROR "Your compiler is either too old or too recent, please update this CMake module.") - ENDIF(MSVC12) + ENDIF() # Use installed Windows SDK IF(NOT WINSDK_VERSION) - IF(WINSDK7.1_FOUND) + IF(WINSDK8.1_FOUND) + SET(WINSDK_VERSION "8.1") + ELSEIF(WINSDK8.0_FOUND) + SET(WINSDK_VERSION "8.0") + ELSEIF(WINSDK7.1_FOUND) SET(WINSDK_VERSION "7.1") ELSEIF(WINSDK7.0_FOUND) SET(WINSDK_VERSION "7.0") @@ -233,10 +292,10 @@ MACRO(USE_CURRENT_WINSDK) SET(WINSDK_VERSION "6.1") ELSEIF(WINSDK6.0_FOUND) SET(WINSDK_VERSION "6.0") - ELSE(WINSDK7.1_FOUND) + ELSE() MESSAGE(FATAL_ERROR "You have no compatible Windows SDK installed.") - ENDIF(WINSDK7.1_FOUND) - ENDIF(NOT WINSDK_VERSION) + ENDIF() + ENDIF() # Look for correct registered Windows SDK version FOREACH(_VERSION ${WINSDK_DETECTED_VERSIONS}) @@ -244,75 +303,193 @@ MACRO(USE_CURRENT_WINSDK) SET(WINSDK_VERSION_FULL "${WINSDK${WINSDK_VERSION}_VERSION_FULL}") SET(WINSDK_DIR "${WINSDK${WINSDK_VERSION}_DIR}") BREAK() - ENDIF(WINSDK_VERSION STREQUAL _VERSION) - ENDFOREACH(_VERSION) - ENDIF(NOT WINSDK_DIR) -ENDMACRO(USE_CURRENT_WINSDK) + ENDIF() + ENDFOREACH() + ENDIF() +ENDMACRO() + +IF(MSVC14) + # Under VC++ 2015 and 2017, stdio.h, stdlib.h, etc... are part of UCRT + SET(WINSDK_UCRT_VERSION "10.0") +ENDIF() + +# Look for correct UCRT +IF(WINSDK_UCRT_VERSION AND WINSDK${WINSDK_UCRT_VERSION}_FOUND) + SET(WINSDK_UCRT_DIR "${WINSDK${WINSDK_UCRT_VERSION}_DIR}") +ENDIF() + +IF(WINSDK_UCRT_DIR) + # determine exact UCRT version + SET(WINSDK_UCRT_INCLUDE_ROOT_DIR ${WINSDK_UCRT_DIR}/Include) + SET(WINSDK_UCRT_LIB_ROOT_DIR ${WINSDK_UCRT_DIR}/Lib) + + FILE(GLOB UCRT_SUBDIRS RELATIVE ${WINSDK_UCRT_INCLUDE_ROOT_DIR} ${WINSDK_UCRT_INCLUDE_ROOT_DIR}/*) + SET(UCRT_VERSION) + + FOREACH(UCRT_SUBDIR ${UCRT_SUBDIRS}) + IF(NOT UCRT_VERSION OR UCRT_SUBDIR VERSION_GREATER UCRT_VERSION) + SET(UCRT_VERSION ${UCRT_SUBDIR}) + ENDIF() + ENDFOREACH() + + IF(UCRT_VERSION) + MESSAGE(STATUS "Using Windows UCRT ${UCRT_VERSION}") + + SET(WINSDK10_INCLUDE_DIR ${WINSDK_UCRT_INCLUDE_ROOT_DIR}/${UCRT_VERSION}) + SET(WINSDK10_LIBRARY_DIR ${WINSDK_UCRT_LIB_ROOT_DIR}/${UCRT_VERSION}) + + # directory where UCRT headers are found + FIND_PATH(WINSDK_UCRT_INCLUDE_DIR corecrt.h + HINTS + ${WINSDK10_INCLUDE_DIR}/ucrt + ) + + # directory where UCRT libraries are found + FIND_PATH(WINSDK_UCRT_LIBRARY_DIR ucrt.lib + HINTS + ${WINSDK10_LIBRARY_DIR}/ucrt/${WINSDK8_SUFFIX} + ) + ENDIF() +ENDIF() IF(WINSDK_VERSION STREQUAL "CURRENT") USE_CURRENT_WINSDK() -ELSE(WINSDK_VERSION STREQUAL "CURRENT") +ELSE() IF(WINSDK${WINSDK_VERSION}_FOUND) SET(WINSDK_VERSION_FULL "${WINSDK${WINSDK_VERSION}_VERSION_FULL}") SET(WINSDK_DIR "${WINSDK${WINSDK_VERSION}_DIR}") - ELSE(WINSDK${WINSDK_VERSION}_FOUND) + ELSE() USE_CURRENT_WINSDK() - ENDIF(WINSDK${WINSDK_VERSION}_FOUND) -ENDIF(WINSDK_VERSION STREQUAL "CURRENT") + ENDIF() +ENDIF() IF(WINSDK_DIR) MESSAGE(STATUS "Using Windows SDK ${WINSDK_VERSION}") -ELSE(WINSDK_DIR) +ELSE() MESSAGE(FATAL_ERROR "Unable to find Windows SDK!") -ENDIF(WINSDK_DIR) +ENDIF() # directory where Win32 headers are found FIND_PATH(WINSDK_INCLUDE_DIR Windows.h HINTS + ${WINSDK_DIR}/Include/${UCRT_VERSION}/um ${WINSDK_DIR}/Include/um ${WINSDK_DIR}/Include + NO_DEFAULT_PATH +) + +MESSAGE(STATUS "Found Windows.h in ${WINSDK_INCLUDE_DIR}") + +# directory where WinRT headers are found +FIND_PATH(WINSDK_WINRT_INCLUDE_DIR winstring.h + HINTS + ${WINSDK_DIR}/Include/${UCRT_VERSION}/winrt + ${WINSDK_DIR}/Include/winrt + NO_DEFAULT_PATH ) +MESSAGE(STATUS "Found winstring.h in ${WINSDK_WINRT_INCLUDE_DIR}") + # directory where DirectX headers are found FIND_PATH(WINSDK_SHARED_INCLUDE_DIR d3d9.h HINTS + ${WINSDK_DIR}/Include/${UCRT_VERSION}/shared ${WINSDK_DIR}/Include/shared - ${WINSDK_DIR}/Include + NO_DEFAULT_PATH +) + +MESSAGE(STATUS "Found d3d9.h in ${WINSDK_SHARED_INCLUDE_DIR}") + +# directory where OpenGL headers are found +FIND_PATH(WINSDK_OPENGL_INCLUDE_DIR GL.h + HINTS + ${WINSDK_INCLUDE_DIR}/gl + ${WINSDK_DIR}/Include/um/gl + ${WINSDK_DIR}/Include/gl + NO_DEFAULT_PATH +) + +MESSAGE(STATUS "Found GL.h in ${WINSDK_OPENGL_INCLUDE_DIR}") + +SET(WINSDK_LIBRARY_DIRS + ${WINSDK_DIR}/Lib/${UCRT_VERSION}/um/${WINSDK8_SUFFIX} + ${WINSDK_DIR}/Lib/winv6.3/um/${WINSDK8_SUFFIX} + ${WINSDK_DIR}/Lib/win8/um/${WINSDK8_SUFFIX} ) +IF(WINSDK_SUFFIXES) + FOREACH(_SUFFIX ${WINSDK_SUFFIXES}) + LIST(APPEND WINSDK_LIBRARY_DIRS ${WINSDK_DIR}/Lib/${_SUFFIX}) + ENDFOREACH() +ELSE() + LIST(APPEND WINSDK_LIBRARY_DIRS ${WINSDK_DIR}/Lib) +ENDIF() + # directory where all libraries are found FIND_PATH(WINSDK_LIBRARY_DIR ComCtl32.lib HINTS - ${WINSDK_DIR}/Lib/win8/um/${WINSDK8_SUFFIX} - ${WINSDK_DIR}/Lib/${WINSDK_SUFFIX} + ${WINSDK_LIBRARY_DIRS} + NO_DEFAULT_PATH +) + +MESSAGE(STATUS "Found ComCtl32.lib in ${WINSDK_LIBRARY_DIR}") + +SET(WINSDK_BINARY_DIRS + ${WINSDK_DIR}/Bin/${UCRT_VERSION}/${WINSDK8_SUFFIX} + ${WINSDK_DIR}/Bin/${WINSDK8_SUFFIX} + ${WINSDK_DIR}/Bin/x86 + ${WINSDK_DIR}/Bin ) # signtool is used to sign executables FIND_PROGRAM(WINSDK_SIGNTOOL signtool HINTS - ${WINSDK_DIR}/Bin/x86 - ${WINSDK_DIR}/Bin + ${WINSDK_BINARY_DIRS} + NO_DEFAULT_PATH ) # midl is used to generate IDL interfaces FIND_PROGRAM(WINSDK_MIDL midl HINTS - ${WINSDK_DIR}/Bin/x86 - ${WINSDK_DIR}/Bin + ${WINSDK_BINARY_DIRS} + NO_DEFAULT_PATH ) IF(WINSDK_INCLUDE_DIR) SET(WINSDK_FOUND ON) - SET(WINSDK_INCLUDE_DIRS ${WINSDK_INCLUDE_DIR} ${WINSDK_SHARED_INCLUDE_DIR}) - SET(CMAKE_LIBRARY_PATH ${WINSDK_LIBRARY_DIR} ${CMAKE_LIBRARY_PATH}) + + IF(WINSDK_UCRT_INCLUDE_DIR) + SET(WINSDK_INCLUDE_DIRS ${WINSDK_INCLUDE_DIRS} ${WINSDK_UCRT_INCLUDE_DIR}) + ENDIF() + + IF(WINSDK_SHARED_INCLUDE_DIR) + SET(WINSDK_INCLUDE_DIRS ${WINSDK_INCLUDE_DIRS} ${WINSDK_SHARED_INCLUDE_DIR}) + ENDIF() + + SET(WINSDK_INCLUDE_DIRS ${WINSDK_INCLUDE_DIRS} ${WINSDK_INCLUDE_DIR}) + + IF(WINSDK_OPENGL_INCLUDE_DIR) + SET(WINSDK_INCLUDE_DIRS ${WINSDK_INCLUDE_DIRS} ${WINSDK_OPENGL_INCLUDE_DIR}) + ENDIF() + + IF(WINSDK_WINRT_INCLUDE_DIR) + SET(WINSDK_INCLUDE_DIRS ${WINSDK_INCLUDE_DIRS} ${WINSDK_WINRT_INCLUDE_DIR}) + ENDIF() + INCLUDE_DIRECTORIES(${WINSDK_INCLUDE_DIRS}) - # Fix for using Windows SDK 7.1 with Visual C++ 2012 - IF(WINSDK_VERSION STREQUAL "7.1" AND MSVC11) + IF(WINSDK_UCRT_LIBRARY_DIR) + SET(CMAKE_LIBRARY_PATH ${WINSDK_UCRT_LIBRARY_DIR} ${CMAKE_LIBRARY_PATH}) + ENDIF() + + SET(CMAKE_LIBRARY_PATH ${WINSDK_LIBRARY_DIR} ${CMAKE_LIBRARY_PATH}) + + # Fix for using Windows SDK 7.1 with Visual C++ 2012, 2013, 2015 and 2017 + IF(WINSDK_VERSION STREQUAL "7.1" AND (MSVC11 OR MSVC12 OR MSVC14)) ADD_DEFINITIONS(-D_USING_V110_SDK71_) - ENDIF(WINSDK_VERSION STREQUAL "7.1" AND MSVC11) -ELSE(WINSDK_INCLUDE_DIR) + ENDIF() +ELSE() IF(NOT WindowsSDK_FIND_QUIETLY) MESSAGE(STATUS "Warning: Unable to find Windows SDK!") - ENDIF(NOT WindowsSDK_FIND_QUIETLY) -ENDIF(WINSDK_INCLUDE_DIR) + ENDIF() +ENDIF() diff --git a/code/CMakeModules/FindXF86VidMode.cmake b/code/CMakeModules/FindXF86VidMode.cmake index 88fa40ad7..15dae03de 100644 --- a/code/CMakeModules/FindXF86VidMode.cmake +++ b/code/CMakeModules/FindXF86VidMode.cmake @@ -7,7 +7,7 @@ IF(XF86VidMode_LIBRARY AND XF86VidMode_INCLUDE_DIR) # in cache already SET(XF86VidMode_FIND_QUIETLY TRUE) -ENDIF(XF86VidMode_LIBRARY AND XF86VidMode_INCLUDE_DIR) +ENDIF() FIND_PATH(XF86VidMode_INCLUDE_DIR @@ -37,10 +37,10 @@ IF(XF86VidMode_LIBRARY AND XF86VidMode_INCLUDE_DIR) SET(XF86VidMode_DEFINITIONS -DXF86VIDMODE) IF(NOT XF86VidMode_FIND_QUIETLY) MESSAGE(STATUS "Found XF86VidMode: ${XF86VidMode_LIBRARY}") - ENDIF(NOT XF86VidMode_FIND_QUIETLY) -ELSE(XF86VidMode_LIBRARY AND XF86VidMode_INCLUDE_DIR) + ENDIF() +ELSE() IF(NOT XF86VidMode_FIND_QUIETLY) MESSAGE(STATUS "Warning: Unable to find XF86VidMode!") - ENDIF(NOT XF86VidMode_FIND_QUIETLY) -ENDIF(XF86VidMode_LIBRARY AND XF86VidMode_INCLUDE_DIR) + ENDIF() +ENDIF() diff --git a/code/CMakeModules/Findassimp.cmake b/code/CMakeModules/Findassimp.cmake new file mode 100644 index 000000000..b4bf0da99 --- /dev/null +++ b/code/CMakeModules/Findassimp.cmake @@ -0,0 +1,63 @@ +IF(assimp_FIND_REQUIRED) + SET(ASSIMP_FIND_REQUIRED ON) +ENDIF() + +FIND_PATH( + ASSIMP_INCLUDE_DIRS + NAMES assimp/postprocess.h assimp/scene.h assimp/version.h assimp/config.h assimp/cimport.h + PATHS /usr/local/include/ +) + +FIND_LIBRARY( + ASSIMP_LIBRARY_RELEASE + NAMES assimp + PATHS /usr/local/lib/ +) + +FIND_LIBRARY( + IRRXML_LIBRARY_RELEASE + NAMES IrrXML + PATHS /usr/local/lib/ +) + +FIND_LIBRARY( + ASSIMP_LIBRARY_DEBUG + NAMES assimpd + PATHS /usr/local/lib/ +) + +FIND_LIBRARY( + IRRXML_LIBRARY_DEBUG + NAMES IrrXMLd + PATHS /usr/local/lib/ +) + +IF (ASSIMP_INCLUDE_DIRS) + SET(ASSIMP_FOUND TRUE) + IF(ASSIMP_LIBRARY_RELEASE) + SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} optimized ${ASSIMP_LIBRARY_RELEASE}) + ENDIF() + IF(ASSIMP_LIBRARY_DEBUG) + SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} debug ${ASSIMP_LIBRARY_DEBUG}) + ENDIF() + FIND_PACKAGE(ZLIB) + IF(ZLIB_FOUND) + SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} ${ZLIB_LIBRARIES}) + ENDIF() + IF(IRRXML_LIBRARY_RELEASE) + SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} optimized ${IRRXML_LIBRARY_RELEASE}) + ENDIF() + IF(IRRXML_LIBRARY_DEBUG) + SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} debug ${IRRXML_LIBRARY_DEBUG}) + ENDIF() +ENDIF() + +IF (ASSIMP_FOUND) + IF (NOT ASSIMP_FIND_QUIETLY) + MESSAGE(STATUS "Found asset importer library: ${ASSIMP_LIBRARIES}") + ENDIF () +ELSE (ASSIMP_FOUND) + IF (ASSIMP_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find asset importer library") + ENDIF () +ENDIF () diff --git a/code/CMakeModules/GetRevision.cmake b/code/CMakeModules/GetRevision.cmake index 21b234f74..dba90c765 100644 --- a/code/CMakeModules/GetRevision.cmake +++ b/code/CMakeModules/GetRevision.cmake @@ -2,50 +2,64 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3) # ROOT_DIR should be set to root of the repository (where to find the .svn or .hg directory) # SOURCE_DIR should be set to root of your code (where to find CMakeLists.txt) +# BINARY_DIR should be set to root of your build directory IF(SOURCE_DIR) # Replace spaces by semi-columns IF(CMAKE_MODULE_PATH) STRING(REPLACE " " ";" CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}) - ENDIF(CMAKE_MODULE_PATH) + ENDIF() SET(CMAKE_MODULE_PATH ${SOURCE_DIR}/CMakeModules ${CMAKE_MODULE_PATH}) IF(NOT ROOT_DIR AND SOURCE_DIR) SET(ROOT_DIR ${SOURCE_DIR}) - ENDIF(NOT ROOT_DIR AND SOURCE_DIR) + ENDIF() IF(NOT SOURCE_DIR AND ROOT_DIR) SET(SOURCE_DIR ${ROOT_DIR}) - ENDIF(NOT SOURCE_DIR AND ROOT_DIR) -ELSE(SOURCE_DIR) + ENDIF() +ELSE() SET(SOURCE_DIR ${CMAKE_SOURCE_DIR}) - SET(ROOT_DIR ${CMAKE_SOURCE_DIR}) -ENDIF(SOURCE_DIR) + SET(ROOT_DIR ${CMAKE_SOURCE_DIR}/..) + + # convert ROOT_DIR to absolute path + GET_FILENAME_COMPONENT(ROOT_DIR ${ROOT_DIR} ABSOLUTE) +ENDIF() MACRO(NOW RESULT) - IF (WIN32) - EXECUTE_PROCESS(COMMAND "wmic" "os" "get" "localdatetime" OUTPUT_VARIABLE DATETIME) - IF(NOT DATETIME MATCHES "ERROR") - STRING(REGEX REPLACE ".*\n([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9]).*" "\\1-\\2-\\3 \\4:\\5:\\6" ${RESULT} "${DATETIME}") - ENDIF(NOT DATETIME MATCHES "ERROR") - ELSEIF(UNIX) - EXECUTE_PROCESS(COMMAND "date" "+%Y-%m-%d %H:%M:%S" OUTPUT_VARIABLE DATETIME) - STRING(REGEX REPLACE "([0-9: -]+).*" "\\1" ${RESULT} "${DATETIME}") - ELSE (WIN32) - MESSAGE(SEND_ERROR "date not implemented") - SET(${RESULT} "0000-00-00 00:00:00") - ENDIF (WIN32) -ENDMACRO(NOW) + IF(CMAKE_VERSION VERSION_GREATER "2.8.10") + STRING(TIMESTAMP ${RESULT} "%Y-%m-%d %H:%M:%S") + ELSE() + IF(WIN32) + EXECUTE_PROCESS(COMMAND "wmic" "os" "get" "localdatetime" OUTPUT_VARIABLE DATETIME) + IF(NOT DATETIME MATCHES "ERROR") + STRING(REGEX REPLACE ".*\n([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9]).*" "\\1-\\2-\\3 \\4:\\5:\\6" ${RESULT} "${DATETIME}") + ENDIF() + ELSEIF(UNIX) + EXECUTE_PROCESS(COMMAND "date" "+%Y-%m-%d %H:%M:%S" OUTPUT_VARIABLE DATETIME) + STRING(REGEX REPLACE "([0-9: -]+).*" "\\1" ${RESULT} "${DATETIME}") + ELSE() + MESSAGE(SEND_ERROR "date not implemented") + SET(${RESULT} "0000-00-00 00:00:00") + ENDIF() + ENDIF() +ENDMACRO() IF(EXISTS "${ROOT_DIR}/.svn/") - FIND_PACKAGE(Subversion) + FIND_PACKAGE(Subversion QUIET) IF(SUBVERSION_FOUND) Subversion_WC_INFO(${ROOT_DIR} ER) SET(REVISION ${ER_WC_REVISION}) - ENDIF(SUBVERSION_FOUND) -ENDIF(EXISTS "${ROOT_DIR}/.svn/") + ENDIF() + + FIND_PACKAGE(TortoiseSVN QUIET) + + IF(TORTOISESVN_FOUND) + TORTOISESVN_GET_REVISION(${ROOT_DIR} REVISION) + ENDIF() +ENDIF() IF(EXISTS "${ROOT_DIR}/.hg/") FIND_PACKAGE(Mercurial) @@ -55,8 +69,8 @@ IF(EXISTS "${ROOT_DIR}/.hg/") SET(REVISION ${ER_WC_REVISION}) SET(CHANGESET ${ER_WC_CHANGESET}) SET(BRANCH ${ER_WC_BRANCH}) - ENDIF(MERCURIAL_FOUND) -ENDIF(EXISTS "${ROOT_DIR}/.hg/") + ENDIF() +ENDIF() # if processing exported sources, use "revision" file if exists IF(SOURCE_DIR AND NOT DEFINED REVISION) @@ -64,14 +78,11 @@ IF(SOURCE_DIR AND NOT DEFINED REVISION) IF(EXISTS ${REVISION_FILE}) FILE(STRINGS ${REVISION_FILE} REVISION LIMIT_COUNT 1) MESSAGE(STATUS "Read revision ${REVISION} from file") - ENDIF(EXISTS ${REVISION_FILE}) -ENDIF(SOURCE_DIR AND NOT DEFINED REVISION) + ENDIF() +ENDIF() -IF(SOURCE_DIR AND DEFINED REVISION) - IF(EXISTS ${SOURCE_DIR}/revision.h.in) - MESSAGE(STATUS "Revision: ${REVISION}") - NOW(BUILD_DATE) - CONFIGURE_FILE(${SOURCE_DIR}/revision.h.in revision.h.txt) - EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy revision.h.txt revision.h) # copy_if_different - ENDIF(EXISTS ${SOURCE_DIR}/revision.h.in) -ENDIF(SOURCE_DIR AND DEFINED REVISION) +IF(DEFINED REVISION) + MESSAGE(STATUS "Found revision ${REVISION}") +ELSE() + SET(REVISION 0) +ENDIF() diff --git a/code/CMakeModules/OSXToolChain.cmake b/code/CMakeModules/OSXToolChain.cmake new file mode 100644 index 000000000..3169aec78 --- /dev/null +++ b/code/CMakeModules/OSXToolChain.cmake @@ -0,0 +1,131 @@ +# Define OSX_SDK to force a specific version such as : -DOSX_SDK=10.11 +# +# Example: +# cmake ../code -DCMAKE_TOOLCHAIN_FILE=../code/CMakeModules/OSXToolChain.cmake -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_SERVER=OFF -DWITH_NEL_TOOLS=OFF -DWITH_RYZOM_TOOLS=OFF -DWITH_LUA51=OFF -DWITH_LUA53=ON -DCMAKE_BUILD_TYPE=Release -DWITH_RYZOM_INSTALLER=OFF -DWITH_RYZOM_PATCH=ON -DWITH_NEL_TESTS=OFF -DWITH_NEL_TOOLS=OFF -DWITH_TOOLS=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_WARNINGS=OFF -DWITH_QT5=OFF -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_STATIC_EXTERNAL=ON -DWITH_UNIX_STRUCTURE=OFF -DWITH_INSTALL_LIBRARIES=OFF -DWITH_RYZOM_SANDBOX=OFF -DOSX_SDK=10.11 + +# Don't forget to define environment variables: +# +# export MACOSX_DEPLOYMENT_TARGET=10.7 +# export OSXCROSS_GCC_NO_STATIC_RUNTIME=1 +# export PATH=$PATH:/home/src/osxcross/target/bin +# +# ln -s /usr/bin/hg /home/src/osxcross/target/bin/hg +# +# To install all dependencies: +# ./osxcross-macports install libxml2 jpeg curl libogg libvorbis freetype boost openssl zlib lua-5.3 giflib + +# to compile Luabind +# export CMAKE_MODULE_PATH=$HOME/shard/tools/external/cmake/modules +# cmake .. -DCMAKE_TOOLCHAIN_FILE=$HOME/ryzomcore/code/CMakeModules/OSXToolChain.cmake -DWITH_SHARED=OFF -DWITH_STATIC=ON -DWITH_LUA51=OFF -DWITH_LUA53=ON -DCMAKE_INSTALL_PREFIX=$HOME/osxcross/target/external + +IF(DEFINED CMAKE_CROSSCOMPILING) + # subsequent toolchain loading is not really needed + RETURN() +ENDIF() + +# Force the compilers to Clang for OS X + +# C +SET(CMAKE_C_COMPILER x86_64-apple-darwin15-clang) +SET(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") +SET(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert") +SET(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") +SET(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") +SET(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") + +# C++ +SET(CMAKE_CXX_COMPILER x86_64-apple-darwin15-clang++) +SET(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17") +SET(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") +SET(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") +SET(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") +SET(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") + +# make +SET(CMAKE_MAKE_PROGRAM make) + +# Skip the platform compiler checks for cross compiling. +SET(CMAKE_CXX_COMPILER_FORCED TRUE) +SET(CMAKE_C_COMPILER_FORCED TRUE) + +# Check if osxcross is installed +EXECUTE_PROCESS(COMMAND which ${CMAKE_CXX_COMPILER} OUTPUT_VARIABLE COMPILER_FULLPATH OUTPUT_STRIP_TRAILING_WHITESPACE) + +IF(NOT COMPILER_FULLPATH) + MESSAGE(FATAL_ERROR "Unable to find ${CMAKE_CXX_COMPILER}, are you sure osxcross is installed and is in PATH?") +ENDIF() + +# Default paths +GET_FILENAME_COMPONENT(CMAKE_OSX_TOOLCHAIN_ROOT ${COMPILER_FULLPATH} DIRECTORY) + +# Parent directory +GET_FILENAME_COMPONENT(CMAKE_OSX_TOOLCHAIN_ROOT ${CMAKE_OSX_TOOLCHAIN_ROOT} DIRECTORY) + +SET(CMAKE_OSX_SYSROOT ${CMAKE_OSX_TOOLCHAIN_ROOT}/SDK) +SET(MACPORTS_ROOT_DIR ${CMAKE_OSX_TOOLCHAIN_ROOT}/macports/pkgs/opt/local) +SET(EXTERNAL_OSX_PATH ${CMAKE_OSX_TOOLCHAIN_ROOT}/external) + +# List of all SDKs that have been found +SET(OSX_SDKS) + +FILE(GLOB _CMAKE_OSX_SDKS "${CMAKE_OSX_SYSROOT}/MacOSX*") +IF(_CMAKE_OSX_SDKS) + LIST(SORT _CMAKE_OSX_SDKS) + LIST(REVERSE _CMAKE_OSX_SDKS) + FOREACH(_CMAKE_OSX_SDK ${_CMAKE_OSX_SDKS}) + STRING(REGEX REPLACE ".+MacOSX([0-9.]+)\\.sdk" "\\1" _OSX_SDK "${_CMAKE_OSX_SDK}") + LIST(APPEND OSX_SDKS ${_OSX_SDK}) + ENDFOREACH() +ENDIF() + +# Find and use the most recent OS X sdk +IF(NOT OSX_SDKS) + MESSAGE(FATAL_ERROR "No OS X SDK's found in default search path ${CMAKE_OSX_SYSROOT}.") +ENDIF() + +# if a specific SDK is defined, try to use it +IF(OSX_SDK) + LIST(FIND OSX_SDKS "${OSX_SDK}" _INDEX) + IF(_INDEX EQUAL -1) + # if specified SDK doesn't exist, use the last one + LIST(GET OSX_SDKS 0 OSX_SDK) + ENDIF() +ELSE() + # use the last SDK + LIST(GET OSX_SDKS 0 OSX_SDK) +ENDIF() + +MESSAGE(STATUS "Using OS X SDK ${OSX_SDK}") + +# Define final OS X sysroot +SET(CMAKE_OSX_SYSROOT ${CMAKE_OSX_SYSROOT}/MacOSX${OSX_SDK}.sdk) + +# Standard settings +SET(CMAKE_SYSTEM_NAME Darwin) +SET(CMAKE_SYSTEM "Darwin-15.0.0") +SET(CMAKE_SYSTEM_VERSION "15.0.0") +SET(CMAKE_SYSTEM_PROCESSOR "x86_64") + +SET(UNIX ON) +SET(APPLE ON) + +# Set the find root to the OS X developer roots and to user defined paths +SET(CMAKE_FIND_ROOT_PATH ${CMAKE_OSX_TOOLCHAIN_ROOT} ${CMAKE_OSX_SYSROOT} ${CMAKE_PREFIX_PATH} ${CMAKE_INSTALL_PREFIX} ${MACPORTS_ROOT_DIR} ${EXTERNAL_OSX_PATH} $ENV{EXTERNAL_OSX_PATH} CACHE STRING "OS X find search path root") + +# default to searching for frameworks first +SET(CMAKE_FIND_FRAMEWORK FIRST) + +# set up the default search directories for frameworks +SET(CMAKE_SYSTEM_FRAMEWORK_PATH + ${CMAKE_OSX_SYSROOT}/System/Library/Frameworks + ${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks + ${CMAKE_OSX_SYSROOT}/Developer/Library/Frameworks +) + +# only search the OS X sdks, not the remainder of the host filesystem +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + +# determinate location for bin utils based on CMAKE_FIND_ROOT_PATH +INCLUDE(CMakeFindBinUtils) diff --git a/code/CMakeModules/PCHSupport.cmake b/code/CMakeModules/PCHSupport.cmake index 97b5ed88d..5069ec40f 100644 --- a/code/CMakeModules/PCHSupport.cmake +++ b/code/CMakeModules/PCHSupport.cmake @@ -10,171 +10,294 @@ IF(MSVC) SET(PCHSupport_FOUND TRUE) -ELSE(MSVC) +ELSE() IF(CMAKE_COMPILER_IS_GNUCXX) EXEC_PROGRAM(${CMAKE_CXX_COMPILER} ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion OUTPUT_VARIABLE gcc_compiler_version) - IF(gcc_compiler_version MATCHES "^4\\.1(\\.[0-9]+)?") + IF(gcc_compiler_version VERSION_LESS "4.2") SET(PCHSupport_FOUND FALSE) - ELSEIF(gcc_compiler_version MATCHES "^4\\.[0-9]+(\\.[0-9]+)?") + ELSE() SET(PCHSupport_FOUND TRUE) - ENDIF(gcc_compiler_version MATCHES "^4\\.1(\\.[0-9]+)?") - ELSE(CMAKE_COMPILER_IS_GNUCXX) + ENDIF() + ELSE() # TODO: make tests for other compilers than GCC SET(PCHSupport_FOUND TRUE) - ENDIF(CMAKE_COMPILER_IS_GNUCXX) -ENDIF(MSVC) + ENDIF() +ENDIF() + +MACRO(APPEND_DEFINITION _NAME _VAL) + IF(CMAKE_VERSION VERSION_LESS "2.8.12") + # don't support logical expressions, append definition + LIST(APPEND ${_NAME} "-D${_VAL}") + ELSE() + # support logical expressions, use them + LIST(APPEND ${_NAME} "$<$:-D$>") + ENDIF() +ENDMACRO() # Set PCH_FLAGS for common flags, PCH_ARCH_XXX_FLAGS for specific archs flags and PCH_ARCHS for archs MACRO(PCH_SET_COMPILE_FLAGS _target) SET(PCH_FLAGS) SET(PCH_ARCHS) + SET(PCH_INCLUDES) - SET(_FLAGS) - LIST(APPEND _FLAGS ${CMAKE_CXX_FLAGS}) + # Append target for clang if defined + IF(CMAKE_CXX_COMPILER_TARGET) + LIST(APPEND PCH_FLAGS "--target=${CMAKE_CXX_COMPILER_TARGET}") + ENDIF() + IF(CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN) + LIST(APPEND PCH_FLAGS "--gcc-toolchain=${CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN}") + ENDIF() + + IF(CMAKE_SYSROOT) + LIST(APPEND PCH_FLAGS "--sysroot=${CMAKE_SYSROOT}") + ENDIF() + + IF(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES) + FOREACH(item ${CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES}) + LIST(APPEND PCH_FLAGS "-isystem ${item}") + ENDFOREACH() + ENDIF() + + # C++ flags + SET(_FLAGS ${CMAKE_CXX_FLAGS}) + SEPARATE_ARGUMENTS(_FLAGS) + + LIST(APPEND PCH_FLAGS ${_FLAGS}) + + # C++ config flags STRING(TOUPPER "${CMAKE_BUILD_TYPE}" _UPPER_BUILD) - LIST(APPEND _FLAGS " ${CMAKE_CXX_FLAGS_${_UPPER_BUILD}}") + + SET(_FLAGS ${CMAKE_CXX_FLAGS_${_UPPER_BUILD}}) + SEPARATE_ARGUMENTS(_FLAGS) + + LIST(APPEND PCH_FLAGS ${_FLAGS}) GET_TARGET_PROPERTY(_targetType ${_target} TYPE) - IF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY) - LIST(APPEND _FLAGS " ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}") - ELSE(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY) + SET(_USE_PIC OFF) + + IF(${_targetType} STREQUAL "SHARED_LIBRARY" OR ${_targetType} STREQUAL "MODULE_LIBRARY") + SET(_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}) + SEPARATE_ARGUMENTS(_FLAGS) + LIST(APPEND PCH_FLAGS ${_FLAGS}) + ELSE() GET_TARGET_PROPERTY(_pic ${_target} POSITION_INDEPENDENT_CODE) IF(_pic) - LIST(APPEND _FLAGS " ${CMAKE_CXX_COMPILE_OPTIONS_PIE}") - ENDIF(_pic) - ENDIF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY) + SET(_USE_PIC ON) + ENDIF() + ENDIF() GET_DIRECTORY_PROPERTY(DIRINC INCLUDE_DIRECTORIES) FOREACH(item ${DIRINC}) - LIST(APPEND _FLAGS " -I\"${item}\"") - ENDFOREACH(item) + LIST(APPEND PCH_INCLUDES "${item}") + ENDFOREACH() + + # NOTE: As cmake files (eg FindQT4) may now use generator expressions around their defines that evaluate + # to an empty string, wrap all "items" in an expression that outputs a -D IFF the generated + # expression is not empty. # Required for CMake 2.6 SET(GLOBAL_DEFINITIONS) GET_DIRECTORY_PROPERTY(DEFINITIONS COMPILE_DEFINITIONS) IF(DEFINITIONS) FOREACH(item ${DEFINITIONS}) - LIST(APPEND GLOBAL_DEFINITIONS " -D${item}") - ENDFOREACH(item) - ENDIF(DEFINITIONS) + APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item}) + ENDFOREACH() + ENDIF() GET_DIRECTORY_PROPERTY(DEFINITIONS COMPILE_DEFINITIONS_${_UPPER_BUILD}) IF(DEFINITIONS) FOREACH(item ${DEFINITIONS}) - LIST(APPEND GLOBAL_DEFINITIONS " -D${item}") - ENDFOREACH(item) - ENDIF(DEFINITIONS) + APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item}) + ENDFOREACH() + ENDIF() + + GET_DIRECTORY_PROPERTY(DEFINITIONS DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMPILE_DEFINITIONS) + IF(DEFINITIONS) + FOREACH(item ${DEFINITIONS}) + APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item}) + ENDFOREACH() + ENDIF() + + GET_DIRECTORY_PROPERTY(DEFINITIONS DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMPILE_DEFINITIONS_${_UPPER_BUILD}) + IF(DEFINITIONS) + FOREACH(item ${DEFINITIONS}) + APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item}) + ENDFOREACH() + ENDIF() GET_TARGET_PROPERTY(oldProps ${_target} COMPILE_FLAGS) IF(oldProps) - LIST(APPEND _FLAGS " ${oldProps}") - ENDIF(oldProps) + SET(_FLAGS ${oldProps}) + SEPARATE_ARGUMENTS(_FLAGS) + LIST(APPEND PCH_FLAGS ${_FLAGS}) + ENDIF() GET_TARGET_PROPERTY(oldPropsBuild ${_target} COMPILE_FLAGS_${_UPPER_BUILD}) IF(oldPropsBuild) - LIST(APPEND _FLAGS " ${oldPropsBuild}") - ENDIF(oldPropsBuild) + SET(_FLAGS ${oldPropsBuild}) + SEPARATE_ARGUMENTS(_FLAGS) + LIST(APPEND PCH_FLAGS ${_FLAGS}) + ENDIF() GET_TARGET_PROPERTY(DIRINC ${_target} INCLUDE_DIRECTORIES) IF(DIRINC) FOREACH(item ${DIRINC}) - LIST(APPEND _FLAGS " -I\"${item}\"") - ENDFOREACH(item) - ENDIF(DIRINC) + LIST(APPEND PCH_INCLUDES "${item}") + ENDFOREACH() + ENDIF() GET_TARGET_PROPERTY(DEFINITIONS ${_target} COMPILE_DEFINITIONS) IF(DEFINITIONS) FOREACH(item ${DEFINITIONS}) - LIST(APPEND GLOBAL_DEFINITIONS " -D${item}") - ENDFOREACH(item) - ENDIF(DEFINITIONS) + APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item}) + ENDFOREACH() + ENDIF() GET_TARGET_PROPERTY(DEFINITIONS ${_target} COMPILE_DEFINITIONS_${_UPPER_BUILD}) IF(DEFINITIONS) FOREACH(item ${DEFINITIONS}) - LIST(APPEND GLOBAL_DEFINITIONS " -D${item}") - ENDFOREACH(item) - ENDIF(DEFINITIONS) - - GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS) - GET_DIRECTORY_PROPERTY(_directory_definitions DIRECTORY ${CMAKE_SOURCE_DIR} DEFINITIONS) - LIST(APPEND _FLAGS " ${GLOBAL_DEFINITIONS}") - LIST(APPEND _FLAGS " ${_directory_flags}") - LIST(APPEND _FLAGS " ${_directory_definitions}") - - # Format definitions - IF(MSVC) - # Fix path with space - SEPARATE_ARGUMENTS(_FLAGS UNIX_COMMAND "${_FLAGS}") - ELSE(MSVC) - STRING(REGEX REPLACE " +" " " _FLAGS ${_FLAGS}) - SEPARATE_ARGUMENTS(_FLAGS) - ENDIF(MSVC) - - IF(CLANG) - # Determining all architectures and get common flags - SET(_ARCH_NEXT) - SET(_XARCH_NEXT) - FOREACH(item ${_FLAGS}) - IF(_ARCH_NEXT) - LIST(FIND PCH_ARCHS ${item} ITEM_FOUND) - IF(ITEM_FOUND EQUAL -1) - LIST(APPEND PCH_ARCHS ${item}) - STRING(TOUPPER "${item}" _UPPER_ARCH) - SET(PCH_ARCH_${_UPPER_ARCH}_FLAGS "-arch" ${item}) - ENDIF(ITEM_FOUND EQUAL -1) - SET(_ARCH_NEXT OFF) - ELSEIF(_XARCH_NEXT) - SET(_XARCH_NEXT OFF) - ELSE(_ARCH_NEXT) - IF(item MATCHES "^-arch") - SET(_ARCH_NEXT ON) - ELSEIF(item MATCHES "^-Xarch_") - STRING(REGEX REPLACE "-Xarch_([a-z0-9_]+)" "\\1" item ${item}) - LIST(FIND PCH_ARCHS ${item} ITEM_FOUND) - IF(ITEM_FOUND EQUAL -1) - LIST(APPEND PCH_ARCHS ${item}) - STRING(TOUPPER "${item}" _UPPER_ARCH) - SET(PCH_ARCH_${_UPPER_ARCH}_FLAGS "-arch" ${item}) - ENDIF(ITEM_FOUND EQUAL -1) - SET(_XARCH_NEXT ON) - ELSE(item MATCHES "^-arch") - LIST(APPEND PCH_FLAGS ${item}) - ENDIF(item MATCHES "^-arch") - ENDIF(_ARCH_NEXT) - ENDFOREACH(item) - - # Get architcture specific flags - SET(_XARCH_NEXT) - FOREACH(item ${_FLAGS}) - IF(_XARCH_NEXT) - STRING(TOUPPER "${_XARCH_NEXT}" _UPPER_XARCH) - LIST(APPEND PCH_ARCH_${_UPPER_XARCH}_FLAGS ${item}) - SET(_XARCH_NEXT OFF) - ELSE(_XARCH_NEXT) - IF(item MATCHES "^-Xarch_") - STRING(SUBSTRING "${item}" 7 -1 _XARCH_NEXT) - ENDIF(item MATCHES "^-Xarch_") - ENDIF(_XARCH_NEXT) - ENDFOREACH(item) - - # Remove duplicated architectures - IF(_ARCHS AND PCH_ARCHS) - LIST(REMOVE_DUPLICATES PCH_ARCHS) - ENDIF(_ARCHS AND PCH_ARCHS) - ELSE(CLANG) - SET(PCH_FLAGS ${_FLAGS}) - ENDIF(CLANG) - - IF(PCH_FLAGS) - LIST(REMOVE_DUPLICATES PCH_FLAGS) - ENDIF(PCH_FLAGS) -ENDMACRO(PCH_SET_COMPILE_FLAGS) + APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item}) + ENDFOREACH() + ENDIF() + + GET_TARGET_PROPERTY(OPTIONS ${_target} COMPILE_OPTIONS) + IF(OPTIONS) + SEPARATE_ARGUMENTS(OPTIONS) + LIST(APPEND PCH_FLAGS ${OPTIONS}) + ENDIF() + + GET_TARGET_PROPERTY(OPTIONS ${_target} COMPILE_OPTIONS_${_UPPER_BUILD}) + IF(OPTIONS) + SEPARATE_ARGUMENTS(OPTIONS) + LIST(APPEND PCH_FLAGS ${OPTIONS}) + ENDIF() + + GET_TARGET_PROPERTY(_LIBS ${_target} INTERFACE_LINK_LIBRARIES) + IF(_LIBS) + FOREACH(_LIB ${_LIBS}) + IF(TARGET "${_LIB}") + # use same include directories + GET_TARGET_PROPERTY(_DIRS ${_LIB} INTERFACE_INCLUDE_DIRECTORIES) + + IF(_DIRS) + FOREACH(item ${_DIRS}) + LIST(APPEND PCH_INCLUDES "${item}") + ENDFOREACH() + ENDIF() + + # use same compile definitions + GET_TARGET_PROPERTY(_DEFINITIONS ${_LIB} INTERFACE_COMPILE_DEFINITIONS) + + IF(_DEFINITIONS) + FOREACH(item ${_DEFINITIONS}) + APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item}) + ENDFOREACH() + ENDIF() + ENDIF() + ENDFOREACH() + ENDIF() + + # Special Qt 5 cases + IF(GLOBAL_DEFINITIONS MATCHES "QT_CORE_LIB") + # Hack to define missing QT_NO_DEBUG with Qt 5.2 + IF(_UPPER_BUILD STREQUAL "RELEASE") + LIST(APPEND GLOBAL_DEFINITIONS "-DQT_NO_DEBUG") + ENDIF() + + # Qt5_POSITION_INDEPENDENT_CODE should be true if Qt was compiled with PIC + IF(Qt5_POSITION_INDEPENDENT_CODE) + SET(_USE_PIC ON) + ENDIF() + + IF(_USE_PIC) + LIST(APPEND PCH_FLAGS ${CMAKE_CXX_COMPILE_OPTIONS_PIC}) + ENDIF() + ENDIF() + + IF(CMAKE_VERSION VERSION_LESS "3.3.0") + GET_DIRECTORY_PROPERTY(_DIRECTORY_FLAGS DEFINITIONS) + + IF(_DIRECTORY_FLAGS) + SEPARATE_ARGUMENTS(_DIRECTORY_FLAGS) + FOREACH(item ${_DIRECTORY_FLAGS}) + LIST(APPEND PCH_FLAGS "${item}") + ENDFOREACH() + ENDIF() + + GET_DIRECTORY_PROPERTY(_DIRECTORY_DEFINITIONS DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEFINITIONS) + + IF(_DIRECTORY_DEFINITIONS) + SEPARATE_ARGUMENTS(_DIRECTORY_DEFINITIONS) + FOREACH(item ${_DIRECTORY_DEFINITIONS}) + LIST(APPEND PCH_FLAGS "${item}") + ENDFOREACH() + ENDIF() + ENDIF() + + IF(CMAKE_CXX11_EXTENSION_COMPILE_OPTION) + LIST(APPEND PCH_FLAGS "${CMAKE_CXX11_EXTENSION_COMPILE_OPTION}") + ENDIF() + + # Already in list form and items may contain non-leading spaces that should not be split on + LIST(APPEND PCH_FLAGS "${GLOBAL_DEFINITIONS}") + + IF(WIN32) + SET(SYSTEM_FLAG "[-/$]") + ELSE() + SET(SYSTEM_FLAG "[-$]") + ENDIF() + + SET(_FINAL_FLAGS) + SET(_PREVIOUS_FLAG) + + FOREACH(_FLAG ${PCH_FLAGS}) + # If parameter is really a flag (starts with -) + IF(_FLAG MATCHES "^${SYSTEM_FLAG}") + IF(_PREVIOUS_FLAG) + # Append previous flag + LIST(APPEND _FINAL_FLAGS ${_PREVIOUS_FLAG}) + ENDIF() + + SET(_PREVIOUS_FLAG ${_FLAG}) + ELSE() + IF(_PREVIOUS_FLAG) + # Append previous flag and its parameter + # TODO: escape them only if there is an space + LIST(APPEND _FINAL_FLAGS "${_PREVIOUS_FLAG} \"${_FLAG}\"") + SET(_PREVIOUS_FLAG) + ELSE() + # Shouldn't happen + MESSAGE(FATAL_ERROR "No previous flag before ${_FLAG}") + ENDIF() + ENDIF() + ENDFOREACH() + + IF(_PREVIOUS_FLAG) + LIST(APPEND _FINAL_FLAGS ${_PREVIOUS_FLAG}) + ENDIF() + + SET(PCH_FLAGS ${_FINAL_FLAGS}) + + # Remove flags that don't work with PCH + LIST(REMOVE_ITEM PCH_FLAGS "-Wa,--noexecstack") + + # Remove all empty parameters + LIST(REMOVE_ITEM PCH_FLAGS "") + + # Remove duplicate parameters + LIST(REMOVE_DUPLICATES PCH_FLAGS) + + # create a command-line string + STRING(REGEX REPLACE ";" " " PCH_FLAGS "${PCH_FLAGS}") + + # and separate arguments + SEPARATE_ARGUMENTS(PCH_FLAGS) +ENDMACRO() MACRO(GET_PDB_FILENAME _out_filename _target) # determine output directory based on target type @@ -183,44 +306,60 @@ MACRO(GET_PDB_FILENAME _out_filename _target) SET(_targetOutput ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) ELSEIF(${_targetType} STREQUAL STATIC_LIBRARY) SET(_targetOutput ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}) - ELSE(${_targetType} STREQUAL EXECUTABLE) + ELSE() SET(_targetOutput ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) - ENDIF(${_targetType} STREQUAL EXECUTABLE) + ENDIF() # determine target postfix STRING(TOUPPER "${CMAKE_BUILD_TYPE}_POSTFIX" _postfix_var_name) GET_TARGET_PROPERTY(_targetPostfix ${_target} ${_postfix_var_name}) IF(${_targetPostfix} MATCHES NOTFOUND) SET(_targetPostfix "") - ENDIF(${_targetPostfix} MATCHES NOTFOUND) + ENDIF() SET(${_out_filename} "${_targetOutput}/${_target}${_targetPostfix}.pdb") ENDMACRO(GET_PDB_FILENAME) -MACRO(PCH_SET_COMPILE_COMMAND _inputcpp _compile_FLAGS) +MACRO(PCH_SET_COMPILE_COMMAND _inputcpp _compile_FLAGS _includes) IF(CMAKE_CXX_COMPILER_ARG1) # remove leading space in compiler argument STRING(REGEX REPLACE "^ +" "" pchsupport_compiler_cxx_arg1 ${CMAKE_CXX_COMPILER_ARG1}) - ELSE(CMAKE_CXX_COMPILER_ARG1) + ELSE() SET(pchsupport_compiler_cxx_arg1 "") - ENDIF(CMAKE_CXX_COMPILER_ARG1) + ENDIF() IF(MSVC) - GET_PDB_FILENAME(PDB_FILE ${_PCH_current_target}) - SET(PCH_COMMAND ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} /Yc /Fp"${PCH_OUTPUT}" ${_inputcpp} /Fd"${PDB_FILE}" /c /Fo"${PCH_OUTPUT}.obj") + GET_PDB_FILENAME(_PDB_FILE ${_PCH_current_target}) + + SET(PCH_TEMP_CONTENT) + + FOREACH(_include ${_includes}) + SET(PCH_TEMP_CONTENT "${PCH_TEMP_CONTENT} -I \"${_include}\"") + ENDFOREACH() + + SET(PCH_TEMP_FILE ${CMAKE_CURRENT_BINARY_DIR}/pch_command.txt) + FILE(WRITE ${PCH_TEMP_FILE} "${PCH_TEMP_CONTENT}") + + SET(PCH_COMMAND ${CMAKE_CXX_COMPILER} /nologo @${PCH_TEMP_FILE} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} /Yc /Fp"${PCH_OUTPUT}" ${_inputcpp} /Fd"${_PDB_FILE}" /c /Fo"${PCH_OUTPUT}.obj") + # Ninja PCH Support # http://public.kitware.com/pipermail/cmake-developers/2012-March/003653.html SET_SOURCE_FILES_PROPERTIES(${_inputcpp} PROPERTIES OBJECT_OUTPUTS "${PCH_OUTPUT}.obj") - ELSE(MSVC) + ELSE() SET(HEADER_FORMAT "c++-header") - SET(_FLAGS "") + SET(_FLAGS) IF(APPLE) SET(HEADER_FORMAT "objective-${HEADER_FORMAT}") - SET(_FLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch) - ENDIF(APPLE) + LIST(APPEND _FLAGS ${OBJC_FLAGS}) + ENDIF() + + FOREACH(_include ${_includes}) + LIST(APPEND _FLAGS -I "${_include}") + ENDFOREACH() + SET(PCH_COMMAND ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} ${_FLAGS} -x ${HEADER_FORMAT} -o ${PCH_OUTPUT} -c ${PCH_INPUT}) - ENDIF(MSVC) -ENDMACRO(PCH_SET_COMPILE_COMMAND) + ENDIF() +ENDMACRO() MACRO(PCH_SET_PRECOMPILED_HEADER_OUTPUT _targetName _input _arch _language) SET(_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${_targetName}_pch") @@ -230,14 +369,14 @@ MACRO(PCH_SET_PRECOMPILED_HEADER_OUTPUT _targetName _input _arch _language) GET_FILENAME_COMPONENT(_name ${_input} NAME_WE) SET(PCH_INPUT ${_input}) SET(PCH_OUTPUT "${_OUTPUT_DIR}/${_name}.pch") - ELSE(MSVC) + ELSE() IF(NOT "${_arch}" STREQUAL "") SET(_OUTPUT_DIR "${_OUTPUT_DIR}_${_arch}") - ENDIF(NOT "${_arch}" STREQUAL "") + ENDIF() IF(NOT "${_language}" STREQUAL "") SET(_OUTPUT_DIR "${_OUTPUT_DIR}_${_language}") - ENDIF(NOT "${_language}" STREQUAL "") + ENDIF() GET_FILENAME_COMPONENT(_name ${_input} NAME) @@ -251,14 +390,14 @@ MACRO(PCH_SET_PRECOMPILED_HEADER_OUTPUT _targetName _input _arch _language) IF(CLANG) SET(PCH_EXT "pth") - ELSE(CLANG) + ELSE() SET(PCH_EXT "gch") - ENDIF(CLANG) + ENDIF() # For GCC and Clang, PCH needs to be in the same directory as .h SET(PCH_OUTPUT "${_OUTPUT_DIR}/${_name}.${PCH_EXT}") - ENDIF(MSVC) -ENDMACRO(PCH_SET_PRECOMPILED_HEADER_OUTPUT) + ENDIF() +ENDMACRO() # Add common flags MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName) @@ -266,7 +405,7 @@ MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName) IF(${oldProps} MATCHES NOTFOUND) SET(oldProps "") - ENDIF(${oldProps} MATCHES NOTFOUND) + ENDIF() IF(MSVC) SET(_target_cflags "${oldProps} /Yu\"${PCH_INPUT}\" /FI\"${PCH_INPUT}\" /Fp\"${PCH_OUTPUT}\"") @@ -279,17 +418,17 @@ MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName) GET_TARGET_PROPERTY(_STATIC_LIBRARY_FLAGS ${_targetName} STATIC_LIBRARY_FLAGS) IF(NOT _STATIC_LIBRARY_FLAGS) SET(_STATIC_LIBRARY_FLAGS) - ENDIF(NOT _STATIC_LIBRARY_FLAGS) + ENDIF() SET(_STATIC_LIBRARY_FLAGS "${PCH_OUTPUT}.obj ${_STATIC_LIBRARY_FLAGS}") GET_TARGET_PROPERTY(_LINK_FLAGS ${_targetName} LINK_FLAGS) IF(NOT _LINK_FLAGS) SET(_LINK_FLAGS) - ENDIF(NOT _LINK_FLAGS) + ENDIF() SET(_LINK_FLAGS "${PCH_OUTPUT}.obj ${_LINK_FLAGS}") SET_TARGET_PROPERTIES(${_targetName} PROPERTIES STATIC_LIBRARY_FLAGS ${_STATIC_LIBRARY_FLAGS} LINK_FLAGS ${_LINK_FLAGS}) - ELSE(MSVC) + ELSE() # for use with distcc and gcc >4.0.1 if preprocessed files are accessible # on all remote machines set # PCH_ADDITIONAL_COMPILER_FLAGS to -fpch-preprocess @@ -299,21 +438,22 @@ MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName) # If no arch is specified, create common flags IF(PCH_ARCHS_COUNT LESS 2) SET(PCH_ADDITIONAL_COMPILER_FLAGS "-include ${PCH_INPUT} ${PCH_ADDITIONAL_COMPILER_FLAGS}") - ENDIF(PCH_ARCHS_COUNT LESS 2) + ENDIF() IF(APPLE) - SET(PCH_ADDITIONAL_COMPILER_FLAGS "-fobjc-abi-version=2 -fobjc-legacy-dispatch -x objective-c++ ${PCH_ADDITIONAL_COMPILER_FLAGS}") - ENDIF(APPLE) - + STRING(REPLACE ";" " " OBJC_FLAGS_STR "${OBJC_FLAGS}") + SET(PCH_ADDITIONAL_COMPILER_FLAGS "${OBJC_FLAGS_STR} -x objective-c++ ${PCH_ADDITIONAL_COMPILER_FLAGS}") + ENDIF() + IF(WITH_PCH_DEBUG) SET(PCH_ADDITIONAL_COMPILER_FLAGS "-H ${PCH_ADDITIONAL_COMPILER_FLAGS}") - ENDIF(WITH_PCH_DEBUG) + ENDIF() SET(_target_cflags "${oldProps} ${PCH_ADDITIONAL_COMPILER_FLAGS} -Winvalid-pch") - ENDIF(MSVC) + ENDIF() SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS ${_target_cflags}) -ENDMACRO(ADD_PRECOMPILED_HEADER_TO_TARGET) +ENDMACRO() # Add specific flags for an arch MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET_ARCH _targetName _arch) @@ -324,19 +464,19 @@ MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET_ARCH _targetName _arch) IF(${_FLAGS} MATCHES NOTFOUND) SET(_FLAGS "") - ENDIF(${_FLAGS} MATCHES NOTFOUND) + ENDIF() SET(_FLAGS "${_FLAGS} -Xarch_${_arch} -include${PCH_INPUT}") SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS ${_FLAGS}) - ENDIF(PCH_ARCHS_COUNT GREATER 1) -ENDMACRO(ADD_PRECOMPILED_HEADER_TO_TARGET_ARCH) + ENDIF() +ENDMACRO() MACRO(PCH_CREATE_TARGET _targetName _targetNamePCH) ADD_CUSTOM_COMMAND(OUTPUT ${PCH_OUTPUT} COMMAND ${PCH_COMMAND} COMMENT "Generating ${_targetNamePCH}" DEPENDS ${PCH_INPUT}) ADD_CUSTOM_TARGET(${_targetNamePCH} DEPENDS ${PCH_INPUT} ${PCH_OUTPUT}) ADD_DEPENDENCIES(${_targetName} ${_targetNamePCH}) -ENDMACRO(PCH_CREATE_TARGET _targetName _inputh _inputcpp) +ENDMACRO() MACRO(ADD_PRECOMPILED_HEADER _targetName _inputh _inputcpp) SET(_PCH_current_target ${_targetName}) @@ -346,7 +486,7 @@ MACRO(ADD_PRECOMPILED_HEADER _targetName _inputh _inputcpp) "This is the ADD_PRECOMPILED_HEADER macro. " "You must set CMAKE_BUILD_TYPE!" ) - ENDIF(NOT CMAKE_BUILD_TYPE) + ENDIF() PCH_SET_COMPILE_FLAGS(${_targetName}) @@ -358,72 +498,77 @@ MACRO(ADD_PRECOMPILED_HEADER _targetName _inputh _inputcpp) PCH_SET_PRECOMPILED_HEADER_OUTPUT(${_targetName} ${_inputh} ${_ARCH} "") LIST(APPEND PCH_OUTPUTS ${PCH_OUTPUT}) - PCH_SET_COMPILE_COMMAND(${_inputcpp} "${PCH_ARCH_${_UPPER_ARCH}_FLAGS};${PCH_FLAGS}") + PCH_SET_COMPILE_COMMAND(${_inputcpp} "${PCH_ARCH_${_UPPER_ARCH}_FLAGS};${PCH_FLAGS}" "${PCH_INCLUDES}") PCH_CREATE_TARGET(${_targetName} ${_targetName}_pch_${_ARCH}) ADD_PRECOMPILED_HEADER_TO_TARGET_ARCH(${_targetName} ${_ARCH}) - ENDFOREACH(_ARCH) - ELSE(PCH_ARCHS) + ENDFOREACH() + ELSE() PCH_SET_PRECOMPILED_HEADER_OUTPUT(${_targetName} ${_inputh} "" "") LIST(APPEND PCH_OUTPUTS ${PCH_OUTPUT}) - PCH_SET_COMPILE_COMMAND(${_inputcpp} "${PCH_FLAGS}") + PCH_SET_COMPILE_COMMAND(${_inputcpp} "${PCH_FLAGS}" "${PCH_INCLUDES}") PCH_CREATE_TARGET(${_targetName} ${_targetName}_pch) - ENDIF(PCH_ARCHS) + ENDIF() ADD_PRECOMPILED_HEADER_TO_TARGET(${_targetName}) SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PCH_OUTPUTS}") -ENDMACRO(ADD_PRECOMPILED_HEADER) +ENDMACRO() MACRO(ADD_NATIVE_PRECOMPILED_HEADER _targetName _inputh _inputcpp) - IF(NOT PCHSupport_FOUND) + IF(PCHSupport_FOUND) + # 0 => creating a new target for PCH, works for all makefiles + # 1 => setting PCH for VC++ project, works for VC++ projects + # 2 => setting PCH for XCode project, works for XCode projects + IF(CMAKE_GENERATOR MATCHES "Visual Studio") + SET(PCH_METHOD 1) + ELSEIF(CMAKE_GENERATOR MATCHES "Xcode") + SET(PCH_METHOD 2) + ELSE() + SET(PCH_METHOD 0) + ENDIF() + + IF(PCH_METHOD EQUAL 1) + # Auto include the precompile (useful for moc processing, since the use of + # precompiled is specified at the target level + # and I don't want to specifiy /F- for each moc/res/ui generated files (using Qt) + + GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS) + IF(${oldProps} MATCHES NOTFOUND) + SET(oldProps "") + ENDIF() + + SET(newProperties "${oldProps} /Yu\"${_inputh}\" /FI\"${_inputh}\"") + SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS "${newProperties}") + + #also inlude ${oldProps} to have the same compile options + SET_SOURCE_FILES_PROPERTIES(${_inputcpp} PROPERTIES COMPILE_FLAGS "${oldProps} /Yc\"${_inputh}\"") + ELSEIF(PCH_METHOD EQUAL 2) + # For Xcode, cmake needs my patch to process + # GCC_PREFIX_HEADER and GCC_PRECOMPILE_PREFIX_HEADER as target properties + + # When buiding out of the tree, precompiled may not be located + # Use full path instead. + GET_FILENAME_COMPONENT(fullPath ${_inputh} ABSOLUTE) + + SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${fullPath}") + SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES") + ELSE() + #Fallback to the "old" precompiled suppport + IF(CMAKE_OSX_ARCHITECTURES AND TARGETS_COUNT GREATER 1) + FOREACH(_ARCH ${CMAKE_OSX_ARCHITECTURES}) + ADD_PRECOMPILED_HEADER(${_targetName}_${_ARCH} ${_inputh} ${_inputcpp}) + ENDFOREACH() + ELSE() + ADD_PRECOMPILED_HEADER(${_targetName} ${_inputh} ${_inputcpp}) + ENDIF() + ENDIF() + + IF(TARGET ${_targetName}_static) + ADD_NATIVE_PRECOMPILED_HEADER(${_targetName}_static ${_inputh} ${_inputcpp}) + ENDIF() + ELSE() MESSAGE(STATUS "PCH disabled because compiler doesn't support them") - RETURN() - ENDIF(NOT PCHSupport_FOUND) - - # 0 => creating a new target for PCH, works for all makefiles - # 1 => setting PCH for VC++ project, works for VC++ projects - # 2 => setting PCH for XCode project, works for XCode projects - IF(CMAKE_GENERATOR MATCHES "Visual Studio") - SET(PCH_METHOD 1) - ELSEIF(CMAKE_GENERATOR MATCHES "Xcode") - SET(PCH_METHOD 2) - ELSE(CMAKE_GENERATOR MATCHES "Visual Studio") - SET(PCH_METHOD 0) - ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio") - - IF(PCH_METHOD EQUAL 1) - # Auto include the precompile (useful for moc processing, since the use of - # precompiled is specified at the target level - # and I don't want to specifiy /F- for each moc/res/ui generated files (using Qt) - - GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS) - IF(${oldProps} MATCHES NOTFOUND) - SET(oldProps "") - ENDIF(${oldProps} MATCHES NOTFOUND) - - SET(newProperties "${oldProps} /Yu\"${_inputh}\" /FI\"${_inputh}\"") - SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS "${newProperties}") - - #also inlude ${oldProps} to have the same compile options - SET_SOURCE_FILES_PROPERTIES(${_inputcpp} PROPERTIES COMPILE_FLAGS "${oldProps} /Yc\"${_inputh}\"") - ELSEIF(PCH_METHOD EQUAL 2) - # For Xcode, cmake needs my patch to process - # GCC_PREFIX_HEADER and GCC_PRECOMPILE_PREFIX_HEADER as target properties - - # When buiding out of the tree, precompiled may not be located - # Use full path instead. - GET_FILENAME_COMPONENT(fullPath ${_inputh} ABSOLUTE) - - SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${fullPath}") - SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES") - ELSE(PCH_METHOD EQUAL 1) - #Fallback to the "old" precompiled suppport - ADD_PRECOMPILED_HEADER(${_targetName} ${_inputh} ${_inputcpp}) - ENDIF(PCH_METHOD EQUAL 1) - - IF(TARGET ${_targetName}_static) - ADD_NATIVE_PRECOMPILED_HEADER(${_targetName}_static ${_inputh} ${_inputcpp}) - ENDIF(TARGET ${_targetName}_static) -ENDMACRO(ADD_NATIVE_PRECOMPILED_HEADER) + ENDIF() +ENDMACRO() diff --git a/code/CMakeModules/iOSToolChain.cmake b/code/CMakeModules/iOSToolChain.cmake index 5b419778e..7bcb57227 100644 --- a/code/CMakeModules/iOSToolChain.cmake +++ b/code/CMakeModules/iOSToolChain.cmake @@ -35,53 +35,55 @@ SET(UNIX ON) SET(APPLE ON) SET(IOS ON) -# Force the compilers to Clang for iOS -include (CMakeForceCompiler) -CMAKE_FORCE_C_COMPILER (clang Clang) -CMAKE_FORCE_CXX_COMPILER (clang++ Clang) - # Setup iOS platform -if (NOT DEFINED IOS_PLATFORM) - set (IOS_PLATFORM "OS") -endif (NOT DEFINED IOS_PLATFORM) -set (IOS_PLATFORM ${IOS_PLATFORM} CACHE STRING "Type of iOS Platform") +IF(NOT DEFINED IOS_PLATFORM) + SET(IOS_PLATFORM "OS") +ENDIF() + +SET(IOS_PLATFORM ${IOS_PLATFORM} CACHE STRING "Type of iOS Platform") SET(IOS_PLATFORM_LOCATION "iPhoneOS.platform") SET(IOS_SIMULATOR_PLATFORM_LOCATION "iPhoneSimulator.platform") # Check the platform selection and setup for developer root -if (${IOS_PLATFORM} STREQUAL "OS") +if(${IOS_PLATFORM} STREQUAL "OS") # This causes the installers to properly locate the output libraries set (CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos") -elseif (${IOS_PLATFORM} STREQUAL "SIMULATOR") +elseif(${IOS_PLATFORM} STREQUAL "SIMULATOR") # This causes the installers to properly locate the output libraries set (CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphonesimulator") -elseif (${IOS_PLATFORM} STREQUAL "ALL") +elseif(${IOS_PLATFORM} STREQUAL "ALL") # This causes the installers to properly locate the output libraries set (CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphonesimulator;-iphoneos") -else (${IOS_PLATFORM} STREQUAL "OS") +else() message (FATAL_ERROR "Unsupported IOS_PLATFORM value selected. Please choose OS or SIMULATOR") -endif (${IOS_PLATFORM} STREQUAL "OS") +endif() set (CMAKE_XCODE_EFFECTIVE_PLATFORMS ${CMAKE_XCODE_EFFECTIVE_PLATFORMS} CACHE PATH "iOS Platform") # Setup iOS developer location unless specified manually with CMAKE_IOS_DEVELOPER_ROOT # Note Xcode 4.3 changed the installation location, choose the most recent one available -SET(XCODE_POST_43_ROOT "/Applications/Xcode.app/Contents/Developer/Platforms") -SET(XCODE_PRE_43_ROOT "/Developer/Platforms") +SET(XCODE_DEFAULT_ROOT "/Applications/Xcode.app/Contents") IF(NOT DEFINED CMAKE_IOS_DEVELOPER_ROOT) - IF(EXISTS ${XCODE_POST_43_ROOT}) - SET(CMAKE_XCODE_ROOT ${XCODE_POST_43_ROOT}) - ELSEIF(EXISTS ${XCODE_PRE_43_ROOT}) - SET(CMAKE_XCODE_ROOT ${XCODE_PRE_43_ROOT}) - ENDIF(EXISTS ${XCODE_POST_43_ROOT}) - IF(EXISTS ${CMAKE_XCODE_ROOT}/${IOS_PLATFORM_LOCATION}/Developer) - SET(CMAKE_IOS_DEVELOPER_ROOT ${CMAKE_XCODE_ROOT}/${IOS_PLATFORM_LOCATION}/Developer) - ENDIF(EXISTS ${CMAKE_XCODE_ROOT}/${IOS_PLATFORM_LOCATION}/Developer) - IF(EXISTS ${CMAKE_XCODE_ROOT}/${IOS_SIMULATOR_PLATFORM_LOCATION}/Developer) - SET(CMAKE_IOS_SIMULATOR_DEVELOPER_ROOT ${CMAKE_XCODE_ROOT}/${IOS_SIMULATOR_PLATFORM_LOCATION}/Developer) - ENDIF(EXISTS ${CMAKE_XCODE_ROOT}/${IOS_SIMULATOR_PLATFORM_LOCATION}/Developer) -ENDIF(NOT DEFINED CMAKE_IOS_DEVELOPER_ROOT) + IF(NOT DEFINED CMAKE_XCODE_ROOT) + IF(EXISTS ${XCODE_DEFAULT_ROOT}) + SET(CMAKE_XCODE_ROOT ${XCODE_DEFAULT_ROOT} CACHE STRING "Xcode root") + ELSE() + MESSAGE(FATAL_ERROR "Xcode directory ${XCODE_DEFAULT_ROOT} doesn't exist") + ENDIF() + ENDIF() + SET(TMP ${CMAKE_XCODE_ROOT}/Developer/Platforms/${IOS_PLATFORM_LOCATION}/Developer) + IF(EXISTS ${TMP}) + SET(CMAKE_IOS_DEVELOPER_ROOT ${TMP}) + MESSAGE(STATUS "Use iOS developer root: ${CMAKE_IOS_DEVELOPER_ROOT}") + ENDIF() + SET(TMP ${CMAKE_XCODE_ROOT}/Developer/Platforms/${IOS_SIMULATOR_PLATFORM_LOCATION}/Developer) + IF(EXISTS ${TMP}) + SET(CMAKE_IOS_SIMULATOR_DEVELOPER_ROOT ${TMP}) + MESSAGE(STATUS "Use iOS simulator developer root: ${CMAKE_IOS_SIMULATOR_DEVELOPER_ROOT}") + ENDIF() +ENDIF() + SET(CMAKE_IOS_DEVELOPER_ROOT ${CMAKE_IOS_DEVELOPER_ROOT} CACHE PATH "Location of iOS Platform") SET(CMAKE_IOS_SIMULATOR_DEVELOPER_ROOT ${CMAKE_IOS_SIMULATOR_DEVELOPER_ROOT} CACHE PATH "Location of iOS Simulator Platform") @@ -93,36 +95,36 @@ MACRO(GET_AVAILABLE_SDK_VERSIONS ROOT VERSIONS) FOREACH(_CMAKE_IOS_SDK ${_CMAKE_IOS_SDKS}) STRING(REGEX REPLACE ".+iPhoneOS([0-9.]+)\\.sdk" "\\1" _IOS_SDK "${_CMAKE_IOS_SDK}") LIST(APPEND ${VERSIONS} ${_IOS_SDK}) - ENDFOREACH(_CMAKE_IOS_SDK) - ENDIF(_CMAKE_IOS_SDKS) -ENDMACRO(GET_AVAILABLE_SDK_VERSIONS) + ENDFOREACH() + ENDIF() +ENDMACRO() -# Find and use the most recent iOS sdk +# Find and use the most recent iOS sdk IF(NOT DEFINED CMAKE_IOS_SDK_ROOT) # Search for a specific version of a SDK GET_AVAILABLE_SDK_VERSIONS(${CMAKE_IOS_DEVELOPER_ROOT} IOS_VERSIONS) IF(NOT IOS_VERSIONS) MESSAGE(FATAL_ERROR "No iOS SDK's found in default search path ${CMAKE_IOS_DEVELOPER_ROOT}. Manually set CMAKE_IOS_SDK_ROOT or install the iOS SDK.") - ENDIF(NOT IOS_VERSIONS) - + ENDIF() + IF(IOS_VERSION) LIST(FIND IOS_VERSIONS "${IOS_VERSION}" _INDEX) IF(_INDEX EQUAL -1) LIST(GET IOS_VERSIONS 0 IOS_SDK_VERSION) - ELSE(_INDEX EQUAL -1) + ELSE() SET(IOS_SDK_VERSION ${IOS_VERSION}) - ENDIF(_INDEX EQUAL -1) - ELSE(IOS_VERSION) + ENDIF() + ELSE() LIST(GET IOS_VERSIONS 0 IOS_VERSION) SET(IOS_SDK_VERSION ${IOS_VERSION}) - ENDIF(IOS_VERSION) + ENDIF() MESSAGE(STATUS "Target iOS ${IOS_VERSION} and use SDK ${IOS_SDK_VERSION}") SET(CMAKE_IOS_SDK_ROOT ${CMAKE_IOS_DEVELOPER_ROOT}/SDKs/iPhoneOS${IOS_SDK_VERSION}.sdk) SET(CMAKE_IOS_SIMULATOR_SDK_ROOT ${CMAKE_IOS_SIMULATOR_DEVELOPER_ROOT}/SDKs/iPhoneSimulator${IOS_SDK_VERSION}.sdk) -endif (NOT DEFINED CMAKE_IOS_SDK_ROOT) +endif() SET(CMAKE_IOS_SDK_ROOT ${CMAKE_IOS_SDK_ROOT} CACHE PATH "Location of the selected iOS SDK") SET(CMAKE_IOS_SIMULATOR_SDK_ROOT ${CMAKE_IOS_SIMULATOR_SDK_ROOT} CACHE PATH "Location of the selected iOS Simulator SDK") @@ -134,50 +136,58 @@ SET(CMAKE_IOS_SYSROOT ${CMAKE_IOS_SDK_ROOT} CACHE PATH "Sysroot used for iOS sup SET(CMAKE_IOS_SIMULATOR_SYSROOT ${CMAKE_IOS_SIMULATOR_SDK_ROOT} CACHE PATH "Sysroot used for iOS Simulator support") IF(CMAKE_GENERATOR MATCHES Xcode) - SET(ARCHS "$(ARCHS_STANDARD_32_BIT)") IF(${IOS_PLATFORM} STREQUAL "OS") SET(CMAKE_SYSTEM_PROCESSOR "armv7") ELSEIF(${IOS_PLATFORM} STREQUAL "SIMULATOR") SET(CMAKE_SYSTEM_PROCESSOR "x86") ELSEIF(${IOS_PLATFORM} STREQUAL "ALL") SET(CMAKE_SYSTEM_PROCESSOR "armv7") - ENDIF(${IOS_PLATFORM} STREQUAL "OS") -ELSE(CMAKE_GENERATOR MATCHES Xcode) + ENDIF() +ELSE() IF(${IOS_PLATFORM} STREQUAL "OS") - SET(ARCHS "armv7") + SET(ARCHS armv7 arm64) SET(CMAKE_SYSTEM_PROCESSOR "armv7") ELSEIF(${IOS_PLATFORM} STREQUAL "SIMULATOR") # iPhone simulator targets i386 SET(ARCHS "i386") SET(CMAKE_SYSTEM_PROCESSOR "x86") ELSEIF(${IOS_PLATFORM} STREQUAL "ALL") - SET(ARCHS "armv7;i386") + SET(ARCHS armv7 arm64 i386 x86_64) SET(CMAKE_SYSTEM_PROCESSOR "armv7") - ENDIF(${IOS_PLATFORM} STREQUAL "OS") -ENDIF(CMAKE_GENERATOR MATCHES Xcode) + ENDIF() +ENDIF() -# set the architecture for iOS - using ARCHS_STANDARD_32_BIT sets armv7,armv7s and appears to be XCode's standard. +# set the architecture for iOS - using ARCHS_STANDARD_32_BIT sets armv7,armv7s and appears to be XCode's standard. # The other value that works is ARCHS_UNIVERSAL_IPHONE_OS but that sets armv7 only -set (CMAKE_OSX_ARCHITECTURES ${ARCHS} CACHE string "Build architecture for iOS") +IF(ARCHS) + SET(CMAKE_OSX_ARCHITECTURES ${ARCHS} CACHE STRING "Build architecture for iOS") +ENDIF() # Set the find root to the iOS developer roots and to user defined paths -set (CMAKE_FIND_ROOT_PATH ${CMAKE_IOS_DEVELOPER_ROOT} ${CMAKE_IOS_SDK_ROOT} ${CMAKE_PREFIX_PATH} ${CMAKE_INSTALL_PREFIX} $ENV{EXTERNAL_IOS_PATH} CACHE string "iOS find search path root") +SET(CMAKE_FIND_ROOT_PATH ${CMAKE_IOS_DEVELOPER_ROOT} ${CMAKE_IOS_SDK_ROOT} ${CMAKE_PREFIX_PATH} ${CMAKE_INSTALL_PREFIX} ${CMAKE_SOURCE_DIR}/external $ENV{EXTERNAL_IOS_PATH} CACHE STRING "iOS find search path root") # default to searching for frameworks first -set (CMAKE_FIND_FRAMEWORK FIRST) +SET(CMAKE_FIND_FRAMEWORK FIRST) # set up the default search directories for frameworks -set (CMAKE_SYSTEM_FRAMEWORK_PATH +SET(CMAKE_SYSTEM_FRAMEWORK_PATH ${CMAKE_IOS_SDK_ROOT}/System/Library/Frameworks ${CMAKE_IOS_SDK_ROOT}/System/Library/PrivateFrameworks ${CMAKE_IOS_SDK_ROOT}/Developer/Library/Frameworks ) # only search the iOS sdks, not the remainder of the host filesystem -set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH) +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + +# Force the compilers to Clang for iOS +SET(CMAKE_C_COMPILER clang) +SET(CMAKE_CXX_COMPILER clang++) + +# Skip the platform compiler checks for cross compiling. +SET(CMAKE_CXX_COMPILER_FORCED TRUE) +SET(CMAKE_C_COMPILER_FORCED TRUE) -#SET(CMAKE_SYSTEM_INCLUDE_PATH /include /usr/include) -#SET(CMAKE_SYSTEM_LIBRARY_PATH /lib /usr/lib) -#SET(CMAKE_SYSTEM_PROGRAM_PATH /bin /usr/bin) +# determinate location for bin utils based on CMAKE_FIND_ROOT_PATH +INCLUDE(CMakeFindBinUtils) diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index 0474c7d7b..abe41ca1f 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -4,7 +4,10 @@ SET(CMAKE_TRY_COMPILE_CONFIGURATION "Release") # Force Release configuration by default IF(NOT CMAKE_BUILD_TYPE) SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE) -ENDIF(NOT CMAKE_BUILD_TYPE) +ENDIF() + +# Declare CMAKE_CONFIGURATION_TYPES before PROJECT +SET(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE) ### # Helper macro that generates .pc and installs it. @@ -14,72 +17,18 @@ MACRO(NL_GEN_PC name) IF(NOT WIN32 AND WITH_INSTALL_LIBRARIES) CONFIGURE_FILE(${name}.in "${CMAKE_CURRENT_BINARY_DIR}/${name}") INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/${name}" DESTINATION ${NL_LIB_PREFIX}/pkgconfig) - ENDIF(NOT WIN32 AND WITH_INSTALL_LIBRARIES) + ENDIF() ENDMACRO(NL_GEN_PC) -### -# Helper macro that generates revision.h from revision.h.in -### -MACRO(NL_GEN_REVISION_H) - IF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h.in) - SET(TOOL_FOUND OFF) - - IF(EXISTS "${CMAKE_SOURCE_DIR}/../.svn/") - FIND_PACKAGE(Subversion) - - IF(SUBVERSION_FOUND) - SET(TOOL_FOUND ON) - ENDIF(SUBVERSION_FOUND) - ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/../.svn/") - - IF(EXISTS "${CMAKE_SOURCE_DIR}/../.hg/") - FIND_PACKAGE(Mercurial) - - IF(MERCURIAL_FOUND) - SET(TOOL_FOUND ON) - ENDIF(MERCURIAL_FOUND) - ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/../.hg/") - - # if already generated - IF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h) - # copy it - MESSAGE(STATUS "Copying provided revision.h...") - FILE(COPY ${CMAKE_SOURCE_DIR}/revision.h DESTINATION ${CMAKE_BINARY_DIR}) - SET(HAVE_REVISION_H ON) - ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h) - - IF(TOOL_FOUND) - # a custom target that is always built - ADD_CUSTOM_TARGET(revision ALL - COMMAND ${CMAKE_COMMAND} - -DSOURCE_DIR=${CMAKE_SOURCE_DIR} - -DROOT_DIR=${CMAKE_SOURCE_DIR}/.. - -DCMAKE_MODULE_PATH=${CMAKE_SOURCE_DIR}/CMakeModules - -P ${CMAKE_SOURCE_DIR}/CMakeModules/GetRevision.cmake) - - # revision.h is a generated file - SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/revision.h - PROPERTIES GENERATED TRUE - HEADER_FILE_ONLY TRUE) - SET(HAVE_REVISION_H ON) - ENDIF(TOOL_FOUND) - - IF(HAVE_REVISION_H) - INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}) - ADD_DEFINITIONS(-DHAVE_REVISION_H) - ENDIF(HAVE_REVISION_H) - ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h.in) -ENDMACRO(NL_GEN_REVISION_H) - ### # ### MACRO(NL_TARGET_LIB name) IF(WITH_STATIC) ADD_LIBRARY(${name} STATIC ${ARGN}) - ELSE(WITH_STATIC) + ELSE() ADD_LIBRARY(${name} SHARED ${ARGN}) - ENDIF(WITH_STATIC) + ENDIF() ENDMACRO(NL_TARGET_LIB) ### @@ -88,9 +37,9 @@ ENDMACRO(NL_TARGET_LIB) MACRO(NL_TARGET_DRIVER name) IF(WITH_STATIC_DRIVERS) ADD_LIBRARY(${name} STATIC ${ARGN}) - ELSE(WITH_STATIC_DRIVERS) + ELSE() ADD_LIBRARY(${name} MODULE ${ARGN}) - ENDIF(WITH_STATIC_DRIVERS) + ENDIF() ENDMACRO(NL_TARGET_DRIVER) ### @@ -99,10 +48,10 @@ ENDMACRO(NL_TARGET_DRIVER) # Argument: ### MACRO(NL_DEFAULT_PROPS name label) - IF(HAVE_REVISION_H) + IF(TARGET revision) # explicitly say that the target depends on revision.h ADD_DEPENDENCIES(${name} revision) - ENDIF(HAVE_REVISION_H) + ENDIF() # Note: This is just a workaround for a CMake bug generating VS10 files with a colon in the project name. # CMake Bug ID: http://www.cmake.org/Bug/view.php?id=11819 @@ -115,16 +64,35 @@ MACRO(NL_DEFAULT_PROPS name label) VERSION ${NL_VERSION} SOVERSION ${NL_VERSION_MAJOR}) IF(NL_LIB_PREFIX) SET_TARGET_PROPERTIES(${name} PROPERTIES INSTALL_NAME_DIR ${NL_LIB_PREFIX}) - ENDIF(NL_LIB_PREFIX) - ENDIF(${type} STREQUAL SHARED_LIBRARY) + ENDIF() + ENDIF() IF(${type} STREQUAL EXECUTABLE AND WIN32 AND NOT MINGW) + # check if using a GUI + GET_TARGET_PROPERTY(_VALUE ${name} WIN32_EXECUTABLE) + + IF(TARGET_X64) + # Target Windows XP 64 bits + SET(_SUBSYSTEM_VERSION "5.02") + ELSE() + # Target Windows XP + SET(_SUBSYSTEM_VERSION "5.01") + ENDIF() + + IF(_VALUE) + # GUI + SET(_SUBSYSTEM "WINDOWS") + ELSE() + # Console + SET(_SUBSYSTEM "CONSOLE") + ENDIF() + SET_TARGET_PROPERTIES(${name} PROPERTIES VERSION ${NL_VERSION} SOVERSION ${NL_VERSION_MAJOR} COMPILE_FLAGS "/GA" - LINK_FLAGS "/VERSION:${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}") - ENDIF(${type} STREQUAL EXECUTABLE AND WIN32 AND NOT MINGW) + LINK_FLAGS "/VERSION:${NL_VERSION_MAJOR}.${NL_VERSION_MINOR} /SUBSYSTEM:${_SUBSYSTEM},${_SUBSYSTEM_VERSION}") + ENDIF() ENDMACRO(NL_DEFAULT_PROPS) ### @@ -134,7 +102,7 @@ ENDMACRO(NL_DEFAULT_PROPS) MACRO(NL_ADD_LIB_SUFFIX name) IF(WIN32) SET_TARGET_PROPERTIES(${name} PROPERTIES DEBUG_POSTFIX "_d" RELEASE_POSTFIX "_r") - ENDIF(WIN32) + ENDIF() ENDMACRO(NL_ADD_LIB_SUFFIX) ### @@ -146,10 +114,10 @@ MACRO(NL_ADD_RUNTIME_FLAGS name) # SET_TARGET_PROPERTIES(${name} PROPERTIES # LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" # LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}") - ENDIF(WIN32) + ENDIF() IF(WITH_STLPORT) TARGET_LINK_LIBRARIES(${name} ${STLPORT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) - ENDIF(WITH_STLPORT) + ENDIF() ENDMACRO(NL_ADD_RUNTIME_FLAGS) MACRO(NL_ADD_STATIC_VID_DRIVERS name) @@ -157,25 +125,25 @@ MACRO(NL_ADD_STATIC_VID_DRIVERS name) IF(WIN32) IF(WITH_DRIVER_DIRECT3D) TARGET_LINK_LIBRARIES(${name} nel_drv_direct3d_win) - ENDIF(WITH_DRIVER_DIRECT3D) - ENDIF(WIN32) + ENDIF() + ENDIF() IF(WITH_DRIVER_OPENGL) IF(WIN32) TARGET_LINK_LIBRARIES(${name} nel_drv_opengl_win) - ELSE(WIN32) + ELSE() TARGET_LINK_LIBRARIES(${name} nel_drv_opengl) - ENDIF(WIN32) - ENDIF(WITH_DRIVER_OPENGL) + ENDIF() + ENDIF() IF(WITH_DRIVER_OPENGLES) IF(WIN32) TARGET_LINK_LIBRARIES(${name} nel_drv_opengles_win) - ELSE(WIN32) + ELSE() TARGET_LINK_LIBRARIES(${name} nel_drv_opengles) - ENDIF(WIN32) - ENDIF(WITH_DRIVER_OPENGLES) - ENDIF(WITH_STATIC_DRIVERS) + ENDIF() + ENDIF() + ENDIF() ENDMACRO(NL_ADD_STATIC_VID_DRIVERS) MACRO(NL_ADD_STATIC_SND_DRIVERS name) @@ -183,30 +151,30 @@ MACRO(NL_ADD_STATIC_SND_DRIVERS name) IF(WIN32) IF(WITH_DRIVER_DSOUND) TARGET_LINK_LIBRARIES(${name} nel_drv_dsound_win) - ENDIF(WITH_DRIVER_DSOUND) + ENDIF() IF(WITH_DRIVER_XAUDIO2) TARGET_LINK_LIBRARIES(${name} nel_drv_xaudio2_win) - ENDIF(WITH_DRIVER_XAUDIO2) + ENDIF() IF(WITH_DRIVER_OPENAL) TARGET_LINK_LIBRARIES(${name} nel_drv_openal_win) - ENDIF(WITH_DRIVER_OPENAL) + ENDIF() IF(WITH_DRIVER_FMOD) TARGET_LINK_LIBRARIES(${name} nel_drv_fmod_win) - ENDIF(WITH_DRIVER_FMOD) - ELSE(WIN32) + ENDIF() + ELSE() IF(WITH_DRIVER_OPENAL) TARGET_LINK_LIBRARIES(${name} nel_drv_openal) - ENDIF(WITH_DRIVER_OPENAL) + ENDIF() IF(WITH_DRIVER_FMOD) TARGET_LINK_LIBRARIES(${name} nel_drv_fmod) - ENDIF(WITH_DRIVER_FMOD) - ENDIF(WIN32) + ENDIF() + ENDIF() - ENDIF(WITH_STATIC_DRIVERS) + ENDIF() ENDMACRO(NL_ADD_STATIC_SND_DRIVERS) ### @@ -224,65 +192,86 @@ Remove the CMakeCache.txt file and try again from another folder, e.g.: cd cmake cmake .. ") - ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) + ENDIF() ENDMACRO(CHECK_OUT_OF_SOURCE) MACRO(NL_SETUP_DEFAULT_OPTIONS) IF(WITH_QT) OPTION(WITH_STUDIO "Build Core Studio" OFF ) - ENDIF(WITH_QT) - + ENDIF() + ### # Features ### OPTION(WITH_LOGGING "With Logging" ON ) OPTION(WITH_COVERAGE "With Code Coverage Support" OFF) OPTION(WITH_PCH "With Precompiled Headers" ON ) + OPTION(WITH_LOW_MEMORY "With low memory (use the least of RAM)" OFF) OPTION(FINAL_VERSION "Build in Final Version mode" ON ) # Default to static building on Windows. IF(WIN32) OPTION(WITH_STATIC "With static libraries." ON ) - ELSE(WIN32) + ELSE() OPTION(WITH_STATIC "With static libraries." OFF) - ENDIF(WIN32) + ENDIF() IF (WITH_STATIC) OPTION(WITH_STATIC_LIBXML2 "With static libxml2" ON ) - ELSE(WITH_STATIC) + ELSE() OPTION(WITH_STATIC_LIBXML2 "With static libxml2" OFF) - ENDIF(WITH_STATIC) + ENDIF() + IF (WITH_STATIC) + OPTION(WITH_STATIC_CURL "With static curl" ON ) + ELSE() + OPTION(WITH_STATIC_CURL "With static curl" OFF) + ENDIF() + IF(APPLE) + OPTION(WITH_LIBXML2_ICONV "With libxml2 using iconv" ON ) + ELSE() + OPTION(WITH_LIBXML2_ICONV "With libxml2 using iconv" OFF) + ENDIF() OPTION(WITH_STATIC_DRIVERS "With static drivers." OFF) IF(WIN32) OPTION(WITH_EXTERNAL "With provided external." ON ) - ELSE(WIN32) + ELSE() OPTION(WITH_EXTERNAL "With provided external." OFF) - ENDIF(WIN32) + ENDIF() OPTION(WITH_STATIC_EXTERNAL "With static external libraries" OFF) + OPTION(WITH_STATIC_RUNTIMES "Use only static C++ runtimes" OFF) + IF(UNIX AND NOT APPLE) + OPTION(WITH_UNIX_STRUCTURE "Use UNIX structure (bin, include, lib)" ON ) + ELSE() + OPTION(WITH_UNIX_STRUCTURE "Use UNIX structure (bin, include, lib)" OFF) + ENDIF() OPTION(WITH_INSTALL_LIBRARIES "Install development files." ON ) + OPTION(WITH_ASSIMP "Use assimp exporter" OFF) + ### # GUI toolkits ### OPTION(WITH_GTK "With GTK Support" OFF) - OPTION(WITH_QT "With QT Support" OFF) + OPTION(WITH_QT "With Qt 4 Support" OFF) + OPTION(WITH_QT5 "With Qt 5 Support" OFF) IF(WIN32 AND MFC_FOUND) OPTION(WITH_MFC "With MFC Support" ON ) - ELSE(WIN32 AND MFC_FOUND) + ELSE() OPTION(WITH_MFC "With MFC Support" OFF) - ENDIF(WIN32 AND MFC_FOUND) + ENDIF() ### # Optional support ### OPTION(WITH_SYMBOLS "Keep debug symbols in binaries" OFF) - IF(WIN32) + # only enable STLport for VC++ 2010 and less + IF(WIN32 AND MSVC_VERSION LESS 1600) OPTION(WITH_STLPORT "With STLport support." ON ) - ELSE(WIN32) + ELSE() OPTION(WITH_STLPORT "With STLport support." OFF) - ENDIF(WIN32) + ENDIF() OPTION(BUILD_DASHBOARD "Build to the CDash dashboard" OFF) @@ -290,6 +279,7 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS) OPTION(WITH_NELNS "Build NeL Network Services." OFF) OPTION(WITH_RYZOM "Build Ryzom Core." ON ) OPTION(WITH_SNOWBALLS "Build Snowballs." OFF) + OPTION(WITH_TOOLS "Build Tools" OFF) ENDMACRO(NL_SETUP_DEFAULT_OPTIONS) MACRO(NL_SETUP_NEL_DEFAULT_OPTIONS) @@ -328,13 +318,13 @@ MACRO(NL_SETUP_NEL_DEFAULT_OPTIONS) OPTION(WITH_LIBOVR "With LibOVR support" OFF) OPTION(WITH_LIBVR "With LibVR support" OFF) OPTION(WITH_PERFHUD "With NVIDIA PerfHUD support" OFF) - + OPTION(WITH_SSE2 "With SSE2" ON ) OPTION(WITH_SSE3 "With SSE3" ON ) - + IF(NOT MSVC) OPTION(WITH_GCC_FPMATH_BOTH "With GCC -mfpmath=both" OFF) - ENDIF(NOT MSVC) + ENDIF() ENDMACRO(NL_SETUP_NEL_DEFAULT_OPTIONS) MACRO(NL_SETUP_NELNS_DEFAULT_OPTIONS) @@ -352,14 +342,19 @@ MACRO(NL_SETUP_RYZOM_DEFAULT_OPTIONS) OPTION(WITH_RYZOM_CLIENT "Build Ryzom Core Client" ON ) OPTION(WITH_RYZOM_TOOLS "Build Ryzom Core Tools" ON ) OPTION(WITH_RYZOM_SERVER "Build Ryzom Core Services" ON ) - OPTION(WITH_RYZOM_SOUND "Enable Ryzom Core Sound" ON ) - OPTION(WITH_RYZOM_PATCH "Enable Ryzom in-game patch support" OFF) + OPTION(WITH_RYZOM_INSTALLER "Build Ryzom Installer" OFF) ### # Optional support ### OPTION(WITH_LUA51 "Build Ryzom Core using Lua 5.1" ON ) OPTION(WITH_LUA52 "Build Ryzom Core using Lua 5.2" OFF) + OPTION(WITH_LUA53 "Build Ryzom Core using Lua 5.3" OFF) + OPTION(WITH_RYZOM_CLIENT_UAC "Ask to run as Administrator" OFF) + OPTION(WITH_RYZOM_PATCH "Enable Ryzom in-game patch support" OFF) + OPTION(WITH_RYZOM_CUSTOM_PATCH_SERVER "Only use patch server from CFG file" OFF) + OPTION(WITH_RYZOM_STEAM "Enable Steam features" OFF) + OPTION(WITH_RYZOM_SANDBOX "Enable Sandbox under OS X" OFF) ENDMACRO(NL_SETUP_RYZOM_DEFAULT_OPTIONS) MACRO(NL_SETUP_SNOWBALLS_DEFAULT_OPTIONS) @@ -373,10 +368,20 @@ ENDMACRO(NL_SETUP_SNOWBALLS_DEFAULT_OPTIONS) MACRO(ADD_PLATFORM_FLAGS _FLAGS) SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} ${_FLAGS}") SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} ${_FLAGS}") -ENDMACRO(ADD_PLATFORM_FLAGS) +ENDMACRO() -MACRO(NL_SETUP_BUILD) +MACRO(ADD_PLATFORM_LINKFLAGS _FLAGS) + SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${_FLAGS}") +ENDMACRO() + +MACRO(CONVERT_VERSION_NUMBER _VERSION_NUMBER _BASE) + SET(${_VERSION_NUMBER} 0) + FOREACH(_ARG ${ARGN}) + MATH(EXPR ${_VERSION_NUMBER} "${${_VERSION_NUMBER}} * ${_BASE} + ${_ARG}") + ENDFOREACH() +ENDMACRO() +MACRO(NL_SETUP_BUILD) #----------------------------------------------------------------------------- # Setup the buildmode variables. # @@ -384,55 +389,62 @@ MACRO(NL_SETUP_BUILD) # Debug = NL_DEBUG # Release = NL_RELEASE - SET(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE) - IF(CMAKE_BUILD_TYPE MATCHES "Debug") SET(NL_BUILD_MODE "NL_DEBUG") - ELSE(CMAKE_BUILD_TYPE MATCHES "Debug") + ELSE() IF(CMAKE_BUILD_TYPE MATCHES "Release") SET(NL_BUILD_MODE "NL_RELEASE") - ELSE(CMAKE_BUILD_TYPE MATCHES "Release") + ELSE() SET(NL_BUILD_MODE "NL_RELEASE") # enforce release mode if it's neither Debug nor Release SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE) - ENDIF(CMAKE_BUILD_TYPE MATCHES "Release") - ENDIF(CMAKE_BUILD_TYPE MATCHES "Debug") + ENDIF() + ENDIF() - SET(HOST_CPU ${CMAKE_HOST_SYSTEM_PROCESSOR}) + IF(CMAKE_CXX_LIBRARY_ARCHITECTURE) + SET(HOST_CPU ${CMAKE_CXX_LIBRARY_ARCHITECTURE}) + ELSE() + SET(HOST_CPU ${CMAKE_HOST_SYSTEM_PROCESSOR}) + ENDIF() - IF(HOST_CPU MATCHES "(amd|AMD)64") + IF(HOST_CPU MATCHES "(amd|AMD|x86_)64") SET(HOST_CPU "x86_64") ELSEIF(HOST_CPU MATCHES "i.86") SET(HOST_CPU "x86") - ENDIF(HOST_CPU MATCHES "(amd|AMD)64") - + ENDIF() + # Determine target CPU # If not specified, use the same CPU as host IF(NOT TARGET_CPU) - SET(TARGET_CPU ${CMAKE_SYSTEM_PROCESSOR}) - ENDIF(NOT TARGET_CPU) + SET(TARGET_CPU ${HOST_CPU}) + ENDIF() - IF(TARGET_CPU MATCHES "(amd|AMD)64") + IF(TARGET_CPU MATCHES "(amd|AMD|x86_)64") SET(TARGET_CPU "x86_64") ELSEIF(TARGET_CPU MATCHES "i.86") SET(TARGET_CPU "x86") - ENDIF(TARGET_CPU MATCHES "(amd|AMD)64") + ENDIF() IF(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") SET(CLANG ON) - MESSAGE(STATUS "Using Clang compiler") - ENDIF(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") + MESSAGE(STATUS "Using Clang ${CMAKE_CXX_COMPILER_VERSION} compiler") + ENDIF() IF(CMAKE_GENERATOR MATCHES "Xcode") SET(XCODE ON) MESSAGE(STATUS "Generating Xcode project") - ENDIF(CMAKE_GENERATOR MATCHES "Xcode") + ENDIF() IF(CMAKE_GENERATOR MATCHES "NMake") SET(NMAKE ON) MESSAGE(STATUS "Generating NMake project") - ENDIF(CMAKE_GENERATOR MATCHES "NMake") + ENDIF() + + IF(CMAKE_GENERATOR MATCHES "Ninja") + SET(NINJA ON) + MESSAGE(STATUS "Generating Ninja project") + ENDIF() # If target and host CPU are the same IF("${HOST_CPU}" STREQUAL "${TARGET_CPU}" AND NOT CMAKE_CROSSCOMPILING) @@ -441,24 +453,24 @@ MACRO(NL_SETUP_BUILD) IF(NOT CMAKE_SIZEOF_VOID_P) INCLUDE (CheckTypeSize) CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P) - ENDIF(NOT CMAKE_SIZEOF_VOID_P) + ENDIF() # Using 32 or 64 bits libraries IF(CMAKE_SIZEOF_VOID_P EQUAL 8) SET(TARGET_CPU "x86_64") - ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8) + ELSE() SET(TARGET_CPU "x86") - ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8) + ENDIF() ELSEIF(HOST_CPU MATCHES "arm") SET(TARGET_CPU "arm") - ELSE(HOST_CPU MATCHES "x86") + ELSE() SET(TARGET_CPU "unknown") MESSAGE(STATUS "Unknown architecture: ${HOST_CPU}") - ENDIF(HOST_CPU MATCHES "x86") + ENDIF() # TODO: add checks for PPC - ELSE("${HOST_CPU}" STREQUAL "${TARGET_CPU}" AND NOT CMAKE_CROSSCOMPILING) + ELSE() MESSAGE(STATUS "Compiling on ${HOST_CPU} for ${TARGET_CPU}") - ENDIF("${HOST_CPU}" STREQUAL "${TARGET_CPU}" AND NOT CMAKE_CROSSCOMPILING) + ENDIF() # Use values from environment variables SET(PLATFORM_CFLAGS "$ENV{CFLAGS} $ENV{CPPFLAGS} ${PLATFORM_CFLAGS}") @@ -482,6 +494,9 @@ MACRO(NL_SETUP_BUILD) SET(TARGET_X86 1) ELSEIF(TARGET_CPU STREQUAL "x86") SET(TARGET_X86 1) + ELSEIF(TARGET_CPU STREQUAL "arm64") + SET(TARGET_ARM 1) + SET(TARGET_ARM64 1) ELSEIF(TARGET_CPU STREQUAL "armv7s") SET(TARGET_ARM 1) SET(TARGET_ARMV7S 1) @@ -498,36 +513,40 @@ MACRO(NL_SETUP_BUILD) SET(TARGET_ARM 1) ELSEIF(TARGET_CPU STREQUAL "mips") SET(TARGET_MIPS 1) - ENDIF(TARGET_CPU STREQUAL "x86_64") + ENDIF() IF(TARGET_ARM) + IF(TARGET_ARM64) + ADD_PLATFORM_FLAGS("-DHAVE_ARM64") + ENDIF() + IF(TARGET_ARMV7S) ADD_PLATFORM_FLAGS("-DHAVE_ARMV7S") - ENDIF(TARGET_ARMV7S) + ENDIF() IF(TARGET_ARMV7) ADD_PLATFORM_FLAGS("-DHAVE_ARMV7") - ENDIF(TARGET_ARMV7) + ENDIF() IF(TARGET_ARMV6) ADD_PLATFORM_FLAGS("-HAVE_ARMV6") - ENDIF(TARGET_ARMV6) + ENDIF() ADD_PLATFORM_FLAGS("-DHAVE_ARM") - ENDIF(TARGET_ARM) + ENDIF() IF(TARGET_X86) ADD_PLATFORM_FLAGS("-DHAVE_X86") - ENDIF(TARGET_X86) + ENDIF() IF(TARGET_X64) ADD_PLATFORM_FLAGS("-DHAVE_X64 -DHAVE_X86_64") - ENDIF(TARGET_X64) + ENDIF() IF(TARGET_MIPS) ADD_PLATFORM_FLAGS("-DHAVE_MIPS") - ENDIF(TARGET_MIPS) - ENDIF(NOT CMAKE_OSX_ARCHITECTURES) + ENDIF() + ENDIF() # Fix library paths suffixes for Debian MultiArch IF(LIBRARY_ARCHITECTURE) @@ -536,40 +555,55 @@ MACRO(NL_SETUP_BUILD) SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /lib64 /usr/lib64) ELSEIF(TARGET_X86) SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /lib32 /usr/lib32) - ENDIF(TARGET_X64) - ENDIF(LIBRARY_ARCHITECTURE) + ENDIF() + ENDIF() IF(APPLE AND NOT IOS) SET(CMAKE_INCLUDE_PATH /opt/local/include ${CMAKE_INCLUDE_PATH}) SET(CMAKE_LIBRARY_PATH /opt/local/lib ${CMAKE_LIBRARY_PATH}) - ENDIF(APPLE AND NOT IOS) + ENDIF() IF(WITH_LOGGING) ADD_PLATFORM_FLAGS("-DENABLE_LOGS") - ENDIF(WITH_LOGGING) + ENDIF() IF(MSVC) - IF(MSVC_VERSION EQUAL "1700" AND NOT MSVC11) - SET(MSVC11 ON) - ENDIF(MSVC_VERSION EQUAL "1700" AND NOT MSVC11) - # Ignore default include paths ADD_PLATFORM_FLAGS("/X") - IF(MSVC11) - ADD_PLATFORM_FLAGS("/Gy- /MP") - # /Ox is working with VC++ 2010, but custom optimizations don't exist + IF(MSVC14) + ADD_PLATFORM_FLAGS("/Gy-") + # /Ox is working with VC++ 2015 and 2017, but custom optimizations don't exist + SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}") + # without inlining it's unusable, use custom optimizations again + SET(DEBUG_CFLAGS "/Od /Ob1 /GF- ${DEBUG_CFLAGS}") + + # Special cases for VC++ 2017 + IF(MSVC_VERSION EQUAL "1911") + SET(MSVC1411 ON) + ELSEIF(MSVC_VERSION EQUAL "1910") + SET(MSVC1410 ON) + ENDIF() + ELSEIF(MSVC12) + ADD_PLATFORM_FLAGS("/Gy-") + # /Ox is working with VC++ 2013, but custom optimizations don't exist + SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}") + # without inlining it's unusable, use custom optimizations again + SET(DEBUG_CFLAGS "/Od /Ob1 /GF- ${DEBUG_CFLAGS}") + ELSEIF(MSVC11) + ADD_PLATFORM_FLAGS("/Gy-") + # /Ox is working with VC++ 2012, but custom optimizations don't exist SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}") # without inlining it's unusable, use custom optimizations again SET(DEBUG_CFLAGS "/Od /Ob1 /GF- ${DEBUG_CFLAGS}") ELSEIF(MSVC10) - ADD_PLATFORM_FLAGS("/Gy- /MP") + ADD_PLATFORM_FLAGS("/Gy-") # /Ox is working with VC++ 2010, but custom optimizations don't exist SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}") # without inlining it's unusable, use custom optimizations again SET(DEBUG_CFLAGS "/Od /Ob1 /GF- ${DEBUG_CFLAGS}") ELSEIF(MSVC90) - ADD_PLATFORM_FLAGS("/Gy- /MP") + ADD_PLATFORM_FLAGS("/Gy-") # don't use a /O[012x] flag if you want custom optimizations SET(RELEASE_CFLAGS "/Ob2 /Oi /Ot /Oy /GT /GF /GS- ${RELEASE_CFLAGS}") # without inlining it's unusable, use custom optimizations again @@ -580,21 +614,24 @@ MACRO(NL_SETUP_BUILD) SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}") # without inlining it's unusable, use custom optimizations again SET(DEBUG_CFLAGS "/Od /Ob1 ${DEBUG_CFLAGS}") - ELSE(MSVC11) + ELSE() MESSAGE(FATAL_ERROR "Can't determine compiler version ${MSVC_VERSION}") - ENDIF(MSVC11) + ENDIF() + + ADD_PLATFORM_FLAGS("/D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS /D_WIN32 /DWIN32 /D_WINDOWS /wd4250") - ADD_PLATFORM_FLAGS("/D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /DWIN32 /D_WINDOWS /Zm1000 /wd4250") + # huge PCH + ADD_PLATFORM_FLAGS("/Zm1000") IF(TARGET_X64) # Fix a bug with Intellisense ADD_PLATFORM_FLAGS("/D_WIN64") # Fix a compilation error for some big C++ files - SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} /bigobj") - ELSE(TARGET_X64) + ADD_PLATFORM_FLAGS("/bigobj") + ELSE() # Allows 32 bits applications to use 3 GB of RAM - SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /LARGEADDRESSAWARE") - ENDIF(TARGET_X64) + ADD_PLATFORM_LINKFLAGS("/LARGEADDRESSAWARE") + ENDIF() # Exceptions are only set for C++ SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} /EHa") @@ -602,38 +639,46 @@ MACRO(NL_SETUP_BUILD) IF(WITH_SYMBOLS) SET(NL_RELEASE_CFLAGS "/Zi ${NL_RELEASE_CFLAGS}") SET(NL_RELEASE_LINKFLAGS "/DEBUG ${NL_RELEASE_LINKFLAGS}") - ELSE(WITH_SYMBOLS) + ELSE() SET(NL_RELEASE_LINKFLAGS "/RELEASE ${NL_RELEASE_LINKFLAGS}") - ENDIF(WITH_SYMBOLS) + ENDIF() - SET(NL_DEBUG_CFLAGS "/Zi /MDd /RTC1 /D_DEBUG ${DEBUG_CFLAGS} ${NL_DEBUG_CFLAGS}") - SET(NL_RELEASE_CFLAGS "/MD /DNDEBUG ${RELEASE_CFLAGS} ${NL_RELEASE_CFLAGS}") + IF(WITH_STATIC_RUNTIMES) + SET(RUNTIME_FLAG "/MT") + ELSE() + SET(RUNTIME_FLAG "/MD") + ENDIF() + + SET(NL_DEBUG_CFLAGS "/Zi ${RUNTIME_FLAG}d /RTC1 /D_DEBUG ${DEBUG_CFLAGS} ${NL_DEBUG_CFLAGS}") + SET(NL_RELEASE_CFLAGS "${RUNTIME_FLAG} /DNDEBUG ${RELEASE_CFLAGS} ${NL_RELEASE_CFLAGS}") SET(NL_DEBUG_LINKFLAGS "/DEBUG /OPT:NOREF /OPT:NOICF /NODEFAULTLIB:msvcrt ${MSVC_INCREMENTAL_YES_FLAG} ${NL_DEBUG_LINKFLAGS}") SET(NL_RELEASE_LINKFLAGS "/OPT:REF /OPT:ICF /INCREMENTAL:NO ${NL_RELEASE_LINKFLAGS}") IF(WITH_WARNINGS) SET(DEBUG_CFLAGS "/W4 ${DEBUG_CFLAGS}") - ELSE(WITH_WARNINGS) + ELSE() SET(DEBUG_CFLAGS "/W3 ${DEBUG_CFLAGS}") - ENDIF(WITH_WARNINGS) - ELSE(MSVC) + ENDIF() + ELSE() IF(WIN32) ADD_PLATFORM_FLAGS("-DWIN32 -D_WIN32") IF(CLANG) ADD_PLATFORM_FLAGS("-nobuiltininc") - ENDIF(CLANG) - ENDIF(WIN32) + ENDIF() + ENDIF() IF(WITH_SSE3) ADD_PLATFORM_FLAGS("-msse3") - ENDIF(WITH_SSE3) + ENDIF() IF(WITH_GCC_FPMATH_BOTH) ADD_PLATFORM_FLAGS("-mfpmath=both") - ENDIF(WITH_GCC_FPMATH_BOTH) + ENDIF() IF(APPLE) + SET(OBJC_FLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch -fobjc-weak) + IF(NOT XCODE) IF(CMAKE_OSX_ARCHITECTURES) SET(TARGETS_COUNT 0) @@ -666,97 +711,97 @@ MACRO(NL_SETUP_BUILD) SET(_ARCHS "${_ARCHS} mips") SET(TARGET_MIPS 1) MATH(EXPR TARGETS_COUNT "${TARGETS_COUNT}+1") - ELSE(_ARCH STREQUAL "i386") + ELSE() SET(_ARCHS "${_ARCHS} unknwon(${_ARCH})") - ENDIF(_ARCH STREQUAL "i386") + ENDIF() ENDFOREACH(_ARCH) MESSAGE(STATUS "Compiling under Mac OS X for ${TARGETS_COUNT} architectures: ${_ARCHS}") - ELSE(CMAKE_OSX_ARCHITECTURES) + ELSE() SET(TARGETS_COUNT 0) - ENDIF(CMAKE_OSX_ARCHITECTURES) + ENDIF() IF(TARGETS_COUNT EQUAL 1) IF(TARGET_ARM) IF(TARGET_ARMV7S) ADD_PLATFORM_FLAGS("-arch armv7s -DHAVE_ARMV7S") - ENDIF(TARGET_ARMV7S) + ENDIF() IF(TARGET_ARMV7) ADD_PLATFORM_FLAGS("-arch armv7 -DHAVE_ARMV7") - ENDIF(TARGET_ARMV7) + ENDIF() IF(TARGET_ARMV6) ADD_PLATFORM_FLAGS("-arch armv6 -DHAVE_ARMV6") - ENDIF(TARGET_ARMV6) + ENDIF() IF(TARGET_ARMV5) ADD_PLATFORM_FLAGS("-arch armv5 -DHAVE_ARMV5") - ENDIF(TARGET_ARMV5) + ENDIF() ADD_PLATFORM_FLAGS("-mthumb -DHAVE_ARM") - ENDIF(TARGET_ARM) + ENDIF() IF(TARGET_X64) ADD_PLATFORM_FLAGS("-arch x86_64 -DHAVE_X64 -DHAVE_X86_64 -DHAVE_X86") ELSEIF(TARGET_X86) ADD_PLATFORM_FLAGS("-arch i386 -DHAVE_X86") - ENDIF(TARGET_X64) + ENDIF() IF(TARGET_MIPS) ADD_PLATFORM_FLAGS("-arch mips -DHAVE_MIPS") - ENDIF(TARGET_MIPS) + ENDIF() ELSEIF(TARGETS_COUNT EQUAL 0) # Not using CMAKE_OSX_ARCHITECTURES, HAVE_XXX already defined before IF(TARGET_ARM) IF(TARGET_ARMV7S) ADD_PLATFORM_FLAGS("-arch armv7s") - ENDIF(TARGET_ARMV7S) + ENDIF() IF(TARGET_ARMV7) ADD_PLATFORM_FLAGS("-arch armv7") - ENDIF(TARGET_ARMV7) + ENDIF() IF(TARGET_ARMV6) ADD_PLATFORM_FLAGS("-arch armv6") - ENDIF(TARGET_ARMV6) + ENDIF() IF(TARGET_ARMV5) ADD_PLATFORM_FLAGS("-arch armv5") - ENDIF(TARGET_ARMV5) + ENDIF() ADD_PLATFORM_FLAGS("-mthumb") - ENDIF(TARGET_ARM) + ENDIF() IF(TARGET_X64) ADD_PLATFORM_FLAGS("-arch x86_64") ELSEIF(TARGET_X86) ADD_PLATFORM_FLAGS("-arch i386") - ENDIF(TARGET_X64) + ENDIF() IF(TARGET_MIPS) ADD_PLATFORM_FLAGS("-arch mips") - ENDIF(TARGET_MIPS) - ELSE(TARGETS_COUNT EQUAL 1) + ENDIF() + ELSE() IF(TARGET_ARMV6) ADD_PLATFORM_FLAGS("-Xarch_armv6 -mthumb -Xarch_armv6 -DHAVE_ARM -Xarch_armv6 -DHAVE_ARMV6") - ENDIF(TARGET_ARMV6) + ENDIF() IF(TARGET_ARMV7) ADD_PLATFORM_FLAGS("-Xarch_armv7 -mthumb -Xarch_armv7 -DHAVE_ARM -Xarch_armv7 -DHAVE_ARMV7") - ENDIF(TARGET_ARMV7) + ENDIF() IF(TARGET_X86) ADD_PLATFORM_FLAGS("-Xarch_i386 -DHAVE_X86") - ENDIF(TARGET_X86) + ENDIF() IF(TARGET_X64) ADD_PLATFORM_FLAGS("-Xarch_x86_64 -DHAVE_X64 -Xarch_x86_64 -DHAVE_X86_64") - ENDIF(TARGET_X64) + ENDIF() IF(TARGET_MIPS) ADD_PLATFORM_FLAGS("-Xarch_mips -DHAVE_MIPS") - ENDIF(TARGET_MIPS) - ENDIF(TARGETS_COUNT EQUAL 1) + ENDIF() + ENDIF() IF(IOS) SET(CMAKE_OSX_SYSROOT "" CACHE PATH "" FORCE) @@ -766,88 +811,114 @@ MACRO(NL_SETUP_BUILD) CONVERT_VERSION_NUMBER(${IOS_VERSION_MAJOR} ${IOS_VERSION_MINOR} ${IOS_VERSION_PATCH} IOS_VERSION_NUMBER) ADD_PLATFORM_FLAGS("-D__IPHONE_OS_VERSION_MIN_REQUIRED=${IOS_VERSION_NUMBER}") - ENDIF(IOS_VERSION) + ENDIF() IF(CMAKE_IOS_SYSROOT) IF(TARGET_ARMV7S) IF(TARGETS_COUNT GREATER 1) SET(XARCH "-Xarch_armv7s ") - ENDIF(TARGETS_COUNT GREATER 1) + ENDIF() ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SYSROOT}") ADD_PLATFORM_FLAGS("${XARCH}-miphoneos-version-min=${IOS_VERSION}") - SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}") - ENDIF(TARGET_ARMV7S) + ADD_PLATFORM_LINKFLAGS("${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}") + ENDIF() IF(TARGET_ARMV7) IF(TARGETS_COUNT GREATER 1) SET(XARCH "-Xarch_armv7 ") - ENDIF(TARGETS_COUNT GREATER 1) + ENDIF() ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SYSROOT}") ADD_PLATFORM_FLAGS("${XARCH}-miphoneos-version-min=${IOS_VERSION}") - SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}") - ENDIF(TARGET_ARMV7) + ADD_PLATFORM_LINKFLAGS("${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}") + ENDIF() IF(TARGET_ARMV6) IF(TARGETS_COUNT GREATER 1) SET(XARCH "-Xarch_armv6 ") - ENDIF(TARGETS_COUNT GREATER 1) + ENDIF() ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SYSROOT}") ADD_PLATFORM_FLAGS("${XARCH}-miphoneos-version-min=${IOS_VERSION}") - SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}") - ENDIF(TARGET_ARMV6) - ENDIF(CMAKE_IOS_SYSROOT) + ADD_PLATFORM_LINKFLAGS("${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}") + ENDIF() + ENDIF() IF(CMAKE_IOS_SIMULATOR_SYSROOT AND TARGET_X86) IF(TARGETS_COUNT GREATER 1) SET(XARCH "-Xarch_i386 ") - ENDIF(TARGETS_COUNT GREATER 1) + ENDIF() ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SIMULATOR_SYSROOT}") ADD_PLATFORM_FLAGS("${XARCH}-mios-simulator-version-min=${IOS_VERSION}") IF(CMAKE_OSX_DEPLOYMENT_TARGET) - SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}") - ENDIF(CMAKE_OSX_DEPLOYMENT_TARGET) - ENDIF(CMAKE_IOS_SIMULATOR_SYSROOT AND TARGET_X86) - ELSE(IOS) + ADD_PLATFORM_LINKFLAGS("${XARCH}-Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}") + ENDIF() + ENDIF() + ELSE() # Always force -mmacosx-version-min to override environement variable IF(CMAKE_OSX_DEPLOYMENT_TARGET) - SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}") - ENDIF(CMAKE_OSX_DEPLOYMENT_TARGET) - ENDIF(IOS) + IF(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS "10.7") + MESSAGE(FATAL_ERROR "Minimum target for OS X is 10.7 but you're using ${CMAKE_OSX_DEPLOYMENT_TARGET}") + ENDIF() + ADD_PLATFORM_LINKFLAGS("-Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}") + ENDIF() + ENDIF() - SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-headerpad_max_install_names") + # use libc++ under OX X to be able to use new C++ features (and else it'll use GCC 4.2.1 STL) + # minimum target is now OS X 10.7 + SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} -stdlib=libc++") + + ADD_PLATFORM_LINKFLAGS("-Wl,-headerpad_max_install_names") IF(HAVE_FLAG_SEARCH_PATHS_FIRST) - SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-search_paths_first") - ENDIF(HAVE_FLAG_SEARCH_PATHS_FIRST) - ENDIF(NOT XCODE) - ELSE(APPLE) + ADD_PLATFORM_LINKFLAGS("-Wl,-search_paths_first") + ENDIF() + ENDIF() + ELSE() IF(HOST_CPU STREQUAL "x86_64" AND TARGET_CPU STREQUAL "x86") ADD_PLATFORM_FLAGS("-m32 -march=i686") - ENDIF(HOST_CPU STREQUAL "x86_64" AND TARGET_CPU STREQUAL "x86") + ENDIF() IF(HOST_CPU STREQUAL "x86" AND TARGET_CPU STREQUAL "x86_64") ADD_PLATFORM_FLAGS("-m64") - ENDIF(HOST_CPU STREQUAL "x86" AND TARGET_CPU STREQUAL "x86_64") - ENDIF(APPLE) + ENDIF() + ENDIF() + + # use c++0x standard to use std::unique_ptr and std::shared_ptr + IF(CMAKE_CXX11_EXTENSION_COMPILE_OPTION) + SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} ${CMAKE_CXX11_EXTENSION_COMPILE_OPTION}") + ENDIF() + + ADD_PLATFORM_FLAGS("-D_REENTRANT") + + # hardening + ADD_PLATFORM_FLAGS("-D_FORTIFY_SOURCE=2") - ADD_PLATFORM_FLAGS("-D_REENTRANT -pipe -fno-strict-aliasing") + IF(NOT WITH_LOW_MEMORY) + ADD_PLATFORM_FLAGS("-pipe") + ENDIF() IF(WITH_COVERAGE) ADD_PLATFORM_FLAGS("-fprofile-arcs -ftest-coverage") - ENDIF(WITH_COVERAGE) + ENDIF() IF(WITH_WARNINGS) - ADD_PLATFORM_FLAGS("-Wall -W -Wpointer-arith -Wsign-compare -Wno-deprecated-declarations -Wno-multichar -Wno-unused") - IF(CLANG) - ADD_PLATFORM_FLAGS("-std=gnu99") - ELSE(CLANG) - ADD_PLATFORM_FLAGS("-ansi") - ENDIF(CLANG) - ENDIF(WITH_WARNINGS) + ADD_PLATFORM_FLAGS("-Wall") + ELSE() + # Check wrong formats in printf-like functions + ADD_PLATFORM_FLAGS("-Wformat -Werror=format-security") + ENDIF() + + # never display these warnings because they are minor + ADD_PLATFORM_FLAGS("-Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-value") + + IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "6.0.0") + ADD_PLATFORM_FLAGS("-Wno-unused-local-typedefs") + ELSEIF(CLANG) + ADD_PLATFORM_FLAGS("-Wno-unused-private-field -Wno-unused-local-typedef") + ENDIF() IF(ANDROID) ADD_PLATFORM_FLAGS("--sysroot=${PLATFORM_ROOT}") @@ -856,68 +927,82 @@ MACRO(NL_SETUP_BUILD) ADD_PLATFORM_FLAGS("-Wa,--noexecstack") IF(TARGET_ARM) - ADD_PLATFORM_FLAGS("-fpic -fstack-protector") + ADD_PLATFORM_FLAGS("-fpic") ADD_PLATFORM_FLAGS("-D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__") IF(TARGET_ARMV7) ADD_PLATFORM_FLAGS("-march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16") - SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -march=armv7-a -Wl,--fix-cortex-a8") + ADD_PLATFORM_LINKFLAGS("-march=armv7-a -Wl,--fix-cortex-a8") ELSEIF(TARGET_ARMV5) ADD_PLATFORM_FLAGS("-march=armv5te -mtune=xscale -msoft-float") - ENDIF(TARGET_ARMV7) + ENDIF() SET(TARGET_THUMB ON) IF(TARGET_THUMB) - ADD_PLATFORM_FLAGS("-mthumb -fno-strict-aliasing -finline-limit=64") + ADD_PLATFORM_FLAGS("-mthumb -finline-limit=64") SET(DEBUG_CFLAGS "${DEBUG_CFLAGS} -marm") - ELSE(TARGET_THUMB) + ELSE() ADD_PLATFORM_FLAGS("-funswitch-loops -finline-limit=300") - SET(DEBUG_CFLAGS "${DEBUG_CFLAGS} -fno-strict-aliasing") - SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} -fstrict-aliasing") - ENDIF(TARGET_THUMB) + ENDIF() ELSEIF(TARGET_X86) # Optimizations for Intel Atom ADD_PLATFORM_FLAGS("-march=i686 -mtune=atom -mstackrealign -msse3 -mfpmath=sse -m32 -flto -ffast-math -funroll-loops") - ADD_PLATFORM_FLAGS("-fstack-protector -funswitch-loops -finline-limit=300") - SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} -fstrict-aliasing") - SET(DEBUG_CFLAGS "${DEBUG_CFLAGS} -fno-strict-aliasing") + ADD_PLATFORM_FLAGS("-funswitch-loops -finline-limit=300") ELSEIF(TARGET_MIPS) - ADD_PLATFORM_FLAGS("-fpic -finline-functions -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers -fno-strict-aliasing") + ADD_PLATFORM_FLAGS("-fpic -finline-functions -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers") SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} -funswitch-loops -finline-limit=300") - ENDIF(TARGET_ARM) - SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now") - SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -L${PLATFORM_ROOT}/usr/lib") - ENDIF(ANDROID) + ENDIF() + ADD_PLATFORM_LINKFLAGS("-Wl,-z,noexecstack") + ADD_PLATFORM_LINKFLAGS("-L${PLATFORM_ROOT}/usr/lib") + ENDIF() IF(APPLE) - ADD_PLATFORM_FLAGS("-gdwarf-2") - ENDIF(APPLE) + ADD_PLATFORM_FLAGS("-gdwarf-2 -D_DARWIN_UNLIMITED_STREAMS") + ENDIF() # Fix "relocation R_X86_64_32 against.." error on x64 platforms - IF(TARGET_X64 AND WITH_STATIC AND NOT WITH_STATIC_DRIVERS AND NOT MINGW) + IF(NOT MINGW) ADD_PLATFORM_FLAGS("-fPIC") - ENDIF(TARGET_X64 AND WITH_STATIC AND NOT WITH_STATIC_DRIVERS AND NOT MINGW) + ENDIF() + + # hardening + ADD_PLATFORM_FLAGS("-fstack-protector --param=ssp-buffer-size=4") + + # If -fstack-protector or -fstack-protector-all enabled, enable too new warnings and fix possible link problems + IF(WITH_WARNINGS) + ADD_PLATFORM_FLAGS("-Wstack-protector") + ENDIF() - SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} -ftemplate-depth-48") + # Fix undefined reference to `__stack_chk_fail' error + ADD_PLATFORM_LINKFLAGS("-lc") IF(NOT APPLE) - SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,--no-undefined -Wl,--as-needed") - ENDIF(NOT APPLE) + ADD_PLATFORM_LINKFLAGS("-Wl,--no-undefined -Wl,--as-needed") + + IF(WITH_STATIC_RUNTIMES) + ADD_PLATFORM_LINKFLAGS("-static-libstdc++") + ENDIF() + ENDIF() + + IF(NOT APPLE) + # hardening + ADD_PLATFORM_LINKFLAGS("-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now") + ENDIF() IF(WITH_SYMBOLS) SET(NL_RELEASE_CFLAGS "${NL_RELEASE_CFLAGS} -g") - ELSE(WITH_SYMBOLS) + ELSE() IF(APPLE) SET(NL_RELEASE_LINKFLAGS "-Wl,-dead_strip ${NL_RELEASE_LINKFLAGS}") - ELSE(APPLE) + ELSE() SET(NL_RELEASE_LINKFLAGS "-Wl,-s ${NL_RELEASE_LINKFLAGS}") - ENDIF(APPLE) - ENDIF(WITH_SYMBOLS) + ENDIF() + ENDIF() SET(NL_DEBUG_CFLAGS "-g -DNL_DEBUG -D_DEBUG ${NL_DEBUG_CFLAGS}") SET(NL_RELEASE_CFLAGS "-DNL_RELEASE -DNDEBUG -O3 ${NL_RELEASE_CFLAGS}") - ENDIF(MSVC) -ENDMACRO(NL_SETUP_BUILD) + ENDIF() +ENDMACRO() MACRO(NL_SETUP_BUILD_FLAGS) SET(CMAKE_C_FLAGS ${PLATFORM_CFLAGS} CACHE STRING "" FORCE) @@ -945,141 +1030,150 @@ ENDMACRO(NL_SETUP_BUILD_FLAGS) MACRO(NL_MAKE_ABSOLUTE_PREFIX NAME_RELATIVE NAME_ABSOLUTE) IF(IS_ABSOLUTE "${${NAME_RELATIVE}}") SET(${NAME_ABSOLUTE} ${${NAME_RELATIVE}}) - ELSE(IS_ABSOLUTE "${${NAME_RELATIVE}}") - IF(WIN32) - SET(${NAME_ABSOLUTE} ${${NAME_RELATIVE}}) - ELSE(WIN32) + ELSE() + IF(WITH_UNIX_STRUCTURE) SET(${NAME_ABSOLUTE} ${CMAKE_INSTALL_PREFIX}/${${NAME_RELATIVE}}) - ENDIF(WIN32) - ENDIF(IS_ABSOLUTE "${${NAME_RELATIVE}}") + ELSE() + SET(${NAME_ABSOLUTE} ${${NAME_RELATIVE}}) + ENDIF() + ENDIF() ENDMACRO(NL_MAKE_ABSOLUTE_PREFIX) MACRO(NL_SETUP_PREFIX_PATHS) + IF(TARGET_X64 AND WIN32) + SET(LIB_SUFFIX "64") + ELSE() + SET(LIB_SUFFIX "") + ENDIF() + ## Allow override of install_prefix/etc path. IF(NOT NL_ETC_PREFIX) - IF(WIN32) - SET(NL_ETC_PREFIX "." CACHE PATH "Installation path for configurations") - ELSE(WIN32) + IF(WITH_UNIX_STRUCTURE) SET(NL_ETC_PREFIX "etc/nel" CACHE PATH "Installation path for configurations") - ENDIF(WIN32) - ENDIF(NOT NL_ETC_PREFIX) + ELSE() + SET(NL_ETC_PREFIX "." CACHE PATH "Installation path for configurations") + ENDIF() + ENDIF() NL_MAKE_ABSOLUTE_PREFIX(NL_ETC_PREFIX NL_ETC_ABSOLUTE_PREFIX) ## Allow override of install_prefix/share path. IF(NOT NL_SHARE_PREFIX) - IF(WIN32) - SET(NL_SHARE_PREFIX "." CACHE PATH "Installation path for data.") - ELSE(WIN32) + IF(WITH_UNIX_STRUCTURE) SET(NL_SHARE_PREFIX "share/nel" CACHE PATH "Installation path for data.") - ENDIF(WIN32) - ENDIF(NOT NL_SHARE_PREFIX) + ELSE() + SET(NL_SHARE_PREFIX "." CACHE PATH "Installation path for data.") + ENDIF() + ENDIF() NL_MAKE_ABSOLUTE_PREFIX(NL_SHARE_PREFIX NL_SHARE_ABSOLUTE_PREFIX) ## Allow override of install_prefix/sbin path. IF(NOT NL_SBIN_PREFIX) - IF(WIN32) + IF(WITH_UNIX_STRUCTURE) + SET(NL_SBIN_PREFIX "sbin${LIB_SUFFIX}" CACHE PATH "Installation path for admin tools and services.") + ELSE() SET(NL_SBIN_PREFIX "." CACHE PATH "Installation path for admin tools and services.") - ELSE(WIN32) - SET(NL_SBIN_PREFIX "sbin" CACHE PATH "Installation path for admin tools and services.") - ENDIF(WIN32) - ENDIF(NOT NL_SBIN_PREFIX) + ENDIF() + ENDIF() NL_MAKE_ABSOLUTE_PREFIX(NL_SBIN_PREFIX NL_SBIN_ABSOLUTE_PREFIX) ## Allow override of install_prefix/bin path. IF(NOT NL_BIN_PREFIX) - IF(WIN32) + IF(WITH_UNIX_STRUCTURE) + SET(NL_BIN_PREFIX "bin${LIB_SUFFIX}" CACHE PATH "Installation path for tools and applications.") + ELSE() SET(NL_BIN_PREFIX "." CACHE PATH "Installation path for tools and applications.") - ELSE(WIN32) - SET(NL_BIN_PREFIX "bin" CACHE PATH "Installation path for tools and applications.") - ENDIF(WIN32) - ENDIF(NOT NL_BIN_PREFIX) + ENDIF() + ENDIF() NL_MAKE_ABSOLUTE_PREFIX(NL_BIN_PREFIX NL_BIN_ABSOLUTE_PREFIX) ## Allow override of install_prefix/lib path. IF(NOT NL_LIB_PREFIX) IF(LIBRARY_ARCHITECTURE) SET(NL_LIB_PREFIX "lib/${LIBRARY_ARCHITECTURE}" CACHE PATH "Installation path for libraries.") - ELSE(LIBRARY_ARCHITECTURE) - SET(NL_LIB_PREFIX "lib" CACHE PATH "Installation path for libraries.") - ENDIF(LIBRARY_ARCHITECTURE) - ENDIF(NOT NL_LIB_PREFIX) + ELSE() + SET(NL_LIB_PREFIX "lib${LIB_SUFFIX}" CACHE PATH "Installation path for libraries.") + ENDIF() + ENDIF() NL_MAKE_ABSOLUTE_PREFIX(NL_LIB_PREFIX NL_LIB_ABSOLUTE_PREFIX) ## Allow override of install_prefix/lib path. IF(NOT NL_DRIVER_PREFIX) - IF(WIN32) - SET(NL_DRIVER_PREFIX "." CACHE PATH "Installation path for drivers.") - ELSE(WIN32) + IF(WITH_UNIX_STRUCTURE) IF(LIBRARY_ARCHITECTURE) SET(NL_DRIVER_PREFIX "lib/${LIBRARY_ARCHITECTURE}/nel" CACHE PATH "Installation path for drivers.") - ELSE(LIBRARY_ARCHITECTURE) - SET(NL_DRIVER_PREFIX "lib/nel" CACHE PATH "Installation path for drivers.") - ENDIF(LIBRARY_ARCHITECTURE) - ENDIF(WIN32) - ENDIF(NOT NL_DRIVER_PREFIX) + ELSE() + IF(WIN32) + SET(NL_DRIVER_PREFIX "bin${LIB_SUFFIX}" CACHE PATH "Installation path for drivers.") + ELSE() + SET(NL_DRIVER_PREFIX "lib${LIB_SUFFIX}/nel" CACHE PATH "Installation path for drivers.") + ENDIF() + ENDIF() + ELSE() + SET(NL_DRIVER_PREFIX "." CACHE PATH "Installation path for drivers.") + ENDIF() + ENDIF() NL_MAKE_ABSOLUTE_PREFIX(NL_DRIVER_PREFIX NL_DRIVER_ABSOLUTE_PREFIX) - ENDMACRO(NL_SETUP_PREFIX_PATHS) MACRO(RYZOM_SETUP_PREFIX_PATHS) ## Allow override of install_prefix/etc path. IF(NOT RYZOM_ETC_PREFIX) - IF(WIN32) - SET(RYZOM_ETC_PREFIX "." CACHE PATH "Installation path for configurations") - ELSE(WIN32) + IF(WITH_UNIX_STRUCTURE) SET(RYZOM_ETC_PREFIX "etc/ryzom" CACHE PATH "Installation path for configurations") - ENDIF(WIN32) - ENDIF(NOT RYZOM_ETC_PREFIX) + ELSE() + SET(RYZOM_ETC_PREFIX "." CACHE PATH "Installation path for configurations") + ENDIF() + ENDIF() NL_MAKE_ABSOLUTE_PREFIX(RYZOM_ETC_PREFIX RYZOM_ETC_ABSOLUTE_PREFIX) ## Allow override of install_prefix/share path. IF(NOT RYZOM_SHARE_PREFIX) - IF(WIN32) - SET(RYZOM_SHARE_PREFIX "." CACHE PATH "Installation path for data.") - ELSE(WIN32) + IF(WITH_UNIX_STRUCTURE) SET(RYZOM_SHARE_PREFIX "share/ryzom" CACHE PATH "Installation path for data.") - ENDIF(WIN32) - ENDIF(NOT RYZOM_SHARE_PREFIX) + ELSE() + SET(RYZOM_SHARE_PREFIX "." CACHE PATH "Installation path for data.") + ENDIF() + ENDIF() NL_MAKE_ABSOLUTE_PREFIX(RYZOM_SHARE_PREFIX RYZOM_SHARE_ABSOLUTE_PREFIX) ## Allow override of install_prefix/sbin path. IF(NOT RYZOM_SBIN_PREFIX) - IF(WIN32) + IF(WITH_UNIX_STRUCTURE) + SET(RYZOM_SBIN_PREFIX "sbin${LIB_SUFFIX}" CACHE PATH "Installation path for admin tools and services.") + ELSE() SET(RYZOM_SBIN_PREFIX "." CACHE PATH "Installation path for admin tools and services.") - ELSE(WIN32) - SET(RYZOM_SBIN_PREFIX "sbin" CACHE PATH "Installation path for admin tools and services.") - ENDIF(WIN32) - ENDIF(NOT RYZOM_SBIN_PREFIX) + ENDIF() + ENDIF() NL_MAKE_ABSOLUTE_PREFIX(RYZOM_SBIN_PREFIX RYZOM_SBIN_ABSOLUTE_PREFIX) ## Allow override of install_prefix/bin path. IF(NOT RYZOM_BIN_PREFIX) - IF(WIN32) + IF(WITH_UNIX_STRUCTURE) + SET(RYZOM_BIN_PREFIX "bin${LIB_SUFFIX}" CACHE PATH "Installation path for tools.") + ELSE() SET(RYZOM_BIN_PREFIX "." CACHE PATH "Installation path for tools and applications.") - ELSE(WIN32) - SET(RYZOM_BIN_PREFIX "bin" CACHE PATH "Installation path for tools.") - ENDIF(WIN32) - ENDIF(NOT RYZOM_BIN_PREFIX) + ENDIF() + ENDIF() NL_MAKE_ABSOLUTE_PREFIX(RYZOM_BIN_PREFIX RYZOM_BIN_ABSOLUTE_PREFIX) ## Allow override of install_prefix/lib path. IF(NOT RYZOM_LIB_PREFIX) IF(LIBRARY_ARCHITECTURE) SET(RYZOM_LIB_PREFIX "lib/${LIBRARY_ARCHITECTURE}" CACHE PATH "Installation path for libraries.") - ELSE(LIBRARY_ARCHITECTURE) - SET(RYZOM_LIB_PREFIX "lib" CACHE PATH "Installation path for libraries.") - ENDIF(LIBRARY_ARCHITECTURE) - ENDIF(NOT RYZOM_LIB_PREFIX) + ELSE() + SET(RYZOM_LIB_PREFIX "lib${LIB_SUFFIX}" CACHE PATH "Installation path for libraries.") + ENDIF() + ENDIF() NL_MAKE_ABSOLUTE_PREFIX(RYZOM_LIB_PREFIX RYZOM_LIB_ABSOLUTE_PREFIX) ## Allow override of install_prefix/games path. IF(NOT RYZOM_GAMES_PREFIX) - IF(WIN32) - SET(RYZOM_GAMES_PREFIX "." CACHE PATH "Installation path for tools and applications.") - ELSE(WIN32) + IF(WITH_UNIX_STRUCTURE) SET(RYZOM_GAMES_PREFIX "games" CACHE PATH "Installation path for client.") - ENDIF(WIN32) - ENDIF(NOT RYZOM_GAMES_PREFIX) + ELSE() + SET(RYZOM_GAMES_PREFIX "." CACHE PATH "Installation path for tools and applications.") + ENDIF() + ENDIF() NL_MAKE_ABSOLUTE_PREFIX(RYZOM_GAMES_PREFIX RYZOM_GAMES_ABSOLUTE_PREFIX) ENDMACRO(RYZOM_SETUP_PREFIX_PATHS) @@ -1087,7 +1181,7 @@ ENDMACRO(RYZOM_SETUP_PREFIX_PATHS) MACRO(SETUP_EXTERNAL) IF(WITH_EXTERNAL) FIND_PACKAGE(External REQUIRED) - ENDIF(WITH_EXTERNAL) + ENDIF() IF(WIN32) FIND_PACKAGE(External REQUIRED) @@ -1096,41 +1190,51 @@ MACRO(SETUP_EXTERNAL) IF(DEFINED BOOST_DIR) SET(BOOST_INCLUDEDIR ${BOOST_DIR}/include) SET(BOOST_LIBRARYDIR ${BOOST_DIR}/lib) - ENDIF(DEFINED BOOST_DIR) - ELSE(WIN32) + ENDIF() + ELSE() FIND_PACKAGE(External QUIET) IF(APPLE) IF(WITH_STATIC_EXTERNAL) + # Look only for static libraries because systems libraries are using Frameworks SET(CMAKE_FIND_LIBRARY_SUFFIXES .a) - ELSE(WITH_STATIC_EXTERNAL) + ELSE() SET(CMAKE_FIND_LIBRARY_SUFFIXES .dylib .so .a) - ENDIF(WITH_STATIC_EXTERNAL) - ELSE(APPLE) + ENDIF() + ELSE() IF(WITH_STATIC_EXTERNAL) SET(CMAKE_FIND_LIBRARY_SUFFIXES .a .so) - ELSE(WITH_STATIC_EXTERNAL) + ELSE() SET(CMAKE_FIND_LIBRARY_SUFFIXES .so .a) - ENDIF(WITH_STATIC_EXTERNAL) - ENDIF(APPLE) - ENDIF(WIN32) + ENDIF() + ENDIF() + ENDIF() - # Android and iOS have pthread - IF(ANDROID OR IOS) + # Android, iOS and Mac OS X have pthread, but no need to link to libpthread + IF(ANDROID OR APPLE) SET(CMAKE_USE_PTHREADS_INIT 1) SET(Threads_FOUND TRUE) - ELSE(ANDROID OR IOS) - FIND_PACKAGE(Threads REQUIRED) + ELSE() + SET(THREADS_HAVE_PTHREAD_ARG ON) + FIND_PACKAGE(Threads) # TODO: replace all -l by absolute path to in CMAKE_THREAD_LIBS_INIT - ENDIF(ANDROID OR IOS) + ENDIF() IF(WITH_STLPORT) FIND_PACKAGE(STLport REQUIRED) INCLUDE_DIRECTORIES(${STLPORT_INCLUDE_DIR}) - ENDIF(WITH_STLPORT) + ENDIF() + + IF(WIN32) + # Must include DXSDK before WINSDK + FIND_PACKAGE(DirectXSDK REQUIRED) + # IF(DXSDK_INCLUDE_DIR) + # INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) + # ENDIF() + ENDIF() IF(MSVC) FIND_PACKAGE(MSVC REQUIRED) FIND_PACKAGE(WindowsSDK REQUIRED) - ENDIF(MSVC) -ENDMACRO(SETUP_EXTERNAL) + ENDIF() +ENDMACRO() diff --git a/code/config.h.cmake b/code/config.h.cmake index d3c9f701d..69171cf68 100644 --- a/code/config.h.cmake +++ b/code/config.h.cmake @@ -1,39 +1,6 @@ #ifndef CONFIG_H #define CONFIG_H -#cmakedefine HAVE_DL_H 1 -#cmakedefine HAVE_EXECINFO_H 1 -#cmakedefine HAVE_ICONV 1 -#cmakedefine HAVE_INTTYPES_H 1 -#cmakedefine HAVE_LANGINFO_CODESET 1 -#cmakedefine HAVE_LIMITS_H 1 -#cmakedefine HAVE_MALLOC_H 1 -#cmakedefine HAVE_PAM_MISC_H 1 -#cmakedefine HAVE_PAM_PAM_APPL_H 1 -#cmakedefine HAVE_PTHREAD 1 -#cmakedefine HAVE_SECURITY_PAM_APPL_H 1 -#cmakedefine HAVE_SECURITY_PAM_MISC_H 1 -#cmakedefine HAVE_STDINT_H 1 -#cmakedefine HAVE_SYS_MOUNT_H 1 -#cmakedefine HAVE_SYS_PARAM_H 1 -#cmakedefine HAVE_SYS_STATVFS_H 1 -#cmakedefine HAVE_SYS_TYPES_H 1 -#cmakedefine HAVE_UNISTD_H 1 -#cmakedefine HAVE_UTIME_H 1 -#cmakedefine HAVE_WCHAR_H 1 - -#cmakedefine HAVE_BACKTRACE 1 -#cmakedefine HAVE_INET_NTOA 1 -#cmakedefine HAVE_INET_NTOP 1 -#cmakedefine HAVE_INET_PTON 1 -#cmakedefine HAVE_STRERROR 1 -#cmakedefine HAVE_STRLCAT 1 -#cmakedefine HAVE_STRPTIME 1 -#cmakedefine HAVE_STRTOK_R 1 -#cmakedefine HAVE_STRTOULL 1 -#cmakedefine HAVE_STATVFS 1 -#cmakedefine HAVE_STAT64 1 - #cmakedefine NL_OPENGL_AVAILABLE ${NL_OPENGL_AVAILABLE} #cmakedefine NL_OPENGLES_AVAILABLE ${NL_OPENGLES_AVAILABLE} #cmakedefine NL_DIRECT3D_AVAILABLE ${NL_DIRECT3D_AVAILABLE} @@ -43,6 +10,8 @@ #cmakedefine NL_DSOUND_AVAILABLE ${NL_DSOUND_AVAILABLE} #cmakedefine NL_XAUDIO2_AVAILABLE ${NL_XAUDIO2_AVAILABLE} +#cmakedefine NL_STEREO_AVAILABLE ${NL_STEREO_AVAILABLE} + #cmakedefine NL_BIN_PREFIX "${NL_BIN_ABSOLUTE_PREFIX}" #cmakedefine NL_ETC_PREFIX "${NL_ETC_ABSOLUTE_PREFIX}" #cmakedefine NL_SHARE_PREFIX "${NL_SHARE_ABSOLUTE_PREFIX}" @@ -53,4 +22,18 @@ #cmakedefine RYZOM_ETC_PREFIX "${RYZOM_ETC_ABSOLUTE_PREFIX}" #cmakedefine RYZOM_SHARE_PREFIX "${RYZOM_SHARE_ABSOLUTE_PREFIX}" +#cmakedefine REVISION "${REVISION}" +#cmakedefine BUILD_DATE "${BUILD_DATE}" + +#cmakedefine NL_VERSION "${NL_VERSION}" +#cmakedefine NL_VERSION_RC ${NL_VERSION_RC} + +#cmakedefine RYZOM_VERSION "${RYZOM_VERSION}" +#cmakedefine RYZOM_VERSION_RC ${RYZOM_VERSION_RC} +#cmakedefine AUTHOR "${AUTHOR}" +#cmakedefine YEAR "${YEAR}" +#cmakedefine COPYRIGHT "${COPYRIGHT}" + +#cmakedefine RYZOM_CLIENT_ICON "${RYZOM_CLIENT_ICON}" + #endif // CONFIG_H diff --git a/code/nel/CMakeLists.txt b/code/nel/CMakeLists.txt index 53bf071e3..3470fcebb 100644 --- a/code/nel/CMakeLists.txt +++ b/code/nel/CMakeLists.txt @@ -1,53 +1,39 @@ -PROJECT(NeL CXX C) - IF(WITH_STATIC_DRIVERS) ADD_DEFINITIONS(-DNL_STATIC) -ENDIF(WITH_STATIC_DRIVERS) +ENDIF() -# On Windows we need to find DirectInput for NLMISC. -# This is how we get events. IF(WIN32) - FIND_PACKAGE(DirectXSDK REQUIRED) - # On Win32 we can also build the MAX plugins. IF(WITH_NEL_MAXPLUGIN) FIND_PACKAGE(3dsMaxSDK) - ENDIF(WITH_NEL_MAXPLUGIN) -ENDIF(WIN32) + ENDIF() +ENDIF() IF(WITH_3D) FIND_PACKAGE(FreeType) IF(WITH_NEL_CEGUI) FIND_PACKAGE(CEGUI) - ENDIF(WITH_NEL_CEGUI) - -ENDIF(WITH_3D) + ENDIF() +ENDIF() IF(WITH_SOUND) FIND_PACKAGE(Ogg) FIND_PACKAGE(Vorbis) + FIND_PACKAGE(FFmpeg COMPONENTS AVCODEC AVFORMAT AVUTIL SWRESAMPLE) IF(WITH_DRIVER_OPENAL) FIND_PACKAGE(OpenAL) - ENDIF(WITH_DRIVER_OPENAL) + ENDIF() IF(WITH_DRIVER_FMOD) FIND_PACKAGE(FMOD) - ENDIF(WITH_DRIVER_FMOD) -ENDIF(WITH_SOUND) + ENDIF() +ENDIF() IF(WITH_GTK) FIND_PACKAGE(GTK2) -ENDIF(WITH_GTK) - -IF(WITH_LIBOVR) - FIND_PACKAGE(LibOVR) -ENDIF(WITH_LIBOVR) - -IF(WITH_LIBVR) - FIND_PACKAGE(LibVR) -ENDIF(WITH_LIBVR) +ENDIF() IF(WITH_INSTALL_LIBRARIES) IF(UNIX) @@ -65,22 +51,15 @@ IF(WITH_INSTALL_LIBRARIES) CONFIGURE_FILE(nel-config.in ${CMAKE_CURRENT_BINARY_DIR}/nel-config) INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/nel-config DESTINATION ${NL_BIN_PREFIX}) - ENDIF(UNIX) + ENDIF() ADD_SUBDIRECTORY(include) -ENDIF(WITH_INSTALL_LIBRARIES) +ENDIF() ADD_SUBDIRECTORY(src) IF(WITH_NEL_SAMPLES) ADD_SUBDIRECTORY(samples) -ENDIF(WITH_NEL_SAMPLES) - -# Allow to compile only max plugins without other tools. -IF(WITH_NEL_TOOLS OR WITH_NEL_MAXPLUGIN) - IF(WITH_NEL_TOOLS) - FIND_PACKAGE(Squish) - ENDIF(WITH_NEL_TOOLS) - ADD_SUBDIRECTORY(tools) -ENDIF(WITH_NEL_TOOLS OR WITH_NEL_MAXPLUGIN) +ENDIF() +ADD_SUBDIRECTORY(tools) diff --git a/code/nel/include/nel/3d/anim_detail_trav.h b/code/nel/include/nel/3d/anim_detail_trav.h index 7b51afe84..0a94fe376 100644 --- a/code/nel/include/nel/3d/anim_detail_trav.h +++ b/code/nel/include/nel/3d/anim_detail_trav.h @@ -71,7 +71,7 @@ public: // For clipTrav. cleared at beginning of CClipTrav::traverse void clearVisibleList(); - // For ClipTrav only. NB: list is cleared at begininng of traverse(). NB: only CTransform are supported + // For ClipTrav only. NB: list is cleared at beginning of traverse(). NB: only CTransform are supported void addVisibleModel(CTransform *model) { _VisibleList[_CurrentNumVisibleModels]= model; diff --git a/code/nel/include/nel/3d/animatable.h b/code/nel/include/nel/3d/animatable.h index 09297ab2b..6e4a7b39f 100644 --- a/code/nel/include/nel/3d/animatable.h +++ b/code/nel/include/nel/3d/animatable.h @@ -19,6 +19,8 @@ #include "nel/misc/types_nl.h" #include "nel/misc/bit_set.h" +#include "nel/misc/smart_ptr.h" + #include #include #include diff --git a/code/nel/include/nel/3d/animated_lightmap.h b/code/nel/include/nel/3d/animated_lightmap.h index 51f1c909e..b8b887d7a 100644 --- a/code/nel/include/nel/3d/animated_lightmap.h +++ b/code/nel/include/nel/3d/animated_lightmap.h @@ -21,13 +21,17 @@ #include "nel/misc/types_nl.h" #include "nel/misc/smart_ptr.h" #include "nel/3d/animatable.h" + #include "nel/3d/track.h" + #include namespace NL3D { +class CScene; + // *************************************************************************** /** * An animated lightmap diff --git a/code/nel/include/nel/3d/animation_set_user.h b/code/nel/include/nel/3d/animation_set_user.h index b0e863297..39477891e 100644 --- a/code/nel/include/nel/3d/animation_set_user.h +++ b/code/nel/include/nel/3d/animation_set_user.h @@ -93,7 +93,7 @@ public: uint addAnimation (const char* fileName, const char* animName, bool displayMissingFileWarning = true) { // Allocate an animation - std::auto_ptr anim (new CAnimation); + CUniquePtr anim (new CAnimation); // Read it NLMISC::CIFile file; @@ -130,7 +130,7 @@ public: virtual uint addSkeletonWeight (const char* fileName, const char* skelName) { // Allocate an animation - std::auto_ptr skeletonWeight (new CSkeletonWeight); + CUniquePtr skeletonWeight (new CSkeletonWeight); // Read it NLMISC::CIFile file; diff --git a/code/nel/include/nel/3d/async_file_manager_3d.h b/code/nel/include/nel/3d/async_file_manager_3d.h index dede1b419..4e86f10b1 100644 --- a/code/nel/include/nel/3d/async_file_manager_3d.h +++ b/code/nel/include/nel/3d/async_file_manager_3d.h @@ -88,7 +88,7 @@ private: public: std::string MeshName; public: - CMeshLoad (const std::string &meshName, IShape **ppShp, IDriver *pDriver, const CVector &position, uint selectedTexture); + CMeshLoad (const std::string &meshName, IShape **ppShp, IDriver *pDriver, const NLMISC::CVector &position, uint selectedTexture); void run (void); void getName (std::string &result) const; }; @@ -122,7 +122,7 @@ private: CTextureFile *TextureFile; bool *Signal; public: - CTextureLoad(CTextureFile *textureFile, bool *psgn, const CVector &position) + CTextureLoad(CTextureFile *textureFile, bool *psgn, const NLMISC::CVector &position) : TextureFile(textureFile), Signal(psgn) { Position = position; diff --git a/code/nel/include/nel/3d/async_texture_manager.h b/code/nel/include/nel/3d/async_texture_manager.h index 8a848cb52..af27c3fde 100644 --- a/code/nel/include/nel/3d/async_texture_manager.h +++ b/code/nel/include/nel/3d/async_texture_manager.h @@ -152,7 +152,7 @@ private: struct CTextureLodToSort { CTextureLod *Lod; - CVector Position; + NLMISC::CVector Position; bool operator<(const CTextureLodToSort &other) const { return Lod->WeightWeight; diff --git a/code/nel/include/nel/3d/bloom_effect.h b/code/nel/include/nel/3d/bloom_effect.h index c10967254..49c959e23 100644 --- a/code/nel/include/nel/3d/bloom_effect.h +++ b/code/nel/include/nel/3d/bloom_effect.h @@ -31,6 +31,7 @@ namespace NL3D class UDriver; class UScene; +class CTextureUser; //----------------------------------------------------------------------------------------------------------- //---------------------------------------- CBloomEffect ----------------------------------------------------- @@ -52,19 +53,14 @@ public: // 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); + // Called after the Driver initialization. + void init(); // must be called before init void setDriver(UDriver *driver) { _Driver = driver; } UDriver* getDriver() const { return _Driver; } - // must be called before initBloom + // must be called before applyBloom void setScene(UScene *scene) { _Scene = scene; } UScene* getScene() const { return _Scene; } @@ -76,6 +72,9 @@ public: void setDensityBloom(uint8 densityBloom) { _DensityBloom = densityBloom; } uint8 getDensityBloom() const { return _DensityBloom; } + // Applies bloom to the current render target + void applyBloom(); + // 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 @@ -83,11 +82,11 @@ public: // 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(); + // 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(); + // 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, @@ -95,15 +94,12 @@ public: // 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(); + // void endInterfacesDisplayBloom(); private: - // Initialize textures and materials. - void init(); - // Initialize a bloom texture with new dimensions. - void initTexture(NLMISC::CSmartPtr & tex, bool isMode2D, uint32 width, uint32 height); + // void initTexture(NLMISC::CSmartPtr & 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. @@ -130,6 +126,7 @@ private: // density of bloom uint8 _DensityBloom; +/* // render target textures // used to display scene NLMISC::CSmartPtr _InitText; @@ -140,13 +137,12 @@ private: NLMISC::CSmartPtr _BlurHorizontalTex; // original render target NLMISC::CSmartPtr _OriginalRenderTarget; +*/ // 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; @@ -156,21 +152,24 @@ private: // 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; + /*uint32 _WndWidth; + uint32 _WndHeight;*/ + // Temporary variables used during applyBloom(...) -> // current blur texture dimensions uint32 _BlurWidth; uint32 _BlurHeight; + // used as stretched texture from _InitText, as displayed texture in first blur pass, + // and as render target in second blur pass. + CTextureUser *_BlurFinalTex; + // used as render target in first blur pass, and as displayed texture on second blur pass. + CTextureUser *_BlurHorizontalTex; + // <- }; } // NL3D diff --git a/code/nel/include/nel/3d/camera_col.h b/code/nel/include/nel/3d/camera_col.h index 9151b0a22..6b5a30517 100644 --- a/code/nel/include/nel/3d/camera_col.h +++ b/code/nel/include/nel/3d/camera_col.h @@ -20,6 +20,7 @@ #include "nel/misc/types_nl.h" #include "nel/misc/vector.h" #include "nel/misc/plane.h" +#include "nel/misc/aabbox.h" namespace NL3D { @@ -39,16 +40,16 @@ public: /** build the camera collision as a cone or a cylinder */ - void build(const CVector &start, const CVector &end, float radius, bool cone); + void build(const NLMISC::CVector &start, const NLMISC::CVector &end, float radius, bool cone); /** build the camera collision as a simple ray */ - void buildRay(const CVector &start, const CVector &end); + void buildRay(const NLMISC::CVector &start, const NLMISC::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); + void minimizeDistanceAgainstTri(const NLMISC::CVector &p0, const NLMISC::CVector &p1, const NLMISC::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) @@ -69,9 +70,9 @@ private: enum {MaxNPlanes=6}; // The start of the camera raycast - CVector _Start; + NLMISC::CVector _Start; // The end of the camera raycast - CVector _End; + NLMISC::CVector _End; // The radius (at end only if cone) float _Radius; // cone or cylinder? @@ -83,8 +84,8 @@ private: NLMISC::CAABBox _BBox; // Temp Data for minimizeDistanceAgainstTri - CVector _ArrayIn[3+MaxNPlanes]; - CVector _ArrayOut[3+MaxNPlanes]; + NLMISC::CVector _ArrayIn[3+MaxNPlanes]; + NLMISC::CVector _ArrayOut[3+MaxNPlanes]; // The pyramid representing the camera collision volume. Nb: local to start for precision problems NLMISC::CPlane _Pyramid[MaxNPlanes]; @@ -97,10 +98,10 @@ private: float _MaxRadiusProj; float _OODeltaRadiusProj; float _RayLen; - CVector _RayNorm; + NLMISC::CVector _RayNorm; // simpler method for simple ray - void intersectRay(const CVector &p0, const CVector &p1, const CVector &p2, float &sqrMinDist); + void intersectRay(const NLMISC::CVector &p0, const NLMISC::CVector &p1, const NLMISC::CVector &p2, float &sqrMinDist); }; diff --git a/code/nel/include/nel/3d/cloud_scape_user.h b/code/nel/include/nel/3d/cloud_scape_user.h index 15c926927..9e2a88376 100644 --- a/code/nel/include/nel/3d/cloud_scape_user.h +++ b/code/nel/include/nel/3d/cloud_scape_user.h @@ -22,6 +22,7 @@ namespace NL3D class UDriver; class UCamera; class CCloudScape; +class CScene; /// implementation of UWaterInstance methods class CCloudScapeUser : public UCloudScape diff --git a/code/nel/include/nel/3d/cluster.h b/code/nel/include/nel/3d/cluster.h index 552d7474a..b038a34c4 100644 --- a/code/nel/include/nel/3d/cluster.h +++ b/code/nel/include/nel/3d/cluster.h @@ -120,7 +120,7 @@ public: void setWorldMatrix (const NLMISC::CMatrix &WM); - bool isRoot() { return _LocalVolume.size() == 0; } + bool isRoot() { return _LocalVolume.empty(); } //\name Sound related. //@{ diff --git a/code/nel/include/nel/3d/coarse_mesh_manager.h b/code/nel/include/nel/3d/coarse_mesh_manager.h index ce571cbd1..feaad9e05 100644 --- a/code/nel/include/nel/3d/coarse_mesh_manager.h +++ b/code/nel/include/nel/3d/coarse_mesh_manager.h @@ -84,7 +84,7 @@ public: void setTextureFile (const char* file); /** - * Add a coarse mesh in the manager. If an error occured, it returns CantAddCoarseMesh. + * Add a coarse mesh in the manager. If an error occurred, 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 diff --git a/code/nel/include/nel/3d/computed_string.h b/code/nel/include/nel/3d/computed_string.h index 517200383..25d12a3ac 100644 --- a/code/nel/include/nel/3d/computed_string.h +++ b/code/nel/include/nel/3d/computed_string.h @@ -178,6 +178,10 @@ public: CVertexBuffer Vertices; CMaterial *Material; CRGBA Color; + ucstring Text; + + uint32 CacheVersion; + /// The width of the string, in pixels (eg: 30) float StringWidth; /// The height of the string, in pixels (eg: 10) @@ -223,6 +227,7 @@ public: */ CComputedString (bool bSetupVB=true) { + CacheVersion = 0; StringWidth = 0; StringHeight = 0; if (bSetupVB) diff --git a/code/nel/include/nel/3d/driver.h b/code/nel/include/nel/3d/driver.h index 022246838..85140b3da 100644 --- a/code/nel/include/nel/3d/driver.h +++ b/code/nel/include/nel/3d/driver.h @@ -42,9 +42,6 @@ namespace NLMISC { class IEventEmitter; -struct IMouseDevice; -struct IKeyboardDevice; -struct IInputDeviceManager; class CRect; class CLog; } @@ -75,6 +72,7 @@ struct IOcclusionQuery; /// A Graphic Mode descriptor. struct GfxMode { + std::string DisplayDevice; bool OffScreen; bool Windowed; uint16 Width; @@ -93,7 +91,7 @@ struct GfxMode Frequency = 0; AntiAlias = -1; } - GfxMode(uint16 w, uint16 h, uint8 d, bool windowed = true, bool offscreen = false, uint frequency = 0, sint8 aa = -1); + GfxMode(uint16 w, uint16 h, uint8 d, bool windowed = true, bool offscreen = false, uint frequency = 0, sint8 aa = -1, const std::string &displayDevice = std::string()); }; // **************************************************************************** @@ -226,7 +224,7 @@ public: // @{ // first param is the associated window. // Must be a HWND for Windows (WIN32). - virtual bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show = true, bool resizeable = true) throw(EBadDisplay) = 0; + virtual bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show = true, bool resizeable = true) = 0; // Must be called after a setDisplay that initialize the mode virtual bool setMode(const GfxMode &mode) = 0; virtual bool getModes(std::vector &modes) = 0; @@ -259,7 +257,7 @@ public: virtual emptyProc getWindowProc() = 0; virtual NLMISC::IEventEmitter *getEventEmitter() = 0; - + /// Copy a string to system clipboard. virtual bool copyTextToClipboard(const ucstring &text) = 0; @@ -362,7 +360,7 @@ public: virtual void getDepthRange(float &znear, float &zfar) const = 0; // @} - + /// \name Textures // @{ @@ -417,6 +415,16 @@ public: */ virtual void setAnisotropicFilter(sint filter) = 0; + /** + * Get current anisotropic filter value + */ + virtual uint getAnisotropicFilter() const = 0; + + /** + * Get maximum anisotropic filter value + */ + virtual uint getAnisotropicFilterMaximum() const = 0; + /** if !=1, force mostly all the textures (but TextureFonts lightmaps, interfaces etc..) * to be divided by Divisor (2, 4, 8...) * Default is 1. @@ -434,7 +442,7 @@ public: * Under OpenGL this simply returns the maximum number of texture stages (getNbTextureStages) in both return values. */ virtual void getNumPerStageConstant(uint &lightedMaterial, uint &unlightedMaterial) const = 0; - + // [DEPRECATED] Return if this texture is a rectangle texture that requires RECT sampler (OpenGL specific pre-NPOT functionality) virtual bool isTextureRectangle(ITexture *tex) const = 0; @@ -442,7 +450,7 @@ public: virtual bool supportNonPowerOfTwoTextures() const = 0; // @} - + /// \name Texture operations // @{ @@ -495,7 +503,7 @@ public: * * NB: you must setupViewMatrix() BEFORE setupModelMatrix(), or else undefined results. */ - virtual void setupViewMatrix(const CMatrix &mtx)=0; + virtual void setupViewMatrix(const CMatrix &mtx) = 0; /** setup the view matrix (inverse of camera matrix). * Extended: give a cameraPos (mtx.Pos() is not taken into account but for getViewMatrix()), @@ -536,7 +544,7 @@ public: virtual bool isForceNormalize() const = 0; // @} - + /// \name Vertex Buffer Hard: Features // @{ @@ -737,7 +745,7 @@ public: virtual uint getSwapVBLInterval() = 0; // @} - + @@ -857,6 +865,12 @@ public: * get the official name of the driver */ virtual const char *getVideocardInformation () = 0; + + /** + * Get total video memory. + * get the amount of video memory of current adapter, result is in KiB, -1 if unable to determine + */ + virtual sint getTotalVideoMemory () const = 0; // @} @@ -869,29 +883,6 @@ public: /// x and y must be between 0.0 and 1.0 virtual void setMousePos(float x, float y) = 0; - /** Enable / disable low level mouse. This allow to take advantage of some options (speed of the mouse, automatic wrapping) - * It returns a interface to these parameters when it is supported, or NULL otherwise - * The interface pointer is valid as long as the low level mouse is enabled. - * A call to disable the mouse returns NULL, and restore the default mouse behavior - * NB : - In this mode the mouse cursor isn't drawn. - * - Calls to showCursor have no effects - * - Calls to setCapture have no effects - */ - virtual NLMISC::IMouseDevice *enableLowLevelMouse(bool enable, bool exclusive) = 0; - - /** Enable / disable a low level keyboard. - * Such a keyboard can only send KeyDown and KeyUp event. It just consider the keyboard as a - * gamepad with lots of buttons... - * This returns a interface to some parameters when it is supported, or NULL otherwise. - * The interface pointer is valid as long as the low level keyboard is enabled. - * A call to disable the keyboard returns NULL, and restore the default keyboard behavior - */ - virtual NLMISC::IKeyboardDevice *enableLowLevelKeyboard(bool enable) = 0; - - /** Get the delay in ms for mouse double clicks. - */ - virtual uint getDoubleClickDelay(bool hardwareMouse) = 0; - /** If true, capture the mouse to force it to stay under the window. * NB : this has no effects if a low level mouse is used */ @@ -908,11 +899,6 @@ public: // Change default scale for all cursors virtual void setCursorScale(float scale) = 0; - - /** Check whether there is a low level device manager available, and get its interface. Return NULL if not available - * From this interface you can deal with mouse and keyboard as above, but you can also manage game device (joysticks, joypads ...) - */ - virtual NLMISC::IInputDeviceManager *getLowLevelInputDeviceManager() = 0; // @} @@ -1005,6 +991,9 @@ public: ) = 0; // @} + /// Hack for bloom + virtual bool textureCoordinateAlternativeMode() const = 0; + /// \name Render state: Polygon mode @@ -1106,7 +1095,7 @@ public: virtual bool supportVertexProgram(CVertexProgram::TProfile profile) const = 0; /** Compile the given vertex program, return if successful. - * If a vertex program was set active before compilation, + * If a vertex program was set active before compilation, * the state of the active vertex program is undefined behaviour afterwards. */ virtual bool compileVertexProgram(CVertexProgram *program) = 0; @@ -1133,7 +1122,7 @@ public: virtual bool supportPixelProgram(CPixelProgram::TProfile profile) const = 0; /** Compile the given pixel program, return if successful. - * If a pixel program was set active before compilation, + * If a pixel program was set active before compilation, * the state of the active pixel program is undefined behaviour afterwards. */ virtual bool compilePixelProgram(CPixelProgram *program) = 0; @@ -1160,7 +1149,7 @@ public: virtual bool supportGeometryProgram(CGeometryProgram::TProfile profile) const = 0; /** Compile the given pixel program, return if successful. - * If a pixel program was set active before compilation, + * If a pixel program was set active before compilation, * the state of the active pixel program is undefined behaviour afterwards. */ virtual bool compileGeometryProgram(CGeometryProgram *program) = 0; @@ -1359,6 +1348,7 @@ public: uint32 DeviceId; uint32 SubSysId; uint32 Revision; + sint32 VideoMemory; // video memory in KiB, -1 if unable to determine }; // Get the number of hardware renderer available on the client platform. @@ -1449,7 +1439,6 @@ protected: private: bool _StaticMemoryToVRAM; - }; // -------------------------------------------------- diff --git a/code/nel/include/nel/3d/driver_user.h b/code/nel/include/nel/3d/driver_user.h index ff9ba8973..62c6fd6db 100644 --- a/code/nel/include/nel/3d/driver_user.h +++ b/code/nel/include/nel/3d/driver_user.h @@ -34,7 +34,7 @@ #include "nel/3d/vertex_stream_manager.h" #include "nel/3d/async_texture_manager.h" #include "nel/3d/lod_character_manager.h" - +#include "nel/3d/render_target_manager.h" namespace NL3D { @@ -71,6 +71,7 @@ protected: bool _WindowInit; CMatrixContext _CurrentMatrixContext; CFontManager _FontManager; + CRenderTargetManager _RenderTargetManager; // Components List. typedef CPtrSet TTextureSet; typedef CPtrSet TTextContextSet; @@ -108,6 +109,11 @@ protected: CMaterial _MatTextInternal; CMaterial _MatTextStretchInternal; + // Default render target for effect pipeline + CTextureUser *_EffectRenderTarget; + UMaterial _MatRenderTarget; + CMaterial _MatRenderTargetInt; + NLMISC::CQuadUV _RenderTargetQuad; // StaticInit static bool _StaticInit; @@ -241,6 +247,16 @@ public: // @} + /// Get the render target manager + virtual CRenderTargetManager &getRenderTargetManager() { return _RenderTargetManager; } + + /// Set a texture the size of the window as render target + virtual void beginDefaultRenderTarget(uint32 width = 0, uint32 height = 0); + + /// Draw the render target to the back buffer + virtual void endDefaultRenderTarget(UScene *scene); + + /// \name Components gestion for Interface 2D/3D. // @{ @@ -396,6 +412,7 @@ public: virtual uint32 getImplementationVersion () const; virtual const char* getDriverInformation (); virtual const char* getVideocardInformation (); + virtual sint getTotalVideoMemory () const; virtual uint getNbTextureStages(); virtual void getWindowSize (uint32 &width, uint32 &height); virtual uint getWindowWidth (); @@ -410,21 +427,6 @@ public: 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(); - - /** - * wrapper for IEventEmitter::emulateMouseRawMode() - */ - virtual void emulateMouseRawMode(bool enable); - - 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 @@ -473,6 +475,8 @@ public: virtual TPolygonMode getPolygonMode (); virtual void forceDXTCCompression(bool dxtcComp); virtual void setAnisotropicFilter(sint filter); + virtual uint getAnisotropicFilter() const; + virtual uint getAnisotropicFilterMaximum() const; virtual void forceTextureResize(uint divisor); virtual bool setMonitorColorProperties (const CMonitorColorProperties &properties); // @} diff --git a/code/nel/include/nel/3d/dru.h b/code/nel/include/nel/3d/dru.h index fda543ecd..c23d41382 100644 --- a/code/nel/include/nel/3d/dru.h +++ b/code/nel/include/nel/3d/dru.h @@ -134,14 +134,14 @@ class CDRU public: /// Portable Function which create a GL Driver (using gl dll...). - static IDriver *createGlDriver() throw(EDru); + static IDriver *createGlDriver(); /// Portable Function which create a GL ES Driver (using gl dll...). - static IDriver *createGlEsDriver() throw(EDru); + static IDriver *createGlEsDriver(); #ifdef NL_OS_WINDOWS /// Windows Function which create a Direct3d Driver. - static IDriver *createD3DDriver() throw(EDru); + static IDriver *createD3DDriver(); #endif // NL_OS_WINDOWS /// \name 2D render. diff --git a/code/nel/include/nel/3d/fasthls_modifier.h b/code/nel/include/nel/3d/fasthls_modifier.h index b5ec7ad82..de8f22a3d 100644 --- a/code/nel/include/nel/3d/fasthls_modifier.h +++ b/code/nel/include/nel/3d/fasthls_modifier.h @@ -48,7 +48,7 @@ public: static void releaseInstance(); /// convert a HLS (0..255) to a RGBA. - CRGBA convert(uint H, uint L, uint S); + NLMISC::CRGBA convert(uint H, uint L, uint S); /// convert a RGBA bitmap into another RGBA, with HLS decal (0..255, -255..+255, -255..+255). void convertRGBABitmap(NLMISC::CBitmap &dst, const NLMISC::CBitmap &src, uint8 dh, sint dl, sint ds); @@ -75,7 +75,7 @@ private: uint8 H,L,S,A; }; - CRGBA _HueTable[HueTableSize]; + NLMISC::CRGBA _HueTable[HueTableSize]; CHLSA _Color16ToHLS[65536]; /// Constructor diff --git a/code/nel/include/nel/3d/flare_shape.h b/code/nel/include/nel/3d/flare_shape.h index 044c53c11..b0c35257b 100644 --- a/code/nel/include/nel/3d/flare_shape.h +++ b/code/nel/include/nel/3d/flare_shape.h @@ -55,7 +55,7 @@ public: CFlareShape(); /// serial this shape - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); //@} diff --git a/code/nel/include/nel/3d/font_generator.h b/code/nel/include/nel/3d/font_generator.h index 36dbf309a..b69249d58 100644 --- a/code/nel/include/nel/3d/font_generator.h +++ b/code/nel/include/nel/3d/font_generator.h @@ -21,8 +21,12 @@ #undef NL_DONT_USE_EXTERNAL_CODE #ifndef NL_DONT_USE_EXTERNAL_CODE -#include -#include FT_FREETYPE_H + +// forward declarations to avoid including freetype.h in headers +typedef int FT_Error; +typedef struct FT_LibraryRec_ *FT_Library; +typedef struct FT_FaceRec_* FT_Face; + #else // NL_DONT_USE_EXTERNAL_CODE #endif // NL_DONT_USE_EXTERNAL_CODE @@ -54,11 +58,13 @@ public: /** generate and return a bitmap * \param c the unicode char * \param size size of the generated font in ??? format + * \param embolden set embolden style (bold) + * \param oblique set oblique style (slanted, italic) * \param width width of the generated bitmap, this value is set by this function * \param height height of the generated bitmap, this value is set by this function * \param pitch pitch of the generated bitmap (+ or - the number of bytes per row), this value is set by this function */ - uint8 *getBitmap (ucchar c, uint32 size, uint32 &width, uint32 &height, uint32 &pitch, sint32 &left, sint32 &top, sint32 &advx, uint32 &glyphIndex); + uint8 *getBitmap (ucchar c, uint32 size, bool embolden, bool oblique, uint32 &width, uint32 &height, uint32 &pitch, sint32 &left, sint32 &top, sint32 &advx, uint32 &glyphIndex); /** returns the width and height of a character using a specific size and * @@ -72,6 +78,8 @@ public: uint32 getUID() { return _UID; } + std::string getFontFileName() const; + private: static uint32 _FontGeneratorCounterUID; diff --git a/code/nel/include/nel/3d/font_manager.h b/code/nel/include/nel/3d/font_manager.h index 41bb935e5..663e9d23a 100644 --- a/code/nel/include/nel/3d/font_manager.h +++ b/code/nel/include/nel/3d/font_manager.h @@ -59,6 +59,9 @@ class CFontManager CSmartPtr _MatFont; CSmartPtr _TexFont; + // Keep track number of textures created to properly report cache version + uint32 _TexCacheNr; + public: /** @@ -71,6 +74,7 @@ public: _NbChar = 0; _MatFont = NULL; _TexFont = NULL; + _TexCacheNr = 0; } @@ -94,7 +98,6 @@ public: */ CMaterial* getFontMaterial(); - /** * Compute primitive blocks and materials of each character of * the string. @@ -102,6 +105,8 @@ public: * \param fontGen font generator * \param color primitive blocks color * \param fontSize font size + * \param embolden font style bold + * \param oblique font style slanted (italic) * \param desc display descriptor (screen size, font ratio) * \param output computed string * \param keep800x600Ratio true if you want that CFontManager look at Driver window size, and resize fontSize so it keeps same size... @@ -110,6 +115,8 @@ public: CFontGenerator *fontGen, const NLMISC::CRGBA &color, uint32 fontSize, + bool embolden, + bool oblique, IDriver *driver, CComputedString& output, bool keep800x600Ratio= true); @@ -121,6 +128,8 @@ public: CFontGenerator *fontGen, const NLMISC::CRGBA &color, uint32 fontSize, + bool embolden, + bool oblique, IDriver *driver, CComputedString &output, bool keep800x600Ratio= true); @@ -132,6 +141,8 @@ public: CFontGenerator *fontGen, const NLMISC::CRGBA &color, uint32 fontSize, + bool embolden, + bool oblique, IDriver *driver, CComputedString &output, bool keep800x600Ratio= true); @@ -144,7 +155,8 @@ public: void dumpCache (const char *filename) { - _TexFont->dumpTextureFont (filename); + if (_TexFont) + _TexFont->dumpTextureFont (filename); } /** @@ -152,6 +164,15 @@ public: */ void invalidate(); + // get font atlas rebuild count + uint32 getCacheVersion() const + { + if (_TexFont) + return (_TexFont->getCacheVersion() << 16) + _TexCacheNr; + + return 0; + } + }; diff --git a/code/nel/include/nel/3d/fxaa.h b/code/nel/include/nel/3d/fxaa.h new file mode 100644 index 000000000..f7ccf4866 --- /dev/null +++ b/code/nel/include/nel/3d/fxaa.h @@ -0,0 +1,84 @@ +/** + * \file fxaa.h + * \brief CFXAA + * \date 2014-08-03 21:41GMT + * \author Jan Boon (Kaetemi) + * CFXAA + */ + +/* + * Copyright (C) 2014 by authors + * + * This file is part of NL3D. + * NL3D 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. + * + * NL3D 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 NL3D. If not, see + * . + */ + +#ifndef NL3D_FXAA_H +#define NL3D_FXAA_H +#include + +// STL includes + +// NeL includes +#include +#include + +// Project includes +#include +#include + +#define NL_STEREO_MAX_USER_CAMERAS 8 + +namespace NL3D { + +class ITexture; +class CTextureUser; +class CPixelProgram; +class CVertexProgram; + +/** + * \brief CFXAA + * \date 2014-08-03 21:41GMT + * \author Jan Boon (Kaetemi) + * CFXAA + */ +class CFXAA +{ +public: + CFXAA(NL3D::UDriver *driver); + virtual ~CFXAA(); + + /// Apply effect to current render target. Render target must be managed by render target manager + virtual void applyEffect(); + +private: + UDriver *m_Driver; + + NL3D::UMaterial m_Mat; + // NL3D::CVertexBuffer m_VB; + NLMISC::CQuadUV m_QuadUV; + CVertexProgram *m_VP; + CPixelProgram *m_PP; + + uint m_Width; + uint m_Height; + +}; /* class CFXAA */ + +} /* namespace NL3D */ + +#endif /* #ifndef NL3D_FXAA_H */ + +/* end of file */ diff --git a/code/nel/include/nel/3d/gpu_program_params.h b/code/nel/include/nel/3d/gpu_program_params.h index ce6b8b2f0..4615c58d9 100644 --- a/code/nel/include/nel/3d/gpu_program_params.h +++ b/code/nel/include/nel/3d/gpu_program_params.h @@ -27,7 +27,8 @@ #ifndef NL3D_GPU_PROGRAM_PARAMS_H #define NL3D_GPU_PROGRAM_PARAMS_H -#include + +#include "nel/misc/types_nl.h" // STL includes #include @@ -167,7 +168,7 @@ private: std::map m_MapName; // map from name to offset size_t m_First; size_t m_Last; - static const size_t s_End = -1; + static const size_t s_End; }; /* class CGPUProgramParams */ diff --git a/code/nel/include/nel/3d/ig_surface_light_build.h b/code/nel/include/nel/3d/ig_surface_light_build.h index e6b37b25c..77046dabb 100644 --- a/code/nel/include/nel/3d/ig_surface_light_build.h +++ b/code/nel/include/nel/3d/ig_surface_light_build.h @@ -26,6 +26,7 @@ namespace NL3D { + class CInstanceGroup; // *************************************************************************** /** @@ -106,14 +107,14 @@ public: public: /// Debug: build a colored Grid mesh of SunContribution. - void buildSunDebugMesh(CMesh::CMeshBuild &meshBuild, CMeshBase::CMeshBaseBuild &meshBaseBuild, const CVector &deltaPos=CVector::Null); + void buildSunDebugMesh(CMesh::CMeshBuild &meshBuild, CMeshBase::CMeshBaseBuild &meshBaseBuild, const NLMISC::CVector &deltaPos= NLMISC::CVector::Null); /// Debug: build a colored Grid mesh of PointLight. R= pointLight1 id. G= PointLight2 id. B= The multiplier used to show Ids. - void buildPLDebugMesh(CMesh::CMeshBuild &meshBuild, CMeshBase::CMeshBaseBuild &meshBaseBuild, const CVector &deltaPos, const CInstanceGroup &igOut); + void buildPLDebugMesh(CMesh::CMeshBuild &meshBuild, CMeshBase::CMeshBaseBuild &meshBaseBuild, const NLMISC::CVector &deltaPos, const CInstanceGroup &igOut); private: void addDebugMeshFaces(CMesh::CMeshBuild &meshBuild, CSurface &surface, uint vId0, - const std::vector &colors); + const std::vector &colors); }; diff --git a/code/nel/include/nel/3d/index_buffer.h b/code/nel/include/nel/3d/index_buffer.h index d5872f5e9..3d9c289ee 100644 --- a/code/nel/include/nel/3d/index_buffer.h +++ b/code/nel/include/nel/3d/index_buffer.h @@ -429,7 +429,7 @@ private: void resetTouchFlags() {_InternalFlags &= (uint16)(~TouchedAll);} // Force non resident memory - void restaureNonResidentMemory(); + void restoreNonResidentMemory(); // Convert current index to a serializable vector void buildSerialVector(std::vector &dest) const; diff --git a/code/nel/include/nel/3d/key.h b/code/nel/include/nel/3d/key.h index d30bfcd6e..6982dc98b 100644 --- a/code/nel/include/nel/3d/key.h +++ b/code/nel/include/nel/3d/key.h @@ -47,7 +47,7 @@ public: public: /// Serial - void serial (NLMISC::IStream& f) throw (NLMISC::EStream) + void serial (NLMISC::IStream& f) { // Version number (void)f.serialVersion (0); @@ -83,7 +83,7 @@ class CKeyTCB : public CKey public: /// Serial - void serial (NLMISC::IStream& f) throw (NLMISC::EStream) + void serial (NLMISC::IStream& f) { // Version number (void)f.serialVersion (0); @@ -130,7 +130,7 @@ class CKeyBezier : public CKey public: /// Serial - void serial (NLMISC::IStream& f) throw (NLMISC::EStream) + void serial (NLMISC::IStream& f) { // Version number (void)f.serialVersion (0); @@ -180,7 +180,7 @@ template<> class CKeyTCB : public CKey public: /// Serial - void serial (NLMISC::IStream& f) throw (NLMISC::EStream) + void serial (NLMISC::IStream& f) { // Version number (void)f.serialVersion (0); @@ -228,7 +228,7 @@ template<> class CKeyBezier : public CKey public: /// Serial - void serial (NLMISC::IStream& f) throw (NLMISC::EStream) + void serial (NLMISC::IStream& f) { // Version number (void)f.serialVersion (0); diff --git a/code/nel/include/nel/3d/landscape.h b/code/nel/include/nel/3d/landscape.h index 66dec0f64..a7383963d 100644 --- a/code/nel/include/nel/3d/landscape.h +++ b/code/nel/include/nel/3d/landscape.h @@ -168,9 +168,9 @@ public: void clear(); /// Verify the binding of patchs of all zones. throw EBadBind if error. - void checkBinds() throw(EBadBind); + void checkBinds(); /// Verify the binding of patchs of one zone. throw EBadBind if error. nop if zone not loaded. - void checkBinds(uint16 zoneId) throw(EBadBind); + void checkBinds(uint16 zoneId); /** * Build tileBank. Call this after loading the near and far tile banks. @@ -716,7 +716,7 @@ private: bool _RefineMode; float _FarTransition; uint _TileMaxSubdivision; - // For VertexProgram. true if change has occured in threshold since the last render(). + // For VertexProgram. true if change has occurred in threshold since the last render(). float _VPThresholdChange; /// \name VertexBuffer mgt. diff --git a/code/nel/include/nel/3d/material.h b/code/nel/include/nel/3d/material.h index 671f3339a..7a300da45 100644 --- a/code/nel/include/nel/3d/material.h +++ b/code/nel/include/nel/3d/material.h @@ -692,7 +692,7 @@ private: { NLMISC::CMatrix TexMat[IDRV_MAT_MAXTEXTURES]; }; - std::auto_ptr _TexUserMat; // user texture matrix + CUniquePtr _TexUserMat; // user texture matrix public: // Private. For Driver only. diff --git a/code/nel/include/nel/3d/matrix_3x4.h b/code/nel/include/nel/3d/matrix_3x4.h index 45901c20e..7b8d6dcf6 100644 --- a/code/nel/include/nel/3d/matrix_3x4.h +++ b/code/nel/include/nel/3d/matrix_3x4.h @@ -47,7 +47,7 @@ public: float a31, a32, a33, a34; // Copy from a matrix. - void set(const CMatrix &mat) + void set(const NLMISC::CMatrix &mat) { const float *m =mat.get(); a11= m[0]; a12= m[4]; a13= m[8] ; a14= m[12]; @@ -57,14 +57,14 @@ public: // mulSetvector. NB: in should be different as v!! (else don't work). - void mulSetVector(const CVector &in, CVector &out) + void mulSetVector(const NLMISC::CVector &in, NLMISC::CVector &out) { out.x= (a11*in.x + a12*in.y + a13*in.z); out.y= (a21*in.x + a22*in.y + a23*in.z); out.z= (a31*in.x + a32*in.y + a33*in.z); } // mulSetpoint. NB: in should be different as v!! (else don't work). - void mulSetPoint(const CVector &in, CVector &out) + void mulSetPoint(const NLMISC::CVector &in, NLMISC::CVector &out) { out.x= (a11*in.x + a12*in.y + a13*in.z + a14); out.y= (a21*in.x + a22*in.y + a23*in.z + a24); @@ -73,14 +73,14 @@ public: // mulSetvector. NB: in should be different as v!! (else don't work). - void mulSetVector(const CVector &in, float scale, CVector &out) + void mulSetVector(const NLMISC::CVector &in, float scale, NLMISC::CVector &out) { out.x= (a11*in.x + a12*in.y + a13*in.z) * scale; out.y= (a21*in.x + a22*in.y + a23*in.z) * scale; out.z= (a31*in.x + a32*in.y + a33*in.z) * scale; } // mulSetpoint. NB: in should be different as v!! (else don't work). - void mulSetPoint(const CVector &in, float scale, CVector &out) + void mulSetPoint(const NLMISC::CVector &in, float scale, NLMISC::CVector &out) { out.x= (a11*in.x + a12*in.y + a13*in.z + a14) * scale; out.y= (a21*in.x + a22*in.y + a23*in.z + a24) * scale; @@ -89,14 +89,14 @@ public: // mulAddvector. NB: in should be different as v!! (else don't work). - void mulAddVector(const CVector &in, float scale, CVector &out) + void mulAddVector(const NLMISC::CVector &in, float scale, NLMISC::CVector &out) { out.x+= (a11*in.x + a12*in.y + a13*in.z) * scale; out.y+= (a21*in.x + a22*in.y + a23*in.z) * scale; out.z+= (a31*in.x + a32*in.y + a33*in.z) * scale; } // mulAddpoint. NB: in should be different as v!! (else don't work). - void mulAddPoint(const CVector &in, float scale, CVector &out) + void mulAddPoint(const NLMISC::CVector &in, float scale, NLMISC::CVector &out) { out.x+= (a11*in.x + a12*in.y + a13*in.z + a14) * scale; out.y+= (a21*in.x + a22*in.y + a23*in.z + a24) * scale; diff --git a/code/nel/include/nel/3d/mesh.h b/code/nel/include/nel/3d/mesh.h index 780a455aa..25872a063 100644 --- a/code/nel/include/nel/3d/mesh.h +++ b/code/nel/include/nel/3d/mesh.h @@ -85,7 +85,7 @@ public: // This is slow but doesn't matter since used at mesh building.... CCorner(); - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); }; /// A Triangle face. @@ -94,7 +94,7 @@ public: CCorner Corner[3]; sint32 MaterialId; sint32 SmoothGroup; - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); }; @@ -118,7 +118,7 @@ public: } } - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); }; struct CVertLink @@ -203,7 +203,7 @@ public: CMeshBuild(); // Serialization - //void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + //void serial(NLMISC::IStream &f); }; //@} @@ -257,7 +257,7 @@ public: virtual void render(IDriver *drv, CTransformShape *trans, bool opaquePass); /// serial this mesh. - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CMesh); /// get trinagle count. @@ -370,7 +370,7 @@ public: virtual float getNumTriangles (float distance); /// serial this mesh. - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CMeshGeom); // profile diff --git a/code/nel/include/nel/3d/mesh_base.h b/code/nel/include/nel/3d/mesh_base.h index 816d8b7a4..9fb4f9029 100644 --- a/code/nel/include/nel/3d/mesh_base.h +++ b/code/nel/include/nel/3d/mesh_base.h @@ -146,7 +146,7 @@ public: CMeshBaseBuild(); // Serialization is not used - //void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + //void serial(NLMISC::IStream &f); }; //@} @@ -201,7 +201,7 @@ public: // @} /// serial the base Part of this mesh. - void serialMeshBase(NLMISC::IStream &f) throw(NLMISC::EStream); + void serialMeshBase(NLMISC::IStream &f); /// Flush textures void flushTextures (IDriver &driver, uint selectedTexture); diff --git a/code/nel/include/nel/3d/mesh_morpher.h b/code/nel/include/nel/3d/mesh_morpher.h index b9d8879e2..909d60586 100644 --- a/code/nel/include/nel/3d/mesh_morpher.h +++ b/code/nel/include/nel/3d/mesh_morpher.h @@ -43,7 +43,7 @@ public: std::vector VertRefs; // Array of vertices reference - void serial (NLMISC::IStream &f) throw(NLMISC::EStream); + void serial (NLMISC::IStream &f); }; // *************************************************************************** @@ -90,7 +90,7 @@ public: NLMISC::CObjectVector &vertexRemap, std::vector *pBSFactor); - void serial (NLMISC::IStream &f) throw(NLMISC::EStream); + void serial (NLMISC::IStream &f); private: diff --git a/code/nel/include/nel/3d/mesh_mrm.h b/code/nel/include/nel/3d/mesh_mrm.h index d0ce7d952..619908499 100644 --- a/code/nel/include/nel/3d/mesh_mrm.h +++ b/code/nel/include/nel/3d/mesh_mrm.h @@ -115,7 +115,7 @@ public: virtual float getNumTriangles (float distance); /// serial this meshGeom. - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CMeshMRMGeom); /// Scene profile @@ -579,11 +579,11 @@ private: /// load the header of this mesh. return the version of the header. - sint loadHeader(NLMISC::IStream &f) throw(NLMISC::EStream); + sint loadHeader(NLMISC::IStream &f); /// load this mesh. - void load(NLMISC::IStream &f) throw(NLMISC::EStream); + void load(NLMISC::IStream &f); /// save the entire mesh. - void save(NLMISC::IStream &f) throw(NLMISC::EStream); + void save(NLMISC::IStream &f); // Build bone Usage information for serialized mesh <= version 2. void buildBoneUsageVer2 (); @@ -702,7 +702,7 @@ public: virtual float getNumTriangles (float distance); /// serial this mesh. - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CMeshMRM); /// Get bbox. diff --git a/code/nel/include/nel/3d/mesh_multi_lod.h b/code/nel/include/nel/3d/mesh_multi_lod.h index 445941ed6..a79d5a63e 100644 --- a/code/nel/include/nel/3d/mesh_multi_lod.h +++ b/code/nel/include/nel/3d/mesh_multi_lod.h @@ -125,7 +125,7 @@ public: virtual void getAABBox(NLMISC::CAABBox &bbox) const; /// serial this mesh. - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); /// Declare name of the shape NLMISC_DECLARE_CLASS(CMeshMultiLod); @@ -238,7 +238,7 @@ private: std::vector CoarseTriangles; /// Serial - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); /// Is Opaque ? bool isOpaque() { return (Flags&IsOpaque)!=0; } diff --git a/code/nel/include/nel/3d/meshvp_per_pixel_light.h b/code/nel/include/nel/3d/meshvp_per_pixel_light.h index a234feddd..4533464a9 100644 --- a/code/nel/include/nel/3d/meshvp_per_pixel_light.h +++ b/code/nel/include/nel/3d/meshvp_per_pixel_light.h @@ -65,7 +65,7 @@ public: const NLMISC::CMatrix &invertedModelMat, const NLMISC::CVector &viewerPos); virtual void end(IDriver *drv); - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); virtual void setupForMaterial(const CMaterial &mat, IDriver *drv, CScene *scene, diff --git a/code/nel/include/nel/3d/meshvp_wind_tree.h b/code/nel/include/nel/3d/meshvp_wind_tree.h index e2c790d6d..790a2f774 100644 --- a/code/nel/include/nel/3d/meshvp_wind_tree.h +++ b/code/nel/include/nel/3d/meshvp_wind_tree.h @@ -90,7 +90,7 @@ public: virtual float getMaxVertexMove(); // Serial. - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CMeshVPWindTree); // @} @@ -124,7 +124,7 @@ private: double _LastSceneTime; // maximum amplitude vector for each level. Stored in mesh because same for all instances. - CVector _MaxDeltaPos[HrcDepth]; + NLMISC::CVector _MaxDeltaPos[HrcDepth]; float _MaxVertexMove; // MBR Cache diff --git a/code/nel/include/nel/3d/nelu.h b/code/nel/include/nel/3d/nelu.h index fb30a5012..b64e83672 100644 --- a/code/nel/include/nel/3d/nelu.h +++ b/code/nel/include/nel/3d/nelu.h @@ -64,7 +64,7 @@ public: * * You can access the driver with CNELU::Driver. */ - static bool initDriver(uint w, uint h, uint bpp=32, bool windowed=true, nlWindow systemWindow=EmptyWindow, bool offscreen=false, bool direct3d=false) throw(EDru); + static bool initDriver(uint w, uint h, uint bpp=32, bool windowed=true, nlWindow systemWindow=EmptyWindow, bool offscreen=false, bool direct3d=false); /** Init all that we need for a Scene. * - register scene basics models, @@ -108,7 +108,7 @@ public: * - initScene(); * - initEventServer(); */ - static bool init(uint w, uint h, CViewport viewport=CViewport(), uint bpp=32, bool windowed=true, nlWindow systemWindow=EmptyWindow, bool offscreen = false, bool direct3d = false) throw(EDru); + static bool init(uint w, uint h, CViewport viewport=CViewport(), uint bpp=32, bool windowed=true, nlWindow systemWindow=EmptyWindow, bool offscreen = false, bool direct3d = false); /** Delete all: * - releaseEventServer(); diff --git a/code/nel/include/nel/3d/packed_world.h b/code/nel/include/nel/3d/packed_world.h index d76c180ba..a091c61fb 100644 --- a/code/nel/include/nel/3d/packed_world.h +++ b/code/nel/include/nel/3d/packed_world.h @@ -54,9 +54,9 @@ public: void build(std::vector &packesZones); bool raytrace(const NLMISC::CVector &start, const NLMISC::CVector &end, NLMISC::CVector &inter, std::vector *testedTriangles = NULL, NLMISC::CVector *normal = NULL); void getZones(std::vector &zones); - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); // just serialize the header, containing name of the zones this CPackedWorld was built from - void serialZoneNames(NLMISC::IStream &f) throw(NLMISC::EStream); + void serialZoneNames(NLMISC::IStream &f); /** Roughly select triangles that are within a convex 2D polygon (world coordinates) * Selection is not exact, because limited to the resolution of the grid into which is packed each zone. * Triangle that are within are guaranteed to be selected, however. @@ -68,7 +68,7 @@ private: public: TPackedZoneBaseSPtr Zone; uint32 RaytraceCounter; - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { f.serialVersion(1); CPackedZoneBase *pz = Zone; @@ -81,7 +81,7 @@ private: { public: std::vector IDs; // make a class from this vector just for serialization - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { f.serialCont(IDs); } diff --git a/code/nel/include/nel/3d/packed_zone.h b/code/nel/include/nel/3d/packed_zone.h index 2beb5f5ed..52f76097a 100644 --- a/code/nel/include/nel/3d/packed_zone.h +++ b/code/nel/include/nel/3d/packed_zone.h @@ -52,7 +52,7 @@ class CPackedVertex public: uint16 X, Y, Z; public: - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { f.serial(X, Y, Z); } @@ -68,7 +68,7 @@ class CPackedTri public: uint32 V0, V1, V2; public: - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { f.serial(V0, V1, V2); } @@ -79,7 +79,7 @@ class CPackedTri16 public: uint16 V0, V1, V2; public: - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { f.serial(V0, V1, V2); } @@ -101,7 +101,7 @@ public: sint32 ZoneY; public: virtual ~CPackedZoneBase() {} - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) = 0; + virtual void serial(NLMISC::IStream &f) = 0; // TMP For debug : render position covered by a frustum virtual void render(CVertexBuffer &vb, IDriver &drv, CMaterial &mat, CMaterial &wiredMaterial, const NLMISC::CMatrix &camMat, uint batchSize, const NLMISC::CVector localFrustCorners[8]) = 0; // raytracing test @@ -138,7 +138,7 @@ public: sint32 zoneX, sint32 zoneY ); - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); // TMP For debug : render porition covered by a frustum void render(CVertexBuffer &vb, IDriver &drv, CMaterial &mat, CMaterial &wiredMaterial, const NLMISC::CMatrix &camMat, uint batchSize, const NLMISC::CVector localFrustCorners[8]); // try to build a 16 bit version of this packed zone to save some more place @@ -183,7 +183,7 @@ public: NLMISC_DECLARE_CLASS(CPackedZone16) CPackedZone16(); // - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); // TMP For debug : render position covered by a frustum void render(CVertexBuffer &vb, IDriver &drv, CMaterial &mat, CMaterial &wiredMaterial, const NLMISC::CMatrix &camMat, uint batchSize, const NLMISC::CVector localFrustCorners[8]); // raytracing test diff --git a/code/nel/include/nel/3d/particle_system.h b/code/nel/include/nel/3d/particle_system.h index 68f67ae6d..bd50514fc 100644 --- a/code/nel/include/nel/3d/particle_system.h +++ b/code/nel/include/nel/3d/particle_system.h @@ -84,7 +84,7 @@ public: /// dtor virtual ~CParticleSystem(); /// serialize this particle system - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); /** Merge this system with a system instanciated from the given shape * NB : This is for edition purpose, this is slow * \return true if the operation could be performed. It can fail when this cause the system the system to last forever, @@ -841,7 +841,7 @@ public: /// return true when there are still emitters in the system - bool hasEmitters(void) const; + bool hasEmitters() const; /// return true when there are still particles bool hasParticles() const; @@ -992,8 +992,8 @@ public: * NB : the system should be restarted for this to work correctly * The default is true */ - void enableEmitThreshold(bool enabled = true) { _EmitThreshold = enabled; } - bool isEmitThresholdEnabled() const { return _EmitThreshold; } + void enableEmitThreshold(bool enabled = true) { _EmitThreshold = enabled; } + bool isEmitThresholdEnabled() const { return _EmitThreshold; } // activate // deactivate all emitters in the system void activateEmitters(bool active); diff --git a/code/nel/include/nel/3d/particle_system_manager.h b/code/nel/include/nel/3d/particle_system_manager.h index f48b17f1b..1e02963bb 100644 --- a/code/nel/include/nel/3d/particle_system_manager.h +++ b/code/nel/include/nel/3d/particle_system_manager.h @@ -87,7 +87,7 @@ private: { public: CParticleSystemModel *Model; - CMatrix OldAncestorMatOrRelPos; // last matrix of ancestor skeleton or relative matrix of ps to its ancestor (see flag below) + NLMISC::CMatrix OldAncestorMatOrRelPos; // last matrix of ancestor skeleton or relative matrix of ps to its ancestor (see flag below) bool IsRelMatrix; // gives usage of the field OldAncestorMatOrRelPos bool HasAncestorSkeleton; // has the system an ancestor skeleton ? public: diff --git a/code/nel/include/nel/3d/particle_system_process.h b/code/nel/include/nel/3d/particle_system_process.h index 1ff031a5a..0e52228ee 100644 --- a/code/nel/include/nel/3d/particle_system_process.h +++ b/code/nel/include/nel/3d/particle_system_process.h @@ -102,7 +102,7 @@ class CParticleSystemProcess : public NLMISC::IStreamable * Everything is saved, except for the fontManager and the fontGenerator. * They must be set again if the PSToolRender pass is used. */ - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) ; + virtual void serial(NLMISC::IStream &f); /// @} @@ -163,10 +163,10 @@ class CParticleSystemProcess : public NLMISC::IStreamable virtual void setMatrixMode(TPSMatrixMode matrixMode); /// tells whether there are alive entities / particles in the system - virtual bool hasParticles(void) const { return false ; } + virtual bool hasParticles() const { return false ; } /// tells whether there are alive emitters / particles in the system - virtual bool hasEmitters(void) const { return false ; } + virtual bool hasEmitters() const { return false ; } /// max number of faces wanted by this process (for load balancing) diff --git a/code/nel/include/nel/3d/particle_system_shape.h b/code/nel/include/nel/3d/particle_system_shape.h index a1c397975..c8fbc8a17 100644 --- a/code/nel/include/nel/3d/particle_system_shape.h +++ b/code/nel/include/nel/3d/particle_system_shape.h @@ -90,7 +90,7 @@ public: // @} /// serial the shape - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CParticleSystemShape); diff --git a/code/nel/include/nel/3d/portal.h b/code/nel/include/nel/3d/portal.h index 0531f9eb5..51fd99913 100644 --- a/code/nel/include/nel/3d/portal.h +++ b/code/nel/include/nel/3d/portal.h @@ -92,9 +92,9 @@ public: void setWorldMatrix (const NLMISC::CMatrix &WM); - void setName (std::string &name) { _Name = name; } + void setName (const std::string &name) { _Name = name; } - std::string getName () { return _Name; } + std::string getName () const { return _Name; } void open (bool opened) { _Opened = opened; } bool isOpened () { return _Opened; } diff --git a/code/nel/include/nel/3d/ps_attrib.h b/code/nel/include/nel/3d/ps_attrib.h index cd691e719..8a0dcdda6 100644 --- a/code/nel/include/nel/3d/ps_attrib.h +++ b/code/nel/include/nel/3d/ps_attrib.h @@ -202,7 +202,7 @@ public: uint size() const { return _Size; } /// serialization - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { if (f.isReading()) { @@ -262,7 +262,7 @@ public: CPSAttrib(); /// Serialization method - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); // swap with another vector void swap(CPSAttrib &other); @@ -429,7 +429,7 @@ void CPSAttrib::remove(uint32 index) } template -void CPSAttrib::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSAttrib::serial(NLMISC::IStream &f) { // version 4 to 5 => bug with size being > capacity sint ver = f.serialVersion(5); diff --git a/code/nel/include/nel/3d/ps_attrib_maker.h b/code/nel/include/nel/3d/ps_attrib_maker.h index 56b393c2e..fb96cb86e 100644 --- a/code/nel/include/nel/3d/ps_attrib_maker.h +++ b/code/nel/include/nel/3d/ps_attrib_maker.h @@ -60,7 +60,7 @@ struct CPSInputType uint32 UserParamNum; }; - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { f.serialEnum(InputType); switch(InputType) @@ -124,7 +124,7 @@ public: } /// serialisation of the object. Derivers MUST call this, (if they use the attribute of this class at least) - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + virtual void serial(NLMISC::IStream &f) { f.serialVersion(1); f.serial(_NbCycles); diff --git a/code/nel/include/nel/3d/ps_attrib_maker_bin_op.h b/code/nel/include/nel/3d/ps_attrib_maker_bin_op.h index f59d9c4e4..597b47457 100644 --- a/code/nel/include/nel/3d/ps_attrib_maker_bin_op.h +++ b/code/nel/include/nel/3d/ps_attrib_maker_bin_op.h @@ -103,7 +103,7 @@ public: uint32 srcStep = (1 << 16) ) const; - virtual void serial (NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial (NLMISC::IStream &f); virtual void deleteElement (uint32 index); virtual void newElement (const CPSEmitterInfo &info); virtual void resize (uint32 capacity, uint32 nbPresentElements); diff --git a/code/nel/include/nel/3d/ps_attrib_maker_bin_op_inline.h b/code/nel/include/nel/3d/ps_attrib_maker_bin_op_inline.h index 2a9cbff45..00d675e4e 100644 --- a/code/nel/include/nel/3d/ps_attrib_maker_bin_op_inline.h +++ b/code/nel/include/nel/3d/ps_attrib_maker_bin_op_inline.h @@ -282,7 +282,7 @@ inline float CPSAttribMakerBinOp::getMaxValue(void) const template inline CPSAttribMakerBinOp::CPSAttribMakerBinOp(const CPSAttribMakerBinOp &other) : CPSAttribMaker(other) // parent copy ctor { - std::auto_ptr > a0(NLMISC::safe_cast *>(other._Arg[0]->clone())) + CUniquePtr > a0(NLMISC::safe_cast *>(other._Arg[0]->clone())) , a1(NLMISC::safe_cast *>(other._Arg[1]->clone())); this->_Op = other._Op; this->_Size = other._Size; @@ -729,7 +729,7 @@ inline void CPSAttribMakerBinOp::makeN(CPSLocated *loc, //================================================================================================================= template -inline void CPSAttribMakerBinOp::serial (NLMISC::IStream &f) throw(NLMISC::EStream) +inline void CPSAttribMakerBinOp::serial (NLMISC::IStream &f) { if (f.isReading()) { diff --git a/code/nel/include/nel/3d/ps_attrib_maker_helper.h b/code/nel/include/nel/3d/ps_attrib_maker_helper.h index 10d29fe52..2a4f243b6 100644 --- a/code/nel/include/nel/3d/ps_attrib_maker_helper.h +++ b/code/nel/include/nel/3d/ps_attrib_maker_helper.h @@ -96,7 +96,7 @@ template class CPSAttribMakerT : public CPSAttribMaker /// serialization of the object - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + virtual void serial(NLMISC::IStream &f) { sint ver = f.serialVersion(2); CPSAttribMaker::serial(f); @@ -1463,7 +1463,7 @@ public: CPSAttribMakerMemoryBase(const CPSAttribMakerMemoryBase &src) : CPSAttribMaker(src) // parent copy ctor { nlassert(src._Scheme); - std::auto_ptr > s(NLMISC::safe_cast *>(src._Scheme->clone())); + CUniquePtr > s(NLMISC::safe_cast *>(src._Scheme->clone())); this->_T = src._T; this->_DefaultValue = src._DefaultValue; this->_Scheme = s.release(); @@ -1624,7 +1624,7 @@ public: } /// serialisation of the object. Derivers MUST call this, (if they use the attribute of this class at least) - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + virtual void serial(NLMISC::IStream &f) { f.serialVersion(1); @@ -1744,7 +1744,7 @@ public: _MaxValue = other._MaxValue; } // serial. Should update min / max when reading - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); virtual uint32 getMinValue(void) const { return _MinValue; } virtual uint32 getMaxValue(void) const { return _MaxValue; } virtual void newElement(const CPSEmitterInfo &info); @@ -1767,7 +1767,7 @@ public: _MaxValue = other._MaxValue; } // serial. Should update min / max when reading - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); virtual sint32 getMinValue(void) const { return _MinValue; } virtual sint32 getMaxValue(void) const { return _MaxValue; } virtual void newElement(const CPSEmitterInfo &info); @@ -1790,7 +1790,7 @@ public: _MaxValue = other._MaxValue; } // serial. Should update min / max when reading - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); virtual float getMinValue(void) const { return _MinValue; } virtual float getMaxValue(void) const { return _MaxValue; } virtual void newElement(const CPSEmitterInfo &info); diff --git a/code/nel/include/nel/3d/ps_attrib_maker_template.h b/code/nel/include/nel/3d/ps_attrib_maker_template.h index 92953b86f..86213880c 100644 --- a/code/nel/include/nel/3d/ps_attrib_maker_template.h +++ b/code/nel/include/nel/3d/ps_attrib_maker_template.h @@ -24,6 +24,8 @@ #include "nel/misc/rgba.h" #include "nel/misc/traits_nl.h" +#include + namespace NL3D { /* @@ -91,7 +93,7 @@ public: CPSValueBlendFunc() {} /// serialization - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { f.serialVersion(1); f.serial(_StartValue, _EndValue); @@ -226,7 +228,7 @@ public: CPSValueBlendSampleFunc() {} /// serialization - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { f.serialVersion(1); if (f.isReading()) @@ -351,7 +353,7 @@ public: } /// serialization - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); T getMaxValue(void) const @@ -480,14 +482,18 @@ void CPSValueGradientFunc::setValuesUnpacked(const T *valueTab, uint32 numVal _MaxValue = _MinValue = valueTab[0]; _NbValues = (numValues - 1) * nbStages; _Tab.resize(_NbValues + 1); +#ifdef NL_COMP_VC14 + std::copy(valueTab, valueTab + _NbValues + 1, stdext::make_checked_array_iterator(&_Tab[0], _Tab.size())); +#else std::copy(valueTab, valueTab + _NbValues + 1, &_Tab[0]); +#endif } template -void CPSValueGradientFunc::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSValueGradientFunc::serial(NLMISC::IStream &f) { f.serialVersion(1); f.serial(_NbStages); diff --git a/code/nel/include/nel/3d/ps_color.h b/code/nel/include/nel/3d/ps_color.h index d05d9cf11..1be8fb329 100644 --- a/code/nel/include/nel/3d/ps_color.h +++ b/code/nel/include/nel/3d/ps_color.h @@ -66,7 +66,7 @@ public: { CPSValueBlendFunc::setValues(convertVBColor(startValue, _ColorType), convertVBColor(endValue, _ColorType)); } - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { setColorType(CVertexBuffer::TRGBA); CPSValueBlendFunc::serial(f); @@ -100,7 +100,7 @@ public: { CPSValueBlendSampleFunc::setValues(convertVBColor(startValue, _ColorType), convertVBColor(endValue, _ColorType)); } - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { setColorType(CVertexBuffer::TRGBA); CPSValueBlendSampleFunc::serial(f); @@ -124,7 +124,7 @@ public: NLMISC::CRGBA getValue(uint index) const; void setValues(const NLMISC::CRGBA *valueTab, uint32 numValues, uint32 nbStages); void setValuesUnpacked(const NLMISC::CRGBA *valueTab, uint32 numValues, uint32 nbStages); - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { setColorType(CVertexBuffer::TRGBA); CPSValueGradientFunc::serial(f); @@ -153,7 +153,7 @@ public: this->_F.setColorType(colorType); } // serialisation should always be done in RGBA mode, so enforce that - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + virtual void serial(NLMISC::IStream &f) { setColorType(CVertexBuffer::TRGBA); CPSAttribMakerT::serial(f); @@ -229,7 +229,7 @@ public: virtual void setColorType(CVertexBuffer::TVertexColorType colorType); virtual void setDefaultValue(NLMISC::CRGBA defaultValue); virtual NLMISC::CRGBA getDefaultValue(void) const; - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); protected: CVertexBuffer::TVertexColorType _ColorType; }; @@ -244,7 +244,7 @@ public: NLMISC_DECLARE_CLASS(CPSColorBinOp); CPSAttribMakerBase *clone() const { return new CPSColorBinOp(*this); } virtual void setColorType(CVertexBuffer::TVertexColorType colorType); - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); }; diff --git a/code/nel/include/nel/3d/ps_dot.h b/code/nel/include/nel/3d/ps_dot.h index d5201ab3b..2bdb7603a 100644 --- a/code/nel/include/nel/3d/ps_dot.h +++ b/code/nel/include/nel/3d/ps_dot.h @@ -46,7 +46,7 @@ public: NLMISC_DECLARE_CLASS(CPSDot); ///serialisation - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); /// return true if there are transparent faces in the object virtual bool hasTransparentFaces(void); diff --git a/code/nel/include/nel/3d/ps_emitter.h b/code/nel/include/nel/3d/ps_emitter.h index 00163c48e..b8d82bb45 100644 --- a/code/nel/include/nel/3d/ps_emitter.h +++ b/code/nel/include/nel/3d/ps_emitter.h @@ -51,14 +51,14 @@ public: //@} /// Return this bindable type - uint32 getType(void) const { return PSEmitter; } + uint32 getType() const { return PSEmitter; } /// Return priority for emitters - virtual uint32 getPriority(void) const { return 500; } + virtual uint32 getPriority() const { return 500; } /// Return true if this located bindable derived class holds alive emitters - virtual bool hasEmitters(void) { nlassert(_Owner); return _Owner->getSize() != 0; } + virtual bool hasEmitters() const { nlassert(_Owner); return _Owner->getSize() != 0; } virtual void step(TPSProcessPass pass); @@ -76,7 +76,7 @@ public: /// Display the emitter in edition mode - virtual void showTool(void); + virtual void showTool(); /** Set the type of located to be emitted. The default is NULL which mean that no emission will occur * \return true if the operation could be performed. It can fail when this cause the system the system to last forever, @@ -90,9 +90,9 @@ public: virtual void notifyTargetRemoved(CPSLocated *ptr); /// Get emitted type. - CPSLocated *getEmittedType(void) { return _EmittedType; } + CPSLocated *getEmittedType() { return _EmittedType; } /// Get const ptr on emitted type - const CPSLocated *getEmittedType(void) const { return _EmittedType; } + const CPSLocated *getEmittedType() const { return _EmittedType; } /** The type of emission. @@ -171,7 +171,7 @@ public: const CPSAttribMaker *getGenNbScheme(void) const { return _GenNbScheme; } /// Serialization - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); ///\name Speed vector options //@{ @@ -336,7 +336,7 @@ protected: * should not be called directly. Call CPSLocated::resize instead */ virtual void resize(uint32 size); - virtual void bounceOccured(uint32 index, TAnimationTime timeToNextSimStep); + virtual void bounceOccurred(uint32 index, TAnimationTime timeToNextSimStep); void updateMaxCountVect(); @@ -424,7 +424,7 @@ class CPSModulatedEmitter bool useEmitteeSpeedScheme(void) const { return _EmitteeSpeedScheme != NULL; } /// serialization - void serialEmitteeSpeedScheme(NLMISC::IStream &f) throw(NLMISC::EStream); + void serialEmitteeSpeedScheme(NLMISC::IStream &f); protected: @@ -470,7 +470,7 @@ public: } /// Serialisation - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSEmitterDirectionnal); @@ -506,7 +506,7 @@ class CPSRadialEmitter : public CPSEmitterDirectionnal if (CParticleSystem::getSerializeIdentifierFlag()) _Name = std::string("RadialEmitter"); } /// Serialisation - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSRadialEmitter); virtual void emit(const NLMISC::CVector &srcPos, uint32 index, NLMISC::CVector &pos, NLMISC::CVector &speed); }; @@ -527,7 +527,7 @@ public: } /// Serialisation - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSEmitterOmni); @@ -561,7 +561,7 @@ class CPSEmitterRectangle : public CPSEmitter, public CPSModulatedEmitter, publi } /// Serialisation - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSEmitterRectangle); @@ -636,7 +636,7 @@ public: } /// Serialisation - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSEmitterConic); @@ -675,7 +675,7 @@ public: } /// Serialisation - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSSphericalEmitter); diff --git a/code/nel/include/nel/3d/ps_face.h b/code/nel/include/nel/3d/ps_face.h index b46299eb1..b62a9d50b 100644 --- a/code/nel/include/nel/3d/ps_face.h +++ b/code/nel/include/nel/3d/ps_face.h @@ -69,7 +69,7 @@ public: */ CPSFace(CSmartPtr tex = NULL); - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSFace); /** Tells that all faces are turning in the same manner, and only have a rotationnal bias diff --git a/code/nel/include/nel/3d/ps_face_look_at.h b/code/nel/include/nel/3d/ps_face_look_at.h index 3ae6a59e3..1d9b38a36 100644 --- a/code/nel/include/nel/3d/ps_face_look_at.h +++ b/code/nel/include/nel/3d/ps_face_look_at.h @@ -40,7 +40,7 @@ public: */ CPSFaceLookAt(CSmartPtr tex = NULL); - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSFaceLookAt); diff --git a/code/nel/include/nel/3d/ps_fan_light.h b/code/nel/include/nel/3d/ps_fan_light.h index 19f5baaa5..1de8beaa9 100644 --- a/code/nel/include/nel/3d/ps_fan_light.h +++ b/code/nel/include/nel/3d/ps_fan_light.h @@ -47,7 +47,7 @@ public: CPSFanLight(uint32 nbFans = 7); /// Dtor ~CPSFanLight(); - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); //@} // Set the number of fans used for drawing (minimum is 3, maximum is 128) diff --git a/code/nel/include/nel/3d/ps_float.h b/code/nel/include/nel/3d/ps_float.h index da8978af1..be5044d2d 100644 --- a/code/nel/include/nel/3d/ps_float.h +++ b/code/nel/include/nel/3d/ps_float.h @@ -104,7 +104,7 @@ class CPSFloatCurveFunctor CCtrlPoint(float date, float value) : Date(date), Value(value) { nlassert(Date >= 0 && Date <= 1); } float Date; float Value; - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { f.serial(Date, Value); } @@ -166,7 +166,7 @@ class CPSFloatCurveFunctor float getValue(float date) const; /// serialization - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); float getMinValue() const { return _MinValue; } float getMaxValue() const { return _MaxValue; } diff --git a/code/nel/include/nel/3d/ps_force.h b/code/nel/include/nel/3d/ps_force.h index e93c21361..14be72150 100644 --- a/code/nel/include/nel/3d/ps_force.h +++ b/code/nel/include/nel/3d/ps_force.h @@ -70,7 +70,7 @@ public: virtual void show() = 0; /// Serial the force definition. MUST be called by deriver during their serialisation - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); /// check whether this force is integrable over time. The default is false virtual bool isIntegrable(void) const { return false; } @@ -175,7 +175,7 @@ public: /// get the attribute maker for a non constant intensity CPSAttribMaker *getIntensityScheme(void) { return _IntensityScheme; } const CPSAttribMaker *getIntensityScheme(void) const { return _IntensityScheme; } - void serialForceIntensity(NLMISC::IStream &f) throw(NLMISC::EStream); + void serialForceIntensity(NLMISC::IStream &f); protected: @@ -209,7 +209,7 @@ protected: class CPSForceIntensityHelper : public CPSForce, public CPSForceIntensity { public: - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) ; + void serial(NLMISC::IStream &f); protected: virtual CPSLocated *getForceIntensityOwner(void) { return _Owner; } @@ -241,7 +241,7 @@ protected: * * // you can provide a serialization method. Note that that if the functor parameters are set before each use, * // it useless to serial something ... - * void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + * void serial(NLMISC::IStream &f) * * protected: * ... @@ -275,7 +275,7 @@ public: /// serialization - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + virtual void serial(NLMISC::IStream &f) { f.serialVersion(1); CPSForce::serial(f); @@ -354,7 +354,7 @@ class CPSDirectionnalForce : public CPSForceIntensityHelper, public CPSDirection } /// serialization - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSDirectionnalForce); @@ -397,7 +397,7 @@ public: } /// serialization - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSGravity); @@ -443,7 +443,7 @@ public: } /// serialization - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSCentralGravity); @@ -464,7 +464,7 @@ public: /// serialization - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); /// Compute the force on the targets @@ -498,7 +498,7 @@ public: speed -= (CParticleSystem::EllapsedTime * _K * invMass * speed); } - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + virtual void serial(NLMISC::IStream &f) { f.serialVersion(1); // we don't save intensity info : it is saved by the owning object (and set before each use of this functor) @@ -539,7 +539,7 @@ public: NLMISC_DECLARE_CLASS(CPSFluidFriction) - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + virtual void serial(NLMISC::IStream &f) { f.serialVersion(1); CIsotropicForceT::serial(f); @@ -571,7 +571,7 @@ public: NLMISC_DECLARE_CLASS(CPSBrownianForce) - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); /// We provide a kind of integration on a predefined sequence virtual bool isIntegrable(void) const; @@ -648,7 +648,7 @@ struct CPSTurbulForceFunc */ } - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + virtual void serial(NLMISC::IStream &f) { f.serialVersion(1); f.serial(_Scale, _NumOctaves); @@ -686,7 +686,7 @@ public: NLMISC_DECLARE_CLASS(CPSTurbul) - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + virtual void serial(NLMISC::IStream &f) { f.serialVersion(1); CIsotropicForceT::serial(f); @@ -758,7 +758,7 @@ public: // serialization - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); @@ -801,7 +801,7 @@ class CPSMagneticForce : public CPSDirectionnalForce } virtual void computeForces(CPSLocated &target); /// serialization - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSMagneticForce); }; diff --git a/code/nel/include/nel/3d/ps_light.h b/code/nel/include/nel/3d/ps_light.h index 31e159ae1..016dddaf9 100644 --- a/code/nel/include/nel/3d/ps_light.h +++ b/code/nel/include/nel/3d/ps_light.h @@ -42,7 +42,7 @@ public: ~CPSLight(); NLMISC_DECLARE_CLASS(CPSLight); /// Serialisation. Derivers must override this, and call their parent version - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); //@} virtual uint32 getType(void) const; virtual uint32 getPriority(void) const { return 600; } diff --git a/code/nel/include/nel/3d/ps_located.h b/code/nel/include/nel/3d/ps_located.h index 30fa7defa..e8bd62a20 100644 --- a/code/nel/include/nel/3d/ps_located.h +++ b/code/nel/include/nel/3d/ps_located.h @@ -66,14 +66,14 @@ class CParticleSystem; /// This structure helps to perform the collision step, by telling which collisionner is the nearest if there are several candidate -/// a distance of -1 indicates that no collisions occured +/// a distance of -1 indicates that no collisions occurred struct CPSCollisionInfo { CPSCollisionInfo *Next; - float Dist; // Distance to the nearest collider, or -1 if not collision occured + float Dist; // Distance to the nearest collider, or -1 if not collision occurred NLMISC::CVector NewPos; - NLMISC::CVector NewSpeed; // The speed of particle after a collision occured. After the updated of collision it is swapped with the post-collision speed - CPSZone *CollisionZone; // The zone on which the bounce occured, can be useful to check the behaviour in case of collision + NLMISC::CVector NewSpeed; // The speed of particle after a collision occurred. After the updated of collision it is swapped with the post-collision speed + CPSZone *CollisionZone; // The zone on which the bounce occurred, can be useful to check the behaviour in case of collision uint32 Index; CPSCollisionInfo() { @@ -356,7 +356,7 @@ public: void resize(uint32 newSize); /// serialization - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); /// Shortcut to get an instance of the 3d driver IDriver *getDriver() const; @@ -449,14 +449,14 @@ public: void setName(const std::string &name) { _Name = name; } /// get the located bindable name (edition purpose) - std::string getName(void) const { return _Name; } + std::string getName() const { return _Name; } /// tells whether there are alive entities / particles in the system - virtual bool hasParticles(void) const; + virtual bool hasParticles() const; /// tells whether there are alive emitters / particles in the system - virtual bool hasEmitters(void) const; + virtual bool hasEmitters() const; /** Enable the to force LOD degradation. This will suppress instances immediately, (during the motion pass) so that * there won't be more than maxNbInstance * dist / maxDist instances. This may not be desirable @@ -468,7 +468,7 @@ public: /** Test whether LOD degradation was activated * \see forceLODDegradation() */ - bool hasLODDegradation(void) const { return _LODDegradation; } + bool hasLODDegradation() const { return _LODDegradation; } /// for the CPSLocated to reevaluate the max number of faces it may need @@ -730,7 +730,7 @@ public: /// ctor CPSLocatedBindable(); /// serialization - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); /** this should be called before to delete any bindable inserted in a system, but this is done * by the system, so you should never need calling it. This has been introduced because calls in dtor are not polymorphic * to derived class (which are already destroyed anyway), and some infos are needed in some dtor. The default behaviour does nothing @@ -853,11 +853,11 @@ public: */ void setLOD(TPSLod lod) { _LOD = lod; } /// get the valid lods for that object - TPSLod getLOD(void) const { return _LOD; } + TPSLod getLOD() const { return _LOD; } /// tells whether there are alive entities / particles - virtual bool hasParticles(void) const { return false; } + virtual bool hasParticles() const { return false; } /// tells whether there are alive emitters - virtual bool hasEmitters(void) const { return false; } + virtual bool hasEmitters() const { return false; } /** set the extern ID of this located bindable. 0 means no extern access. The map of ID-locatedBindable. Is in th * particle system, so this located bindable must have been attached to a particle system, otherwise an assertion is raised */ @@ -906,10 +906,10 @@ protected: */ virtual void resize(uint32 size) = 0; - /** a bounce occured, so some action could be done. The default behaviour does nothing + /** a bounce occurred, so some action could be done. The default behaviour does nothing * \param index the index of the element that bounced */ - virtual void bounceOccured(uint32 /* index */, TAnimationTime /* timeToNextsimStep */) {} + virtual void bounceOccurred(uint32 /* index */, TAnimationTime /* timeToNextsimStep */) {} /** show an drawing to represent the object, and in red if it is selected * \param tab : a table of 2 * nbSeg vector. only the x and y coordinates are used @@ -1010,7 +1010,7 @@ public: */ virtual void releaseTargetRsc(CPSLocated * /* target */) {} /// Seralization, must be called by derivers - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); /// Finalize this object : the default is to call releaseTargetRsc on targets virtual void finalize(void); virtual ~CPSTargetLocatedBindable(); diff --git a/code/nel/include/nel/3d/ps_mesh.h b/code/nel/include/nel/3d/ps_mesh.h index 72ba76f4d..7eef01012 100644 --- a/code/nel/include/nel/3d/ps_mesh.h +++ b/code/nel/include/nel/3d/ps_mesh.h @@ -82,7 +82,7 @@ public: std::string getShape(void) const { return _Shape; } /// serialisation. Derivers must override this, and call their parent version - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); virtual ~CPSMesh(); @@ -271,7 +271,7 @@ public: /// serialisation. Derivers must override this, and call their parent version - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSConstraintMesh); @@ -334,7 +334,7 @@ public: float WRotSpeed; /* = 0 */ float WRotAccel; /* = 0 */ CGlobalTexAnim(); - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); /// Build a texture matrix from a date and this obj. void buildMatrix(TAnimationTime date, NLMISC::CMatrix &dest); }; @@ -587,10 +587,10 @@ protected: struct CGlobalTexAnims { CGlobalTexAnim Anims[IDRV_MAT_MAXTEXTURES]; - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); }; - typedef std::auto_ptr PGlobalTexAnims; + typedef CUniquePtr PGlobalTexAnims; PGlobalTexAnims _GlobalTexAnims; float _GlobalAnimDate; diff --git a/code/nel/include/nel/3d/ps_particle_basic.h b/code/nel/include/nel/3d/ps_particle_basic.h index 3674e6d9c..c7bdc242a 100644 --- a/code/nel/include/nel/3d/ps_particle_basic.h +++ b/code/nel/include/nel/3d/ps_particle_basic.h @@ -107,7 +107,7 @@ public: virtual uint32 getNumWantedTris() const = 0; /// serialisation. Derivers must override this, and call their parent version - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + virtual void serial(NLMISC::IStream &f) { /// version 3 : global color lighting /// version 2 : auto-lod saved @@ -210,7 +210,7 @@ class CPSColoredParticle virtual ~CPSColoredParticle(); /// serialization. - void serialColorScheme(NLMISC::IStream &f) throw(NLMISC::EStream); + void serialColorScheme(NLMISC::IStream &f); protected: @@ -273,7 +273,7 @@ class CPSSizedParticle virtual ~CPSSizedParticle(); /// serialization. We choose a different name because of multiple-inheritance - void serialSizeScheme(NLMISC::IStream &f) throw(NLMISC::EStream); + void serialSizeScheme(NLMISC::IStream &f); protected: @@ -335,7 +335,7 @@ class CPSRotated2DParticle virtual ~CPSRotated2DParticle(); /// serialization. We choose a different name because of multiple-inheritance - void serialAngle2DScheme(NLMISC::IStream &f) throw(NLMISC::EStream); + void serialAngle2DScheme(NLMISC::IStream &f); @@ -453,7 +453,7 @@ class CPSTexturedParticle virtual ~CPSTexturedParticle(); /// serialization. We choose a different name because of multiple-inheritance - void serialTextureScheme(NLMISC::IStream &f) throw(NLMISC::EStream); + void serialTextureScheme(NLMISC::IStream &f); void enumTexs(std::vector > &dest); @@ -576,7 +576,7 @@ public: } /// serial this object - void serialMultiTex(NLMISC::IStream &f) throw(NLMISC::EStream); + void serialMultiTex(NLMISC::IStream &f); /** setup a material from this object and a primary texture * drv is used to check the device caps. @@ -683,7 +683,7 @@ class CPSRotated3DPlaneParticle virtual ~CPSRotated3DPlaneParticle(); /// serialization. We choose a different name because of multiple-inheritance - void serialPlaneBasisScheme(NLMISC::IStream &f) throw(NLMISC::EStream); + void serialPlaneBasisScheme(NLMISC::IStream &f); protected: /// if this is false, constant size will be used instead of a scheme @@ -806,7 +806,7 @@ public: enum TBlendingMode { add, modulate, alphaBlend, alphaTest }; /// serialization (not named 'serial' because it will be used via multiple-inheritance) - void serialMaterial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serialMaterial(NLMISC::IStream &f); /// set the blending mode. The default is ass void setBlendingMode(CPSMaterial::TBlendingMode mode); diff --git a/code/nel/include/nel/3d/ps_plane_basis.h b/code/nel/include/nel/3d/ps_plane_basis.h index 41882e148..3a36876f7 100644 --- a/code/nel/include/nel/3d/ps_plane_basis.h +++ b/code/nel/include/nel/3d/ps_plane_basis.h @@ -66,7 +66,7 @@ struct CPlaneBasis } - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { f.serial(X, Y) ; } diff --git a/code/nel/include/nel/3d/ps_plane_basis_maker.h b/code/nel/include/nel/3d/ps_plane_basis_maker.h index 54770c9c9..e798c9885 100644 --- a/code/nel/include/nel/3d/ps_plane_basis_maker.h +++ b/code/nel/include/nel/3d/ps_plane_basis_maker.h @@ -128,7 +128,7 @@ class CPSPlaneBasisFollowSpeed : public CPSAttribMaker NLMISC_DECLARE_CLASS(CPSPlaneBasisFollowSpeed); /// serialization - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + virtual void serial(NLMISC::IStream &f) { // version 2 : added projection plane // version 1 : nothing to save here @@ -192,7 +192,7 @@ public: /// get the number of samples for the rotation uint32 getNumSamples(void) const; /// serial this object - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); protected: CPSVector::V _PBTab; uint32 _NbSamples; diff --git a/code/nel/include/nel/3d/ps_quad.h b/code/nel/include/nel/3d/ps_quad.h index 000ff32cc..76e9562e2 100644 --- a/code/nel/include/nel/3d/ps_quad.h +++ b/code/nel/include/nel/3d/ps_quad.h @@ -114,7 +114,7 @@ protected: void updateVbColNUVForRender(CVertexBuffer &vb, uint32 startIndex, uint32 numQuad, uint32 srcStep, IDriver &drv); /// DERIVERS MUST CALL this - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); virtual CPSLocated *getColorOwner(void) { return _Owner; } virtual CPSLocated *getSizeOwner(void) { return _Owner; } virtual CPSLocated *getTextureIndexOwner(void) { return _Owner; } diff --git a/code/nel/include/nel/3d/ps_ribbon.h b/code/nel/include/nel/3d/ps_ribbon.h index ccda62021..5383a1b4b 100644 --- a/code/nel/include/nel/3d/ps_ribbon.h +++ b/code/nel/include/nel/3d/ps_ribbon.h @@ -55,7 +55,7 @@ public: /// dtor ~CPSRibbon(); /// serialisation. Derivers must override this, and call their parent version - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); // NLMISC_DECLARE_CLASS(CPSRibbon); ///@} diff --git a/code/nel/include/nel/3d/ps_ribbon_base.h b/code/nel/include/nel/3d/ps_ribbon_base.h index ea3443060..5670a2d31 100644 --- a/code/nel/include/nel/3d/ps_ribbon_base.h +++ b/code/nel/include/nel/3d/ps_ribbon_base.h @@ -52,7 +52,7 @@ public: ///@{ CPSRibbonBase(); /// serialisation. Derivers must override this, and call their parent version - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); ///@} ///\name Behaviour diff --git a/code/nel/include/nel/3d/ps_ribbon_look_at.h b/code/nel/include/nel/3d/ps_ribbon_look_at.h index 2494fe04c..6da38694b 100644 --- a/code/nel/include/nel/3d/ps_ribbon_look_at.h +++ b/code/nel/include/nel/3d/ps_ribbon_look_at.h @@ -38,7 +38,7 @@ public: /// dtor ~CPSRibbonLookAt(); /// serialisation. Derivers must override this, and call their parent version - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); // NLMISC_DECLARE_CLASS(CPSRibbonLookAt); ///@} diff --git a/code/nel/include/nel/3d/ps_shockwave.h b/code/nel/include/nel/3d/ps_shockwave.h index b8329a239..54774c58f 100644 --- a/code/nel/include/nel/3d/ps_shockwave.h +++ b/code/nel/include/nel/3d/ps_shockwave.h @@ -54,7 +54,7 @@ public: float getRadiusCut(void) const { return _RadiusCut; } /// serialisation. Derivers must override this, and call their parent version - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSShockWave); diff --git a/code/nel/include/nel/3d/ps_sound.h b/code/nel/include/nel/3d/ps_sound.h index af5a7cc94..d1c990770 100644 --- a/code/nel/include/nel/3d/ps_sound.h +++ b/code/nel/include/nel/3d/ps_sound.h @@ -50,7 +50,7 @@ public: /// dtor ~CPSSound(); /// serialisation. Derivers must override this, and call their parent version - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); //@} /// return this bindable type diff --git a/code/nel/include/nel/3d/ps_tail_dot.h b/code/nel/include/nel/3d/ps_tail_dot.h index 3caf5fa96..a2aae6e83 100644 --- a/code/nel/include/nel/3d/ps_tail_dot.h +++ b/code/nel/include/nel/3d/ps_tail_dot.h @@ -37,7 +37,7 @@ public: /// dtor ~CPSTailDot(); /// serialisation. Derivers must override this, and call their parent version - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); // NLMISC_DECLARE_CLASS(CPSTailDot); ///@} diff --git a/code/nel/include/nel/3d/ps_zone.h b/code/nel/include/nel/3d/ps_zone.h index 7289e64e0..032d5db62 100644 --- a/code/nel/include/nel/3d/ps_zone.h +++ b/code/nel/include/nel/3d/ps_zone.h @@ -82,7 +82,7 @@ public: /// serialization, DERIVER must override this, and call the parent version - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); /** Inherited from CPSTargetLocatedBindable. It's called when one of the targets has been detroyed or detached @@ -120,7 +120,7 @@ protected: /** * This set speed of a located so that it looks like bouncing on a surface * \param locatedIndex the index - * \param bouncePoint the position where the collision occured + * \param bouncePoint the position where the collision occurred * \param surfNormal the normal of the surface at the collision point (this must be a unit vector) * \elasticity 1 = full bounce, 0 = no bounce (contact) * \ellapsedTime the time ellapsed @@ -155,7 +155,7 @@ class CPSZonePlane : public CPSZone, public IPSMover virtual NLMISC::CVector getNormal(uint32 index); virtual void setNormal(uint32 index, NLMISC::CVector n); - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); protected: TPSAttribVector _Normal; @@ -176,7 +176,7 @@ struct CRadiusPair { // the adius, and the square radius float R, R2; - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { f.serial(R, R2); } @@ -205,7 +205,7 @@ class CPSZoneSphere : public CPSZone, public IPSMover - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); // inherited from IPSMover @@ -257,7 +257,7 @@ class CPSZoneDisc : public CPSZone, public IPSMover virtual NLMISC::CVector getNormal(uint32 index); virtual void setNormal(uint32 index, NLMISC::CVector n); - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); @@ -303,7 +303,7 @@ class CPSZoneCylinder : public CPSZone, public IPSMover virtual NLMISC::CVector getScale(uint32 k) const; // serialization - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); @@ -350,7 +350,7 @@ class CPSZoneRectangle : public CPSZone, public IPSMover // serialization - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); // inherited from IPSMover virtual bool supportUniformScaling(void) const { return true; } diff --git a/code/nel/include/nel/3d/quad_grid.h b/code/nel/include/nel/3d/quad_grid.h index 12160b540..b03164520 100644 --- a/code/nel/include/nel/3d/quad_grid.h +++ b/code/nel/include/nel/3d/quad_grid.h @@ -654,7 +654,7 @@ template typename CQuadGrid::CIterator CQuadGrid::erase(typename if(!ptr->Selected) next= NULL; // delete the object. - _NodeBlockMemory.free(ptr); + _NodeBlockMemory.freeBlock(ptr); return CIterator((CNode*)next); diff --git a/code/nel/include/nel/3d/ray_mesh.h b/code/nel/include/nel/3d/ray_mesh.h index 80671a49c..70a25c2be 100644 --- a/code/nel/include/nel/3d/ray_mesh.h +++ b/code/nel/include/nel/3d/ray_mesh.h @@ -53,7 +53,7 @@ public: public: // Simple Definition of a mesh used to test against Ray - std::vector Vertices; + std::vector Vertices; std::vector Triangles; /// Empty? diff --git a/code/nel/include/nel/3d/render_target_manager.h b/code/nel/include/nel/3d/render_target_manager.h new file mode 100644 index 000000000..cae8e31b0 --- /dev/null +++ b/code/nel/include/nel/3d/render_target_manager.h @@ -0,0 +1,83 @@ +/** + * \file render_target_manager.h + * \brief CRenderTargetManager + * \date 2014-07-30 21:30GMT + * \author Jan Boon (Kaetemi) + * CRenderTargetManager + */ + +/* + * Copyright (C) 2013 by authors + * + * This file is part of NL3D. + * NL3D 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. + * + * NL3D 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 NL3D. If not, see + * . + */ + +#ifndef NL3D_RENDER_TARGET_MANAGER_H +#define NL3D_RENDER_TARGET_MANAGER_H +#include + +// STL includes + +// NeL includes +#include +#include + +// Project includes +#include + +namespace NL3D { + +class UDriver; +class ITexture; +class CTextureUser; +class CDriverUser; + +struct CRenderTargetDescInt; + +/** + * \brief CRenderTargetManager + * \date 2013-07-03 20:17GMT + * \author Jan Boon (Kaetemi) + * CRenderTargetManager + * Usage: Call 'getRenderTarget' when you start using a render target, + * call 'recycledRenderTarget' when the render target can be recycled. + * At end of frame call cleanup. + * Assumes semi-constant render target quantity between frames, + * except on changes of resolution or feature settings. + */ +class CRenderTargetManager +{ +public: + CRenderTargetManager(); + ~CRenderTargetManager(); + + NL3D::CTextureUser *getRenderTarget(uint width, uint height, bool mode2D = false, UTexture::TUploadFormat format = UTexture::Auto); + void recycleRenderTarget(NL3D::CTextureUser *renderTarget); + + void cleanup(); + +private: + friend class CDriverUser; + NL3D::UDriver *m_Driver; + std::vector m_RenderTargets; + +}; /* class CRenderTargetManager */ + +} /* namespace NL3D */ + +#endif /* #ifndef NL3D_RENDER_TARGET_MANAGER_H */ + +/* end of file */ diff --git a/code/nel/include/nel/3d/render_trav.h b/code/nel/include/nel/3d/render_trav.h index d50d2c242..41570c2ca 100644 --- a/code/nel/include/nel/3d/render_trav.h +++ b/code/nel/include/nel/3d/render_trav.h @@ -28,6 +28,8 @@ #include "nel/3d/shadow_map_manager.h" #include "nel/3d/u_scene.h" #include "nel/3d/vertex_program.h" +#include "nel/3d/transform.h" + #include @@ -139,7 +141,7 @@ public: * \param renderPart : The part of the scene that must be rendered * \param newRender true If scene render is beginning. Otherwise other parts of the scene have already been rendered. */ - void traverse(UScene::TRenderPart renderPart, bool newRender); + void traverse(UScene::TRenderPart renderPart, bool newRender, bool generateShadows); //@} /// \name RenderList. diff --git a/code/nel/include/nel/3d/scene.h b/code/nel/include/nel/3d/scene.h index 50dfe6b8a..12c18b484 100644 --- a/code/nel/include/nel/3d/scene.h +++ b/code/nel/include/nel/3d/scene.h @@ -157,7 +157,7 @@ public: * \param doHrcPass set it to false to indicate that the CHrcTrav have not to be traversed. Useful to optimize if * you know that NONE of your models have moved (a good example is a shoot of the scene from different cameras). */ - void render(bool doHrcPass=true); + void render(bool doHrcPass = true); /** Begin Part Rendering * During beginPartRender()/endPartRender(), you can ask other scene to render their part, but you should @@ -171,10 +171,10 @@ public: * WARNING: always must begin rendering with at least UScene::RenderOpaque, else shadows won't work * WARNING: assert-crash if a part in 'rp' has already been rendered since the last beginPartRender() */ - void renderPart(UScene::TRenderPart rp, bool doHrcPass=true); + void renderPart(UScene::TRenderPart rp, bool doHrcPass = true, bool doTrav = true, bool keepTrav = false); /** End Part Rendering (commit model creation and deletion that were asked during rendering) */ - void endPartRender(); + void endPartRender(bool keepTrav = false); //@} diff --git a/code/nel/include/nel/3d/scene_user.h b/code/nel/include/nel/3d/scene_user.h index 708c8bfd7..639fa33d8 100644 --- a/code/nel/include/nel/3d/scene_user.h +++ b/code/nel/include/nel/3d/scene_user.h @@ -96,8 +96,8 @@ public: // render methods virtual void render(bool updateWaitingInstances = true, bool restoreMatrixContextAfterRender = true); virtual void beginPartRender(); - virtual void renderPart(TRenderPart rp); - virtual void endPartRender(bool updateWaitingInstances = true, bool restoreMatrixContextAfterRender = true); + virtual void renderPart(TRenderPart rp, bool doHrcPass = true, bool doTrav = true, bool keepTrav = false); + virtual void endPartRender(bool updateWaitingInstances = true, bool restoreMatrixContextAfterRender = true, bool keepTrav = true); // update async loading whithout a call to render virtual void updateWaitingInstances(double ellapsedTime); diff --git a/code/nel/include/nel/3d/seg_remanence_shape.h b/code/nel/include/nel/3d/seg_remanence_shape.h index 6a1f2cb5e..2f8a159ff 100644 --- a/code/nel/include/nel/3d/seg_remanence_shape.h +++ b/code/nel/include/nel/3d/seg_remanence_shape.h @@ -22,7 +22,7 @@ #include "nel/misc/smart_ptr.h" #include "nel/misc/vector.h" #include "nel/misc/aabbox.h" - +#include "nel/misc/class_id.h" #include "nel/3d/texture.h" #include "nel/3d/shape.h" @@ -70,7 +70,7 @@ public: // assignement CSegRemanenceShape &operator = (const CSegRemanenceShape &other); - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CSegRemanenceShape); //@} diff --git a/code/nel/include/nel/3d/shadow_map.h b/code/nel/include/nel/3d/shadow_map.h index aa4921594..84cc32af1 100644 --- a/code/nel/include/nel/3d/shadow_map.h +++ b/code/nel/include/nel/3d/shadow_map.h @@ -51,7 +51,7 @@ public: * The usage of this matrix is for UV projection: XYZ= WorldProjectionMatrix * UVW. * NB: Vj (ie for W) is mapped such that Vp means NearClip of the shadow and Vp+Vj means FarClip of the shadow */ - CMatrix LocalProjectionMatrix; + NLMISC::CMatrix LocalProjectionMatrix; /** Computed at shadow casting time. They are clipping planes used to clip receivers (mirror of the OBB). * Receivers may use them to clip sub received parts (as they which) @@ -63,7 +63,7 @@ public: /** Computed at shadow casting time. This is the LocalPos Bouding Box containing the shadow (AxisAligned). * \see generateClipInfoFromMatrix() */ - CAABBox LocalBoundingBox; + NLMISC::CAABBox LocalBoundingBox; // Filled by ShadowMapManager. This is the Last Frame Id we had update the texture. @@ -114,13 +114,13 @@ public: * driver->setupModelMatrix(localPosMatrix); * Then render his mesh. */ - void buildCasterCameraMatrix(const CVector &lightDir, const CMatrix &localPosMatrix, const CAABBox &bbShape, CMatrix &cameraMatrix); + void buildCasterCameraMatrix(const NLMISC::CVector &lightDir, const NLMISC::CMatrix &localPosMatrix, const NLMISC::CAABBox &bbShape, NLMISC::CMatrix &cameraMatrix); /** From the Camera matrix computed with buildCasterCameraMatrix, compute the LocalProjectionMatrix, which modify the * J axis according to backPoint and Shadow Depth. * NB: automatically calls the buildClipInfoFromMatrix() method */ - void buildProjectionInfos(const CMatrix &cameraMatrix, const CVector &backPoint, float shadowMaxDepth); + void buildProjectionInfos(const NLMISC::CMatrix &cameraMatrix, const NLMISC::CVector &backPoint, float shadowMaxDepth); /** The ShadowMap Caster can call this method after setting LocalProjectionMatrix. It computes auto the * LocalClipPlanes and LocalBoundingBox from it. NB: don't use it if you use buildProjectionInfos(). @@ -158,13 +158,13 @@ class CShadowMapProjector { public: CShadowMapProjector(); - void setWorldSpaceTextMat(const CMatrix &ws); - void applyToMaterial(const CMatrix &receiverWorldMatrix, CMaterial &material); + void setWorldSpaceTextMat(const NLMISC::CMatrix &ws); + void applyToMaterial(const NLMISC::CMatrix &receiverWorldMatrix, CMaterial &material); private: - CMatrix _WsTextMat; - CMatrix _XYZToUWVMatrix; - CMatrix _XYZToWUVMatrix; + NLMISC::CMatrix _WsTextMat; + NLMISC::CMatrix _XYZToUWVMatrix; + NLMISC::CMatrix _XYZToWUVMatrix; }; diff --git a/code/nel/include/nel/3d/shadow_map_manager.h b/code/nel/include/nel/3d/shadow_map_manager.h index d52c0fb03..8f8267492 100644 --- a/code/nel/include/nel/3d/shadow_map_manager.h +++ b/code/nel/include/nel/3d/shadow_map_manager.h @@ -29,7 +29,8 @@ namespace NL3D { -class CTransform; +class CTransform; +class CScene; // *************************************************************************** diff --git a/code/nel/include/nel/3d/shadow_skin.h b/code/nel/include/nel/3d/shadow_skin.h index 2b63a635d..7560e0c50 100644 --- a/code/nel/include/nel/3d/shadow_skin.h +++ b/code/nel/include/nel/3d/shadow_skin.h @@ -33,9 +33,9 @@ namespace NL3D class CShadowVertex { public: - CVector Vertex; - uint32 MatrixId; - void serial(NLMISC::IStream &f) + NLMISC::CVector Vertex; + uint32 MatrixId; + void serial(NLMISC::IStream &f) { (void)f.serialVersion(0); @@ -82,7 +82,7 @@ public: * if don't intersect, dist2D="nearest distance to the ray", and distZ=0 * \param computeDist2D if false and don't intersect, then return dist2D=FLT_MAX, and distZ=0 */ - bool getRayIntersection(const CMatrix &toRaySpace, class CSkeletonModel &skeleton, + bool getRayIntersection(const NLMISC::CMatrix &toRaySpace, class CSkeletonModel &skeleton, const std::vector &matrixInfluences, float &dist2D, float &distZ, bool computeDist2D); private: diff --git a/code/nel/include/nel/3d/shape.h b/code/nel/include/nel/3d/shape.h index a8038e593..ec359aa7f 100644 --- a/code/nel/include/nel/3d/shape.h +++ b/code/nel/include/nel/3d/shape.h @@ -201,7 +201,7 @@ public: IShape* getShapePointer () const; /// serial the shape. - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); private: IShape* _Shape; }; diff --git a/code/nel/include/nel/3d/skeleton_shape.h b/code/nel/include/nel/3d/skeleton_shape.h index a47be7f17..359a51fd3 100644 --- a/code/nel/include/nel/3d/skeleton_shape.h +++ b/code/nel/include/nel/3d/skeleton_shape.h @@ -49,7 +49,7 @@ public: std::vector ActiveBones; public: - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); }; public: @@ -94,7 +94,7 @@ public: virtual float getNumTriangles (float distance); /// serial this skeletonshape. - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CSkeletonShape); /// flush textures used by this shape. diff --git a/code/nel/include/nel/3d/stereo_debugger.h b/code/nel/include/nel/3d/stereo_debugger.h index b07a9630c..6c974f93d 100644 --- a/code/nel/include/nel/3d/stereo_debugger.h +++ b/code/nel/include/nel/3d/stereo_debugger.h @@ -65,10 +65,17 @@ public: /// Sets driver and generates necessary render targets virtual void setDriver(NL3D::UDriver *driver); - void releaseTextures(); + /*void releaseTextures(); void initTextures(); void setTextures(); - void verifyTextures(); + void verifyTextures();*/ + void getTextures(); + void recycleTextures(); + + /// Attach the driver to the display + virtual bool attachToDisplay(); + /// Detach the driver from the display + virtual void detachFromDisplay(); /// Gets the required screen resolution for this device virtual bool getScreenResolution(uint &width, uint &height); @@ -76,6 +83,8 @@ public: virtual void updateCamera(uint cid, const NL3D::UCamera *camera); /// Get the frustum to use for clipping virtual void getClippingFrustum(uint cid, NL3D::UCamera *camera) const; + /// Get the original frustum of the camera + virtual void getOriginalFrustum(uint cid, NL3D::UCamera *camera) const; /// Is there a next pass virtual bool nextPass(); @@ -89,14 +98,21 @@ public: virtual void getCurrentMatrix(uint cid, NL3D::UCamera *camera) const; /// At the start of a new render target - virtual bool wantClear(); + virtual bool wantClear(); /// The 3D scene virtual bool wantScene(); + /// Scene post processing effects + virtual bool wantSceneEffects(); /// Interface within the 3D scene virtual bool wantInterface3D(); /// 2D Interface virtual bool wantInterface2D(); + /// Is this the first 3D scene of the frame + virtual bool isSceneFirst(); + /// Is this the last 3D scene of the frame + virtual bool isSceneLast(); + /// Returns true if a new render target was set, always fase if not using render targets virtual bool beginRenderTarget(); /// Returns true if a render target was fully drawn, always false if not using render targets @@ -116,9 +132,7 @@ private: CFrustum m_Frustum[NL_STEREO_MAX_USER_CAMERAS]; CMatrix m_CameraMatrix[NL_STEREO_MAX_USER_CAMERAS]; - NLMISC::CSmartPtr m_LeftTex; NL3D::CTextureUser *m_LeftTexU; - NLMISC::CSmartPtr m_RightTex; NL3D::CTextureUser *m_RightTexU; NL3D::UMaterial m_Mat; NLMISC::CQuadUV m_QuadUV; diff --git a/code/nel/include/nel/3d/stereo_display.h b/code/nel/include/nel/3d/stereo_display.h index 3b9c73b74..3b6fdbb21 100644 --- a/code/nel/include/nel/3d/stereo_display.h +++ b/code/nel/include/nel/3d/stereo_display.h @@ -94,6 +94,11 @@ public: /// Sets driver and generates necessary render targets virtual void setDriver(NL3D::UDriver *driver) = 0; + + /// Attach the driver to the display, return true if attached + virtual bool attachToDisplay() = 0; + /// Detach the driver from the display + virtual void detachFromDisplay() = 0; /// Gets the required screen resolution for this device virtual bool getScreenResolution(uint &width, uint &height) = 0; @@ -101,6 +106,8 @@ public: virtual void updateCamera(uint cid, const NL3D::UCamera *camera) = 0; /// Get the frustum to use for clipping virtual void getClippingFrustum(uint cid, NL3D::UCamera *camera) const = 0; + /// Get the original frustum of the camera + virtual void getOriginalFrustum(uint cid, NL3D::UCamera *camera) const = 0; /// Is there a next pass virtual bool nextPass() = 0; @@ -114,20 +121,28 @@ public: virtual void getCurrentMatrix(uint cid, NL3D::UCamera *camera) const = 0; /// At the start of a new render target - virtual bool wantClear() = 0; + virtual bool wantClear() = 0; /// The 3D scene virtual bool wantScene() = 0; + /// Scene post processing effects + virtual bool wantSceneEffects() = 0; /// Interface within the 3D scene virtual bool wantInterface3D() = 0; /// 2D Interface virtual bool wantInterface2D() = 0; + /// Is this the first 3D scene of the frame + virtual bool isSceneFirst() = 0; + /// Is this the last 3D scene of the frame + virtual bool isSceneLast() = 0; + /// Returns true if a new render target was set, always fase if not using render targets virtual bool beginRenderTarget() = 0; /// Returns true if a render target was fully drawn, always false if not using render targets virtual bool endRenderTarget() = 0; static const char *getLibraryName(CStereoDeviceInfo::TStereoDeviceLibrary library); + // List all devices. Device creation factories are no longer valid after re-calling this function static void listDevices(std::vector &devicesOut); static IStereoDisplay *createDevice(const CStereoDeviceInfo &deviceInfo); static void releaseUnusedLibraries(); diff --git a/code/nel/include/nel/3d/stereo_hmd.h b/code/nel/include/nel/3d/stereo_hmd.h index 95c159cfd..69f8e60dd 100644 --- a/code/nel/include/nel/3d/stereo_hmd.h +++ b/code/nel/include/nel/3d/stereo_hmd.h @@ -53,6 +53,9 @@ public: /// Get the HMD orientation virtual NLMISC::CQuat getOrientation() const = 0; + /// Set the GUI reference + virtual void setInterfaceMatrix(const NLMISC::CMatrix &matrix) = 0; + /// Get GUI center (1 = width, 1 = height, 0 = center) virtual void getInterface2DShift(uint cid, float &x, float &y, float distance) const = 0; diff --git a/code/nel/include/nel/3d/stereo_ovr.h b/code/nel/include/nel/3d/stereo_ovr.h index ba6895bf0..750f32027 100644 --- a/code/nel/include/nel/3d/stereo_ovr.h +++ b/code/nel/include/nel/3d/stereo_ovr.h @@ -44,7 +44,7 @@ #ifndef NL3D_STEREO_OVR_H #define NL3D_STEREO_OVR_H -#ifdef HAVE_LIBOVR +#ifdef HAVE_LIBOVR_02 #include @@ -91,6 +91,8 @@ public: virtual void updateCamera(uint cid, const NL3D::UCamera *camera); /// Get the frustum to use for clipping virtual void getClippingFrustum(uint cid, NL3D::UCamera *camera) const; + /// Get the original frustum of the camera + virtual void getOriginalFrustum(uint cid, NL3D::UCamera *camera) const; /// Is there a next pass virtual bool nextPass(); @@ -121,6 +123,9 @@ public: /// Get the HMD orientation virtual NLMISC::CQuat getOrientation() const; + /// Set the GUI reference + virtual void setInterfaceMatrix(const NL3D::CMatrix &matrix); + /// Get GUI center (1 = width, 1 = height, 0 = center) virtual void getInterface2DShift(uint cid, float &x, float &y, float distance) const; @@ -132,33 +137,37 @@ public: /// Set the scale of the game in units per meter virtual void setScale(float s); - - static void listDevices(std::vector &devicesOut); - static bool isLibraryInUse(); - static void releaseLibrary(); - - /// Calculates internal camera information based on the reference camera void initCamera(uint cid, const NL3D::UCamera *camera); + /// Render GUI + void renderGUI(); + /// Checks if the device used by this class was actually created bool isDeviceCreated(); + static void listDevices(std::vector &devicesOut); + static bool isLibraryInUse(); + static void releaseLibrary(); + private: CStereoOVRDevicePtr *m_DevicePtr; int m_Stage; int m_SubStage; + CViewport m_RegularViewport; CViewport m_LeftViewport; CViewport m_RightViewport; CFrustum m_ClippingFrustum[NL_STEREO_MAX_USER_CAMERAS]; CFrustum m_LeftFrustum[NL_STEREO_MAX_USER_CAMERAS]; CFrustum m_RightFrustum[NL_STEREO_MAX_USER_CAMERAS]; + CFrustum m_OriginalFrustum[NL_STEREO_MAX_USER_CAMERAS]; CMatrix m_CameraMatrix[NL_STEREO_MAX_USER_CAMERAS]; + CMatrix m_InterfaceCameraMatrix; mutable bool m_OrientationCached; mutable NLMISC::CQuat m_OrientationCache; UDriver *m_Driver; - NLMISC::CSmartPtr m_BarrelTex; - NL3D::CTextureUser *m_BarrelTexU; + NL3D::CTextureUser *m_SceneTexture; NL3D::UMaterial m_BarrelMat; + NL3D::CTextureUser *m_GUITexture; NLMISC::CQuadUV m_BarrelQuadLeft; NLMISC::CQuadUV m_BarrelQuadRight; NLMISC::CRefPtr m_PixelProgram; diff --git a/code/nel/include/nel/3d/stereo_ovr_04.h b/code/nel/include/nel/3d/stereo_ovr_04.h new file mode 100644 index 000000000..8bda88c88 --- /dev/null +++ b/code/nel/include/nel/3d/stereo_ovr_04.h @@ -0,0 +1,225 @@ +/** + * \file stereo_ovr.h + * \brief CStereoOVR + * \date 2014-08-04 16:21GMT + * \author Jan Boon (Kaetemi) + * CStereoOVR + */ + +/* + * Copyright (C) 2014 by authors + * + * This file is part of NL3D. + * NL3D 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. + * + * NL3D 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 NL3D. If not, see + * . + * + * Linking this library statically or dynamically with other modules + * is making a combined work based on this library. Thus, the terms + * and conditions of the GNU General Public License cover the whole + * combination. + * + * As a special exception, the copyright holders of this library give + * you permission to link this library with the Oculus SDK to produce + * an executable, regardless of the license terms of the Oculus SDK, + * and distribute linked combinations including the two, provided that + * you also meet the terms and conditions of the license of the Oculus + * SDK. You must obey the GNU General Public License in all respects + * for all of the code used other than the Oculus SDK. If you modify + * this file, you may extend this exception to your version of the + * file, but you are not obligated to do so. If you do not wish to do + * so, delete this exception statement from your version. + */ + +#ifndef NL3D_STEREO_OVR_04_H +#define NL3D_STEREO_OVR_04_H + +#ifdef HAVE_LIBOVR + +#include + +// STL includes + +// NeL includes +#include +#include + +// Project includes +#include +#include +#include +#include +#include +#include +#include + +struct ovrHmdDesc_; +typedef const ovrHmdDesc_ *ovrHmd; + +namespace NL3D { + +class ITexture; +class CTextureUser; +class CStereoOVRDeviceFactory; + +#define NL_STEREO_MAX_USER_CAMERAS 8 +#define NL_OVR_EYE_COUNT 2 + +/** + * \brief CStereoOVR + * \date 2014-08-04 16:21GMT + * \author Jan Boon (Kaetemi) + * CStereoOVR + */ +class CStereoOVR : public IStereoHMD +{ +public: + CStereoOVR(const CStereoOVRDeviceFactory *factory); + virtual ~CStereoOVR(); + + /// Sets driver and generates necessary render targets + virtual void setDriver(NL3D::UDriver *driver); + + /// Attach the driver to the display + virtual bool attachToDisplay(); + /// Detach the driver from the display + virtual void detachFromDisplay(); + + /// Gets the required screen resolution for this device + virtual bool getScreenResolution(uint &width, uint &height); + /// Set latest camera position etcetera + virtual void updateCamera(uint cid, const NL3D::UCamera *camera); + /// Get the frustum to use for clipping + virtual void getClippingFrustum(uint cid, NL3D::UCamera *camera) const; + /// Get the original frustum of the camera + virtual void getOriginalFrustum(uint cid, NL3D::UCamera *camera) const; + + /// Is there a next pass + virtual bool nextPass(); + /// Gets the current viewport + virtual const NL3D::CViewport &getCurrentViewport() const; + /// Gets the current camera frustum + virtual const NL3D::CFrustum &getCurrentFrustum(uint cid) const; + /// Gets the current camera frustum + virtual void getCurrentFrustum(uint cid, NL3D::UCamera *camera) const; + /// Gets the current camera matrix + virtual void getCurrentMatrix(uint cid, NL3D::UCamera *camera) const; + + /// At the start of a new render target + virtual bool wantClear(); + /// The 3D scene + virtual bool wantScene(); + /// Scene post processing effects + virtual bool wantSceneEffects(); + /// Interface within the 3D scene + virtual bool wantInterface3D(); + /// 2D Interface + virtual bool wantInterface2D(); + + /// Is this the first 3D scene of the frame + virtual bool isSceneFirst(); + /// Is this the last 3D scene of the frame + virtual bool isSceneLast(); + + /// Returns true if a new render target was set, always fase if not using render targets + virtual bool beginRenderTarget(); + /// Returns true if a render target was fully drawn, always false if not using render targets + virtual bool endRenderTarget(); + + + /// Get the HMD orientation + virtual NLMISC::CQuat getOrientation() const; + + /// Set the GUI reference + virtual void setInterfaceMatrix(const NL3D::CMatrix &matrix); + + /// Get GUI center (1 = width, 1 = height, 0 = center) + virtual void getInterface2DShift(uint cid, float &x, float &y, float distance) const; + + /// Set the head model, eye position relative to orientation point + virtual void setEyePosition(const NLMISC::CVector &v); + /// Get the head model, eye position relative to orientation point + virtual const NLMISC::CVector &getEyePosition() const; + + /// Set the scale of the game in units per meter + virtual void setScale(float s); + + /// Calculates internal camera information based on the reference camera + void initCamera(uint cid, const NL3D::UCamera *camera); + /// Render GUI + void renderGUI(); + + /// Checks if the device used by this class was actually created + bool isDeviceCreated(); + + static void listDevices(std::vector &devicesOut); + static bool isLibraryInUse(); + static void releaseLibrary(); + +private: + ovrHmd m_DevicePtr; + bool m_DebugDevice; + + int m_Stage; + int m_SubStage; + + CViewport m_RegularViewport; + CViewport m_EyeViewport[NL_OVR_EYE_COUNT]; + CFrustum m_EyeFrustumBase[NL_OVR_EYE_COUNT]; + uint m_RenderTargetWidth; + uint m_RenderTargetHeight; + NLMISC::CVector2f m_EyeUVScaleOffset[NL_OVR_EYE_COUNT][2]; + float m_EyeViewAdjustX[NL_OVR_EYE_COUNT]; + + CVertexBuffer m_VB[NL_OVR_EYE_COUNT]; + CIndexBuffer m_IB[NL_OVR_EYE_COUNT]; + uint32 m_NbTris[NL_OVR_EYE_COUNT]; + + CFrustum m_ClippingFrustum[NL_STEREO_MAX_USER_CAMERAS]; + CFrustum m_LeftFrustum[NL_STEREO_MAX_USER_CAMERAS]; + CFrustum m_RightFrustum[NL_STEREO_MAX_USER_CAMERAS]; + CFrustum m_OriginalFrustum[NL_STEREO_MAX_USER_CAMERAS]; + CMatrix m_CameraMatrix[NL_STEREO_MAX_USER_CAMERAS]; + CMatrix m_InterfaceCameraMatrix; + mutable bool m_OrientationCached; + mutable NLMISC::CQuat m_OrientationCache; + + UDriver *m_Driver; + + CTextureUser *m_GUITexture; + NL3D::CTextureUser *m_SceneTexture; + + UMaterial m_UnlitMat; + + UDriver::CMode m_OriginalMode; + sint32 m_OriginalWinPosX; + sint32 m_OriginalWinPosY; + bool m_AttachedDisplay; + + /* + NL3D::UMaterial m_BarrelMat; + NLMISC::CQuadUV m_BarrelQuadLeft; + NLMISC::CQuadUV m_BarrelQuadRight; + NLMISC::CRefPtr m_PixelProgram;*/ + NLMISC::CVector m_EyePosition; + float m_Scale; + +}; /* class CStereoOVR */ + +} /* namespace NL3D */ + +#endif /* HAVE_LIBOVR */ + +#endif /* #ifndef NL3D_STEREO_OVR_04_H */ + +/* end of file */ diff --git a/code/nel/include/nel/3d/target_anim_ctrl.h b/code/nel/include/nel/3d/target_anim_ctrl.h index b2edf9f84..19aae3c20 100644 --- a/code/nel/include/nel/3d/target_anim_ctrl.h +++ b/code/nel/include/nel/3d/target_anim_ctrl.h @@ -44,16 +44,16 @@ public: public: /// Target controled or direction controled. Default to DirectionMode - TMode Mode; + TMode Mode; /// \name Target and Direction specific // @{ /// For TargetMode, the world Position of the target. - CVector WorldTarget; + NLMISC::CVector WorldTarget; /// For TargetMode only, the Pos of eyes relative to the bone controlled. Default to (0,0,0) - CVector EyePos; + NLMISC::CVector EyePos; /// For DirectionMode, the WorldRotation to apply to the bone. NB: modified in execute() if TargetMode - CQuat CurrentWorldDirection; + NLMISC::CQuat CurrentWorldDirection; // @} /// \name Common @@ -61,13 +61,13 @@ public: /** This enable or disable the ctrl. When disabled or enabled, the ctrl ensure * that the movement does not "pop", respecting MaxAngularVelocity. Default to true. */ - bool Enabled; + bool Enabled; /// This give The World Orientation when the Mesh is in bind Pos (default to "LookBack"). - CQuat DefaultWorldDirection; + NLMISC::CQuat DefaultWorldDirection; /// The Maximum angle of rotation that can be performed between the Default Direction and Current Direction. Default to Pi/3 - float MaxAngle; + float MaxAngle; /// The Maximum Angular Velocity the ctrl can perform. Default to 2*Pi per second. - float MaxAngularVelocity; + float MaxAngularVelocity; // @} @@ -77,19 +77,19 @@ public: virtual ~CTargetAnimCtrl(); /// Called at compute() time. - virtual void execute(CSkeletonModel *model, CBone *bone); + virtual void execute(CSkeletonModel *model, CBone *bone); private: /// The last rotation computed (in LocalSkeleton Space). Used to smooth transition - CQuat _LastLSRotation; + NLMISC::CQuat _LastLSRotation; /// This tells that a Enable/Disable transition is in progress. - bool _LastEnabled; - bool _EnableToDisableTransition; + bool _LastEnabled; + bool _EnableToDisableTransition; - CQuat getCurrentLSRotationFromBone(CSkeletonModel *model, CBone *bone); + NLMISC::CQuat getCurrentLSRotationFromBone(CSkeletonModel *model, CBone *bone); }; diff --git a/code/nel/include/nel/3d/text_context.h b/code/nel/include/nel/3d/text_context.h index 203e2b3c3..1f75e1184 100644 --- a/code/nel/include/nel/3d/text_context.h +++ b/code/nel/include/nel/3d/text_context.h @@ -74,6 +74,10 @@ public: void setFontSize (uint32 fontSize) { _FontSize = fontSize; } + void setEmbolden (bool b) { _Embolden = b; } + + void setOblique (bool b) { _Oblique = b; } + void setHotSpot (CComputedString::THotSpot hotSpot) { _HotSpot = hotSpot; } void setScaleX (float scaleX) { _ScaleX = scaleX; } @@ -82,7 +86,9 @@ public: void setShaded (bool b) { _Shaded = b; } - void setShadeExtent (float shext) { _ShadeExtent = shext; } + void setShadeOutline (bool b) { _ShadeOutline = b; } + + void setShadeExtent (float x, float y) { _ShadeExtentX = x; _ShadeExtentY = y; } /// The alpha of the shade is multiplied at each draw with the alpha of the color. Default: (0,0,0,255) void setShadeColor (NLMISC::CRGBA color) { _ShadeColor = color; } @@ -99,6 +105,10 @@ public: uint32 getFontSize () const { return _FontSize; } + bool getEmbolden () const { return _Embolden; } + + bool getOblique () const { return _Oblique; } + CComputedString::THotSpot getHotSpot() const { return _HotSpot; } float getScaleX() const { return _ScaleX; } @@ -107,6 +117,8 @@ public: bool getShaded() const { return _Shaded; } + bool getShadeOutline() const { return _ShadeOutline; } + bool getKeep800x600Ratio() const {return _Keep800x600Ratio;} NLMISC::CRGBA getShadeColor () const { return _ShadeColor; } @@ -138,15 +150,35 @@ public: { nlassert (index < _CacheStrings.size()); CComputedString &rCS = _CacheStrings[index]; - if(_Shaded) + if (rCS.CacheVersion != _FontManager->getCacheVersion()) { - CRGBA bkup = rCS.Color; + computeString(rCS.Text, rCS); + } + if (_Shaded) + { + CRGBA bkup = rCS.Color; rCS.Color = _ShadeColor; rCS.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8); - rCS.render2D (*_Driver, x+_ShadeExtent, z-_ShadeExtent, _HotSpot, _ScaleX, _ScaleZ); + if (_ShadeOutline) + { + float rextX = _ShadeExtentX * 0.7071f; + float rextY = _ShadeExtentY * 0.7071f; + rCS.render2D(*_Driver, x+rextX, z-rextY, _HotSpot, _ScaleX, _ScaleZ); + rCS.render2D(*_Driver, x-rextX, z-rextY, _HotSpot, _ScaleX, _ScaleZ); + rCS.render2D(*_Driver, x-rextX, z+rextY, _HotSpot, _ScaleX, _ScaleZ); + rCS.render2D(*_Driver, x+rextX, z+rextY, _HotSpot, _ScaleX, _ScaleZ); + rCS.render2D(*_Driver, x+_ShadeExtentX, z, _HotSpot, _ScaleX, _ScaleZ); + rCS.render2D(*_Driver, x-_ShadeExtentX, z, _HotSpot, _ScaleX, _ScaleZ); + rCS.render2D(*_Driver, x, z-_ShadeExtentY, _HotSpot, _ScaleX, _ScaleZ); + rCS.render2D(*_Driver, x, z-_ShadeExtentY, _HotSpot, _ScaleX, _ScaleZ); + } + else + { + rCS.render2D(*_Driver, x+_ShadeExtentX, z-_ShadeExtentY, _HotSpot, _ScaleX, _ScaleZ); + } rCS.Color= bkup; } - rCS.render2D (*_Driver, x, z, _HotSpot, _ScaleX, _ScaleZ); + rCS.render2D(*_Driver, x, z, _HotSpot, _ScaleX, _ScaleZ); } /** Clip and print a string that is in the cache (it leaves the string in the cache) @@ -156,12 +188,32 @@ public: { nlassert (index < _CacheStrings.size()); CComputedString &rCS = _CacheStrings[index]; + if (rCS.CacheVersion != _FontManager->getCacheVersion()) + { + computeString(rCS.Text, rCS); + } if(_Shaded) { CRGBA bkup = rCS.Color; rCS.Color= _ShadeColor; rCS.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8); - rCS.render2DClip(*_Driver, rdrBuffer, x+_ShadeExtent, z-_ShadeExtent, xmin, ymin, xmax, ymax); + if (_ShadeOutline) + { + float rextX = _ShadeExtentX * 0.7071f; + float rextY = _ShadeExtentY * 0.7071f; + rCS.render2DClip(*_Driver, rdrBuffer, x+rextX, z-rextY, xmin, ymin, xmax, ymax); + rCS.render2DClip(*_Driver, rdrBuffer, x-rextX, z-rextY, xmin, ymin, xmax, ymax); + rCS.render2DClip(*_Driver, rdrBuffer, x-rextX, z+rextY, xmin, ymin, xmax, ymax); + rCS.render2DClip(*_Driver, rdrBuffer, x+rextX, z+rextY, xmin, ymin, xmax, ymax); + rCS.render2DClip(*_Driver, rdrBuffer, x+_ShadeExtentX, z, xmin, ymin, xmax, ymax); + rCS.render2DClip(*_Driver, rdrBuffer, x-_ShadeExtentX, z, xmin, ymin, xmax, ymax); + rCS.render2DClip(*_Driver, rdrBuffer, x, z+_ShadeExtentY, xmin, ymin, xmax, ymax); + rCS.render2DClip(*_Driver, rdrBuffer, x, z-_ShadeExtentY, xmin, ymin, xmax, ymax); + } + else + { + rCS.render2DClip(*_Driver, rdrBuffer, x+_ShadeExtentX, z-_ShadeExtentY, xmin, ymin, xmax, ymax); + } rCS.Color= bkup; } rCS.render2DClip (*_Driver, rdrBuffer, x, z, xmin, ymin, xmax, ymax); @@ -174,12 +226,33 @@ public: { nlassert (index < _CacheStrings.size()); CComputedString &rCS = _CacheStrings[index]; - if(_Shaded) + if (rCS.CacheVersion != _FontManager->getCacheVersion()) + { + computeString(rCS.Text, rCS); + } + + if (_Shaded) { CRGBA bkup = rCS.Color; rCS.Color= _ShadeColor; rCS.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8); - rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+_ShadeExtent, y-_ShadeExtent, depth, xmin, ymin, xmax, ymax); + if (_ShadeOutline) + { + float rextX = _ShadeExtentX * 0.7071f; + float rextY = _ShadeExtentY * 0.7071f; + rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+rextX, y-rextY, depth, xmin, ymin, xmax, ymax); + rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x-rextX, y-rextY, depth, xmin, ymin, xmax, ymax); + rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x-rextX, y+rextY, depth, xmin, ymin, xmax, ymax); + rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+rextX, y+rextY, depth, xmin, ymin, xmax, ymax); + rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+_ShadeExtentX, y, depth, xmin, ymin, xmax, ymax); + rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x-_ShadeExtentX, y, depth, xmin, ymin, xmax, ymax); + rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x, y+_ShadeExtentY, depth, xmin, ymin, xmax, ymax); + rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x, y-_ShadeExtentY, depth, xmin, ymin, xmax, ymax); + } + else + { + rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+_ShadeExtentX, y-_ShadeExtentY, depth, xmin, ymin, xmax, ymax); + } rCS.Color= bkup; } rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x, y, depth, xmin, ymin, xmax, ymax); @@ -191,20 +264,36 @@ public: nlassert(_FontGen); // compute the string just one time - _FontManager->computeString (ucstr, _FontGen, _Color, _FontSize, _Driver, _TempString, _Keep800x600Ratio); + _FontManager->computeString (ucstr, _FontGen, _Color, _FontSize, _Embolden, _Oblique, _Driver, _TempString, _Keep800x600Ratio); // draw shaded - if(_Shaded) + if (_Shaded) { CRGBA bkup = _TempString.Color; - _TempString.Color= _ShadeColor; + _TempString.Color = _ShadeColor; _TempString.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8); - _TempString.render2D (*_Driver,x+_ShadeExtent,z-_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ); - _TempString.Color= bkup; + if (_ShadeOutline) + { + float rextX = _ShadeExtentX * 0.7071f; + float rextY = _ShadeExtentY * 0.7071f; + _TempString.render2D(*_Driver,x+rextX,z-rextY,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x-rextX,z-rextY,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x-rextX,z+rextY,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x+rextX,z+rextY,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x+_ShadeExtentX,z,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x-_ShadeExtentX,z,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x,z+_ShadeExtentY,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x,z-_ShadeExtentY,_HotSpot,_ScaleX,_ScaleZ); + } + else + { + _TempString.render2D(*_Driver, x+_ShadeExtentX, z-_ShadeExtentY, _HotSpot, _ScaleX, _ScaleZ); + } + _TempString.Color = bkup; } // draw - _TempString.render2D (*_Driver, x, z, _HotSpot, _ScaleX, _ScaleZ); + _TempString.render2D(*_Driver, x, z, _HotSpot, _ScaleX, _ScaleZ); } /// Directly print a string @@ -215,20 +304,36 @@ public: // compute the string just one time char *str; NLMISC_CONVERT_VARGS (str, format, NLMISC::MaxCStringSize); - _FontManager->computeString (str, _FontGen, _Color, _FontSize, _Driver, _TempString, _Keep800x600Ratio); + _FontManager->computeString (str, _FontGen, _Color, _FontSize, _Embolden, _Oblique, _Driver, _TempString, _Keep800x600Ratio); // draw shaded - if(_Shaded) + if (_Shaded) { CRGBA bkup = _TempString.Color; _TempString.Color = _ShadeColor; _TempString.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8); - _TempString.render2D (*_Driver,x+_ShadeExtent,z-_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ); - _TempString.Color= bkup; + if (_ShadeOutline) + { + float rextX = _ShadeExtentX * 0.7071f; + float rextY = _ShadeExtentY * 0.7071f; + _TempString.render2D(*_Driver,x+rextX,z-rextY,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x-rextX,z-rextY,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x-rextX,z+rextY,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x+rextX,z+rextY,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x+_ShadeExtentX,z,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x-_ShadeExtentX,z,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x,z+_ShadeExtentY,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x,z-_ShadeExtentY,_HotSpot,_ScaleX,_ScaleZ); + } + else + { + _TempString.render2D(*_Driver, x+_ShadeExtentX, z-_ShadeExtentY, _HotSpot, _ScaleX, _ScaleZ); + } + _TempString.Color = bkup; } // draw - _TempString.render2D (*_Driver, x, z, _HotSpot, _ScaleX, _ScaleZ); + _TempString.render2D(*_Driver, x, z, _HotSpot, _ScaleX, _ScaleZ); } /// Get computed string from index @@ -255,7 +360,7 @@ public: */ void computeString (const std::string& s, CComputedString& output) { - _FontManager->computeString (s, _FontGen, _Color, _FontSize, _Driver, output, _Keep800x600Ratio); + _FontManager->computeString (s, _FontGen, _Color, _FontSize, _Embolden, _Oblique, _Driver, output, _Keep800x600Ratio); } /** @@ -266,12 +371,12 @@ public: */ void computeString (const ucstring& s, CComputedString& output) { - _FontManager->computeString (s, _FontGen, _Color, _FontSize, _Driver, output, _Keep800x600Ratio); + _FontManager->computeString (s, _FontGen, _Color, _FontSize, _Embolden, _Oblique, _Driver, output, _Keep800x600Ratio); } void computeStringInfo (const ucstring& s, CComputedString& output) { - _FontManager->computeStringInfo (s, _FontGen, _Color, _FontSize, _Driver, output, _Keep800x600Ratio); + _FontManager->computeStringInfo (s, _FontGen, _Color, _FontSize, _Embolden, _Oblique, _Driver, output, _Keep800x600Ratio); } /// Debug : write to the disk the texture cache @@ -302,6 +407,10 @@ private: /// Font size; uint32 _FontSize; + bool _Embolden; + + bool _Oblique; + /// Current text color NLMISC::CRGBA _Color; @@ -317,8 +426,12 @@ private: /// true if text is shaded bool _Shaded; + /// true if shade appears as an outline + bool _ShadeOutline; + /// shade's extent (shadow size) - float _ShadeExtent; + float _ShadeExtentX; + float _ShadeExtentY; /// Shade color (default is black) NLMISC::CRGBA _ShadeColor; diff --git a/code/nel/include/nel/3d/text_context_user.h b/code/nel/include/nel/3d/text_context_user.h index a95fb2ca1..15e93c3f2 100644 --- a/code/nel/include/nel/3d/text_context_user.h +++ b/code/nel/include/nel/3d/text_context_user.h @@ -64,19 +64,25 @@ public: /// \name Text look. // @{ void setColor(NLMISC::CRGBA color); - void setFontSize(uint32 fontSize) ; - uint32 getFontSize() const ; - void setHotSpot(THotSpot hotSpot) ; - THotSpot getHotSpot() const ; - void setScaleX(float scaleX) ; - void setScaleY(float scaleY) ; - float getScaleX() const ; - float getScaleY() const ; - void setShaded(bool b) ; - bool getShaded() const ; - void setShadeExtent(float shext) ; - void setShadeColor (NLMISC::CRGBA sc); - NLMISC::CRGBA getShadeColor () const; + void setFontSize(uint32 fontSize); + uint32 getFontSize() const; + void setEmbolden(bool b); + bool getEmbolden() const; + void setOblique(bool b); + bool getOblique() const; + void setHotSpot(THotSpot hotSpot); + THotSpot getHotSpot() const; + void setScaleX(float scaleX); + void setScaleY(float scaleY); + float getScaleX() const; + float getScaleY() const; + void setShaded(bool b); + bool getShaded() const; + void setShadeOutline(bool b); + bool getShadeOutline() const; + void setShadeExtent(float x, float y); + void setShadeColor (NLMISC::CRGBA sc); + NLMISC::CRGBA getShadeColor () const; void setKeep800x600Ratio(bool keep); bool getKeep800x600Ratio() const; // @} diff --git a/code/nel/include/nel/3d/texture.h b/code/nel/include/nel/3d/texture.h index bb9b9165a..5b8e7ef37 100644 --- a/code/nel/include/nel/3d/texture.h +++ b/code/nel/include/nel/3d/texture.h @@ -359,7 +359,7 @@ public: virtual bool allowDegradation() const { return false; } /// serial ITexture basic infos (clamp ...). - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); /** Select a texture among several other (if this texture is a set of texture such as CTextureMultiFile) * The default does nothing diff --git a/code/nel/include/nel/3d/texture_blend.h b/code/nel/include/nel/3d/texture_blend.h index 7a910d91e..5dcc7c6ea 100644 --- a/code/nel/include/nel/3d/texture_blend.h +++ b/code/nel/include/nel/3d/texture_blend.h @@ -74,7 +74,7 @@ public: virtual void release(); // serial this texture datas - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); private: uint16 _BlendFactor; diff --git a/code/nel/include/nel/3d/texture_bump.h b/code/nel/include/nel/3d/texture_bump.h index 7e4a099c9..1fb6152de 100644 --- a/code/nel/include/nel/3d/texture_bump.h +++ b/code/nel/include/nel/3d/texture_bump.h @@ -47,7 +47,7 @@ public: const ITexture *getHeightMap() const { return _HeightMap; }; // serial this texture datas - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); virtual bool supportSharing() const; diff --git a/code/nel/include/nel/3d/texture_cube.h b/code/nel/include/nel/3d/texture_cube.h index 979defa1c..4958f6628 100644 --- a/code/nel/include/nel/3d/texture_cube.h +++ b/code/nel/include/nel/3d/texture_cube.h @@ -77,7 +77,7 @@ public: virtual bool isTextureCube() const { return true; } /// Save the texture file name. - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CTextureCube); /// If the face support multiple texture (such has CTextureMultiFile), this allow to select the active set diff --git a/code/nel/include/nel/3d/texture_dlm.h b/code/nel/include/nel/3d/texture_dlm.h index 18cf125a0..0c16d95f6 100644 --- a/code/nel/include/nel/3d/texture_dlm.h +++ b/code/nel/include/nel/3d/texture_dlm.h @@ -81,7 +81,7 @@ public: /// TextureDLM are system. Do not need to serialize them... // default ctor is required for compilation with NLMISC_DECLARE_CLASS, but never called... CTextureDLM() {nlstop;} - virtual void serial(NLMISC::IStream &/* f */) throw(NLMISC::EStream) {nlstop;} + virtual void serial(NLMISC::IStream &/* f */) {nlstop;} NLMISC_DECLARE_CLASS(CTextureDLM); diff --git a/code/nel/include/nel/3d/texture_emboss.h b/code/nel/include/nel/3d/texture_emboss.h index a4c469a5c..fed99f52a 100644 --- a/code/nel/include/nel/3d/texture_emboss.h +++ b/code/nel/include/nel/3d/texture_emboss.h @@ -46,7 +46,7 @@ public: const ITexture *getHeightMap() const { return _HeightMap; }; // serial this texture datas - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); virtual bool supportSharing() const; virtual std::string getShareName() const; // @@ -54,16 +54,16 @@ public: bool isSharingEnabled() const { return !_DisableSharing; } // set the ambiant/ diffuse color to be added to the embossed texture - void setAmbient(CRGBA ambient) { _Ambient = ambient; touch(); } - void setDiffuse(CRGBA diffuse) { _Diffuse = diffuse; touch(); } + void setAmbient(NLMISC::CRGBA ambient) { _Ambient = ambient; touch(); } + void setDiffuse(NLMISC::CRGBA diffuse) { _Diffuse = diffuse; touch(); } // Set the direction of light (usually should be normalized). The bitmap is in the x,y plane void setLightDir(const NLMISC::CVector &lightDir) { _LightDir = lightDir; touch(); } // set a factor for the slope void setSlopeFactor(float factor) { _SlopeFactor = factor; touch(); } // - CRGBA getAmbient() const { return _Ambient; } - CRGBA getDiffuse() const { return _Diffuse; } - const CVector &getLightDir() const { return _LightDir; } + NLMISC::CRGBA getAmbient() const { return _Ambient; } + NLMISC::CRGBA getDiffuse() const { return _Diffuse; } + const NLMISC::CVector &getLightDir() const { return _LightDir; } float getSlopeFactor() const { return _SlopeFactor; } @@ -75,8 +75,8 @@ protected: // inherited from ITexture. Generate this bumpmap pixels virtual void doGenerate(bool async = false); NLMISC::CSmartPtr _HeightMap; - CRGBA _Ambient; - CRGBA _Diffuse; + NLMISC::CRGBA _Ambient; + NLMISC::CRGBA _Diffuse; NLMISC::CVector _LightDir; bool _DisableSharing; float _SlopeFactor; diff --git a/code/nel/include/nel/3d/texture_far.h b/code/nel/include/nel/3d/texture_far.h index a55308b19..6fdb59f30 100644 --- a/code/nel/include/nel/3d/texture_far.h +++ b/code/nel/include/nel/3d/texture_far.h @@ -185,7 +185,7 @@ private: void rebuildPatch (const CVector2s texturePos, const CPatchIdent &pid); /// From IStreamable - virtual void serial(NLMISC::IStream &/* f */) throw(NLMISC::EStream) {} + virtual void serial(NLMISC::IStream &/* f */) {} // Some static buffers static NLMISC::CRGBA _LightmapExpanded[]; diff --git a/code/nel/include/nel/3d/texture_file.h b/code/nel/include/nel/3d/texture_file.h index c758b1d6c..6f3620f47 100644 --- a/code/nel/include/nel/3d/texture_file.h +++ b/code/nel/include/nel/3d/texture_file.h @@ -122,7 +122,7 @@ public: void doGenerate(bool async = false); /// Save the texture file name. - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CTextureFile); diff --git a/code/nel/include/nel/3d/texture_font.h b/code/nel/include/nel/3d/texture_font.h index 98e94c82f..865615b63 100644 --- a/code/nel/include/nel/3d/texture_font.h +++ b/code/nel/include/nel/3d/texture_font.h @@ -18,6 +18,7 @@ #define NL_TEXTURE_FONT_H #include "nel/misc/types_nl.h" +#include "nel/misc/rect.h" #include "nel/3d/texture.h" namespace NL3D @@ -25,9 +26,6 @@ namespace NL3D class CFontGenerator; -#define TEXTUREFONT_NBCATEGORY 5 // Config 1 -//#define TEXTUREFONT_NBCATEGORY 4 - // **************************************************************************** /** * CTextureFont @@ -37,39 +35,77 @@ class CTextureFont : public ITexture public: - struct SLetterInfo + // Holds info for glyphs rendered on atlas + struct SGlyphInfo { - // To generate the letter - ucchar Char; - CFontGenerator *FontGenerator; - sint Size; + // font atlas info + uint32 CacheVersion; + // atlas region with padding + uint32 X, Y, W, H; - // The less recently used infos - SLetterInfo *Next, *Prev; + // rendered glyph size without padding + uint32 CharWidth; + uint32 CharHeight; - uint Cat; // 8x8, 16x16, 24x24, 32x32 + // UV coords for rendered glyph without padding + float U0, V0, U1, V1; - ////////////////////////////////////////////////////////////////////// + uint32 GlyphIndex; + sint Size; + bool Embolden; + bool Oblique; + CFontGenerator *FontGenerator; - float U ,V; - uint32 CharWidth; - uint32 CharHeight; - uint32 GlyphIndex; // number of the character in the this font + SGlyphInfo() + : CacheVersion(0), + U0(0.f), V0(0.f), U1(0.f), V1(0.f), + X(0), Y(0), W(0), H(0), CharWidth(0), CharHeight(0), + GlyphIndex(0), Size(0), Embolden(false), Oblique(false), FontGenerator(NULL) + { + } + }; + + // Holds info for glyphs displayed on screen + struct SLetterInfo + { + ucchar Char; + sint Size; + bool Embolden; + bool Oblique; + CFontGenerator *FontGenerator; + + uint32 GlyphIndex; + uint32 CharWidth; // Displayed glyph height + uint32 CharHeight; // Displayed glyph height sint32 Top; // Distance between origin and top of the texture sint32 Left; // Distance between origin and left of the texture sint32 AdvX; // Advance to the next caracter + + SGlyphInfo* glyph; + + SLetterInfo() + : Char(0), Size(0), Embolden(false), Oblique(false), FontGenerator(NULL), + GlyphIndex(0), CharWidth(0), CharHeight(0), Top(0), Left(0), AdvX(0), + glyph(NULL) + { + } }; struct SLetterKey { ucchar Char; - CFontGenerator *FontGenerator; sint Size; + bool Embolden; + bool Oblique; + CFontGenerator *FontGenerator; + // Does not use FontGenerator in return value uint32 getVal(); - //bool operator < (const SLetterKey&k) const; - //bool operator == (const SLetterKey&k) const; + + SLetterKey():Char(0), FontGenerator(NULL), Size(0), Embolden(false), Oblique(false) + { + } }; public: @@ -84,23 +120,80 @@ public: void doGenerate (bool async = false); // This function manage the cache if the letter wanted does not exist - SLetterInfo* getLetterInfo (SLetterKey& k); + // \param render Set to true if letter is currently visible on screen + SLetterInfo* getLetterInfo (SLetterKey& k, bool render); void dumpTextureFont (const char *filename); + // Version is increased with each rebuild of font atlas + uint32 getCacheVersion() const { return _CacheVersion; } + private: + uint32 _CacheVersion; + + // current texture size + uint32 _TextureSizeX; + uint32 _TextureSizeY; + + // maximum texture size allowed + uint32 _TextureMaxW; + uint32 _TextureMaxH; + + // padding around glyphs + uint8 _PaddingL, _PaddingT; + uint8 _PaddingR, _PaddingB; // To find a letter in the texture - std::map Accel; - std::vector Letters[TEXTUREFONT_NBCATEGORY]; - SLetterInfo *Front[TEXTUREFONT_NBCATEGORY], *Back[TEXTUREFONT_NBCATEGORY]; + // Keep track of available space in main texture + std::vector _AtlasNodes; + + std::vector _Letters; + + // lookup letter from letter cache or create new + SLetterInfo* findLetter(SLetterKey& k, bool insert); + + // lower/upper bound of glyphs to render, sizes outside are scaled bitmaps + uint _MinGlyphSize; + uint _MaxGlyphSize; + // start using size stem from this font size + uint _GlyphSizeStepMin; + // every n'th font size is rendered, intermediates are using bitmap scaling + uint _GlyphSizeStep; + + // rendered glyph cache + std::list _GlyphCache; + SGlyphInfo* findLetterGlyph(SLetterInfo *letter, bool insert); + + // render letter glyph into glyph cache + SGlyphInfo* renderLetterGlyph(SLetterInfo *letter, uint32 bitmapFontSize); + + // copy glyph bitmap into texture and invalidate that region + void copyGlyphBitmap(uint8* bitmap, uint32 bitmapW, uint32 bitmapH, uint32 atlasX, uint32 atlasY); + + // Find best fit for WxH rect in atlas + uint fitRegion(uint index, uint width, uint height); + + // Return top/left from font texture or false if there is no more room + bool reserveAtlas(const uint32 width, const uint32 height, uint32 &x, uint32 &y); + + // repack glyphs, resize texture, and invalidate unused glyphs. + void repackAtlas(); + void repackAtlas(uint32 width, uint32 height); + + // resize texture, + bool resizeAtlas(); + + // remove all glyphs from atlas, clear glyph cache, letter info is kept + void clearAtlas(); - void rebuildLetter (sint cat, sint x, sint y); + // if return true: newW, newH contains next size font atlas should be resized + // if return false: _TextureMaxW and _TextureMaxH is reached + bool getNextTextureSize(uint32 &newW, uint32 &newH) const; /// Todo: serialize a font texture. public: - virtual void serial(NLMISC::IStream &/* f */) throw(NLMISC::EStream) {nlstop;} + virtual void serial(NLMISC::IStream &/* f */) {nlstop;} NLMISC_DECLARE_CLASS(CTextureFont); }; diff --git a/code/nel/include/nel/3d/texture_grouped.h b/code/nel/include/nel/3d/texture_grouped.h index 247dd455a..f6f9515a0 100644 --- a/code/nel/include/nel/3d/texture_grouped.h +++ b/code/nel/include/nel/3d/texture_grouped.h @@ -111,7 +111,7 @@ public: void doGenerate(bool async = false); /// serialization - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); /// a group of 4 uvs diff --git a/code/nel/include/nel/3d/texture_mem.h b/code/nel/include/nel/3d/texture_mem.h index 01ea393f1..d28218151 100644 --- a/code/nel/include/nel/3d/texture_mem.h +++ b/code/nel/include/nel/3d/texture_mem.h @@ -160,7 +160,7 @@ public: void setAllowDegradation(bool allow); /// Todo: serialize a mem texture. - virtual void serial(NLMISC::IStream &/* f */) throw(NLMISC::EStream) {nlstop;} + virtual void serial(NLMISC::IStream &/* f */) {nlstop;} NLMISC_DECLARE_CLASS(CTextureMem); /** This create a white square texture of 1x1 diff --git a/code/nel/include/nel/3d/texture_multi_file.h b/code/nel/include/nel/3d/texture_multi_file.h index 37549b997..a32207995 100644 --- a/code/nel/include/nel/3d/texture_multi_file.h +++ b/code/nel/include/nel/3d/texture_multi_file.h @@ -70,7 +70,7 @@ public: /// Generate the current selected texture, looking in CPath if necessary. virtual void doGenerate(bool async = false); /// Serial this object - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CTextureMultiFile); private: diff --git a/code/nel/include/nel/3d/texture_near.h b/code/nel/include/nel/3d/texture_near.h index 5a124b53b..0c47ecec7 100644 --- a/code/nel/include/nel/3d/texture_near.h +++ b/code/nel/include/nel/3d/texture_near.h @@ -77,7 +77,7 @@ public: /// TextureNear are system. Do not need to serialize them... // default ctor is required for compilation with NLMISC_DECLARE_CLASS, but never called... CTextureNear() {nlstop;} - virtual void serial(NLMISC::IStream &/* f */) throw(NLMISC::EStream) {nlstop;} + virtual void serial(NLMISC::IStream &/* f */) {nlstop;} NLMISC_DECLARE_CLASS(CTextureNear); private: diff --git a/code/nel/include/nel/3d/tile_bank.h b/code/nel/include/nel/3d/tile_bank.h index 00e0f2cae..7d4eda3a7 100644 --- a/code/nel/include/nel/3d/tile_bank.h +++ b/code/nel/include/nel/3d/tile_bank.h @@ -20,6 +20,7 @@ #include "nel/misc/debug.h" #include "nel/misc/stream.h" #include "nel/misc/rgba.h" +#include "nel/misc/path.h" #include #include #include @@ -76,14 +77,14 @@ public: { return (_Flags&NL3D_CTILE_FREE_FLAG)!=0; } - void serial(class NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); void setFileName (TBitmap bitmapType, const std::string& name) { // not free _Flags&=~NL3D_CTILE_FREE_FLAG; - // set filename - _BitmapName[bitmapType]=name; + // set filename, replacing \\ by / if needed + _BitmapName[bitmapType] = NLMISC::CPath::standardizePath(name, false); } std::string getFileName (TBitmap bitmapType) const @@ -139,7 +140,7 @@ public: private: void clearTile (CTile::TBitmap type); - void free () + void freeBlock () { nlassert ((_Flags&=NL3D_CTILE_FREE_FLAG)==0); _Flags|=NL3D_CTILE_FREE_FLAG; @@ -179,7 +180,7 @@ public: void clear(){ _TileSet.clear(); } - void serial(class NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); private: // internal use @@ -209,7 +210,7 @@ public: { return _Tile; } - void serial(class NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); private: sint32 _Tile; @@ -235,7 +236,7 @@ public: void doubleSize (); bool operator== (const CTileBorder& border) const; void operator= (const CTileBorder& border); - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); bool isSet() const { return _Set; @@ -319,7 +320,7 @@ public: // For edition: change the tileVegetableDesc. NB: only the TileVegetableDescFileName is serialised. void setTileVegetableDesc (const CTileVegetableDesc &tvd); /** try to load the vegetable tile desc associated with the fileName (nlinfo() if can't) - * lookup into CPath. no-op if string=="". + * lookup into CPath. no-op if string empty */ void loadTileVegetableDesc(); @@ -415,7 +416,7 @@ public: { return _ChildName.find(name)!=_ChildName.end(); } - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); private: static TFlagBorder getComplementaryBorder (TFlagBorder border); @@ -628,7 +629,7 @@ public: /// Postfix tile vegetable desc void postfixTileVegetableDesc (const char *filename); - void serial(class NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); private: sint createTile (); void freeTile (int tileIndex); diff --git a/code/nel/include/nel/3d/tile_far_bank.h b/code/nel/include/nel/3d/tile_far_bank.h index 35c04be8b..52f380439 100644 --- a/code/nel/include/nel/3d/tile_far_bank.h +++ b/code/nel/include/nel/3d/tile_far_bank.h @@ -94,7 +94,7 @@ public: } /// Serial this tile - void serial (class NLMISC::IStream &f) throw(NLMISC::EStream); + void serial (NLMISC::IStream &f); private: /// RGBA Pixels vector @@ -141,7 +141,7 @@ public: } /// Serial this bank - void serial(class NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); /// The far tile vector std::vector _TileVector; diff --git a/code/nel/include/nel/3d/track.h b/code/nel/include/nel/3d/track.h index e3c88f800..1ef8a4f1e 100644 --- a/code/nel/include/nel/3d/track.h +++ b/code/nel/include/nel/3d/track.h @@ -166,7 +166,7 @@ public: /// Serial the template - virtual void serial (NLMISC::IStream& f) throw (NLMISC::EStream) + virtual void serial (NLMISC::IStream& f) { // Serial version (void)f.serialVersion (0); @@ -217,7 +217,7 @@ public: /// Serial the template - virtual void serial (NLMISC::IStream& f) throw (NLMISC::EStream) + virtual void serial (NLMISC::IStream& f) { // Serial version (void)f.serialVersion (0); diff --git a/code/nel/include/nel/3d/track_keyframer.h b/code/nel/include/nel/3d/track_keyframer.h index 6cfb6736a..c49e63404 100644 --- a/code/nel/include/nel/3d/track_keyframer.h +++ b/code/nel/include/nel/3d/track_keyframer.h @@ -237,7 +237,7 @@ public: /// Serial the template - virtual void serial (NLMISC::IStream& f) throw (NLMISC::EStream) + virtual void serial (NLMISC::IStream& f) { // Serial version (void)f.serialVersion (0); diff --git a/code/nel/include/nel/3d/track_tcb.h b/code/nel/include/nel/3d/track_tcb.h index e91cfb397..153dcbc54 100644 --- a/code/nel/include/nel/3d/track_tcb.h +++ b/code/nel/include/nel/3d/track_tcb.h @@ -218,7 +218,7 @@ protected: date*= previous->OODeltaTime; NLMISC::clamp(date, 0,1); - date = this->ease(previous, date); + date = this->ease(previous, (float)date); float hb[4]; this->computeHermiteBasis(date, hb); diff --git a/code/nel/include/nel/3d/u_driver.h b/code/nel/include/nel/3d/u_driver.h index 67e0c30fd..0500192ad 100644 --- a/code/nel/include/nel/3d/u_driver.h +++ b/code/nel/include/nel/3d/u_driver.h @@ -35,9 +35,6 @@ namespace NLMISC { - struct IMouseDevice; - struct IKeyboardDevice; - struct IInputDeviceManager; class CLog; } @@ -63,6 +60,7 @@ class U3dMouseListener; class ULight; class UAnimationSet; class UWaterEnvMap; +class CRenderTargetManager; typedef void (*emptyProc)(void); @@ -94,6 +92,7 @@ public: /// A Graphic Mode descriptor. struct CMode { + std::string DisplayDevice; bool Windowed; uint16 Width; uint16 Height; @@ -110,8 +109,9 @@ public: Frequency = 0; AntiAlias = -1; } - CMode(uint16 w, uint16 h, uint8 d, bool windowed= true, uint frequency = 0, sint8 aa = -1) + CMode(uint16 w, uint16 h, uint8 d, bool windowed= true, uint frequency = 0, sint8 aa = -1, const std::string &displayDevice = std::string()) { + DisplayDevice = displayDevice; Windowed = windowed; Width = w; Height = h; @@ -309,6 +309,16 @@ public: // @} + /// Get the render target manager + virtual CRenderTargetManager &getRenderTargetManager() =0; + + /// Set a texture of specified size or of the size of the window as render target + virtual void beginDefaultRenderTarget(uint32 width = 0, uint32 height = 0) =0; + + /// Draw the render target to the back buffer + virtual void endDefaultRenderTarget(UScene *scene) =0; + + /// \name Components gestion for Interface 2D/3D. // @{ @@ -495,6 +505,12 @@ public: */ virtual const char* getVideocardInformation () = 0; + /** + * Get total video memory. + * get the amount of video memory of current adapter, result is in KiB, -1 if unable to determine + */ + virtual sint getTotalVideoMemory () const = 0; + /// Get the number of texture stage available, for multitexturing (Normal material shaders). Valid only after setDisplay(). virtual uint getNbTextureStages() = 0; @@ -556,36 +572,6 @@ public: /// \name Mouse / Keyboard / Gamedevices // @{ - /** Enable / disable low level mouse. This allow to take advantage of some options (speed of the mouse, automatic wrapping) - * It returns a interface to these parameters when it is supported, or NULL otherwise - * The interface pointer is valid as long as the low level mouse is enabled. - * A call to disable the mouse returns NULL, and restore the default mouse behaviour - * NB : - In this mode the mouse cursor isn't drawn. - * - Calls to showCursor have no effects - * - Calls to setCapture have no effects - */ - virtual NLMISC::IMouseDevice *enableLowLevelMouse(bool enable, bool hardware) = 0; - - /** Enable / disable a low level keyboard. - * This returns a interface to some parameters when it is supported, or NULL otherwise. - * The interface pointer is valid as long as the low level keyboard is enabled. - * A call to disable the keyboard returns NULL, and restore the default keyboard behaviour. - */ - virtual NLMISC::IKeyboardDevice *enableLowLevelKeyboard(bool enable) = 0; - - /** Check whether there is a low level device manager available, and get its interface. Return NULL if not available. - * From this interface you can deal with mouse and keyboard as above, but you can also manage game devices (joysticks, joypads ...) - */ - virtual NLMISC::IInputDeviceManager *getLowLevelInputDeviceManager() = 0; - - /** - * wrapper for IEventEmitter::emulateMouseRawMode() - */ - virtual void emulateMouseRawMode(bool enable) = 0; - - // get delay used for mouse double click - virtual uint getDoubleClickDelay(bool hardwareMouse) = 0; - /** show cursor if b is true, or hide it if b is false * NB: This has no effects if a low level mouse is used. */ @@ -666,6 +652,16 @@ public: */ virtual void setAnisotropicFilter(sint filter)=0; + /** + * Get current anisotropic filter value + */ + virtual uint getAnisotropicFilter() const = 0; + + /** + * Get maximum anisotropic filter value + */ + virtual uint getAnisotropicFilterMaximum() const = 0; + /** if !=1, force mostly all the textures (but TextureFonts lightmaps, interfaces etc..) * to be divided by Divisor (2, 4, 8...) * Default is 1. diff --git a/code/nel/include/nel/3d/u_scene.h b/code/nel/include/nel/3d/u_scene.h index d60266afe..c0733c5d2 100644 --- a/code/nel/include/nel/3d/u_scene.h +++ b/code/nel/include/nel/3d/u_scene.h @@ -134,14 +134,17 @@ public: /** Render a part (see render() for what it does) * beginPartRender() must have been called * \param renderPart a combination of UScene::TRenderPart flags, allow to choose which part of the scene must be rendered + * \param doHrcPass set it to false to indicate that the CHrcTrav have not to be traversed. Useful to optimize if + * you know that NONE of your models have moved (a good example is a shoot of the scene from different cameras). + * \param doTrav set to false when processing a second frame for stereo rending to avoid unnecessary traversals. * WARNING: always must begin rendering with at least UScene::RenderOpaque, else shadows won't work * WARNING: assert-crash if a part in 'rp' has already been rendered since the last beginPartRender() */ - virtual void renderPart(UScene::TRenderPart rp) =0; + virtual void renderPart(UScene::TRenderPart rp, bool doHrcPass = true, bool doTrav = true, bool keepTrav = false) =0; /** End Part Rendering (commit model creation and deletion that were asked during rendering) */ - virtual void endPartRender(bool updateWaitingInstances = true, bool restoreMatrixContextAfterRender = true) =0; + virtual void endPartRender(bool updateWaitingInstances = true, bool restoreMatrixContextAfterRender = true, bool keepTrav = false) =0; /** Update waiting instances and igs that are loaded asynchronously diff --git a/code/nel/include/nel/3d/u_text_context.h b/code/nel/include/nel/3d/u_text_context.h index dcaa1949a..4c1dfea47 100644 --- a/code/nel/include/nel/3d/u_text_context.h +++ b/code/nel/include/nel/3d/u_text_context.h @@ -137,6 +137,24 @@ public: * \return the font size */ virtual uint32 getFontSize () const = 0; + /** + * set embolden (bold) state + * \param embolden the embbolden state + */ + virtual void setEmbolden (bool b) = 0; + /** + * \return the embolden state + */ + virtual bool getEmbolden () const = 0; + /** + * set oblique (italic) state + * \param oblique the oblique state + */ + virtual void setOblique (bool b) = 0; + /** + * \return the oblique state + */ + virtual bool getOblique () const = 0; /** * set the hot spot * \param fonSize the font size @@ -174,11 +192,20 @@ public: * \return the shade state */ virtual bool getShaded () const = 0; + /** + * set the shade states + * \param the shade state + */ + virtual void setShadeOutline (bool b) = 0; + /** + * \return the shade state + */ + virtual bool getShadeOutline () const = 0; /** * set the shadow's size * \param the shade extent */ - virtual void setShadeExtent (float shext) = 0; + virtual void setShadeExtent (float x, float y) = 0; /** * set the shadow's color * The alpha of the shade is multiplied at each draw with the alpha of the color. Default: (0,0,0,255) diff --git a/code/nel/include/nel/3d/u_transform.h b/code/nel/include/nel/3d/u_transform.h index 556be7908..66315fa40 100644 --- a/code/nel/include/nel/3d/u_transform.h +++ b/code/nel/include/nel/3d/u_transform.h @@ -32,6 +32,7 @@ using NLMISC::CQuat; class ILogicInfo; class CCluster; +class ITransformable; // *************************************************************************** /** diff --git a/code/nel/include/nel/3d/vegetable_light_ex.h b/code/nel/include/nel/3d/vegetable_light_ex.h index a513dbeab..d9c1f2f0b 100644 --- a/code/nel/include/nel/3d/vegetable_light_ex.h +++ b/code/nel/include/nel/3d/vegetable_light_ex.h @@ -48,7 +48,7 @@ public: /// PointLights. Used at CVegetableManager::updateLighting() to get current colors of pointLights. CPointLightNamed *PointLight[MaxNumLight]; /// Direction of the light. the direction to the instance should be precomputed. - CVector Direction[MaxNumLight]; + NLMISC::CVector Direction[MaxNumLight]; /// Factor to be multiplied by color of the light. Actually it is the attenuation factor. uint PointLightFactor[MaxNumLight]; diff --git a/code/nel/include/nel/3d/vertex_buffer.h b/code/nel/include/nel/3d/vertex_buffer.h index 6c269ec6c..1f1c789ae 100644 --- a/code/nel/include/nel/3d/vertex_buffer.h +++ b/code/nel/include/nel/3d/vertex_buffer.h @@ -653,7 +653,7 @@ private: void resetTouchFlags() {_InternalFlags &= (uint16)(~TouchedAll);} // Force non resident memory - void restaureNonResidentMemory(); + void restoreNonResidentMemory(); private: diff --git a/code/nel/include/nel/3d/vertex_buffer_heap.h b/code/nel/include/nel/3d/vertex_buffer_heap.h index c87426f7b..009d72489 100644 --- a/code/nel/include/nel/3d/vertex_buffer_heap.h +++ b/code/nel/include/nel/3d/vertex_buffer_heap.h @@ -69,7 +69,7 @@ public: bool allocate(uint numVertices, uint &indexStart); /// free a subset of the VB. nlstop if subset not found... - void free(uint indexStart); + void freeBlock(uint indexStart); // @} diff --git a/code/nel/include/nel/3d/water_env_map.h b/code/nel/include/nel/3d/water_env_map.h index 50fca18ec..2282610d7 100644 --- a/code/nel/include/nel/3d/water_env_map.h +++ b/code/nel/include/nel/3d/water_env_map.h @@ -21,6 +21,7 @@ // #include "nel/3d/texture_cube.h" #include "nel/3d/texture_blank.h" +#include "nel/3d/animation_time.h" namespace NL3D diff --git a/code/nel/include/nel/3d/water_height_map.h b/code/nel/include/nel/3d/water_height_map.h index f705c0368..003aaac53 100644 --- a/code/nel/include/nel/3d/water_height_map.h +++ b/code/nel/include/nel/3d/water_height_map.h @@ -79,7 +79,7 @@ public: /** Set the userPos (relative to the height map coordinates). This is needed because a height map can't be used with large surface (such as a sea). * As a consequence, the height map is only valid below the user (e.g from user.x - 0.5 * size to user.x + 0.5 *size). - * When setPos is called, and if a move has occured, new area of the height field are set to 0 + * When setPos is called, and if a move has occurred, new area of the height field are set to 0 * The pos set will be taken in account when buffers have been swapped (e.g when the propagation time as ellapsed) */ void setUserPos(sint x, sint y); @@ -168,7 +168,7 @@ public: sint64 Date; /// serial the pools data's - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); /// Set this pool name. void setName(const std::string &name) { _Name = name; } diff --git a/code/nel/include/nel/3d/water_pool_manager.h b/code/nel/include/nel/3d/water_pool_manager.h index 569b5d59a..c8a0885c9 100644 --- a/code/nel/include/nel/3d/water_pool_manager.h +++ b/code/nel/include/nel/3d/water_pool_manager.h @@ -97,7 +97,7 @@ public: /// serial the pools data's - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); private: friend class CWaterShape; diff --git a/code/nel/include/nel/3d/water_shape.h b/code/nel/include/nel/3d/water_shape.h index dc7f20426..633da8611 100644 --- a/code/nel/include/nel/3d/water_shape.h +++ b/code/nel/include/nel/3d/water_shape.h @@ -108,7 +108,7 @@ public: /// serial this shape - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); //@} @@ -299,7 +299,7 @@ public: /// serial this shape - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); //@} diff --git a/code/nel/include/nel/3d/zone.h b/code/nel/include/nel/3d/zone.h index 9c60013a8..4aaaea53b 100644 --- a/code/nel/include/nel/3d/zone.h +++ b/code/nel/include/nel/3d/zone.h @@ -163,7 +163,7 @@ public: /** There is (OrderS/2+1) * (OrderT/2+1) tiles light influence. * It indicates which static pointLight influence each corner of a TessBlock (block of 2*2 tiles). * - * If size()==0, suppose no light influence. but CZone::retrieve() always return a + * If empty(), suppose no light influence. but CZone::retrieve() always return a * size() == (OrderS/2+1) * (OrderT/2+1). * * They are stored in line first order, from S=0 to 1, and T=0 to 1. diff --git a/code/nel/include/nel/CMakeLists.txt b/code/nel/include/nel/CMakeLists.txt index b695104ae..4df9413b5 100644 --- a/code/nel/include/nel/CMakeLists.txt +++ b/code/nel/include/nel/CMakeLists.txt @@ -2,36 +2,36 @@ SUBDIRS(misc) IF(WITH_3D) SUBDIRS(3d) -ENDIF(WITH_3D) +ENDIF() IF(WITH_GUI) ADD_SUBDIRECTORY(gui) -ENDIF(WITH_GUI) +ENDIF() IF(WITH_GEORGES) SUBDIRS(georges) -ENDIF(WITH_GEORGES) +ENDIF() IF(WITH_LIGO) SUBDIRS(ligo) -ENDIF(WITH_LIGO) +ENDIF() IF(WITH_LOGIC) SUBDIRS(logic) -ENDIF(WITH_LOGIC) +ENDIF() IF(WITH_NET) SUBDIRS(net) -ENDIF(WITH_NET) +ENDIF() IF(WITH_SOUND) SUBDIRS(sound) -ENDIF(WITH_SOUND) +ENDIF() IF(WITH_PACS) SUBDIRS(pacs) -ENDIF(WITH_PACS) +ENDIF() IF(WITH_NEL_CEGUI) SUBDIRS(cegui) -ENDIF(WITH_NEL_CEGUI) +ENDIF() diff --git a/code/nel/include/nel/georges/form.h b/code/nel/include/nel/georges/form.h index d2b6a2f2d..da5c0ea88 100644 --- a/code/nel/include/nel/georges/form.h +++ b/code/nel/include/nel/georges/form.h @@ -22,7 +22,7 @@ #include "form_elm.h" #include "header.h" -extern bool convertFormFile (const char *oldFileName, const char *newFileName); +extern bool convertFormFile (const std::string &oldFileName, const std::string &newFileName); namespace NLGEORGES { @@ -35,7 +35,7 @@ class UFormElm; class CForm : public UForm { friend class CFormLoader; - friend bool convertFormFile (const char *oldFileName, const char *newFileName); + friend bool convertFormFile (const std::string &oldFileName, const std::string &newFileName); public: enum { HeldElementCount = 4 }; @@ -73,12 +73,12 @@ public: // ** IO functions // Set the filename before saving the form - void write (xmlDocPtr doc, const char *filename); + void write (xmlDocPtr doc, const std::string &filename); // ** Parent access // Insert parent before parent indexed "before". - bool insertParent (uint before, const char *filename, CForm *parent); + bool insertParent (uint before, const std::string &filename, CForm *parent); // Remove a parent from parent list void removeParent (uint parent); @@ -97,7 +97,7 @@ public: const std::string &getFilename () const; // Error handling - void warning (bool exception, const char *function, const char *format, ... ) const; + void warning (bool exception, const std::string &function, const char *format, ... ) const; private: @@ -114,7 +114,7 @@ private: // CFormLoader call it // Set the filename before reading the form - void read (xmlNodePtr node, CFormLoader &loader, CFormDfn *dfn, const char *filename); + void read (xmlNodePtr node, CFormLoader &loader, CFormDfn *dfn, const std::string &filename); // Called by read void readParent (const char *parent, CFormLoader &loader); diff --git a/code/nel/include/nel/georges/form_dfn.h b/code/nel/include/nel/georges/form_dfn.h index a93dcbe48..4e9870043 100644 --- a/code/nel/include/nel/georges/form_dfn.h +++ b/code/nel/include/nel/georges/form_dfn.h @@ -24,7 +24,7 @@ #include "header.h" #include "type.h" -bool convertDfnFile (const char *oldFileName, const char *newFileName); +bool convertDfnFile (const std::string &oldFileName, const std::string &newFileName); namespace NLGEORGES { @@ -41,7 +41,7 @@ class CFormDfn : public UFormDfn friend class CFormElm; friend class CFormLoader; friend class CFormElmStruct; - friend bool convertDfnFile (const char *oldFileName, const char *newFileName); + friend bool convertDfnFile (const std::string &oldFileName, const std::string &newFileName); public: // Default cstr @@ -60,7 +60,7 @@ public: friend class CFormElm; friend class CFormDfn; friend class CFormElmStruct; - friend bool convertDfnFile (const char *oldFileName, const char *newFileName); + friend bool convertDfnFile (const std::string &oldFileName, const std::string &newFileName); public: CEntry () @@ -85,12 +85,12 @@ public: TEntryType getType () const; // Set as a type - void setType (CFormLoader &loader, const char *filename); + void setType (CFormLoader &loader, const std::string &filename); void setType (TEntryType type); // Set as a dfn - void setDfn (CFormLoader &loader, const char *filename); + void setDfn (CFormLoader &loader, const std::string &filename); // Set as a dfn pointer void setDfnPointer (); @@ -99,7 +99,7 @@ public: const std::string &getName () const; // Set element Name - void setName (const char *name); + void setName (const std::string &name); // Get the filename const std::string &getFilename() const; @@ -108,16 +108,16 @@ public: const std::string &getFilenameExt() const; // Set the filename - void setFilename (const char *def); + void setFilename (const std::string &def); // Set the filename extension - void setFilenameExt (const char *ext); + void setFilenameExt (const std::string &ext); // Get default value const std::string &getDefault () const; // Set default value - void setDefault (const char *def); + void setDefault (const std::string &def); // Set array flag void setArrayFlag (bool flag); @@ -167,7 +167,7 @@ public: void removeEntry( uint idx ); // ** IO functions - void write (xmlDocPtr root, const char *filename); + void write (xmlDocPtr root, const std::string &filename); // Count parent DFN uint countParentDfn (uint32 round=0) const; @@ -185,7 +185,7 @@ public: void setNumParent (uint size); // Set a parent - void setParent (uint parent, CFormLoader &loader, const char *filename); + void setParent (uint parent, CFormLoader &loader, const std::string &filename); // Get a parent CFormDfn *getParent (uint parent) const; @@ -232,7 +232,7 @@ public: CFileHeader Header; // Error handling - void warning (bool exception, const char *function, const char *format, ... ) const; + void warning (bool exception, const std::string &function, const char *format, ... ) const; private: // The parents array @@ -249,7 +249,7 @@ private: private: // Read method called by the form loader - void read (xmlNodePtr doc, CFormLoader &loader, bool forceLoad, const char *filename); + void read (xmlNodePtr doc, CFormLoader &loader, bool forceLoad, const std::string &filename); }; } // NLGEORGES diff --git a/code/nel/include/nel/georges/form_elm.h b/code/nel/include/nel/georges/form_elm.h index 2d9e76630..738e6a55a 100644 --- a/code/nel/include/nel/georges/form_elm.h +++ b/code/nel/include/nel/georges/form_elm.h @@ -62,30 +62,30 @@ public: virtual void getFormName (std::string &result, const CFormElm *child=NULL) const = 0; // From UFormElm - virtual bool getNodeByName (const UFormElm **result, const char *name, TWhereIsNode *where, bool verbose, uint32 round=0) const; - virtual bool getNodeByName (UFormElm **result, const char *name, TWhereIsNode *where, bool verbose, uint32 round=0); - virtual bool getValueByName (std::string &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; - virtual bool getValueByName (sint8 &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; - virtual bool getValueByName (uint8 &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; - virtual bool getValueByName (sint16 &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; - virtual bool getValueByName (uint16 &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; - virtual bool getValueByName (sint32 &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; - virtual bool getValueByName (uint32 &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; - virtual bool getValueByName (float &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; - virtual bool getValueByName (double &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; - virtual bool getValueByName (bool &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; - virtual bool getValueByName (NLMISC::CRGBA &result, const char *name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; - virtual bool setValueByName (const char *value, const char *name, bool *created); - virtual bool setValueByName (sint8 value, const char *name, bool *created); - virtual bool setValueByName (uint8 value, const char *name, bool *created); - virtual bool setValueByName (sint16 value, const char *name, bool *created); - virtual bool setValueByName (uint16 value, const char *name, bool *created); - virtual bool setValueByName (sint32 value, const char *name, bool *created); - virtual bool setValueByName (uint32 value, const char *name, bool *created); - virtual bool setValueByName (float value, const char *name, bool *created); - virtual bool setValueByName (double value, const char *name, bool *created); - virtual bool setValueByName (bool value, const char *name, bool *created); - virtual bool setValueByName (NLMISC::CRGBA value, const char *name, bool *created); + virtual bool getNodeByName (const UFormElm **result, const std::string &name, TWhereIsNode *where, bool verbose, uint32 round=0) const; + virtual bool getNodeByName (UFormElm **result, const std::string &name, TWhereIsNode *where, bool verbose, uint32 round=0); + virtual bool getValueByName (std::string &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; + virtual bool getValueByName (sint8 &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; + virtual bool getValueByName (uint8 &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; + virtual bool getValueByName (sint16 &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; + virtual bool getValueByName (uint16 &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; + virtual bool getValueByName (sint32 &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; + virtual bool getValueByName (uint32 &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; + virtual bool getValueByName (float &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; + virtual bool getValueByName (double &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; + virtual bool getValueByName (bool &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; + virtual bool getValueByName (NLMISC::CRGBA &result, const std::string &name, TEval evaluate, TWhereIsValue *where, uint32 round=0) const; + virtual bool setValueByName (const std::string &value, const std::string &name, bool *created); + virtual bool setValueByName (sint8 value, const std::string &name, bool *created); + virtual bool setValueByName (uint8 value, const std::string &name, bool *created); + virtual bool setValueByName (sint16 value, const std::string &name, bool *created); + virtual bool setValueByName (uint16 value, const std::string &name, bool *created); + virtual bool setValueByName (sint32 value, const std::string &name, bool *created); + virtual bool setValueByName (uint32 value, const std::string &name, bool *created); + virtual bool setValueByName (float value, const std::string &name, bool *created); + virtual bool setValueByName (double value, const std::string &name, bool *created); + virtual bool setValueByName (bool value, const std::string &name, bool *created); + virtual bool setValueByName (NLMISC::CRGBA value, const std::string &name, bool *created); virtual UFormElm *getParent () const; virtual const CType *getType (); virtual bool isArray () const; @@ -127,16 +127,16 @@ public: // ** Convert functions - inline bool convertValue (sint8 &result, const char *value) const; - inline bool convertValue (uint8 &result, const char *value) const; - inline bool convertValue (sint16 &result, const char *value) const; - inline bool convertValue (uint16 &result, const char *value) const; - inline bool convertValue (sint32 &result, const char *value) const; - inline bool convertValue (uint32 &result, const char *value) const; - inline bool convertValue (float &result, const char *value) const; - inline bool convertValue (double &result, const char *value) const; - inline bool convertValue (bool &result, const char *value) const; - inline bool convertValue (NLMISC::CRGBA &result, const char *value) const; + inline bool convertValue (sint8 &result, const std::string &value) const; + inline bool convertValue (uint8 &result, const std::string &value) const; + inline bool convertValue (sint16 &result, const std::string &value) const; + inline bool convertValue (uint16 &result, const std::string &value) const; + inline bool convertValue (sint32 &result, const std::string &value) const; + inline bool convertValue (uint32 &result, const std::string &value) const; + inline bool convertValue (float &result, const std::string &value) const; + inline bool convertValue (double &result, const std::string &value) const; + inline bool convertValue (bool &result, const std::string &value) const; + inline bool convertValue (NLMISC::CRGBA &result, const std::string &value) const; // ** Get dependencies virtual void getDependencies (std::set &dependencies) const = 0; @@ -144,7 +144,7 @@ public: // ** Internal node access // Create a node by name. If the node already exists, return it - bool createNodeByName (const char *name, const CFormDfn **parentDfn, uint &indexDfn, + bool createNodeByName (const std::string &, const CFormDfn **parentDfn, uint &indexDfn, const CFormDfn **nodeDfn, const CType **nodeType, CFormElm **node, UFormDfn::TEntryType &type, bool &array, bool &created); @@ -153,13 +153,13 @@ public: * Delete a node by name. If the node already exists, return it *Delete its parent if not used */ - bool deleteNodeByName (const char *name, const CFormDfn **parentDfn, uint &indexDfn, + bool deleteNodeByName (const std::string &name, const CFormDfn **parentDfn, uint &indexDfn, const CFormDfn **nodeDfn, const CType **nodeType, CFormElm **node, UFormDfn::TEntryType &type, bool &array); // Search for a node by name - bool getNodeByName (const char *name, const CFormDfn **parentDfn, uint &indexDfn, + bool getNodeByName (const std::string &name, const CFormDfn **parentDfn, uint &indexDfn, const CFormDfn **nodeDfn, const CType **nodeType, CFormElm **node, UFormDfn::TEntryType &type, bool &array, bool &parentVDfnArray, bool verbose, uint32 round) const; @@ -168,7 +168,7 @@ public: * Insert an array node by name * The index asked must be < the size of the array. */ - bool arrayInsertNodeByName (const char *name, const CFormDfn **parentDfn, uint &indexDfn, + bool arrayInsertNodeByName (const std::string &name, const CFormDfn **parentDfn, uint &indexDfn, const CFormDfn **nodeDfn, const CType **nodeType, CFormElm **node, UFormDfn::TEntryType &type, bool &array, bool verbose, uint arrayIndex) const; @@ -177,7 +177,7 @@ public: * Delete an array node by name * The index asked must be < the size of the array. */ - bool arrayDeleteNodeByName (const char *name, const CFormDfn **parentDfn, uint &indexDfn, + bool arrayDeleteNodeByName (const std::string &name, const CFormDfn **parentDfn, uint &indexDfn, const CFormDfn **nodeDfn, const CType **nodeType, CFormElm **node, UFormDfn::TEntryType &type, bool &array, bool verbose, uint arrayIndex) const; @@ -199,7 +199,7 @@ protected: * Then, else (*parentDfn / indexDfn ) or *node must be defined. * Other values are for result only. */ - static bool getInternalNodeByName (CForm *form, const char *name, const CFormDfn **parentDfn, uint &indexDfn, + static bool getInternalNodeByName (CForm *form, const std::string &name, const CFormDfn **parentDfn, uint &indexDfn, const CFormDfn **nodeDfn, const CType **nodeType, CFormElm **node, UFormDfn::TEntryType &type, bool &array, TNodeAction action, bool &created, bool &parentVDfnArray, bool verbose, uint32 round); @@ -215,7 +215,7 @@ public: static const char* tokenize (const char *name, std::string &str, uint &errorIndex, uint &code); // ** IO functions - virtual xmlNodePtr write (xmlNodePtr node, const CForm *form, const char *structName = NULL, bool forceWrite = false) const = 0; + virtual xmlNodePtr write (xmlNodePtr node, const CForm *form, const std::string &structName = "", bool forceWrite = false) const = 0; protected: @@ -235,8 +235,8 @@ protected: uint32 Round; // Error handling - static void warning (bool exception, const char *formName, const char *formFileName, const char *function, const char *format, ... ); - virtual void warning (bool exception, const char *function, const char *format, ... ) const; + static void warning (bool exception, const std::string &formName, const std::string &formFileName, const std::string &function, const char *format, ... ); + virtual void warning (bool exception, const std::string &function, const char *format, ... ) const; private: // Tokens @@ -298,7 +298,7 @@ public: // From CFormElm bool isUsed (const CForm *form) const; - xmlNodePtr write (xmlNodePtr node, const CForm *form, const char *structName, bool forceWrite = false) const; + xmlNodePtr write (xmlNodePtr node, const CForm *form, const std::string &structName, bool forceWrite = false) const; void unlink (CFormElm *child); void getFormName (std::string &result, const CFormElm *child) const; void getDependencies (std::set &dependencies) const; @@ -310,7 +310,7 @@ public: std::vector Elements; // Error handling - virtual void warning (bool exception, const char *function, const char *format, ... ) const; + virtual void warning (bool exception, const std::string &function, const char *format, ... ) const; }; /** @@ -332,13 +332,13 @@ public: // From CFormElm bool isUsed (const CForm *form) const; - xmlNodePtr write (xmlNodePtr node, const CForm *form, const char *structName, bool forceWrite = false) const; + xmlNodePtr write (xmlNodePtr node, const CForm *form, const std::string &structName, bool forceWrite = false) const; // Call by CFormLoader void read (xmlNodePtr node, CFormLoader &loader, CForm *form); // Error handling - virtual void warning (bool exception, const char *function, const char *format, ... ) const; + virtual void warning (bool exception, const std::string &function, const char *format, ... ) const; }; /** @@ -377,7 +377,7 @@ public: bool getArrayValue (NLMISC::CRGBA &result, uint arrayIndex, TEval evaluate, TWhereIsValue *where) const; // From CFormElm - xmlNodePtr write (xmlNodePtr node, const CForm *form, const char *structName, bool forceWrite = false) const; + xmlNodePtr write (xmlNodePtr node, const CForm *form, const std::string &structName, bool forceWrite = false) const; bool setParent (CFormElm *parent); void unlink (CFormElm *child); bool isUsed (const CForm *form) const; @@ -406,7 +406,7 @@ public: std::vector Elements; // Error handling - virtual void warning (bool exception, const char *function, const char *format, ... ) const; + virtual void warning (bool exception, const std::string &function, const char *format, ... ) const; }; /** @@ -429,7 +429,7 @@ public: const CType *Type; // From CFormElm - xmlNodePtr write (xmlNodePtr node, const CForm *form, const char *structName, bool forceWrite = false) const; + xmlNodePtr write (xmlNodePtr node, const CForm *form, const std::string &structName, bool forceWrite = false) const; bool setParent (CFormElm *parent); void getFormName (std::string &result, const CFormElm *child) const; void getDependencies (std::set &dependencies) const; @@ -453,7 +453,7 @@ public: bool getValue (NLMISC::CRGBA &result, TEval evaluate) const; // Set the value, the elt been used - void setValue (const char *value); + void setValue (const std::string &value); // Get the raw value. Does not care about any parent or default values void getValue (std::string &result) const; @@ -463,14 +463,14 @@ private: std::string Value; // Error handling - virtual void warning (bool exception, const char *function, const char *format, ... ) const; + virtual void warning (bool exception, const std::string &function, const char *format, ... ) const; }; // *************************************************************************** // CFormElm inlines // *************************************************************************** -inline bool CFormElm::convertValue (sint8 &result, const char *value) const +inline bool CFormElm::convertValue (sint8 &result, const std::string &value) const { float tmp; if (NLMISC::fromString(value, tmp)) @@ -482,14 +482,14 @@ inline bool CFormElm::convertValue (sint8 &result, const char *value) const else { // Error message - warning (false, "convertValue", "Can't convert the string \"%s\" in sint8.", value); + warning (false, "convertValue", "Can't convert the string \"%s\" in sint8.", value.c_str()); } return false; } // *************************************************************************** -inline bool CFormElm::convertValue (uint8 &result, const char *value) const +inline bool CFormElm::convertValue (uint8 &result, const std::string &value) const { float tmp; if (NLMISC::fromString(value, tmp)) @@ -501,14 +501,14 @@ inline bool CFormElm::convertValue (uint8 &result, const char *value) const else { // Error message - warning (false, "convertValue", "Can't convert the string \"%s\" in uint8.", value); + warning (false, "convertValue", "Can't convert the string \"%s\" in uint8.", value.c_str()); } return false; } // *************************************************************************** -inline bool CFormElm::convertValue (sint16 &result, const char *value) const +inline bool CFormElm::convertValue (sint16 &result, const std::string &value) const { float tmp; if (NLMISC::fromString(value, tmp)) @@ -520,14 +520,14 @@ inline bool CFormElm::convertValue (sint16 &result, const char *value) const else { // Error message - warning (false, "convertValue", "Can't convert the string \"%s\" in sint16.", value); + warning (false, "convertValue", "Can't convert the string \"%s\" in sint16.", value.c_str()); } return false; } // *************************************************************************** -inline bool CFormElm::convertValue (uint16 &result, const char *value) const +inline bool CFormElm::convertValue (uint16 &result, const std::string &value) const { float tmp; if (NLMISC::fromString(value, tmp)) @@ -539,14 +539,14 @@ inline bool CFormElm::convertValue (uint16 &result, const char *value) const else { // Error message - warning (false, "convertValue", "Can't convert the string \"%s\" in uint16.", value); + warning (false, "convertValue", "Can't convert the string \"%s\" in uint16.", value.c_str()); } return false; } // *************************************************************************** -inline bool CFormElm::convertValue (sint32 &result, const char *value) const +inline bool CFormElm::convertValue (sint32 &result, const std::string &value) const { float tmp; if (NLMISC::fromString(value, tmp)) @@ -558,14 +558,14 @@ inline bool CFormElm::convertValue (sint32 &result, const char *value) const else { // Error message - warning (false, "convertValue", "Can't convert the string \"%s\" in sint32.", value); + warning (false, "convertValue", "Can't convert the string \"%s\" in sint32.", value.c_str()); } return false; } // *************************************************************************** -inline bool CFormElm::convertValue (uint32 &result, const char *value) const +inline bool CFormElm::convertValue (uint32 &result, const std::string &value) const { float tmp; if (NLMISC::fromString(value, tmp)) @@ -577,14 +577,14 @@ inline bool CFormElm::convertValue (uint32 &result, const char *value) const else { // Error message - warning (false, "convertValue", "Can't convert the string \"%s\" in uint32.", value); + warning (false, "convertValue", "Can't convert the string \"%s\" in uint32.", value.c_str()); } return false; } // *************************************************************************** -inline bool CFormElm::convertValue (float &result, const char *value) const +inline bool CFormElm::convertValue (float &result, const std::string &value) const { if (NLMISC::fromString(value, result)) { @@ -593,16 +593,16 @@ inline bool CFormElm::convertValue (float &result, const char *value) const else { // Error message - warning (false, "convertValue", "Can't convert the string \"%s\" in float.", value); + warning (false, "convertValue", "Can't convert the string \"%s\" in float.", value.c_str()); } return false; } // *************************************************************************** -inline bool CFormElm::convertValue (double &result, const char *value) const +inline bool CFormElm::convertValue (double &result, const std::string &value) const { - float tmp; + double tmp; if (NLMISC::fromString(value, tmp)) { result = tmp; @@ -611,14 +611,14 @@ inline bool CFormElm::convertValue (double &result, const char *value) const else { // Error message - warning (false, "convertValue", "Can't convert the string \"%s\" in double.", value); + warning (false, "convertValue", "Can't convert the string \"%s\" in double.", value.c_str()); } return false; } // *************************************************************************** -inline bool CFormElm::convertValue (bool &result, const char *value) const +inline bool CFormElm::convertValue (bool &result, const std::string &value) const { int tmp; if (NLMISC::fromString(value, tmp)) @@ -628,7 +628,7 @@ inline bool CFormElm::convertValue (bool &result, const char *value) const } else { - std::string temp = NLMISC::toLower(std::string(value)); + std::string temp = NLMISC::toLower(value); if (strcmp (temp.c_str (), "true") == 0) { result = true; @@ -642,17 +642,17 @@ inline bool CFormElm::convertValue (bool &result, const char *value) const } // Error message - warning (false, "convertValue", "Can't convert the string \"%s\" in boolean.", value); + warning (false, "convertValue", "Can't convert the string \"%s\" in boolean.", value.c_str()); return false; } // *************************************************************************** -inline bool CFormElm::convertValue (NLMISC::CRGBA &result, const char *value) const +inline bool CFormElm::convertValue (NLMISC::CRGBA &result, const std::string &value) const { float r, g, b; - if (sscanf (value, "%f,%f,%f", &r, &g, &b) == 3) + if (sscanf (value.c_str(), "%f,%f,%f", &r, &g, &b) == 3) { NLMISC::clamp (r, 0.f, 255.f); NLMISC::clamp (g, 0.f, 255.f); @@ -664,7 +664,7 @@ inline bool CFormElm::convertValue (NLMISC::CRGBA &result, const char *value) co } // Error message - warning (false, "convertValue", "Can't convert the string \"%s\" in RGB color.", value); + warning (false, "convertValue", "Can't convert the string \"%s\" in RGB color.", value.c_str()); return false; } diff --git a/code/nel/include/nel/georges/form_loader.h b/code/nel/include/nel/georges/form_loader.h index 75d7152ec..c46d79f22 100644 --- a/code/nel/include/nel/georges/form_loader.h +++ b/code/nel/include/nel/georges/form_loader.h @@ -42,18 +42,18 @@ class CFormLoader : public UFormLoader public: virtual ~CFormLoader(); // From UFormLoader - UForm *loadForm (const char *filename); - UFormDfn *loadFormDfn (const char *filename); - UType *loadFormType (const char *filename); + UForm *loadForm (const std::string &filename); + UFormDfn *loadFormDfn (const std::string &filename); + UType *loadFormType (const std::string &filename); // Load type and formDfn - CType *loadType (const char *filename); - CFormDfn *loadFormDfn (const char *filename, bool forceLoad); + CType *loadType (const std::string &filename); + CFormDfn *loadFormDfn (const std::string &filename, bool forceLoad); private: // Error handling - virtual void warning (bool exception, const char *function, const char *format, ... ) const; + virtual void warning (bool exception, const std::string &function, const char *format, ... ) const; typedef std::map > TTypeMap; typedef std::map > TFormDfnMap; diff --git a/code/nel/include/nel/georges/header.h b/code/nel/include/nel/georges/header.h index 21b05445e..82a094b3d 100644 --- a/code/nel/include/nel/georges/header.h +++ b/code/nel/include/nel/georges/header.h @@ -19,8 +19,12 @@ #include "nel/misc/types_nl.h" -// Include from libxml2 -#include +// Forward declarations for libxml2 +typedef struct _xmlNode xmlNode; +typedef xmlNode *xmlNodePtr; + +typedef struct _xmlDoc xmlDoc; +typedef xmlDoc *xmlDocPtr; namespace NLGEORGES { @@ -40,10 +44,10 @@ public: }; /// Add a log - void addLog (const char *log); + void addLog(const std::string &log); /// Set the comment - void setComments (const char *comments); + void setComments (const std::string &comments); /// Major version number uint32 MajorVersion; @@ -68,7 +72,7 @@ public: static const char *getStateString (TState state); // Error handling - void warning (bool exception, const char *function, const char *format, ... ) const; + void warning (bool exception, const std::string &function, const char *format, ... ) const; }; } // NLGEORGES diff --git a/code/nel/include/nel/georges/load_form.h b/code/nel/include/nel/georges/load_form.h index 4aaab43d0..a927d21e0 100644 --- a/code/nel/include/nel/georges/load_form.h +++ b/code/nel/include/nel/georges/load_form.h @@ -385,7 +385,7 @@ void loadForm (const std::vector &sheetFilters, const std::string & } } - if(NeededToRecompute.size() > 0) + if(!NeededToRecompute.empty()) nlinfo ("%d seconds to recompute %d sheets", (uint32)(NLMISC::CTime::getLocalTime()-start)/1000, NeededToRecompute.size()); // free the georges loader if necessary @@ -748,7 +748,7 @@ void loadForm2(const std::vector &sheetFilters, const std::string & } } - if(NeededToRecompute.size() > 0) + if(!NeededToRecompute.empty()) nlinfo ("%d seconds to recompute %d sheets", (uint32)(NLMISC::CTime::getLocalTime()-start)/1000, NeededToRecompute.size()); // free the georges loader if necessary @@ -1304,7 +1304,7 @@ void loadFormNoPackedSheet (const std::vector &sheetFilters, std::m } } - if(NeededToRecompute.size() > 0) + if(!NeededToRecompute.empty()) nlinfo ("%d seconds to recompute %d sheets", (uint32)(NLMISC::CTime::getLocalTime()-start)/1000, NeededToRecompute.size()); // free the georges loader if necessary @@ -1393,7 +1393,7 @@ void loadFormNoPackedSheet2 (const std::vector &sheetFilters, std:: } } - if(NeededToRecompute.size() > 0) + if(!NeededToRecompute.empty()) nlinfo ("%d seconds to recompute %d sheets", (uint32)(NLMISC::CTime::getLocalTime()-start)/1000, NeededToRecompute.size()); // free the georges loader if necessary diff --git a/code/nel/include/nel/georges/type.h b/code/nel/include/nel/georges/type.h index 936506c7c..e1bad7934 100644 --- a/code/nel/include/nel/georges/type.h +++ b/code/nel/include/nel/georges/type.h @@ -80,7 +80,7 @@ public: // Evaluate a node bool getValue (std::string &result, const class CForm *form, const class CFormElmAtom *node, const class CFormDfn &parentDfn, - uint parentIndex, UFormElm::TEval evaluate, uint32 *where, uint32 round, const char *formName) const; + uint parentIndex, UFormElm::TEval evaluate, uint32 *where, uint32 round, const std::string &formName) const; // Definitions class CDefinition @@ -114,8 +114,8 @@ public: private: // Error handling - virtual void warning (bool exception, const char *formName, const char *formFilename, const char *function, const char *format, ... ) const; - virtual void warning2 (bool exception, const char *function, const char *format, ... ) const; + virtual void warning (bool exception, const std::string &formName, const std::string &formFilename, const std::string &function, const char *format, ... ) const; + virtual void warning2 (bool exception, const std::string &function, const char *format, ... ) const; // Type names static const char *TypeNames[]; diff --git a/code/nel/include/nel/georges/u_form_elm.h b/code/nel/include/nel/georges/u_form_elm.h index ebb950429..f50582a04 100644 --- a/code/nel/include/nel/georges/u_form_elm.h +++ b/code/nel/include/nel/georges/u_form_elm.h @@ -78,8 +78,8 @@ public: * "position.x" : get the element named x in the struct named position * "entities[2].color" : get the node named color in the second element of the entities array */ - virtual bool getNodeByName (const UFormElm **result, const char *name, TWhereIsNode *where = NULL, bool reserved=true, uint32 round=0) const = 0; - virtual bool getNodeByName (UFormElm **result, const char *name, TWhereIsNode *where = NULL, bool reserved=true, uint32 round=0) = 0; + virtual bool getNodeByName (const UFormElm **result, const std::string &name, TWhereIsNode *where = NULL, bool reserved=true, uint32 round=0) const = 0; + virtual bool getNodeByName (UFormElm **result, const std::string &name, TWhereIsNode *where = NULL, bool reserved=true, uint32 round=0) = 0; /// Where a value has been found @@ -104,19 +104,19 @@ public: * \return true if the result has been filled, false if the value has not been found or the cast has failed or the evaluation has failed. * \see getNodeByName () */ - virtual bool getValueByName (std::string &result, const char *namename, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; - virtual bool getValueByName (sint8 &result, const char *name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; - virtual bool getValueByName (uint8 &result, const char *name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; - virtual bool getValueByName (sint16 &result, const char *name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; - virtual bool getValueByName (uint16 &result, const char *name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; - virtual bool getValueByName (sint32 &result, const char *name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; - virtual bool getValueByName (uint32 &result, const char *name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; - virtual bool getValueByName (float &result, const char *name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; - virtual bool getValueByName (double &result, const char *name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; - virtual bool getValueByName (bool &result, const char *name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; + virtual bool getValueByName (std::string &result, const std::string &name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; + virtual bool getValueByName (sint8 &result, const std::string &name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; + virtual bool getValueByName (uint8 &result, const std::string &name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; + virtual bool getValueByName (sint16 &result, const std::string &name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; + virtual bool getValueByName (uint16 &result, const std::string &name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; + virtual bool getValueByName (sint32 &result, const std::string &name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; + virtual bool getValueByName (uint32 &result, const std::string &name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; + virtual bool getValueByName (float &result, const std::string &name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; + virtual bool getValueByName (double &result, const std::string &name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; + virtual bool getValueByName (bool &result, const std::string &name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; /// Warning, only R, G and B members are filled, not A. - virtual bool getValueByName (NLMISC::CRGBA &result, const char *name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; + virtual bool getValueByName (NLMISC::CRGBA &result, const std::string &name, TEval evaluate = Eval, TWhereIsValue *where = NULL, uint32 round=0) const = 0; /** * Set a form value with its name. If the node doesn't exist, it is created. @@ -129,17 +129,17 @@ public: * true if the value has been created, false it the value has been filled. * \return true if the value has been set, false if the value has not been found or hasn't been created. */ - virtual bool setValueByName (const char *value, const char *name, bool *created = NULL) = 0; - virtual bool setValueByName (sint8 value, const char *name, bool *created = NULL) = 0; - virtual bool setValueByName (uint8 value, const char *name, bool *created = NULL) = 0; - virtual bool setValueByName (sint16 value, const char *name, bool *created = NULL) = 0; - virtual bool setValueByName (uint16 value, const char *name, bool *created = NULL) = 0; - virtual bool setValueByName (sint32 value, const char *name, bool *created = NULL) = 0; - virtual bool setValueByName (uint32 value, const char *name, bool *created = NULL) = 0; - virtual bool setValueByName (float value, const char *name, bool *created = NULL) = 0; - virtual bool setValueByName (double value, const char *name, bool *created = NULL) = 0; - virtual bool setValueByName (bool value, const char *name, bool *created = NULL) = 0; - virtual bool setValueByName (NLMISC::CRGBA value, const char *name, bool *created = NULL) = 0; + virtual bool setValueByName (const std::string &value, const std::string &name, bool *created = NULL) = 0; + virtual bool setValueByName (sint8 value, const std::string &name, bool *created = NULL) = 0; + virtual bool setValueByName (uint8 value, const std::string &name, bool *created = NULL) = 0; + virtual bool setValueByName (sint16 value, const std::string &name, bool *created = NULL) = 0; + virtual bool setValueByName (uint16 value, const std::string &name, bool *created = NULL) = 0; + virtual bool setValueByName (sint32 value, const std::string &name, bool *created = NULL) = 0; + virtual bool setValueByName (uint32 value, const std::string &name, bool *created = NULL) = 0; + virtual bool setValueByName (float value, const std::string &name, bool *created = NULL) = 0; + virtual bool setValueByName (double value, const std::string &name, bool *created = NULL) = 0; + virtual bool setValueByName (bool value, const std::string &name, bool *created = NULL) = 0; + virtual bool setValueByName (NLMISC::CRGBA value, const std::string &name, bool *created = NULL) = 0; // ** Array element methods @@ -225,7 +225,7 @@ public: /// Returns the type of the atom. NULL otherwise. - virtual const class UType *getType () = 0; + virtual const class UType *getType () = 0; /// Return true if the element is an atom virtual bool isAtom () const = 0; diff --git a/code/nel/include/nel/georges/u_form_loader.h b/code/nel/include/nel/georges/u_form_loader.h index b32f358e0..c1cb30cfb 100644 --- a/code/nel/include/nel/georges/u_form_loader.h +++ b/code/nel/include/nel/georges/u_form_loader.h @@ -43,19 +43,19 @@ public: * * The pointer on the form must be held in a CSmartPtr. Returns NULL if the form can't be loaded. */ - virtual UForm *loadForm (const char *filename) = 0; + virtual UForm *loadForm (const std::string &filename) = 0; /** Load a DFN, use NMISC::CPath to find the file. * * The pointer on the form must be held in a CSmartPtr. Returns NULL if the DFN can't be loaded. */ - virtual UFormDfn *loadFormDfn (const char *filename) = 0; + virtual UFormDfn *loadFormDfn (const std::string &filename) = 0; /** Load a type, use NMISC::CPath to find the file. * * The pointer on the form must be held in a CSmartPtr. Returns NULL if the type can't be loaded. */ - virtual UType *loadFormType (const char *filename) = 0; + virtual UType *loadFormType (const std::string &filename) = 0; /// Create a form loader static UFormLoader *createLoader (); diff --git a/code/nel/include/nel/gui/action_handler.h b/code/nel/include/nel/gui/action_handler.h index 48b49e451..f0f4c46f8 100644 --- a/code/nel/include/nel/gui/action_handler.h +++ b/code/nel/include/nel/gui/action_handler.h @@ -17,13 +17,16 @@ #ifndef NL_ACTION_HANDLER_H #define NL_ACTION_HANDLER_H -#include "nel/misc/types_nl.h" -#include #include "nel/misc/types_nl.h" #include "nel/misc/debug.h" #include "nel/misc/xml_auto_ptr.h" + #include +// Forward declarations for libxml2 +typedef struct _xmlNode xmlNode; +typedef xmlNode *xmlNodePtr; + namespace NLGUI { diff --git a/code/nel/include/nel/gui/ctrl_base.h b/code/nel/include/nel/gui/ctrl_base.h index 71e6cad56..35148b5b0 100644 --- a/code/nel/include/nel/gui/ctrl_base.h +++ b/code/nel/include/nel/gui/ctrl_base.h @@ -50,6 +50,8 @@ namespace NLGUI // see interface.txt for meaning of auto _ToolTipParentPosRef= Hotspot_TTAuto; _ToolTipPosRef= Hotspot_TTAuto; + _EventX = 0; + _EventY = 0; resizer = false; } @@ -70,6 +72,9 @@ namespace NLGUI bool handleEvent (const NLGUI::CEventDescriptor &event); + sint32 getEventX() { return _EventX; } + sint32 getEventY() { return _EventY; } + virtual CCtrlBase *getSubCtrl (sint32 /* x */, sint32 /* y */) { return this; } /// Debug @@ -146,8 +151,12 @@ namespace NLGUI // called when keyboard capture has been lost virtual void onKeyboardCaptureLost() {} + // 'tooltip' property expects string to be ucstring or latin1 which is not possible from html page + int luaSetTooltipUtf8(CLuaState &ls); + REFLECT_EXPORT_START(CCtrlBase, CViewBase) REFLECT_UCSTRING("tooltip", getDefaultContextHelp, setDefaultContextHelp); + REFLECT_LUA_METHOD("setTooltipUtf8", luaSetTooltipUtf8); REFLECT_EXPORT_END // special for mouse over : return true and fill the name of the cursor to display @@ -181,6 +190,9 @@ namespace NLGUI static std::map< std::string, std::map< std::string, std::string > > AHCache; bool resizer; + + sint32 _EventX; + sint32 _EventY; }; } diff --git a/code/nel/include/nel/gui/ctrl_button.h b/code/nel/include/nel/gui/ctrl_button.h index 02b827329..1910ea72a 100644 --- a/code/nel/include/nel/gui/ctrl_button.h +++ b/code/nel/include/nel/gui/ctrl_button.h @@ -51,7 +51,7 @@ namespace NLGUI xmlNodePtr serialize( xmlNodePtr parentNode, const char *type ) const; // Init part - virtual bool parse (xmlNodePtr cur,CInterfaceGroup * parentGroup); + virtual bool parse (xmlNodePtr cur, CInterfaceGroup * parentGroup); virtual void updateCoords(); diff --git a/code/nel/include/nel/gui/ctrl_draggable.h b/code/nel/include/nel/gui/ctrl_draggable.h index 3f625db1d..22ace71e0 100644 --- a/code/nel/include/nel/gui/ctrl_draggable.h +++ b/code/nel/include/nel/gui/ctrl_draggable.h @@ -29,7 +29,7 @@ namespace NLGUI DECLARE_UI_CLASS( CCtrlDraggable ) CCtrlDraggable( const TCtorParam ¶m ); - virtual ~CCtrlDraggable(){}; + virtual ~CCtrlDraggable(){} static CCtrlDraggable *getDraggedSheet(){ return _LastDraggedSheet; } bool isDragged() const{ return dragged; } diff --git a/code/nel/include/nel/gui/ctrl_scroll.h b/code/nel/include/nel/gui/ctrl_scroll.h index b01a3bf81..a22da2cbd 100644 --- a/code/nel/include/nel/gui/ctrl_scroll.h +++ b/code/nel/include/nel/gui/ctrl_scroll.h @@ -147,7 +147,7 @@ namespace NLGUI sint32 _Aligned; // 0-Top 1-Bottom 2-Left 3-Right sint32 _TrackDispPos; - sint32 _TrackPos; + float _TrackPos; sint32 _TrackSize; sint32 _TrackSizeMin; @@ -175,6 +175,7 @@ namespace NLGUI bool _CallingAH : 1; bool _Cancelable : 1; // true if the slider may be cancelled when pressed on the mouse right button bool _Frozen : 1; + bool _Scale : 1; // For Target Scroller only: the target offset step in pixel. sint32 _TargetStepX; diff --git a/code/nel/include/nel/gui/ctrl_text_button.h b/code/nel/include/nel/gui/ctrl_text_button.h index 183b6a65e..e88ec81e1 100644 --- a/code/nel/include/nel/gui/ctrl_text_button.h +++ b/code/nel/include/nel/gui/ctrl_text_button.h @@ -49,8 +49,9 @@ namespace NLGUI xmlNodePtr serialize( xmlNodePtr parentNode, const char *type ) const; // Init part - virtual bool parse (xmlNodePtr cur,CInterfaceGroup * parentGroup); + virtual bool parse (xmlNodePtr cur, CInterfaceGroup * parentGroup); + virtual void checkCoords(); virtual void updateCoords(); virtual uint32 getMemory() { return (uint32)(sizeof(*this)+_Id.size()); } @@ -110,9 +111,19 @@ namespace NLGUI sint32 getWMin() const { return _WMin; } void setWMin( sint32 wmin ) { _WMin = wmin; } + sint32 getHMin() const { return _HMin; } + void setHMin( sint32 hmin ) { _HMin = hmin; } + // Compute Size according to bitmap and Text (Ensure as big as possible button) sint32 getWMax() const; + // Set texture directly without _l.tga, _m.tga, _r.tga convention + // Texture size is only read from normal textures + // If updateHeight == false, then _BmpH will keep its value + void setTexture(const std::string &l, const std::string &m, const std::string &r, bool updateHeight = true); + void setTexturePushed(const std::string &l, const std::string &m, const std::string &r); + void setTextureOver(const std::string &l, const std::string &m, const std::string &r); + int luaGetViewText(CLuaState &ls); REFLECT_EXPORT_START(CCtrlTextButton, CCtrlBaseButton) @@ -121,11 +132,13 @@ namespace NLGUI REFLECT_SINT32("text_x", getTextX, setTextX) REFLECT_SINT32("wmargin", getWMargin, setWMargin) REFLECT_SINT32("wmin", getWMin, setWMin) + REFLECT_SINT32("hmin", getHMin, setHMin) REFLECT_LUA_METHOD("getViewText", luaGetViewText) REFLECT_EXPORT_END void onRemoved(); void onWidgetDeleted( CInterfaceElement *e ); + void moveBy( sint32 x, sint32 y ); protected: @@ -149,8 +162,8 @@ namespace NLGUI sint32 _BmpLeftW, _BmpMiddleW, _BmpRightW, _BmpH; // Value to add to TextW to get button W. sint32 _WMargin; - // Min W Value - sint32 _WMin; + // Min W, H Value + sint32 _WMin, _HMin; sint32 _TextY; sint32 _TextX; THotSpot _TextPosRef; diff --git a/code/nel/include/nel/gui/curl_certificates.h b/code/nel/include/nel/gui/curl_certificates.h new file mode 100644 index 000000000..9d5ad4855 --- /dev/null +++ b/code/nel/include/nel/gui/curl_certificates.h @@ -0,0 +1,38 @@ +// Ryzom - MMORPG Framework +// 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 . + +#ifndef CL_CURL_CERTIFICATES_HTML_H +#define CL_CURL_CERTIFICATES_HTML_H + +#include "nel/misc/types_nl.h" + +// forward declaration to avoid curl.h inclusion everywhere +typedef void CURL; + +namespace NLGUI +{ + class CCurlCertificates + { + public: + // allow to use custom PEM certificates + static void addCertificateFile(const std::string &cert); + + // set all CURL options to use custom SSL context function + static void useCertificates(CURL *curl); + }; + +} // namespace +#endif diff --git a/code/nel/include/nel/gui/dbgroup_combo_box.h b/code/nel/include/nel/gui/dbgroup_combo_box.h index 75208b1e3..723afbdc0 100644 --- a/code/nel/include/nel/gui/dbgroup_combo_box.h +++ b/code/nel/include/nel/gui/dbgroup_combo_box.h @@ -60,9 +60,11 @@ namespace NLGUI void setText(uint i, const ucstring &text); void insertText(uint i, const ucstring &text); const ucstring &getText(uint i) const; - const uint &getTextId(uint i) const; + uint getTextId(uint i) const; uint getTextPos(uint nId) const; const ucstring &getTexture(uint i) const; + void setGrayed(uint i, bool g); + bool getGrayed(uint i) const; void removeText(uint nPos); uint getNumTexts() const {return (uint)_Texts.size();} void sortText(); @@ -83,6 +85,7 @@ namespace NLGUI // view text void setViewText(const ucstring & text); ucstring getViewText() const; + CViewText *getViewText(); void setTexture(uint i, const ucstring &texture); @@ -132,6 +135,7 @@ namespace NLGUI sint32 _NotLinkedToDBSelection; std::vector > _Texts; std::vector _Textures; + std::vector _Grayed; // Action Handler called on combo click std::string _AHOnSelectStart; diff --git a/code/nel/include/nel/gui/dbview_number.h b/code/nel/include/nel/gui/dbview_number.h index 2c76a255d..bfa963fb6 100644 --- a/code/nel/include/nel/gui/dbview_number.h +++ b/code/nel/include/nel/gui/dbview_number.h @@ -55,9 +55,7 @@ namespace NLGUI static void forceLink(); protected: - - sint64 getVal() { if (_Modulo == 0) return (_Number.getSInt64() / _Divisor); - else return (_Number.getSInt64() / _Divisor)%_Modulo; } + sint64 getVal(); protected: diff --git a/code/nel/include/nel/gui/editor_selection_watcher.h b/code/nel/include/nel/gui/editor_selection_watcher.h index 415f4f9db..7e262bdf1 100644 --- a/code/nel/include/nel/gui/editor_selection_watcher.h +++ b/code/nel/include/nel/gui/editor_selection_watcher.h @@ -15,6 +15,7 @@ // along with this program. If not, see . #include +#include namespace NLGUI { @@ -24,7 +25,7 @@ namespace NLGUI public: /// Notifies the watcher about the change - virtual void selectionChanged( std::string &newSelection ) = 0; + virtual void selectionChanged() = 0; }; } diff --git a/code/nel/include/nel/gui/group_container_base.h b/code/nel/include/nel/gui/group_container_base.h index 3e9d1c8bf..6aa7425b7 100644 --- a/code/nel/include/nel/gui/group_container_base.h +++ b/code/nel/include/nel/gui/group_container_base.h @@ -82,13 +82,13 @@ namespace NLGUI // Get the header color draw. NB: depends if grayed, and if active. virtual NLMISC::CRGBA getDrawnHeaderColor () const{ return NLMISC::CRGBA(); }; - uint8 getCurrentContainerAlpha() const{ return _CurrentContainerAlpha; } - uint8 getCurrentContentAlpha() const{ return _CurrentContentAlpha; } + uint8 getCurrentContainerAlpha() const { return _CurrentContainerAlpha; } + uint8 getCurrentContentAlpha() const { return _CurrentContentAlpha; } - virtual bool isGrayed() const{ return false; } - virtual bool getTouchFlag(bool clearFlag) const{ return false; } - virtual void backupPosition(){} - virtual void restorePosition(){} + virtual bool isGrayed() const { return false; } + virtual bool getTouchFlag(bool /* clearFlag */) const { return false; } + virtual void backupPosition() {} + virtual void restorePosition() {} protected: void triggerAlphaSettingsChangedAH(); diff --git a/code/nel/include/nel/gui/group_editbox.h b/code/nel/include/nel/gui/group_editbox.h index 7ea2ab529..14d9d55a5 100644 --- a/code/nel/include/nel/gui/group_editbox.h +++ b/code/nel/include/nel/gui/group_editbox.h @@ -264,6 +264,7 @@ namespace NLGUI // because of multiline, thz parent container will be moved to top // The good position can be restored by a press on enter then bool _WantReturn : 1; // Want return char, don't call the enter action handler + bool _ClearOnEscape : 1; // clear content when ESC is pressed? bool _Savable : 1; // should content be saved ? bool _DefaultInputString : 1; // Is the current input string the default one (should not be edited) bool _Frozen : 1; // is the control frozen? (cannot edit in it) @@ -283,6 +284,10 @@ namespace NLGUI sint32 _ViewTextDeltaX; + CViewText* getVT() const{ return _ViewText; } + + void createViewText(); + private: void setupDisplayText(); void makeTopWindow(); diff --git a/code/nel/include/nel/gui/group_editbox_decor.h b/code/nel/include/nel/gui/group_editbox_decor.h new file mode 100644 index 000000000..975177612 --- /dev/null +++ b/code/nel/include/nel/gui/group_editbox_decor.h @@ -0,0 +1,53 @@ +// Ryzom - MMORPG Framework +// Copyright (C) 2014 Laszlo Kis-Adam +// 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 . + +#ifndef GROUP_EDITBOX_DECOR +#define GROUP_EDITBOX_DECOR + +#include "nel/gui/group_editbox.h" + +namespace NLGUI +{ + /// Decorated CGroupEditBox + class CGroupEditBoxDecor : public CGroupEditBox + { + public: + DECLARE_UI_CLASS( CGroupEditBoxDecor ) + + CGroupEditBoxDecor( const TCtorParam ¶m ); + ~CGroupEditBoxDecor(); + + void moveBy( sint32 x, sint32 y ); + + void setIdRecurse( const std::string &newID ); + + std::string getProperty( const std::string &name ) const; + void setProperty( const std::string &name, const std::string &value ); + xmlNodePtr serialize( xmlNodePtr parentNode, const char *type ) const; + bool parse( xmlNodePtr cur, CInterfaceGroup *parent ); + void draw(); + void updateCoords(); + + static void forceLink(); + + private: + class EBDPrivate *_Pvt; + }; +} + +#endif + diff --git a/code/nel/include/nel/gui/group_html.h b/code/nel/include/nel/gui/group_html.h index 3f5526197..55daa3c52 100644 --- a/code/nel/include/nel/gui/group_html.h +++ b/code/nel/include/nel/gui/group_html.h @@ -17,32 +17,30 @@ #ifndef CL_GROUP_HTML_H #define CL_GROUP_HTML_H -#define CURL_STATICLIB 1 -#include - #include "nel/misc/types_nl.h" #include "nel/gui/interface_group.h" #include "nel/gui/group_scrolltext.h" #include "nel/gui/group_tree.h" #include "nel/gui/ctrl_button.h" #include "nel/gui/group_table.h" +#include "nel/gui/libwww_types.h" -typedef std::map TStyle; +// forward declaration +typedef void CURLM; -extern "C" -{ -#include "WWWInit.h" -} +typedef std::map TStyle; namespace NLGUI { class CCtrlButton; + class CCtrlTextButton; class CCtrlScroll; class CGroupList; + class CGroupMenu; class CDBGroupComboBox; class CGroupParagraph; - + extern std::string CurrentCookie; // HTML group /** @@ -56,15 +54,6 @@ namespace NLGUI public: DECLARE_UI_CLASS( CGroupHTML ) - friend void TextAdd (struct _HText *me, const char * buf, int len); - friend void TextBeginElement (_HText *me, int element_number, const BOOL *present, const char ** value); - friend void TextEndElement (_HText *me, int element_number); - friend void TextLink (struct _HText *me, int element_number, int attribute_number, struct _HTChildAnchor *anchor, const BOOL *present, const char **value); - friend void TextBuild (HText * me, HTextStatus status); - friend void TextBeginUnparsedElement(HText *me, const char *buffer, int length); - friend void TextEndUnparsedElement(HText *me, const char *buffer, int length); - friend int requestTerminater (HTRequest * request, HTResponse * response, void * param, int status); - /// Web browser options for CGroupHTML struct SWebOptions { @@ -77,14 +66,72 @@ namespace NLGUI std::string languageCode; /// List of domains the widget can consider secure. std::vector< std::string > trustedDomains; + /// Maximum concurrent MultiCurl connections per CGroupHTML instance + sint32 curlMaxConnections; - SWebOptions() + SWebOptions(): curlMaxConnections(2) { } }; static SWebOptions options; + // text-shadow + struct STextShadow + { + public: + STextShadow(bool enabled = false, bool outline = false, sint32 x=1, sint32 y=1, NLMISC::CRGBA color=NLMISC::CRGBA::Black) + : Enabled(enabled), Outline(outline), X(x), Y(y), Color(color) + { } + + bool Enabled; + bool Outline; + sint32 X; + sint32 Y; + NLMISC::CRGBA Color; + }; + + class CStyleParams + { + public: + CStyleParams () : FontFamily(""), TextColor(255,255,255,255), TextShadow() + { + FontSize=10; + FontWeight=400; + FontOblique=false; + Underlined=false; + StrikeThrough=false; + GlobalColor=false; + Width=-1; + Height=-1; + MaxWidth=-1; + MaxHeight=-1; + BorderWidth=1; + BackgroundColor=NLMISC::CRGBA::Black; + BackgroundColorOver=NLMISC::CRGBA::Black; + } + uint FontSize; + uint FontWeight; + bool FontOblique; + std::string FontFamily; + NLMISC::CRGBA TextColor; + STextShadow TextShadow; + bool GlobalColor; + bool Underlined; + bool StrikeThrough; + sint32 Width; + sint32 Height; + sint32 MaxWidth; + sint32 MaxHeight; + sint32 BorderWidth; + NLMISC::CRGBA BackgroundColor; + NLMISC::CRGBA BackgroundColorOver; + }; + + // ImageDownload system + enum TDataType {ImgType= 0, BnpType}; + enum TImageType {NormalImage=0, OverImage}; + // Constructor CGroupHTML(const TCtorParam ¶m); ~CGroupHTML(); @@ -103,11 +150,14 @@ namespace NLGUI // Browse virtual void browse (const char *url); + // parse html string using libxml2 parser + virtual bool parseHtml(std::string htmlString); + // Refresh void refresh(); // submit form - void submitForm (uint formId, const char *submitButtonName); + void submitForm (uint formId, const char *submitButtonType, const char *submitButtonName, const char *submitButtonValue, sint32 x, sint32 y); // Browse error void browseError (const char *msg); @@ -127,6 +177,10 @@ namespace NLGUI // End of the paragraph void endParagraph(); + + // add image download (used by view_bitmap.cpp to load web images) + void addImageDownload(const std::string &url, CViewBase *img, const CStyleParams &style = CStyleParams(), const TImageType type = NormalImage); + std::string localImageName(const std::string &url); // Timeout void setTimeout(float tm) {_TimeoutValue= std::max(0.f, tm);} @@ -170,12 +224,44 @@ namespace NLGUI std::string DefaultFormTextGroup; std::string DefaultFormTextAreaGroup; std::string DefaultFormSelectGroup; + std::string DefaultFormSelectBoxMenuGroup; std::string DefaultCheckBoxBitmapNormal; std::string DefaultCheckBoxBitmapPushed; std::string DefaultCheckBoxBitmapOver; + std::string DefaultRadioButtonBitmapNormal; + std::string DefaultRadioButtonBitmapPushed; + std::string DefaultRadioButtonBitmapOver; std::string DefaultBackgroundBitmapView; std::string CurrentLinkTitle; + struct TFormField { + public: + TFormField(const std::string &k, const std::string &v) + :name(k),value(v) + {} + std::string name; + std::string value; + }; + + struct SFormFields { + public: + SFormFields() + { + } + + void clear() + { + Values.clear(); + } + + void add(const std::string &key, const std::string &value) + { + Values.push_back(TFormField(key, value)); + } + + std::vector Values; + }; + // Browser home std::string Home; @@ -183,6 +269,8 @@ namespace NLGUI void browseUndo (); // Redo browse: Browse the precedent url undoed. no op if none void browseRedo (); + // disable refresh button + void clearRefresh(); // clear undo/redo void clearUndoRedo(); @@ -191,6 +279,8 @@ namespace NLGUI void setURL(const std::string &url); + int luaClearRefresh(CLuaState &ls); + int luaClearUndoRedo(CLuaState &ls); int luaBrowse(CLuaState &ls); int luaRefresh(CLuaState &ls); int luaRemoveContent(CLuaState &ls); @@ -200,10 +290,14 @@ namespace NLGUI int luaBeginElement(CLuaState &ls); int luaEndElement(CLuaState &ls); int luaShowDiv(CLuaState &ls); + int luaParseHtml(CLuaState &ls); + int luaRenderHtml(CLuaState &ls); REFLECT_EXPORT_START(CGroupHTML, CGroupScrollText) REFLECT_LUA_METHOD("browse", luaBrowse) REFLECT_LUA_METHOD("refresh", luaRefresh) + REFLECT_LUA_METHOD("clearUndoRedo", luaClearUndoRedo) + REFLECT_LUA_METHOD("clearRefresh", luaClearRefresh) REFLECT_LUA_METHOD("removeContent", luaRemoveContent) REFLECT_LUA_METHOD("insertText", luaInsertText) REFLECT_LUA_METHOD("addString", luaAddString) @@ -211,8 +305,11 @@ namespace NLGUI REFLECT_LUA_METHOD("beginElement", luaBeginElement) REFLECT_LUA_METHOD("endElement", luaEndElement) REFLECT_LUA_METHOD("showDiv", luaShowDiv) + REFLECT_LUA_METHOD("parseHtml", luaParseHtml) + REFLECT_LUA_METHOD("renderHtml", luaRenderHtml) REFLECT_STRING("url", getURL, setURL) REFLECT_FLOAT("timeout", getTimeout, setTimeout) + REFLECT_STRING("title", getTitle, setTitle) REFLECT_EXPORT_END protected : @@ -228,11 +325,8 @@ namespace NLGUI // A new text block has been parsed virtual void addText (const char * buf, int len); - // A link has been parsed - virtual void addLink (uint element_number, uint attribute_number, HTChildAnchor *anchor, const BOOL *present, const char **value); - // A new begin HTML element has been parsed ( for exemple) - virtual void beginElement (uint element_number, const BOOL *present, const char **value); + virtual void beginElement (uint element_number, const std::vector &present, const std::vector &value); // A new end HTML element has been parsed ( for exemple) virtual void endElement (uint element_number); @@ -247,14 +341,21 @@ namespace NLGUI virtual void addHTTPGetParams (std::string &url, bool trustedDomain); // Add POST params to the libwww list - virtual void addHTTPPostParams (HTAssocList *formfields, bool trustedDomain); + virtual void addHTTPPostParams (SFormFields &formfields, bool trustedDomain); // the current request is terminated - virtual void requestTerminated(HTRequest *request); + virtual void requestTerminated(); + + // libxml2 html parser functions + void htmlElement(xmlNode *node, int element_number); + void htmlWalkDOM(xmlNode *a_node); // Get Home URL virtual std::string home(); + // Clear style stack and restore default style + void resetCssStyle(); + // Parse style html tag TStyle parseStyle(const std::string &str_styles); @@ -264,7 +365,7 @@ namespace NLGUI // \name internal methods // Add a group in the current parent group - void addGroup (CInterfaceGroup *group, uint beginSpace); + void addHtmlGroup (CInterfaceGroup *group, uint beginSpace); // Get the current parent group CInterfaceGroup *getCurrentGroup(); @@ -282,17 +383,19 @@ namespace NLGUI void addString(const ucstring &str); // Add an image in the current paragraph - void addImage(const char *image, bool globalColor, bool reloadImg=false); + void addImage(const std::string &id, const char *image, bool reloadImg=false, const CStyleParams &style = CStyleParams()); // Add a text area in the current paragraph - CInterfaceGroup *addTextArea (const std::string &templateName, const char *name, uint rows, uint cols, bool multiLine, const ucstring &content); + CInterfaceGroup *addTextArea (const std::string &templateName, const char *name, uint rows, uint cols, bool multiLine, const ucstring &content, uint maxlength); // Add a combo box in the current paragraph CDBGroupComboBox *addComboBox(const std::string &templateName, const char *name); + CGroupMenu *addSelectBox(const std::string &templateName, const char *name); // Add a button in the current paragraph. actionHandler, actionHandlerParams and tooltip can be NULL. CCtrlButton *addButton(CCtrlButton::EType type, const std::string &name, const std::string &normalBitmap, const std::string &pushedBitmap, - const std::string &overBitmap, bool useGlobalColor, const char *actionHandler, const char *actionHandlerParams, const char *tooltip); + const std::string &overBitmap, const char *actionHandler, const char *actionHandlerParams, const char *tooltip, + const CStyleParams &style = CStyleParams()); // Set the background color void setBackgroundColor (const NLMISC::CRGBA &bgcolor); @@ -305,6 +408,8 @@ namespace NLGUI // Set the title void setTitle (const ucstring &title); + void setTitle (const std::string &title); + std::string getTitle() const; // Lookup a url in local file system bool lookupLocalFile (std::string &result, const char *url, bool isUrl); @@ -312,8 +417,21 @@ namespace NLGUI // Delete page content and prepare next page void removeContent (); - // Current URL + // Current URL for relative links in page std::string _URL; + // Current URL + std::string _DocumentUrl; + std::string _DocumentDomain; + // Valid base href was found + bool _IgnoreBaseUrlTag; + // Fragment from loading url + std::string _UrlFragment; + std::map _Anchors; + std::vector _AnchorName; + + // Parser context + bool _ReadingHeadTag; + bool _IgnoreHeadTag; // Current DOMAIN bool _TrustedDomain; @@ -328,13 +446,22 @@ namespace NLGUI bool _BrowseNextTime; bool _PostNextTime; uint _PostFormId; + std::string _PostFormSubmitType; std::string _PostFormSubmitButton; + std::string _PostFormSubmitValue; + sint32 _PostFormSubmitX; + sint32 _PostFormSubmitY; // Browsing.. bool _Browsing; bool _Connecting; double _TimeoutValue; // the timeout in seconds double _ConnectingTimeout; + sint _RedirectsRemaining; + // Automatic page refresh + double _LastRefreshTime; + double _NextRefreshTime; + std::string _RefreshUrl; // minimal embeded lua script support // Note : any embeded script is executed immediately after the closing @@ -344,15 +471,13 @@ namespace NLGUI bool _IgnoreText; // the script to execute std::string _LuaScript; + bool _LuaHrefHack; bool _Object; std::string _ObjectScript; - // Someone is conecting. We got problem with libwww : 2 connection requests can deadlock the client. - static CGroupHTML *_ConnectingLock; - - // LibWWW data - class CLibWWWData *_LibWWW; + // Data container for active curl transfer + class CCurlWWWData * _CurlWWW; // Current paragraph std::string _DivName; @@ -374,14 +499,33 @@ namespace NLGUI return _PRE.back(); } - // UL mode - std::vector _UL; - inline bool getUL() const - { - if (_UL.empty()) - return false; - return _UL.back(); - } + // DL list + class HTMLDListElement { + public: + HTMLDListElement() + : DT(false), DD(false) + { } + + public: + bool DT; + bool DD; + }; + std::vector _DL; + + // OL and UL + class HTMLOListElement { + public: + HTMLOListElement(int start, std::string type) + : Value(start),Type(type), First(true) + { } + + std::string getListMarkerText() const; + public: + sint32 Value; + std::string Type; + bool First; + }; + std::vector _UL; // A mode std::vector _A; @@ -395,31 +539,32 @@ namespace NLGUI // IL mode bool _LI; - // Current text color - std::vector _TextColor; - inline const NLMISC::CRGBA &getTextColor() const + // Current active style + CStyleParams _Style; + // Default style + CStyleParams _StyleDefault; + // Nested style stack + std::vector _StyleParams; + inline void pushStyle() { - if (_TextColor.empty()) - return TextColor; - return _TextColor.back(); + _StyleParams.push_back(_Style); } - - // Current global color flag - std::vector _GlobalColor; - inline bool getGlobalColor() const + inline void popStyle() { - if (_GlobalColor.empty()) - return false; - return _GlobalColor.back(); + if (_StyleParams.empty()) + _Style = _StyleDefault; + else + { + _Style = _StyleParams.back(); + _StyleParams.pop_back(); + } } - // Current font size - std::vector _FontSize; - inline uint getFontSize() const + inline uint getFontSizeSmaller() const { - if (_FontSize.empty()) - return TextFontSize; - return _FontSize.back(); + if (_Style.FontSize < 5) + return 3; + return _Style.FontSize-2; } // Current link @@ -445,7 +590,15 @@ namespace NLGUI return ""; return _LinkClass.back().c_str(); } - + + std::vector _BlockLevelElement; + inline bool isBlockLevelElement() const + { + if (_BlockLevelElement.empty()) + return false; + return _BlockLevelElement.back(); + } + // Divs (i.e. interface group) std::vector _Divs; inline CInterfaceGroup *getDiv() const @@ -476,6 +629,14 @@ namespace NLGUI return _TR.back(); } + std::vector _TextShadow; + inline STextShadow getTextShadow() const + { + if (_TextShadow.empty()) + return STextShadow(); + return _TextShadow.back(); + } + // Forms class CForm { @@ -489,6 +650,10 @@ namespace NLGUI TextArea = NULL; Checkbox = NULL; ComboBox = NULL; + SelectBox = NULL; + sbRBRef = NULL; + sbMultiple = false; + sbOptionDisabled = -1; InitialSelection = 0; } @@ -507,6 +672,19 @@ namespace NLGUI // Combobox group CDBGroupComboBox *ComboBox; + // Combobox with multiple selection or display size >= 2 + CGroupMenu *SelectBox; + + // Single or multiple selections for SelectBox + bool sbMultiple; + + // Marks OPTION element as disabled + // Only valid when parsing html + sint sbOptionDisabled; + + // First radio button in SelectBox if single selection + CCtrlBaseButton *sbRBRef; + // select values (for the ' . $output; diff --git a/code/web/public_php/admin/smarty/plugins/function.html_select_date.php b/code/web/public_php/admin/smarty/plugins/function.html_select_date.php index fc2d449a8..e5eb18307 100644 --- a/code/web/public_php/admin/smarty/plugins/function.html_select_date.php +++ b/code/web/public_php/admin/smarty/plugins/function.html_select_date.php @@ -22,18 +22,22 @@ * month values (Gary Loescher) * - 1.3.1 added support for choosing format for * day values (Marcus Bointon) - * - 1.3.2 suppport negative timestamps, force year + * - 1.3.2 support negative timestamps, force year * dropdown to include given date unless explicitly set (Monte) + * - 1.3.4 fix behaviour of 0000-00-00 00:00:00 dates to match that + * of 0000-00-00 dates (cybot, boots) * @link http://smarty.php.net/manual/en/language.function.html.select.date.php {html_select_date} * (Smarty online manual) - * @version 1.3.2 - * @author Andrei Zmievski + * @version 1.3.4 + * @author Andrei Zmievski + * @author Monte Ohrt * @param array * @param Smarty * @return string */ function smarty_function_html_select_date($params, &$smarty) { + require_once $smarty->_get_plugin_filepath('shared','escape_special_chars'); require_once $smarty->_get_plugin_filepath('shared','make_timestamp'); require_once $smarty->_get_plugin_filepath('function','html_options'); /* Default values. */ @@ -78,6 +82,7 @@ function smarty_function_html_select_date($params, &$smarty) $day_empty = null; $month_empty = null; $year_empty = null; + $extra_attrs = ''; foreach ($params as $_key=>$_value) { switch ($_key) { @@ -119,24 +124,30 @@ function smarty_function_html_select_date($params, &$smarty) break; default: - $smarty->trigger_error("[html_select_date] unknown parameter $_key", E_USER_WARNING); - + if(!is_array($_value)) { + $extra_attrs .= ' '.$_key.'="'.smarty_function_escape_special_chars($_value).'"'; + } else { + $smarty->trigger_error("html_select_date: extra attribute '$_key' cannot be an array", E_USER_NOTICE); + } + break; } } - if(preg_match('!^-\d+$!',$time)) { + if (preg_match('!^-\d+$!', $time)) { // negative timestamp, use date() - $time = date('Y-m-d',$time); + $time = date('Y-m-d', $time); } // If $time is not in format yyyy-mm-dd - if (!preg_match('/^\d{0,4}-\d{0,2}-\d{0,2}$/', $time)) { + if (preg_match('/^(\d{0,4}-\d{0,2}-\d{0,2})/', $time, $found)) { + $time = $found[1]; + } else { // use smarty_make_timestamp to get an unix timestamp and // strftime to make yyyy-mm-dd $time = strftime('%Y-%m-%d', smarty_make_timestamp($time)); } // Now split this in pieces, which later can be used to set the select $time = explode("-", $time); - + // make syntax "+N" or "-N" work with start_year and end_year if (preg_match('!^(\+|\-)\s*(\d+)$!', $end_year, $match)) { if ($match[1] == '+') { @@ -152,7 +163,7 @@ function smarty_function_html_select_date($params, &$smarty) $start_year = strftime('%Y') - $match[2]; } } - if (strlen($time[0]) > 0) { + if (strlen($time[0]) > 0) { if ($start_year > $time[0] && !isset($params['start_year'])) { // force start year to include given date if not explicitly set $start_year = $time[0]; @@ -167,7 +178,9 @@ function smarty_function_html_select_date($params, &$smarty) $html_result = $month_result = $day_result = $year_result = ""; + $field_separator_count = -1; if ($display_months) { + $field_separator_count++; $month_names = array(); $month_values = array(); if(isset($month_empty)) { @@ -194,17 +207,18 @@ function smarty_function_html_select_date($params, &$smarty) if (null !== $all_extra){ $month_result .= ' ' . $all_extra; } - $month_result .= '>'."\n"; + $month_result .= $extra_attrs . '>'."\n"; $month_result .= smarty_function_html_options(array('output' => $month_names, 'values' => $month_values, - 'selected' => $a=$time[1] ? strftime($month_value_format, mktime(0, 0, 0, (int)$time[1], 1, 2000)) : '', + 'selected' => (int)$time[1] ? strftime($month_value_format, mktime(0, 0, 0, (int)$time[1], 1, 2000)) : '', 'print_result' => false), $smarty); $month_result .= ''; } if ($display_days) { + $field_separator_count++; $days = array(); if (isset($day_empty)) { $days[''] = $day_empty; @@ -230,7 +244,7 @@ function smarty_function_html_select_date($params, &$smarty) if (null !== $day_extra){ $day_result .= ' ' . $day_extra; } - $day_result .= '>'."\n"; + $day_result .= $extra_attrs . '>'."\n"; $day_result .= smarty_function_html_options(array('output' => $days, 'values' => $day_values, 'selected' => $time[2], @@ -240,6 +254,7 @@ function smarty_function_html_select_date($params, &$smarty) } if ($display_years) { + $field_separator_count++; if (null !== $field_array){ $year_name = $field_array . '[' . $prefix . 'Year]'; } else { @@ -253,7 +268,7 @@ function smarty_function_html_select_date($params, &$smarty) if (null !== $year_extra){ $year_result .= ' ' . $year_extra; } - $year_result .= '>'; + $year_result .= ' />'; } else { $years = range((int)$start_year, (int)$end_year); if ($reverse_years) { @@ -276,7 +291,7 @@ function smarty_function_html_select_date($params, &$smarty) if (null !== $year_extra){ $year_result .= ' ' . $year_extra; } - $year_result .= '>'."\n"; + $year_result .= $extra_attrs . '>'."\n"; $year_result .= smarty_function_html_options(array('output' => $years, 'values' => $yearvals, 'selected' => $time[0], @@ -303,7 +318,7 @@ function smarty_function_html_select_date($params, &$smarty) break; } // Add the field seperator - if($i != 2) { + if($i < $field_separator_count) { $html_result .= $field_separator; } } diff --git a/code/web/public_php/admin/smarty/plugins/function.html_select_time.php b/code/web/public_php/admin/smarty/plugins/function.html_select_time.php index 00cd1ae88..2e5be7efe 100644 --- a/code/web/public_php/admin/smarty/plugins/function.html_select_time.php +++ b/code/web/public_php/admin/smarty/plugins/function.html_select_time.php @@ -14,6 +14,8 @@ * Purpose: Prints the dropdowns for time selection * @link http://smarty.php.net/manual/en/language.function.html.select.time.php {html_select_time} * (Smarty online manual) + * @author Roberto Berto + * @credits Monte Ohrt * @param array * @param Smarty * @return string diff --git a/code/web/public_php/admin/smarty/plugins/function.html_table.php b/code/web/public_php/admin/smarty/plugins/function.html_table.php index 62d7410b8..32aeba83c 100644 --- a/code/web/public_php/admin/smarty/plugins/function.html_table.php +++ b/code/web/public_php/admin/smarty/plugins/function.html_table.php @@ -15,12 +15,15 @@ * Purpose: make an html table from an array of data
* Input:
* - loop = array to loop through - * - cols = number of columns + * - cols = number of columns, comma separated list of column names + * or array of column names * - rows = number of rows * - table_attr = table attributes + * - th_attr = table heading attributes (arrays are cycled) * - tr_attr = table row attributes (arrays are cycled) * - td_attr = table cell attributes (arrays are cycled) * - trailpad = value to pad trailing cells with + * - caption = text for caption element * - vdir = vertical direction (default: "down", means top-to-bottom) * - hdir = horizontal direction (default: "right", means left-to-right) * - inner = inner loop (default "cols": print $loop line by line, @@ -31,10 +34,12 @@ *
  * {table loop=$data}
  * {table loop=$data cols=4 tr_attr='"bgcolor=red"'}
- * {table loop=$data cols=4 tr_attr=$colors}
+ * {table loop=$data cols="first,second,third" tr_attr=$colors}
  * 
* @author Monte Ohrt - * @version 1.0 + * @author credit to Messju Mohr + * @author credit to boots + * @version 1.1 * @link http://smarty.php.net/manual/en/language.function.html.table.php {html_table} * (Smarty online manual) * @param array @@ -45,13 +50,15 @@ function smarty_function_html_table($params, &$smarty) { $table_attr = 'border="1"'; $tr_attr = ''; + $th_attr = ''; $td_attr = ''; - $cols = 3; + $cols = $cols_count = 3; $rows = 3; $trailpad = ' '; $vdir = 'down'; $hdir = 'right'; $inner = 'cols'; + $caption = ''; if (!isset($params['loop'])) { $smarty->trigger_error("html_table: missing 'loop' parameter"); @@ -65,6 +72,19 @@ function smarty_function_html_table($params, &$smarty) break; case 'cols': + if (is_array($_value) && !empty($_value)) { + $cols = $_value; + $cols_count = count($_value); + } elseif (!is_numeric($_value) && is_string($_value) && !empty($_value)) { + $cols = explode(',', $_value); + $cols_count = count($cols); + } elseif (!empty($_value)) { + $cols_count = (int)$_value; + } else { + $cols_count = $cols; + } + break; + case 'rows': $$_key = (int)$_value; break; @@ -74,11 +94,13 @@ function smarty_function_html_table($params, &$smarty) case 'hdir': case 'vdir': case 'inner': + case 'caption': $$_key = (string)$_value; break; case 'tr_attr': case 'td_attr': + case 'th_attr': $$_key = $_value; break; } @@ -87,25 +109,42 @@ function smarty_function_html_table($params, &$smarty) $loop_count = count($loop); if (empty($params['rows'])) { /* no rows specified */ - $rows = ceil($loop_count/$cols); + $rows = ceil($loop_count/$cols_count); } elseif (empty($params['cols'])) { if (!empty($params['rows'])) { /* no cols specified, but rows */ - $cols = ceil($loop_count/$rows); + $cols_count = ceil($loop_count/$rows); } } $output = "\n"; + if (!empty($caption)) { + $output .= '\n"; + } + + if (is_array($cols)) { + $cols = ($hdir == 'right') ? $cols : array_reverse($cols); + $output .= "\n"; + + for ($r=0; $r<$cols_count; $r++) { + $output .= ''; + $output .= $cols[$r]; + $output .= "\n"; + } + $output .= "\n"; + } + + $output .= "\n"; for ($r=0; $r<$rows; $r++) { $output .= "\n"; - $rx = ($vdir == 'down') ? $r*$cols : ($rows-1-$r)*$cols; + $rx = ($vdir == 'down') ? $r*$cols_count : ($rows-1-$r)*$cols_count; - for ($c=0; $c<$cols; $c++) { - $x = ($hdir == 'right') ? $rx+$c : $rx+$cols-1-$c; + for ($c=0; $c<$cols_count; $c++) { + $x = ($hdir == 'right') ? $rx+$c : $rx+$cols_count-1-$c; if ($inner!='cols') { /* shuffle x to loop over rows*/ - $x = floor($x/$cols) + ($x%$cols)*$rows; + $x = floor($x/$cols_count) + ($x%$cols_count)*$rows; } if ($x<$loop_count) { @@ -116,6 +155,7 @@ function smarty_function_html_table($params, &$smarty) } $output .= "\n"; } + $output .= "\n"; $output .= "
' . $caption . "
\n"; return $output; diff --git a/code/web/public_php/admin/smarty/plugins/function.mailto.php b/code/web/public_php/admin/smarty/plugins/function.mailto.php index 64c122ce4..20e9ed984 100644 --- a/code/web/public_php/admin/smarty/plugins/function.mailto.php +++ b/code/web/public_php/admin/smarty/plugins/function.mailto.php @@ -62,6 +62,8 @@ function smarty_function_mailto($params, &$smarty) // netscape and mozilla do not decode %40 (@) in BCC field (bug?) // so, don't encode it. + $search = array('%40', '%2C'); + $replace = array('@', ','); $mail_parms = array(); foreach ($params as $var=>$value) { switch ($var) { @@ -69,7 +71,7 @@ function smarty_function_mailto($params, &$smarty) case 'bcc': case 'followupto': if (!empty($value)) - $mail_parms[] = $var.'='.str_replace('%40','@',rawurlencode($value)); + $mail_parms[] = $var.'='.str_replace($search,$replace,rawurlencode($value)); break; case 'subject': diff --git a/code/web/public_php/admin/smarty/plugins/function.math.php b/code/web/public_php/admin/smarty/plugins/function.math.php index 043910770..6575e0600 100644 --- a/code/web/public_php/admin/smarty/plugins/function.math.php +++ b/code/web/public_php/admin/smarty/plugins/function.math.php @@ -14,6 +14,7 @@ * Purpose: handle math computations in template
* @link http://smarty.php.net/manual/en/language.function.math.php {math} * (Smarty online manual) + * @author Monte Ohrt * @param array * @param Smarty * @return string @@ -26,7 +27,8 @@ function smarty_function_math($params, &$smarty) return; } - $equation = $params['equation']; + // strip out backticks, not necessary for math + $equation = str_replace('`','',$params['equation']); // make sure parenthesis are balanced if (substr_count($equation,"(") != substr_count($equation,")")) { @@ -35,7 +37,7 @@ function smarty_function_math($params, &$smarty) } // match all vars in equation, make sure all are passed - preg_match_all("!(?:0x[a-fA-F0-9]+)|([a-zA-Z][a-zA-Z0-9_]+)!",$equation, $match); + preg_match_all("!(?:0x[a-fA-F0-9]+)|([a-zA-Z][a-zA-Z0-9_]*)!",$equation, $match); $allowed_funcs = array('int','abs','ceil','cos','exp','floor','log','log10', 'max','min','pi','pow','rand','round','sin','sqrt','srand','tan'); @@ -57,7 +59,7 @@ function smarty_function_math($params, &$smarty) $smarty->trigger_error("math: parameter $key: is not numeric"); return; } - $equation = preg_replace("/\b$key\b/",$val, $equation); + $equation = preg_replace("/\b$key\b/", " \$params['$key'] ", $equation); } } @@ -80,4 +82,4 @@ function smarty_function_math($params, &$smarty) /* vim: set expandtab: */ -?> +?> \ No newline at end of file diff --git a/code/web/public_php/admin/smarty/plugins/function.popup.php b/code/web/public_php/admin/smarty/plugins/function.popup.php index 2ba54de5a..3a76b785a 100644 --- a/code/web/public_php/admin/smarty/plugins/function.popup.php +++ b/code/web/public_php/admin/smarty/plugins/function.popup.php @@ -14,6 +14,7 @@ * Purpose: make text pop up in windows via overlib * @link http://smarty.php.net/manual/en/language.function.popup.php {popup} * (Smarty online manual) + * @author Monte Ohrt * @param array * @param Smarty * @return string @@ -88,6 +89,7 @@ function smarty_function_popup($params, &$smarty) case 'vauto': case 'mouseoff': case 'followmouse': + case 'closeclick': if ($_value) $append .= ',' . strtoupper($_key); break; diff --git a/code/web/public_php/admin/smarty/plugins/function.popup_init.php b/code/web/public_php/admin/smarty/plugins/function.popup_init.php index f62c33c13..93cb45450 100644 --- a/code/web/public_php/admin/smarty/plugins/function.popup_init.php +++ b/code/web/public_php/admin/smarty/plugins/function.popup_init.php @@ -14,6 +14,7 @@ * Purpose: initialize overlib * @link http://smarty.php.net/manual/en/language.function.popup.init.php {popup_init} * (Smarty online manual) + * @author Monte Ohrt * @param array * @param Smarty * @return string diff --git a/code/web/public_php/admin/smarty/plugins/modifier.capitalize.php b/code/web/public_php/admin/smarty/plugins/modifier.capitalize.php index 2b9169cef..4a611d9f0 100644 --- a/code/web/public_php/admin/smarty/plugins/modifier.capitalize.php +++ b/code/web/public_php/admin/smarty/plugins/modifier.capitalize.php @@ -14,13 +14,14 @@ * Purpose: capitalize words in the string * @link http://smarty.php.net/manual/en/language.modifiers.php#LANGUAGE.MODIFIER.CAPITALIZE * capitalize (Smarty online manual) + * @author Monte Ohrt * @param string * @return string */ function smarty_modifier_capitalize($string, $uc_digits = false) { smarty_modifier_capitalize_ucfirst(null, $uc_digits); - return preg_replace_callback('!\b\w+\b!', 'smarty_modifier_capitalize_ucfirst', $string); + return preg_replace_callback('!\'?\b\w(\w|\')*\b!', 'smarty_modifier_capitalize_ucfirst', $string); } function smarty_modifier_capitalize_ucfirst($string, $uc_digits = null) @@ -32,7 +33,7 @@ function smarty_modifier_capitalize_ucfirst($string, $uc_digits = null) return; } - if(!preg_match('!\d!',$string[0]) || $_uc_digits) + if(substr($string[0],0,1) != "'" && !preg_match("!\d!",$string[0]) || $_uc_digits) return ucfirst($string[0]); else return $string[0]; diff --git a/code/web/public_php/admin/smarty/plugins/modifier.count_characters.php b/code/web/public_php/admin/smarty/plugins/modifier.count_characters.php index 49ce655e8..5ed9a87cd 100644 --- a/code/web/public_php/admin/smarty/plugins/modifier.count_characters.php +++ b/code/web/public_php/admin/smarty/plugins/modifier.count_characters.php @@ -14,6 +14,7 @@ * Purpose: count the number of characters in a text * @link http://smarty.php.net/manual/en/language.modifier.count.characters.php * count_characters (Smarty online manual) + * @author Monte Ohrt * @param string * @param boolean include whitespace in the character count * @return integer diff --git a/code/web/public_php/admin/smarty/plugins/modifier.count_paragraphs.php b/code/web/public_php/admin/smarty/plugins/modifier.count_paragraphs.php index 6a9833c97..e0e274da7 100644 --- a/code/web/public_php/admin/smarty/plugins/modifier.count_paragraphs.php +++ b/code/web/public_php/admin/smarty/plugins/modifier.count_paragraphs.php @@ -14,6 +14,7 @@ * Purpose: count the number of paragraphs in a text * @link http://smarty.php.net/manual/en/language.modifier.count.paragraphs.php * count_paragraphs (Smarty online manual) + * @author Monte Ohrt * @param string * @return integer */ diff --git a/code/web/public_php/admin/smarty/plugins/modifier.count_sentences.php b/code/web/public_php/admin/smarty/plugins/modifier.count_sentences.php index 0c210f08f..f66ea1703 100644 --- a/code/web/public_php/admin/smarty/plugins/modifier.count_sentences.php +++ b/code/web/public_php/admin/smarty/plugins/modifier.count_sentences.php @@ -14,6 +14,7 @@ * Purpose: count the number of sentences in a text * @link http://smarty.php.net/manual/en/language.modifier.count.paragraphs.php * count_sentences (Smarty online manual) + * @author Monte Ohrt * @param string * @return integer */ diff --git a/code/web/public_php/admin/smarty/plugins/modifier.count_words.php b/code/web/public_php/admin/smarty/plugins/modifier.count_words.php index 42c8a741c..9d339f542 100644 --- a/code/web/public_php/admin/smarty/plugins/modifier.count_words.php +++ b/code/web/public_php/admin/smarty/plugins/modifier.count_words.php @@ -14,6 +14,7 @@ * Purpose: count the number of words in a text * @link http://smarty.php.net/manual/en/language.modifier.count.words.php * count_words (Smarty online manual) + * @author Monte Ohrt * @param string * @return integer */ diff --git a/code/web/public_php/admin/smarty/plugins/modifier.date_format.php b/code/web/public_php/admin/smarty/plugins/modifier.date_format.php index 2f36b3b79..8cf7d5e14 100644 --- a/code/web/public_php/admin/smarty/plugins/modifier.date_format.php +++ b/code/web/public_php/admin/smarty/plugins/modifier.date_format.php @@ -8,7 +8,7 @@ /** * Include the {@link shared.make_timestamp.php} plugin */ -require_once $smarty->_get_plugin_filepath('shared','make_timestamp'); +require_once $smarty->_get_plugin_filepath('shared', 'make_timestamp'); /** * Smarty date_format modifier plugin * @@ -21,26 +21,36 @@ require_once $smarty->_get_plugin_filepath('shared','make_timestamp'); * - default_date: default date if $string is empty * @link http://smarty.php.net/manual/en/language.modifier.date.format.php * date_format (Smarty online manual) + * @author Monte Ohrt * @param string * @param string * @param string * @return string|void * @uses smarty_make_timestamp() */ -function smarty_modifier_date_format($string, $format="%b %e, %Y", $default_date=null) +function smarty_modifier_date_format($string, $format = '%b %e, %Y', $default_date = '') { - if (substr(PHP_OS,0,3) == 'WIN') { - $_win_from = array ('%e', '%T', '%D'); - $_win_to = array ('%#d', '%H:%M:%S', '%m/%d/%y'); - $format = str_replace($_win_from, $_win_to, $format); - } - if($string != '') { - return strftime($format, smarty_make_timestamp($string)); - } elseif (isset($default_date) && $default_date != '') { - return strftime($format, smarty_make_timestamp($default_date)); + if ($string != '') { + $timestamp = smarty_make_timestamp($string); + } elseif ($default_date != '') { + $timestamp = smarty_make_timestamp($default_date); } else { return; } + if (DIRECTORY_SEPARATOR == '\\') { + $_win_from = array('%D', '%h', '%n', '%r', '%R', '%t', '%T'); + $_win_to = array('%m/%d/%y', '%b', "\n", '%I:%M:%S %p', '%H:%M', "\t", '%H:%M:%S'); + if (strpos($format, '%e') !== false) { + $_win_from[] = '%e'; + $_win_to[] = sprintf('%\' 2d', date('j', $timestamp)); + } + if (strpos($format, '%l') !== false) { + $_win_from[] = '%l'; + $_win_to[] = sprintf('%\' 2d', date('h', $timestamp)); + } + $format = str_replace($_win_from, $_win_to, $format); + } + return strftime($format, $timestamp); } /* vim: set expandtab: */ diff --git a/code/web/public_php/admin/smarty/plugins/modifier.debug_print_var.php b/code/web/public_php/admin/smarty/plugins/modifier.debug_print_var.php index b9bb18488..e4f7bc0cc 100644 --- a/code/web/public_php/admin/smarty/plugins/modifier.debug_print_var.php +++ b/code/web/public_php/admin/smarty/plugins/modifier.debug_print_var.php @@ -14,6 +14,7 @@ * Purpose: formats variable contents for display in the console * @link http://smarty.php.net/manual/en/language.modifier.debug.print.var.php * debug_print_var (Smarty online manual) + * @author Monte Ohrt * @param array|object * @param integer * @param integer @@ -21,33 +22,66 @@ */ function smarty_modifier_debug_print_var($var, $depth = 0, $length = 40) { - $_replace = array("\n"=>'\n', "\r"=>'\r', "\t"=>'\t'); - if (is_array($var)) { - $results = "Array (".count($var).")"; - foreach ($var as $curr_key => $curr_val) { - $return = smarty_modifier_debug_print_var($curr_val, $depth+1, $length); - $results .= "
".str_repeat(' ', $depth*2)."".strtr($curr_key, $_replace)." => $return"; - } - } else if (is_object($var)) { - $object_vars = get_object_vars($var); - $results = "".get_class($var)." Object (".count($object_vars).")"; - foreach ($object_vars as $curr_key => $curr_val) { - $return = smarty_modifier_debug_print_var($curr_val, $depth+1, $length); - $results .= "
".str_repeat(' ', $depth*2)."$curr_key => $return"; - } - } else if (is_resource($var)) { - $results = ''.(string)$var.''; - } else if (empty($var) && $var != "0") { - $results = 'empty'; - } else { - if (strlen($var) > $length ) { - $results = substr($var, 0, $length-3).'...'; - } else { - $results = $var; - } - $results = htmlspecialchars($results); - $results = strtr($results, $_replace); + $_replace = array( + "\n" => '\n', + "\r" => '\r', + "\t" => '\t' + ); + + switch (gettype($var)) { + case 'array' : + $results = 'Array (' . count($var) . ')'; + foreach ($var as $curr_key => $curr_val) { + $results .= '
' . str_repeat(' ', $depth * 2) + . '' . strtr($curr_key, $_replace) . ' => ' + . smarty_modifier_debug_print_var($curr_val, ++$depth, $length); + $depth--; + } + break; + case 'object' : + $object_vars = get_object_vars($var); + $results = '' . get_class($var) . ' Object (' . count($object_vars) . ')'; + foreach ($object_vars as $curr_key => $curr_val) { + $results .= '
' . str_repeat(' ', $depth * 2) + . ' ->' . strtr($curr_key, $_replace) . ' = ' + . smarty_modifier_debug_print_var($curr_val, ++$depth, $length); + $depth--; + } + break; + case 'boolean' : + case 'NULL' : + case 'resource' : + if (true === $var) { + $results = 'true'; + } elseif (false === $var) { + $results = 'false'; + } elseif (null === $var) { + $results = 'null'; + } else { + $results = htmlspecialchars((string) $var); + } + $results = '' . $results . ''; + break; + case 'integer' : + case 'float' : + $results = htmlspecialchars((string) $var); + break; + case 'string' : + $results = strtr($var, $_replace); + if (strlen($var) > $length ) { + $results = substr($var, 0, $length - 3) . '...'; + } + $results = htmlspecialchars('"' . $results . '"'); + break; + case 'unknown type' : + default : + $results = strtr((string) $var, $_replace); + if (strlen($results) > $length ) { + $results = substr($results, 0, $length - 3) . '...'; + } + $results = htmlspecialchars($results); } + return $results; } diff --git a/code/web/public_php/admin/smarty/plugins/modifier.default.php b/code/web/public_php/admin/smarty/plugins/modifier.default.php index 8268e396f..70011fd6b 100644 --- a/code/web/public_php/admin/smarty/plugins/modifier.default.php +++ b/code/web/public_php/admin/smarty/plugins/modifier.default.php @@ -14,6 +14,7 @@ * Purpose: designate default value for empty variables * @link http://smarty.php.net/manual/en/language.modifier.default.php * default (Smarty online manual) + * @author Monte Ohrt * @param string * @param string * @return string diff --git a/code/web/public_php/admin/smarty/plugins/modifier.escape.php b/code/web/public_php/admin/smarty/plugins/modifier.escape.php index a32a8766c..a2f52b232 100644 --- a/code/web/public_php/admin/smarty/plugins/modifier.escape.php +++ b/code/web/public_php/admin/smarty/plugins/modifier.escape.php @@ -14,22 +14,26 @@ * Purpose: Escape the string according to escapement type * @link http://smarty.php.net/manual/en/language.modifier.escape.php * escape (Smarty online manual) + * @author Monte Ohrt * @param string * @param html|htmlall|url|quotes|hex|hexentity|javascript * @return string */ -function smarty_modifier_escape($string, $esc_type = 'html') +function smarty_modifier_escape($string, $esc_type = 'html', $char_set = 'ISO-8859-1') { switch ($esc_type) { case 'html': - return htmlspecialchars($string, ENT_QUOTES); + return htmlspecialchars($string, ENT_QUOTES, $char_set); case 'htmlall': - return htmlentities($string, ENT_QUOTES); + return htmlentities($string, ENT_QUOTES, $char_set); case 'url': return rawurlencode($string); + case 'urlpathinfo': + return str_replace('%2F','/',rawurlencode($string)); + case 'quotes': // escape unescaped single quotes return preg_replace("%(?= 126){ $_res .= '&#' . $_ord . ';'; } else { - $_res .= $string{$_i}; + $_res .= substr($string, $_i, 1); } } return $_res; diff --git a/code/web/public_php/admin/smarty/plugins/modifier.indent.php b/code/web/public_php/admin/smarty/plugins/modifier.indent.php index 1642bac3d..394147a29 100644 --- a/code/web/public_php/admin/smarty/plugins/modifier.indent.php +++ b/code/web/public_php/admin/smarty/plugins/modifier.indent.php @@ -14,6 +14,7 @@ * Purpose: indent lines of text * @link http://smarty.php.net/manual/en/language.modifier.indent.php * indent (Smarty online manual) + * @author Monte Ohrt * @param string * @param integer * @param string diff --git a/code/web/public_php/admin/smarty/plugins/modifier.lower.php b/code/web/public_php/admin/smarty/plugins/modifier.lower.php index 0b4d1517d..20e7a8d39 100644 --- a/code/web/public_php/admin/smarty/plugins/modifier.lower.php +++ b/code/web/public_php/admin/smarty/plugins/modifier.lower.php @@ -14,6 +14,7 @@ * Purpose: convert string to lowercase * @link http://smarty.php.net/manual/en/language.modifier.lower.php * lower (Smarty online manual) + * @author Monte Ohrt * @param string * @return string */ diff --git a/code/web/public_php/admin/smarty/plugins/modifier.regex_replace.php b/code/web/public_php/admin/smarty/plugins/modifier.regex_replace.php index 7eee497c8..100b58ce4 100644 --- a/code/web/public_php/admin/smarty/plugins/modifier.regex_replace.php +++ b/code/web/public_php/admin/smarty/plugins/modifier.regex_replace.php @@ -11,9 +11,10 @@ * * Type: modifier
* Name: regex_replace
- * Purpose: regular epxression search/replace + * Purpose: regular expression search/replace * @link http://smarty.php.net/manual/en/language.modifier.regex.replace.php * regex_replace (Smarty online manual) + * @author Monte Ohrt * @param string * @param string|array * @param string|array @@ -21,11 +22,25 @@ */ function smarty_modifier_regex_replace($string, $search, $replace) { - if (preg_match('!\W(\w+)$!s', $search, $match) && (strpos($match[1], 'e') !== false)) { + if(is_array($search)) { + foreach($search as $idx => $s) + $search[$idx] = _smarty_regex_replace_check($s); + } else { + $search = _smarty_regex_replace_check($search); + } + + return preg_replace($search, $replace, $string); +} + +function _smarty_regex_replace_check($search) +{ + if (($pos = strpos($search,"\0")) !== false) + $search = substr($search,0,$pos); + if (preg_match('!([a-zA-Z\s]+)$!s', $search, $match) && (strpos($match[1], 'e') !== false)) { /* remove eval-modifier from $search */ - $search = substr($search, 0, -strlen($match[1])) . str_replace('e', '', $match[1]); + $search = substr($search, 0, -strlen($match[1])) . preg_replace('![e\s]+!', '', $match[1]); } - return preg_replace($search, $replace, $string); + return $search; } /* vim: set expandtab: */ diff --git a/code/web/public_php/admin/smarty/plugins/modifier.replace.php b/code/web/public_php/admin/smarty/plugins/modifier.replace.php index 2a43515f7..df041c884 100644 --- a/code/web/public_php/admin/smarty/plugins/modifier.replace.php +++ b/code/web/public_php/admin/smarty/plugins/modifier.replace.php @@ -14,6 +14,7 @@ * Purpose: simple search/replace * @link http://smarty.php.net/manual/en/language.modifier.replace.php * replace (Smarty online manual) + * @author Monte Ohrt * @param string * @param string * @param string diff --git a/code/web/public_php/admin/smarty/plugins/modifier.spacify.php b/code/web/public_php/admin/smarty/plugins/modifier.spacify.php index dad057f9b..c2423f4f2 100644 --- a/code/web/public_php/admin/smarty/plugins/modifier.spacify.php +++ b/code/web/public_php/admin/smarty/plugins/modifier.spacify.php @@ -14,6 +14,7 @@ * Purpose: add spaces between characters in a string * @link http://smarty.php.net/manual/en/language.modifier.spacify.php * spacify (Smarty online manual) + * @author Monte Ohrt * @param string * @param string * @return string diff --git a/code/web/public_php/admin/smarty/plugins/modifier.string_format.php b/code/web/public_php/admin/smarty/plugins/modifier.string_format.php index efd621506..9e051a578 100644 --- a/code/web/public_php/admin/smarty/plugins/modifier.string_format.php +++ b/code/web/public_php/admin/smarty/plugins/modifier.string_format.php @@ -14,6 +14,7 @@ * Purpose: format strings via sprintf * @link http://smarty.php.net/manual/en/language.modifier.string.format.php * string_format (Smarty online manual) + * @author Monte Ohrt * @param string * @param string * @return string diff --git a/code/web/public_php/admin/smarty/plugins/modifier.strip_tags.php b/code/web/public_php/admin/smarty/plugins/modifier.strip_tags.php index 45f1ec14d..93011a892 100644 --- a/code/web/public_php/admin/smarty/plugins/modifier.strip_tags.php +++ b/code/web/public_php/admin/smarty/plugins/modifier.strip_tags.php @@ -14,6 +14,7 @@ * Purpose: strip html tags from text * @link http://smarty.php.net/manual/en/language.modifier.strip.tags.php * strip_tags (Smarty online manual) + * @author Monte Ohrt * @param string * @param boolean * @return string diff --git a/code/web/public_php/admin/smarty/plugins/modifier.truncate.php b/code/web/public_php/admin/smarty/plugins/modifier.truncate.php index 15a26ba97..35c89690a 100644 --- a/code/web/public_php/admin/smarty/plugins/modifier.truncate.php +++ b/code/web/public_php/admin/smarty/plugins/modifier.truncate.php @@ -13,29 +13,36 @@ * Name: truncate
* Purpose: Truncate a string to a certain length if necessary, * optionally splitting in the middle of a word, and - * appending the $etc string. + * appending the $etc string or inserting $etc into the middle. * @link http://smarty.php.net/manual/en/language.modifier.truncate.php * truncate (Smarty online manual) + * @author Monte Ohrt * @param string * @param integer * @param string * @param boolean + * @param boolean * @return string */ function smarty_modifier_truncate($string, $length = 80, $etc = '...', - $break_words = false) + $break_words = false, $middle = false) { if ($length == 0) return ''; if (strlen($string) > $length) { - $length -= strlen($etc); - if (!$break_words) + $length -= min($length, strlen($etc)); + if (!$break_words && !$middle) { $string = preg_replace('/\s+?(\S+)?$/', '', substr($string, 0, $length+1)); - - return substr($string, 0, $length).$etc; - } else + } + if(!$middle) { + return substr($string, 0, $length) . $etc; + } else { + return substr($string, 0, $length/2) . $etc . substr($string, -$length/2); + } + } else { return $string; + } } /* vim: set expandtab: */ diff --git a/code/web/public_php/admin/smarty/plugins/modifier.upper.php b/code/web/public_php/admin/smarty/plugins/modifier.upper.php index 69960ae72..c12480fbd 100644 --- a/code/web/public_php/admin/smarty/plugins/modifier.upper.php +++ b/code/web/public_php/admin/smarty/plugins/modifier.upper.php @@ -14,6 +14,7 @@ * Purpose: convert string to uppercase * @link http://smarty.php.net/manual/en/language.modifier.upper.php * upper (Smarty online manual) + * @author Monte Ohrt * @param string * @return string */ diff --git a/code/web/public_php/admin/smarty/plugins/modifier.wordwrap.php b/code/web/public_php/admin/smarty/plugins/modifier.wordwrap.php index b9a9fe94b..ce0718156 100644 --- a/code/web/public_php/admin/smarty/plugins/modifier.wordwrap.php +++ b/code/web/public_php/admin/smarty/plugins/modifier.wordwrap.php @@ -14,6 +14,7 @@ * Purpose: wrap a string of text at a given length * @link http://smarty.php.net/manual/en/language.modifier.wordwrap.php * wordwrap (Smarty online manual) + * @author Monte Ohrt * @param string * @param integer * @param string diff --git a/code/web/public_php/admin/smarty/plugins/outputfilter.trimwhitespace.php b/code/web/public_php/admin/smarty/plugins/outputfilter.trimwhitespace.php index 01e35e03d..739fa39b0 100644 --- a/code/web/public_php/admin/smarty/plugins/outputfilter.trimwhitespace.php +++ b/code/web/public_php/admin/smarty/plugins/outputfilter.trimwhitespace.php @@ -28,35 +28,35 @@ function smarty_outputfilter_trimwhitespace($source, &$smarty) { // Pull out the script blocks - preg_match_all("!]+>.*?!is", $source, $match); + preg_match_all("!]*?>.*?!is", $source, $match); $_script_blocks = $match[0]; - $source = preg_replace("!]+>.*?!is", + $source = preg_replace("!]*?>.*?!is", '@@@SMARTY:TRIM:SCRIPT@@@', $source); // Pull out the pre blocks - preg_match_all("!
.*?
!is", $source, $match); + preg_match_all("!]*?>.*?!is", $source, $match); $_pre_blocks = $match[0]; - $source = preg_replace("!
.*?
!is", + $source = preg_replace("!]*?>.*?!is", '@@@SMARTY:TRIM:PRE@@@', $source); - + // Pull out the textarea blocks - preg_match_all("!]+>.*?!is", $source, $match); + preg_match_all("!]*?>.*?!is", $source, $match); $_textarea_blocks = $match[0]; - $source = preg_replace("!]+>.*?!is", + $source = preg_replace("!]*?>.*?!is", '@@@SMARTY:TRIM:TEXTAREA@@@', $source); // remove all leading spaces, tabs and carriage returns NOT // preceeded by a php close tag. $source = trim(preg_replace('/((?)\n)[\s]+/m', '\1', $source)); - // replace script blocks - smarty_outputfilter_trimwhitespace_replace("@@@SMARTY:TRIM:SCRIPT@@@",$_script_blocks, $source); + // replace textarea blocks + smarty_outputfilter_trimwhitespace_replace("@@@SMARTY:TRIM:TEXTAREA@@@",$_textarea_blocks, $source); // replace pre blocks smarty_outputfilter_trimwhitespace_replace("@@@SMARTY:TRIM:PRE@@@",$_pre_blocks, $source); - // replace textarea blocks - smarty_outputfilter_trimwhitespace_replace("@@@SMARTY:TRIM:TEXTAREA@@@",$_textarea_blocks, $source); + // replace script blocks + smarty_outputfilter_trimwhitespace_replace("@@@SMARTY:TRIM:SCRIPT@@@",$_script_blocks, $source); return $source; } diff --git a/code/web/public_php/admin/smarty/plugins/shared.escape_special_chars.php b/code/web/public_php/admin/smarty/plugins/shared.escape_special_chars.php index 515763abe..c07ce31be 100644 --- a/code/web/public_php/admin/smarty/plugins/shared.escape_special_chars.php +++ b/code/web/public_php/admin/smarty/plugins/shared.escape_special_chars.php @@ -12,6 +12,7 @@ * Function: smarty_function_escape_special_chars
* Purpose: used by other smarty functions to escape * special chars except for already escaped ones + * @author Monte Ohrt * @param string * @return string */ diff --git a/code/web/public_php/admin/smarty/plugins/shared.make_timestamp.php b/code/web/public_php/admin/smarty/plugins/shared.make_timestamp.php index acdd77735..b42eb11d8 100644 --- a/code/web/public_php/admin/smarty/plugins/shared.make_timestamp.php +++ b/code/web/public_php/admin/smarty/plugins/shared.make_timestamp.php @@ -10,32 +10,35 @@ * Function: smarty_make_timestamp
* Purpose: used by other smarty functions to make a timestamp * from a string. + * @author Monte Ohrt * @param string * @return string */ function smarty_make_timestamp($string) { if(empty($string)) { - $string = "now"; - } - $time = strtotime($string); - if (is_numeric($time) && $time != -1) - return $time; - - // is mysql timestamp format of YYYYMMDDHHMMSS? - if (preg_match('/^\d{14}$/', $string)) { - $time = mktime(substr($string,8,2),substr($string,10,2),substr($string,12,2), - substr($string,4,2),substr($string,6,2),substr($string,0,4)); + // use "now": + $time = time(); - return $time; + } elseif (preg_match('/^\d{14}$/', $string)) { + // it is mysql timestamp format of YYYYMMDDHHMMSS? + $time = mktime(substr($string, 8, 2),substr($string, 10, 2),substr($string, 12, 2), + substr($string, 4, 2),substr($string, 6, 2),substr($string, 0, 4)); + + } elseif (is_numeric($string)) { + // it is a numeric string, we handle it as timestamp + $time = (int)$string; + + } else { + // strtotime should handle it + $time = strtotime($string); + if ($time == -1 || $time === false) { + // strtotime() was not able to parse $string, use "now": + $time = time(); + } } + return $time; - // couldn't recognize it, try to return a time - $time = (int) $string; - if ($time > 0) - return $time; - else - return time(); } /* vim: set expandtab: */ diff --git a/code/web/public_php/admin/templates/default/index_login.tpl b/code/web/public_php/admin/templates/default/index_login.tpl index f62a03998..7b18df28e 100644 --- a/code/web/public_php/admin/templates/default/index_login.tpl +++ b/code/web/public_php/admin/templates/default/index_login.tpl @@ -1,25 +1,25 @@ - -{include file="page_header_light.tpl"} - -

Shard Administration Website

- -

Use login: guest and password: guest to login.

- - - - - - - - - - - - - - - -
Login:
Password:
  -
- -{include file="page_footer_light.tpl"} + +{include file="page_header_light.tpl"} + +

Shard Administration Website

+ +

Use login: guest and password: guest to login.

+ + + + + + + + + + + + + + + +
Login:
Password:
  +
+ +{include file="page_footer_light.tpl"} diff --git a/code/web/public_php/admin/templates/default/tool_actions.tpl b/code/web/public_php/admin/templates/default/tool_actions.tpl index a8c9e614a..3ceacb946 100644 --- a/code/web/public_php/admin/templates/default/tool_actions.tpl +++ b/code/web/public_php/admin/templates/default/tool_actions.tpl @@ -1,6 +1,6 @@ - -{include file="page_header.tpl"} - - - -{include file="page_footer.tpl"} + +{include file="page_header.tpl"} + + + +{include file="page_footer.tpl"} diff --git a/code/web/public_php/admin/templates/default/tool_administration_applications.tpl b/code/web/public_php/admin/templates/default/tool_administration_applications.tpl index 824d34325..45dc12839 100644 --- a/code/web/public_php/admin/templates/default/tool_administration_applications.tpl +++ b/code/web/public_php/admin/templates/default/tool_administration_applications.tpl @@ -1,115 +1,115 @@ - -{include file="page_header.tpl"} - - - - - - -
{$tool_alert_message} - - - {section name=onemenu loop=$tool_menu} - - {/section} - -
{$tool_menu[onemenu].title}
-
- -
- - - - - - - - - -
- - - - - - - - - - - - - -{section name=application loop=$tool_application_list} -{cycle assign="trclass" values="row1,row0"} - - - - - - - - - -{/section} -
Applications
IDNameURIRestrictionIconOrderVisible
{$tool_application_list[application].application_id}{$tool_application_list[application].application_name}{$tool_application_list[application].application_uri}{$tool_application_list[application].application_restriction}{$tool_application_list[application].application_icon}{$tool_application_list[application].application_order}{if $tool_application_list[application].application_visible == 1}Yes{else}No{/if}
-
- - - - - -{if $tool_application_edit_data.application_id} - - - - -{/if} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Applications Details
Id :
Name :
URI :
Restriction :
Icon :
Order :
Visible : - -
  - -{if $tool_application_edit_data.application_id} - - -{else} - - -{/if} - -
-
- -{include file="page_footer.tpl"} + +{include file="page_header.tpl"} + + + + + + +
{$tool_alert_message} + + + {section name=onemenu loop=$tool_menu} + + {/section} + +
{$tool_menu[onemenu].title}
+
+ +
+ + + + + + + + + +
+ + + + + + + + + + + + + +{section name=application loop=$tool_application_list} +{cycle assign="trclass" values="row1,row0"} + + + + + + + + + +{/section} +
Applications
IDNameURIRestrictionIconOrderVisible
{$tool_application_list[application].application_id}{$tool_application_list[application].application_name}{$tool_application_list[application].application_uri}{$tool_application_list[application].application_restriction}{$tool_application_list[application].application_icon}{$tool_application_list[application].application_order}{if $tool_application_list[application].application_visible == 1}Yes{else}No{/if}
+
+ + + + + +{if $tool_application_edit_data.application_id} + + + + +{/if} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Applications Details
Id :
Name :
URI :
Restriction :
Icon :
Order :
Visible : + +
  + +{if $tool_application_edit_data.application_id} + + +{else} + + +{/if} + +
+
+ +{include file="page_footer.tpl"} diff --git a/code/web/public_php/admin/templates/default/tool_administration_domains.tpl b/code/web/public_php/admin/templates/default/tool_administration_domains.tpl index 3262aee9d..fa61386a5 100644 --- a/code/web/public_php/admin/templates/default/tool_administration_domains.tpl +++ b/code/web/public_php/admin/templates/default/tool_administration_domains.tpl @@ -1,185 +1,185 @@ - -{include file="page_header.tpl"} - - - - - - -
{$tool_alert_message} - - - {section name=onemenu loop=$tool_menu} - - {/section} - -
{$tool_menu[onemenu].title}
-
- -
- - - - - - - - - -
- - - - - - - - - - - - - - - - - - -{section name=domain loop=$tool_domain_list} -{cycle assign="trclass" values="row1,row0"} - - - - - - - - - - - - - - -{/section} -
Domains
IDNameApplicationAS HostAS PortMFS WebRRD PathLAS Admin PathLAS Local PathRing DBCS DBHD Check
{$tool_domain_list[domain].domain_id}{$tool_domain_list[domain].domain_name}{$tool_domain_list[domain].domain_application}{$tool_domain_list[domain].domain_as_host}{$tool_domain_list[domain].domain_as_port}{$tool_domain_list[domain].domain_mfs_web}{$tool_domain_list[domain].domain_rrd_path}{$tool_domain_list[domain].domain_las_admin_path}{$tool_domain_list[domain].domain_las_local_path}{if $tool_domain_list[domain].domain_sql_string != ''}True{else}False{/if}{if $tool_domain_list[domain].domain_cs_sql_string != ''}True{else}False{/if}{if $tool_domain_list[domain].domain_hd_check == 1}Yes{else}No{/if}
-
- - - - - -{if $tool_domain_edit_data.domain_id} - - - - -{/if} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Domain Details
Id :
Name :
Application :
AS Host :
AS Port :
MFS Web :
RRD Path :
LAS Admin Path :
LAS Local Path :
Ring DB String :
CS DB String :
HD Check : - -
  - -{if $tool_domain_edit_data.domain_id} - - -{else} - - -{/if} - -
- -{if $tool_domain_nel_data} -
- - - - - - - - - - - - - - - - - - - - - - - -
Domain Data
ID :
Name :
Status : -
  - - -
-{/if} - -
- -{include file="page_footer.tpl"} + +{include file="page_header.tpl"} + + + + + + +
{$tool_alert_message} + + + {section name=onemenu loop=$tool_menu} + + {/section} + +
{$tool_menu[onemenu].title}
+
+ +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +{section name=domain loop=$tool_domain_list} +{cycle assign="trclass" values="row1,row0"} + + + + + + + + + + + + + + +{/section} +
Domains
IDNameApplicationAS HostAS PortMFS WebRRD PathLAS Admin PathLAS Local PathRing DBCS DBHD Check
{$tool_domain_list[domain].domain_id}{$tool_domain_list[domain].domain_name}{$tool_domain_list[domain].domain_application}{$tool_domain_list[domain].domain_as_host}{$tool_domain_list[domain].domain_as_port}{$tool_domain_list[domain].domain_mfs_web}{$tool_domain_list[domain].domain_rrd_path}{$tool_domain_list[domain].domain_las_admin_path}{$tool_domain_list[domain].domain_las_local_path}{if $tool_domain_list[domain].domain_sql_string != ''}True{else}False{/if}{if $tool_domain_list[domain].domain_cs_sql_string != ''}True{else}False{/if}{if $tool_domain_list[domain].domain_hd_check == 1}Yes{else}No{/if}
+
+ + + + + +{if $tool_domain_edit_data.domain_id} + + + + +{/if} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Domain Details
Id :
Name :
Application :
AS Host :
AS Port :
MFS Web :
RRD Path :
LAS Admin Path :
LAS Local Path :
Ring DB String :
CS DB String :
HD Check : + +
  + +{if $tool_domain_edit_data.domain_id} + + +{else} + + +{/if} + +
+ +{if $tool_domain_nel_data} +
+ + + + + + + + + + + + + + + + + + + + + + + +
Domain Data
ID :
Name :
Status : +
  + + +
+{/if} + +
+ +{include file="page_footer.tpl"} diff --git a/code/web/public_php/admin/templates/default/tool_administration_groups.tpl b/code/web/public_php/admin/templates/default/tool_administration_groups.tpl index 3dedf7067..be7235734 100644 --- a/code/web/public_php/admin/templates/default/tool_administration_groups.tpl +++ b/code/web/public_php/admin/templates/default/tool_administration_groups.tpl @@ -1,334 +1,334 @@ - -{include file="page_header.tpl"} - - - - - - -
{$tool_alert_message} - - - {section name=onemenu loop=$tool_menu} - - {/section} - -
{$tool_menu[onemenu].title}
-
- -
- - - - - - - - - -
- - - - - - - - - - - -{section name=group loop=$tool_group_list} -{cycle assign="trclass" values="row1,row0"} - - - - - - - -{/section} -
Groups
IDNameLevelDefaultActive
{$tool_group_list[group].group_id}{$tool_group_list[group].group_name}{$tool_group_list[group].group_level_name}{if $tool_group_list[group].group_default == 1}Yes{else}No{/if}{if $tool_group_list[group].group_active == 1}Yes{else}No{/if}
- -{if $tool_group_user_list} -
- - - - - - - - - - - - - -{section name=user loop=$tool_group_user_list} -{cycle assign="trclass2" values="row1,row0"} - - - - -{if $tool_group_user_list[user].user_logged_last > 0} - -{else} - -{/if} - - - -{/section} -
Accounts
IDLoginCreatedLast LoggedNum LogsActive
{$tool_group_user_list[user].user_id}{$tool_group_user_list[user].user_name}{$tool_group_user_list[user].user_created|date_format:"%Y/%m/%d %H:%M:%S"}{$tool_group_user_list[user].user_logged_last|date_format:"%Y/%m/%d %H:%M:%S"}never{$tool_group_user_list[user].user_logged_count}{if $tool_group_user_list[user].user_active == 1}Yes{else}No{/if}
-{/if} - -
- - - - - -{if $tool_group_edit_data.group_id} - - - - -{/if} - - - - - - - - - - - - - - - - - - - - - -
Group Details
Id :
Name :
Level : - -
Default : - -
Active : - -
  - -{if $tool_group_edit_data.group_id} - - -{else} - - -{/if} - -
- -{if $tool_group_edit_data.group_id} - -
- - - - - - - - - - - - - - -
Default Domain
Domains : - -
  - - -
- -{if $tool_group_edit_data.group_default_domain_id > 0} -
- - - - - - - - - - - - - - -
Default Shard
Shards : - -
  - - -
-{/if} - -
- - - - - - - - - - - - - - -
Default Application
Application : - -
  - - -
- -
- - - - - - - - - - - - - - -
Application Access
Applications : - -
  - - -
- -
- - - - - - - - - - - - - - -
Domain Access
Domains : - -
  - - -
- -
- - - - - - - - - - - - - - -
Shard Access
Shards : - -
  - - -
- -{/if} - -
- -{include file="page_footer.tpl"} + +{include file="page_header.tpl"} + + + + + + +
{$tool_alert_message} + + + {section name=onemenu loop=$tool_menu} + + {/section} + +
{$tool_menu[onemenu].title}
+
+ +
+ + + + + + + + + +
+ + + + + + + + + + + +{section name=group loop=$tool_group_list} +{cycle assign="trclass" values="row1,row0"} + + + + + + + +{/section} +
Groups
IDNameLevelDefaultActive
{$tool_group_list[group].group_id}{$tool_group_list[group].group_name}{$tool_group_list[group].group_level_name}{if $tool_group_list[group].group_default == 1}Yes{else}No{/if}{if $tool_group_list[group].group_active == 1}Yes{else}No{/if}
+ +{if $tool_group_user_list} +
+ + + + + + + + + + + + + +{section name=user loop=$tool_group_user_list} +{cycle assign="trclass2" values="row1,row0"} + + + + +{if $tool_group_user_list[user].user_logged_last > 0} + +{else} + +{/if} + + + +{/section} +
Accounts
IDLoginCreatedLast LoggedNum LogsActive
{$tool_group_user_list[user].user_id}{$tool_group_user_list[user].user_name}{$tool_group_user_list[user].user_created|date_format:"%Y/%m/%d %H:%M:%S"}{$tool_group_user_list[user].user_logged_last|date_format:"%Y/%m/%d %H:%M:%S"}never{$tool_group_user_list[user].user_logged_count}{if $tool_group_user_list[user].user_active == 1}Yes{else}No{/if}
+{/if} + +
+ + + + + +{if $tool_group_edit_data.group_id} + + + + +{/if} + + + + + + + + + + + + + + + + + + + + + +
Group Details
Id :
Name :
Level : + +
Default : + +
Active : + +
  + +{if $tool_group_edit_data.group_id} + + +{else} + + +{/if} + +
+ +{if $tool_group_edit_data.group_id} + +
+ + + + + + + + + + + + + + +
Default Domain
Domains : + +
  + + +
+ +{if $tool_group_edit_data.group_default_domain_id > 0} +
+ + + + + + + + + + + + + + +
Default Shard
Shards : + +
  + + +
+{/if} + +
+ + + + + + + + + + + + + + +
Default Application
Application : + +
  + + +
+ +
+ + + + + + + + + + + + + + +
Application Access
Applications : + +
  + + +
+ +
+ + + + + + + + + + + + + + +
Domain Access
Domains : + +
  + + +
+ +
+ + + + + + + + + + + + + + +
Shard Access
Shards : + +
  + + +
+ +{/if} + +
+ +{include file="page_footer.tpl"} diff --git a/code/web/public_php/admin/templates/default/tool_administration_logs.tpl b/code/web/public_php/admin/templates/default/tool_administration_logs.tpl index a2f537a8e..b44d3719b 100644 --- a/code/web/public_php/admin/templates/default/tool_administration_logs.tpl +++ b/code/web/public_php/admin/templates/default/tool_administration_logs.tpl @@ -1,56 +1,56 @@ - -{include file="page_header.tpl"} - - - - - - -
{$tool_alert_message} - - - {section name=onemenu loop=$tool_menu} - - {/section} - -
{$tool_menu[onemenu].title}
-
- -
- - - - - -
- - - - - - - - - - -{section name=log loop=$tool_log_list} - - - - - - -{/section} - - - -
Logs
IDUserDateAction
{$tool_log_list[log].logs_id}{$tool_log_list[log].logs_user_name}{$tool_log_list[log].logs_date|date_format:"%Y/%m/%d %H:%M:%S"}{$tool_log_list[log].logs_data}
-|<    -<    -Page {$tool_log_page_current} / {$tool_log_page_total}    ->    ->| -
-
- -{include file="page_footer.tpl"} + +{include file="page_header.tpl"} + + + + + + +
{$tool_alert_message} + + + {section name=onemenu loop=$tool_menu} + + {/section} + +
{$tool_menu[onemenu].title}
+
+ +
+ + + + + +
+ + + + + + + + + + +{section name=log loop=$tool_log_list} + + + + + + +{/section} + + + +
Logs
IDUserDateAction
{$tool_log_list[log].logs_id}{$tool_log_list[log].logs_user_name}{$tool_log_list[log].logs_date|date_format:"%Y/%m/%d %H:%M:%S"}{$tool_log_list[log].logs_data}
+|<    +<    +Page {$tool_log_page_current} / {$tool_log_page_total}    +>    +>| +
+
+ +{include file="page_footer.tpl"} diff --git a/code/web/public_php/admin/templates/default/tool_administration_restarts.tpl b/code/web/public_php/admin/templates/default/tool_administration_restarts.tpl index 37e856f09..d31e4a65e 100644 --- a/code/web/public_php/admin/templates/default/tool_administration_restarts.tpl +++ b/code/web/public_php/admin/templates/default/tool_administration_restarts.tpl @@ -1,172 +1,172 @@ - -{include file="page_header.tpl"} - - - - - - -
{$tool_alert_message} - - - {section name=onemenu loop=$tool_menu} - - {/section} - -
{$tool_menu[onemenu].title}
-
- -
- - - - - - - - - -
- - - - - - - - - - -{section name=restart loop=$tool_restart_list} -{cycle assign="trclass" values="row1,row0"} - - - - - - -{/section} -
Restart Groups
IDNameListOrder
{$tool_restart_list[restart].restart_group_id}{$tool_restart_list[restart].restart_group_name}{$tool_restart_list[restart].restart_group_list}{$tool_restart_list[restart].restart_group_order}
-
- - - - - -{if $tool_restart_edit_data.restart_group_id} - - - - -{/if} - - - - - - - - - - - - - - - - - -
Restart Group Details
Id :
Name :
Services :
Order :
  - -{if $tool_restart_edit_data.restart_group_id} - - -{else} - - -{/if} - -
-
- -
- - - - - - - - - -
- - - - - - - - - - -{section name=msg loop=$tool_message_list} -{cycle assign="trclass" values="row1,row0"} - - - - - - -{/section} -
Restart Messages
IDLanguageNameValue
{$tool_message_list[msg].restart_message_id}{$tool_message_list[msg].restart_message_lang}{$tool_message_list[msg].restart_message_name}{$tool_message_list[msg].restart_message_value}
-
- - - - - -{if $tool_message_edit_data.restart_message_id} - - - - -{/if} - - - - - - - - - - - - - - - - - -
Restart Message Details
Id :
Name :
Value :
Language : - -
  - -{if $tool_message_edit_data.restart_message_id } - - -{else} - - -{/if} - -
-
- - -{include file="page_footer.tpl"} + +{include file="page_header.tpl"} + + + + + + +
{$tool_alert_message} + + + {section name=onemenu loop=$tool_menu} + + {/section} + +
{$tool_menu[onemenu].title}
+
+ +
+ + + + + + + + + +
+ + + + + + + + + + +{section name=restart loop=$tool_restart_list} +{cycle assign="trclass" values="row1,row0"} + + + + + + +{/section} +
Restart Groups
IDNameListOrder
{$tool_restart_list[restart].restart_group_id}{$tool_restart_list[restart].restart_group_name}{$tool_restart_list[restart].restart_group_list}{$tool_restart_list[restart].restart_group_order}
+
+ + + + + +{if $tool_restart_edit_data.restart_group_id} + + + + +{/if} + + + + + + + + + + + + + + + + + +
Restart Group Details
Id :
Name :
Services :
Order :
  + +{if $tool_restart_edit_data.restart_group_id} + + +{else} + + +{/if} + +
+
+ +
+ + + + + + + + + +
+ + + + + + + + + + +{section name=msg loop=$tool_message_list} +{cycle assign="trclass" values="row1,row0"} + + + + + + +{/section} +
Restart Messages
IDLanguageNameValue
{$tool_message_list[msg].restart_message_id}{$tool_message_list[msg].restart_message_lang}{$tool_message_list[msg].restart_message_name}{$tool_message_list[msg].restart_message_value}
+
+ + + + + +{if $tool_message_edit_data.restart_message_id} + + + + +{/if} + + + + + + + + + + + + + + + + + +
Restart Message Details
Id :
Name :
Value :
Language : + +
  + +{if $tool_message_edit_data.restart_message_id } + + +{else} + + +{/if} + +
+
+ + +{include file="page_footer.tpl"} diff --git a/code/web/public_php/admin/templates/default/tool_administration_shards.tpl b/code/web/public_php/admin/templates/default/tool_administration_shards.tpl index c5ebdc00f..03ceb06b9 100644 --- a/code/web/public_php/admin/templates/default/tool_administration_shards.tpl +++ b/code/web/public_php/admin/templates/default/tool_administration_shards.tpl @@ -1,110 +1,110 @@ - -{include file="page_header.tpl"} - - - - - - -
{$tool_alert_message} - - - {section name=onemenu loop=$tool_menu} - - {/section} - -
{$tool_menu[onemenu].title}
-
- -
- - - - - - - - - -
- - - - - - - - - - - -{section name=shard loop=$tool_shard_list} -{cycle assign="trclass" values="row1,row0"} - - - - - - - -{/section} -
Shards
IDNameShard IDDomainLanguage
{$tool_shard_list[shard].shard_id}{$tool_shard_list[shard].shard_name}{$tool_shard_list[shard].shard_as_id}{$tool_shard_list[shard].domain_name}{$tool_shard_list[shard].shard_lang}
-
- - - - - -{if $tool_shard_edit_data.shard_id} - - - - -{/if} - - - - - - - - - - - - - - - - - - - - - -
Shard Details
Id :
Name :
Shard ID :
Domain : - -
Language : - -
  - -{if $tool_shard_edit_data.shard_id} - - -{else} - - -{/if} - -
-
- -{include file="page_footer.tpl"} + +{include file="page_header.tpl"} + + + + + + +
{$tool_alert_message} + + + {section name=onemenu loop=$tool_menu} + + {/section} + +
{$tool_menu[onemenu].title}
+
+ +
+ + + + + + + + + +
+ + + + + + + + + + + +{section name=shard loop=$tool_shard_list} +{cycle assign="trclass" values="row1,row0"} + + + + + + + +{/section} +
Shards
IDNameShard IDDomainLanguage
{$tool_shard_list[shard].shard_id}{$tool_shard_list[shard].shard_name}{$tool_shard_list[shard].shard_as_id}{$tool_shard_list[shard].domain_name}{$tool_shard_list[shard].shard_lang}
+
+ + + + + +{if $tool_shard_edit_data.shard_id} + + + + +{/if} + + + + + + + + + + + + + + + + + + + + + +
Shard Details
Id :
Name :
Shard ID :
Domain : + +
Language : + +
  + +{if $tool_shard_edit_data.shard_id} + + +{else} + + +{/if} + +
+
+ +{include file="page_footer.tpl"} diff --git a/code/web/public_php/admin/templates/default/tool_administration_users.tpl b/code/web/public_php/admin/templates/default/tool_administration_users.tpl index d2d81a85b..5950d21ca 100644 --- a/code/web/public_php/admin/templates/default/tool_administration_users.tpl +++ b/code/web/public_php/admin/templates/default/tool_administration_users.tpl @@ -1,207 +1,207 @@ - -{include file="page_header.tpl"} - - - - - - -
{$tool_alert_message} - - - {section name=onemenu loop=$tool_menu} - - {/section} - -
{$tool_menu[onemenu].title}
-
- -
- - - - - - - - - -
- - - - - - - - - - - - - -{section name=user loop=$tool_user_list} -{cycle assign="trclass" values="row1,row0"} - - - - - -{if $tool_user_list[user].user_logged_last > 0} - -{else} - -{/if} - - - -{/section} -
Accounts
IDLoginGroupCreatedLast LoggedNum LogsActive
{$tool_user_list[user].user_id}{$tool_user_list[user].user_name}{$tool_user_list[user].user_group_name}{$tool_user_list[user].user_created|date_format:"%Y/%m/%d %H:%M:%S"}{$tool_user_list[user].user_logged_last|date_format:"%Y/%m/%d %H:%M:%S"}never{$tool_user_list[user].user_logged_count}{if $tool_user_list[user].user_active == 1}Yes{else}No{/if}
-
- - - - - -{if $tool_user_edit_data.user_id} - - - - -{/if} - - - - - - - - - - - - - - - - - - - - - -
Account Details
Id :
Name :
Password :
Group : - -
Active : - -
  - -{if $tool_user_edit_data.user_id} - - -{else} - - -{/if} - -
- -{if $tool_user_edit_data.user_id} - -
- - - - - - - - - - - - - - -
Application Access
Applications : - -
  - - -
- -
- - - - - - - - - - - - - - -
Domain Access
Domains : - -
  - - -
- -
- - - - - - - - - - - - - - -
Shard Access {if $tool_domain_list[domain].domain_disabled}(group){/if}
Shards : - -
  - - {* *} - -
- -{/if} - -
- -{include file="page_footer.tpl"} + +{include file="page_header.tpl"} + + + + + + +
{$tool_alert_message} + + + {section name=onemenu loop=$tool_menu} + + {/section} + +
{$tool_menu[onemenu].title}
+
+ +
+ + + + + + + + + +
+ + + + + + + + + + + + + +{section name=user loop=$tool_user_list} +{cycle assign="trclass" values="row1,row0"} + + + + + +{if $tool_user_list[user].user_logged_last > 0} + +{else} + +{/if} + + + +{/section} +
Accounts
IDLoginGroupCreatedLast LoggedNum LogsActive
{$tool_user_list[user].user_id}{$tool_user_list[user].user_name}{$tool_user_list[user].user_group_name}{$tool_user_list[user].user_created|date_format:"%Y/%m/%d %H:%M:%S"}{$tool_user_list[user].user_logged_last|date_format:"%Y/%m/%d %H:%M:%S"}never{$tool_user_list[user].user_logged_count}{if $tool_user_list[user].user_active == 1}Yes{else}No{/if}
+
+ + + + + +{if $tool_user_edit_data.user_id} + + + + +{/if} + + + + + + + + + + + + + + + + + + + + + +
Account Details
Id :
Name :
Password :
Group : + +
Active : + +
  + +{if $tool_user_edit_data.user_id} + + +{else} + + +{/if} + +
+ +{if $tool_user_edit_data.user_id} + +
+ + + + + + + + + + + + + + +
Application Access
Applications : + +
  + + +
+ +
+ + + + + + + + + + + + + + +
Domain Access
Domains : + +
  + + +
+ +
+ + + + + + + + + + + + + + +
Shard Access {if $tool_domain_list[domain].domain_disabled}(group){/if}
Shards : + +
  + + {* *} + +
+ +{/if} + +
+ +{include file="page_footer.tpl"} diff --git a/code/web/public_php/admin/templates/default/tool_graphs.tpl b/code/web/public_php/admin/templates/default/tool_graphs.tpl index 24e2d4eaa..9dcd896a5 100644 --- a/code/web/public_php/admin/templates/default/tool_graphs.tpl +++ b/code/web/public_php/admin/templates/default/tool_graphs.tpl @@ -1,274 +1,274 @@ - -{include file="page_header.tpl"} - -{literal} - -{/literal} - - - - - -
- - - {section name=onemenu loop=$tool_menu} - - {/section} - -
{$tool_menu[onemenu].title}
-
- -
- - - - - - - - - -
- -{if $tool_domain_selected && $tool_shard_selected} - - - - - - - - -{if $tool_refresh_rate > 0} - - - -{/if} - -
Refresh
- -
- - -
-
-{/if} - - - - - -{section name=domain loop=$tool_domain_list} - - - -{/section} -
Domains
{$tool_domain_list[domain].domain_name}
- -{if $tool_domain_selected} -
- - - - -{section name=shard loop=$tool_shard_list} -{if $tool_domain_selected == $tool_shard_list[shard].shard_domain_id} - - - -{/if} -{/section} -
Shards
{$tool_shard_list[shard].shard_name}
- -{if $tool_frame_list} - -{/if} - -{if $tool_graph_list} -
- - - - -{section name=gvar loop=$tool_graph_variables} - - - - - -{assign var="var_name" value=$tool_graph_variables[gvar]} -{section name=gdata loop=$tool_graph_datas.$var_name} - - - - - -{/section} -{/section} -
Graphs
{$tool_graph_variables[gvar]}High
{$tool_graph_datas.$var_name[gdata].service}{if $tool_graph_datas.$var_name[gdata].high_file != ''}Yes{else}No{/if}
-{/if} - -{/if} - -
  - -{if $tool_domain_error} - - - - -
{$tool_domain_error}
-{elseif !$tool_domain_selected} - - - - -
You need to select a domain.
-{else} -{if $tool_as_error} - - - - -
{$tool_as_error}
-
-{/if} - - - - - -
-{if $tool_rrd_output} -{section name=rrd loop=$tool_rrd_output} - {$tool_rrd_output[rrd].desc}
-
-{/section} -{/if} -
-{if $tool_rrd_high_output} -{section name=rrd loop=$tool_rrd_high_output} - {$tool_rrd_high_output[rrd].desc}
-{if $tool_rrd_high_output[rrd].img != ''} -
-{/if} -{/section} -{/if} -
-{/if} - -
- - -{include file="page_footer.tpl"} + +{include file="page_header.tpl"} + +{literal} + +{/literal} + + + + + +
+ + + {section name=onemenu loop=$tool_menu} + + {/section} + +
{$tool_menu[onemenu].title}
+
+ +
+ + + + + + + + + +
+ +{if $tool_domain_selected && $tool_shard_selected} + + + + + + + + +{if $tool_refresh_rate > 0} + + + +{/if} + +
Refresh
+ +
+ + +
+
+{/if} + + + + + +{section name=domain loop=$tool_domain_list} + + + +{/section} +
Domains
{$tool_domain_list[domain].domain_name}
+ +{if $tool_domain_selected} +
+ + + + +{section name=shard loop=$tool_shard_list} +{if $tool_domain_selected == $tool_shard_list[shard].shard_domain_id} + + + +{/if} +{/section} +
Shards
{$tool_shard_list[shard].shard_name}
+ +{if $tool_frame_list} + +{/if} + +{if $tool_graph_list} +
+ + + + +{section name=gvar loop=$tool_graph_variables} + + + + + +{assign var="var_name" value=$tool_graph_variables[gvar]} +{section name=gdata loop=$tool_graph_datas.$var_name} + + + + + +{/section} +{/section} +
Graphs
{$tool_graph_variables[gvar]}High
{$tool_graph_datas.$var_name[gdata].service}{if $tool_graph_datas.$var_name[gdata].high_file != ''}Yes{else}No{/if}
+{/if} + +{/if} + +
  + +{if $tool_domain_error} + + + + +
{$tool_domain_error}
+{elseif !$tool_domain_selected} + + + + +
You need to select a domain.
+{else} +{if $tool_as_error} + + + + +
{$tool_as_error}
+
+{/if} + + + + + +
+{if $tool_rrd_output} +{section name=rrd loop=$tool_rrd_output} + {$tool_rrd_output[rrd].desc}
+
+{/section} +{/if} +
+{if $tool_rrd_high_output} +{section name=rrd loop=$tool_rrd_high_output} + {$tool_rrd_high_output[rrd].desc}
+{if $tool_rrd_high_output[rrd].img != ''} +
+{/if} +{/section} +{/if} +
+{/if} + +
+ + +{include file="page_footer.tpl"} diff --git a/code/web/public_php/admin/templates/default/tool_graphs_ccu.tpl b/code/web/public_php/admin/templates/default/tool_graphs_ccu.tpl index db9051058..2a9cf3f21 100644 --- a/code/web/public_php/admin/templates/default/tool_graphs_ccu.tpl +++ b/code/web/public_php/admin/templates/default/tool_graphs_ccu.tpl @@ -1,230 +1,230 @@ - -{include file="page_header.tpl"} - -{literal} - -{/literal} - - - - - -
- - - {section name=onemenu loop=$tool_menu} - - {/section} - -
{$tool_menu[onemenu].title}
-
- -
- - - - - - - - - -
- -{if $tool_domain_selected && $tool_frame_selected} - - - - - - - - -{if $tool_refresh_rate > 0} - - - -{/if} - -
Refresh
- -
- - -
-
-{/if} - - - - - -{section name=domain loop=$tool_domain_list} - - - -{/section} -
Domains
{$tool_domain_list[domain].domain_name}
- -{if $tool_domain_selected} -
- - - - -{section name=frame loop=$tool_frame_list} - - - -{/section} -
Time Frame
{$tool_frame_list[frame].title}
- -{/if} - -
  - -{if $tool_domain_error} - - - - -
{$tool_domain_error}
-{elseif !$tool_domain_selected} - - - - -
You need to select a domain.
-{elseif !$tool_frame_selected} - - - - -
You need to select a time frame.
-{else} -{if $tool_as_error} - - - - -
{$tool_as_error}
-
-{/if} - - - - -
-{if $tool_rrd_output} -{section name=rrd loop=$tool_rrd_output} - {$tool_rrd_output[rrd].desc}
-
-{/section} -{/if} -
-{/if} - -
- - -{include file="page_footer.tpl"} + +{include file="page_header.tpl"} + +{literal} + +{/literal} + + + + + +
+ + + {section name=onemenu loop=$tool_menu} + + {/section} + +
{$tool_menu[onemenu].title}
+
+ +
+ + + + + + + + + +
+ +{if $tool_domain_selected && $tool_frame_selected} + + + + + + + + +{if $tool_refresh_rate > 0} + + + +{/if} + +
Refresh
+ +
+ + +
+
+{/if} + + + + + +{section name=domain loop=$tool_domain_list} + + + +{/section} +
Domains
{$tool_domain_list[domain].domain_name}
+ +{if $tool_domain_selected} +
+ + + + +{section name=frame loop=$tool_frame_list} + + + +{/section} +
Time Frame
{$tool_frame_list[frame].title}
+ +{/if} + +
  + +{if $tool_domain_error} + + + + +
{$tool_domain_error}
+{elseif !$tool_domain_selected} + + + + +
You need to select a domain.
+{elseif !$tool_frame_selected} + + + + +
You need to select a time frame.
+{else} +{if $tool_as_error} + + + + +
{$tool_as_error}
+
+{/if} + + + + +
+{if $tool_rrd_output} +{section name=rrd loop=$tool_rrd_output} + {$tool_rrd_output[rrd].desc}
+
+{/section} +{/if} +
+{/if} + +
+ + +{include file="page_footer.tpl"} diff --git a/code/web/public_php/admin/templates/default/tool_graphs_hires.tpl b/code/web/public_php/admin/templates/default/tool_graphs_hires.tpl index 67288ac95..54d784934 100644 --- a/code/web/public_php/admin/templates/default/tool_graphs_hires.tpl +++ b/code/web/public_php/admin/templates/default/tool_graphs_hires.tpl @@ -1,252 +1,252 @@ - -{include file="page_header.tpl"} - -{literal} - -{/literal} - - - - - -
- - - {section name=onemenu loop=$tool_menu} - - {/section} - -
{$tool_menu[onemenu].title}
-
- -
- - - - - - - - - -
- -{if $tool_domain_selected && $tool_shard_selected && $tool_frame_selected} - - - - - - - - -{if $tool_refresh_rate > 0} - - - -{/if} - -
Refresh
- -
- - -
-
-{/if} - - - - - -{section name=domain loop=$tool_domain_list} - - - -{/section} -
Domains
{$tool_domain_list[domain].domain_name}
- -{if $tool_domain_selected} -
- - - - -{section name=shard loop=$tool_shard_list} -{if $tool_domain_selected == $tool_shard_list[shard].shard_domain_id} - - - -{/if} -{/section} -
Shards
{$tool_shard_list[shard].shard_name}
- -
- - - - -{section name=frame loop=$tool_frame_list} - - - -{/section} -
Time Frame
{$tool_frame_list[frame].title}
- -{/if} - -
  - -{if $tool_domain_error} - - - - -
{$tool_domain_error}
-{elseif !$tool_domain_selected} - - - - -
You need to select a domain.
-{elseif !$tool_shard_selected} - - - - -
You need to select a shard.
-{elseif !$tool_frame_selected} - - - - -
You need to select a time frame.
-{else} -{if $tool_as_error} - - - - -
{$tool_as_error}
-
-{/if} - - - - -
-{if $tool_rrd_high_output} -{section name=rrd loop=$tool_rrd_high_output} - {$tool_rrd_high_output[rrd].desc}
-{if $tool_rrd_high_output[rrd].img != ''} -
-{/if} -{/section} -{/if} -
-{/if} - -
- - -{include file="page_footer.tpl"} + +{include file="page_header.tpl"} + +{literal} + +{/literal} + + + + + +
+ + + {section name=onemenu loop=$tool_menu} + + {/section} + +
{$tool_menu[onemenu].title}
+
+ +
+ + + + + + + + + +
+ +{if $tool_domain_selected && $tool_shard_selected && $tool_frame_selected} + + + + + + + + +{if $tool_refresh_rate > 0} + + + +{/if} + +
Refresh
+ +
+ + +
+
+{/if} + + + + + +{section name=domain loop=$tool_domain_list} + + + +{/section} +
Domains
{$tool_domain_list[domain].domain_name}
+ +{if $tool_domain_selected} +
+ + + + +{section name=shard loop=$tool_shard_list} +{if $tool_domain_selected == $tool_shard_list[shard].shard_domain_id} + + + +{/if} +{/section} +
Shards
{$tool_shard_list[shard].shard_name}
+ +
+ + + + +{section name=frame loop=$tool_frame_list} + + + +{/section} +
Time Frame
{$tool_frame_list[frame].title}
+ +{/if} + +
  + +{if $tool_domain_error} + + + + +
{$tool_domain_error}
+{elseif !$tool_domain_selected} + + + + +
You need to select a domain.
+{elseif !$tool_shard_selected} + + + + +
You need to select a shard.
+{elseif !$tool_frame_selected} + + + + +
You need to select a time frame.
+{else} +{if $tool_as_error} + + + + +
{$tool_as_error}
+
+{/if} + + + + +
+{if $tool_rrd_high_output} +{section name=rrd loop=$tool_rrd_high_output} + {$tool_rrd_high_output[rrd].desc}
+{if $tool_rrd_high_output[rrd].img != ''} +
+{/if} +{/section} +{/if} +
+{/if} + +
+ + +{include file="page_footer.tpl"} diff --git a/code/web/public_php/admin/templates/default/tool_graphs_tech.tpl b/code/web/public_php/admin/templates/default/tool_graphs_tech.tpl index c1c96d189..79299b7ab 100644 --- a/code/web/public_php/admin/templates/default/tool_graphs_tech.tpl +++ b/code/web/public_php/admin/templates/default/tool_graphs_tech.tpl @@ -1,250 +1,250 @@ - -{include file="page_header.tpl"} - -{literal} - -{/literal} - - - - - -
- - - {section name=onemenu loop=$tool_menu} - - {/section} - -
{$tool_menu[onemenu].title}
-
- -
- - - - - - - - - -
- -{if $tool_domain_selected && $tool_shard_selected && $tool_frame_selected} - - - - - - - - -{if $tool_refresh_rate > 0} - - - -{/if} - -
Refresh
- -
- - -
-
-{/if} - - - - - -{section name=domain loop=$tool_domain_list} - - - -{/section} -
Domains
{$tool_domain_list[domain].domain_name}
- -{if $tool_domain_selected} -
- - - - -{section name=shard loop=$tool_shard_list} -{if $tool_domain_selected == $tool_shard_list[shard].shard_domain_id} - - - -{/if} -{/section} -
Shards
{$tool_shard_list[shard].shard_name}
- -
- - - - -{section name=frame loop=$tool_frame_list} - - - -{/section} -
Time Frame
{$tool_frame_list[frame].title}
- -{/if} - -
  - -{if $tool_domain_error} - - - - -
{$tool_domain_error}
-{elseif !$tool_domain_selected} - - - - -
You need to select a domain.
-{elseif !$tool_shard_selected} - - - - -
You need to select a shard.
-{elseif !$tool_frame_selected} - - - - -
You need to select a time frame.
-{else} -{if $tool_as_error} - - - - -
{$tool_as_error}
-
-{/if} - - - - -
-{if $tool_rrd_output} -{section name=rrd loop=$tool_rrd_output} - {$tool_rrd_output[rrd].desc}
-
-{/section} -{/if} -
-{/if} - -
- - -{include file="page_footer.tpl"} + +{include file="page_header.tpl"} + +{literal} + +{/literal} + + + + + +
+ + + {section name=onemenu loop=$tool_menu} + + {/section} + +
{$tool_menu[onemenu].title}
+
+ +
+ + + + + + + + + +
+ +{if $tool_domain_selected && $tool_shard_selected && $tool_frame_selected} + + + + + + + + +{if $tool_refresh_rate > 0} + + + +{/if} + +
Refresh
+ +
+ + +
+
+{/if} + + + + + +{section name=domain loop=$tool_domain_list} + + + +{/section} +
Domains
{$tool_domain_list[domain].domain_name}
+ +{if $tool_domain_selected} +
+ + + + +{section name=shard loop=$tool_shard_list} +{if $tool_domain_selected == $tool_shard_list[shard].shard_domain_id} + + + +{/if} +{/section} +
Shards
{$tool_shard_list[shard].shard_name}
+ +
+ + + + +{section name=frame loop=$tool_frame_list} + + + +{/section} +
Time Frame
{$tool_frame_list[frame].title}
+ +{/if} + +
  + +{if $tool_domain_error} + + + + +
{$tool_domain_error}
+{elseif !$tool_domain_selected} + + + + +
You need to select a domain.
+{elseif !$tool_shard_selected} + + + + +
You need to select a shard.
+{elseif !$tool_frame_selected} + + + + +
You need to select a time frame.
+{else} +{if $tool_as_error} + + + + +
{$tool_as_error}
+
+{/if} + + + + +
+{if $tool_rrd_output} +{section name=rrd loop=$tool_rrd_output} + {$tool_rrd_output[rrd].desc}
+
+{/section} +{/if} +
+{/if} + +
+ + +{include file="page_footer.tpl"} diff --git a/code/web/public_php/admin/templates/default/tool_notes.tpl b/code/web/public_php/admin/templates/default/tool_notes.tpl index 56a35c4cf..e0e04106d 100644 --- a/code/web/public_php/admin/templates/default/tool_notes.tpl +++ b/code/web/public_php/admin/templates/default/tool_notes.tpl @@ -1,164 +1,164 @@ - -{include file="page_header.tpl"} - -{literal} - - - -{/literal} - - - - - -
{$tool_alert_message}
- -
- - - - - - - - - - -
- - - - - - - - - - -{if $restriction_tool_notes_global} - -{/if} - - {section name=note loop=$tool_note_list} - - - - - - -{if $restriction_tool_notes_global} - -{/if} - - {/section} -
Notes
IDTitleModeLast UpdateActiveGlobal
{$tool_note_list[note].note_id}{$tool_note_list[note].note_title}{if $tool_note_list[note].note_mode == 0}Text{else}Popup{/if}{$tool_note_list[note].note_date|date_format:"%Y/%m/%d %H:%M:%S"}{if $tool_note_list[note].note_active == 1}Yes{else}No{/if}{if $tool_note_list[note].note_global == 1}Yes{else}No{/if}
-
  - - - - - -{if $tool_note_edit_data.note_id} - - - - -{/if} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -{if $restriction_tool_notes_global} - - - - -{/if} - - - - - -
Notes Details
Id :
Title :
Mode :
Text :
URI :
Restriction :
Active : - -
Global : - -
  - -{if $tool_note_edit_data.note_id} - - -{else} - - -{/if} - -
-
- - -{include file="page_footer.tpl"} + +{include file="page_header.tpl"} + +{literal} + + + +{/literal} + + + + + +
{$tool_alert_message}
+ +
+ + + + + + + + + + +
+ + + + + + + + + + +{if $restriction_tool_notes_global} + +{/if} + + {section name=note loop=$tool_note_list} + + + + + + +{if $restriction_tool_notes_global} + +{/if} + + {/section} +
Notes
IDTitleModeLast UpdateActiveGlobal
{$tool_note_list[note].note_id}{$tool_note_list[note].note_title}{if $tool_note_list[note].note_mode == 0}Text{else}Popup{/if}{$tool_note_list[note].note_date|date_format:"%Y/%m/%d %H:%M:%S"}{if $tool_note_list[note].note_active == 1}Yes{else}No{/if}{if $tool_note_list[note].note_global == 1}Yes{else}No{/if}
+
  + + + + + +{if $tool_note_edit_data.note_id} + + + + +{/if} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{if $restriction_tool_notes_global} + + + + +{/if} + + + + + +
Notes Details
Id :
Title :
Mode :
Text :
URI :
Restriction :
Active : + +
Global : + +
  + +{if $tool_note_edit_data.note_id} + + +{else} + + +{/if} + +
+
+ + +{include file="page_footer.tpl"} diff --git a/code/web/public_php/ams/autoload/webusers.php b/code/web/public_php/ams/autoload/webusers.php index b01ddf02d..ebc654f5d 100644 --- a/code/web/public_php/ams/autoload/webusers.php +++ b/code/web/public_php/ams/autoload/webusers.php @@ -80,7 +80,14 @@ class WebUsers extends Users{ $dbw = new DBLayer("web"); $statement = $dbw->select("ams_user", array('value' => $value),"Login=:value OR Email=:value"); $row = $statement->fetch(); - $salt = substr($row['Password'],0,2); + if ($row['Password'][0] == '$') + { + $salt = substr($row['Password'], 0, 19); + } + else + { + $salt = substr($row['Password'], 0, 2); + } $hashed_input_pass = crypt($password, $salt); if($hashed_input_pass == $row['Password']){ return $row; diff --git a/code/web/public_php/ams/css/custom.css b/code/web/public_php/ams/css/custom.css index 65ba21ade..7a36a6799 100644 --- a/code/web/public_php/ams/css/custom.css +++ b/code/web/public_php/ams/css/custom.css @@ -133,3 +133,7 @@ margin-top: 10px; margin-left: -1; margin-right: -1; } + +.col-sm-4 { + width: 33.333%; +} \ No newline at end of file diff --git a/code/web/public_php/ams/func/userRegistration.php b/code/web/public_php/ams/func/userRegistration.php new file mode 100644 index 000000000..632c0681d --- /dev/null +++ b/code/web/public_php/ams/func/userRegistration.php @@ -0,0 +1,42 @@ +update("settings", Array('Value' => $_POST['userRegistration']), "`Setting` = 'userRegistration'"); + + $result['target_id'] = $_GET['id']; + global $SITEBASE; + require_once($SITEBASE . '/inc/settings.php'); + $pageElements = settings(); + $pageElements = array_merge(settings(), $result); + $pageElements['permission'] = unserialize($_SESSION['ticket_user'])->getPermission(); + // pass error and reload template accordingly + helpers :: loadtemplate( 'settings', $pageElements); + throw new SystemExit(); + + } else { + //ERROR: user is not logged in + header("Location: index.php"); + throw new SystemExit(); + } + + } + catch (PDOException $e) { + //go to error page or something, because can't access website db + print_r($e); + throw new SystemExit(); + } + +} \ No newline at end of file diff --git a/code/web/public_php/ams/inc/login.php b/code/web/public_php/ams/inc/login.php index 753873f38..d813bfd00 100644 --- a/code/web/public_php/ams/inc/login.php +++ b/code/web/public_php/ams/inc/login.php @@ -1,6 +1,6 @@ executeWithoutParams("SELECT * FROM settings"); + $rows = $statement->fetchAll(); + + foreach ($rows as &$value) { + $result[$value['Setting']] = $value['Value']; + } + return $result; }else{ //ERROR: not logged in! diff --git a/code/web/public_php/ams/js/jquery.js b/code/web/public_php/ams/js/jquery.js index 00c4e23a2..a4a29e87d 100644 --- a/code/web/public_php/ams/js/jquery.js +++ b/code/web/public_php/ams/js/jquery.js @@ -8097,7 +8097,7 @@ if ( jQuery.support.ajax ) { xml; // Firefox throws exceptions when accessing properties - // of an xhr when a network error occured + // of an xhr when a network error occurred // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) try { diff --git a/code/web/public_php/ams/misc/elfinder-connector/elFinderVolumeMySQL.class.php b/code/web/public_php/ams/misc/elfinder-connector/elFinderVolumeMySQL.class.php index 52861155d..f6f3fef35 100644 --- a/code/web/public_php/ams/misc/elfinder-connector/elFinderVolumeMySQL.class.php +++ b/code/web/public_php/ams/misc/elfinder-connector/elFinderVolumeMySQL.class.php @@ -178,7 +178,7 @@ class elFinderVolumeMySQL extends elFinderVolumeDriver { /** * Perform sql query and return result. - * Increase sqlCnt and save error if occured + * Increase sqlCnt and save error if occurred * * @param string $sql query * @return misc diff --git a/code/web/public_php/ams/sql/db.sql b/code/web/public_php/ams/sql/db.sql index ccc214125..b52ae65ed 100644 --- a/code/web/public_php/ams/sql/db.sql +++ b/code/web/public_php/ams/sql/db.sql @@ -21,4 +21,4 @@ CREATE TABLE ams_querycache ( `SID` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `type` VARCHAR( 64 ) NOT NULL , `query` VARCHAR( 512 ) NOT NULL -); \ No newline at end of file +); diff --git a/code/web/public_php/ams/templates/forgot_password.tpl b/code/web/public_php/ams/templates/forgot_password.tpl index 80bea346b..f6fae04d1 100644 --- a/code/web/public_php/ams/templates/forgot_password.tpl +++ b/code/web/public_php/ams/templates/forgot_password.tpl @@ -1,54 +1,54 @@ -{extends file="layout.tpl"} -{block name=content} - -
- -
- -
- -
-{/block} - - +{extends file="layout.tpl"} +{block name=content} + +
+ +
+ +
+ +
+{/block} + + diff --git a/code/web/public_php/ams/templates/layout.tpl b/code/web/public_php/ams/templates/layout.tpl index b77cef785..7720ca65c 100644 --- a/code/web/public_php/ams/templates/layout.tpl +++ b/code/web/public_php/ams/templates/layout.tpl @@ -140,7 +140,7 @@ {if isset($smarty.get.page) and $smarty.get.page eq 'layout_plugin' and $smarty.get.name eq $arrkey} {include file=$hook_info[$smarty.get.name]['TemplatePath']} {/if} - {/foreach} + {/foreach} {/if} @@ -167,7 +167,7 @@
- {if $permission > 1}

AMS 0.9.1 Powered by: Charisma

{/if} + {if $permission > 1}

AMS 0.12.0 Powered by: Charisma

{/if}
{/if} diff --git a/code/web/public_php/ams/templates/login.tpl b/code/web/public_php/ams/templates/login.tpl index 7acdf3bbe..23834554a 100644 --- a/code/web/public_php/ams/templates/login.tpl +++ b/code/web/public_php/ams/templates/login.tpl @@ -12,6 +12,7 @@
{$login_info}
+
@@ -42,9 +43,13 @@ {$login_error_message}
{/if} + + + + {/block} diff --git a/code/web/public_php/ams/templates/register.tpl b/code/web/public_php/ams/templates/register.tpl index b5ea3980d..f14ef9a6c 100644 --- a/code/web/public_php/ams/templates/register.tpl +++ b/code/web/public_php/ams/templates/register.tpl @@ -1,120 +1,124 @@ -{extends file="layout.tpl"} -{block name=content} - -
- -
- -
- -
-{/block} - - +{extends file="layout.tpl"} +{block name=content} + +
+ +
+ +
+ +
+{/block} + + diff --git a/code/web/public_php/ams/templates/reset_password.tpl b/code/web/public_php/ams/templates/reset_password.tpl index 4c5bca351..57d0567ff 100644 --- a/code/web/public_php/ams/templates/reset_password.tpl +++ b/code/web/public_php/ams/templates/reset_password.tpl @@ -1,66 +1,66 @@ -{extends file="layout.tpl"} -{block name=content} - -
- -
- -
- -
-{/block} - - +{extends file="layout.tpl"} +{block name=content} + +
+ +
+ +
+ +
+{/block} + + diff --git a/code/web/public_php/ams/templates/settings.tpl b/code/web/public_php/ams/templates/settings.tpl index 4ee9f2c6a..0e04cab17 100644 --- a/code/web/public_php/ams/templates/settings.tpl +++ b/code/web/public_php/ams/templates/settings.tpl @@ -1,331 +1,382 @@ -{block name=content} -
-
-
-
- Change Password -
-
-
-
- Change Password - - {if !isset($changesOther) or $changesOther eq "FALSE"} -
- -
-
- - - {if isset($MATCH_ERROR) and $MATCH_ERROR eq "TRUE"}The password is incorrect{/if} -
-
-
- {/if} -
- -
-
- - - {if isset($NEWPASSWORD_ERROR) and $NEWPASSWORD_ERROR eq "TRUE"}{$newpass_error_message}{/if} -
-
-
- -
- -
-
- - - {if isset($CNEWPASSWORD_ERROR) and $CNEWPASSWORD_ERROR eq "TRUE"}{$confirmnewpass_error_message}{/if} -
-
-
- - - - {if isset($SUCCESS_PASS) and $SUCCESS_PASS eq "OK"} -
- The password has been changed! -
- {/if} - - {if isset($SUCCESS_PASS) and $SUCCESS_PASS eq "SHARDOFF"} -
- The password has been changed, though the shard seems offline, it may take some time to see the change on the shard. -
- {/if} - - - -
- -
- -
-
-
-
-
-
-
- - {if $permission != '1'} -
-
-
- Add User -
-
-
-
- Add User - -
- -
-
- - - {if isset($USERNAME_ERROR) and $USERNAME_ERROR eq "TRUE"}{$USERNAME}{/if} -
-
-
- -
- -
-
- - - {if isset($PASSWORD_ERROR) and $PASSWORD_ERROR eq "TRUE"}{$PASSWORD}{/if} -
-
-
- -
- -
-
- - - {if isset($CPASSWORD_ERROR) and $CPASSWORD_ERROR eq "TRUE"}{$CPASSWORD}{/if} -
-
-
- -
- -
-
- - - {if isset($EMAIL_ERROR) and $EMAIL_ERROR eq "TRUE" and isset($do)}{$EMAIL}{/if} -
-
-
- - - {if isset($SUCCESS_ADD) and $SUCCESS_ADD eq "ok"} -
- The user has been created! -
- {/if} - - {if isset($SUCCESS_ADD) and $SUCCESS_ADD eq "shardoffline"} -
- The user is created, though the shard seems offline, it may take some time to see the change on the shard. -
- {/if} - - - -
- -
- -
-
-
-
-
-
-
- {/if} - -
-
-
- Change Email -
-
-
-
- Change Email -
- -
-
- - - {if isset($CEMAIL_ERROR) and $CEMAIL_ERROR eq "TRUE"}{$EMAIL}{/if} - -
-
-
- - - {if isset($SUCCESS_MAIL) and $SUCCESS_MAIL eq "OK"} -
- The email has been changed! -
- {/if} - - {if isset($SUCCESS_MAIL) and $SUCCESS_MAIL eq "SHARDOFF"} -
- The email has been changed, though the shard seems offline, it may take some time to see the change on the shard. -
- {/if} - - - -
- -
- -
-
-
-
-
-
-
- -
-
-
- Ticket updates -
- - -
-
-
- Ticket-Update Mail Settings - -
- -
- -
- -
- - - -
- -
- -
-
-
-
-
-
-
- -
-
-
- Change Info -
-
-
-
- Change Info - -
- -
-
- - -
-
-
- -
- -
-
- - -
-
-
- -
- -
- -
-
- -
- -
- -
- -
- -
-
- - {if isset($info_updated) and $info_updated eq "OK"} -
- The Info has been updated! -
- {/if} - - - -
- -
- -
-
-
-
-
-
-
-
- - - -{/block} - +{block name=content} +
+
+
+
+ Change Password +
+
+
+
+ Change Password + + {if !isset($changesOther) or $changesOther eq "FALSE"} +
+ +
+
+ + + {if isset($MATCH_ERROR) and $MATCH_ERROR eq "TRUE"}The password is incorrect{/if} +
+
+
+ {/if} +
+ +
+
+ + + {if isset($NEWPASSWORD_ERROR) and $NEWPASSWORD_ERROR eq "TRUE"}{$newpass_error_message}{/if} +
+
+
+ +
+ +
+
+ + + {if isset($CNEWPASSWORD_ERROR) and $CNEWPASSWORD_ERROR eq "TRUE"}{$confirmnewpass_error_message}{/if} +
+
+
+ + + + {if isset($SUCCESS_PASS) and $SUCCESS_PASS eq "OK"} +
+ The password has been changed! +
+ {/if} + + {if isset($SUCCESS_PASS) and $SUCCESS_PASS eq "SHARDOFF"} +
+ The password has been changed, though the shard seems offline, it may take some time to see the change on the shard. +
+ {/if} + + + +
+ +
+ +
+
+
+
+
+
+
+ + {if $permission != '1'} +
+
+
+ Add User +
+
+
+
+ Add User + +
+ +
+
+ + + {if isset($USERNAME_ERROR) and $USERNAME_ERROR eq "TRUE"}{$USERNAME}{/if} +
+
+
+ +
+ +
+
+ + + {if isset($PASSWORD_ERROR) and $PASSWORD_ERROR eq "TRUE"}{$PASSWORD}{/if} +
+
+
+ +
+ +
+
+ + + {if isset($CPASSWORD_ERROR) and $CPASSWORD_ERROR eq "TRUE"}{$CPASSWORD}{/if} +
+
+
+ +
+ +
+
+ + + {if isset($EMAIL_ERROR) and $EMAIL_ERROR eq "TRUE" and isset($do)}{$EMAIL}{/if} +
+
+
+ + + {if isset($SUCCESS_ADD) and $SUCCESS_ADD eq "ok"} +
+ The user has been created! +
+ {/if} + + {if isset($SUCCESS_ADD) and $SUCCESS_ADD eq "shardoffline"} +
+ The user is created, though the shard seems offline, it may take some time to see the change on the shard. +
+ {/if} + + + +
+ +
+ +
+
+
+
+
+
+
+ {/if} + +
+
+
+ Change Email +
+
+
+
+ Change Email +
+ +
+
+ + + {if isset($CEMAIL_ERROR) and $CEMAIL_ERROR eq "TRUE"}{$EMAIL}{/if} + +
+
+
+ + + {if isset($SUCCESS_MAIL) and $SUCCESS_MAIL eq "OK"} +
+ The email has been changed! +
+ {/if} + + {if isset($SUCCESS_MAIL) and $SUCCESS_MAIL eq "SHARDOFF"} +
+ The email has been changed, though the shard seems offline, it may take some time to see the change on the shard. +
+ {/if} + + + +
+ +
+ +
+
+
+
+
+
+
+ +
+
+
+ Ticket updates +
+ + +
+
+
+ Ticket-Update Mail Settings + +
+ +
+ +
+ +
+ + + +
+ +
+ +
+
+
+
+
+
+
+ +
+
+
+ Change Info +
+
+
+
+ Change Info + +
+ +
+
+ + +
+
+
+ +
+ +
+
+ + +
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+ +
+ +
+
+ + {if isset($info_updated) and $info_updated eq "OK"} +
+ The Info has been updated! +
+ {/if} + + + +
+ +
+ +
+
+
+
+
+
+
+ + {if $permission == '3'} +
+
+
+ User Registration +
+
+
+
+ User Registration + +
+
+ +
+ +
+ +
+ +
+
+ + + +
+ +
+ +
+
+
+
+
+
+
+ {/if} + +
+ + + +{/block} + diff --git a/code/web/public_php/api/data/js/jquery-1.7.1.js b/code/web/public_php/api/data/js/jquery-1.7.1.js index 8ccd0ea78..49dbf5895 100644 --- a/code/web/public_php/api/data/js/jquery-1.7.1.js +++ b/code/web/public_php/api/data/js/jquery-1.7.1.js @@ -8111,7 +8111,7 @@ if ( jQuery.support.ajax ) { xml; // Firefox throws exceptions when accessing properties - // of an xhr when a network error occured + // of an xhr when a network error occurred // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) try { diff --git a/code/nel/src/misc/game_device_events.cpp b/code/web/public_php/crash_report/config.inc.php similarity index 66% rename from code/nel/src/misc/game_device_events.cpp rename to code/web/public_php/crash_report/config.inc.php index bf64a1c4b..fe4b3e928 100644 --- a/code/nel/src/misc/game_device_events.cpp +++ b/code/web/public_php/crash_report/config.inc.php @@ -1,5 +1,9 @@ -// NeL - MMORPG Framework -// 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 @@ -14,20 +18,13 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#include "stdmisc.h" -#include "nel/misc/game_device_events.h" - - -#ifdef DEBUG_NEW - #define new DEBUG_NEW -#endif - -namespace NLMISC -{ - -void dummyToAvoidStupidCompilerWarning_game_device_events_cpp() +class BugReportConfig { - + static public $dbhost = "localhost"; + static public $dbport = "3306"; + static public $dbdb = "bugs"; + static public $dbuser = "bugs"; + static public $dbpw = "bugs"; } -} // NLMISC +?> diff --git a/code/nel/src/misc/geom_ext.cpp b/code/web/public_php/crash_report/log.inc.php similarity index 57% rename from code/nel/src/misc/geom_ext.cpp rename to code/web/public_php/crash_report/log.inc.php index 32dba1d60..71deee24f 100644 --- a/code/nel/src/misc/geom_ext.cpp +++ b/code/web/public_php/crash_report/log.inc.php @@ -1,5 +1,9 @@ -// NeL - MMORPG Framework -// 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 @@ -14,23 +18,28 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#include "stdmisc.h" - -#include "nel/misc/geom_ext.h" - - -// leave not static else this workaround don't work -void dummyToAvoidStupidCompilerWarning_misc_geom_ext_cpp() +/// Simple file logger class +class Logger { + private $lf = NULL; + + function __construct() + { + $this->lf = fopen( 'log.txt', 'a' ); + if( $this->lf === FALSE ) + exit( 1 ); + } + + function __destruct() + { + fclose( $this->lf ); + } + + public function log( $msg ) + { + $date = date( "[M d, Y H:i:s] " ); + fwrite( $this->lf, $date . $msg . "\n" ); + } } -#ifdef DEBUG_NEW - #define new DEBUG_NEW -#endif - -namespace NLMISC -{ - - - -} // NLMISC +?> diff --git a/code/web/public_php/crash_report/submit.php b/code/web/public_php/crash_report/submit.php new file mode 100644 index 000000000..d20214d11 --- /dev/null +++ b/code/web/public_php/crash_report/submit.php @@ -0,0 +1,112 @@ + +// +// 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 . + +require_once( 'config.inc.php' ); +require_once( 'log.inc.php' ); + +/// Example web application that takes bug reports from the bug reporter Qt app +class BugReportGatherApp +{ + private $db = NULL; + private $logger = NULL; + + function __construct() + { + $this->logger = new Logger(); + } + + private function logPOSTVars() + { + $report = ""; + $descr = ""; + $email = ""; + + if( isset( $_POST[ 'report' ] ) ) + $report = $_POST[ 'report' ]; + + if( isset( $_POST[ 'descr' ] ) ) + $descr = $_POST[ 'descr' ]; + + if( isset( $_POST[ 'email' ] ) ) + $email = $_POST[ 'email' ]; + + $this->logger->log( 'report: ' . "\n" . $report ); + $this->logger->log( 'description: ' . "\n" . $descr ); + $this->logger->log( 'email: ' . "\n" . $email ); + } + + private function buildQuery() + { + $report = ""; + $descr = ""; + $email = ""; + + if( isset( $_POST[ 'report' ] ) ) + $report = $_POST[ 'report' ]; + + if( isset( $_POST[ 'descr' ] ) ) + $descr = $_POST[ 'descr' ]; + + if( isset( $_POST[ 'email' ] ) ) + $email = $_POST[ 'email' ]; + + $report = $this->db->real_escape_string( $report ); + $descr = $this->db->real_escape_string( $descr ); + $email = $this->db->real_escape_string( $email ); + + + $q = "INSERT INTO `bugs` (`report`,`description`,`email`) VALUES ("; + $q .= "'$report',"; + $q .= "'$descr',"; + $q .= "'$email')"; + + return $q; + } + + public function exec() + { + //$this->logPOSTVars(); + + $this->db = new mysqli( BugReportConfig::$dbhost, BugReportConfig::$dbuser, BugReportConfig::$dbpw, BugReportConfig::$dbdb, BugReportConfig::$dbport ); + if( mysqli_connect_error() ) + { + $this->logger->log( "Connection error :(" ); + $this->logger->log( mysqli_connect_error() ); + return; + } + + $q = $this->buildQuery(); + $result = $this->db->query( $q ); + if( $result !== TRUE ) + { + $this->logger->log( "Query failed :(" ); + $this->logger->log( 'Query: ' . $q ); + $this->logPOSTVars(); + } + + $this->db->close(); + } +} + + +$app = new BugReportGatherApp(); +$app->exec(); + +?> diff --git a/code/web/public_php/login/r2_login.php b/code/web/public_php/login/r2_login.php index ee4b68819..b0a8a2d79 100644 --- a/code/web/public_php/login/r2_login.php +++ b/code/web/public_php/login/r2_login.php @@ -14,6 +14,19 @@ include_once('../ring/join_shard.php'); + function get_salt($password) + { + if ($password[0] == '$') + { + $salt = substr($password, 0, 19); + } + else + { + $salt = substr($password, 0, 2); + } + return $salt; + } + // see errorMsg function errorMsgBlock($errNum=GENERIC_ERROR_NUM) // $mixedArgs { @@ -132,6 +145,7 @@ { $logFile = new CWwwLog(); $logFile->logStr("PHP ERROR/$errno $errmsg ($filename:$linenum)"); + $logFile->logStr("PHP CALLSTACK/" . print_r(debug_backtrace(), TRUE)); // Never die after an error } @@ -331,7 +345,7 @@ else { $row = mysqli_fetch_assoc ($result); - $salt = substr($row["Password"],0,2); + $salt = get_salt($row["Password"]); if (($cp && $row["Password"] == $password) || (!$cp && $row["Password"] == crypt($password, $salt))) { // Store the real login (with correct case) @@ -488,7 +502,7 @@ else { $res_array = mysqli_fetch_assoc($result); - $salt = substr($res_array['Password'], 0, 2); + $salt = get_salt($res_array['Password']); } echo "1:".$salt; diff --git a/code/web/public_php/setup/database.php b/code/web/public_php/setup/database.php index 303df57d5..6137cb00f 100644 --- a/code/web/public_php/setup/database.php +++ b/code/web/public_php/setup/database.php @@ -1,12 +1,12 @@ serialUInt32(strlen($val)); + $valLen = strlen($val); + $this->serialUInt32($valLen); $this->Buffer .= $val; - $this->Pos += strlen($val); + $this->Pos += $valLen; debug(sprintf ("write string '%s' %d
\n", $val, $this->Pos)); } } @@ -103,7 +104,8 @@ } else { - $this->serialUInt32($val->toInt()); + $intValue = $val->toInt(); + $this->serialUInt32($intValue); debug(sprintf ("write enum '%s' %d
\n", $val->toString(), $this->Pos)); } } diff --git a/code/web/public_php/webtt/cake/console/libs/tasks/plugin.php b/code/web/public_php/webtt/cake/console/libs/tasks/plugin.php index 94d9e261c..9a76eb212 100644 --- a/code/web/public_php/webtt/cake/console/libs/tasks/plugin.php +++ b/code/web/public_php/webtt/cake/console/libs/tasks/plugin.php @@ -108,7 +108,7 @@ class PluginTask extends Shell { } if (!$this->bake($plugin)) { - $this->err(sprintf(__("An error occured trying to bake: %s in %s", true), $plugin, $this->path . Inflector::underscore($pluginPath))); + $this->err(sprintf(__("An error occurred trying to bake: %s in %s", true), $plugin, $this->path . Inflector::underscore($pluginPath))); } } diff --git a/code/web/public_php/webtt/cake/tests/cases/libs/controller/component.test.php b/code/web/public_php/webtt/cake/tests/cases/libs/controller/component.test.php index 770aacc2c..a069a6571 100644 --- a/code/web/public_php/webtt/cake/tests/cases/libs/controller/component.test.php +++ b/code/web/public_php/webtt/cake/tests/cases/libs/controller/component.test.php @@ -508,7 +508,7 @@ class ComponentTest extends CakeTestCase { $Controller->constructClasses(); $Controller->Component->initialize($Controller); $expected = array('setting' => array('itemx'), 'colour' => 'blood orange'); - $this->assertEqual($Controller->Orange->settings, $expected, 'Params duplication has occured %s'); + $this->assertEqual($Controller->Orange->settings, $expected, 'Params duplication has occurred %s'); } /** diff --git a/code/web/public_php/webtt/cake/tests/cases/libs/controller/controller_merge_vars.test.php b/code/web/public_php/webtt/cake/tests/cases/libs/controller/controller_merge_vars.test.php index b98aff1ff..4d4ef9773 100644 --- a/code/web/public_php/webtt/cake/tests/cases/libs/controller/controller_merge_vars.test.php +++ b/code/web/public_php/webtt/cake/tests/cases/libs/controller/controller_merge_vars.test.php @@ -155,7 +155,7 @@ class ControllerMergeVarsTestCase extends CakeTestCase { $Controller->constructClasses(); $expected = array('MergeVar' => array('flag', 'otherFlag', 'redirect' => false)); - $this->assertEqual($Controller->components, $expected, 'Duplication of settings occured. %s'); + $this->assertEqual($Controller->components, $expected, 'Duplication of settings occurred. %s'); } /** @@ -182,7 +182,7 @@ class ControllerMergeVarsTestCase extends CakeTestCase { $Controller->constructClasses(); $expected = array('MergeVar' => array('format' => 'html', 'terse')); - $this->assertEqual($Controller->helpers, $expected, 'Duplication of settings occured. %s'); + $this->assertEqual($Controller->helpers, $expected, 'Duplication of settings occurred. %s'); } /** diff --git a/code/web/public_php/webtt/cake/tests/cases/libs/model/model_validation.test.php b/code/web/public_php/webtt/cake/tests/cases/libs/model/model_validation.test.php index d0b3fb648..6f42d6fec 100644 --- a/code/web/public_php/webtt/cake/tests/cases/libs/model/model_validation.test.php +++ b/code/web/public_php/webtt/cake/tests/cases/libs/model/model_validation.test.php @@ -574,7 +574,7 @@ class ModelValidationTest extends BaseModelTest { $Something->create(); $result = $Something->save($data); - $this->assertFalse($result, 'Save occured even when with models failed. %s'); + $this->assertFalse($result, 'Save occurred even when with models failed. %s'); $this->assertEqual($JoinThing->validationErrors, $expectedError); $count = $Something->find('count', array('conditions' => array('Something.id' => $data['Something']['id']))); $this->assertIdentical($count, 0); @@ -593,7 +593,7 @@ class ModelValidationTest extends BaseModelTest { ); $Something->create(); $result = $Something->save($data); - $this->assertFalse($result, 'Save occured even when with models failed. %s'); + $this->assertFalse($result, 'Save occurred even when with models failed. %s'); $joinRecords = $JoinThing->find('count', array( 'conditions' => array('JoinThing.something_id' => $data['Something']['id']) diff --git a/code/web/public_php/webtt/plugins/debug_kit/vendors/debug_kit_debugger.php b/code/web/public_php/webtt/plugins/debug_kit/vendors/debug_kit_debugger.php index 862ce627d..5ba573359 100644 --- a/code/web/public_php/webtt/plugins/debug_kit/vendors/debug_kit_debugger.php +++ b/code/web/public_php/webtt/plugins/debug_kit/vendors/debug_kit_debugger.php @@ -377,8 +377,8 @@ class DebugKitDebugger extends Debugger { * @param string $error Name of error * @param string $code Code of error * @param string $description Description of error - * @param string $file File error occured in - * @param string $line Line error occured on + * @param string $file File error occurred in + * @param string $line Line error occurred on * @param string $trace Stack trace at time of error * @param string $context context of error * @return void diff --git a/dist/debian/jessie/debian/changelog b/dist/debian/jessie/debian/changelog new file mode 100644 index 000000000..44f3e244e --- /dev/null +++ b/dist/debian/jessie/debian/changelog @@ -0,0 +1,408 @@ +ryzom-core (0.8.2802~raring1) raring; urgency=low + + * New upstream release (revision 2802) + + -- Cédric OCHS Mon, 10 Dec 2012 11:12:17 +0100 + +ryzom-core (0.8.2786~raring1) raring; urgency=low + + * New upstream release (revision 2786) + + -- Cédric OCHS Fri, 07 Dec 2012 16:33:15 +0100 + +ryzom-core (0.8.2691~quantal1) quantal; urgency=low + + * New upstream release (revision 2691) + + -- Cédric OCHS Sun, 07 Oct 2012 09:46:56 +0200 + +ryzom-core (0.8.2682~quantal1) quantal; urgency=low + + * New upstream release (revision 2682) + + -- Cédric OCHS Wed, 03 Oct 2012 15:59:54 +0200 + +ryzom-core (0.8.2681~quantal2) quantal; urgency=low + + * New upstream release (revision 2681) + + -- Cédric OCHS Tue, 02 Oct 2012 17:42:23 +0200 + +ryzom-core (0.8.2681~quantal1) quantal; urgency=low + + * New upstream release (revision 2681) + + -- Cédric OCHS Tue, 02 Oct 2012 17:13:57 +0200 + +ryzom-core (0.8.2650~quantal2) quantal; urgency=low + + * New upstream release (revision 2650) + + -- Cédric OCHS Mon, 24 Sep 2012 22:06:37 +0200 + +ryzom-core (0.8.2650~quantal1) quantal; urgency=low + + * New upstream release (revision 2650) + + -- Cédric OCHS Mon, 24 Sep 2012 20:55:19 +0200 + +ryzom-core (0.8.2025~precise1) precise; urgency=low + + * New upstream release (revision 2025) + + -- Cédric OCHS Sat, 10 Mar 2012 22:23:49 +0100 + +ryzom-core (0.8.2024~precise1) precise; urgency=low + + * New upstream release (revision 2024) + + -- Cédric OCHS Sat, 10 Mar 2012 11:16:08 +0100 + +ryzom-core (0.8.1847~natty1) natty; urgency=low + + * New upstream release (revision 1847) + + -- Cédric OCHS Mon, 17 Oct 2011 09:33:45 +0200 + +ryzom-core (0.8.1847~natty0) natty; urgency=low + + * New upstream release (revision 1847) + + -- Cédric OCHS Sun, 16 Oct 2011 18:45:27 +0200 + +ryzom-core (0.8.1758~natty0) natty; urgency=low + + * New upstream release (revision 1758) + + -- Cédric OCHS Tue, 16 Aug 2011 09:02:55 +0200 + +ryzom-core (0.8.1752~natty0) natty; urgency=low + + * New upstream release (revision 1752) + + -- Cédric OCHS Sun, 14 Aug 2011 16:07:29 +0200 + +ryzom-core (0.8.1751~natty0) natty; urgency=low + + * New upstream release (revision 1751) + + -- Cédric OCHS Sun, 14 Aug 2011 14:16:24 +0200 + +ryzom-core (0.8.1750~natty0) natty; urgency=low + + * New upstream release (revision 1750) + + -- Cédric OCHS Sun, 14 Aug 2011 12:30:18 +0200 + +ryzom-core (0.8.1744~natty0) natty; urgency=low + + * New upstream release (revision 1744) + + -- Cédric OCHS Sat, 13 Aug 2011 20:24:49 +0200 + +ryzom-core (0.8.1742~natty0) natty; urgency=low + + * New upstream release (revision 1742) + + -- Cédric OCHS Fri, 12 Aug 2011 18:11:07 +0200 + +ryzom-core (0.8.1628~natty0) natty; urgency=low + + * New upstream release (revision 1628) + + -- Cédric OCHS Fri, 17 Jun 2011 12:56:17 +0200 + +ryzom-core (0.8.1627~natty0) natty; urgency=low + + * New upstream release (revision 1627) + + -- Cédric OCHS Tue, 14 Jun 2011 20:37:05 +0200 + +ryzom-core (0.8.1611~natty0) natty; urgency=low + + * New upstream release (revision 1611) + + -- Cédric OCHS Wed, 08 Jun 2011 19:53:44 +0200 + +ryzom-core (0.8.1596~natty1) natty; urgency=low + + * New upstream release (revision 1596) + + -- Cédric OCHS Sat, 04 Jun 2011 18:11:45 +0200 + +ryzom-core (0.7.1406~natty0) natty; urgency=low + + * New upstream release (revision 1406) + + -- Kervala Sun, 13 Mar 2011 19:07:44 +0100 + +ryzom-core (0.7.1404~karmic0) karmic; urgency=low + + * New upstream release (revision 1404) + + -- Kervala Thu, 10 Mar 2011 20:13:35 +0100 + +ryzom-core (0.7.1122~karmic0) karmic; urgency=low + + * New upstream release (revision 1122) + + -- Kervala Thu, 25 Nov 2010 13:18:41 +0100 + +ryzom-core (0.7.992~karmic0) karmic; urgency=low + + * New upstream release (revision 992) + + -- Kervala Tue, 19 Oct 2010 13:44:23 +0200 + +ryzom-core (0.7.941~karmic0) karmic; urgency=low + + * New upstream release (revision 941) + + -- Kervala Sat, 16 Oct 2010 14:59:36 +0200 + +ryzom-core (0.7.933~karmic0) karmic; urgency=low + + * New upstream release (revision 933) + + -- Kervala Fri, 15 Oct 2010 22:29:44 +0200 + +ryzom-core (0.7.932~karmic0) karmic; urgency=low + + * New upstream release (revision 932) + + -- Kervala Fri, 15 Oct 2010 19:53:47 +0200 + +ryzom-core (0.7.666~karmic0) karmic; urgency=low + + * New upstream release (revision 666) + + -- Kervala Sun, 29 Aug 2010 17:56:06 +0200 + +ryzom-core (0.7.631~karmic0) karmic; urgency=low + + * New upstream release (revision 631) + + -- Kervala Thu, 12 Aug 2010 16:57:30 +0200 + +ryzom-core (0.7.614~lucid1) lucid; urgency=low + + * Fixed dependencies + + -- Kervala Sun, 08 Aug 2010 22:42:50 +0200 + +ryzom-core (0.7.614~lucid0) lucid; urgency=low + + * New upstream release (revision 614) + + -- Kervala Sun, 08 Aug 2010 21:53:00 +0200 + +ryzom-core (0.7.583~lucid1) lucid; urgency=low + + * Added dependency on libogg and libvorbis + + -- Kervala Sun, 01 Aug 2010 15:38:40 +0200 + +ryzom-core (0.7.583~lucid0) lucid; urgency=low + + * New upstream release (revision 583) + + -- Kervala Sun, 01 Aug 2010 14:43:28 +0200 + +ryzom-core (0.7.530~lucid0) lucid; urgency=low + + * New upstream release (revision 530) + + -- Kervala Sun, 25 Jul 2010 16:50:57 +0200 + +ryzom-core (0.7.519~lucid0) lucid; urgency=low + + * New upstream release (revision 519) + + -- Kervala Mon, 19 Jul 2010 22:24:05 +0200 + +ryzom-core (0.7.507~lucid0) lucid; urgency=low + + * New upstream release (revision 507) + + -- Kervala Sat, 17 Jul 2010 19:56:35 +0200 + +ryzom-core (0.7.474~lucid0) lucid; urgency=low + + * New upstream release (revision 474) + + -- Kervala Tue, 13 Jul 2010 08:56:24 +0200 + +ryzom-core (0.7.473~lucid1) lucid; urgency=low + + * Some fixes + + -- Kervala Mon, 12 Jul 2010 22:46:16 +0200 + +ryzom-core (0.7.473~lucid0) lucid; urgency=low + + * New upstream release (revision 473) + + -- Kervala Mon, 12 Jul 2010 22:04:30 +0200 + +ryzom-core (0.7.437~lucid1) lucid; urgency=low + + * Fixed drivers installation + + -- Kervala Thu, 08 Jul 2010 08:54:02 +0200 + +ryzom-core (0.7.437~lucid0) lucid; urgency=low + + * New upstream release (revision 437) + + -- Kervala Thu, 01 Jul 2010 20:07:14 +0200 + +ryzom-core (0.7.419~lucid0) lucid; urgency=low + + * New upstream release (revision 419) + + -- Kervala Sat, 26 Jun 2010 18:58:36 +0200 + +ryzom-core (0.7.411~lucid0) lucid; urgency=low + + * New upstream release (revision 411) + + -- Kervala Sat, 26 Jun 2010 11:00:47 +0200 + +ryzom-core (0.7.404~lucid1) lucid; urgency=low + + * Fix OpenAL driver + + -- Kervala Thu, 24 Jun 2010 23:06:51 +0200 + +ryzom-core (0.7.404~lucid0) lucid; urgency=low + + * New upstream release (revision 404) + + -- Kervala Thu, 24 Jun 2010 22:17:36 +0200 + +ryzom-core (0.7.394~lucid0) lucid; urgency=low + + * New upstream release (revision 394) + + -- Kervala Tue, 22 Jun 2010 06:53:15 +0200 + +ryzom-core (0.7.375~lucid0) lucid; urgency=low + + * New upstream release (revision 375) + + -- Kervala Wed, 16 Jun 2010 12:46:51 +0200 + +ryzom-core (0.7.371~lucid0) lucid; urgency=low + + * New upstream release (revision 371) + + -- Kervala Mon, 14 Jun 2010 22:48:27 +0200 + +ryzom-core (0.7.359~lucid0) lucid; urgency=low + + * New upstream release (revision 359) + + -- Kervala Sun, 13 Jun 2010 21:31:29 +0200 + +ryzom-core (0.7.350~lucid1) lucid; urgency=low + + * Fixes problem with "copy" files + + -- Kervala Sun, 13 Jun 2010 10:36:30 +0200 + +ryzom-core (0.7.350~lucid0) lucid; urgency=low + + * New upstream release (revision 350) + + -- Kervala Sun, 13 Jun 2010 09:55:38 +0200 + +ryzom-core (0.7.332~lucid0) lucid; urgency=low + + * New upstream release (revision 332) + + -- Kervala Sat, 12 Jun 2010 09:09:21 +0200 + +ryzom-core (0.7.317~lucid0) lucid; urgency=low + + * New upstream release (revision 317) + + -- Kervala Thu, 10 Jun 2010 13:11:28 +0200 + +ryzom-core (0.7.315~lucid0) lucid; urgency=low + + * Fixed pkg-config installation again + + -- Kervala Thu, 10 Jun 2010 08:19:44 +0200 + +ryzom-core (0.7.311~lucid2) lucid; urgency=low + + * Fixed pkg-config files + + -- Kervala Wed, 09 Jun 2010 22:58:15 +0200 + +ryzom-core (0.7.311~lucid1) lucid; urgency=low + + * Fixed dependencies versions + + -- Kervala Wed, 09 Jun 2010 22:27:00 +0200 + +ryzom-core (0.7.311~lucid0) lucid; urgency=low + + * New upstream version (revision 311). + + -- Kervala Wed, 09 Jun 2010 21:15:42 +0200 + +ryzom-core (0.7.304~lucid0) lucid; urgency=low + + * New upstream version (revision 304). + + -- Kervala Wed, 09 Jun 2010 08:34:10 +0200 + +ryzom-core (0.7.0-1) unstable; urgency=low + + [ Gürkan Sengün ] + * New upstream version. (Closes: #553248) + * Updated build dependencies. + + [ Michal Čihař ] + * Convert to dh with cmake support. + * Bump standards to 3.8.4. + + [ Luboš Novák ] + * Change maintainer to 'Debian Games Team' + * ftbfs_gcc_4.5.path: Fix build with g++-4.5. (Closes: #565104) + * Converted direct changes in source to patches. + * Enable building CEGUI renderer. + * Add package libnel-doc with documentation. + * debian/control + + Changed priority of libnel-dbg to extra. + + Remove duplicate Section in libnel0. + + Update short descriptions. + + Replace obsolete package xlibmesa-gl-dev with libgl1-mesa-dev + in build-depends. + + Add libpng-dev to build-depends. + + Remove libalut-dev from build-depends. + + New homepage. + + Supported architectures are i386 and amd64. + * debian/libnel-dev.dirs + + Remove empty dir usr/lib/nel. + * debian/copyright + + Update redistribution licence from GPL to GPL-2. + * debian/rules + + Disable building unit test, samples and tools. + + -- Luboš Novák Tue, 30 Mar 2010 10:29:23 +0100 + +ryzom-core (0.5.0-1.1) unstable; urgency=low + + * Non-maintainer upload. + * Change Build-Depends: libstlport5.2-dev. (Closes: #521762) + + -- Torsten Werner Sun, 28 Jun 2009 11:54:05 +0200 + +ryzom-core (0.5.0-1) unstable; urgency=low + + * Initial release. (Closes: #448067) + + -- Gürkan Sengün Tue, 23 Oct 2007 12:56:45 +0200 + diff --git a/code/ryzom/client/client_default.cfg.in b/dist/debian/jessie/debian/client_default.cfg similarity index 88% rename from code/ryzom/client/client_default.cfg.in rename to dist/debian/jessie/debian/client_default.cfg index 030a4a2b2..d09cbbb9c 100644 --- a/code/ryzom/client/client_default.cfg.in +++ b/dist/debian/jessie/debian/client_default.cfg @@ -1,575 +1,567 @@ -////////////////////////// -////////////////////////// -/// CLIENT CONFIG FILE /// -////////////////////////// -////////////////////////// - - -// If you set this variable to 1, your client.cfg will be overwritten when you quit the client. -// You will loose all the comments and identation in this file. -SaveConfig = 1; - -/////////////////// -// WINDOW CONFIG // -/////////////////// - -Driver3D="Auto"; // Valid values are "Auto" or "0", "OpengGL" or "1" & "Direct3D" or "2" - // "Auto" will choose the best suited driver depending on hardware -FullScreen = 1; -Width = 1024; -Height = 768; -PositionX = 0; -PositionY = 0; -Frequency = 60; -Depth = 32; -Sleep = -1; -ProcessPriority = 0; // -2 = idle, -1 = below normal, 0 = normal, 1 = above normal, 2 = high, 3 = real time -Contrast = 0.0; // -1.0 ~ 1.0 -Luminosity = 0.0; // -1.0 ~ 1.0 -Gamma = 0.0; // -1.0 ~ 1.0 -Contrast_min = -1.0; -Luminosity_min = -1.0; -Gamma_min = -1.0; -Contrast_max = 1.0; -Luminosity_max = 1.0; -Gamma_max = 1.0; - - -///////////// -// NETWORK // -///////////// - -Application = { "ryzom_open", "./client_ryzom_r.exe", "./" }; -BackgroundDownloader = 0; -PatchServer = ""; -PatchWanted = 0; -SignUpURL = ""; -StartupHost = "open.ryzom.com:40916"; -StartupPage = "/login/r2_login.php"; -InstallStatsUrl = "http://open.ryzom.com:50000/stats/stats.php"; -CreateAccountURL = ""; -InstallWebPage = ""; - - -//////////////// -// INTERFACES // -//////////////// - -// the language to use as in ISO 639-2 -LanguageCode = "en"; // english - -XMLInputFile = "input_config_v3.xml"; - -XMLLoginInterfaceFiles = { - "login_config.xml", - "login_widgets.xml", - "login_main.xml", - "login_keys.xml", -}; - -XMLOutGameInterfaceFiles = { - "out_v2_config.xml", - "out_v2_widgets.xml", - "out_v2_connect.xml", - "out_v2_intro.xml", - "out_v2_select.xml", - "out_v2_appear.xml", - "out_v2_location.xml", - "out_v2_crash.xml", - "out_v2_hierarchy.xml", - "out_v2_keys.xml", -}; - -TexturesInterface = "texture_interfaces_v3"; -TexturesInterfaceDXTC = "texture_interfaces_dxtc"; - - -// The ligo primitive class file -LigoPrimitiveClass = "world_editor_classes.xml"; - -VerboseLog = 1; - -/////////// -// MOUSE // -/////////// -HardwareCursor = 1; - -CursorSpeed = 1.0; // In pixels per mickey -CursorSpeed_min = 0.5; -CursorSpeed_max = 2.0; - -CursorAcceleration = 40; // Threshold in mickey -CursorAcceleration_min = 20; -CursorAcceleration_max = 80; - -FreeLookSpeed = 0.004; // In radian per mickey -FreeLookSpeed_min = 0.0001; -FreeLookSpeed_max = 0.01; - -FreeLookAcceleration = 40; // Threshold in mickey -FreeLookAcceleration_min = 20; -FreeLookAcceleration_max = 80; - -FreeLookInverted = 0; -AutomaticCamera = 0; -DblClickMode = 1; -AutoEquipTool = 1; - -/////////////////// -// RENDER CONFIG // -/////////////////// - -// NB: thoses variables configure also the InGameConfigurator: -// _min and _max define the bounds -// _step defines the step (NB: take care of _min and _max!!) -// _ps0 is the LOW preset, _ps1 is the MEDIUM preset, _ps2 is the NORMAL Preset, and _ps3 is the HIGH one - - -// *** LANDSCAPE -LandscapeTileNear = 50.000000; -LandscapeTileNear_min = 20.000000; -LandscapeTileNear_max = 100.000000; -LandscapeTileNear_step = 10.0; -LandscapeTileNear_ps0 = 20.0; -LandscapeTileNear_ps1 = 40.0; -LandscapeTileNear_ps2 = 50.0; -LandscapeTileNear_ps3 = 80.0; - -// NB: threshold is inverted ULandscape::setThreshold(), to be more intelligible -LandscapeThreshold = 1000.0; -LandscapeThreshold_min = 100.0; // Low quality => 0.01 threshold -LandscapeThreshold_max = 2000.0; // High quality => 0.0005 threshold -LandscapeThreshold_step = 100.0; -LandscapeThreshold_ps0 = 100.0; -LandscapeThreshold_ps1 = 500.0; -LandscapeThreshold_ps2 = 1000.0; -LandscapeThreshold_ps3 = 2000.0; - -Vision = 500.000000; -Vision_min = 200.000000; -Vision_max = 800.000000; -Vision_step = 100.000000; -Vision_ps0 = 200.0; -Vision_ps1 = 400.0; -Vision_ps2 = 500.0; -Vision_ps3 = 800.0; - -MicroVeget = 1; // Enable/Disable MicroVeget. -MicroVeget_ps0 = 0; -MicroVeget_ps1 = 1; -MicroVeget_ps2 = 1; -MicroVeget_ps3 = 1; - -MicroVegetDensity = 80.0; -MicroVegetDensity_min = 10.0; -MicroVegetDensity_max = 100.0; -MicroVegetDensity_step = 10.0; -MicroVegetDensity_ps0 = 10.0; // not used since disabled! -MicroVegetDensity_ps1 = 30.0; -MicroVegetDensity_ps2 = 80.0; -MicroVegetDensity_ps3 = 100.0; - - -// *** FX -FxNbMaxPoly = 20000; -FxNbMaxPoly_min = 2000; -FxNbMaxPoly_max = 50000; -FxNbMaxPoly_step= 2000; -FxNbMaxPoly_ps0 = 2000; -FxNbMaxPoly_ps1 = 10000; -FxNbMaxPoly_ps2 = 20000; -FxNbMaxPoly_ps3 = 50000; - -Cloud = 1; -Cloud_ps0 = 0 ; -Cloud_ps1 = 1 ; -Cloud_ps2 = 1 ; -Cloud_ps3 = 1 ; - -CloudQuality = 160.0; -CloudQuality_min = 80.0; -CloudQuality_max = 320.0; -CloudQuality_step = 20.0; -CloudQuality_ps0 = 80.0; // not used since disabled! -CloudQuality_ps1 = 80.0; -CloudQuality_ps2 = 160.0; -CloudQuality_ps3 = 320.0; - -CloudUpdate = 1; -CloudUpdate_min = 1; -CloudUpdate_max = 8; -CloudUpdate_step= 1; -CloudUpdate_ps0 = 1; // not used since disabled! -CloudUpdate_ps1 = 1; -CloudUpdate_ps2 = 1; -CloudUpdate_ps3 = 3; - -Shadows = 1; -Shadows_ps0 = 0; -Shadows_ps1 = 1; -Shadows_ps2 = 1; -Shadows_ps3 = 1; - -Bloom = 0; -Bloom_ps0 = 0; -Bloom_ps1 = 1; -Bloom_ps2 = 1; -Bloom_ps3 = 1; - -SquareBloom = 1; -SquareBloom_ps0 = 0; -SquareBloom_ps1 = 1; -SquareBloom_ps2 = 1; -SquareBloom_ps3 = 1; - -DensityBloom = 255.0; -DensityBloom_min = 0.0; -DensityBloom_max = 255.0; -DensityBloom_step = 1.0; -DensityBloom_ps0 = 255.0; -DensityBloom_ps1 = 255.0; -DensityBloom_ps2 = 255.0; -DensityBloom_ps3 = 255.0; - - -// *** CHARACTERS -SkinNbMaxPoly = 100000; -SkinNbMaxPoly_min = 5000; -SkinNbMaxPoly_max = 250000; -SkinNbMaxPoly_step = 5000; -SkinNbMaxPoly_ps0 = 10000; -SkinNbMaxPoly_ps1 = 70000; -SkinNbMaxPoly_ps2 = 100000; -SkinNbMaxPoly_ps3 = 200000; - -NbMaxSkeletonNotCLod = 125; -NbMaxSkeletonNotCLod_min = 5; -NbMaxSkeletonNotCLod_max = 255; -NbMaxSkeletonNotCLod_step = 5; -NbMaxSkeletonNotCLod_ps0 = 10; -NbMaxSkeletonNotCLod_ps1 = 50; -NbMaxSkeletonNotCLod_ps2 = 125; -NbMaxSkeletonNotCLod_ps3 = 255; - -CharacterFarClip = 200.0; -CharacterFarClip_min = 50.0; -CharacterFarClip_max = 500.0; -CharacterFarClip_step = 10.0; -CharacterFarClip_ps0 = 50.0; -CharacterFarClip_ps1 = 100.0; -CharacterFarClip_ps2 = 200.0; -CharacterFarClip_ps3 = 500.0; - -EnableRacialAnimation = 1; - -// *** MISC -// This is the actual aspect ratio of your screen (no relation with the resolution!!). Set 1.7777 if you got a 16/9 screen for instance -ScreenAspectRatio = 0.0; -ForceDXTC = 1; // Enable/Disable DXTC. -DivideTextureSizeBy2= 0; // Divide texture size -DisableVtxProgram = 0; // Disable Hardware Vertex Program. -DisableVtxAGP = 0; // Disable Hardware Vertex AGP. -DisableTextureShdr = 0; // Disable Hardware Texture Shader. -HDEntityTexture = 0; -HDTextureInstalled = 1; -WaitVBL = 0; // 0 or 1 to wait Vertical Sync. - -////////////////// -// GAME OPTIONS // -////////////////// -SelectWithRClick = 1; -DisplayWeapons = 1; -RotKeySpeedMax = 2.0; -RotKeySpeedMax_min = 1.0; -RotKeySpeedMax_max = 4.0; -RotKeySpeedMin = 1.0; -RotKeySpeedMin_min = 0.5; -RotKeySpeedMin_max = 2.0; -RotAccel = 3.0; -FollowOnAtk = 0; -AtkOnSelect = 0; -ZCPacsPrim = "gen_bt_col_ext.pacs_prim"; - -///////////////// -// PREFERENCES // -///////////////// -FPV = 0; // FPV(First Person View) : default is false (Third Person View). -CameraHeight = 2.2; // Camera Height (in meter) from the ground (for the Third Person View). -CameraDistance = 3.0; // Camera Distance(in meter) from the user (for the Third Person View). -CameraDistStep = 1.0; -CameraDistMin = 1.0; -CameraDistMax = 25.0; -CameraAccel = 5.0; -CameraSpeedMin = 2.0; -CameraSpeedMax = 100.0; -CameraResetSpeed = 10.0; // Speed in radian/s - -////////////////// -// SOUND CONFIG // -////////////////// -SoundForceSoftwareBuffer= 1; -SoundOn = 1; -UseEax = 0; - -MaxTrack = 32; -MaxTrack_min = 4; -MaxTrack_max = 32; -MaxTrack_step = 4; - -// This is the volume for "InGame" sound FXs -SoundSFXVolume = 1.0; -SoundSFXVolume_min = 0.0; -SoundSFXVolume_max = 1.0; -SoundSFXVolume_step = 0.001; - -// This is volume for "InGame" music. Does not affect the MP3 player -SoundGameMusicVolume = 0.5; -SoundGameMusicVolume_min = 0.0; -SoundGameMusicVolume_max = 1.0; -SoundGameMusicVolume_step = 0.001; - -// MISC -PreDataPath = { "user", "patch", "examples", "${RYZOM_SHARE_PREFIX}/data/fonts", "${RYZOM_SHARE_PREFIX}/data/gamedev.bnp" }; -DataPath = { "${RYZOM_SHARE_PREFIX}/data" }; -NeedComputeVS = 0; - -NegFiltersDebug = {"Update DB", "Reading:", "Read Value :", "impulseCallBack", "CLIMPD:", "LNET" }; -NegFiltersInfo = { "CLIMPD:", "CPath::lookup" , "LNET" }; -NegFiltersWarning = { "'basics.Equipment Slot'.", "_usercolor.tga", "PACS" }; - -// Big screen shot -ScreenShotWidth = 0; -ScreenShotHeight = 0; -ScreenShotFullDetail = 1; // 1 to switch full detail mode for characters (both standard & big screenshots) - -// Read : "ID", "R G B A MODE [FX]" -SystemInfoColors = -{ -// OLD STUFF Here for compatibility -"RG", "0 0 0 255 normal", // Black to see when there is an error -"BC", "0 0 0 255 normal", // Black to see when there is an error -"JA", "0 0 0 255 normal", // Black to see when there is an error -"BL", "0 0 0 255 normal", // Black to see when there is an error -"VE", "0 0 0 255 normal", // Black to see when there is an error -"VI", "0 0 0 255 normal", // Black to see when there is an error - -// NEW System Info Categories -"SYS", "255 255 255 255 normal", // Default system messages -"BC", "255 255 255 255 centeraround", // Broadcast messages -"TAGBC", "255 255 255 255 centeraround", // Taged broadcast messages : color should remain white as some word are tagged -"XP", "255 255 64 255 over", // XP Gain -"SP", "255 255 64 255 over", // SP Gain -"TTL", "255 255 64 255 over", // Title -"TSK", "255 255 255 255 over", // Task -"ZON", "255 255 255 255 center", // Zone -"DG", "255 0 0 255 normal", // Damage to me -"DMG", "255 0 0 255 normal", // Damage to me -"DGP", "200 0 0 255 normal", // Damage to me from player -"DGM", "255 128 64 255 normal", // Damage from me -"MIS", "150 150 150 255 normal", // The opponent misses -"MISM", "255 255 255 255 normal", // I miss -"ITM", "0 200 0 255 over", // Item -"ITMO", "170 170 255 255 overonly", // Item other in group -"ITMF", "220 0 220 255 over", // Item failed -"SPL", "50 50 250 255 normal", // Spell to me -"SPLM", "50 150 250 255 normal", // Spell from me -"EMT", "255 150 150 255 normal", // Emote -"MTD", "255 255 0 255 over", // Message Of The Day -"FORLD","64 255 64 255 overonly", // Forage Locate Deposit -"CHK", "255 120 60 255 center", // Tous ce qui ne remplit pas une condition -"CHKCB","255 255 0 255 center", // Tous ce qui ne remplit pas une condition en combat (trop loin, cible invalide, pas assez de mana, etc.) -"PVPTM","255 120 60 255 overonly", // PVP timer -"THM", "255 255 64 255 over misc_levelup.ps", // Thema finished -"AMB", "255 255 64 255 center", // Ambiance -"ISE", "192 208 255 255 normal", // Item special effect -"ISE2", "192 208 255 255 center", // Item special effect with center text (for effects without flying text) -"OSM", "128 160 255 255 center", // Outpost state message -"AROUND","255 255 0 255 around", // Only in around channel -"R2_INVITE","0 255 0 255 around", // Ring invitation -}; - -PrintfCommands = { - "52", "15", "55 55 0 255", "28", "uiChapterV", "624", - "428", "0 0 0 255", "18", "", "624", "378", - "0 0 0 255", "14", "", "644", "278", "0 0 0 255", - "18", "", "52", "17", "255 255 255 255", "28", - "uiChapterV", "622", "430", "255 255 255 255", "18", "", - "622", "380", "255 255 255 255", "14", "", "642", - "280", "255 255 255 255", "18", "" -}; - -PrintfCommandsFreeTrial = { - "52", "15", "55 55 0 255", "28", "uiChapterV", "624", - "428", "0 0 0 255", "18", "", "624", "378", - "0 0 0 255", "14", "", "644", "278", "0 0 0 255", - "18", "", "52", "17", "255 255 255 255", "28", - "uiChapterV", "622", "430", "255 255 255 255", "18", "", - "622", "380", "255 255 255 255", "14", "", "642", - "280", "255 255 255 255", "18", "" -}; - -DisplayMissingAnimFile = 0; - -LoadingStringCount = 54; - - -// Some R2 parameters ... - -R2Mode = 1; -R2EDEnabled = 1; -R2EDExtendedDebug = 0; -R2EDLightPalette = 0; -R2ClientGw = "r2linux01"; -LoadLuaDebugger = 0; -CheckR2ScenarioMD5 = 1; -LevelDesignEnabled = 0; - -DmCameraDistMax = 25; -DmRun = 20; -DmWalk = 6; - -R2EDReloadFiles = { - "r2ed.xml", - "r2_basic_bricks.lua", - "r2_components.lua", - "r2_core.lua", - "r2_features_default.lua", - "r2_features_fauna.lua", - "r2_features_npc_groups.lua", - "r2_palette.lua", - "r2_scenario.lua", - "r2_ui.lua" -}; - -XMLInterfaceFiles = { - "config.xml", - "widgets.xml", - "webig_widgets.xml", - "player.xml", - "inventory.xml", - "interaction.xml", - "phrase.xml", - "harvest.xml", - "macros.xml", - "info_player.xml", - "outpost.xml", - "guild.xml", - "taskbar.xml", - "game_config.xml", - "game_context_menu.xml", - "player_trade.xml", - "bot_chat_v4.xml", - "compass.xml", - "map.xml", - "hierarchy.xml", - "reset.xml", - "actions.xml", - "help.xml", - "encyclopedia.xml", - "commands.xml", - "commands2.xml", - "ring_access_point_filter.xml", - "ring_window.xml", - "bg_downloader.xml" -}; - -XMLR2EDInterfaceFiles = -{ - "r2ed.xml", - "r2_triggers.xml", - "r2_logic_entities.xml", - "r2ed_acts.xml", - "r2ed_scenario.xml", - "r2ed_connect.xml" -}; - -FogDistAndDepthLookupBias = 20; // bias for lookup of fog distance and depth - - -// Hardware cursor textures -// These will be extracted from the corresponding packed ui .tga files when they are loaded -// * -// * individual .tga files for hardware cursor bitmap not looked for, and not supported yet -HardwareCursors = -{ - "curs_can_pan.tga", - "curs_can_pan_dup.tga", - "curs_create.tga", - "curs_create_multi.tga", - "curs_create_vertex_invalid.tga", - "curs_default.tga", - "curs_dup.tga", - "curs_L.tga", - "curs_M.tga", - "curs_pan.tga", - "curs_pan_dup.tga", - "curs_pick.tga", - "curs_pick_dup.tga", - "curs_R.tga", - "curs_resize_BL_TR.tga", - "curs_resize_BR_TL.tga", - "curs_resize_LR.tga", - "curs_resize_TB.tga", - "curs_rotate.tga", - "curs_scale.tga", - "curs_stop.tga", - "text_cursor.tga", - "r2_hand_can_pan.tga", - "r2_hand_pan.tga", - "r2ed_tool_can_pick.tga", - "r2ed_tool_can_rotate.tga", - "r2ed_tool_pick.tga", - "r2ed_tool_rotate.tga", - "r2ed_tool_rotating.tga" -}; - -Loading_BG = "new_loading_bg.tga"; // Default name for the loading background file. -Launch_BG = "new_launcher_bg.tga"; // Default name for the launch background file. -TeleportKami_BG = "new_teleport_kami_bg.tga"; -TeleportKaravan_BG = "new_teleport_caravan_bg.tga"; -Elevator_BG = "new_elevator_bg.tga"; // Default name for the loading background file. -ResurectKami_BG = "new_resurect_kami_bg.tga"; -ResurectKaravan_BG = "new_resurect_caravane_bg.tga"; -End_BG = "end_bg.tga"; // Default name for the last background file. - -ScenarioSavePath = "./my_scenarios/"; - -// list ofpredefined keyset -// name will be looked up in the translation file by searching 'uiCP_KeysetName_" + id -// tooltip will be looked up in the translation file by searching 'uiCP_KeysetTooltip_" + id -// 'bi.' stands for built-in -// note : we add a dot in the name to be sure that there cannot be a conflict with character keyset name -BuiltInKeySets = -{ - "", // default ryzom keyboard layout - "bi.zqsd", // european keyboard fps displacement style (NB : don't change this layout name, ryzom will automatically select it if keyboard is french or belgian) - "bi.wasd", // english keyboard fps displacement style (NB : don't change this layout name, ryzom will automatically select it if keyboard is not french nor belgian) - "bi.wow_alike" // 'world of warcraft' like keyboard style. (NB : not available for ring) -}; - -// "Newbie Training", "Story Telling", "Mistery", "Hack & Slash", "Guild Training", "Other" -ScenarioTypes = {"so_newbie_training","so_story_telling","so_mistery","so_hack_slash","so_guild_training","so_other"}; - -ScenarioLanguages = {"fr","de","en","other_lang"}; - -// Map each language to a forum help page -HelpPages = -{ - "fr=http://forums.ryzom.com/forum/showthread.php?t=29130", - "en=http://forums.ryzom.com/forum/showthread.php?t=29129", - "wk=http://forums.ryzom.com/forum/showthread.php?t=29129", - "de=http://forums.ryzom.com/forum/showthread.php?t=29131" -}; - -WebIgMainDomain = "atys.ryzom.com"; - -WebIgTrustedDomains = -{ - "atys.ryzom.com" -}; - -PatchletUrl = "http://atys.ryzom.com/start/app_patchlet.php?patch=preload"; - -SelectedSlot = 0; - -BuildName = "RELEASE_HEAD"; +////////////////////////// +////////////////////////// +/// CLIENT CONFIG FILE /// +////////////////////////// +////////////////////////// + + +// If you set this variable to 1, your client.cfg will be overwritten when you quit the client. +// You will loose all the comments and identation in this file. +SaveConfig = 1; + +/////////////////// +// WINDOW CONFIG // +/////////////////// + +Driver3D="Auto"; // Valid values are "Auto" or "0", "OpengGL" or "1" & "Direct3D" or "2" + // "Auto" will choose the best suited driver depending on hardware +FullScreen = 0; +Width = 1024; +Height = 768; +PositionX = 0; +PositionY = 0; +Frequency = 60; +Depth = 32; +Sleep = -1; +ProcessPriority = 0; // -2 = idle, -1 = below normal, 0 = normal, 1 = above normal, 2 = high, 3 = real time +Contrast = 0.0; // -1.0 ~ 1.0 +Luminosity = 0.0; // -1.0 ~ 1.0 +Gamma = 0.0; // -1.0 ~ 1.0 +Contrast_min = -1.0; +Luminosity_min = -1.0; +Gamma_min = -1.0; +Contrast_max = 1.0; +Luminosity_max = 1.0; +Gamma_max = 1.0; + + +///////////// +// NETWORK // +///////////// + +Application = { "ryzom_live", "./client_ryzom_r.exe", "./" }; +BackgroundDownloader = 0; +PatchServer = "http://dl.ryzom.com/patch_live"; +SignUpURL = "http://www.ryzom.com/subscribe"; +StartupHost = "shard.ryzom.com:40916"; +StartupPage = "/login/r2_login.php"; +InstallStatsUrl = "http://shard.ryzom.com:50000/stats/stats.php"; +CreateAccountURL = "https://secure.ryzom.com/signup/from_client.php"; +InstallWebPage = "http://dl.ryzom.com/installer/"; + + +//////////////// +// INTERFACES // +//////////////// + +// the language to use as in ISO 639-2 +LanguageCode = "en"; // english + +XMLInputFile = "input_config_v3.xml"; + +XMLLoginInterfaceFiles = { + "login_config.xml", + "login_widgets.xml", + "login_main.xml", + "login_keys.xml", +}; + +XMLOutGameInterfaceFiles = { + "out_v2_config.xml", + "out_v2_widgets.xml", + "out_v2_connect.xml", + "out_v2_intro.xml", + "out_v2_select.xml", + "out_v2_appear.xml", + "out_v2_location.xml", + "out_v2_crash.xml", + "out_v2_hierarchy.xml", + "out_v2_keys.xml", +}; + +// The ligo primitive class file +LigoPrimitiveClass = "world_editor_classes.xml"; + +VerboseLog = 1; + +/////////// +// MOUSE // +/////////// +HardwareCursor = 1; + +CursorSpeed = 1.0; // In pixels per mickey +CursorSpeed_min = 0.5; +CursorSpeed_max = 2.0; + +CursorAcceleration = 40; // Threshold in mickey +CursorAcceleration_min = 20; +CursorAcceleration_max = 80; + +FreeLookSpeed = 0.004; // In radian per mickey +FreeLookSpeed_min = 0.0001; +FreeLookSpeed_max = 0.01; + +FreeLookAcceleration = 40; // Threshold in mickey +FreeLookAcceleration_min = 20; +FreeLookAcceleration_max = 80; + +FreeLookInverted = 0; +AutomaticCamera = 0; +DblClickMode = 1; +AutoEquipTool = 1; + +/////////////////// +// RENDER CONFIG // +/////////////////// + +// NB: thoses variables configure also the InGameConfigurator: +// _min and _max define the bounds +// _step defines the step (NB: take care of _min and _max!!) +// _ps0 is the LOW preset, _ps1 is the MEDIUM preset, _ps2 is the NORMAL Preset, and _ps3 is the HIGH one + + +// *** LANDSCAPE +LandscapeTileNear = 150.000000; +LandscapeTileNear_min = 20.000000; +LandscapeTileNear_max = 250.000000; +LandscapeTileNear_step = 10.0; +LandscapeTileNear_ps0 = 20.0; +LandscapeTileNear_ps1 = 100.0; +LandscapeTileNear_ps2 = 150.0; +LandscapeTileNear_ps3 = 200.0; + +// NB: threshold is inverted ULandscape::setThreshold(), to be more intelligible +LandscapeThreshold = 2000.0; +LandscapeThreshold_min = 100.0; // Low quality => 0.01 threshold +LandscapeThreshold_max = 4000.0; // High quality => 0.0005 threshold +LandscapeThreshold_step = 100.0; +LandscapeThreshold_ps0 = 100.0; +LandscapeThreshold_ps1 = 1000.0; +LandscapeThreshold_ps2 = 2000.0; +LandscapeThreshold_ps3 = 3000.0; + +Vision = 500.000000; +Vision_min = 200.000000; +Vision_max = 800.000000; +Vision_step = 100.000000; +Vision_ps0 = 200.0; +Vision_ps1 = 400.0; +Vision_ps2 = 500.0; +Vision_ps3 = 800.0; + +MicroVeget = 1; // Enable/Disable MicroVeget. +MicroVeget_ps0 = 0; +MicroVeget_ps1 = 1; +MicroVeget_ps2 = 1; +MicroVeget_ps3 = 1; + +MicroVegetDensity = 80.0; +MicroVegetDensity_min = 10.0; +MicroVegetDensity_max = 100.0; +MicroVegetDensity_step = 10.0; +MicroVegetDensity_ps0 = 10.0; // not used since disabled! +MicroVegetDensity_ps1 = 30.0; +MicroVegetDensity_ps2 = 80.0; +MicroVegetDensity_ps3 = 100.0; + + +// *** FX +FxNbMaxPoly = 20000; +FxNbMaxPoly_min = 2000; +FxNbMaxPoly_max = 50000; +FxNbMaxPoly_step= 2000; +FxNbMaxPoly_ps0 = 2000; +FxNbMaxPoly_ps1 = 10000; +FxNbMaxPoly_ps2 = 20000; +FxNbMaxPoly_ps3 = 50000; + +Cloud = 1; +Cloud_ps0 = 0 ; +Cloud_ps1 = 1 ; +Cloud_ps2 = 1 ; +Cloud_ps3 = 1 ; + +CloudQuality = 160.0; +CloudQuality_min = 80.0; +CloudQuality_max = 320.0; +CloudQuality_step = 20.0; +CloudQuality_ps0 = 80.0; // not used since disabled! +CloudQuality_ps1 = 80.0; +CloudQuality_ps2 = 160.0; +CloudQuality_ps3 = 320.0; + +CloudUpdate = 1; +CloudUpdate_min = 1; +CloudUpdate_max = 8; +CloudUpdate_step= 1; +CloudUpdate_ps0 = 1; // not used since disabled! +CloudUpdate_ps1 = 1; +CloudUpdate_ps2 = 1; +CloudUpdate_ps3 = 3; + +Shadows = 1; +Shadows_ps0 = 0; +Shadows_ps1 = 1; +Shadows_ps2 = 1; +Shadows_ps3 = 1; + +Bloom = 0; +Bloom_ps0 = 0; +Bloom_ps1 = 1; +Bloom_ps2 = 1; +Bloom_ps3 = 1; + +SquareBloom = 1; +SquareBloom_ps0 = 0; +SquareBloom_ps1 = 1; +SquareBloom_ps2 = 1; +SquareBloom_ps3 = 1; + +DensityBloom = 255.0; +DensityBloom_min = 0.0; +DensityBloom_max = 255.0; +DensityBloom_step = 1.0; +DensityBloom_ps0 = 255.0; +DensityBloom_ps1 = 255.0; +DensityBloom_ps2 = 255.0; +DensityBloom_ps3 = 255.0; + + +// *** CHARACTERS +SkinNbMaxPoly = 100000; +SkinNbMaxPoly_min = 5000; +SkinNbMaxPoly_max = 250000; +SkinNbMaxPoly_step = 5000; +SkinNbMaxPoly_ps0 = 10000; +SkinNbMaxPoly_ps1 = 70000; +SkinNbMaxPoly_ps2 = 100000; +SkinNbMaxPoly_ps3 = 200000; + +NbMaxSkeletonNotCLod = 125; +NbMaxSkeletonNotCLod_min = 5; +NbMaxSkeletonNotCLod_max = 255; +NbMaxSkeletonNotCLod_step = 5; +NbMaxSkeletonNotCLod_ps0 = 10; +NbMaxSkeletonNotCLod_ps1 = 50; +NbMaxSkeletonNotCLod_ps2 = 125; +NbMaxSkeletonNotCLod_ps3 = 255; + +CharacterFarClip = 200.0; +CharacterFarClip_min = 50.0; +CharacterFarClip_max = 500.0; +CharacterFarClip_step = 10.0; +CharacterFarClip_ps0 = 50.0; +CharacterFarClip_ps1 = 100.0; +CharacterFarClip_ps2 = 200.0; +CharacterFarClip_ps3 = 500.0; + +EnableRacialAnimation = 1; + +// *** MISC +// This is the actual aspect ratio of your screen (no relation with the resolution!!). Set 1.7777 if you got a 16/9 screen for instance +ScreenAspectRatio = 0.0; +ForceDXTC = 1; // Enable/Disable DXTC. +DivideTextureSizeBy2= 0; // Divide texture size +DisableVtxProgram = 0; // Disable Hardware Vertex Program. +DisableVtxAGP = 0; // Disable Hardware Vertex AGP. +DisableTextureShdr = 0; // Disable Hardware Texture Shader. +HDEntityTexture = 0; +HDTextureInstalled = 1; +WaitVBL = 0; // 0 or 1 to wait Vertical Sync. + +////////////////// +// GAME OPTIONS // +////////////////// +SelectWithRClick = 1; +DisplayWeapons = 1; +RotKeySpeedMax = 2.0; +RotKeySpeedMax_min = 1.0; +RotKeySpeedMax_max = 4.0; +RotKeySpeedMin = 1.0; +RotKeySpeedMin_min = 0.5; +RotKeySpeedMin_max = 2.0; +RotAccel = 3.0; +FollowOnAtk = 0; +AtkOnSelect = 0; +ZCPacsPrim = "gen_bt_col_ext.pacs_prim"; + +///////////////// +// PREFERENCES // +///////////////// +FPV = 0; // FPV(First Person View) : default is false (Third Person View). +CameraHeight = 2.2; // Camera Height (in meter) from the ground (for the Third Person View). +CameraDistance = 3.0; // Camera Distance(in meter) from the user (for the Third Person View). +CameraDistStep = 1.0; +CameraDistMin = 1.0; +CameraDistMax = 25.0; +CameraAccel = 5.0; +CameraSpeedMin = 2.0; +CameraSpeedMax = 100.0; +CameraResetSpeed = 10.0; // Speed in radian/s + +////////////////// +// SOUND CONFIG // +////////////////// +SoundForceSoftwareBuffer= 1; +SoundOn = 1; +UseEax = 0; + +MaxTrack = 32; +MaxTrack_min = 4; +MaxTrack_max = 32; +MaxTrack_step = 4; + +// This is the volume for "InGame" sound FXs +SoundSFXVolume = 1.0; +SoundSFXVolume_min = 0.0; +SoundSFXVolume_max = 1.0; +SoundSFXVolume_step = 0.001; + +// This is volume for "InGame" music. Does not affect the MP3 player +SoundGameMusicVolume = 0.5; +SoundGameMusicVolume_min = 0.0; +SoundGameMusicVolume_max = 1.0; +SoundGameMusicVolume_step = 0.001; + +// MISC +PreDataPath = { "user", "patch", "examples", "data/fonts", "data/gamedev.bnp" }; +DataPath = { "data" }; +NeedComputeVS = 0; + +NegFiltersDebug = {"Update DB", "Reading:", "Read Value :", "impulseCallBack", "CLIMPD:", "LNET" }; +NegFiltersInfo = { "CLIMPD:", "CPath::lookup" , "LNET" }; +NegFiltersWarning = { "'basics.Equipment Slot'.", "_usercolor.tga", "PACS" }; + +// Big screen shot +ScreenShotWidth = 0; +ScreenShotHeight = 0; +ScreenShotFullDetail = 1; // 1 to switch full detail mode for characters (both standard & big screenshots) + +// Read : "ID", "R G B A MODE [FX]" +SystemInfoColors = +{ +// OLD STUFF Here for compatibility +"RG", "0 0 0 255 normal", // Black to see when there is an error +"BC", "0 0 0 255 normal", // Black to see when there is an error +"JA", "0 0 0 255 normal", // Black to see when there is an error +"BL", "0 0 0 255 normal", // Black to see when there is an error +"VE", "0 0 0 255 normal", // Black to see when there is an error +"VI", "0 0 0 255 normal", // Black to see when there is an error + +// NEW System Info Categories +"SYS", "255 255 255 255 normal", // Default system messages +"BC", "255 255 255 255 centeraround", // Broadcast messages +"TAGBC", "255 255 255 255 centeraround", // Taged broadcast messages : color should remain white as some word are tagged +"XP", "255 255 64 255 over", // XP Gain +"SP", "255 255 64 255 over", // SP Gain +"TTL", "255 255 64 255 over", // Title +"TSK", "255 255 255 255 over", // Task +"ZON", "255 255 255 255 center", // Zone +"DG", "255 0 0 255 normal", // Damage to me +"DMG", "255 0 0 255 normal", // Damage to me +"DGP", "200 0 0 255 normal", // Damage to me from player +"DGM", "255 128 64 255 normal", // Damage from me +"MIS", "150 150 150 255 normal", // The opponent misses +"MISM", "255 255 255 255 normal", // I miss +"ITM", "0 200 0 255 over", // Item +"ITMO", "170 170 255 255 overonly", // Item other in group +"ITMF", "220 0 220 255 over", // Item failed +"SPL", "50 50 250 255 normal", // Spell to me +"SPLM", "50 150 250 255 normal", // Spell from me +"EMT", "255 150 150 255 normal", // Emote +"MTD", "255 255 0 255 over", // Message Of The Day +"FORLD","64 255 64 255 overonly", // Forage Locate Deposit +"CHK", "255 120 60 255 center", // Tous ce qui ne remplit pas une condition +"CHKCB","255 255 0 255 center", // Tous ce qui ne remplit pas une condition en combat (trop loin, cible invalide, pas assez de mana, etc.) +"PVPTM","255 120 60 255 overonly", // PVP timer +"THM", "255 255 64 255 over misc_levelup.ps", // Thema finished +"AMB", "255 255 64 255 center", // Ambiance +"ISE", "192 208 255 255 normal", // Item special effect +"ISE2", "192 208 255 255 center", // Item special effect with center text (for effects without flying text) +"OSM", "128 160 255 255 center", // Outpost state message +"AROUND","255 255 0 255 around", // Only in around channel +"R2_INVITE","0 255 0 255 around", // Ring invitation +}; + +PrintfCommands = { + "52", "15", "55 55 0 255", "28", "uiChapterV", "624", + "428", "0 0 0 255", "18", "", "624", "378", + "0 0 0 255", "14", "", "644", "278", "0 0 0 255", + "18", "", "52", "17", "255 255 255 255", "28", + "uiChapterV", "622", "430", "255 255 255 255", "18", "", + "622", "380", "255 255 255 255", "14", "", "642", + "280", "255 255 255 255", "18", "" +}; + +PrintfCommandsFreeTrial = { + "52", "15", "55 55 0 255", "28", "uiChapterV", "624", + "428", "0 0 0 255", "18", "", "624", "378", + "0 0 0 255", "14", "", "644", "278", "0 0 0 255", + "18", "", "52", "17", "255 255 255 255", "28", + "uiChapterV", "622", "430", "255 255 255 255", "18", "", + "622", "380", "255 255 255 255", "14", "", "642", + "280", "255 255 255 255", "18", "" +}; + +DisplayMissingAnimFile = 0; + +LoadingStringCount = 54; + + +// Some R2 parameters ... + +R2Mode = 1; +R2EDEnabled = 1; +R2EDExtendedDebug = 0; +R2EDLightPalette = 0; +R2ClientGw = "r2linux01"; +LoadLuaDebugger = 0; +CheckR2ScenarioMD5 = 1; +LevelDesignEnabled = 0; + +DmCameraDistMax = 25; +DmRun = 20; +DmWalk = 6; + +R2EDReloadFiles = { + "r2ed.xml", + "r2_basic_bricks.lua", + "r2_components.lua", + "r2_core.lua", + "r2_features_default.lua", + "r2_features_fauna.lua", + "r2_features_npc_groups.lua", + "r2_palette.lua", + "r2_scenario.lua", + "r2_ui.lua" +}; + +XMLInterfaceFiles = { + "config.xml", + "widgets.xml", + "webig_widgets.xml", + "player.xml", + "inventory.xml", + "interaction.xml", + "phrase.xml", + "harvest.xml", + "macros.xml", + "info_player.xml", + "outpost.xml", + "guild.xml", + "taskbar.xml", + "game_config.xml", + "game_context_menu.xml", + "player_trade.xml", + "bot_chat_v4.xml", + "compass.xml", + "map.xml", + "hierarchy.xml", + "reset.xml", + "actions.xml", + "help.xml", + "encyclopedia.xml", + "commands.xml", + "commands2.xml", + "ring_access_point_filter.xml", + "ring_window.xml", + "bg_downloader.xml" +}; + +XMLR2EDInterfaceFiles = +{ + "r2ed.xml", + "r2_triggers.xml", + "r2_logic_entities.xml", + "r2ed_acts.xml", + "r2ed_scenario.xml", + "r2ed_connect.xml" +}; + +FogDistAndDepthLookupBias = 20; // bias for lookup of fog distance and depth + + +// Hardware cursor textures +// These will be extracted from the corresponding packed ui .tga files when they are loaded +// * +// * individual .tga files for hardware cursor bitmap not looked for, and not supported yet +HardwareCursors = +{ + "curs_can_pan.tga", + "curs_can_pan_dup.tga", + "curs_create.tga", + "curs_create_multi.tga", + "curs_create_vertex_invalid.tga", + "curs_default.tga", + "curs_dup.tga", + "curs_L.tga", + "curs_M.tga", + "curs_pan.tga", + "curs_pan_dup.tga", + "curs_pick.tga", + "curs_pick_dup.tga", + "curs_R.tga", + "curs_resize_BL_TR.tga", + "curs_resize_BR_TL.tga", + "curs_resize_LR.tga", + "curs_resize_TB.tga", + "curs_rotate.tga", + "curs_scale.tga", + "curs_stop.tga", + "text_cursor.tga", + "r2_hand_can_pan.tga", + "r2_hand_pan.tga", + "r2ed_tool_can_pick.tga", + "r2ed_tool_can_rotate.tga", + "r2ed_tool_pick.tga", + "r2ed_tool_rotate.tga", + "r2ed_tool_rotating.tga" +}; + +Loading_BG = "new_loading_bg.tga"; // Default name for the loading background file. +Launch_BG = "new_launcher_bg.tga"; // Default name for the launch background file. +TeleportKami_BG = "new_teleport_kami_bg.tga"; +TeleportKaravan_BG = "new_teleport_caravan_bg.tga"; +Elevator_BG = "new_elevator_bg.tga"; // Default name for the loading background file. +ResurectKami_BG = "new_resurect_kami_bg.tga"; +ResurectKaravan_BG = "new_resurect_caravane_bg.tga"; +End_BG = "end_bg.tga"; // Default name for the last background file. + +ScenarioSavePath = "./my_scenarios/"; + +// list ofpredefined keyset +// name will be looked up in the translation file by searching 'uiCP_KeysetName_" + id +// tooltip will be looked up in the translation file by searching 'uiCP_KeysetTooltip_" + id +// 'bi.' stands for built-in +// note : we add a dot in the name to be sure that there cannot be a conflict with character keyset name +BuiltInKeySets = +{ + "", // default ryzom keyboard layout + "bi.zqsd", // european keyboard fps displacement style (NB : don't change this layout name, ryzom will automatically select it if keyboard is french or belgian) + "bi.wasd", // english keyboard fps displacement style (NB : don't change this layout name, ryzom will automatically select it if keyboard is not french nor belgian) + "bi.wow_alike" // 'world of warcraft' like keyboard style. (NB : not available for ring) +}; + +// "Newbie Training", "Story Telling", "Mistery", "Hack & Slash", "Guild Training", "Other" +ScenarioTypes = {"so_newbie_training","so_story_telling","so_mistery","so_hack_slash","so_guild_training","so_other"}; + +ScenarioLanguages = {"fr","de","en","other_lang"}; + +// Map each language to a forum help page +HelpPages = +{ + "fr=http://forums.ryzom.com/forum/showthread.php?t=29130", + "en=http://forums.ryzom.com/forum/showthread.php?t=29129", + "wk=http://forums.ryzom.com/forum/showthread.php?t=29129", + "de=http://forums.ryzom.com/forum/showthread.php?t=29131" +}; + +WebIgMainDomain = "app.ryzom.com"; +WebIgTrustedDomains = { + "api.ryzom.com", "app.ryzom.com" +}; +PatchletUrl = "http://app.ryzom.com/app_patchlet/index.php?patch=preload"; + +SelectedSlot = 0; + +BuildName = "RELEASE_HEAD"; diff --git a/dist/debian/jessie/debian/compat b/dist/debian/jessie/debian/compat new file mode 100644 index 000000000..ec635144f --- /dev/null +++ b/dist/debian/jessie/debian/compat @@ -0,0 +1 @@ +9 diff --git a/dist/debian/jessie/debian/control b/dist/debian/jessie/debian/control new file mode 100644 index 000000000..2918bb7cb --- /dev/null +++ b/dist/debian/jessie/debian/control @@ -0,0 +1,212 @@ +Source: ryzom-core +Priority: extra +Maintainer: Debian Games Team +Uploaders: Luboš Novák , Cédric OCHS , Lewis Candler +Build-Depends: debhelper (>= 9), cmake(>= 3.0), libxml2-dev, + libgl1-mesa-dev, libjpeg-dev, libpng12-dev, libopenal-dev, + libfreetype6-dev, libxxf86vm-dev, libxrandr-dev, libxrender-dev, + libvorbis-dev, libcurl4-openssl-dev, libluabind-dev, + libboost-dev, libmysqlclient-dev, + libqt4-dev, libqt4-opengl-dev +Standards-Version: 3.9.5 +Section: games +Bugs: https://bitbucket.org/ryzom/ryzomcore/issues +Homepage: https://bitbucket.org/ryzom/ryzomcore/ +Vcs-Hg: https://bitbucket.org/ryzom/ryzomcore +Vcs-Browser: https://bitbucket.org/ryzom/ryzomcore + +Package: libnel0 +Section: libdevel +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Massive multi-user 3D game environments library (shared library) + This is a software platform for creating and running massively multi-user + entertainment in a 3D environment over the Internet. + . + This 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 independent from + each other so you can use only the parts you really need in your project. + . + This package contains the shared library. + +Package: libnel-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Depends: ${misc:Depends}, libnel0 (= ${binary:Version}) +Description: Massive multi-user 3D game environments library (development files) + This is a software platform for creating and running massively multi-user + entertainment in a 3D environment over the Internet. + . + This 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 independent from + each other so you can use only the parts you really need in your project. + . + This package contains the headers. + +Package: libnel0-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, libnel0 (= ${binary:Version}) +Description: Massive multi-user 3D game environments library (debugging symbols) + This is a software platform for creating and running massively multi-user + entertainment in a 3D environment over the Internet. + . + This 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 independent from + each other so you can use only the parts you really need in your project. + . + This package contains the debugging symbols. + +Package: nel-tools +Section: devel +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends}, libnel0 (= ${binary:Version}) +Description: Massive multi-user 3D game environments library (tools) + This is a software platform for creating and running massively multi-user + entertainment in a 3D environment over the Internet. + . + This 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 independent from + each other so you can use only the parts you really need in your project. + . + This package contains the tools. + +Package: nel-tools-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, nel-tools (= ${binary:Version}) +Description: Massive multi-user 3D game environments library (tools debugging symbols) + This is a software platform for creating and running massively multi-user + entertainment in a 3D environment over the Internet. + . + This 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 independent from + each other so you can use only the parts you really need in your project. + . + This package contains the tools debugging symbols. + +Package: libryzom-sevenzip0 +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Ryzom science-fantasy MMORPG (decompression library) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the decompression shared library. + +Package: libryzom-sevenzip0-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, libryzom-sevenzip0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (decompression library debugging symbols) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the decompression shared library debugging symbols. + +Package: libryzom-gameshare0 +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends}, libnel0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (common shared library) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the game common shared library. + +Package: libryzom-gameshare0-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, libryzom-gameshare0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (common debugging symbols) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the game common debugging symbols. + +Package: libryzom-clientsheets0 +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends}, libryzom-gameshare0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (client sheets shared library) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the client sheets shared library. + +Package: libryzom-clientsheets0-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, libryzom-clientsheets0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (client sheets debugging symbols) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the client sheets debugging symbols. + +Package: ryzom-client +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends}, libryzom-gameshare0 (= ${binary:Version}), + libryzom-clientsheets0 (= ${binary:Version}), + ryzom-client-config (>= ${source:Version}), rsync, wget, p7zip-full +Description: Ryzom science-fantasy MMORPG (client) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the game client. + +Package: ryzom-client-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, ryzom-client (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (client debugging symbols) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the client debugging symbols. + +Package: ryzom-tools +Section: devel +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends}, libryzom-gameshare0 (= ${binary:Version}), + libryzom-clientsheets0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (tools) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the tools. + +Package: ryzom-tools-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, ryzom-tools (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (tools debugging symbols) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the tools debugging symbols. + +Package: ryzom-client-config +Architecture: all +Depends: ${misc:Depends} +Description: Ryzom science-fantasy MMORPG (client configuration) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the client configuration. diff --git a/dist/debian/jessie/debian/copyright b/dist/debian/jessie/debian/copyright new file mode 100644 index 000000000..d5a0f2f10 --- /dev/null +++ b/dist/debian/jessie/debian/copyright @@ -0,0 +1,53 @@ +This package was debianized by Gürkan Sengün on +Tue, 23 Oct 2007 12:56:45 +0200. + +It was downloaded from + +Upstream Authors: + + Olivier Cado + Bertram Felgenhauer + Krzysztof Kotlenga + Henri Kuuste + Vianney Lecroart + Namine + Cédric Ochs + Guillaume Puzin + Matt Raykowski + Robert Timm + Titegus + Ulukyn + Robert Wetzel + Zorglor + TODO: take names from Ryzom credits + +Copyright: + + Copyright (C) 2003-2009 Vianney Lecroart + Copyright (C) 2003-2009 Matt Raykowski + Copyright (C) 2000-2006 Nevrax Ltd. + Copyright (C) 2006-2007 Gameforge France + Copyright (C) 2008-2010 Winch Gate Property Limited + +License: + + 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 . + +The Debian packaging is: + + Copyright (C) 2007 Gürkan Sengün + +and is licensed under the GPL version 2, +see `/usr/share/common-licenses/GPL-2'. + diff --git a/dist/debian/jessie/debian/docs b/dist/debian/jessie/debian/docs new file mode 100644 index 000000000..58e5e3e76 --- /dev/null +++ b/dist/debian/jessie/debian/docs @@ -0,0 +1,2 @@ +changelog +README diff --git a/dist/debian/jessie/debian/libnel-dev.docs b/dist/debian/jessie/debian/libnel-dev.docs new file mode 100644 index 000000000..ba8894c15 --- /dev/null +++ b/dist/debian/jessie/debian/libnel-dev.docs @@ -0,0 +1,2 @@ +README + diff --git a/dist/debian/jessie/debian/libnel-dev.install b/dist/debian/jessie/debian/libnel-dev.install new file mode 100644 index 000000000..9f9310cee --- /dev/null +++ b/dist/debian/jessie/debian/libnel-dev.install @@ -0,0 +1,3 @@ +usr/include/* +usr/lib/*/libnel*.so +usr/lib/*/pkgconfig/* diff --git a/dist/debian/jessie/debian/libnel-dev.manpages b/dist/debian/jessie/debian/libnel-dev.manpages new file mode 100644 index 000000000..bb4027ca9 --- /dev/null +++ b/dist/debian/jessie/debian/libnel-dev.manpages @@ -0,0 +1 @@ +debian/nel-config.1 diff --git a/dist/debian/jessie/debian/libnel-doc.doc-base.nel b/dist/debian/jessie/debian/libnel-doc.doc-base.nel new file mode 100644 index 000000000..6ae95fc9f --- /dev/null +++ b/dist/debian/jessie/debian/libnel-doc.doc-base.nel @@ -0,0 +1,9 @@ +Document: nel +Title: NeL Reference Manual +Author: Nevrax +Abstract: This is a software platform for creating and running massively multi-user entertainment in a 3D environment over the Internet. +Section: Programming/C + +Format: HTML +Index: /usr/share/doc/libnel-doc/html/index.html +Files: /usr/share/doc/libnel-doc/html/*.html diff --git a/dist/debian/jessie/debian/libnel-doc.install b/dist/debian/jessie/debian/libnel-doc.install new file mode 100644 index 000000000..bf3f02a61 --- /dev/null +++ b/dist/debian/jessie/debian/libnel-doc.install @@ -0,0 +1 @@ +usr/share/doc/libnel-doc/html/* diff --git a/dist/debian/jessie/debian/libnel0.install b/dist/debian/jessie/debian/libnel0.install new file mode 100644 index 000000000..4273c0ad1 --- /dev/null +++ b/dist/debian/jessie/debian/libnel0.install @@ -0,0 +1,3 @@ +usr/lib/*/libnel*.so.* +usr/lib/*/nel/libnel_drv_openal.so +usr/lib/*/nel/libnel_drv_opengl.so diff --git a/dist/debian/jessie/debian/libryzom-clientsheets0.install b/dist/debian/jessie/debian/libryzom-clientsheets0.install new file mode 100644 index 000000000..b5ea5b79c --- /dev/null +++ b/dist/debian/jessie/debian/libryzom-clientsheets0.install @@ -0,0 +1,2 @@ +usr/lib/*/libryzom_clientsheets.so.* + diff --git a/dist/debian/jessie/debian/libryzom-gameshare0.install b/dist/debian/jessie/debian/libryzom-gameshare0.install new file mode 100644 index 000000000..2f51b0804 --- /dev/null +++ b/dist/debian/jessie/debian/libryzom-gameshare0.install @@ -0,0 +1,2 @@ +usr/lib/*/libryzom_gameshare.so.* + diff --git a/dist/debian/jessie/debian/libryzom-sevenzip0.install b/dist/debian/jessie/debian/libryzom-sevenzip0.install new file mode 100644 index 000000000..1edced3f8 --- /dev/null +++ b/dist/debian/jessie/debian/libryzom-sevenzip0.install @@ -0,0 +1,2 @@ +usr/lib/*/libryzom_sevenzip.so.* + diff --git a/dist/debian/jessie/debian/nel-config.1 b/dist/debian/jessie/debian/nel-config.1 new file mode 100644 index 000000000..be47bf496 --- /dev/null +++ b/dist/debian/jessie/debian/nel-config.1 @@ -0,0 +1,37 @@ +.TH nel-config 1 "26 Oct 2007" +.SH NAME +nel-config \- Get information about a libnel installation +.SH SYNOPSIS +.B nel-config [options] +.SH DESCRIPTION +.B nel-config +displays information about a libnel installation. +.SH OPTIONS +.IP "--cflags" +Set of compiler options (CFLAGS) to use when compiling files that use +libnel. Currently that is only thw include path to the nel include files. +.IP "--libs" +Shows the complete set of libs and other linker options you will need in order +to link your application with libnel. +.IP "--prefix" +This is the prefix used when libnel was installed. libnel is then installed +in $prefix/lib and its header files are installed in $prefix/include and so +on. The prefix is set with "configure \-\-prefix". +.IP "--version" +Outputs version information about the installed libnel. +.SH "EXAMPLES" +What linker options do I need when I link with libnel? + + $ nel-config \-\-libs + +What compiler options do I need when I compile using libnel functions? + + $ nel-config \-\-cflags + +What's the installed libnel version? + + $ nel-config \-\-version +.SH AUTHOR +.PP +This manual page was written by G\[:u]rkan Seng\[:u]n +,for the Debian project (but may be used by others). diff --git a/dist/debian/jessie/debian/nel-tools.install b/dist/debian/jessie/debian/nel-tools.install new file mode 100644 index 000000000..4ca03208c --- /dev/null +++ b/dist/debian/jessie/debian/nel-tools.install @@ -0,0 +1,87 @@ +etc/nel/build_ig_boxes.cfg +etc/nel/build_indoor_rbank.cfg +etc/nel/build_rbank.cfg +etc/nel/make_sheet_id.cfg +etc/nel/words_dic.cfg +etc/nel/zviewer.cfg +usr/bin/animation_set_builder +usr/bin/anim_builder +usr/bin/bnp_make +usr/bin/build_clod_bank +usr/bin/build_clodtex +usr/bin/build_coarse_mesh +usr/bin/build_far_bank +usr/bin/build_ig_boxes +usr/bin/build_indoor_rbank +usr/bin/build_interface +usr/bin/build_rbank +usr/bin/build_samplebank +usr/bin/build_shadow_skin +usr/bin/build_smallbank +usr/bin/build_sound +usr/bin/build_soundbank +usr/bin/cluster_viewer +usr/bin/disp_sheet_id +usr/bin/extract_filename +usr/bin/file_info +usr/bin/georges2csv +usr/bin/get_neighbors +usr/bin/hls_bank_maker +usr/bin/ig_add +usr/bin/ig_info +usr/bin/ig_lighter +usr/bin/lock +usr/bin/make_sheet_id +usr/bin/memlog +usr/bin/message_box_qt +usr/bin/nl_probe_timers +usr/bin/nl_sample_chatclient +usr/bin/nl_sample_chatserver +usr/bin/nl_sample_clusterview +usr/bin/nl_sample_command +usr/bin/nl_sample_configfile +usr/bin/nl_sample_ct_ai_service +usr/bin/nl_sample_ct_gd_service +usr/bin/nl_sample_debug +usr/bin/nl_sample_font +usr/bin/nl_sample_georges +usr/bin/nl_sample_i18n +usr/bin/nl_sample_log +usr/bin/nl_sample_ls_client +usr/bin/nl_sample_ls_fes +usr/bin/nl_sample_pacs +usr/bin/nl_sample_shapeview +usr/bin/nl_sample_sound_sources +usr/bin/nl_sample_stream_file +usr/bin/nl_sample_stream_ogg_vorbis +usr/bin/nl_sample_strings +usr/bin/nl_sample_udpclient +usr/bin/nl_sample_udpserver +usr/bin/panoply_maker +usr/bin/shapes_exporter +usr/bin/tga2dds +usr/bin/tga_cut +usr/bin/tga_resize +usr/bin/tile_edit_qt +usr/bin/words_dic_qt +usr/bin/xml_packer +usr/bin/zone_check_bind +usr/bin/zone_dependencies +usr/bin/zone_dump +usr/bin/zone_ig_lighter +usr/bin/zone_lighter +usr/bin/zone_welder +usr/bin/zviewer +usr/lib/*/libs3tc_compressor.so.* +usr/share/nel/nl_sample_chat +usr/share/nel/nl_sample_class_transport +usr/share/nel/nl_sample_clusterview +usr/share/nel/nl_sample_configfile +usr/share/nel/nl_sample_font +usr/share/nel/nl_sample_georges +usr/share/nel/nl_sample_i18n +usr/share/nel/nl_sample_login_system +usr/share/nel/nl_sample_pacs +usr/share/nel/nl_sample_sound +usr/share/nel/nl_sample_udp +usr/share/nel/zviewer diff --git a/dist/debian/jessie/debian/rules b/dist/debian/jessie/debian/rules new file mode 100644 index 000000000..26ace8254 --- /dev/null +++ b/dist/debian/jessie/debian/rules @@ -0,0 +1,19 @@ +#!/usr/bin/make -f +%: + dh $@ --buildsystem=cmake --parallel + +override_dh_strip: + dh_strip -plibnel0 --dbg-package=libnel0-dbg + dh_strip -pnel-tools --dbg-package=nel-tools-dbg + dh_strip -plibryzom-sevenzip0 --dbg-package=libryzom-sevenzip0-dbg + dh_strip -plibryzom-gameshare0 --dbg-package=libryzom-gameshare0-dbg + dh_strip -plibryzom-clientsheets0 --dbg-package=libryzom-clientsheets0-dbg + dh_strip -pryzom-client --dbg-package=ryzom-client-dbg + dh_strip -pryzom-tools --dbg-package=ryzom-tools-dbg + +override_dh_auto_configure: + dh_auto_configure -- -DLIBRARY_ARCHITECTURE=$(DEB_HOST_MULTIARCH) -DTARGET_CPU=$(DEB_HOST_GNU_CPU) -DWITH_SYMBOLS=ON -DNL_ETC_PREFIX=/etc/nel -DRYZOM_ETC_PREFIX=/etc/ryzom -DRYZOM_SHARE_PREFIX=/usr/share/games/ryzom -DRYZOM_BIN_PREFIX=/usr/bin -DRYZOM_GAMES_PREFIX=/usr/games -DWITH_RYZOM_SERVER=OFF -DWITH_NEL_TESTS=OFF -DWITH_QT=ON + +override_dh_install: + dh_install + install -m755 debian/ryzom debian/ryzom-client/usr/games/ryzom diff --git a/dist/debian/jessie/debian/ryzom b/dist/debian/jessie/debian/ryzom new file mode 100644 index 000000000..79923e9e9 --- /dev/null +++ b/dist/debian/jessie/debian/ryzom @@ -0,0 +1,116 @@ +#!/bin/sh + +P7ZIP=/usr/bin/7z +RSYNC=/usr/bin/rsync +WGET=/usr/bin/wget +RYZOM_CLIENT=/usr/games/ryzom_client +RYZOM_CONFIG_DEFAULT=/etc/ryzom/client_default.cfg +RYZOM_CONFIG=~/.ryzom/client.cfg + +RYZOM_DIR=~/.ryzom +DATA_DIR=$RYZOM_DIR/data + +mkdir -p $RYZOM_DIR + +if [ ! -d "$DATA_DIR" ] +then + # symlink user's data dir to ryzom data cache + ln -s /var/cache/ryzom/data $DATA_DIR +fi + +# Check if a directory contains Ryzom data +ryzom_data_found() +{ + # Check for directory, gamedev.bnp and ryzom.ttf + COUNT=0 + + if [ -d $1 ] + then + # If there are a least 220 bnp files, we could use this directory + # There are 226 bnp files in last version + COUNT=$(find -L $1 -name *.bnp | wc -l) + fi + + echo $COUNT +} + +COUNT=$(ryzom_data_found $DATA_DIR) + +echo "Found $COUNT BNP files in $DATA_DIR" + +if [ $COUNT -lt 220 ] && [ -f $WGET ] && [ -f $P7ZIP ] +then + mkdir -p "$DATA_DIR/tmp" + + # Check free diskspace + echo "Checking for free disk space..." + DISKSPACE=$(df "$DATA_DIR/tmp" | grep "/dev" | awk '{print $4}') + if [ $? -ne 0 ] + then + exit 1 + fi + if [ "$DISKSPACE" -lt "8000000" ] + then + echo "You don't have enough free space to download and uncompress Ryzom client data." + exit 1 + fi + + # Download + echo "Downloading ryzom_client.7z from sourceforge..." + # wget + $WGET -c http://sourceforge.net/projects/ryzom/files/ryzom_client.7z -O "$DATA_DIR/tmp/ryzom_client.7z" + if [ $? -ne 0 ] + then + exit 1 + fi + + # Extract data + echo "Extracting data from ryzom_client.7z..." + cd "$DATA_DIR/tmp" + # 7z + $P7ZIP x ryzom_client.7z + if [ $? -ne 0 ] + then + exit 1 + fi + cd .. + mv -uf tmp/ryzom/data/* . + # Delete temporary downloaded files + rm -rf tmp +fi + +if [ -f $RYZOM_CONFIG ] +then + echo "Updating $RYZOM_CONFIG..." + + # Escape path for sed using bash find and replace + RYZOM_CONFIG_DEFAULT_ESCAPED=$(echo $RYZOM_CONFIG_DEFAULT | sed 's/\//\\\//g') + + # Update RootConfigFilename to be sure it's using the right default config + sed -i 's/RootConfigFilename.*/RootConfigFilename = \"'$RYZOM_CONFIG_DEFAULT_ESCAPED'\"/g' $RYZOM_CONFIG +fi + +if [ -f $RSYNC ] +then + echo "Patching Ryzom data..." + + # Rsync + $RSYNC -rOtzv --progress --stats www.ryzom.com::ryzom/data/ $DATA_DIR + if [ $? -ne 0 ] + then + exit 1 + fi +fi + +# Launch Ryzom client if it exists +if [ -f $RYZOM_CLIENT ] +then + echo "Launching Ryzom..." + + nohup $RYZOM_CLIENT $1 $2 $3 2> /dev/null & +fi + +# Wait until all previous commands are executed and displayed before exiting +sync + +exit 0 diff --git a/dist/debian/jessie/debian/ryzom-client-config.install b/dist/debian/jessie/debian/ryzom-client-config.install new file mode 100644 index 000000000..bef3f53dd --- /dev/null +++ b/dist/debian/jessie/debian/ryzom-client-config.install @@ -0,0 +1 @@ +debian/client_default.cfg etc/ryzom diff --git a/dist/debian/jessie/debian/ryzom-client.dirs b/dist/debian/jessie/debian/ryzom-client.dirs new file mode 100644 index 000000000..d1571095c --- /dev/null +++ b/dist/debian/jessie/debian/ryzom-client.dirs @@ -0,0 +1,4 @@ +usr/games +usr/share/applications +usr/share/pixmaps +var/cache/ryzom/data diff --git a/dist/debian/jessie/debian/ryzom-client.install b/dist/debian/jessie/debian/ryzom-client.install new file mode 100644 index 000000000..be142a6be --- /dev/null +++ b/dist/debian/jessie/debian/ryzom-client.install @@ -0,0 +1,4 @@ +usr/games/ryzom_client +usr/share/icons +usr/share/pixmaps +debian/ryzom_client.desktop usr/share/applications diff --git a/dist/debian/jessie/debian/ryzom-client.menu b/dist/debian/jessie/debian/ryzom-client.menu new file mode 100644 index 000000000..5e15bf577 --- /dev/null +++ b/dist/debian/jessie/debian/ryzom-client.menu @@ -0,0 +1,6 @@ +?package(ryzom-client): \ + needs="x11" \ + section="Games/Adventure" \ + icon="/usr/share/pixmaps/ryzom.xpm" \ + title="Ryzom" \ + command="/usr/games/ryzom" diff --git a/dist/debian/jessie/debian/ryzom-client.postinst b/dist/debian/jessie/debian/ryzom-client.postinst new file mode 100644 index 000000000..51570a3dc --- /dev/null +++ b/dist/debian/jessie/debian/ryzom-client.postinst @@ -0,0 +1,10 @@ +#!/bin/sh + +if ! getent group ryzom ; then + addgroup --system ryzom +fi + +chgrp -R ryzom /var/cache/ryzom/data +chmod -R g+wrxs /var/cache/ryzom/data + +#DEBHELPER# diff --git a/dist/debian/jessie/debian/ryzom-client.postrm b/dist/debian/jessie/debian/ryzom-client.postrm new file mode 100644 index 000000000..828871eb4 --- /dev/null +++ b/dist/debian/jessie/debian/ryzom-client.postrm @@ -0,0 +1,49 @@ +#! /bin/sh +# postrm script for ryzom-client +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' overwrit>r> +# for details, see /usr/share/doc/packaging-manual/ + +case "$1" in + purge) + + FILES=/home/* + + for f in $FILES + do + FOLDER="$f/.ryzom/data" + + if [ -d $FOLDER ] + then + rm -rf $FOLDER + echo "Deleting $FOLDER..." + fi + done + + ;; + + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + +esac + +#DEBHELPER# + +exit 0 diff --git a/dist/debian/jessie/debian/ryzom-tools.install b/dist/debian/jessie/debian/ryzom-tools.install new file mode 100644 index 000000000..c468e32d8 --- /dev/null +++ b/dist/debian/jessie/debian/ryzom-tools.install @@ -0,0 +1,26 @@ +usr/bin/7zDec +usr/bin/alias_synchronizer +usr/bin/assoc_mem +usr/bin/csv_transform +usr/bin/georges_editor_qt +usr/bin/icon_search +usr/bin/make_alias_file +usr/bin/make_anim_by_race +usr/bin/make_anim_melee_impact +usr/bin/mp_generator +usr/bin/named2csv +usr/bin/patch_gen +usr/bin/patch_gen_service +usr/bin/pd_parser +usr/bin/pdr_util +usr/bin/prim_export +usr/bin/ryzom_mission_compiler +usr/bin/sheets_packer +usr/bin/skill_extractor +usr/bin/stats_scan +usr/bin/translation_tools +usr/bin/uni_conv +usr/games/ryzom_client_patcher +usr/lib/*/libryzom_mission_compiler_lib.so.* +usr/share/games/ryzom/data_leveldesign +usr/share/games/ryzom/georges_editor_qt diff --git a/dist/debian/jessie/debian/ryzom_client.desktop b/dist/debian/jessie/debian/ryzom_client.desktop new file mode 100644 index 000000000..1c62d1b6a --- /dev/null +++ b/dist/debian/jessie/debian/ryzom_client.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Version=1.0 +Name=Ryzom +Name[ru]=Ризом +Type=Application +GenericName=ryzom_client +Exec=/usr/games/ryzom +Icon=ryzom_client +Terminal=true +Hidden=false +Categories=Game;RolePlaying; diff --git a/dist/debian/jessie/debian/source/format b/dist/debian/jessie/debian/source/format new file mode 100644 index 000000000..b9b023757 --- /dev/null +++ b/dist/debian/jessie/debian/source/format @@ -0,0 +1,2 @@ +1.0 + diff --git a/dist/debian/readme.txt b/dist/debian/readme.txt new file mode 100644 index 000000000..2c43c9414 --- /dev/null +++ b/dist/debian/readme.txt @@ -0,0 +1,4 @@ +To create a official Ryzom Core package, you have to do: + +- launch ./update.sh to update Ryzom Core to last version and create the .orig directory +- launch ./update_debian.sh to update packaging stuff for , create the final directory and upload source package diff --git a/dist/debian/ryzomcore_version.sh b/dist/debian/ryzomcore_version.sh new file mode 100755 index 000000000..55129da1d --- /dev/null +++ b/dist/debian/ryzomcore_version.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +CODEROOT=$1 + +if [ -z "$CODEROOT" ] +then + CODEROOT=../../code +fi + +VERSION_FILE=$CODEROOT/CMakeLists.txt + +if [ ! -f $VERSION_FILE ] +then + echo "Unable to find $VERSION_FILE" + exit 1 +fi + +parse_version() +{ + PREFIX=$1 + FILE=$2 + VAR=$3 + + V=$(egrep -o $PREFIX"_$VAR [0-9]+" $FILE | awk '{print $2}' | head -n 1) + + if [ -z "$V" ] + then + echo "Can't parse $VAR from $FILE, aborting..." + exit 1 + fi + + export $VAR=$V +} + +parse_version NL $VERSION_FILE VERSION_MAJOR +parse_version NL $VERSION_FILE VERSION_MINOR +parse_version NL $VERSION_FILE VERSION_PATCH + +VERSION=$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH + +echo $VERSION + +exit 0 diff --git a/dist/debian/trusty/debian/changelog b/dist/debian/trusty/debian/changelog new file mode 100644 index 000000000..44f3e244e --- /dev/null +++ b/dist/debian/trusty/debian/changelog @@ -0,0 +1,408 @@ +ryzom-core (0.8.2802~raring1) raring; urgency=low + + * New upstream release (revision 2802) + + -- Cédric OCHS Mon, 10 Dec 2012 11:12:17 +0100 + +ryzom-core (0.8.2786~raring1) raring; urgency=low + + * New upstream release (revision 2786) + + -- Cédric OCHS Fri, 07 Dec 2012 16:33:15 +0100 + +ryzom-core (0.8.2691~quantal1) quantal; urgency=low + + * New upstream release (revision 2691) + + -- Cédric OCHS Sun, 07 Oct 2012 09:46:56 +0200 + +ryzom-core (0.8.2682~quantal1) quantal; urgency=low + + * New upstream release (revision 2682) + + -- Cédric OCHS Wed, 03 Oct 2012 15:59:54 +0200 + +ryzom-core (0.8.2681~quantal2) quantal; urgency=low + + * New upstream release (revision 2681) + + -- Cédric OCHS Tue, 02 Oct 2012 17:42:23 +0200 + +ryzom-core (0.8.2681~quantal1) quantal; urgency=low + + * New upstream release (revision 2681) + + -- Cédric OCHS Tue, 02 Oct 2012 17:13:57 +0200 + +ryzom-core (0.8.2650~quantal2) quantal; urgency=low + + * New upstream release (revision 2650) + + -- Cédric OCHS Mon, 24 Sep 2012 22:06:37 +0200 + +ryzom-core (0.8.2650~quantal1) quantal; urgency=low + + * New upstream release (revision 2650) + + -- Cédric OCHS Mon, 24 Sep 2012 20:55:19 +0200 + +ryzom-core (0.8.2025~precise1) precise; urgency=low + + * New upstream release (revision 2025) + + -- Cédric OCHS Sat, 10 Mar 2012 22:23:49 +0100 + +ryzom-core (0.8.2024~precise1) precise; urgency=low + + * New upstream release (revision 2024) + + -- Cédric OCHS Sat, 10 Mar 2012 11:16:08 +0100 + +ryzom-core (0.8.1847~natty1) natty; urgency=low + + * New upstream release (revision 1847) + + -- Cédric OCHS Mon, 17 Oct 2011 09:33:45 +0200 + +ryzom-core (0.8.1847~natty0) natty; urgency=low + + * New upstream release (revision 1847) + + -- Cédric OCHS Sun, 16 Oct 2011 18:45:27 +0200 + +ryzom-core (0.8.1758~natty0) natty; urgency=low + + * New upstream release (revision 1758) + + -- Cédric OCHS Tue, 16 Aug 2011 09:02:55 +0200 + +ryzom-core (0.8.1752~natty0) natty; urgency=low + + * New upstream release (revision 1752) + + -- Cédric OCHS Sun, 14 Aug 2011 16:07:29 +0200 + +ryzom-core (0.8.1751~natty0) natty; urgency=low + + * New upstream release (revision 1751) + + -- Cédric OCHS Sun, 14 Aug 2011 14:16:24 +0200 + +ryzom-core (0.8.1750~natty0) natty; urgency=low + + * New upstream release (revision 1750) + + -- Cédric OCHS Sun, 14 Aug 2011 12:30:18 +0200 + +ryzom-core (0.8.1744~natty0) natty; urgency=low + + * New upstream release (revision 1744) + + -- Cédric OCHS Sat, 13 Aug 2011 20:24:49 +0200 + +ryzom-core (0.8.1742~natty0) natty; urgency=low + + * New upstream release (revision 1742) + + -- Cédric OCHS Fri, 12 Aug 2011 18:11:07 +0200 + +ryzom-core (0.8.1628~natty0) natty; urgency=low + + * New upstream release (revision 1628) + + -- Cédric OCHS Fri, 17 Jun 2011 12:56:17 +0200 + +ryzom-core (0.8.1627~natty0) natty; urgency=low + + * New upstream release (revision 1627) + + -- Cédric OCHS Tue, 14 Jun 2011 20:37:05 +0200 + +ryzom-core (0.8.1611~natty0) natty; urgency=low + + * New upstream release (revision 1611) + + -- Cédric OCHS Wed, 08 Jun 2011 19:53:44 +0200 + +ryzom-core (0.8.1596~natty1) natty; urgency=low + + * New upstream release (revision 1596) + + -- Cédric OCHS Sat, 04 Jun 2011 18:11:45 +0200 + +ryzom-core (0.7.1406~natty0) natty; urgency=low + + * New upstream release (revision 1406) + + -- Kervala Sun, 13 Mar 2011 19:07:44 +0100 + +ryzom-core (0.7.1404~karmic0) karmic; urgency=low + + * New upstream release (revision 1404) + + -- Kervala Thu, 10 Mar 2011 20:13:35 +0100 + +ryzom-core (0.7.1122~karmic0) karmic; urgency=low + + * New upstream release (revision 1122) + + -- Kervala Thu, 25 Nov 2010 13:18:41 +0100 + +ryzom-core (0.7.992~karmic0) karmic; urgency=low + + * New upstream release (revision 992) + + -- Kervala Tue, 19 Oct 2010 13:44:23 +0200 + +ryzom-core (0.7.941~karmic0) karmic; urgency=low + + * New upstream release (revision 941) + + -- Kervala Sat, 16 Oct 2010 14:59:36 +0200 + +ryzom-core (0.7.933~karmic0) karmic; urgency=low + + * New upstream release (revision 933) + + -- Kervala Fri, 15 Oct 2010 22:29:44 +0200 + +ryzom-core (0.7.932~karmic0) karmic; urgency=low + + * New upstream release (revision 932) + + -- Kervala Fri, 15 Oct 2010 19:53:47 +0200 + +ryzom-core (0.7.666~karmic0) karmic; urgency=low + + * New upstream release (revision 666) + + -- Kervala Sun, 29 Aug 2010 17:56:06 +0200 + +ryzom-core (0.7.631~karmic0) karmic; urgency=low + + * New upstream release (revision 631) + + -- Kervala Thu, 12 Aug 2010 16:57:30 +0200 + +ryzom-core (0.7.614~lucid1) lucid; urgency=low + + * Fixed dependencies + + -- Kervala Sun, 08 Aug 2010 22:42:50 +0200 + +ryzom-core (0.7.614~lucid0) lucid; urgency=low + + * New upstream release (revision 614) + + -- Kervala Sun, 08 Aug 2010 21:53:00 +0200 + +ryzom-core (0.7.583~lucid1) lucid; urgency=low + + * Added dependency on libogg and libvorbis + + -- Kervala Sun, 01 Aug 2010 15:38:40 +0200 + +ryzom-core (0.7.583~lucid0) lucid; urgency=low + + * New upstream release (revision 583) + + -- Kervala Sun, 01 Aug 2010 14:43:28 +0200 + +ryzom-core (0.7.530~lucid0) lucid; urgency=low + + * New upstream release (revision 530) + + -- Kervala Sun, 25 Jul 2010 16:50:57 +0200 + +ryzom-core (0.7.519~lucid0) lucid; urgency=low + + * New upstream release (revision 519) + + -- Kervala Mon, 19 Jul 2010 22:24:05 +0200 + +ryzom-core (0.7.507~lucid0) lucid; urgency=low + + * New upstream release (revision 507) + + -- Kervala Sat, 17 Jul 2010 19:56:35 +0200 + +ryzom-core (0.7.474~lucid0) lucid; urgency=low + + * New upstream release (revision 474) + + -- Kervala Tue, 13 Jul 2010 08:56:24 +0200 + +ryzom-core (0.7.473~lucid1) lucid; urgency=low + + * Some fixes + + -- Kervala Mon, 12 Jul 2010 22:46:16 +0200 + +ryzom-core (0.7.473~lucid0) lucid; urgency=low + + * New upstream release (revision 473) + + -- Kervala Mon, 12 Jul 2010 22:04:30 +0200 + +ryzom-core (0.7.437~lucid1) lucid; urgency=low + + * Fixed drivers installation + + -- Kervala Thu, 08 Jul 2010 08:54:02 +0200 + +ryzom-core (0.7.437~lucid0) lucid; urgency=low + + * New upstream release (revision 437) + + -- Kervala Thu, 01 Jul 2010 20:07:14 +0200 + +ryzom-core (0.7.419~lucid0) lucid; urgency=low + + * New upstream release (revision 419) + + -- Kervala Sat, 26 Jun 2010 18:58:36 +0200 + +ryzom-core (0.7.411~lucid0) lucid; urgency=low + + * New upstream release (revision 411) + + -- Kervala Sat, 26 Jun 2010 11:00:47 +0200 + +ryzom-core (0.7.404~lucid1) lucid; urgency=low + + * Fix OpenAL driver + + -- Kervala Thu, 24 Jun 2010 23:06:51 +0200 + +ryzom-core (0.7.404~lucid0) lucid; urgency=low + + * New upstream release (revision 404) + + -- Kervala Thu, 24 Jun 2010 22:17:36 +0200 + +ryzom-core (0.7.394~lucid0) lucid; urgency=low + + * New upstream release (revision 394) + + -- Kervala Tue, 22 Jun 2010 06:53:15 +0200 + +ryzom-core (0.7.375~lucid0) lucid; urgency=low + + * New upstream release (revision 375) + + -- Kervala Wed, 16 Jun 2010 12:46:51 +0200 + +ryzom-core (0.7.371~lucid0) lucid; urgency=low + + * New upstream release (revision 371) + + -- Kervala Mon, 14 Jun 2010 22:48:27 +0200 + +ryzom-core (0.7.359~lucid0) lucid; urgency=low + + * New upstream release (revision 359) + + -- Kervala Sun, 13 Jun 2010 21:31:29 +0200 + +ryzom-core (0.7.350~lucid1) lucid; urgency=low + + * Fixes problem with "copy" files + + -- Kervala Sun, 13 Jun 2010 10:36:30 +0200 + +ryzom-core (0.7.350~lucid0) lucid; urgency=low + + * New upstream release (revision 350) + + -- Kervala Sun, 13 Jun 2010 09:55:38 +0200 + +ryzom-core (0.7.332~lucid0) lucid; urgency=low + + * New upstream release (revision 332) + + -- Kervala Sat, 12 Jun 2010 09:09:21 +0200 + +ryzom-core (0.7.317~lucid0) lucid; urgency=low + + * New upstream release (revision 317) + + -- Kervala Thu, 10 Jun 2010 13:11:28 +0200 + +ryzom-core (0.7.315~lucid0) lucid; urgency=low + + * Fixed pkg-config installation again + + -- Kervala Thu, 10 Jun 2010 08:19:44 +0200 + +ryzom-core (0.7.311~lucid2) lucid; urgency=low + + * Fixed pkg-config files + + -- Kervala Wed, 09 Jun 2010 22:58:15 +0200 + +ryzom-core (0.7.311~lucid1) lucid; urgency=low + + * Fixed dependencies versions + + -- Kervala Wed, 09 Jun 2010 22:27:00 +0200 + +ryzom-core (0.7.311~lucid0) lucid; urgency=low + + * New upstream version (revision 311). + + -- Kervala Wed, 09 Jun 2010 21:15:42 +0200 + +ryzom-core (0.7.304~lucid0) lucid; urgency=low + + * New upstream version (revision 304). + + -- Kervala Wed, 09 Jun 2010 08:34:10 +0200 + +ryzom-core (0.7.0-1) unstable; urgency=low + + [ Gürkan Sengün ] + * New upstream version. (Closes: #553248) + * Updated build dependencies. + + [ Michal Čihař ] + * Convert to dh with cmake support. + * Bump standards to 3.8.4. + + [ Luboš Novák ] + * Change maintainer to 'Debian Games Team' + * ftbfs_gcc_4.5.path: Fix build with g++-4.5. (Closes: #565104) + * Converted direct changes in source to patches. + * Enable building CEGUI renderer. + * Add package libnel-doc with documentation. + * debian/control + + Changed priority of libnel-dbg to extra. + + Remove duplicate Section in libnel0. + + Update short descriptions. + + Replace obsolete package xlibmesa-gl-dev with libgl1-mesa-dev + in build-depends. + + Add libpng-dev to build-depends. + + Remove libalut-dev from build-depends. + + New homepage. + + Supported architectures are i386 and amd64. + * debian/libnel-dev.dirs + + Remove empty dir usr/lib/nel. + * debian/copyright + + Update redistribution licence from GPL to GPL-2. + * debian/rules + + Disable building unit test, samples and tools. + + -- Luboš Novák Tue, 30 Mar 2010 10:29:23 +0100 + +ryzom-core (0.5.0-1.1) unstable; urgency=low + + * Non-maintainer upload. + * Change Build-Depends: libstlport5.2-dev. (Closes: #521762) + + -- Torsten Werner Sun, 28 Jun 2009 11:54:05 +0200 + +ryzom-core (0.5.0-1) unstable; urgency=low + + * Initial release. (Closes: #448067) + + -- Gürkan Sengün Tue, 23 Oct 2007 12:56:45 +0200 + diff --git a/dist/debian/trusty/debian/client_default.cfg b/dist/debian/trusty/debian/client_default.cfg new file mode 100644 index 000000000..d09cbbb9c --- /dev/null +++ b/dist/debian/trusty/debian/client_default.cfg @@ -0,0 +1,567 @@ +////////////////////////// +////////////////////////// +/// CLIENT CONFIG FILE /// +////////////////////////// +////////////////////////// + + +// If you set this variable to 1, your client.cfg will be overwritten when you quit the client. +// You will loose all the comments and identation in this file. +SaveConfig = 1; + +/////////////////// +// WINDOW CONFIG // +/////////////////// + +Driver3D="Auto"; // Valid values are "Auto" or "0", "OpengGL" or "1" & "Direct3D" or "2" + // "Auto" will choose the best suited driver depending on hardware +FullScreen = 0; +Width = 1024; +Height = 768; +PositionX = 0; +PositionY = 0; +Frequency = 60; +Depth = 32; +Sleep = -1; +ProcessPriority = 0; // -2 = idle, -1 = below normal, 0 = normal, 1 = above normal, 2 = high, 3 = real time +Contrast = 0.0; // -1.0 ~ 1.0 +Luminosity = 0.0; // -1.0 ~ 1.0 +Gamma = 0.0; // -1.0 ~ 1.0 +Contrast_min = -1.0; +Luminosity_min = -1.0; +Gamma_min = -1.0; +Contrast_max = 1.0; +Luminosity_max = 1.0; +Gamma_max = 1.0; + + +///////////// +// NETWORK // +///////////// + +Application = { "ryzom_live", "./client_ryzom_r.exe", "./" }; +BackgroundDownloader = 0; +PatchServer = "http://dl.ryzom.com/patch_live"; +SignUpURL = "http://www.ryzom.com/subscribe"; +StartupHost = "shard.ryzom.com:40916"; +StartupPage = "/login/r2_login.php"; +InstallStatsUrl = "http://shard.ryzom.com:50000/stats/stats.php"; +CreateAccountURL = "https://secure.ryzom.com/signup/from_client.php"; +InstallWebPage = "http://dl.ryzom.com/installer/"; + + +//////////////// +// INTERFACES // +//////////////// + +// the language to use as in ISO 639-2 +LanguageCode = "en"; // english + +XMLInputFile = "input_config_v3.xml"; + +XMLLoginInterfaceFiles = { + "login_config.xml", + "login_widgets.xml", + "login_main.xml", + "login_keys.xml", +}; + +XMLOutGameInterfaceFiles = { + "out_v2_config.xml", + "out_v2_widgets.xml", + "out_v2_connect.xml", + "out_v2_intro.xml", + "out_v2_select.xml", + "out_v2_appear.xml", + "out_v2_location.xml", + "out_v2_crash.xml", + "out_v2_hierarchy.xml", + "out_v2_keys.xml", +}; + +// The ligo primitive class file +LigoPrimitiveClass = "world_editor_classes.xml"; + +VerboseLog = 1; + +/////////// +// MOUSE // +/////////// +HardwareCursor = 1; + +CursorSpeed = 1.0; // In pixels per mickey +CursorSpeed_min = 0.5; +CursorSpeed_max = 2.0; + +CursorAcceleration = 40; // Threshold in mickey +CursorAcceleration_min = 20; +CursorAcceleration_max = 80; + +FreeLookSpeed = 0.004; // In radian per mickey +FreeLookSpeed_min = 0.0001; +FreeLookSpeed_max = 0.01; + +FreeLookAcceleration = 40; // Threshold in mickey +FreeLookAcceleration_min = 20; +FreeLookAcceleration_max = 80; + +FreeLookInverted = 0; +AutomaticCamera = 0; +DblClickMode = 1; +AutoEquipTool = 1; + +/////////////////// +// RENDER CONFIG // +/////////////////// + +// NB: thoses variables configure also the InGameConfigurator: +// _min and _max define the bounds +// _step defines the step (NB: take care of _min and _max!!) +// _ps0 is the LOW preset, _ps1 is the MEDIUM preset, _ps2 is the NORMAL Preset, and _ps3 is the HIGH one + + +// *** LANDSCAPE +LandscapeTileNear = 150.000000; +LandscapeTileNear_min = 20.000000; +LandscapeTileNear_max = 250.000000; +LandscapeTileNear_step = 10.0; +LandscapeTileNear_ps0 = 20.0; +LandscapeTileNear_ps1 = 100.0; +LandscapeTileNear_ps2 = 150.0; +LandscapeTileNear_ps3 = 200.0; + +// NB: threshold is inverted ULandscape::setThreshold(), to be more intelligible +LandscapeThreshold = 2000.0; +LandscapeThreshold_min = 100.0; // Low quality => 0.01 threshold +LandscapeThreshold_max = 4000.0; // High quality => 0.0005 threshold +LandscapeThreshold_step = 100.0; +LandscapeThreshold_ps0 = 100.0; +LandscapeThreshold_ps1 = 1000.0; +LandscapeThreshold_ps2 = 2000.0; +LandscapeThreshold_ps3 = 3000.0; + +Vision = 500.000000; +Vision_min = 200.000000; +Vision_max = 800.000000; +Vision_step = 100.000000; +Vision_ps0 = 200.0; +Vision_ps1 = 400.0; +Vision_ps2 = 500.0; +Vision_ps3 = 800.0; + +MicroVeget = 1; // Enable/Disable MicroVeget. +MicroVeget_ps0 = 0; +MicroVeget_ps1 = 1; +MicroVeget_ps2 = 1; +MicroVeget_ps3 = 1; + +MicroVegetDensity = 80.0; +MicroVegetDensity_min = 10.0; +MicroVegetDensity_max = 100.0; +MicroVegetDensity_step = 10.0; +MicroVegetDensity_ps0 = 10.0; // not used since disabled! +MicroVegetDensity_ps1 = 30.0; +MicroVegetDensity_ps2 = 80.0; +MicroVegetDensity_ps3 = 100.0; + + +// *** FX +FxNbMaxPoly = 20000; +FxNbMaxPoly_min = 2000; +FxNbMaxPoly_max = 50000; +FxNbMaxPoly_step= 2000; +FxNbMaxPoly_ps0 = 2000; +FxNbMaxPoly_ps1 = 10000; +FxNbMaxPoly_ps2 = 20000; +FxNbMaxPoly_ps3 = 50000; + +Cloud = 1; +Cloud_ps0 = 0 ; +Cloud_ps1 = 1 ; +Cloud_ps2 = 1 ; +Cloud_ps3 = 1 ; + +CloudQuality = 160.0; +CloudQuality_min = 80.0; +CloudQuality_max = 320.0; +CloudQuality_step = 20.0; +CloudQuality_ps0 = 80.0; // not used since disabled! +CloudQuality_ps1 = 80.0; +CloudQuality_ps2 = 160.0; +CloudQuality_ps3 = 320.0; + +CloudUpdate = 1; +CloudUpdate_min = 1; +CloudUpdate_max = 8; +CloudUpdate_step= 1; +CloudUpdate_ps0 = 1; // not used since disabled! +CloudUpdate_ps1 = 1; +CloudUpdate_ps2 = 1; +CloudUpdate_ps3 = 3; + +Shadows = 1; +Shadows_ps0 = 0; +Shadows_ps1 = 1; +Shadows_ps2 = 1; +Shadows_ps3 = 1; + +Bloom = 0; +Bloom_ps0 = 0; +Bloom_ps1 = 1; +Bloom_ps2 = 1; +Bloom_ps3 = 1; + +SquareBloom = 1; +SquareBloom_ps0 = 0; +SquareBloom_ps1 = 1; +SquareBloom_ps2 = 1; +SquareBloom_ps3 = 1; + +DensityBloom = 255.0; +DensityBloom_min = 0.0; +DensityBloom_max = 255.0; +DensityBloom_step = 1.0; +DensityBloom_ps0 = 255.0; +DensityBloom_ps1 = 255.0; +DensityBloom_ps2 = 255.0; +DensityBloom_ps3 = 255.0; + + +// *** CHARACTERS +SkinNbMaxPoly = 100000; +SkinNbMaxPoly_min = 5000; +SkinNbMaxPoly_max = 250000; +SkinNbMaxPoly_step = 5000; +SkinNbMaxPoly_ps0 = 10000; +SkinNbMaxPoly_ps1 = 70000; +SkinNbMaxPoly_ps2 = 100000; +SkinNbMaxPoly_ps3 = 200000; + +NbMaxSkeletonNotCLod = 125; +NbMaxSkeletonNotCLod_min = 5; +NbMaxSkeletonNotCLod_max = 255; +NbMaxSkeletonNotCLod_step = 5; +NbMaxSkeletonNotCLod_ps0 = 10; +NbMaxSkeletonNotCLod_ps1 = 50; +NbMaxSkeletonNotCLod_ps2 = 125; +NbMaxSkeletonNotCLod_ps3 = 255; + +CharacterFarClip = 200.0; +CharacterFarClip_min = 50.0; +CharacterFarClip_max = 500.0; +CharacterFarClip_step = 10.0; +CharacterFarClip_ps0 = 50.0; +CharacterFarClip_ps1 = 100.0; +CharacterFarClip_ps2 = 200.0; +CharacterFarClip_ps3 = 500.0; + +EnableRacialAnimation = 1; + +// *** MISC +// This is the actual aspect ratio of your screen (no relation with the resolution!!). Set 1.7777 if you got a 16/9 screen for instance +ScreenAspectRatio = 0.0; +ForceDXTC = 1; // Enable/Disable DXTC. +DivideTextureSizeBy2= 0; // Divide texture size +DisableVtxProgram = 0; // Disable Hardware Vertex Program. +DisableVtxAGP = 0; // Disable Hardware Vertex AGP. +DisableTextureShdr = 0; // Disable Hardware Texture Shader. +HDEntityTexture = 0; +HDTextureInstalled = 1; +WaitVBL = 0; // 0 or 1 to wait Vertical Sync. + +////////////////// +// GAME OPTIONS // +////////////////// +SelectWithRClick = 1; +DisplayWeapons = 1; +RotKeySpeedMax = 2.0; +RotKeySpeedMax_min = 1.0; +RotKeySpeedMax_max = 4.0; +RotKeySpeedMin = 1.0; +RotKeySpeedMin_min = 0.5; +RotKeySpeedMin_max = 2.0; +RotAccel = 3.0; +FollowOnAtk = 0; +AtkOnSelect = 0; +ZCPacsPrim = "gen_bt_col_ext.pacs_prim"; + +///////////////// +// PREFERENCES // +///////////////// +FPV = 0; // FPV(First Person View) : default is false (Third Person View). +CameraHeight = 2.2; // Camera Height (in meter) from the ground (for the Third Person View). +CameraDistance = 3.0; // Camera Distance(in meter) from the user (for the Third Person View). +CameraDistStep = 1.0; +CameraDistMin = 1.0; +CameraDistMax = 25.0; +CameraAccel = 5.0; +CameraSpeedMin = 2.0; +CameraSpeedMax = 100.0; +CameraResetSpeed = 10.0; // Speed in radian/s + +////////////////// +// SOUND CONFIG // +////////////////// +SoundForceSoftwareBuffer= 1; +SoundOn = 1; +UseEax = 0; + +MaxTrack = 32; +MaxTrack_min = 4; +MaxTrack_max = 32; +MaxTrack_step = 4; + +// This is the volume for "InGame" sound FXs +SoundSFXVolume = 1.0; +SoundSFXVolume_min = 0.0; +SoundSFXVolume_max = 1.0; +SoundSFXVolume_step = 0.001; + +// This is volume for "InGame" music. Does not affect the MP3 player +SoundGameMusicVolume = 0.5; +SoundGameMusicVolume_min = 0.0; +SoundGameMusicVolume_max = 1.0; +SoundGameMusicVolume_step = 0.001; + +// MISC +PreDataPath = { "user", "patch", "examples", "data/fonts", "data/gamedev.bnp" }; +DataPath = { "data" }; +NeedComputeVS = 0; + +NegFiltersDebug = {"Update DB", "Reading:", "Read Value :", "impulseCallBack", "CLIMPD:", "LNET" }; +NegFiltersInfo = { "CLIMPD:", "CPath::lookup" , "LNET" }; +NegFiltersWarning = { "'basics.Equipment Slot'.", "_usercolor.tga", "PACS" }; + +// Big screen shot +ScreenShotWidth = 0; +ScreenShotHeight = 0; +ScreenShotFullDetail = 1; // 1 to switch full detail mode for characters (both standard & big screenshots) + +// Read : "ID", "R G B A MODE [FX]" +SystemInfoColors = +{ +// OLD STUFF Here for compatibility +"RG", "0 0 0 255 normal", // Black to see when there is an error +"BC", "0 0 0 255 normal", // Black to see when there is an error +"JA", "0 0 0 255 normal", // Black to see when there is an error +"BL", "0 0 0 255 normal", // Black to see when there is an error +"VE", "0 0 0 255 normal", // Black to see when there is an error +"VI", "0 0 0 255 normal", // Black to see when there is an error + +// NEW System Info Categories +"SYS", "255 255 255 255 normal", // Default system messages +"BC", "255 255 255 255 centeraround", // Broadcast messages +"TAGBC", "255 255 255 255 centeraround", // Taged broadcast messages : color should remain white as some word are tagged +"XP", "255 255 64 255 over", // XP Gain +"SP", "255 255 64 255 over", // SP Gain +"TTL", "255 255 64 255 over", // Title +"TSK", "255 255 255 255 over", // Task +"ZON", "255 255 255 255 center", // Zone +"DG", "255 0 0 255 normal", // Damage to me +"DMG", "255 0 0 255 normal", // Damage to me +"DGP", "200 0 0 255 normal", // Damage to me from player +"DGM", "255 128 64 255 normal", // Damage from me +"MIS", "150 150 150 255 normal", // The opponent misses +"MISM", "255 255 255 255 normal", // I miss +"ITM", "0 200 0 255 over", // Item +"ITMO", "170 170 255 255 overonly", // Item other in group +"ITMF", "220 0 220 255 over", // Item failed +"SPL", "50 50 250 255 normal", // Spell to me +"SPLM", "50 150 250 255 normal", // Spell from me +"EMT", "255 150 150 255 normal", // Emote +"MTD", "255 255 0 255 over", // Message Of The Day +"FORLD","64 255 64 255 overonly", // Forage Locate Deposit +"CHK", "255 120 60 255 center", // Tous ce qui ne remplit pas une condition +"CHKCB","255 255 0 255 center", // Tous ce qui ne remplit pas une condition en combat (trop loin, cible invalide, pas assez de mana, etc.) +"PVPTM","255 120 60 255 overonly", // PVP timer +"THM", "255 255 64 255 over misc_levelup.ps", // Thema finished +"AMB", "255 255 64 255 center", // Ambiance +"ISE", "192 208 255 255 normal", // Item special effect +"ISE2", "192 208 255 255 center", // Item special effect with center text (for effects without flying text) +"OSM", "128 160 255 255 center", // Outpost state message +"AROUND","255 255 0 255 around", // Only in around channel +"R2_INVITE","0 255 0 255 around", // Ring invitation +}; + +PrintfCommands = { + "52", "15", "55 55 0 255", "28", "uiChapterV", "624", + "428", "0 0 0 255", "18", "", "624", "378", + "0 0 0 255", "14", "", "644", "278", "0 0 0 255", + "18", "", "52", "17", "255 255 255 255", "28", + "uiChapterV", "622", "430", "255 255 255 255", "18", "", + "622", "380", "255 255 255 255", "14", "", "642", + "280", "255 255 255 255", "18", "" +}; + +PrintfCommandsFreeTrial = { + "52", "15", "55 55 0 255", "28", "uiChapterV", "624", + "428", "0 0 0 255", "18", "", "624", "378", + "0 0 0 255", "14", "", "644", "278", "0 0 0 255", + "18", "", "52", "17", "255 255 255 255", "28", + "uiChapterV", "622", "430", "255 255 255 255", "18", "", + "622", "380", "255 255 255 255", "14", "", "642", + "280", "255 255 255 255", "18", "" +}; + +DisplayMissingAnimFile = 0; + +LoadingStringCount = 54; + + +// Some R2 parameters ... + +R2Mode = 1; +R2EDEnabled = 1; +R2EDExtendedDebug = 0; +R2EDLightPalette = 0; +R2ClientGw = "r2linux01"; +LoadLuaDebugger = 0; +CheckR2ScenarioMD5 = 1; +LevelDesignEnabled = 0; + +DmCameraDistMax = 25; +DmRun = 20; +DmWalk = 6; + +R2EDReloadFiles = { + "r2ed.xml", + "r2_basic_bricks.lua", + "r2_components.lua", + "r2_core.lua", + "r2_features_default.lua", + "r2_features_fauna.lua", + "r2_features_npc_groups.lua", + "r2_palette.lua", + "r2_scenario.lua", + "r2_ui.lua" +}; + +XMLInterfaceFiles = { + "config.xml", + "widgets.xml", + "webig_widgets.xml", + "player.xml", + "inventory.xml", + "interaction.xml", + "phrase.xml", + "harvest.xml", + "macros.xml", + "info_player.xml", + "outpost.xml", + "guild.xml", + "taskbar.xml", + "game_config.xml", + "game_context_menu.xml", + "player_trade.xml", + "bot_chat_v4.xml", + "compass.xml", + "map.xml", + "hierarchy.xml", + "reset.xml", + "actions.xml", + "help.xml", + "encyclopedia.xml", + "commands.xml", + "commands2.xml", + "ring_access_point_filter.xml", + "ring_window.xml", + "bg_downloader.xml" +}; + +XMLR2EDInterfaceFiles = +{ + "r2ed.xml", + "r2_triggers.xml", + "r2_logic_entities.xml", + "r2ed_acts.xml", + "r2ed_scenario.xml", + "r2ed_connect.xml" +}; + +FogDistAndDepthLookupBias = 20; // bias for lookup of fog distance and depth + + +// Hardware cursor textures +// These will be extracted from the corresponding packed ui .tga files when they are loaded +// * +// * individual .tga files for hardware cursor bitmap not looked for, and not supported yet +HardwareCursors = +{ + "curs_can_pan.tga", + "curs_can_pan_dup.tga", + "curs_create.tga", + "curs_create_multi.tga", + "curs_create_vertex_invalid.tga", + "curs_default.tga", + "curs_dup.tga", + "curs_L.tga", + "curs_M.tga", + "curs_pan.tga", + "curs_pan_dup.tga", + "curs_pick.tga", + "curs_pick_dup.tga", + "curs_R.tga", + "curs_resize_BL_TR.tga", + "curs_resize_BR_TL.tga", + "curs_resize_LR.tga", + "curs_resize_TB.tga", + "curs_rotate.tga", + "curs_scale.tga", + "curs_stop.tga", + "text_cursor.tga", + "r2_hand_can_pan.tga", + "r2_hand_pan.tga", + "r2ed_tool_can_pick.tga", + "r2ed_tool_can_rotate.tga", + "r2ed_tool_pick.tga", + "r2ed_tool_rotate.tga", + "r2ed_tool_rotating.tga" +}; + +Loading_BG = "new_loading_bg.tga"; // Default name for the loading background file. +Launch_BG = "new_launcher_bg.tga"; // Default name for the launch background file. +TeleportKami_BG = "new_teleport_kami_bg.tga"; +TeleportKaravan_BG = "new_teleport_caravan_bg.tga"; +Elevator_BG = "new_elevator_bg.tga"; // Default name for the loading background file. +ResurectKami_BG = "new_resurect_kami_bg.tga"; +ResurectKaravan_BG = "new_resurect_caravane_bg.tga"; +End_BG = "end_bg.tga"; // Default name for the last background file. + +ScenarioSavePath = "./my_scenarios/"; + +// list ofpredefined keyset +// name will be looked up in the translation file by searching 'uiCP_KeysetName_" + id +// tooltip will be looked up in the translation file by searching 'uiCP_KeysetTooltip_" + id +// 'bi.' stands for built-in +// note : we add a dot in the name to be sure that there cannot be a conflict with character keyset name +BuiltInKeySets = +{ + "", // default ryzom keyboard layout + "bi.zqsd", // european keyboard fps displacement style (NB : don't change this layout name, ryzom will automatically select it if keyboard is french or belgian) + "bi.wasd", // english keyboard fps displacement style (NB : don't change this layout name, ryzom will automatically select it if keyboard is not french nor belgian) + "bi.wow_alike" // 'world of warcraft' like keyboard style. (NB : not available for ring) +}; + +// "Newbie Training", "Story Telling", "Mistery", "Hack & Slash", "Guild Training", "Other" +ScenarioTypes = {"so_newbie_training","so_story_telling","so_mistery","so_hack_slash","so_guild_training","so_other"}; + +ScenarioLanguages = {"fr","de","en","other_lang"}; + +// Map each language to a forum help page +HelpPages = +{ + "fr=http://forums.ryzom.com/forum/showthread.php?t=29130", + "en=http://forums.ryzom.com/forum/showthread.php?t=29129", + "wk=http://forums.ryzom.com/forum/showthread.php?t=29129", + "de=http://forums.ryzom.com/forum/showthread.php?t=29131" +}; + +WebIgMainDomain = "app.ryzom.com"; +WebIgTrustedDomains = { + "api.ryzom.com", "app.ryzom.com" +}; +PatchletUrl = "http://app.ryzom.com/app_patchlet/index.php?patch=preload"; + +SelectedSlot = 0; + +BuildName = "RELEASE_HEAD"; diff --git a/dist/debian/trusty/debian/compat b/dist/debian/trusty/debian/compat new file mode 100644 index 000000000..ec635144f --- /dev/null +++ b/dist/debian/trusty/debian/compat @@ -0,0 +1 @@ +9 diff --git a/dist/debian/trusty/debian/control b/dist/debian/trusty/debian/control new file mode 100644 index 000000000..a802646d4 --- /dev/null +++ b/dist/debian/trusty/debian/control @@ -0,0 +1,212 @@ +Source: ryzom-core +Priority: extra +Maintainer: Debian Games Team +Uploaders: Luboš Novák , Cédric OCHS +Build-Depends: debhelper (>= 9), cmake(>= 2.6), libxml2-dev, + libgl1-mesa-dev, libjpeg8-dev | libjpeg62-dev, libpng12-dev, libopenal-dev, + libfreetype6-dev, libxxf86vm-dev, libxrandr-dev, libxrender-dev, + libvorbis-dev, libsquish-dev, libcurl4-openssl-dev, libluabind-dev, + libboost-dev, libmysqlclient-dev, + libcpptest-dev, libqt4-dev, libqt4-opengl-dev +Standards-Version: 3.9.5 +Section: games +Bugs: https://bitbucket.org/ryzom/ryzomcore/issues +Homepage: https://bitbucket.org/ryzom/ryzomcore/ +Vcs-Hg: https://bitbucket.org/ryzom/ryzomcore +Vcs-Browser: https://bitbucket.org/ryzom/ryzomcore + +Package: libnel0 +Section: libdevel +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Massive multi-user 3D game environments library (shared library) + This is a software platform for creating and running massively multi-user + entertainment in a 3D environment over the Internet. + . + This 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 independent from + each other so you can use only the parts you really need in your project. + . + This package contains the shared library. + +Package: libnel-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Depends: ${misc:Depends}, libnel0 (= ${binary:Version}) +Description: Massive multi-user 3D game environments library (development files) + This is a software platform for creating and running massively multi-user + entertainment in a 3D environment over the Internet. + . + This 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 independent from + each other so you can use only the parts you really need in your project. + . + This package contains the headers. + +Package: libnel0-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, libnel0 (= ${binary:Version}) +Description: Massive multi-user 3D game environments library (debugging symbols) + This is a software platform for creating and running massively multi-user + entertainment in a 3D environment over the Internet. + . + This 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 independent from + each other so you can use only the parts you really need in your project. + . + This package contains the debugging symbols. + +Package: nel-tools +Section: devel +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends}, libnel0 (= ${binary:Version}) +Description: Massive multi-user 3D game environments library (tools) + This is a software platform for creating and running massively multi-user + entertainment in a 3D environment over the Internet. + . + This 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 independent from + each other so you can use only the parts you really need in your project. + . + This package contains the tools. + +Package: nel-tools-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, nel-tools (= ${binary:Version}) +Description: Massive multi-user 3D game environments library (tools debugging symbols) + This is a software platform for creating and running massively multi-user + entertainment in a 3D environment over the Internet. + . + This 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 independent from + each other so you can use only the parts you really need in your project. + . + This package contains the tools debugging symbols. + +Package: libryzom-sevenzip0 +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Ryzom science-fantasy MMORPG (decompression library) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the decompression shared library. + +Package: libryzom-sevenzip0-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, libryzom-sevenzip0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (decompression library debugging symbols) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the decompression shared library debugging symbols. + +Package: libryzom-gameshare0 +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends}, libnel0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (common shared library) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the game common shared library. + +Package: libryzom-gameshare0-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, libryzom-gameshare0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (common debugging symbols) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the game common debugging symbols. + +Package: libryzom-clientsheets0 +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends}, libryzom-gameshare0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (client sheets shared library) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the client sheets shared library. + +Package: libryzom-clientsheets0-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, libryzom-clientsheets0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (client sheets debugging symbols) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the client sheets debugging symbols. + +Package: ryzom-client +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends}, libryzom-gameshare0 (= ${binary:Version}), + libryzom-clientsheets0 (= ${binary:Version}), + ryzom-client-config (>= ${source:Version}), rsync, wget, p7zip-full +Description: Ryzom science-fantasy MMORPG (client) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the game client. + +Package: ryzom-client-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, ryzom-client (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (client debugging symbols) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the client debugging symbols. + +Package: ryzom-tools +Section: devel +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends}, libryzom-gameshare0 (= ${binary:Version}), + libryzom-clientsheets0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (tools) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the tools. + +Package: ryzom-tools-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, ryzom-tools (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (tools debugging symbols) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the tools debugging symbols. + +Package: ryzom-client-config +Architecture: all +Depends: ${misc:Depends} +Description: Ryzom science-fantasy MMORPG (client configuration) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the client configuration. diff --git a/dist/debian/trusty/debian/copyright b/dist/debian/trusty/debian/copyright new file mode 100644 index 000000000..d5a0f2f10 --- /dev/null +++ b/dist/debian/trusty/debian/copyright @@ -0,0 +1,53 @@ +This package was debianized by Gürkan Sengün on +Tue, 23 Oct 2007 12:56:45 +0200. + +It was downloaded from + +Upstream Authors: + + Olivier Cado + Bertram Felgenhauer + Krzysztof Kotlenga + Henri Kuuste + Vianney Lecroart + Namine + Cédric Ochs + Guillaume Puzin + Matt Raykowski + Robert Timm + Titegus + Ulukyn + Robert Wetzel + Zorglor + TODO: take names from Ryzom credits + +Copyright: + + Copyright (C) 2003-2009 Vianney Lecroart + Copyright (C) 2003-2009 Matt Raykowski + Copyright (C) 2000-2006 Nevrax Ltd. + Copyright (C) 2006-2007 Gameforge France + Copyright (C) 2008-2010 Winch Gate Property Limited + +License: + + 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 . + +The Debian packaging is: + + Copyright (C) 2007 Gürkan Sengün + +and is licensed under the GPL version 2, +see `/usr/share/common-licenses/GPL-2'. + diff --git a/dist/debian/trusty/debian/docs b/dist/debian/trusty/debian/docs new file mode 100644 index 000000000..58e5e3e76 --- /dev/null +++ b/dist/debian/trusty/debian/docs @@ -0,0 +1,2 @@ +changelog +README diff --git a/dist/debian/trusty/debian/libnel-dev.docs b/dist/debian/trusty/debian/libnel-dev.docs new file mode 100644 index 000000000..ba8894c15 --- /dev/null +++ b/dist/debian/trusty/debian/libnel-dev.docs @@ -0,0 +1,2 @@ +README + diff --git a/dist/debian/trusty/debian/libnel-dev.install b/dist/debian/trusty/debian/libnel-dev.install new file mode 100644 index 000000000..9f9310cee --- /dev/null +++ b/dist/debian/trusty/debian/libnel-dev.install @@ -0,0 +1,3 @@ +usr/include/* +usr/lib/*/libnel*.so +usr/lib/*/pkgconfig/* diff --git a/dist/debian/trusty/debian/libnel-dev.manpages b/dist/debian/trusty/debian/libnel-dev.manpages new file mode 100644 index 000000000..bb4027ca9 --- /dev/null +++ b/dist/debian/trusty/debian/libnel-dev.manpages @@ -0,0 +1 @@ +debian/nel-config.1 diff --git a/dist/debian/trusty/debian/libnel-doc.doc-base.nel b/dist/debian/trusty/debian/libnel-doc.doc-base.nel new file mode 100644 index 000000000..6ae95fc9f --- /dev/null +++ b/dist/debian/trusty/debian/libnel-doc.doc-base.nel @@ -0,0 +1,9 @@ +Document: nel +Title: NeL Reference Manual +Author: Nevrax +Abstract: This is a software platform for creating and running massively multi-user entertainment in a 3D environment over the Internet. +Section: Programming/C + +Format: HTML +Index: /usr/share/doc/libnel-doc/html/index.html +Files: /usr/share/doc/libnel-doc/html/*.html diff --git a/dist/debian/trusty/debian/libnel-doc.install b/dist/debian/trusty/debian/libnel-doc.install new file mode 100644 index 000000000..bf3f02a61 --- /dev/null +++ b/dist/debian/trusty/debian/libnel-doc.install @@ -0,0 +1 @@ +usr/share/doc/libnel-doc/html/* diff --git a/dist/debian/trusty/debian/libnel0.install b/dist/debian/trusty/debian/libnel0.install new file mode 100644 index 000000000..4273c0ad1 --- /dev/null +++ b/dist/debian/trusty/debian/libnel0.install @@ -0,0 +1,3 @@ +usr/lib/*/libnel*.so.* +usr/lib/*/nel/libnel_drv_openal.so +usr/lib/*/nel/libnel_drv_opengl.so diff --git a/dist/debian/trusty/debian/libryzom-clientsheets0.install b/dist/debian/trusty/debian/libryzom-clientsheets0.install new file mode 100644 index 000000000..b5ea5b79c --- /dev/null +++ b/dist/debian/trusty/debian/libryzom-clientsheets0.install @@ -0,0 +1,2 @@ +usr/lib/*/libryzom_clientsheets.so.* + diff --git a/dist/debian/trusty/debian/libryzom-gameshare0.install b/dist/debian/trusty/debian/libryzom-gameshare0.install new file mode 100644 index 000000000..2f51b0804 --- /dev/null +++ b/dist/debian/trusty/debian/libryzom-gameshare0.install @@ -0,0 +1,2 @@ +usr/lib/*/libryzom_gameshare.so.* + diff --git a/dist/debian/trusty/debian/libryzom-sevenzip0.install b/dist/debian/trusty/debian/libryzom-sevenzip0.install new file mode 100644 index 000000000..1edced3f8 --- /dev/null +++ b/dist/debian/trusty/debian/libryzom-sevenzip0.install @@ -0,0 +1,2 @@ +usr/lib/*/libryzom_sevenzip.so.* + diff --git a/dist/debian/trusty/debian/nel-config.1 b/dist/debian/trusty/debian/nel-config.1 new file mode 100644 index 000000000..be47bf496 --- /dev/null +++ b/dist/debian/trusty/debian/nel-config.1 @@ -0,0 +1,37 @@ +.TH nel-config 1 "26 Oct 2007" +.SH NAME +nel-config \- Get information about a libnel installation +.SH SYNOPSIS +.B nel-config [options] +.SH DESCRIPTION +.B nel-config +displays information about a libnel installation. +.SH OPTIONS +.IP "--cflags" +Set of compiler options (CFLAGS) to use when compiling files that use +libnel. Currently that is only thw include path to the nel include files. +.IP "--libs" +Shows the complete set of libs and other linker options you will need in order +to link your application with libnel. +.IP "--prefix" +This is the prefix used when libnel was installed. libnel is then installed +in $prefix/lib and its header files are installed in $prefix/include and so +on. The prefix is set with "configure \-\-prefix". +.IP "--version" +Outputs version information about the installed libnel. +.SH "EXAMPLES" +What linker options do I need when I link with libnel? + + $ nel-config \-\-libs + +What compiler options do I need when I compile using libnel functions? + + $ nel-config \-\-cflags + +What's the installed libnel version? + + $ nel-config \-\-version +.SH AUTHOR +.PP +This manual page was written by G\[:u]rkan Seng\[:u]n +,for the Debian project (but may be used by others). diff --git a/dist/debian/trusty/debian/nel-tools.install b/dist/debian/trusty/debian/nel-tools.install new file mode 100644 index 000000000..4ca03208c --- /dev/null +++ b/dist/debian/trusty/debian/nel-tools.install @@ -0,0 +1,87 @@ +etc/nel/build_ig_boxes.cfg +etc/nel/build_indoor_rbank.cfg +etc/nel/build_rbank.cfg +etc/nel/make_sheet_id.cfg +etc/nel/words_dic.cfg +etc/nel/zviewer.cfg +usr/bin/animation_set_builder +usr/bin/anim_builder +usr/bin/bnp_make +usr/bin/build_clod_bank +usr/bin/build_clodtex +usr/bin/build_coarse_mesh +usr/bin/build_far_bank +usr/bin/build_ig_boxes +usr/bin/build_indoor_rbank +usr/bin/build_interface +usr/bin/build_rbank +usr/bin/build_samplebank +usr/bin/build_shadow_skin +usr/bin/build_smallbank +usr/bin/build_sound +usr/bin/build_soundbank +usr/bin/cluster_viewer +usr/bin/disp_sheet_id +usr/bin/extract_filename +usr/bin/file_info +usr/bin/georges2csv +usr/bin/get_neighbors +usr/bin/hls_bank_maker +usr/bin/ig_add +usr/bin/ig_info +usr/bin/ig_lighter +usr/bin/lock +usr/bin/make_sheet_id +usr/bin/memlog +usr/bin/message_box_qt +usr/bin/nl_probe_timers +usr/bin/nl_sample_chatclient +usr/bin/nl_sample_chatserver +usr/bin/nl_sample_clusterview +usr/bin/nl_sample_command +usr/bin/nl_sample_configfile +usr/bin/nl_sample_ct_ai_service +usr/bin/nl_sample_ct_gd_service +usr/bin/nl_sample_debug +usr/bin/nl_sample_font +usr/bin/nl_sample_georges +usr/bin/nl_sample_i18n +usr/bin/nl_sample_log +usr/bin/nl_sample_ls_client +usr/bin/nl_sample_ls_fes +usr/bin/nl_sample_pacs +usr/bin/nl_sample_shapeview +usr/bin/nl_sample_sound_sources +usr/bin/nl_sample_stream_file +usr/bin/nl_sample_stream_ogg_vorbis +usr/bin/nl_sample_strings +usr/bin/nl_sample_udpclient +usr/bin/nl_sample_udpserver +usr/bin/panoply_maker +usr/bin/shapes_exporter +usr/bin/tga2dds +usr/bin/tga_cut +usr/bin/tga_resize +usr/bin/tile_edit_qt +usr/bin/words_dic_qt +usr/bin/xml_packer +usr/bin/zone_check_bind +usr/bin/zone_dependencies +usr/bin/zone_dump +usr/bin/zone_ig_lighter +usr/bin/zone_lighter +usr/bin/zone_welder +usr/bin/zviewer +usr/lib/*/libs3tc_compressor.so.* +usr/share/nel/nl_sample_chat +usr/share/nel/nl_sample_class_transport +usr/share/nel/nl_sample_clusterview +usr/share/nel/nl_sample_configfile +usr/share/nel/nl_sample_font +usr/share/nel/nl_sample_georges +usr/share/nel/nl_sample_i18n +usr/share/nel/nl_sample_login_system +usr/share/nel/nl_sample_pacs +usr/share/nel/nl_sample_sound +usr/share/nel/nl_sample_udp +usr/share/nel/zviewer diff --git a/dist/debian/trusty/debian/rules b/dist/debian/trusty/debian/rules new file mode 100755 index 000000000..26ace8254 --- /dev/null +++ b/dist/debian/trusty/debian/rules @@ -0,0 +1,19 @@ +#!/usr/bin/make -f +%: + dh $@ --buildsystem=cmake --parallel + +override_dh_strip: + dh_strip -plibnel0 --dbg-package=libnel0-dbg + dh_strip -pnel-tools --dbg-package=nel-tools-dbg + dh_strip -plibryzom-sevenzip0 --dbg-package=libryzom-sevenzip0-dbg + dh_strip -plibryzom-gameshare0 --dbg-package=libryzom-gameshare0-dbg + dh_strip -plibryzom-clientsheets0 --dbg-package=libryzom-clientsheets0-dbg + dh_strip -pryzom-client --dbg-package=ryzom-client-dbg + dh_strip -pryzom-tools --dbg-package=ryzom-tools-dbg + +override_dh_auto_configure: + dh_auto_configure -- -DLIBRARY_ARCHITECTURE=$(DEB_HOST_MULTIARCH) -DTARGET_CPU=$(DEB_HOST_GNU_CPU) -DWITH_SYMBOLS=ON -DNL_ETC_PREFIX=/etc/nel -DRYZOM_ETC_PREFIX=/etc/ryzom -DRYZOM_SHARE_PREFIX=/usr/share/games/ryzom -DRYZOM_BIN_PREFIX=/usr/bin -DRYZOM_GAMES_PREFIX=/usr/games -DWITH_RYZOM_SERVER=OFF -DWITH_NEL_TESTS=OFF -DWITH_QT=ON + +override_dh_install: + dh_install + install -m755 debian/ryzom debian/ryzom-client/usr/games/ryzom diff --git a/dist/debian/trusty/debian/ryzom b/dist/debian/trusty/debian/ryzom new file mode 100755 index 000000000..79923e9e9 --- /dev/null +++ b/dist/debian/trusty/debian/ryzom @@ -0,0 +1,116 @@ +#!/bin/sh + +P7ZIP=/usr/bin/7z +RSYNC=/usr/bin/rsync +WGET=/usr/bin/wget +RYZOM_CLIENT=/usr/games/ryzom_client +RYZOM_CONFIG_DEFAULT=/etc/ryzom/client_default.cfg +RYZOM_CONFIG=~/.ryzom/client.cfg + +RYZOM_DIR=~/.ryzom +DATA_DIR=$RYZOM_DIR/data + +mkdir -p $RYZOM_DIR + +if [ ! -d "$DATA_DIR" ] +then + # symlink user's data dir to ryzom data cache + ln -s /var/cache/ryzom/data $DATA_DIR +fi + +# Check if a directory contains Ryzom data +ryzom_data_found() +{ + # Check for directory, gamedev.bnp and ryzom.ttf + COUNT=0 + + if [ -d $1 ] + then + # If there are a least 220 bnp files, we could use this directory + # There are 226 bnp files in last version + COUNT=$(find -L $1 -name *.bnp | wc -l) + fi + + echo $COUNT +} + +COUNT=$(ryzom_data_found $DATA_DIR) + +echo "Found $COUNT BNP files in $DATA_DIR" + +if [ $COUNT -lt 220 ] && [ -f $WGET ] && [ -f $P7ZIP ] +then + mkdir -p "$DATA_DIR/tmp" + + # Check free diskspace + echo "Checking for free disk space..." + DISKSPACE=$(df "$DATA_DIR/tmp" | grep "/dev" | awk '{print $4}') + if [ $? -ne 0 ] + then + exit 1 + fi + if [ "$DISKSPACE" -lt "8000000" ] + then + echo "You don't have enough free space to download and uncompress Ryzom client data." + exit 1 + fi + + # Download + echo "Downloading ryzom_client.7z from sourceforge..." + # wget + $WGET -c http://sourceforge.net/projects/ryzom/files/ryzom_client.7z -O "$DATA_DIR/tmp/ryzom_client.7z" + if [ $? -ne 0 ] + then + exit 1 + fi + + # Extract data + echo "Extracting data from ryzom_client.7z..." + cd "$DATA_DIR/tmp" + # 7z + $P7ZIP x ryzom_client.7z + if [ $? -ne 0 ] + then + exit 1 + fi + cd .. + mv -uf tmp/ryzom/data/* . + # Delete temporary downloaded files + rm -rf tmp +fi + +if [ -f $RYZOM_CONFIG ] +then + echo "Updating $RYZOM_CONFIG..." + + # Escape path for sed using bash find and replace + RYZOM_CONFIG_DEFAULT_ESCAPED=$(echo $RYZOM_CONFIG_DEFAULT | sed 's/\//\\\//g') + + # Update RootConfigFilename to be sure it's using the right default config + sed -i 's/RootConfigFilename.*/RootConfigFilename = \"'$RYZOM_CONFIG_DEFAULT_ESCAPED'\"/g' $RYZOM_CONFIG +fi + +if [ -f $RSYNC ] +then + echo "Patching Ryzom data..." + + # Rsync + $RSYNC -rOtzv --progress --stats www.ryzom.com::ryzom/data/ $DATA_DIR + if [ $? -ne 0 ] + then + exit 1 + fi +fi + +# Launch Ryzom client if it exists +if [ -f $RYZOM_CLIENT ] +then + echo "Launching Ryzom..." + + nohup $RYZOM_CLIENT $1 $2 $3 2> /dev/null & +fi + +# Wait until all previous commands are executed and displayed before exiting +sync + +exit 0 diff --git a/dist/debian/trusty/debian/ryzom-client-config.install b/dist/debian/trusty/debian/ryzom-client-config.install new file mode 100644 index 000000000..bef3f53dd --- /dev/null +++ b/dist/debian/trusty/debian/ryzom-client-config.install @@ -0,0 +1 @@ +debian/client_default.cfg etc/ryzom diff --git a/dist/debian/trusty/debian/ryzom-client.dirs b/dist/debian/trusty/debian/ryzom-client.dirs new file mode 100644 index 000000000..d1571095c --- /dev/null +++ b/dist/debian/trusty/debian/ryzom-client.dirs @@ -0,0 +1,4 @@ +usr/games +usr/share/applications +usr/share/pixmaps +var/cache/ryzom/data diff --git a/dist/debian/trusty/debian/ryzom-client.install b/dist/debian/trusty/debian/ryzom-client.install new file mode 100644 index 000000000..be142a6be --- /dev/null +++ b/dist/debian/trusty/debian/ryzom-client.install @@ -0,0 +1,4 @@ +usr/games/ryzom_client +usr/share/icons +usr/share/pixmaps +debian/ryzom_client.desktop usr/share/applications diff --git a/dist/debian/trusty/debian/ryzom-client.menu b/dist/debian/trusty/debian/ryzom-client.menu new file mode 100644 index 000000000..5e15bf577 --- /dev/null +++ b/dist/debian/trusty/debian/ryzom-client.menu @@ -0,0 +1,6 @@ +?package(ryzom-client): \ + needs="x11" \ + section="Games/Adventure" \ + icon="/usr/share/pixmaps/ryzom.xpm" \ + title="Ryzom" \ + command="/usr/games/ryzom" diff --git a/dist/debian/trusty/debian/ryzom-client.postinst b/dist/debian/trusty/debian/ryzom-client.postinst new file mode 100644 index 000000000..51570a3dc --- /dev/null +++ b/dist/debian/trusty/debian/ryzom-client.postinst @@ -0,0 +1,10 @@ +#!/bin/sh + +if ! getent group ryzom ; then + addgroup --system ryzom +fi + +chgrp -R ryzom /var/cache/ryzom/data +chmod -R g+wrxs /var/cache/ryzom/data + +#DEBHELPER# diff --git a/dist/debian/trusty/debian/ryzom-client.postrm b/dist/debian/trusty/debian/ryzom-client.postrm new file mode 100644 index 000000000..828871eb4 --- /dev/null +++ b/dist/debian/trusty/debian/ryzom-client.postrm @@ -0,0 +1,49 @@ +#! /bin/sh +# postrm script for ryzom-client +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' overwrit>r> +# for details, see /usr/share/doc/packaging-manual/ + +case "$1" in + purge) + + FILES=/home/* + + for f in $FILES + do + FOLDER="$f/.ryzom/data" + + if [ -d $FOLDER ] + then + rm -rf $FOLDER + echo "Deleting $FOLDER..." + fi + done + + ;; + + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + +esac + +#DEBHELPER# + +exit 0 diff --git a/dist/debian/trusty/debian/ryzom-tools.install b/dist/debian/trusty/debian/ryzom-tools.install new file mode 100644 index 000000000..c468e32d8 --- /dev/null +++ b/dist/debian/trusty/debian/ryzom-tools.install @@ -0,0 +1,26 @@ +usr/bin/7zDec +usr/bin/alias_synchronizer +usr/bin/assoc_mem +usr/bin/csv_transform +usr/bin/georges_editor_qt +usr/bin/icon_search +usr/bin/make_alias_file +usr/bin/make_anim_by_race +usr/bin/make_anim_melee_impact +usr/bin/mp_generator +usr/bin/named2csv +usr/bin/patch_gen +usr/bin/patch_gen_service +usr/bin/pd_parser +usr/bin/pdr_util +usr/bin/prim_export +usr/bin/ryzom_mission_compiler +usr/bin/sheets_packer +usr/bin/skill_extractor +usr/bin/stats_scan +usr/bin/translation_tools +usr/bin/uni_conv +usr/games/ryzom_client_patcher +usr/lib/*/libryzom_mission_compiler_lib.so.* +usr/share/games/ryzom/data_leveldesign +usr/share/games/ryzom/georges_editor_qt diff --git a/dist/debian/trusty/debian/ryzom_client.desktop b/dist/debian/trusty/debian/ryzom_client.desktop new file mode 100644 index 000000000..1c62d1b6a --- /dev/null +++ b/dist/debian/trusty/debian/ryzom_client.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Version=1.0 +Name=Ryzom +Name[ru]=Ризом +Type=Application +GenericName=ryzom_client +Exec=/usr/games/ryzom +Icon=ryzom_client +Terminal=true +Hidden=false +Categories=Game;RolePlaying; diff --git a/dist/debian/trusty/debian/source/format b/dist/debian/trusty/debian/source/format new file mode 100644 index 000000000..b9b023757 --- /dev/null +++ b/dist/debian/trusty/debian/source/format @@ -0,0 +1,2 @@ +1.0 + diff --git a/dist/debian/update.sh b/dist/debian/update.sh new file mode 100755 index 000000000..7ccbd30f7 --- /dev/null +++ b/dist/debian/update.sh @@ -0,0 +1,38 @@ +#!/bin/sh + +HGBIN="/usr/bin/hg" +CODEROOT=../../code + +echo "Generating changelogs..." +$HGBIN log -M --style $CODEROOT/changelog.template > $CODEROOT/changelog + +REVISION=$($HGBIN identify -n | grep -o -P "[0-9]+") +echo "Found revision $REVISION" + +REVISION_H=$CODEROOT/revision + +DATE=$(date "+%Y-%m-%d %H:%M:%S") + +# Update revision.h with revision and build date +echo $REVISION > $REVISION_H + +VERSION=$(./ryzomcore_version.sh) + +if [ -z "$VERSION" ] +then + echo "Can't parse version from $VERSION_FILE, aborting..." + exit 1 +fi + +DSTFOLDER=ryzom-core-$VERSION.$REVISION + +# remove destination folder if present +rm -rf $DSTFOLDER.orig +# copy all files +echo "Copying files to $DSTFOLDER..." +cp -r -p $CODEROOT $DSTFOLDER.orig + +echo "Removing web files, because we don't need them and they generate lintian errors..." +rm -rf $DSTFOLDER.orig/web + +echo "Done. Now launch ./update_debian.sh " diff --git a/dist/debian/update_debian.sh b/dist/debian/update_debian.sh new file mode 100755 index 000000000..8c2c5dd7d --- /dev/null +++ b/dist/debian/update_debian.sh @@ -0,0 +1,88 @@ +#!/bin/sh + +HGBIN="/usr/bin/hg" +DCHBIN="/usr/bin/dch" + +if [ ! -e $DCHBIN ] +then + apt-get install devscripts debhelper +fi + +DISTRIB=$1 +MINORDISTRIB=$2 + +if [ -z "$DISTRIB" ] +then + echo "You must specify a distribution" + exit 1 +fi + +if [ -z "$MINORDISTRIB" ] +then + MINORDISTRIB=1 +fi + +if [ ! -d "$DISTRIB" ] +then + echo "$DISTRIB is not supported, you can create the folder or compile for another version." + exit 1 +fi + +echo "Targetting $DISTRIB..." + +VERSION=$(./ryzomcore_version.sh) + +if [ -z "$VERSION" ] +then + echo "Can't parse version from $VERSION_FILE, aborting..." + exit 1 +fi + +REVISION=$($HGBIN identify -n | grep -o -P "[0-9]+") + +DSTFOLDER=ryzom-core-$VERSION.$REVISION + +if [ ! -d "$DSTFOLDER.orig" ] +then + echo "$DSTFOLDER.orig doesn't exist, did you forget to launch ./update.sh?" + exit 1 +fi + +# copy files if directory doesn't exist +if [ ! -d $DSTFOLDER ] +then + # copy all files + echo "Copying files to $DSTFOLDER..." + cp -r -p $DSTFOLDER.orig $DSTFOLDER +fi + +cd $DSTFOLDER + +echo "Copying debian directory..." +# delete debian directory if present +rm -rf debian +# create debian folder +mkdir -p debian +# copy debian folder +cp -r -p ../$DISTRIB/debian . + +# returning the line with the version +LAST_VERSION=`grep $VERSION.$REVISION debian/changelog` +FULL_VERSION=$VERSION.$REVISION-1~$DISTRIB$MINORDISTRIB + +# adding the new version to changelog +if [ -z "$LAST_VERSION" ] +then + echo "Adding $FULL_VERSION to debian/changelog for $DISTRIB" + $DCHBIN --force-distribution -b -v $FULL_VERSION -D $DISTRIB "New upstream release (revision $REVISION)" +else + echo "Last version is $LAST_VERSION" +fi + +echo "Creating source package..." +debuild -S + +cd .. + +echo "Done." +echo "If you want to upload source to your PPA, type: dput ryzom-core_"$FULL_VERSION"_source.changes" diff --git a/dist/debian/xenial/debian/changelog b/dist/debian/xenial/debian/changelog new file mode 100644 index 000000000..44f3e244e --- /dev/null +++ b/dist/debian/xenial/debian/changelog @@ -0,0 +1,408 @@ +ryzom-core (0.8.2802~raring1) raring; urgency=low + + * New upstream release (revision 2802) + + -- Cédric OCHS Mon, 10 Dec 2012 11:12:17 +0100 + +ryzom-core (0.8.2786~raring1) raring; urgency=low + + * New upstream release (revision 2786) + + -- Cédric OCHS Fri, 07 Dec 2012 16:33:15 +0100 + +ryzom-core (0.8.2691~quantal1) quantal; urgency=low + + * New upstream release (revision 2691) + + -- Cédric OCHS Sun, 07 Oct 2012 09:46:56 +0200 + +ryzom-core (0.8.2682~quantal1) quantal; urgency=low + + * New upstream release (revision 2682) + + -- Cédric OCHS Wed, 03 Oct 2012 15:59:54 +0200 + +ryzom-core (0.8.2681~quantal2) quantal; urgency=low + + * New upstream release (revision 2681) + + -- Cédric OCHS Tue, 02 Oct 2012 17:42:23 +0200 + +ryzom-core (0.8.2681~quantal1) quantal; urgency=low + + * New upstream release (revision 2681) + + -- Cédric OCHS Tue, 02 Oct 2012 17:13:57 +0200 + +ryzom-core (0.8.2650~quantal2) quantal; urgency=low + + * New upstream release (revision 2650) + + -- Cédric OCHS Mon, 24 Sep 2012 22:06:37 +0200 + +ryzom-core (0.8.2650~quantal1) quantal; urgency=low + + * New upstream release (revision 2650) + + -- Cédric OCHS Mon, 24 Sep 2012 20:55:19 +0200 + +ryzom-core (0.8.2025~precise1) precise; urgency=low + + * New upstream release (revision 2025) + + -- Cédric OCHS Sat, 10 Mar 2012 22:23:49 +0100 + +ryzom-core (0.8.2024~precise1) precise; urgency=low + + * New upstream release (revision 2024) + + -- Cédric OCHS Sat, 10 Mar 2012 11:16:08 +0100 + +ryzom-core (0.8.1847~natty1) natty; urgency=low + + * New upstream release (revision 1847) + + -- Cédric OCHS Mon, 17 Oct 2011 09:33:45 +0200 + +ryzom-core (0.8.1847~natty0) natty; urgency=low + + * New upstream release (revision 1847) + + -- Cédric OCHS Sun, 16 Oct 2011 18:45:27 +0200 + +ryzom-core (0.8.1758~natty0) natty; urgency=low + + * New upstream release (revision 1758) + + -- Cédric OCHS Tue, 16 Aug 2011 09:02:55 +0200 + +ryzom-core (0.8.1752~natty0) natty; urgency=low + + * New upstream release (revision 1752) + + -- Cédric OCHS Sun, 14 Aug 2011 16:07:29 +0200 + +ryzom-core (0.8.1751~natty0) natty; urgency=low + + * New upstream release (revision 1751) + + -- Cédric OCHS Sun, 14 Aug 2011 14:16:24 +0200 + +ryzom-core (0.8.1750~natty0) natty; urgency=low + + * New upstream release (revision 1750) + + -- Cédric OCHS Sun, 14 Aug 2011 12:30:18 +0200 + +ryzom-core (0.8.1744~natty0) natty; urgency=low + + * New upstream release (revision 1744) + + -- Cédric OCHS Sat, 13 Aug 2011 20:24:49 +0200 + +ryzom-core (0.8.1742~natty0) natty; urgency=low + + * New upstream release (revision 1742) + + -- Cédric OCHS Fri, 12 Aug 2011 18:11:07 +0200 + +ryzom-core (0.8.1628~natty0) natty; urgency=low + + * New upstream release (revision 1628) + + -- Cédric OCHS Fri, 17 Jun 2011 12:56:17 +0200 + +ryzom-core (0.8.1627~natty0) natty; urgency=low + + * New upstream release (revision 1627) + + -- Cédric OCHS Tue, 14 Jun 2011 20:37:05 +0200 + +ryzom-core (0.8.1611~natty0) natty; urgency=low + + * New upstream release (revision 1611) + + -- Cédric OCHS Wed, 08 Jun 2011 19:53:44 +0200 + +ryzom-core (0.8.1596~natty1) natty; urgency=low + + * New upstream release (revision 1596) + + -- Cédric OCHS Sat, 04 Jun 2011 18:11:45 +0200 + +ryzom-core (0.7.1406~natty0) natty; urgency=low + + * New upstream release (revision 1406) + + -- Kervala Sun, 13 Mar 2011 19:07:44 +0100 + +ryzom-core (0.7.1404~karmic0) karmic; urgency=low + + * New upstream release (revision 1404) + + -- Kervala Thu, 10 Mar 2011 20:13:35 +0100 + +ryzom-core (0.7.1122~karmic0) karmic; urgency=low + + * New upstream release (revision 1122) + + -- Kervala Thu, 25 Nov 2010 13:18:41 +0100 + +ryzom-core (0.7.992~karmic0) karmic; urgency=low + + * New upstream release (revision 992) + + -- Kervala Tue, 19 Oct 2010 13:44:23 +0200 + +ryzom-core (0.7.941~karmic0) karmic; urgency=low + + * New upstream release (revision 941) + + -- Kervala Sat, 16 Oct 2010 14:59:36 +0200 + +ryzom-core (0.7.933~karmic0) karmic; urgency=low + + * New upstream release (revision 933) + + -- Kervala Fri, 15 Oct 2010 22:29:44 +0200 + +ryzom-core (0.7.932~karmic0) karmic; urgency=low + + * New upstream release (revision 932) + + -- Kervala Fri, 15 Oct 2010 19:53:47 +0200 + +ryzom-core (0.7.666~karmic0) karmic; urgency=low + + * New upstream release (revision 666) + + -- Kervala Sun, 29 Aug 2010 17:56:06 +0200 + +ryzom-core (0.7.631~karmic0) karmic; urgency=low + + * New upstream release (revision 631) + + -- Kervala Thu, 12 Aug 2010 16:57:30 +0200 + +ryzom-core (0.7.614~lucid1) lucid; urgency=low + + * Fixed dependencies + + -- Kervala Sun, 08 Aug 2010 22:42:50 +0200 + +ryzom-core (0.7.614~lucid0) lucid; urgency=low + + * New upstream release (revision 614) + + -- Kervala Sun, 08 Aug 2010 21:53:00 +0200 + +ryzom-core (0.7.583~lucid1) lucid; urgency=low + + * Added dependency on libogg and libvorbis + + -- Kervala Sun, 01 Aug 2010 15:38:40 +0200 + +ryzom-core (0.7.583~lucid0) lucid; urgency=low + + * New upstream release (revision 583) + + -- Kervala Sun, 01 Aug 2010 14:43:28 +0200 + +ryzom-core (0.7.530~lucid0) lucid; urgency=low + + * New upstream release (revision 530) + + -- Kervala Sun, 25 Jul 2010 16:50:57 +0200 + +ryzom-core (0.7.519~lucid0) lucid; urgency=low + + * New upstream release (revision 519) + + -- Kervala Mon, 19 Jul 2010 22:24:05 +0200 + +ryzom-core (0.7.507~lucid0) lucid; urgency=low + + * New upstream release (revision 507) + + -- Kervala Sat, 17 Jul 2010 19:56:35 +0200 + +ryzom-core (0.7.474~lucid0) lucid; urgency=low + + * New upstream release (revision 474) + + -- Kervala Tue, 13 Jul 2010 08:56:24 +0200 + +ryzom-core (0.7.473~lucid1) lucid; urgency=low + + * Some fixes + + -- Kervala Mon, 12 Jul 2010 22:46:16 +0200 + +ryzom-core (0.7.473~lucid0) lucid; urgency=low + + * New upstream release (revision 473) + + -- Kervala Mon, 12 Jul 2010 22:04:30 +0200 + +ryzom-core (0.7.437~lucid1) lucid; urgency=low + + * Fixed drivers installation + + -- Kervala Thu, 08 Jul 2010 08:54:02 +0200 + +ryzom-core (0.7.437~lucid0) lucid; urgency=low + + * New upstream release (revision 437) + + -- Kervala Thu, 01 Jul 2010 20:07:14 +0200 + +ryzom-core (0.7.419~lucid0) lucid; urgency=low + + * New upstream release (revision 419) + + -- Kervala Sat, 26 Jun 2010 18:58:36 +0200 + +ryzom-core (0.7.411~lucid0) lucid; urgency=low + + * New upstream release (revision 411) + + -- Kervala Sat, 26 Jun 2010 11:00:47 +0200 + +ryzom-core (0.7.404~lucid1) lucid; urgency=low + + * Fix OpenAL driver + + -- Kervala Thu, 24 Jun 2010 23:06:51 +0200 + +ryzom-core (0.7.404~lucid0) lucid; urgency=low + + * New upstream release (revision 404) + + -- Kervala Thu, 24 Jun 2010 22:17:36 +0200 + +ryzom-core (0.7.394~lucid0) lucid; urgency=low + + * New upstream release (revision 394) + + -- Kervala Tue, 22 Jun 2010 06:53:15 +0200 + +ryzom-core (0.7.375~lucid0) lucid; urgency=low + + * New upstream release (revision 375) + + -- Kervala Wed, 16 Jun 2010 12:46:51 +0200 + +ryzom-core (0.7.371~lucid0) lucid; urgency=low + + * New upstream release (revision 371) + + -- Kervala Mon, 14 Jun 2010 22:48:27 +0200 + +ryzom-core (0.7.359~lucid0) lucid; urgency=low + + * New upstream release (revision 359) + + -- Kervala Sun, 13 Jun 2010 21:31:29 +0200 + +ryzom-core (0.7.350~lucid1) lucid; urgency=low + + * Fixes problem with "copy" files + + -- Kervala Sun, 13 Jun 2010 10:36:30 +0200 + +ryzom-core (0.7.350~lucid0) lucid; urgency=low + + * New upstream release (revision 350) + + -- Kervala Sun, 13 Jun 2010 09:55:38 +0200 + +ryzom-core (0.7.332~lucid0) lucid; urgency=low + + * New upstream release (revision 332) + + -- Kervala Sat, 12 Jun 2010 09:09:21 +0200 + +ryzom-core (0.7.317~lucid0) lucid; urgency=low + + * New upstream release (revision 317) + + -- Kervala Thu, 10 Jun 2010 13:11:28 +0200 + +ryzom-core (0.7.315~lucid0) lucid; urgency=low + + * Fixed pkg-config installation again + + -- Kervala Thu, 10 Jun 2010 08:19:44 +0200 + +ryzom-core (0.7.311~lucid2) lucid; urgency=low + + * Fixed pkg-config files + + -- Kervala Wed, 09 Jun 2010 22:58:15 +0200 + +ryzom-core (0.7.311~lucid1) lucid; urgency=low + + * Fixed dependencies versions + + -- Kervala Wed, 09 Jun 2010 22:27:00 +0200 + +ryzom-core (0.7.311~lucid0) lucid; urgency=low + + * New upstream version (revision 311). + + -- Kervala Wed, 09 Jun 2010 21:15:42 +0200 + +ryzom-core (0.7.304~lucid0) lucid; urgency=low + + * New upstream version (revision 304). + + -- Kervala Wed, 09 Jun 2010 08:34:10 +0200 + +ryzom-core (0.7.0-1) unstable; urgency=low + + [ Gürkan Sengün ] + * New upstream version. (Closes: #553248) + * Updated build dependencies. + + [ Michal Čihař ] + * Convert to dh with cmake support. + * Bump standards to 3.8.4. + + [ Luboš Novák ] + * Change maintainer to 'Debian Games Team' + * ftbfs_gcc_4.5.path: Fix build with g++-4.5. (Closes: #565104) + * Converted direct changes in source to patches. + * Enable building CEGUI renderer. + * Add package libnel-doc with documentation. + * debian/control + + Changed priority of libnel-dbg to extra. + + Remove duplicate Section in libnel0. + + Update short descriptions. + + Replace obsolete package xlibmesa-gl-dev with libgl1-mesa-dev + in build-depends. + + Add libpng-dev to build-depends. + + Remove libalut-dev from build-depends. + + New homepage. + + Supported architectures are i386 and amd64. + * debian/libnel-dev.dirs + + Remove empty dir usr/lib/nel. + * debian/copyright + + Update redistribution licence from GPL to GPL-2. + * debian/rules + + Disable building unit test, samples and tools. + + -- Luboš Novák Tue, 30 Mar 2010 10:29:23 +0100 + +ryzom-core (0.5.0-1.1) unstable; urgency=low + + * Non-maintainer upload. + * Change Build-Depends: libstlport5.2-dev. (Closes: #521762) + + -- Torsten Werner Sun, 28 Jun 2009 11:54:05 +0200 + +ryzom-core (0.5.0-1) unstable; urgency=low + + * Initial release. (Closes: #448067) + + -- Gürkan Sengün Tue, 23 Oct 2007 12:56:45 +0200 + diff --git a/dist/debian/xenial/debian/client_default.cfg b/dist/debian/xenial/debian/client_default.cfg new file mode 100644 index 000000000..d09cbbb9c --- /dev/null +++ b/dist/debian/xenial/debian/client_default.cfg @@ -0,0 +1,567 @@ +////////////////////////// +////////////////////////// +/// CLIENT CONFIG FILE /// +////////////////////////// +////////////////////////// + + +// If you set this variable to 1, your client.cfg will be overwritten when you quit the client. +// You will loose all the comments and identation in this file. +SaveConfig = 1; + +/////////////////// +// WINDOW CONFIG // +/////////////////// + +Driver3D="Auto"; // Valid values are "Auto" or "0", "OpengGL" or "1" & "Direct3D" or "2" + // "Auto" will choose the best suited driver depending on hardware +FullScreen = 0; +Width = 1024; +Height = 768; +PositionX = 0; +PositionY = 0; +Frequency = 60; +Depth = 32; +Sleep = -1; +ProcessPriority = 0; // -2 = idle, -1 = below normal, 0 = normal, 1 = above normal, 2 = high, 3 = real time +Contrast = 0.0; // -1.0 ~ 1.0 +Luminosity = 0.0; // -1.0 ~ 1.0 +Gamma = 0.0; // -1.0 ~ 1.0 +Contrast_min = -1.0; +Luminosity_min = -1.0; +Gamma_min = -1.0; +Contrast_max = 1.0; +Luminosity_max = 1.0; +Gamma_max = 1.0; + + +///////////// +// NETWORK // +///////////// + +Application = { "ryzom_live", "./client_ryzom_r.exe", "./" }; +BackgroundDownloader = 0; +PatchServer = "http://dl.ryzom.com/patch_live"; +SignUpURL = "http://www.ryzom.com/subscribe"; +StartupHost = "shard.ryzom.com:40916"; +StartupPage = "/login/r2_login.php"; +InstallStatsUrl = "http://shard.ryzom.com:50000/stats/stats.php"; +CreateAccountURL = "https://secure.ryzom.com/signup/from_client.php"; +InstallWebPage = "http://dl.ryzom.com/installer/"; + + +//////////////// +// INTERFACES // +//////////////// + +// the language to use as in ISO 639-2 +LanguageCode = "en"; // english + +XMLInputFile = "input_config_v3.xml"; + +XMLLoginInterfaceFiles = { + "login_config.xml", + "login_widgets.xml", + "login_main.xml", + "login_keys.xml", +}; + +XMLOutGameInterfaceFiles = { + "out_v2_config.xml", + "out_v2_widgets.xml", + "out_v2_connect.xml", + "out_v2_intro.xml", + "out_v2_select.xml", + "out_v2_appear.xml", + "out_v2_location.xml", + "out_v2_crash.xml", + "out_v2_hierarchy.xml", + "out_v2_keys.xml", +}; + +// The ligo primitive class file +LigoPrimitiveClass = "world_editor_classes.xml"; + +VerboseLog = 1; + +/////////// +// MOUSE // +/////////// +HardwareCursor = 1; + +CursorSpeed = 1.0; // In pixels per mickey +CursorSpeed_min = 0.5; +CursorSpeed_max = 2.0; + +CursorAcceleration = 40; // Threshold in mickey +CursorAcceleration_min = 20; +CursorAcceleration_max = 80; + +FreeLookSpeed = 0.004; // In radian per mickey +FreeLookSpeed_min = 0.0001; +FreeLookSpeed_max = 0.01; + +FreeLookAcceleration = 40; // Threshold in mickey +FreeLookAcceleration_min = 20; +FreeLookAcceleration_max = 80; + +FreeLookInverted = 0; +AutomaticCamera = 0; +DblClickMode = 1; +AutoEquipTool = 1; + +/////////////////// +// RENDER CONFIG // +/////////////////// + +// NB: thoses variables configure also the InGameConfigurator: +// _min and _max define the bounds +// _step defines the step (NB: take care of _min and _max!!) +// _ps0 is the LOW preset, _ps1 is the MEDIUM preset, _ps2 is the NORMAL Preset, and _ps3 is the HIGH one + + +// *** LANDSCAPE +LandscapeTileNear = 150.000000; +LandscapeTileNear_min = 20.000000; +LandscapeTileNear_max = 250.000000; +LandscapeTileNear_step = 10.0; +LandscapeTileNear_ps0 = 20.0; +LandscapeTileNear_ps1 = 100.0; +LandscapeTileNear_ps2 = 150.0; +LandscapeTileNear_ps3 = 200.0; + +// NB: threshold is inverted ULandscape::setThreshold(), to be more intelligible +LandscapeThreshold = 2000.0; +LandscapeThreshold_min = 100.0; // Low quality => 0.01 threshold +LandscapeThreshold_max = 4000.0; // High quality => 0.0005 threshold +LandscapeThreshold_step = 100.0; +LandscapeThreshold_ps0 = 100.0; +LandscapeThreshold_ps1 = 1000.0; +LandscapeThreshold_ps2 = 2000.0; +LandscapeThreshold_ps3 = 3000.0; + +Vision = 500.000000; +Vision_min = 200.000000; +Vision_max = 800.000000; +Vision_step = 100.000000; +Vision_ps0 = 200.0; +Vision_ps1 = 400.0; +Vision_ps2 = 500.0; +Vision_ps3 = 800.0; + +MicroVeget = 1; // Enable/Disable MicroVeget. +MicroVeget_ps0 = 0; +MicroVeget_ps1 = 1; +MicroVeget_ps2 = 1; +MicroVeget_ps3 = 1; + +MicroVegetDensity = 80.0; +MicroVegetDensity_min = 10.0; +MicroVegetDensity_max = 100.0; +MicroVegetDensity_step = 10.0; +MicroVegetDensity_ps0 = 10.0; // not used since disabled! +MicroVegetDensity_ps1 = 30.0; +MicroVegetDensity_ps2 = 80.0; +MicroVegetDensity_ps3 = 100.0; + + +// *** FX +FxNbMaxPoly = 20000; +FxNbMaxPoly_min = 2000; +FxNbMaxPoly_max = 50000; +FxNbMaxPoly_step= 2000; +FxNbMaxPoly_ps0 = 2000; +FxNbMaxPoly_ps1 = 10000; +FxNbMaxPoly_ps2 = 20000; +FxNbMaxPoly_ps3 = 50000; + +Cloud = 1; +Cloud_ps0 = 0 ; +Cloud_ps1 = 1 ; +Cloud_ps2 = 1 ; +Cloud_ps3 = 1 ; + +CloudQuality = 160.0; +CloudQuality_min = 80.0; +CloudQuality_max = 320.0; +CloudQuality_step = 20.0; +CloudQuality_ps0 = 80.0; // not used since disabled! +CloudQuality_ps1 = 80.0; +CloudQuality_ps2 = 160.0; +CloudQuality_ps3 = 320.0; + +CloudUpdate = 1; +CloudUpdate_min = 1; +CloudUpdate_max = 8; +CloudUpdate_step= 1; +CloudUpdate_ps0 = 1; // not used since disabled! +CloudUpdate_ps1 = 1; +CloudUpdate_ps2 = 1; +CloudUpdate_ps3 = 3; + +Shadows = 1; +Shadows_ps0 = 0; +Shadows_ps1 = 1; +Shadows_ps2 = 1; +Shadows_ps3 = 1; + +Bloom = 0; +Bloom_ps0 = 0; +Bloom_ps1 = 1; +Bloom_ps2 = 1; +Bloom_ps3 = 1; + +SquareBloom = 1; +SquareBloom_ps0 = 0; +SquareBloom_ps1 = 1; +SquareBloom_ps2 = 1; +SquareBloom_ps3 = 1; + +DensityBloom = 255.0; +DensityBloom_min = 0.0; +DensityBloom_max = 255.0; +DensityBloom_step = 1.0; +DensityBloom_ps0 = 255.0; +DensityBloom_ps1 = 255.0; +DensityBloom_ps2 = 255.0; +DensityBloom_ps3 = 255.0; + + +// *** CHARACTERS +SkinNbMaxPoly = 100000; +SkinNbMaxPoly_min = 5000; +SkinNbMaxPoly_max = 250000; +SkinNbMaxPoly_step = 5000; +SkinNbMaxPoly_ps0 = 10000; +SkinNbMaxPoly_ps1 = 70000; +SkinNbMaxPoly_ps2 = 100000; +SkinNbMaxPoly_ps3 = 200000; + +NbMaxSkeletonNotCLod = 125; +NbMaxSkeletonNotCLod_min = 5; +NbMaxSkeletonNotCLod_max = 255; +NbMaxSkeletonNotCLod_step = 5; +NbMaxSkeletonNotCLod_ps0 = 10; +NbMaxSkeletonNotCLod_ps1 = 50; +NbMaxSkeletonNotCLod_ps2 = 125; +NbMaxSkeletonNotCLod_ps3 = 255; + +CharacterFarClip = 200.0; +CharacterFarClip_min = 50.0; +CharacterFarClip_max = 500.0; +CharacterFarClip_step = 10.0; +CharacterFarClip_ps0 = 50.0; +CharacterFarClip_ps1 = 100.0; +CharacterFarClip_ps2 = 200.0; +CharacterFarClip_ps3 = 500.0; + +EnableRacialAnimation = 1; + +// *** MISC +// This is the actual aspect ratio of your screen (no relation with the resolution!!). Set 1.7777 if you got a 16/9 screen for instance +ScreenAspectRatio = 0.0; +ForceDXTC = 1; // Enable/Disable DXTC. +DivideTextureSizeBy2= 0; // Divide texture size +DisableVtxProgram = 0; // Disable Hardware Vertex Program. +DisableVtxAGP = 0; // Disable Hardware Vertex AGP. +DisableTextureShdr = 0; // Disable Hardware Texture Shader. +HDEntityTexture = 0; +HDTextureInstalled = 1; +WaitVBL = 0; // 0 or 1 to wait Vertical Sync. + +////////////////// +// GAME OPTIONS // +////////////////// +SelectWithRClick = 1; +DisplayWeapons = 1; +RotKeySpeedMax = 2.0; +RotKeySpeedMax_min = 1.0; +RotKeySpeedMax_max = 4.0; +RotKeySpeedMin = 1.0; +RotKeySpeedMin_min = 0.5; +RotKeySpeedMin_max = 2.0; +RotAccel = 3.0; +FollowOnAtk = 0; +AtkOnSelect = 0; +ZCPacsPrim = "gen_bt_col_ext.pacs_prim"; + +///////////////// +// PREFERENCES // +///////////////// +FPV = 0; // FPV(First Person View) : default is false (Third Person View). +CameraHeight = 2.2; // Camera Height (in meter) from the ground (for the Third Person View). +CameraDistance = 3.0; // Camera Distance(in meter) from the user (for the Third Person View). +CameraDistStep = 1.0; +CameraDistMin = 1.0; +CameraDistMax = 25.0; +CameraAccel = 5.0; +CameraSpeedMin = 2.0; +CameraSpeedMax = 100.0; +CameraResetSpeed = 10.0; // Speed in radian/s + +////////////////// +// SOUND CONFIG // +////////////////// +SoundForceSoftwareBuffer= 1; +SoundOn = 1; +UseEax = 0; + +MaxTrack = 32; +MaxTrack_min = 4; +MaxTrack_max = 32; +MaxTrack_step = 4; + +// This is the volume for "InGame" sound FXs +SoundSFXVolume = 1.0; +SoundSFXVolume_min = 0.0; +SoundSFXVolume_max = 1.0; +SoundSFXVolume_step = 0.001; + +// This is volume for "InGame" music. Does not affect the MP3 player +SoundGameMusicVolume = 0.5; +SoundGameMusicVolume_min = 0.0; +SoundGameMusicVolume_max = 1.0; +SoundGameMusicVolume_step = 0.001; + +// MISC +PreDataPath = { "user", "patch", "examples", "data/fonts", "data/gamedev.bnp" }; +DataPath = { "data" }; +NeedComputeVS = 0; + +NegFiltersDebug = {"Update DB", "Reading:", "Read Value :", "impulseCallBack", "CLIMPD:", "LNET" }; +NegFiltersInfo = { "CLIMPD:", "CPath::lookup" , "LNET" }; +NegFiltersWarning = { "'basics.Equipment Slot'.", "_usercolor.tga", "PACS" }; + +// Big screen shot +ScreenShotWidth = 0; +ScreenShotHeight = 0; +ScreenShotFullDetail = 1; // 1 to switch full detail mode for characters (both standard & big screenshots) + +// Read : "ID", "R G B A MODE [FX]" +SystemInfoColors = +{ +// OLD STUFF Here for compatibility +"RG", "0 0 0 255 normal", // Black to see when there is an error +"BC", "0 0 0 255 normal", // Black to see when there is an error +"JA", "0 0 0 255 normal", // Black to see when there is an error +"BL", "0 0 0 255 normal", // Black to see when there is an error +"VE", "0 0 0 255 normal", // Black to see when there is an error +"VI", "0 0 0 255 normal", // Black to see when there is an error + +// NEW System Info Categories +"SYS", "255 255 255 255 normal", // Default system messages +"BC", "255 255 255 255 centeraround", // Broadcast messages +"TAGBC", "255 255 255 255 centeraround", // Taged broadcast messages : color should remain white as some word are tagged +"XP", "255 255 64 255 over", // XP Gain +"SP", "255 255 64 255 over", // SP Gain +"TTL", "255 255 64 255 over", // Title +"TSK", "255 255 255 255 over", // Task +"ZON", "255 255 255 255 center", // Zone +"DG", "255 0 0 255 normal", // Damage to me +"DMG", "255 0 0 255 normal", // Damage to me +"DGP", "200 0 0 255 normal", // Damage to me from player +"DGM", "255 128 64 255 normal", // Damage from me +"MIS", "150 150 150 255 normal", // The opponent misses +"MISM", "255 255 255 255 normal", // I miss +"ITM", "0 200 0 255 over", // Item +"ITMO", "170 170 255 255 overonly", // Item other in group +"ITMF", "220 0 220 255 over", // Item failed +"SPL", "50 50 250 255 normal", // Spell to me +"SPLM", "50 150 250 255 normal", // Spell from me +"EMT", "255 150 150 255 normal", // Emote +"MTD", "255 255 0 255 over", // Message Of The Day +"FORLD","64 255 64 255 overonly", // Forage Locate Deposit +"CHK", "255 120 60 255 center", // Tous ce qui ne remplit pas une condition +"CHKCB","255 255 0 255 center", // Tous ce qui ne remplit pas une condition en combat (trop loin, cible invalide, pas assez de mana, etc.) +"PVPTM","255 120 60 255 overonly", // PVP timer +"THM", "255 255 64 255 over misc_levelup.ps", // Thema finished +"AMB", "255 255 64 255 center", // Ambiance +"ISE", "192 208 255 255 normal", // Item special effect +"ISE2", "192 208 255 255 center", // Item special effect with center text (for effects without flying text) +"OSM", "128 160 255 255 center", // Outpost state message +"AROUND","255 255 0 255 around", // Only in around channel +"R2_INVITE","0 255 0 255 around", // Ring invitation +}; + +PrintfCommands = { + "52", "15", "55 55 0 255", "28", "uiChapterV", "624", + "428", "0 0 0 255", "18", "", "624", "378", + "0 0 0 255", "14", "", "644", "278", "0 0 0 255", + "18", "", "52", "17", "255 255 255 255", "28", + "uiChapterV", "622", "430", "255 255 255 255", "18", "", + "622", "380", "255 255 255 255", "14", "", "642", + "280", "255 255 255 255", "18", "" +}; + +PrintfCommandsFreeTrial = { + "52", "15", "55 55 0 255", "28", "uiChapterV", "624", + "428", "0 0 0 255", "18", "", "624", "378", + "0 0 0 255", "14", "", "644", "278", "0 0 0 255", + "18", "", "52", "17", "255 255 255 255", "28", + "uiChapterV", "622", "430", "255 255 255 255", "18", "", + "622", "380", "255 255 255 255", "14", "", "642", + "280", "255 255 255 255", "18", "" +}; + +DisplayMissingAnimFile = 0; + +LoadingStringCount = 54; + + +// Some R2 parameters ... + +R2Mode = 1; +R2EDEnabled = 1; +R2EDExtendedDebug = 0; +R2EDLightPalette = 0; +R2ClientGw = "r2linux01"; +LoadLuaDebugger = 0; +CheckR2ScenarioMD5 = 1; +LevelDesignEnabled = 0; + +DmCameraDistMax = 25; +DmRun = 20; +DmWalk = 6; + +R2EDReloadFiles = { + "r2ed.xml", + "r2_basic_bricks.lua", + "r2_components.lua", + "r2_core.lua", + "r2_features_default.lua", + "r2_features_fauna.lua", + "r2_features_npc_groups.lua", + "r2_palette.lua", + "r2_scenario.lua", + "r2_ui.lua" +}; + +XMLInterfaceFiles = { + "config.xml", + "widgets.xml", + "webig_widgets.xml", + "player.xml", + "inventory.xml", + "interaction.xml", + "phrase.xml", + "harvest.xml", + "macros.xml", + "info_player.xml", + "outpost.xml", + "guild.xml", + "taskbar.xml", + "game_config.xml", + "game_context_menu.xml", + "player_trade.xml", + "bot_chat_v4.xml", + "compass.xml", + "map.xml", + "hierarchy.xml", + "reset.xml", + "actions.xml", + "help.xml", + "encyclopedia.xml", + "commands.xml", + "commands2.xml", + "ring_access_point_filter.xml", + "ring_window.xml", + "bg_downloader.xml" +}; + +XMLR2EDInterfaceFiles = +{ + "r2ed.xml", + "r2_triggers.xml", + "r2_logic_entities.xml", + "r2ed_acts.xml", + "r2ed_scenario.xml", + "r2ed_connect.xml" +}; + +FogDistAndDepthLookupBias = 20; // bias for lookup of fog distance and depth + + +// Hardware cursor textures +// These will be extracted from the corresponding packed ui .tga files when they are loaded +// * +// * individual .tga files for hardware cursor bitmap not looked for, and not supported yet +HardwareCursors = +{ + "curs_can_pan.tga", + "curs_can_pan_dup.tga", + "curs_create.tga", + "curs_create_multi.tga", + "curs_create_vertex_invalid.tga", + "curs_default.tga", + "curs_dup.tga", + "curs_L.tga", + "curs_M.tga", + "curs_pan.tga", + "curs_pan_dup.tga", + "curs_pick.tga", + "curs_pick_dup.tga", + "curs_R.tga", + "curs_resize_BL_TR.tga", + "curs_resize_BR_TL.tga", + "curs_resize_LR.tga", + "curs_resize_TB.tga", + "curs_rotate.tga", + "curs_scale.tga", + "curs_stop.tga", + "text_cursor.tga", + "r2_hand_can_pan.tga", + "r2_hand_pan.tga", + "r2ed_tool_can_pick.tga", + "r2ed_tool_can_rotate.tga", + "r2ed_tool_pick.tga", + "r2ed_tool_rotate.tga", + "r2ed_tool_rotating.tga" +}; + +Loading_BG = "new_loading_bg.tga"; // Default name for the loading background file. +Launch_BG = "new_launcher_bg.tga"; // Default name for the launch background file. +TeleportKami_BG = "new_teleport_kami_bg.tga"; +TeleportKaravan_BG = "new_teleport_caravan_bg.tga"; +Elevator_BG = "new_elevator_bg.tga"; // Default name for the loading background file. +ResurectKami_BG = "new_resurect_kami_bg.tga"; +ResurectKaravan_BG = "new_resurect_caravane_bg.tga"; +End_BG = "end_bg.tga"; // Default name for the last background file. + +ScenarioSavePath = "./my_scenarios/"; + +// list ofpredefined keyset +// name will be looked up in the translation file by searching 'uiCP_KeysetName_" + id +// tooltip will be looked up in the translation file by searching 'uiCP_KeysetTooltip_" + id +// 'bi.' stands for built-in +// note : we add a dot in the name to be sure that there cannot be a conflict with character keyset name +BuiltInKeySets = +{ + "", // default ryzom keyboard layout + "bi.zqsd", // european keyboard fps displacement style (NB : don't change this layout name, ryzom will automatically select it if keyboard is french or belgian) + "bi.wasd", // english keyboard fps displacement style (NB : don't change this layout name, ryzom will automatically select it if keyboard is not french nor belgian) + "bi.wow_alike" // 'world of warcraft' like keyboard style. (NB : not available for ring) +}; + +// "Newbie Training", "Story Telling", "Mistery", "Hack & Slash", "Guild Training", "Other" +ScenarioTypes = {"so_newbie_training","so_story_telling","so_mistery","so_hack_slash","so_guild_training","so_other"}; + +ScenarioLanguages = {"fr","de","en","other_lang"}; + +// Map each language to a forum help page +HelpPages = +{ + "fr=http://forums.ryzom.com/forum/showthread.php?t=29130", + "en=http://forums.ryzom.com/forum/showthread.php?t=29129", + "wk=http://forums.ryzom.com/forum/showthread.php?t=29129", + "de=http://forums.ryzom.com/forum/showthread.php?t=29131" +}; + +WebIgMainDomain = "app.ryzom.com"; +WebIgTrustedDomains = { + "api.ryzom.com", "app.ryzom.com" +}; +PatchletUrl = "http://app.ryzom.com/app_patchlet/index.php?patch=preload"; + +SelectedSlot = 0; + +BuildName = "RELEASE_HEAD"; diff --git a/dist/debian/xenial/debian/compat b/dist/debian/xenial/debian/compat new file mode 100644 index 000000000..ec635144f --- /dev/null +++ b/dist/debian/xenial/debian/compat @@ -0,0 +1 @@ +9 diff --git a/dist/debian/xenial/debian/control b/dist/debian/xenial/debian/control new file mode 100644 index 000000000..7d95157c0 --- /dev/null +++ b/dist/debian/xenial/debian/control @@ -0,0 +1,212 @@ +Source: ryzom-core +Priority: extra +Maintainer: Debian Games Team +Uploaders: Luboš Novák , Cédric OCHS +Build-Depends: debhelper (>= 9), cmake(>= 2.6), libxml2-dev, + libgl1-mesa-dev, libjpeg8-dev | libjpeg62-dev, libpng12-dev, libopenal-dev, + libfreetype6-dev, libxxf86vm-dev, libxrandr-dev, libxrender-dev, + libvorbis-dev, libsquish-dev, libcurl4-openssl-dev, libluabind-dev, + libboost-dev, libmysqlclient-dev, libssl-dev, + libcpptest-dev, libqt4-dev, libqt4-opengl-dev +Standards-Version: 3.9.5 +Section: games +Bugs: https://bitbucket.org/ryzom/ryzomcore/issues +Homepage: https://bitbucket.org/ryzom/ryzomcore/ +Vcs-Hg: https://bitbucket.org/ryzom/ryzomcore +Vcs-Browser: https://bitbucket.org/ryzom/ryzomcore + +Package: libnel0 +Section: libdevel +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Massive multi-user 3D game environments library (shared library) + This is a software platform for creating and running massively multi-user + entertainment in a 3D environment over the Internet. + . + This 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 independent from + each other so you can use only the parts you really need in your project. + . + This package contains the shared library. + +Package: libnel-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Depends: ${misc:Depends}, libnel0 (= ${binary:Version}) +Description: Massive multi-user 3D game environments library (development files) + This is a software platform for creating and running massively multi-user + entertainment in a 3D environment over the Internet. + . + This 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 independent from + each other so you can use only the parts you really need in your project. + . + This package contains the headers. + +Package: libnel0-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, libnel0 (= ${binary:Version}) +Description: Massive multi-user 3D game environments library (debugging symbols) + This is a software platform for creating and running massively multi-user + entertainment in a 3D environment over the Internet. + . + This 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 independent from + each other so you can use only the parts you really need in your project. + . + This package contains the debugging symbols. + +Package: nel-tools +Section: devel +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends}, libnel0 (= ${binary:Version}) +Description: Massive multi-user 3D game environments library (tools) + This is a software platform for creating and running massively multi-user + entertainment in a 3D environment over the Internet. + . + This 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 independent from + each other so you can use only the parts you really need in your project. + . + This package contains the tools. + +Package: nel-tools-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, nel-tools (= ${binary:Version}) +Description: Massive multi-user 3D game environments library (tools debugging symbols) + This is a software platform for creating and running massively multi-user + entertainment in a 3D environment over the Internet. + . + This 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 independent from + each other so you can use only the parts you really need in your project. + . + This package contains the tools debugging symbols. + +Package: libryzom-sevenzip0 +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Ryzom science-fantasy MMORPG (decompression library) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the decompression shared library. + +Package: libryzom-sevenzip0-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, libryzom-sevenzip0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (decompression library debugging symbols) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the decompression shared library debugging symbols. + +Package: libryzom-gameshare0 +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends}, libnel0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (common shared library) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the game common shared library. + +Package: libryzom-gameshare0-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, libryzom-gameshare0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (common debugging symbols) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the game common debugging symbols. + +Package: libryzom-clientsheets0 +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends}, libryzom-gameshare0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (client sheets shared library) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the client sheets shared library. + +Package: libryzom-clientsheets0-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, libryzom-clientsheets0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (client sheets debugging symbols) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the client sheets debugging symbols. + +Package: ryzom-client +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends}, libryzom-gameshare0 (= ${binary:Version}), + libryzom-clientsheets0 (= ${binary:Version}), + ryzom-client-config (>= ${source:Version}), rsync, wget, p7zip-full +Description: Ryzom science-fantasy MMORPG (client) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the game client. + +Package: ryzom-client-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, ryzom-client (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (client debugging symbols) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the client debugging symbols. + +Package: ryzom-tools +Section: devel +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends}, libryzom-gameshare0 (= ${binary:Version}), + libryzom-clientsheets0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (tools) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the tools. + +Package: ryzom-tools-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, ryzom-tools (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (tools debugging symbols) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the tools debugging symbols. + +Package: ryzom-client-config +Architecture: all +Depends: ${misc:Depends} +Description: Ryzom science-fantasy MMORPG (client configuration) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the client configuration. diff --git a/dist/debian/xenial/debian/copyright b/dist/debian/xenial/debian/copyright new file mode 100644 index 000000000..d5a0f2f10 --- /dev/null +++ b/dist/debian/xenial/debian/copyright @@ -0,0 +1,53 @@ +This package was debianized by Gürkan Sengün on +Tue, 23 Oct 2007 12:56:45 +0200. + +It was downloaded from + +Upstream Authors: + + Olivier Cado + Bertram Felgenhauer + Krzysztof Kotlenga + Henri Kuuste + Vianney Lecroart + Namine + Cédric Ochs + Guillaume Puzin + Matt Raykowski + Robert Timm + Titegus + Ulukyn + Robert Wetzel + Zorglor + TODO: take names from Ryzom credits + +Copyright: + + Copyright (C) 2003-2009 Vianney Lecroart + Copyright (C) 2003-2009 Matt Raykowski + Copyright (C) 2000-2006 Nevrax Ltd. + Copyright (C) 2006-2007 Gameforge France + Copyright (C) 2008-2010 Winch Gate Property Limited + +License: + + 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 . + +The Debian packaging is: + + Copyright (C) 2007 Gürkan Sengün + +and is licensed under the GPL version 2, +see `/usr/share/common-licenses/GPL-2'. + diff --git a/dist/debian/xenial/debian/docs b/dist/debian/xenial/debian/docs new file mode 100644 index 000000000..58e5e3e76 --- /dev/null +++ b/dist/debian/xenial/debian/docs @@ -0,0 +1,2 @@ +changelog +README diff --git a/dist/debian/xenial/debian/libnel-dev.docs b/dist/debian/xenial/debian/libnel-dev.docs new file mode 100644 index 000000000..ba8894c15 --- /dev/null +++ b/dist/debian/xenial/debian/libnel-dev.docs @@ -0,0 +1,2 @@ +README + diff --git a/dist/debian/xenial/debian/libnel-dev.install b/dist/debian/xenial/debian/libnel-dev.install new file mode 100644 index 000000000..9f9310cee --- /dev/null +++ b/dist/debian/xenial/debian/libnel-dev.install @@ -0,0 +1,3 @@ +usr/include/* +usr/lib/*/libnel*.so +usr/lib/*/pkgconfig/* diff --git a/dist/debian/xenial/debian/libnel-dev.manpages b/dist/debian/xenial/debian/libnel-dev.manpages new file mode 100644 index 000000000..bb4027ca9 --- /dev/null +++ b/dist/debian/xenial/debian/libnel-dev.manpages @@ -0,0 +1 @@ +debian/nel-config.1 diff --git a/dist/debian/xenial/debian/libnel-doc.doc-base.nel b/dist/debian/xenial/debian/libnel-doc.doc-base.nel new file mode 100644 index 000000000..6ae95fc9f --- /dev/null +++ b/dist/debian/xenial/debian/libnel-doc.doc-base.nel @@ -0,0 +1,9 @@ +Document: nel +Title: NeL Reference Manual +Author: Nevrax +Abstract: This is a software platform for creating and running massively multi-user entertainment in a 3D environment over the Internet. +Section: Programming/C + +Format: HTML +Index: /usr/share/doc/libnel-doc/html/index.html +Files: /usr/share/doc/libnel-doc/html/*.html diff --git a/dist/debian/xenial/debian/libnel-doc.install b/dist/debian/xenial/debian/libnel-doc.install new file mode 100644 index 000000000..bf3f02a61 --- /dev/null +++ b/dist/debian/xenial/debian/libnel-doc.install @@ -0,0 +1 @@ +usr/share/doc/libnel-doc/html/* diff --git a/dist/debian/xenial/debian/libnel0.install b/dist/debian/xenial/debian/libnel0.install new file mode 100644 index 000000000..4273c0ad1 --- /dev/null +++ b/dist/debian/xenial/debian/libnel0.install @@ -0,0 +1,3 @@ +usr/lib/*/libnel*.so.* +usr/lib/*/nel/libnel_drv_openal.so +usr/lib/*/nel/libnel_drv_opengl.so diff --git a/dist/debian/xenial/debian/libryzom-clientsheets0.install b/dist/debian/xenial/debian/libryzom-clientsheets0.install new file mode 100644 index 000000000..b5ea5b79c --- /dev/null +++ b/dist/debian/xenial/debian/libryzom-clientsheets0.install @@ -0,0 +1,2 @@ +usr/lib/*/libryzom_clientsheets.so.* + diff --git a/dist/debian/xenial/debian/libryzom-gameshare0.install b/dist/debian/xenial/debian/libryzom-gameshare0.install new file mode 100644 index 000000000..2f51b0804 --- /dev/null +++ b/dist/debian/xenial/debian/libryzom-gameshare0.install @@ -0,0 +1,2 @@ +usr/lib/*/libryzom_gameshare.so.* + diff --git a/dist/debian/xenial/debian/libryzom-sevenzip0.install b/dist/debian/xenial/debian/libryzom-sevenzip0.install new file mode 100644 index 000000000..1edced3f8 --- /dev/null +++ b/dist/debian/xenial/debian/libryzom-sevenzip0.install @@ -0,0 +1,2 @@ +usr/lib/*/libryzom_sevenzip.so.* + diff --git a/dist/debian/xenial/debian/nel-config.1 b/dist/debian/xenial/debian/nel-config.1 new file mode 100644 index 000000000..be47bf496 --- /dev/null +++ b/dist/debian/xenial/debian/nel-config.1 @@ -0,0 +1,37 @@ +.TH nel-config 1 "26 Oct 2007" +.SH NAME +nel-config \- Get information about a libnel installation +.SH SYNOPSIS +.B nel-config [options] +.SH DESCRIPTION +.B nel-config +displays information about a libnel installation. +.SH OPTIONS +.IP "--cflags" +Set of compiler options (CFLAGS) to use when compiling files that use +libnel. Currently that is only thw include path to the nel include files. +.IP "--libs" +Shows the complete set of libs and other linker options you will need in order +to link your application with libnel. +.IP "--prefix" +This is the prefix used when libnel was installed. libnel is then installed +in $prefix/lib and its header files are installed in $prefix/include and so +on. The prefix is set with "configure \-\-prefix". +.IP "--version" +Outputs version information about the installed libnel. +.SH "EXAMPLES" +What linker options do I need when I link with libnel? + + $ nel-config \-\-libs + +What compiler options do I need when I compile using libnel functions? + + $ nel-config \-\-cflags + +What's the installed libnel version? + + $ nel-config \-\-version +.SH AUTHOR +.PP +This manual page was written by G\[:u]rkan Seng\[:u]n +,for the Debian project (but may be used by others). diff --git a/dist/debian/xenial/debian/nel-tools.install b/dist/debian/xenial/debian/nel-tools.install new file mode 100644 index 000000000..4ca03208c --- /dev/null +++ b/dist/debian/xenial/debian/nel-tools.install @@ -0,0 +1,87 @@ +etc/nel/build_ig_boxes.cfg +etc/nel/build_indoor_rbank.cfg +etc/nel/build_rbank.cfg +etc/nel/make_sheet_id.cfg +etc/nel/words_dic.cfg +etc/nel/zviewer.cfg +usr/bin/animation_set_builder +usr/bin/anim_builder +usr/bin/bnp_make +usr/bin/build_clod_bank +usr/bin/build_clodtex +usr/bin/build_coarse_mesh +usr/bin/build_far_bank +usr/bin/build_ig_boxes +usr/bin/build_indoor_rbank +usr/bin/build_interface +usr/bin/build_rbank +usr/bin/build_samplebank +usr/bin/build_shadow_skin +usr/bin/build_smallbank +usr/bin/build_sound +usr/bin/build_soundbank +usr/bin/cluster_viewer +usr/bin/disp_sheet_id +usr/bin/extract_filename +usr/bin/file_info +usr/bin/georges2csv +usr/bin/get_neighbors +usr/bin/hls_bank_maker +usr/bin/ig_add +usr/bin/ig_info +usr/bin/ig_lighter +usr/bin/lock +usr/bin/make_sheet_id +usr/bin/memlog +usr/bin/message_box_qt +usr/bin/nl_probe_timers +usr/bin/nl_sample_chatclient +usr/bin/nl_sample_chatserver +usr/bin/nl_sample_clusterview +usr/bin/nl_sample_command +usr/bin/nl_sample_configfile +usr/bin/nl_sample_ct_ai_service +usr/bin/nl_sample_ct_gd_service +usr/bin/nl_sample_debug +usr/bin/nl_sample_font +usr/bin/nl_sample_georges +usr/bin/nl_sample_i18n +usr/bin/nl_sample_log +usr/bin/nl_sample_ls_client +usr/bin/nl_sample_ls_fes +usr/bin/nl_sample_pacs +usr/bin/nl_sample_shapeview +usr/bin/nl_sample_sound_sources +usr/bin/nl_sample_stream_file +usr/bin/nl_sample_stream_ogg_vorbis +usr/bin/nl_sample_strings +usr/bin/nl_sample_udpclient +usr/bin/nl_sample_udpserver +usr/bin/panoply_maker +usr/bin/shapes_exporter +usr/bin/tga2dds +usr/bin/tga_cut +usr/bin/tga_resize +usr/bin/tile_edit_qt +usr/bin/words_dic_qt +usr/bin/xml_packer +usr/bin/zone_check_bind +usr/bin/zone_dependencies +usr/bin/zone_dump +usr/bin/zone_ig_lighter +usr/bin/zone_lighter +usr/bin/zone_welder +usr/bin/zviewer +usr/lib/*/libs3tc_compressor.so.* +usr/share/nel/nl_sample_chat +usr/share/nel/nl_sample_class_transport +usr/share/nel/nl_sample_clusterview +usr/share/nel/nl_sample_configfile +usr/share/nel/nl_sample_font +usr/share/nel/nl_sample_georges +usr/share/nel/nl_sample_i18n +usr/share/nel/nl_sample_login_system +usr/share/nel/nl_sample_pacs +usr/share/nel/nl_sample_sound +usr/share/nel/nl_sample_udp +usr/share/nel/zviewer diff --git a/dist/debian/xenial/debian/rules b/dist/debian/xenial/debian/rules new file mode 100755 index 000000000..26ace8254 --- /dev/null +++ b/dist/debian/xenial/debian/rules @@ -0,0 +1,19 @@ +#!/usr/bin/make -f +%: + dh $@ --buildsystem=cmake --parallel + +override_dh_strip: + dh_strip -plibnel0 --dbg-package=libnel0-dbg + dh_strip -pnel-tools --dbg-package=nel-tools-dbg + dh_strip -plibryzom-sevenzip0 --dbg-package=libryzom-sevenzip0-dbg + dh_strip -plibryzom-gameshare0 --dbg-package=libryzom-gameshare0-dbg + dh_strip -plibryzom-clientsheets0 --dbg-package=libryzom-clientsheets0-dbg + dh_strip -pryzom-client --dbg-package=ryzom-client-dbg + dh_strip -pryzom-tools --dbg-package=ryzom-tools-dbg + +override_dh_auto_configure: + dh_auto_configure -- -DLIBRARY_ARCHITECTURE=$(DEB_HOST_MULTIARCH) -DTARGET_CPU=$(DEB_HOST_GNU_CPU) -DWITH_SYMBOLS=ON -DNL_ETC_PREFIX=/etc/nel -DRYZOM_ETC_PREFIX=/etc/ryzom -DRYZOM_SHARE_PREFIX=/usr/share/games/ryzom -DRYZOM_BIN_PREFIX=/usr/bin -DRYZOM_GAMES_PREFIX=/usr/games -DWITH_RYZOM_SERVER=OFF -DWITH_NEL_TESTS=OFF -DWITH_QT=ON + +override_dh_install: + dh_install + install -m755 debian/ryzom debian/ryzom-client/usr/games/ryzom diff --git a/dist/debian/xenial/debian/ryzom b/dist/debian/xenial/debian/ryzom new file mode 100755 index 000000000..79923e9e9 --- /dev/null +++ b/dist/debian/xenial/debian/ryzom @@ -0,0 +1,116 @@ +#!/bin/sh + +P7ZIP=/usr/bin/7z +RSYNC=/usr/bin/rsync +WGET=/usr/bin/wget +RYZOM_CLIENT=/usr/games/ryzom_client +RYZOM_CONFIG_DEFAULT=/etc/ryzom/client_default.cfg +RYZOM_CONFIG=~/.ryzom/client.cfg + +RYZOM_DIR=~/.ryzom +DATA_DIR=$RYZOM_DIR/data + +mkdir -p $RYZOM_DIR + +if [ ! -d "$DATA_DIR" ] +then + # symlink user's data dir to ryzom data cache + ln -s /var/cache/ryzom/data $DATA_DIR +fi + +# Check if a directory contains Ryzom data +ryzom_data_found() +{ + # Check for directory, gamedev.bnp and ryzom.ttf + COUNT=0 + + if [ -d $1 ] + then + # If there are a least 220 bnp files, we could use this directory + # There are 226 bnp files in last version + COUNT=$(find -L $1 -name *.bnp | wc -l) + fi + + echo $COUNT +} + +COUNT=$(ryzom_data_found $DATA_DIR) + +echo "Found $COUNT BNP files in $DATA_DIR" + +if [ $COUNT -lt 220 ] && [ -f $WGET ] && [ -f $P7ZIP ] +then + mkdir -p "$DATA_DIR/tmp" + + # Check free diskspace + echo "Checking for free disk space..." + DISKSPACE=$(df "$DATA_DIR/tmp" | grep "/dev" | awk '{print $4}') + if [ $? -ne 0 ] + then + exit 1 + fi + if [ "$DISKSPACE" -lt "8000000" ] + then + echo "You don't have enough free space to download and uncompress Ryzom client data." + exit 1 + fi + + # Download + echo "Downloading ryzom_client.7z from sourceforge..." + # wget + $WGET -c http://sourceforge.net/projects/ryzom/files/ryzom_client.7z -O "$DATA_DIR/tmp/ryzom_client.7z" + if [ $? -ne 0 ] + then + exit 1 + fi + + # Extract data + echo "Extracting data from ryzom_client.7z..." + cd "$DATA_DIR/tmp" + # 7z + $P7ZIP x ryzom_client.7z + if [ $? -ne 0 ] + then + exit 1 + fi + cd .. + mv -uf tmp/ryzom/data/* . + # Delete temporary downloaded files + rm -rf tmp +fi + +if [ -f $RYZOM_CONFIG ] +then + echo "Updating $RYZOM_CONFIG..." + + # Escape path for sed using bash find and replace + RYZOM_CONFIG_DEFAULT_ESCAPED=$(echo $RYZOM_CONFIG_DEFAULT | sed 's/\//\\\//g') + + # Update RootConfigFilename to be sure it's using the right default config + sed -i 's/RootConfigFilename.*/RootConfigFilename = \"'$RYZOM_CONFIG_DEFAULT_ESCAPED'\"/g' $RYZOM_CONFIG +fi + +if [ -f $RSYNC ] +then + echo "Patching Ryzom data..." + + # Rsync + $RSYNC -rOtzv --progress --stats www.ryzom.com::ryzom/data/ $DATA_DIR + if [ $? -ne 0 ] + then + exit 1 + fi +fi + +# Launch Ryzom client if it exists +if [ -f $RYZOM_CLIENT ] +then + echo "Launching Ryzom..." + + nohup $RYZOM_CLIENT $1 $2 $3 2> /dev/null & +fi + +# Wait until all previous commands are executed and displayed before exiting +sync + +exit 0 diff --git a/dist/debian/xenial/debian/ryzom-client-config.install b/dist/debian/xenial/debian/ryzom-client-config.install new file mode 100644 index 000000000..bef3f53dd --- /dev/null +++ b/dist/debian/xenial/debian/ryzom-client-config.install @@ -0,0 +1 @@ +debian/client_default.cfg etc/ryzom diff --git a/dist/debian/xenial/debian/ryzom-client.dirs b/dist/debian/xenial/debian/ryzom-client.dirs new file mode 100644 index 000000000..d1571095c --- /dev/null +++ b/dist/debian/xenial/debian/ryzom-client.dirs @@ -0,0 +1,4 @@ +usr/games +usr/share/applications +usr/share/pixmaps +var/cache/ryzom/data diff --git a/dist/debian/xenial/debian/ryzom-client.install b/dist/debian/xenial/debian/ryzom-client.install new file mode 100644 index 000000000..be142a6be --- /dev/null +++ b/dist/debian/xenial/debian/ryzom-client.install @@ -0,0 +1,4 @@ +usr/games/ryzom_client +usr/share/icons +usr/share/pixmaps +debian/ryzom_client.desktop usr/share/applications diff --git a/dist/debian/xenial/debian/ryzom-client.menu b/dist/debian/xenial/debian/ryzom-client.menu new file mode 100644 index 000000000..5e15bf577 --- /dev/null +++ b/dist/debian/xenial/debian/ryzom-client.menu @@ -0,0 +1,6 @@ +?package(ryzom-client): \ + needs="x11" \ + section="Games/Adventure" \ + icon="/usr/share/pixmaps/ryzom.xpm" \ + title="Ryzom" \ + command="/usr/games/ryzom" diff --git a/dist/debian/xenial/debian/ryzom-client.postinst b/dist/debian/xenial/debian/ryzom-client.postinst new file mode 100644 index 000000000..51570a3dc --- /dev/null +++ b/dist/debian/xenial/debian/ryzom-client.postinst @@ -0,0 +1,10 @@ +#!/bin/sh + +if ! getent group ryzom ; then + addgroup --system ryzom +fi + +chgrp -R ryzom /var/cache/ryzom/data +chmod -R g+wrxs /var/cache/ryzom/data + +#DEBHELPER# diff --git a/dist/debian/xenial/debian/ryzom-client.postrm b/dist/debian/xenial/debian/ryzom-client.postrm new file mode 100644 index 000000000..828871eb4 --- /dev/null +++ b/dist/debian/xenial/debian/ryzom-client.postrm @@ -0,0 +1,49 @@ +#! /bin/sh +# postrm script for ryzom-client +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' overwrit>r> +# for details, see /usr/share/doc/packaging-manual/ + +case "$1" in + purge) + + FILES=/home/* + + for f in $FILES + do + FOLDER="$f/.ryzom/data" + + if [ -d $FOLDER ] + then + rm -rf $FOLDER + echo "Deleting $FOLDER..." + fi + done + + ;; + + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + +esac + +#DEBHELPER# + +exit 0 diff --git a/dist/debian/xenial/debian/ryzom-tools.install b/dist/debian/xenial/debian/ryzom-tools.install new file mode 100644 index 000000000..c468e32d8 --- /dev/null +++ b/dist/debian/xenial/debian/ryzom-tools.install @@ -0,0 +1,26 @@ +usr/bin/7zDec +usr/bin/alias_synchronizer +usr/bin/assoc_mem +usr/bin/csv_transform +usr/bin/georges_editor_qt +usr/bin/icon_search +usr/bin/make_alias_file +usr/bin/make_anim_by_race +usr/bin/make_anim_melee_impact +usr/bin/mp_generator +usr/bin/named2csv +usr/bin/patch_gen +usr/bin/patch_gen_service +usr/bin/pd_parser +usr/bin/pdr_util +usr/bin/prim_export +usr/bin/ryzom_mission_compiler +usr/bin/sheets_packer +usr/bin/skill_extractor +usr/bin/stats_scan +usr/bin/translation_tools +usr/bin/uni_conv +usr/games/ryzom_client_patcher +usr/lib/*/libryzom_mission_compiler_lib.so.* +usr/share/games/ryzom/data_leveldesign +usr/share/games/ryzom/georges_editor_qt diff --git a/dist/debian/xenial/debian/ryzom_client.desktop b/dist/debian/xenial/debian/ryzom_client.desktop new file mode 100644 index 000000000..1c62d1b6a --- /dev/null +++ b/dist/debian/xenial/debian/ryzom_client.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Version=1.0 +Name=Ryzom +Name[ru]=Ризом +Type=Application +GenericName=ryzom_client +Exec=/usr/games/ryzom +Icon=ryzom_client +Terminal=true +Hidden=false +Categories=Game;RolePlaying; diff --git a/dist/debian/xenial/debian/source/format b/dist/debian/xenial/debian/source/format new file mode 100644 index 000000000..b9b023757 --- /dev/null +++ b/dist/debian/xenial/debian/source/format @@ -0,0 +1,2 @@ +1.0 + diff --git a/dist/debian/yaketty/debian/changelog b/dist/debian/yaketty/debian/changelog new file mode 100644 index 000000000..44f3e244e --- /dev/null +++ b/dist/debian/yaketty/debian/changelog @@ -0,0 +1,408 @@ +ryzom-core (0.8.2802~raring1) raring; urgency=low + + * New upstream release (revision 2802) + + -- Cédric OCHS Mon, 10 Dec 2012 11:12:17 +0100 + +ryzom-core (0.8.2786~raring1) raring; urgency=low + + * New upstream release (revision 2786) + + -- Cédric OCHS Fri, 07 Dec 2012 16:33:15 +0100 + +ryzom-core (0.8.2691~quantal1) quantal; urgency=low + + * New upstream release (revision 2691) + + -- Cédric OCHS Sun, 07 Oct 2012 09:46:56 +0200 + +ryzom-core (0.8.2682~quantal1) quantal; urgency=low + + * New upstream release (revision 2682) + + -- Cédric OCHS Wed, 03 Oct 2012 15:59:54 +0200 + +ryzom-core (0.8.2681~quantal2) quantal; urgency=low + + * New upstream release (revision 2681) + + -- Cédric OCHS Tue, 02 Oct 2012 17:42:23 +0200 + +ryzom-core (0.8.2681~quantal1) quantal; urgency=low + + * New upstream release (revision 2681) + + -- Cédric OCHS Tue, 02 Oct 2012 17:13:57 +0200 + +ryzom-core (0.8.2650~quantal2) quantal; urgency=low + + * New upstream release (revision 2650) + + -- Cédric OCHS Mon, 24 Sep 2012 22:06:37 +0200 + +ryzom-core (0.8.2650~quantal1) quantal; urgency=low + + * New upstream release (revision 2650) + + -- Cédric OCHS Mon, 24 Sep 2012 20:55:19 +0200 + +ryzom-core (0.8.2025~precise1) precise; urgency=low + + * New upstream release (revision 2025) + + -- Cédric OCHS Sat, 10 Mar 2012 22:23:49 +0100 + +ryzom-core (0.8.2024~precise1) precise; urgency=low + + * New upstream release (revision 2024) + + -- Cédric OCHS Sat, 10 Mar 2012 11:16:08 +0100 + +ryzom-core (0.8.1847~natty1) natty; urgency=low + + * New upstream release (revision 1847) + + -- Cédric OCHS Mon, 17 Oct 2011 09:33:45 +0200 + +ryzom-core (0.8.1847~natty0) natty; urgency=low + + * New upstream release (revision 1847) + + -- Cédric OCHS Sun, 16 Oct 2011 18:45:27 +0200 + +ryzom-core (0.8.1758~natty0) natty; urgency=low + + * New upstream release (revision 1758) + + -- Cédric OCHS Tue, 16 Aug 2011 09:02:55 +0200 + +ryzom-core (0.8.1752~natty0) natty; urgency=low + + * New upstream release (revision 1752) + + -- Cédric OCHS Sun, 14 Aug 2011 16:07:29 +0200 + +ryzom-core (0.8.1751~natty0) natty; urgency=low + + * New upstream release (revision 1751) + + -- Cédric OCHS Sun, 14 Aug 2011 14:16:24 +0200 + +ryzom-core (0.8.1750~natty0) natty; urgency=low + + * New upstream release (revision 1750) + + -- Cédric OCHS Sun, 14 Aug 2011 12:30:18 +0200 + +ryzom-core (0.8.1744~natty0) natty; urgency=low + + * New upstream release (revision 1744) + + -- Cédric OCHS Sat, 13 Aug 2011 20:24:49 +0200 + +ryzom-core (0.8.1742~natty0) natty; urgency=low + + * New upstream release (revision 1742) + + -- Cédric OCHS Fri, 12 Aug 2011 18:11:07 +0200 + +ryzom-core (0.8.1628~natty0) natty; urgency=low + + * New upstream release (revision 1628) + + -- Cédric OCHS Fri, 17 Jun 2011 12:56:17 +0200 + +ryzom-core (0.8.1627~natty0) natty; urgency=low + + * New upstream release (revision 1627) + + -- Cédric OCHS Tue, 14 Jun 2011 20:37:05 +0200 + +ryzom-core (0.8.1611~natty0) natty; urgency=low + + * New upstream release (revision 1611) + + -- Cédric OCHS Wed, 08 Jun 2011 19:53:44 +0200 + +ryzom-core (0.8.1596~natty1) natty; urgency=low + + * New upstream release (revision 1596) + + -- Cédric OCHS Sat, 04 Jun 2011 18:11:45 +0200 + +ryzom-core (0.7.1406~natty0) natty; urgency=low + + * New upstream release (revision 1406) + + -- Kervala Sun, 13 Mar 2011 19:07:44 +0100 + +ryzom-core (0.7.1404~karmic0) karmic; urgency=low + + * New upstream release (revision 1404) + + -- Kervala Thu, 10 Mar 2011 20:13:35 +0100 + +ryzom-core (0.7.1122~karmic0) karmic; urgency=low + + * New upstream release (revision 1122) + + -- Kervala Thu, 25 Nov 2010 13:18:41 +0100 + +ryzom-core (0.7.992~karmic0) karmic; urgency=low + + * New upstream release (revision 992) + + -- Kervala Tue, 19 Oct 2010 13:44:23 +0200 + +ryzom-core (0.7.941~karmic0) karmic; urgency=low + + * New upstream release (revision 941) + + -- Kervala Sat, 16 Oct 2010 14:59:36 +0200 + +ryzom-core (0.7.933~karmic0) karmic; urgency=low + + * New upstream release (revision 933) + + -- Kervala Fri, 15 Oct 2010 22:29:44 +0200 + +ryzom-core (0.7.932~karmic0) karmic; urgency=low + + * New upstream release (revision 932) + + -- Kervala Fri, 15 Oct 2010 19:53:47 +0200 + +ryzom-core (0.7.666~karmic0) karmic; urgency=low + + * New upstream release (revision 666) + + -- Kervala Sun, 29 Aug 2010 17:56:06 +0200 + +ryzom-core (0.7.631~karmic0) karmic; urgency=low + + * New upstream release (revision 631) + + -- Kervala Thu, 12 Aug 2010 16:57:30 +0200 + +ryzom-core (0.7.614~lucid1) lucid; urgency=low + + * Fixed dependencies + + -- Kervala Sun, 08 Aug 2010 22:42:50 +0200 + +ryzom-core (0.7.614~lucid0) lucid; urgency=low + + * New upstream release (revision 614) + + -- Kervala Sun, 08 Aug 2010 21:53:00 +0200 + +ryzom-core (0.7.583~lucid1) lucid; urgency=low + + * Added dependency on libogg and libvorbis + + -- Kervala Sun, 01 Aug 2010 15:38:40 +0200 + +ryzom-core (0.7.583~lucid0) lucid; urgency=low + + * New upstream release (revision 583) + + -- Kervala Sun, 01 Aug 2010 14:43:28 +0200 + +ryzom-core (0.7.530~lucid0) lucid; urgency=low + + * New upstream release (revision 530) + + -- Kervala Sun, 25 Jul 2010 16:50:57 +0200 + +ryzom-core (0.7.519~lucid0) lucid; urgency=low + + * New upstream release (revision 519) + + -- Kervala Mon, 19 Jul 2010 22:24:05 +0200 + +ryzom-core (0.7.507~lucid0) lucid; urgency=low + + * New upstream release (revision 507) + + -- Kervala Sat, 17 Jul 2010 19:56:35 +0200 + +ryzom-core (0.7.474~lucid0) lucid; urgency=low + + * New upstream release (revision 474) + + -- Kervala Tue, 13 Jul 2010 08:56:24 +0200 + +ryzom-core (0.7.473~lucid1) lucid; urgency=low + + * Some fixes + + -- Kervala Mon, 12 Jul 2010 22:46:16 +0200 + +ryzom-core (0.7.473~lucid0) lucid; urgency=low + + * New upstream release (revision 473) + + -- Kervala Mon, 12 Jul 2010 22:04:30 +0200 + +ryzom-core (0.7.437~lucid1) lucid; urgency=low + + * Fixed drivers installation + + -- Kervala Thu, 08 Jul 2010 08:54:02 +0200 + +ryzom-core (0.7.437~lucid0) lucid; urgency=low + + * New upstream release (revision 437) + + -- Kervala Thu, 01 Jul 2010 20:07:14 +0200 + +ryzom-core (0.7.419~lucid0) lucid; urgency=low + + * New upstream release (revision 419) + + -- Kervala Sat, 26 Jun 2010 18:58:36 +0200 + +ryzom-core (0.7.411~lucid0) lucid; urgency=low + + * New upstream release (revision 411) + + -- Kervala Sat, 26 Jun 2010 11:00:47 +0200 + +ryzom-core (0.7.404~lucid1) lucid; urgency=low + + * Fix OpenAL driver + + -- Kervala Thu, 24 Jun 2010 23:06:51 +0200 + +ryzom-core (0.7.404~lucid0) lucid; urgency=low + + * New upstream release (revision 404) + + -- Kervala Thu, 24 Jun 2010 22:17:36 +0200 + +ryzom-core (0.7.394~lucid0) lucid; urgency=low + + * New upstream release (revision 394) + + -- Kervala Tue, 22 Jun 2010 06:53:15 +0200 + +ryzom-core (0.7.375~lucid0) lucid; urgency=low + + * New upstream release (revision 375) + + -- Kervala Wed, 16 Jun 2010 12:46:51 +0200 + +ryzom-core (0.7.371~lucid0) lucid; urgency=low + + * New upstream release (revision 371) + + -- Kervala Mon, 14 Jun 2010 22:48:27 +0200 + +ryzom-core (0.7.359~lucid0) lucid; urgency=low + + * New upstream release (revision 359) + + -- Kervala Sun, 13 Jun 2010 21:31:29 +0200 + +ryzom-core (0.7.350~lucid1) lucid; urgency=low + + * Fixes problem with "copy" files + + -- Kervala Sun, 13 Jun 2010 10:36:30 +0200 + +ryzom-core (0.7.350~lucid0) lucid; urgency=low + + * New upstream release (revision 350) + + -- Kervala Sun, 13 Jun 2010 09:55:38 +0200 + +ryzom-core (0.7.332~lucid0) lucid; urgency=low + + * New upstream release (revision 332) + + -- Kervala Sat, 12 Jun 2010 09:09:21 +0200 + +ryzom-core (0.7.317~lucid0) lucid; urgency=low + + * New upstream release (revision 317) + + -- Kervala Thu, 10 Jun 2010 13:11:28 +0200 + +ryzom-core (0.7.315~lucid0) lucid; urgency=low + + * Fixed pkg-config installation again + + -- Kervala Thu, 10 Jun 2010 08:19:44 +0200 + +ryzom-core (0.7.311~lucid2) lucid; urgency=low + + * Fixed pkg-config files + + -- Kervala Wed, 09 Jun 2010 22:58:15 +0200 + +ryzom-core (0.7.311~lucid1) lucid; urgency=low + + * Fixed dependencies versions + + -- Kervala Wed, 09 Jun 2010 22:27:00 +0200 + +ryzom-core (0.7.311~lucid0) lucid; urgency=low + + * New upstream version (revision 311). + + -- Kervala Wed, 09 Jun 2010 21:15:42 +0200 + +ryzom-core (0.7.304~lucid0) lucid; urgency=low + + * New upstream version (revision 304). + + -- Kervala Wed, 09 Jun 2010 08:34:10 +0200 + +ryzom-core (0.7.0-1) unstable; urgency=low + + [ Gürkan Sengün ] + * New upstream version. (Closes: #553248) + * Updated build dependencies. + + [ Michal Čihař ] + * Convert to dh with cmake support. + * Bump standards to 3.8.4. + + [ Luboš Novák ] + * Change maintainer to 'Debian Games Team' + * ftbfs_gcc_4.5.path: Fix build with g++-4.5. (Closes: #565104) + * Converted direct changes in source to patches. + * Enable building CEGUI renderer. + * Add package libnel-doc with documentation. + * debian/control + + Changed priority of libnel-dbg to extra. + + Remove duplicate Section in libnel0. + + Update short descriptions. + + Replace obsolete package xlibmesa-gl-dev with libgl1-mesa-dev + in build-depends. + + Add libpng-dev to build-depends. + + Remove libalut-dev from build-depends. + + New homepage. + + Supported architectures are i386 and amd64. + * debian/libnel-dev.dirs + + Remove empty dir usr/lib/nel. + * debian/copyright + + Update redistribution licence from GPL to GPL-2. + * debian/rules + + Disable building unit test, samples and tools. + + -- Luboš Novák Tue, 30 Mar 2010 10:29:23 +0100 + +ryzom-core (0.5.0-1.1) unstable; urgency=low + + * Non-maintainer upload. + * Change Build-Depends: libstlport5.2-dev. (Closes: #521762) + + -- Torsten Werner Sun, 28 Jun 2009 11:54:05 +0200 + +ryzom-core (0.5.0-1) unstable; urgency=low + + * Initial release. (Closes: #448067) + + -- Gürkan Sengün Tue, 23 Oct 2007 12:56:45 +0200 + diff --git a/dist/debian/yaketty/debian/client_default.cfg b/dist/debian/yaketty/debian/client_default.cfg new file mode 100644 index 000000000..d09cbbb9c --- /dev/null +++ b/dist/debian/yaketty/debian/client_default.cfg @@ -0,0 +1,567 @@ +////////////////////////// +////////////////////////// +/// CLIENT CONFIG FILE /// +////////////////////////// +////////////////////////// + + +// If you set this variable to 1, your client.cfg will be overwritten when you quit the client. +// You will loose all the comments and identation in this file. +SaveConfig = 1; + +/////////////////// +// WINDOW CONFIG // +/////////////////// + +Driver3D="Auto"; // Valid values are "Auto" or "0", "OpengGL" or "1" & "Direct3D" or "2" + // "Auto" will choose the best suited driver depending on hardware +FullScreen = 0; +Width = 1024; +Height = 768; +PositionX = 0; +PositionY = 0; +Frequency = 60; +Depth = 32; +Sleep = -1; +ProcessPriority = 0; // -2 = idle, -1 = below normal, 0 = normal, 1 = above normal, 2 = high, 3 = real time +Contrast = 0.0; // -1.0 ~ 1.0 +Luminosity = 0.0; // -1.0 ~ 1.0 +Gamma = 0.0; // -1.0 ~ 1.0 +Contrast_min = -1.0; +Luminosity_min = -1.0; +Gamma_min = -1.0; +Contrast_max = 1.0; +Luminosity_max = 1.0; +Gamma_max = 1.0; + + +///////////// +// NETWORK // +///////////// + +Application = { "ryzom_live", "./client_ryzom_r.exe", "./" }; +BackgroundDownloader = 0; +PatchServer = "http://dl.ryzom.com/patch_live"; +SignUpURL = "http://www.ryzom.com/subscribe"; +StartupHost = "shard.ryzom.com:40916"; +StartupPage = "/login/r2_login.php"; +InstallStatsUrl = "http://shard.ryzom.com:50000/stats/stats.php"; +CreateAccountURL = "https://secure.ryzom.com/signup/from_client.php"; +InstallWebPage = "http://dl.ryzom.com/installer/"; + + +//////////////// +// INTERFACES // +//////////////// + +// the language to use as in ISO 639-2 +LanguageCode = "en"; // english + +XMLInputFile = "input_config_v3.xml"; + +XMLLoginInterfaceFiles = { + "login_config.xml", + "login_widgets.xml", + "login_main.xml", + "login_keys.xml", +}; + +XMLOutGameInterfaceFiles = { + "out_v2_config.xml", + "out_v2_widgets.xml", + "out_v2_connect.xml", + "out_v2_intro.xml", + "out_v2_select.xml", + "out_v2_appear.xml", + "out_v2_location.xml", + "out_v2_crash.xml", + "out_v2_hierarchy.xml", + "out_v2_keys.xml", +}; + +// The ligo primitive class file +LigoPrimitiveClass = "world_editor_classes.xml"; + +VerboseLog = 1; + +/////////// +// MOUSE // +/////////// +HardwareCursor = 1; + +CursorSpeed = 1.0; // In pixels per mickey +CursorSpeed_min = 0.5; +CursorSpeed_max = 2.0; + +CursorAcceleration = 40; // Threshold in mickey +CursorAcceleration_min = 20; +CursorAcceleration_max = 80; + +FreeLookSpeed = 0.004; // In radian per mickey +FreeLookSpeed_min = 0.0001; +FreeLookSpeed_max = 0.01; + +FreeLookAcceleration = 40; // Threshold in mickey +FreeLookAcceleration_min = 20; +FreeLookAcceleration_max = 80; + +FreeLookInverted = 0; +AutomaticCamera = 0; +DblClickMode = 1; +AutoEquipTool = 1; + +/////////////////// +// RENDER CONFIG // +/////////////////// + +// NB: thoses variables configure also the InGameConfigurator: +// _min and _max define the bounds +// _step defines the step (NB: take care of _min and _max!!) +// _ps0 is the LOW preset, _ps1 is the MEDIUM preset, _ps2 is the NORMAL Preset, and _ps3 is the HIGH one + + +// *** LANDSCAPE +LandscapeTileNear = 150.000000; +LandscapeTileNear_min = 20.000000; +LandscapeTileNear_max = 250.000000; +LandscapeTileNear_step = 10.0; +LandscapeTileNear_ps0 = 20.0; +LandscapeTileNear_ps1 = 100.0; +LandscapeTileNear_ps2 = 150.0; +LandscapeTileNear_ps3 = 200.0; + +// NB: threshold is inverted ULandscape::setThreshold(), to be more intelligible +LandscapeThreshold = 2000.0; +LandscapeThreshold_min = 100.0; // Low quality => 0.01 threshold +LandscapeThreshold_max = 4000.0; // High quality => 0.0005 threshold +LandscapeThreshold_step = 100.0; +LandscapeThreshold_ps0 = 100.0; +LandscapeThreshold_ps1 = 1000.0; +LandscapeThreshold_ps2 = 2000.0; +LandscapeThreshold_ps3 = 3000.0; + +Vision = 500.000000; +Vision_min = 200.000000; +Vision_max = 800.000000; +Vision_step = 100.000000; +Vision_ps0 = 200.0; +Vision_ps1 = 400.0; +Vision_ps2 = 500.0; +Vision_ps3 = 800.0; + +MicroVeget = 1; // Enable/Disable MicroVeget. +MicroVeget_ps0 = 0; +MicroVeget_ps1 = 1; +MicroVeget_ps2 = 1; +MicroVeget_ps3 = 1; + +MicroVegetDensity = 80.0; +MicroVegetDensity_min = 10.0; +MicroVegetDensity_max = 100.0; +MicroVegetDensity_step = 10.0; +MicroVegetDensity_ps0 = 10.0; // not used since disabled! +MicroVegetDensity_ps1 = 30.0; +MicroVegetDensity_ps2 = 80.0; +MicroVegetDensity_ps3 = 100.0; + + +// *** FX +FxNbMaxPoly = 20000; +FxNbMaxPoly_min = 2000; +FxNbMaxPoly_max = 50000; +FxNbMaxPoly_step= 2000; +FxNbMaxPoly_ps0 = 2000; +FxNbMaxPoly_ps1 = 10000; +FxNbMaxPoly_ps2 = 20000; +FxNbMaxPoly_ps3 = 50000; + +Cloud = 1; +Cloud_ps0 = 0 ; +Cloud_ps1 = 1 ; +Cloud_ps2 = 1 ; +Cloud_ps3 = 1 ; + +CloudQuality = 160.0; +CloudQuality_min = 80.0; +CloudQuality_max = 320.0; +CloudQuality_step = 20.0; +CloudQuality_ps0 = 80.0; // not used since disabled! +CloudQuality_ps1 = 80.0; +CloudQuality_ps2 = 160.0; +CloudQuality_ps3 = 320.0; + +CloudUpdate = 1; +CloudUpdate_min = 1; +CloudUpdate_max = 8; +CloudUpdate_step= 1; +CloudUpdate_ps0 = 1; // not used since disabled! +CloudUpdate_ps1 = 1; +CloudUpdate_ps2 = 1; +CloudUpdate_ps3 = 3; + +Shadows = 1; +Shadows_ps0 = 0; +Shadows_ps1 = 1; +Shadows_ps2 = 1; +Shadows_ps3 = 1; + +Bloom = 0; +Bloom_ps0 = 0; +Bloom_ps1 = 1; +Bloom_ps2 = 1; +Bloom_ps3 = 1; + +SquareBloom = 1; +SquareBloom_ps0 = 0; +SquareBloom_ps1 = 1; +SquareBloom_ps2 = 1; +SquareBloom_ps3 = 1; + +DensityBloom = 255.0; +DensityBloom_min = 0.0; +DensityBloom_max = 255.0; +DensityBloom_step = 1.0; +DensityBloom_ps0 = 255.0; +DensityBloom_ps1 = 255.0; +DensityBloom_ps2 = 255.0; +DensityBloom_ps3 = 255.0; + + +// *** CHARACTERS +SkinNbMaxPoly = 100000; +SkinNbMaxPoly_min = 5000; +SkinNbMaxPoly_max = 250000; +SkinNbMaxPoly_step = 5000; +SkinNbMaxPoly_ps0 = 10000; +SkinNbMaxPoly_ps1 = 70000; +SkinNbMaxPoly_ps2 = 100000; +SkinNbMaxPoly_ps3 = 200000; + +NbMaxSkeletonNotCLod = 125; +NbMaxSkeletonNotCLod_min = 5; +NbMaxSkeletonNotCLod_max = 255; +NbMaxSkeletonNotCLod_step = 5; +NbMaxSkeletonNotCLod_ps0 = 10; +NbMaxSkeletonNotCLod_ps1 = 50; +NbMaxSkeletonNotCLod_ps2 = 125; +NbMaxSkeletonNotCLod_ps3 = 255; + +CharacterFarClip = 200.0; +CharacterFarClip_min = 50.0; +CharacterFarClip_max = 500.0; +CharacterFarClip_step = 10.0; +CharacterFarClip_ps0 = 50.0; +CharacterFarClip_ps1 = 100.0; +CharacterFarClip_ps2 = 200.0; +CharacterFarClip_ps3 = 500.0; + +EnableRacialAnimation = 1; + +// *** MISC +// This is the actual aspect ratio of your screen (no relation with the resolution!!). Set 1.7777 if you got a 16/9 screen for instance +ScreenAspectRatio = 0.0; +ForceDXTC = 1; // Enable/Disable DXTC. +DivideTextureSizeBy2= 0; // Divide texture size +DisableVtxProgram = 0; // Disable Hardware Vertex Program. +DisableVtxAGP = 0; // Disable Hardware Vertex AGP. +DisableTextureShdr = 0; // Disable Hardware Texture Shader. +HDEntityTexture = 0; +HDTextureInstalled = 1; +WaitVBL = 0; // 0 or 1 to wait Vertical Sync. + +////////////////// +// GAME OPTIONS // +////////////////// +SelectWithRClick = 1; +DisplayWeapons = 1; +RotKeySpeedMax = 2.0; +RotKeySpeedMax_min = 1.0; +RotKeySpeedMax_max = 4.0; +RotKeySpeedMin = 1.0; +RotKeySpeedMin_min = 0.5; +RotKeySpeedMin_max = 2.0; +RotAccel = 3.0; +FollowOnAtk = 0; +AtkOnSelect = 0; +ZCPacsPrim = "gen_bt_col_ext.pacs_prim"; + +///////////////// +// PREFERENCES // +///////////////// +FPV = 0; // FPV(First Person View) : default is false (Third Person View). +CameraHeight = 2.2; // Camera Height (in meter) from the ground (for the Third Person View). +CameraDistance = 3.0; // Camera Distance(in meter) from the user (for the Third Person View). +CameraDistStep = 1.0; +CameraDistMin = 1.0; +CameraDistMax = 25.0; +CameraAccel = 5.0; +CameraSpeedMin = 2.0; +CameraSpeedMax = 100.0; +CameraResetSpeed = 10.0; // Speed in radian/s + +////////////////// +// SOUND CONFIG // +////////////////// +SoundForceSoftwareBuffer= 1; +SoundOn = 1; +UseEax = 0; + +MaxTrack = 32; +MaxTrack_min = 4; +MaxTrack_max = 32; +MaxTrack_step = 4; + +// This is the volume for "InGame" sound FXs +SoundSFXVolume = 1.0; +SoundSFXVolume_min = 0.0; +SoundSFXVolume_max = 1.0; +SoundSFXVolume_step = 0.001; + +// This is volume for "InGame" music. Does not affect the MP3 player +SoundGameMusicVolume = 0.5; +SoundGameMusicVolume_min = 0.0; +SoundGameMusicVolume_max = 1.0; +SoundGameMusicVolume_step = 0.001; + +// MISC +PreDataPath = { "user", "patch", "examples", "data/fonts", "data/gamedev.bnp" }; +DataPath = { "data" }; +NeedComputeVS = 0; + +NegFiltersDebug = {"Update DB", "Reading:", "Read Value :", "impulseCallBack", "CLIMPD:", "LNET" }; +NegFiltersInfo = { "CLIMPD:", "CPath::lookup" , "LNET" }; +NegFiltersWarning = { "'basics.Equipment Slot'.", "_usercolor.tga", "PACS" }; + +// Big screen shot +ScreenShotWidth = 0; +ScreenShotHeight = 0; +ScreenShotFullDetail = 1; // 1 to switch full detail mode for characters (both standard & big screenshots) + +// Read : "ID", "R G B A MODE [FX]" +SystemInfoColors = +{ +// OLD STUFF Here for compatibility +"RG", "0 0 0 255 normal", // Black to see when there is an error +"BC", "0 0 0 255 normal", // Black to see when there is an error +"JA", "0 0 0 255 normal", // Black to see when there is an error +"BL", "0 0 0 255 normal", // Black to see when there is an error +"VE", "0 0 0 255 normal", // Black to see when there is an error +"VI", "0 0 0 255 normal", // Black to see when there is an error + +// NEW System Info Categories +"SYS", "255 255 255 255 normal", // Default system messages +"BC", "255 255 255 255 centeraround", // Broadcast messages +"TAGBC", "255 255 255 255 centeraround", // Taged broadcast messages : color should remain white as some word are tagged +"XP", "255 255 64 255 over", // XP Gain +"SP", "255 255 64 255 over", // SP Gain +"TTL", "255 255 64 255 over", // Title +"TSK", "255 255 255 255 over", // Task +"ZON", "255 255 255 255 center", // Zone +"DG", "255 0 0 255 normal", // Damage to me +"DMG", "255 0 0 255 normal", // Damage to me +"DGP", "200 0 0 255 normal", // Damage to me from player +"DGM", "255 128 64 255 normal", // Damage from me +"MIS", "150 150 150 255 normal", // The opponent misses +"MISM", "255 255 255 255 normal", // I miss +"ITM", "0 200 0 255 over", // Item +"ITMO", "170 170 255 255 overonly", // Item other in group +"ITMF", "220 0 220 255 over", // Item failed +"SPL", "50 50 250 255 normal", // Spell to me +"SPLM", "50 150 250 255 normal", // Spell from me +"EMT", "255 150 150 255 normal", // Emote +"MTD", "255 255 0 255 over", // Message Of The Day +"FORLD","64 255 64 255 overonly", // Forage Locate Deposit +"CHK", "255 120 60 255 center", // Tous ce qui ne remplit pas une condition +"CHKCB","255 255 0 255 center", // Tous ce qui ne remplit pas une condition en combat (trop loin, cible invalide, pas assez de mana, etc.) +"PVPTM","255 120 60 255 overonly", // PVP timer +"THM", "255 255 64 255 over misc_levelup.ps", // Thema finished +"AMB", "255 255 64 255 center", // Ambiance +"ISE", "192 208 255 255 normal", // Item special effect +"ISE2", "192 208 255 255 center", // Item special effect with center text (for effects without flying text) +"OSM", "128 160 255 255 center", // Outpost state message +"AROUND","255 255 0 255 around", // Only in around channel +"R2_INVITE","0 255 0 255 around", // Ring invitation +}; + +PrintfCommands = { + "52", "15", "55 55 0 255", "28", "uiChapterV", "624", + "428", "0 0 0 255", "18", "", "624", "378", + "0 0 0 255", "14", "", "644", "278", "0 0 0 255", + "18", "", "52", "17", "255 255 255 255", "28", + "uiChapterV", "622", "430", "255 255 255 255", "18", "", + "622", "380", "255 255 255 255", "14", "", "642", + "280", "255 255 255 255", "18", "" +}; + +PrintfCommandsFreeTrial = { + "52", "15", "55 55 0 255", "28", "uiChapterV", "624", + "428", "0 0 0 255", "18", "", "624", "378", + "0 0 0 255", "14", "", "644", "278", "0 0 0 255", + "18", "", "52", "17", "255 255 255 255", "28", + "uiChapterV", "622", "430", "255 255 255 255", "18", "", + "622", "380", "255 255 255 255", "14", "", "642", + "280", "255 255 255 255", "18", "" +}; + +DisplayMissingAnimFile = 0; + +LoadingStringCount = 54; + + +// Some R2 parameters ... + +R2Mode = 1; +R2EDEnabled = 1; +R2EDExtendedDebug = 0; +R2EDLightPalette = 0; +R2ClientGw = "r2linux01"; +LoadLuaDebugger = 0; +CheckR2ScenarioMD5 = 1; +LevelDesignEnabled = 0; + +DmCameraDistMax = 25; +DmRun = 20; +DmWalk = 6; + +R2EDReloadFiles = { + "r2ed.xml", + "r2_basic_bricks.lua", + "r2_components.lua", + "r2_core.lua", + "r2_features_default.lua", + "r2_features_fauna.lua", + "r2_features_npc_groups.lua", + "r2_palette.lua", + "r2_scenario.lua", + "r2_ui.lua" +}; + +XMLInterfaceFiles = { + "config.xml", + "widgets.xml", + "webig_widgets.xml", + "player.xml", + "inventory.xml", + "interaction.xml", + "phrase.xml", + "harvest.xml", + "macros.xml", + "info_player.xml", + "outpost.xml", + "guild.xml", + "taskbar.xml", + "game_config.xml", + "game_context_menu.xml", + "player_trade.xml", + "bot_chat_v4.xml", + "compass.xml", + "map.xml", + "hierarchy.xml", + "reset.xml", + "actions.xml", + "help.xml", + "encyclopedia.xml", + "commands.xml", + "commands2.xml", + "ring_access_point_filter.xml", + "ring_window.xml", + "bg_downloader.xml" +}; + +XMLR2EDInterfaceFiles = +{ + "r2ed.xml", + "r2_triggers.xml", + "r2_logic_entities.xml", + "r2ed_acts.xml", + "r2ed_scenario.xml", + "r2ed_connect.xml" +}; + +FogDistAndDepthLookupBias = 20; // bias for lookup of fog distance and depth + + +// Hardware cursor textures +// These will be extracted from the corresponding packed ui .tga files when they are loaded +// * +// * individual .tga files for hardware cursor bitmap not looked for, and not supported yet +HardwareCursors = +{ + "curs_can_pan.tga", + "curs_can_pan_dup.tga", + "curs_create.tga", + "curs_create_multi.tga", + "curs_create_vertex_invalid.tga", + "curs_default.tga", + "curs_dup.tga", + "curs_L.tga", + "curs_M.tga", + "curs_pan.tga", + "curs_pan_dup.tga", + "curs_pick.tga", + "curs_pick_dup.tga", + "curs_R.tga", + "curs_resize_BL_TR.tga", + "curs_resize_BR_TL.tga", + "curs_resize_LR.tga", + "curs_resize_TB.tga", + "curs_rotate.tga", + "curs_scale.tga", + "curs_stop.tga", + "text_cursor.tga", + "r2_hand_can_pan.tga", + "r2_hand_pan.tga", + "r2ed_tool_can_pick.tga", + "r2ed_tool_can_rotate.tga", + "r2ed_tool_pick.tga", + "r2ed_tool_rotate.tga", + "r2ed_tool_rotating.tga" +}; + +Loading_BG = "new_loading_bg.tga"; // Default name for the loading background file. +Launch_BG = "new_launcher_bg.tga"; // Default name for the launch background file. +TeleportKami_BG = "new_teleport_kami_bg.tga"; +TeleportKaravan_BG = "new_teleport_caravan_bg.tga"; +Elevator_BG = "new_elevator_bg.tga"; // Default name for the loading background file. +ResurectKami_BG = "new_resurect_kami_bg.tga"; +ResurectKaravan_BG = "new_resurect_caravane_bg.tga"; +End_BG = "end_bg.tga"; // Default name for the last background file. + +ScenarioSavePath = "./my_scenarios/"; + +// list ofpredefined keyset +// name will be looked up in the translation file by searching 'uiCP_KeysetName_" + id +// tooltip will be looked up in the translation file by searching 'uiCP_KeysetTooltip_" + id +// 'bi.' stands for built-in +// note : we add a dot in the name to be sure that there cannot be a conflict with character keyset name +BuiltInKeySets = +{ + "", // default ryzom keyboard layout + "bi.zqsd", // european keyboard fps displacement style (NB : don't change this layout name, ryzom will automatically select it if keyboard is french or belgian) + "bi.wasd", // english keyboard fps displacement style (NB : don't change this layout name, ryzom will automatically select it if keyboard is not french nor belgian) + "bi.wow_alike" // 'world of warcraft' like keyboard style. (NB : not available for ring) +}; + +// "Newbie Training", "Story Telling", "Mistery", "Hack & Slash", "Guild Training", "Other" +ScenarioTypes = {"so_newbie_training","so_story_telling","so_mistery","so_hack_slash","so_guild_training","so_other"}; + +ScenarioLanguages = {"fr","de","en","other_lang"}; + +// Map each language to a forum help page +HelpPages = +{ + "fr=http://forums.ryzom.com/forum/showthread.php?t=29130", + "en=http://forums.ryzom.com/forum/showthread.php?t=29129", + "wk=http://forums.ryzom.com/forum/showthread.php?t=29129", + "de=http://forums.ryzom.com/forum/showthread.php?t=29131" +}; + +WebIgMainDomain = "app.ryzom.com"; +WebIgTrustedDomains = { + "api.ryzom.com", "app.ryzom.com" +}; +PatchletUrl = "http://app.ryzom.com/app_patchlet/index.php?patch=preload"; + +SelectedSlot = 0; + +BuildName = "RELEASE_HEAD"; diff --git a/dist/debian/yaketty/debian/compat b/dist/debian/yaketty/debian/compat new file mode 100644 index 000000000..ec635144f --- /dev/null +++ b/dist/debian/yaketty/debian/compat @@ -0,0 +1 @@ +9 diff --git a/dist/debian/yaketty/debian/control b/dist/debian/yaketty/debian/control new file mode 100644 index 000000000..225201b7b --- /dev/null +++ b/dist/debian/yaketty/debian/control @@ -0,0 +1,212 @@ +Source: ryzom-core +Priority: extra +Maintainer: Debian Games Team +Uploaders: Luboš Novák , Cédric OCHS +Build-Depends: debhelper (>= 9), cmake (>= 2.6), libxml2-dev, + libgl1-mesa-dev, libjpeg8-dev, libpng-dev, libopenal-dev, + libfreetype6-dev, libxxf86vm-dev, libxrandr-dev, libxrender-dev, + libvorbis-dev, libsquish-dev, libcurl4-openssl-dev, libluabind-dev, + libboost-dev, libmysqlclient-dev, libssl-dev, + libcpptest-dev, libqt4-dev, libqt4-opengl-dev +Standards-Version: 3.9.5 +Section: games +Bugs: https://bitbucket.org/ryzom/ryzomcore/issues +Homepage: https://bitbucket.org/ryzom/ryzomcore/ +Vcs-Hg: https://bitbucket.org/ryzom/ryzomcore +Vcs-Browser: https://bitbucket.org/ryzom/ryzomcore + +Package: libnel0 +Section: libdevel +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Massive multi-user 3D game environments library (shared library) + This is a software platform for creating and running massively multi-user + entertainment in a 3D environment over the Internet. + . + This 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 independent from + each other so you can use only the parts you really need in your project. + . + This package contains the shared library. + +Package: libnel-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Depends: ${misc:Depends}, libnel0 (= ${binary:Version}) +Description: Massive multi-user 3D game environments library (development files) + This is a software platform for creating and running massively multi-user + entertainment in a 3D environment over the Internet. + . + This 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 independent from + each other so you can use only the parts you really need in your project. + . + This package contains the headers. + +Package: libnel0-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, libnel0 (= ${binary:Version}) +Description: Massive multi-user 3D game environments library (debugging symbols) + This is a software platform for creating and running massively multi-user + entertainment in a 3D environment over the Internet. + . + This 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 independent from + each other so you can use only the parts you really need in your project. + . + This package contains the debugging symbols. + +Package: nel-tools +Section: devel +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends}, libnel0 (= ${binary:Version}) +Description: Massive multi-user 3D game environments library (tools) + This is a software platform for creating and running massively multi-user + entertainment in a 3D environment over the Internet. + . + This 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 independent from + each other so you can use only the parts you really need in your project. + . + This package contains the tools. + +Package: nel-tools-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, nel-tools (= ${binary:Version}) +Description: Massive multi-user 3D game environments library (tools debugging symbols) + This is a software platform for creating and running massively multi-user + entertainment in a 3D environment over the Internet. + . + This 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 independent from + each other so you can use only the parts you really need in your project. + . + This package contains the tools debugging symbols. + +Package: libryzom-sevenzip0 +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Ryzom science-fantasy MMORPG (decompression library) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the decompression shared library. + +Package: libryzom-sevenzip0-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, libryzom-sevenzip0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (decompression library debugging symbols) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the decompression shared library debugging symbols. + +Package: libryzom-gameshare0 +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends}, libnel0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (common shared library) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the game common shared library. + +Package: libryzom-gameshare0-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, libryzom-gameshare0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (common debugging symbols) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the game common debugging symbols. + +Package: libryzom-clientsheets0 +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends}, libryzom-gameshare0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (client sheets shared library) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the client sheets shared library. + +Package: libryzom-clientsheets0-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, libryzom-clientsheets0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (client sheets debugging symbols) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the client sheets debugging symbols. + +Package: ryzom-client +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends}, libryzom-gameshare0 (= ${binary:Version}), + libryzom-clientsheets0 (= ${binary:Version}), + ryzom-client-config (>= ${source:Version}), rsync, wget, p7zip-full +Description: Ryzom science-fantasy MMORPG (client) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the game client. + +Package: ryzom-client-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, ryzom-client (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (client debugging symbols) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the client debugging symbols. + +Package: ryzom-tools +Section: devel +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends}, libryzom-gameshare0 (= ${binary:Version}), + libryzom-clientsheets0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (tools) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the tools. + +Package: ryzom-tools-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, ryzom-tools (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (tools debugging symbols) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the tools debugging symbols. + +Package: ryzom-client-config +Architecture: all +Depends: ${misc:Depends} +Description: Ryzom science-fantasy MMORPG (client configuration) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the client configuration. diff --git a/dist/debian/yaketty/debian/copyright b/dist/debian/yaketty/debian/copyright new file mode 100644 index 000000000..d5a0f2f10 --- /dev/null +++ b/dist/debian/yaketty/debian/copyright @@ -0,0 +1,53 @@ +This package was debianized by Gürkan Sengün on +Tue, 23 Oct 2007 12:56:45 +0200. + +It was downloaded from + +Upstream Authors: + + Olivier Cado + Bertram Felgenhauer + Krzysztof Kotlenga + Henri Kuuste + Vianney Lecroart + Namine + Cédric Ochs + Guillaume Puzin + Matt Raykowski + Robert Timm + Titegus + Ulukyn + Robert Wetzel + Zorglor + TODO: take names from Ryzom credits + +Copyright: + + Copyright (C) 2003-2009 Vianney Lecroart + Copyright (C) 2003-2009 Matt Raykowski + Copyright (C) 2000-2006 Nevrax Ltd. + Copyright (C) 2006-2007 Gameforge France + Copyright (C) 2008-2010 Winch Gate Property Limited + +License: + + 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 . + +The Debian packaging is: + + Copyright (C) 2007 Gürkan Sengün + +and is licensed under the GPL version 2, +see `/usr/share/common-licenses/GPL-2'. + diff --git a/dist/debian/yaketty/debian/docs b/dist/debian/yaketty/debian/docs new file mode 100644 index 000000000..58e5e3e76 --- /dev/null +++ b/dist/debian/yaketty/debian/docs @@ -0,0 +1,2 @@ +changelog +README diff --git a/dist/debian/yaketty/debian/libnel-dev.docs b/dist/debian/yaketty/debian/libnel-dev.docs new file mode 100644 index 000000000..ba8894c15 --- /dev/null +++ b/dist/debian/yaketty/debian/libnel-dev.docs @@ -0,0 +1,2 @@ +README + diff --git a/dist/debian/yaketty/debian/libnel-dev.install b/dist/debian/yaketty/debian/libnel-dev.install new file mode 100644 index 000000000..9f9310cee --- /dev/null +++ b/dist/debian/yaketty/debian/libnel-dev.install @@ -0,0 +1,3 @@ +usr/include/* +usr/lib/*/libnel*.so +usr/lib/*/pkgconfig/* diff --git a/dist/debian/yaketty/debian/libnel-dev.manpages b/dist/debian/yaketty/debian/libnel-dev.manpages new file mode 100644 index 000000000..bb4027ca9 --- /dev/null +++ b/dist/debian/yaketty/debian/libnel-dev.manpages @@ -0,0 +1 @@ +debian/nel-config.1 diff --git a/dist/debian/yaketty/debian/libnel-doc.doc-base.nel b/dist/debian/yaketty/debian/libnel-doc.doc-base.nel new file mode 100644 index 000000000..6ae95fc9f --- /dev/null +++ b/dist/debian/yaketty/debian/libnel-doc.doc-base.nel @@ -0,0 +1,9 @@ +Document: nel +Title: NeL Reference Manual +Author: Nevrax +Abstract: This is a software platform for creating and running massively multi-user entertainment in a 3D environment over the Internet. +Section: Programming/C + +Format: HTML +Index: /usr/share/doc/libnel-doc/html/index.html +Files: /usr/share/doc/libnel-doc/html/*.html diff --git a/dist/debian/yaketty/debian/libnel-doc.install b/dist/debian/yaketty/debian/libnel-doc.install new file mode 100644 index 000000000..bf3f02a61 --- /dev/null +++ b/dist/debian/yaketty/debian/libnel-doc.install @@ -0,0 +1 @@ +usr/share/doc/libnel-doc/html/* diff --git a/dist/debian/yaketty/debian/libnel0.install b/dist/debian/yaketty/debian/libnel0.install new file mode 100644 index 000000000..4273c0ad1 --- /dev/null +++ b/dist/debian/yaketty/debian/libnel0.install @@ -0,0 +1,3 @@ +usr/lib/*/libnel*.so.* +usr/lib/*/nel/libnel_drv_openal.so +usr/lib/*/nel/libnel_drv_opengl.so diff --git a/dist/debian/yaketty/debian/libryzom-clientsheets0.install b/dist/debian/yaketty/debian/libryzom-clientsheets0.install new file mode 100644 index 000000000..b5ea5b79c --- /dev/null +++ b/dist/debian/yaketty/debian/libryzom-clientsheets0.install @@ -0,0 +1,2 @@ +usr/lib/*/libryzom_clientsheets.so.* + diff --git a/dist/debian/yaketty/debian/libryzom-gameshare0.install b/dist/debian/yaketty/debian/libryzom-gameshare0.install new file mode 100644 index 000000000..2f51b0804 --- /dev/null +++ b/dist/debian/yaketty/debian/libryzom-gameshare0.install @@ -0,0 +1,2 @@ +usr/lib/*/libryzom_gameshare.so.* + diff --git a/dist/debian/yaketty/debian/libryzom-sevenzip0.install b/dist/debian/yaketty/debian/libryzom-sevenzip0.install new file mode 100644 index 000000000..1edced3f8 --- /dev/null +++ b/dist/debian/yaketty/debian/libryzom-sevenzip0.install @@ -0,0 +1,2 @@ +usr/lib/*/libryzom_sevenzip.so.* + diff --git a/dist/debian/yaketty/debian/nel-config.1 b/dist/debian/yaketty/debian/nel-config.1 new file mode 100644 index 000000000..be47bf496 --- /dev/null +++ b/dist/debian/yaketty/debian/nel-config.1 @@ -0,0 +1,37 @@ +.TH nel-config 1 "26 Oct 2007" +.SH NAME +nel-config \- Get information about a libnel installation +.SH SYNOPSIS +.B nel-config [options] +.SH DESCRIPTION +.B nel-config +displays information about a libnel installation. +.SH OPTIONS +.IP "--cflags" +Set of compiler options (CFLAGS) to use when compiling files that use +libnel. Currently that is only thw include path to the nel include files. +.IP "--libs" +Shows the complete set of libs and other linker options you will need in order +to link your application with libnel. +.IP "--prefix" +This is the prefix used when libnel was installed. libnel is then installed +in $prefix/lib and its header files are installed in $prefix/include and so +on. The prefix is set with "configure \-\-prefix". +.IP "--version" +Outputs version information about the installed libnel. +.SH "EXAMPLES" +What linker options do I need when I link with libnel? + + $ nel-config \-\-libs + +What compiler options do I need when I compile using libnel functions? + + $ nel-config \-\-cflags + +What's the installed libnel version? + + $ nel-config \-\-version +.SH AUTHOR +.PP +This manual page was written by G\[:u]rkan Seng\[:u]n +,for the Debian project (but may be used by others). diff --git a/dist/debian/yaketty/debian/nel-tools.install b/dist/debian/yaketty/debian/nel-tools.install new file mode 100644 index 000000000..4ca03208c --- /dev/null +++ b/dist/debian/yaketty/debian/nel-tools.install @@ -0,0 +1,87 @@ +etc/nel/build_ig_boxes.cfg +etc/nel/build_indoor_rbank.cfg +etc/nel/build_rbank.cfg +etc/nel/make_sheet_id.cfg +etc/nel/words_dic.cfg +etc/nel/zviewer.cfg +usr/bin/animation_set_builder +usr/bin/anim_builder +usr/bin/bnp_make +usr/bin/build_clod_bank +usr/bin/build_clodtex +usr/bin/build_coarse_mesh +usr/bin/build_far_bank +usr/bin/build_ig_boxes +usr/bin/build_indoor_rbank +usr/bin/build_interface +usr/bin/build_rbank +usr/bin/build_samplebank +usr/bin/build_shadow_skin +usr/bin/build_smallbank +usr/bin/build_sound +usr/bin/build_soundbank +usr/bin/cluster_viewer +usr/bin/disp_sheet_id +usr/bin/extract_filename +usr/bin/file_info +usr/bin/georges2csv +usr/bin/get_neighbors +usr/bin/hls_bank_maker +usr/bin/ig_add +usr/bin/ig_info +usr/bin/ig_lighter +usr/bin/lock +usr/bin/make_sheet_id +usr/bin/memlog +usr/bin/message_box_qt +usr/bin/nl_probe_timers +usr/bin/nl_sample_chatclient +usr/bin/nl_sample_chatserver +usr/bin/nl_sample_clusterview +usr/bin/nl_sample_command +usr/bin/nl_sample_configfile +usr/bin/nl_sample_ct_ai_service +usr/bin/nl_sample_ct_gd_service +usr/bin/nl_sample_debug +usr/bin/nl_sample_font +usr/bin/nl_sample_georges +usr/bin/nl_sample_i18n +usr/bin/nl_sample_log +usr/bin/nl_sample_ls_client +usr/bin/nl_sample_ls_fes +usr/bin/nl_sample_pacs +usr/bin/nl_sample_shapeview +usr/bin/nl_sample_sound_sources +usr/bin/nl_sample_stream_file +usr/bin/nl_sample_stream_ogg_vorbis +usr/bin/nl_sample_strings +usr/bin/nl_sample_udpclient +usr/bin/nl_sample_udpserver +usr/bin/panoply_maker +usr/bin/shapes_exporter +usr/bin/tga2dds +usr/bin/tga_cut +usr/bin/tga_resize +usr/bin/tile_edit_qt +usr/bin/words_dic_qt +usr/bin/xml_packer +usr/bin/zone_check_bind +usr/bin/zone_dependencies +usr/bin/zone_dump +usr/bin/zone_ig_lighter +usr/bin/zone_lighter +usr/bin/zone_welder +usr/bin/zviewer +usr/lib/*/libs3tc_compressor.so.* +usr/share/nel/nl_sample_chat +usr/share/nel/nl_sample_class_transport +usr/share/nel/nl_sample_clusterview +usr/share/nel/nl_sample_configfile +usr/share/nel/nl_sample_font +usr/share/nel/nl_sample_georges +usr/share/nel/nl_sample_i18n +usr/share/nel/nl_sample_login_system +usr/share/nel/nl_sample_pacs +usr/share/nel/nl_sample_sound +usr/share/nel/nl_sample_udp +usr/share/nel/zviewer diff --git a/dist/debian/yaketty/debian/rules b/dist/debian/yaketty/debian/rules new file mode 100644 index 000000000..26ace8254 --- /dev/null +++ b/dist/debian/yaketty/debian/rules @@ -0,0 +1,19 @@ +#!/usr/bin/make -f +%: + dh $@ --buildsystem=cmake --parallel + +override_dh_strip: + dh_strip -plibnel0 --dbg-package=libnel0-dbg + dh_strip -pnel-tools --dbg-package=nel-tools-dbg + dh_strip -plibryzom-sevenzip0 --dbg-package=libryzom-sevenzip0-dbg + dh_strip -plibryzom-gameshare0 --dbg-package=libryzom-gameshare0-dbg + dh_strip -plibryzom-clientsheets0 --dbg-package=libryzom-clientsheets0-dbg + dh_strip -pryzom-client --dbg-package=ryzom-client-dbg + dh_strip -pryzom-tools --dbg-package=ryzom-tools-dbg + +override_dh_auto_configure: + dh_auto_configure -- -DLIBRARY_ARCHITECTURE=$(DEB_HOST_MULTIARCH) -DTARGET_CPU=$(DEB_HOST_GNU_CPU) -DWITH_SYMBOLS=ON -DNL_ETC_PREFIX=/etc/nel -DRYZOM_ETC_PREFIX=/etc/ryzom -DRYZOM_SHARE_PREFIX=/usr/share/games/ryzom -DRYZOM_BIN_PREFIX=/usr/bin -DRYZOM_GAMES_PREFIX=/usr/games -DWITH_RYZOM_SERVER=OFF -DWITH_NEL_TESTS=OFF -DWITH_QT=ON + +override_dh_install: + dh_install + install -m755 debian/ryzom debian/ryzom-client/usr/games/ryzom diff --git a/dist/debian/yaketty/debian/ryzom b/dist/debian/yaketty/debian/ryzom new file mode 100644 index 000000000..79923e9e9 --- /dev/null +++ b/dist/debian/yaketty/debian/ryzom @@ -0,0 +1,116 @@ +#!/bin/sh + +P7ZIP=/usr/bin/7z +RSYNC=/usr/bin/rsync +WGET=/usr/bin/wget +RYZOM_CLIENT=/usr/games/ryzom_client +RYZOM_CONFIG_DEFAULT=/etc/ryzom/client_default.cfg +RYZOM_CONFIG=~/.ryzom/client.cfg + +RYZOM_DIR=~/.ryzom +DATA_DIR=$RYZOM_DIR/data + +mkdir -p $RYZOM_DIR + +if [ ! -d "$DATA_DIR" ] +then + # symlink user's data dir to ryzom data cache + ln -s /var/cache/ryzom/data $DATA_DIR +fi + +# Check if a directory contains Ryzom data +ryzom_data_found() +{ + # Check for directory, gamedev.bnp and ryzom.ttf + COUNT=0 + + if [ -d $1 ] + then + # If there are a least 220 bnp files, we could use this directory + # There are 226 bnp files in last version + COUNT=$(find -L $1 -name *.bnp | wc -l) + fi + + echo $COUNT +} + +COUNT=$(ryzom_data_found $DATA_DIR) + +echo "Found $COUNT BNP files in $DATA_DIR" + +if [ $COUNT -lt 220 ] && [ -f $WGET ] && [ -f $P7ZIP ] +then + mkdir -p "$DATA_DIR/tmp" + + # Check free diskspace + echo "Checking for free disk space..." + DISKSPACE=$(df "$DATA_DIR/tmp" | grep "/dev" | awk '{print $4}') + if [ $? -ne 0 ] + then + exit 1 + fi + if [ "$DISKSPACE" -lt "8000000" ] + then + echo "You don't have enough free space to download and uncompress Ryzom client data." + exit 1 + fi + + # Download + echo "Downloading ryzom_client.7z from sourceforge..." + # wget + $WGET -c http://sourceforge.net/projects/ryzom/files/ryzom_client.7z -O "$DATA_DIR/tmp/ryzom_client.7z" + if [ $? -ne 0 ] + then + exit 1 + fi + + # Extract data + echo "Extracting data from ryzom_client.7z..." + cd "$DATA_DIR/tmp" + # 7z + $P7ZIP x ryzom_client.7z + if [ $? -ne 0 ] + then + exit 1 + fi + cd .. + mv -uf tmp/ryzom/data/* . + # Delete temporary downloaded files + rm -rf tmp +fi + +if [ -f $RYZOM_CONFIG ] +then + echo "Updating $RYZOM_CONFIG..." + + # Escape path for sed using bash find and replace + RYZOM_CONFIG_DEFAULT_ESCAPED=$(echo $RYZOM_CONFIG_DEFAULT | sed 's/\//\\\//g') + + # Update RootConfigFilename to be sure it's using the right default config + sed -i 's/RootConfigFilename.*/RootConfigFilename = \"'$RYZOM_CONFIG_DEFAULT_ESCAPED'\"/g' $RYZOM_CONFIG +fi + +if [ -f $RSYNC ] +then + echo "Patching Ryzom data..." + + # Rsync + $RSYNC -rOtzv --progress --stats www.ryzom.com::ryzom/data/ $DATA_DIR + if [ $? -ne 0 ] + then + exit 1 + fi +fi + +# Launch Ryzom client if it exists +if [ -f $RYZOM_CLIENT ] +then + echo "Launching Ryzom..." + + nohup $RYZOM_CLIENT $1 $2 $3 2> /dev/null & +fi + +# Wait until all previous commands are executed and displayed before exiting +sync + +exit 0 diff --git a/dist/debian/yaketty/debian/ryzom-client-config.install b/dist/debian/yaketty/debian/ryzom-client-config.install new file mode 100644 index 000000000..bef3f53dd --- /dev/null +++ b/dist/debian/yaketty/debian/ryzom-client-config.install @@ -0,0 +1 @@ +debian/client_default.cfg etc/ryzom diff --git a/dist/debian/yaketty/debian/ryzom-client.dirs b/dist/debian/yaketty/debian/ryzom-client.dirs new file mode 100644 index 000000000..d1571095c --- /dev/null +++ b/dist/debian/yaketty/debian/ryzom-client.dirs @@ -0,0 +1,4 @@ +usr/games +usr/share/applications +usr/share/pixmaps +var/cache/ryzom/data diff --git a/dist/debian/yaketty/debian/ryzom-client.install b/dist/debian/yaketty/debian/ryzom-client.install new file mode 100644 index 000000000..be142a6be --- /dev/null +++ b/dist/debian/yaketty/debian/ryzom-client.install @@ -0,0 +1,4 @@ +usr/games/ryzom_client +usr/share/icons +usr/share/pixmaps +debian/ryzom_client.desktop usr/share/applications diff --git a/dist/debian/yaketty/debian/ryzom-client.menu b/dist/debian/yaketty/debian/ryzom-client.menu new file mode 100644 index 000000000..5e15bf577 --- /dev/null +++ b/dist/debian/yaketty/debian/ryzom-client.menu @@ -0,0 +1,6 @@ +?package(ryzom-client): \ + needs="x11" \ + section="Games/Adventure" \ + icon="/usr/share/pixmaps/ryzom.xpm" \ + title="Ryzom" \ + command="/usr/games/ryzom" diff --git a/dist/debian/yaketty/debian/ryzom-client.postinst b/dist/debian/yaketty/debian/ryzom-client.postinst new file mode 100644 index 000000000..51570a3dc --- /dev/null +++ b/dist/debian/yaketty/debian/ryzom-client.postinst @@ -0,0 +1,10 @@ +#!/bin/sh + +if ! getent group ryzom ; then + addgroup --system ryzom +fi + +chgrp -R ryzom /var/cache/ryzom/data +chmod -R g+wrxs /var/cache/ryzom/data + +#DEBHELPER# diff --git a/dist/debian/yaketty/debian/ryzom-client.postrm b/dist/debian/yaketty/debian/ryzom-client.postrm new file mode 100644 index 000000000..828871eb4 --- /dev/null +++ b/dist/debian/yaketty/debian/ryzom-client.postrm @@ -0,0 +1,49 @@ +#! /bin/sh +# postrm script for ryzom-client +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' overwrit>r> +# for details, see /usr/share/doc/packaging-manual/ + +case "$1" in + purge) + + FILES=/home/* + + for f in $FILES + do + FOLDER="$f/.ryzom/data" + + if [ -d $FOLDER ] + then + rm -rf $FOLDER + echo "Deleting $FOLDER..." + fi + done + + ;; + + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + +esac + +#DEBHELPER# + +exit 0 diff --git a/dist/debian/yaketty/debian/ryzom-tools.install b/dist/debian/yaketty/debian/ryzom-tools.install new file mode 100644 index 000000000..c468e32d8 --- /dev/null +++ b/dist/debian/yaketty/debian/ryzom-tools.install @@ -0,0 +1,26 @@ +usr/bin/7zDec +usr/bin/alias_synchronizer +usr/bin/assoc_mem +usr/bin/csv_transform +usr/bin/georges_editor_qt +usr/bin/icon_search +usr/bin/make_alias_file +usr/bin/make_anim_by_race +usr/bin/make_anim_melee_impact +usr/bin/mp_generator +usr/bin/named2csv +usr/bin/patch_gen +usr/bin/patch_gen_service +usr/bin/pd_parser +usr/bin/pdr_util +usr/bin/prim_export +usr/bin/ryzom_mission_compiler +usr/bin/sheets_packer +usr/bin/skill_extractor +usr/bin/stats_scan +usr/bin/translation_tools +usr/bin/uni_conv +usr/games/ryzom_client_patcher +usr/lib/*/libryzom_mission_compiler_lib.so.* +usr/share/games/ryzom/data_leveldesign +usr/share/games/ryzom/georges_editor_qt diff --git a/dist/debian/yaketty/debian/ryzom_client.desktop b/dist/debian/yaketty/debian/ryzom_client.desktop new file mode 100644 index 000000000..1c62d1b6a --- /dev/null +++ b/dist/debian/yaketty/debian/ryzom_client.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Version=1.0 +Name=Ryzom +Name[ru]=Ризом +Type=Application +GenericName=ryzom_client +Exec=/usr/games/ryzom +Icon=ryzom_client +Terminal=true +Hidden=false +Categories=Game;RolePlaying; diff --git a/dist/debian/yaketty/debian/source/format b/dist/debian/yaketty/debian/source/format new file mode 100644 index 000000000..b9b023757 --- /dev/null +++ b/dist/debian/yaketty/debian/source/format @@ -0,0 +1,2 @@ +1.0 + diff --git a/dist/debian/zesty/debian/changelog b/dist/debian/zesty/debian/changelog new file mode 100644 index 000000000..44f3e244e --- /dev/null +++ b/dist/debian/zesty/debian/changelog @@ -0,0 +1,408 @@ +ryzom-core (0.8.2802~raring1) raring; urgency=low + + * New upstream release (revision 2802) + + -- Cédric OCHS Mon, 10 Dec 2012 11:12:17 +0100 + +ryzom-core (0.8.2786~raring1) raring; urgency=low + + * New upstream release (revision 2786) + + -- Cédric OCHS Fri, 07 Dec 2012 16:33:15 +0100 + +ryzom-core (0.8.2691~quantal1) quantal; urgency=low + + * New upstream release (revision 2691) + + -- Cédric OCHS Sun, 07 Oct 2012 09:46:56 +0200 + +ryzom-core (0.8.2682~quantal1) quantal; urgency=low + + * New upstream release (revision 2682) + + -- Cédric OCHS Wed, 03 Oct 2012 15:59:54 +0200 + +ryzom-core (0.8.2681~quantal2) quantal; urgency=low + + * New upstream release (revision 2681) + + -- Cédric OCHS Tue, 02 Oct 2012 17:42:23 +0200 + +ryzom-core (0.8.2681~quantal1) quantal; urgency=low + + * New upstream release (revision 2681) + + -- Cédric OCHS Tue, 02 Oct 2012 17:13:57 +0200 + +ryzom-core (0.8.2650~quantal2) quantal; urgency=low + + * New upstream release (revision 2650) + + -- Cédric OCHS Mon, 24 Sep 2012 22:06:37 +0200 + +ryzom-core (0.8.2650~quantal1) quantal; urgency=low + + * New upstream release (revision 2650) + + -- Cédric OCHS Mon, 24 Sep 2012 20:55:19 +0200 + +ryzom-core (0.8.2025~precise1) precise; urgency=low + + * New upstream release (revision 2025) + + -- Cédric OCHS Sat, 10 Mar 2012 22:23:49 +0100 + +ryzom-core (0.8.2024~precise1) precise; urgency=low + + * New upstream release (revision 2024) + + -- Cédric OCHS Sat, 10 Mar 2012 11:16:08 +0100 + +ryzom-core (0.8.1847~natty1) natty; urgency=low + + * New upstream release (revision 1847) + + -- Cédric OCHS Mon, 17 Oct 2011 09:33:45 +0200 + +ryzom-core (0.8.1847~natty0) natty; urgency=low + + * New upstream release (revision 1847) + + -- Cédric OCHS Sun, 16 Oct 2011 18:45:27 +0200 + +ryzom-core (0.8.1758~natty0) natty; urgency=low + + * New upstream release (revision 1758) + + -- Cédric OCHS Tue, 16 Aug 2011 09:02:55 +0200 + +ryzom-core (0.8.1752~natty0) natty; urgency=low + + * New upstream release (revision 1752) + + -- Cédric OCHS Sun, 14 Aug 2011 16:07:29 +0200 + +ryzom-core (0.8.1751~natty0) natty; urgency=low + + * New upstream release (revision 1751) + + -- Cédric OCHS Sun, 14 Aug 2011 14:16:24 +0200 + +ryzom-core (0.8.1750~natty0) natty; urgency=low + + * New upstream release (revision 1750) + + -- Cédric OCHS Sun, 14 Aug 2011 12:30:18 +0200 + +ryzom-core (0.8.1744~natty0) natty; urgency=low + + * New upstream release (revision 1744) + + -- Cédric OCHS Sat, 13 Aug 2011 20:24:49 +0200 + +ryzom-core (0.8.1742~natty0) natty; urgency=low + + * New upstream release (revision 1742) + + -- Cédric OCHS Fri, 12 Aug 2011 18:11:07 +0200 + +ryzom-core (0.8.1628~natty0) natty; urgency=low + + * New upstream release (revision 1628) + + -- Cédric OCHS Fri, 17 Jun 2011 12:56:17 +0200 + +ryzom-core (0.8.1627~natty0) natty; urgency=low + + * New upstream release (revision 1627) + + -- Cédric OCHS Tue, 14 Jun 2011 20:37:05 +0200 + +ryzom-core (0.8.1611~natty0) natty; urgency=low + + * New upstream release (revision 1611) + + -- Cédric OCHS Wed, 08 Jun 2011 19:53:44 +0200 + +ryzom-core (0.8.1596~natty1) natty; urgency=low + + * New upstream release (revision 1596) + + -- Cédric OCHS Sat, 04 Jun 2011 18:11:45 +0200 + +ryzom-core (0.7.1406~natty0) natty; urgency=low + + * New upstream release (revision 1406) + + -- Kervala Sun, 13 Mar 2011 19:07:44 +0100 + +ryzom-core (0.7.1404~karmic0) karmic; urgency=low + + * New upstream release (revision 1404) + + -- Kervala Thu, 10 Mar 2011 20:13:35 +0100 + +ryzom-core (0.7.1122~karmic0) karmic; urgency=low + + * New upstream release (revision 1122) + + -- Kervala Thu, 25 Nov 2010 13:18:41 +0100 + +ryzom-core (0.7.992~karmic0) karmic; urgency=low + + * New upstream release (revision 992) + + -- Kervala Tue, 19 Oct 2010 13:44:23 +0200 + +ryzom-core (0.7.941~karmic0) karmic; urgency=low + + * New upstream release (revision 941) + + -- Kervala Sat, 16 Oct 2010 14:59:36 +0200 + +ryzom-core (0.7.933~karmic0) karmic; urgency=low + + * New upstream release (revision 933) + + -- Kervala Fri, 15 Oct 2010 22:29:44 +0200 + +ryzom-core (0.7.932~karmic0) karmic; urgency=low + + * New upstream release (revision 932) + + -- Kervala Fri, 15 Oct 2010 19:53:47 +0200 + +ryzom-core (0.7.666~karmic0) karmic; urgency=low + + * New upstream release (revision 666) + + -- Kervala Sun, 29 Aug 2010 17:56:06 +0200 + +ryzom-core (0.7.631~karmic0) karmic; urgency=low + + * New upstream release (revision 631) + + -- Kervala Thu, 12 Aug 2010 16:57:30 +0200 + +ryzom-core (0.7.614~lucid1) lucid; urgency=low + + * Fixed dependencies + + -- Kervala Sun, 08 Aug 2010 22:42:50 +0200 + +ryzom-core (0.7.614~lucid0) lucid; urgency=low + + * New upstream release (revision 614) + + -- Kervala Sun, 08 Aug 2010 21:53:00 +0200 + +ryzom-core (0.7.583~lucid1) lucid; urgency=low + + * Added dependency on libogg and libvorbis + + -- Kervala Sun, 01 Aug 2010 15:38:40 +0200 + +ryzom-core (0.7.583~lucid0) lucid; urgency=low + + * New upstream release (revision 583) + + -- Kervala Sun, 01 Aug 2010 14:43:28 +0200 + +ryzom-core (0.7.530~lucid0) lucid; urgency=low + + * New upstream release (revision 530) + + -- Kervala Sun, 25 Jul 2010 16:50:57 +0200 + +ryzom-core (0.7.519~lucid0) lucid; urgency=low + + * New upstream release (revision 519) + + -- Kervala Mon, 19 Jul 2010 22:24:05 +0200 + +ryzom-core (0.7.507~lucid0) lucid; urgency=low + + * New upstream release (revision 507) + + -- Kervala Sat, 17 Jul 2010 19:56:35 +0200 + +ryzom-core (0.7.474~lucid0) lucid; urgency=low + + * New upstream release (revision 474) + + -- Kervala Tue, 13 Jul 2010 08:56:24 +0200 + +ryzom-core (0.7.473~lucid1) lucid; urgency=low + + * Some fixes + + -- Kervala Mon, 12 Jul 2010 22:46:16 +0200 + +ryzom-core (0.7.473~lucid0) lucid; urgency=low + + * New upstream release (revision 473) + + -- Kervala Mon, 12 Jul 2010 22:04:30 +0200 + +ryzom-core (0.7.437~lucid1) lucid; urgency=low + + * Fixed drivers installation + + -- Kervala Thu, 08 Jul 2010 08:54:02 +0200 + +ryzom-core (0.7.437~lucid0) lucid; urgency=low + + * New upstream release (revision 437) + + -- Kervala Thu, 01 Jul 2010 20:07:14 +0200 + +ryzom-core (0.7.419~lucid0) lucid; urgency=low + + * New upstream release (revision 419) + + -- Kervala Sat, 26 Jun 2010 18:58:36 +0200 + +ryzom-core (0.7.411~lucid0) lucid; urgency=low + + * New upstream release (revision 411) + + -- Kervala Sat, 26 Jun 2010 11:00:47 +0200 + +ryzom-core (0.7.404~lucid1) lucid; urgency=low + + * Fix OpenAL driver + + -- Kervala Thu, 24 Jun 2010 23:06:51 +0200 + +ryzom-core (0.7.404~lucid0) lucid; urgency=low + + * New upstream release (revision 404) + + -- Kervala Thu, 24 Jun 2010 22:17:36 +0200 + +ryzom-core (0.7.394~lucid0) lucid; urgency=low + + * New upstream release (revision 394) + + -- Kervala Tue, 22 Jun 2010 06:53:15 +0200 + +ryzom-core (0.7.375~lucid0) lucid; urgency=low + + * New upstream release (revision 375) + + -- Kervala Wed, 16 Jun 2010 12:46:51 +0200 + +ryzom-core (0.7.371~lucid0) lucid; urgency=low + + * New upstream release (revision 371) + + -- Kervala Mon, 14 Jun 2010 22:48:27 +0200 + +ryzom-core (0.7.359~lucid0) lucid; urgency=low + + * New upstream release (revision 359) + + -- Kervala Sun, 13 Jun 2010 21:31:29 +0200 + +ryzom-core (0.7.350~lucid1) lucid; urgency=low + + * Fixes problem with "copy" files + + -- Kervala Sun, 13 Jun 2010 10:36:30 +0200 + +ryzom-core (0.7.350~lucid0) lucid; urgency=low + + * New upstream release (revision 350) + + -- Kervala Sun, 13 Jun 2010 09:55:38 +0200 + +ryzom-core (0.7.332~lucid0) lucid; urgency=low + + * New upstream release (revision 332) + + -- Kervala Sat, 12 Jun 2010 09:09:21 +0200 + +ryzom-core (0.7.317~lucid0) lucid; urgency=low + + * New upstream release (revision 317) + + -- Kervala Thu, 10 Jun 2010 13:11:28 +0200 + +ryzom-core (0.7.315~lucid0) lucid; urgency=low + + * Fixed pkg-config installation again + + -- Kervala Thu, 10 Jun 2010 08:19:44 +0200 + +ryzom-core (0.7.311~lucid2) lucid; urgency=low + + * Fixed pkg-config files + + -- Kervala Wed, 09 Jun 2010 22:58:15 +0200 + +ryzom-core (0.7.311~lucid1) lucid; urgency=low + + * Fixed dependencies versions + + -- Kervala Wed, 09 Jun 2010 22:27:00 +0200 + +ryzom-core (0.7.311~lucid0) lucid; urgency=low + + * New upstream version (revision 311). + + -- Kervala Wed, 09 Jun 2010 21:15:42 +0200 + +ryzom-core (0.7.304~lucid0) lucid; urgency=low + + * New upstream version (revision 304). + + -- Kervala Wed, 09 Jun 2010 08:34:10 +0200 + +ryzom-core (0.7.0-1) unstable; urgency=low + + [ Gürkan Sengün ] + * New upstream version. (Closes: #553248) + * Updated build dependencies. + + [ Michal Čihař ] + * Convert to dh with cmake support. + * Bump standards to 3.8.4. + + [ Luboš Novák ] + * Change maintainer to 'Debian Games Team' + * ftbfs_gcc_4.5.path: Fix build with g++-4.5. (Closes: #565104) + * Converted direct changes in source to patches. + * Enable building CEGUI renderer. + * Add package libnel-doc with documentation. + * debian/control + + Changed priority of libnel-dbg to extra. + + Remove duplicate Section in libnel0. + + Update short descriptions. + + Replace obsolete package xlibmesa-gl-dev with libgl1-mesa-dev + in build-depends. + + Add libpng-dev to build-depends. + + Remove libalut-dev from build-depends. + + New homepage. + + Supported architectures are i386 and amd64. + * debian/libnel-dev.dirs + + Remove empty dir usr/lib/nel. + * debian/copyright + + Update redistribution licence from GPL to GPL-2. + * debian/rules + + Disable building unit test, samples and tools. + + -- Luboš Novák Tue, 30 Mar 2010 10:29:23 +0100 + +ryzom-core (0.5.0-1.1) unstable; urgency=low + + * Non-maintainer upload. + * Change Build-Depends: libstlport5.2-dev. (Closes: #521762) + + -- Torsten Werner Sun, 28 Jun 2009 11:54:05 +0200 + +ryzom-core (0.5.0-1) unstable; urgency=low + + * Initial release. (Closes: #448067) + + -- Gürkan Sengün Tue, 23 Oct 2007 12:56:45 +0200 + diff --git a/dist/debian/zesty/debian/client_default.cfg b/dist/debian/zesty/debian/client_default.cfg new file mode 100644 index 000000000..d09cbbb9c --- /dev/null +++ b/dist/debian/zesty/debian/client_default.cfg @@ -0,0 +1,567 @@ +////////////////////////// +////////////////////////// +/// CLIENT CONFIG FILE /// +////////////////////////// +////////////////////////// + + +// If you set this variable to 1, your client.cfg will be overwritten when you quit the client. +// You will loose all the comments and identation in this file. +SaveConfig = 1; + +/////////////////// +// WINDOW CONFIG // +/////////////////// + +Driver3D="Auto"; // Valid values are "Auto" or "0", "OpengGL" or "1" & "Direct3D" or "2" + // "Auto" will choose the best suited driver depending on hardware +FullScreen = 0; +Width = 1024; +Height = 768; +PositionX = 0; +PositionY = 0; +Frequency = 60; +Depth = 32; +Sleep = -1; +ProcessPriority = 0; // -2 = idle, -1 = below normal, 0 = normal, 1 = above normal, 2 = high, 3 = real time +Contrast = 0.0; // -1.0 ~ 1.0 +Luminosity = 0.0; // -1.0 ~ 1.0 +Gamma = 0.0; // -1.0 ~ 1.0 +Contrast_min = -1.0; +Luminosity_min = -1.0; +Gamma_min = -1.0; +Contrast_max = 1.0; +Luminosity_max = 1.0; +Gamma_max = 1.0; + + +///////////// +// NETWORK // +///////////// + +Application = { "ryzom_live", "./client_ryzom_r.exe", "./" }; +BackgroundDownloader = 0; +PatchServer = "http://dl.ryzom.com/patch_live"; +SignUpURL = "http://www.ryzom.com/subscribe"; +StartupHost = "shard.ryzom.com:40916"; +StartupPage = "/login/r2_login.php"; +InstallStatsUrl = "http://shard.ryzom.com:50000/stats/stats.php"; +CreateAccountURL = "https://secure.ryzom.com/signup/from_client.php"; +InstallWebPage = "http://dl.ryzom.com/installer/"; + + +//////////////// +// INTERFACES // +//////////////// + +// the language to use as in ISO 639-2 +LanguageCode = "en"; // english + +XMLInputFile = "input_config_v3.xml"; + +XMLLoginInterfaceFiles = { + "login_config.xml", + "login_widgets.xml", + "login_main.xml", + "login_keys.xml", +}; + +XMLOutGameInterfaceFiles = { + "out_v2_config.xml", + "out_v2_widgets.xml", + "out_v2_connect.xml", + "out_v2_intro.xml", + "out_v2_select.xml", + "out_v2_appear.xml", + "out_v2_location.xml", + "out_v2_crash.xml", + "out_v2_hierarchy.xml", + "out_v2_keys.xml", +}; + +// The ligo primitive class file +LigoPrimitiveClass = "world_editor_classes.xml"; + +VerboseLog = 1; + +/////////// +// MOUSE // +/////////// +HardwareCursor = 1; + +CursorSpeed = 1.0; // In pixels per mickey +CursorSpeed_min = 0.5; +CursorSpeed_max = 2.0; + +CursorAcceleration = 40; // Threshold in mickey +CursorAcceleration_min = 20; +CursorAcceleration_max = 80; + +FreeLookSpeed = 0.004; // In radian per mickey +FreeLookSpeed_min = 0.0001; +FreeLookSpeed_max = 0.01; + +FreeLookAcceleration = 40; // Threshold in mickey +FreeLookAcceleration_min = 20; +FreeLookAcceleration_max = 80; + +FreeLookInverted = 0; +AutomaticCamera = 0; +DblClickMode = 1; +AutoEquipTool = 1; + +/////////////////// +// RENDER CONFIG // +/////////////////// + +// NB: thoses variables configure also the InGameConfigurator: +// _min and _max define the bounds +// _step defines the step (NB: take care of _min and _max!!) +// _ps0 is the LOW preset, _ps1 is the MEDIUM preset, _ps2 is the NORMAL Preset, and _ps3 is the HIGH one + + +// *** LANDSCAPE +LandscapeTileNear = 150.000000; +LandscapeTileNear_min = 20.000000; +LandscapeTileNear_max = 250.000000; +LandscapeTileNear_step = 10.0; +LandscapeTileNear_ps0 = 20.0; +LandscapeTileNear_ps1 = 100.0; +LandscapeTileNear_ps2 = 150.0; +LandscapeTileNear_ps3 = 200.0; + +// NB: threshold is inverted ULandscape::setThreshold(), to be more intelligible +LandscapeThreshold = 2000.0; +LandscapeThreshold_min = 100.0; // Low quality => 0.01 threshold +LandscapeThreshold_max = 4000.0; // High quality => 0.0005 threshold +LandscapeThreshold_step = 100.0; +LandscapeThreshold_ps0 = 100.0; +LandscapeThreshold_ps1 = 1000.0; +LandscapeThreshold_ps2 = 2000.0; +LandscapeThreshold_ps3 = 3000.0; + +Vision = 500.000000; +Vision_min = 200.000000; +Vision_max = 800.000000; +Vision_step = 100.000000; +Vision_ps0 = 200.0; +Vision_ps1 = 400.0; +Vision_ps2 = 500.0; +Vision_ps3 = 800.0; + +MicroVeget = 1; // Enable/Disable MicroVeget. +MicroVeget_ps0 = 0; +MicroVeget_ps1 = 1; +MicroVeget_ps2 = 1; +MicroVeget_ps3 = 1; + +MicroVegetDensity = 80.0; +MicroVegetDensity_min = 10.0; +MicroVegetDensity_max = 100.0; +MicroVegetDensity_step = 10.0; +MicroVegetDensity_ps0 = 10.0; // not used since disabled! +MicroVegetDensity_ps1 = 30.0; +MicroVegetDensity_ps2 = 80.0; +MicroVegetDensity_ps3 = 100.0; + + +// *** FX +FxNbMaxPoly = 20000; +FxNbMaxPoly_min = 2000; +FxNbMaxPoly_max = 50000; +FxNbMaxPoly_step= 2000; +FxNbMaxPoly_ps0 = 2000; +FxNbMaxPoly_ps1 = 10000; +FxNbMaxPoly_ps2 = 20000; +FxNbMaxPoly_ps3 = 50000; + +Cloud = 1; +Cloud_ps0 = 0 ; +Cloud_ps1 = 1 ; +Cloud_ps2 = 1 ; +Cloud_ps3 = 1 ; + +CloudQuality = 160.0; +CloudQuality_min = 80.0; +CloudQuality_max = 320.0; +CloudQuality_step = 20.0; +CloudQuality_ps0 = 80.0; // not used since disabled! +CloudQuality_ps1 = 80.0; +CloudQuality_ps2 = 160.0; +CloudQuality_ps3 = 320.0; + +CloudUpdate = 1; +CloudUpdate_min = 1; +CloudUpdate_max = 8; +CloudUpdate_step= 1; +CloudUpdate_ps0 = 1; // not used since disabled! +CloudUpdate_ps1 = 1; +CloudUpdate_ps2 = 1; +CloudUpdate_ps3 = 3; + +Shadows = 1; +Shadows_ps0 = 0; +Shadows_ps1 = 1; +Shadows_ps2 = 1; +Shadows_ps3 = 1; + +Bloom = 0; +Bloom_ps0 = 0; +Bloom_ps1 = 1; +Bloom_ps2 = 1; +Bloom_ps3 = 1; + +SquareBloom = 1; +SquareBloom_ps0 = 0; +SquareBloom_ps1 = 1; +SquareBloom_ps2 = 1; +SquareBloom_ps3 = 1; + +DensityBloom = 255.0; +DensityBloom_min = 0.0; +DensityBloom_max = 255.0; +DensityBloom_step = 1.0; +DensityBloom_ps0 = 255.0; +DensityBloom_ps1 = 255.0; +DensityBloom_ps2 = 255.0; +DensityBloom_ps3 = 255.0; + + +// *** CHARACTERS +SkinNbMaxPoly = 100000; +SkinNbMaxPoly_min = 5000; +SkinNbMaxPoly_max = 250000; +SkinNbMaxPoly_step = 5000; +SkinNbMaxPoly_ps0 = 10000; +SkinNbMaxPoly_ps1 = 70000; +SkinNbMaxPoly_ps2 = 100000; +SkinNbMaxPoly_ps3 = 200000; + +NbMaxSkeletonNotCLod = 125; +NbMaxSkeletonNotCLod_min = 5; +NbMaxSkeletonNotCLod_max = 255; +NbMaxSkeletonNotCLod_step = 5; +NbMaxSkeletonNotCLod_ps0 = 10; +NbMaxSkeletonNotCLod_ps1 = 50; +NbMaxSkeletonNotCLod_ps2 = 125; +NbMaxSkeletonNotCLod_ps3 = 255; + +CharacterFarClip = 200.0; +CharacterFarClip_min = 50.0; +CharacterFarClip_max = 500.0; +CharacterFarClip_step = 10.0; +CharacterFarClip_ps0 = 50.0; +CharacterFarClip_ps1 = 100.0; +CharacterFarClip_ps2 = 200.0; +CharacterFarClip_ps3 = 500.0; + +EnableRacialAnimation = 1; + +// *** MISC +// This is the actual aspect ratio of your screen (no relation with the resolution!!). Set 1.7777 if you got a 16/9 screen for instance +ScreenAspectRatio = 0.0; +ForceDXTC = 1; // Enable/Disable DXTC. +DivideTextureSizeBy2= 0; // Divide texture size +DisableVtxProgram = 0; // Disable Hardware Vertex Program. +DisableVtxAGP = 0; // Disable Hardware Vertex AGP. +DisableTextureShdr = 0; // Disable Hardware Texture Shader. +HDEntityTexture = 0; +HDTextureInstalled = 1; +WaitVBL = 0; // 0 or 1 to wait Vertical Sync. + +////////////////// +// GAME OPTIONS // +////////////////// +SelectWithRClick = 1; +DisplayWeapons = 1; +RotKeySpeedMax = 2.0; +RotKeySpeedMax_min = 1.0; +RotKeySpeedMax_max = 4.0; +RotKeySpeedMin = 1.0; +RotKeySpeedMin_min = 0.5; +RotKeySpeedMin_max = 2.0; +RotAccel = 3.0; +FollowOnAtk = 0; +AtkOnSelect = 0; +ZCPacsPrim = "gen_bt_col_ext.pacs_prim"; + +///////////////// +// PREFERENCES // +///////////////// +FPV = 0; // FPV(First Person View) : default is false (Third Person View). +CameraHeight = 2.2; // Camera Height (in meter) from the ground (for the Third Person View). +CameraDistance = 3.0; // Camera Distance(in meter) from the user (for the Third Person View). +CameraDistStep = 1.0; +CameraDistMin = 1.0; +CameraDistMax = 25.0; +CameraAccel = 5.0; +CameraSpeedMin = 2.0; +CameraSpeedMax = 100.0; +CameraResetSpeed = 10.0; // Speed in radian/s + +////////////////// +// SOUND CONFIG // +////////////////// +SoundForceSoftwareBuffer= 1; +SoundOn = 1; +UseEax = 0; + +MaxTrack = 32; +MaxTrack_min = 4; +MaxTrack_max = 32; +MaxTrack_step = 4; + +// This is the volume for "InGame" sound FXs +SoundSFXVolume = 1.0; +SoundSFXVolume_min = 0.0; +SoundSFXVolume_max = 1.0; +SoundSFXVolume_step = 0.001; + +// This is volume for "InGame" music. Does not affect the MP3 player +SoundGameMusicVolume = 0.5; +SoundGameMusicVolume_min = 0.0; +SoundGameMusicVolume_max = 1.0; +SoundGameMusicVolume_step = 0.001; + +// MISC +PreDataPath = { "user", "patch", "examples", "data/fonts", "data/gamedev.bnp" }; +DataPath = { "data" }; +NeedComputeVS = 0; + +NegFiltersDebug = {"Update DB", "Reading:", "Read Value :", "impulseCallBack", "CLIMPD:", "LNET" }; +NegFiltersInfo = { "CLIMPD:", "CPath::lookup" , "LNET" }; +NegFiltersWarning = { "'basics.Equipment Slot'.", "_usercolor.tga", "PACS" }; + +// Big screen shot +ScreenShotWidth = 0; +ScreenShotHeight = 0; +ScreenShotFullDetail = 1; // 1 to switch full detail mode for characters (both standard & big screenshots) + +// Read : "ID", "R G B A MODE [FX]" +SystemInfoColors = +{ +// OLD STUFF Here for compatibility +"RG", "0 0 0 255 normal", // Black to see when there is an error +"BC", "0 0 0 255 normal", // Black to see when there is an error +"JA", "0 0 0 255 normal", // Black to see when there is an error +"BL", "0 0 0 255 normal", // Black to see when there is an error +"VE", "0 0 0 255 normal", // Black to see when there is an error +"VI", "0 0 0 255 normal", // Black to see when there is an error + +// NEW System Info Categories +"SYS", "255 255 255 255 normal", // Default system messages +"BC", "255 255 255 255 centeraround", // Broadcast messages +"TAGBC", "255 255 255 255 centeraround", // Taged broadcast messages : color should remain white as some word are tagged +"XP", "255 255 64 255 over", // XP Gain +"SP", "255 255 64 255 over", // SP Gain +"TTL", "255 255 64 255 over", // Title +"TSK", "255 255 255 255 over", // Task +"ZON", "255 255 255 255 center", // Zone +"DG", "255 0 0 255 normal", // Damage to me +"DMG", "255 0 0 255 normal", // Damage to me +"DGP", "200 0 0 255 normal", // Damage to me from player +"DGM", "255 128 64 255 normal", // Damage from me +"MIS", "150 150 150 255 normal", // The opponent misses +"MISM", "255 255 255 255 normal", // I miss +"ITM", "0 200 0 255 over", // Item +"ITMO", "170 170 255 255 overonly", // Item other in group +"ITMF", "220 0 220 255 over", // Item failed +"SPL", "50 50 250 255 normal", // Spell to me +"SPLM", "50 150 250 255 normal", // Spell from me +"EMT", "255 150 150 255 normal", // Emote +"MTD", "255 255 0 255 over", // Message Of The Day +"FORLD","64 255 64 255 overonly", // Forage Locate Deposit +"CHK", "255 120 60 255 center", // Tous ce qui ne remplit pas une condition +"CHKCB","255 255 0 255 center", // Tous ce qui ne remplit pas une condition en combat (trop loin, cible invalide, pas assez de mana, etc.) +"PVPTM","255 120 60 255 overonly", // PVP timer +"THM", "255 255 64 255 over misc_levelup.ps", // Thema finished +"AMB", "255 255 64 255 center", // Ambiance +"ISE", "192 208 255 255 normal", // Item special effect +"ISE2", "192 208 255 255 center", // Item special effect with center text (for effects without flying text) +"OSM", "128 160 255 255 center", // Outpost state message +"AROUND","255 255 0 255 around", // Only in around channel +"R2_INVITE","0 255 0 255 around", // Ring invitation +}; + +PrintfCommands = { + "52", "15", "55 55 0 255", "28", "uiChapterV", "624", + "428", "0 0 0 255", "18", "", "624", "378", + "0 0 0 255", "14", "", "644", "278", "0 0 0 255", + "18", "", "52", "17", "255 255 255 255", "28", + "uiChapterV", "622", "430", "255 255 255 255", "18", "", + "622", "380", "255 255 255 255", "14", "", "642", + "280", "255 255 255 255", "18", "" +}; + +PrintfCommandsFreeTrial = { + "52", "15", "55 55 0 255", "28", "uiChapterV", "624", + "428", "0 0 0 255", "18", "", "624", "378", + "0 0 0 255", "14", "", "644", "278", "0 0 0 255", + "18", "", "52", "17", "255 255 255 255", "28", + "uiChapterV", "622", "430", "255 255 255 255", "18", "", + "622", "380", "255 255 255 255", "14", "", "642", + "280", "255 255 255 255", "18", "" +}; + +DisplayMissingAnimFile = 0; + +LoadingStringCount = 54; + + +// Some R2 parameters ... + +R2Mode = 1; +R2EDEnabled = 1; +R2EDExtendedDebug = 0; +R2EDLightPalette = 0; +R2ClientGw = "r2linux01"; +LoadLuaDebugger = 0; +CheckR2ScenarioMD5 = 1; +LevelDesignEnabled = 0; + +DmCameraDistMax = 25; +DmRun = 20; +DmWalk = 6; + +R2EDReloadFiles = { + "r2ed.xml", + "r2_basic_bricks.lua", + "r2_components.lua", + "r2_core.lua", + "r2_features_default.lua", + "r2_features_fauna.lua", + "r2_features_npc_groups.lua", + "r2_palette.lua", + "r2_scenario.lua", + "r2_ui.lua" +}; + +XMLInterfaceFiles = { + "config.xml", + "widgets.xml", + "webig_widgets.xml", + "player.xml", + "inventory.xml", + "interaction.xml", + "phrase.xml", + "harvest.xml", + "macros.xml", + "info_player.xml", + "outpost.xml", + "guild.xml", + "taskbar.xml", + "game_config.xml", + "game_context_menu.xml", + "player_trade.xml", + "bot_chat_v4.xml", + "compass.xml", + "map.xml", + "hierarchy.xml", + "reset.xml", + "actions.xml", + "help.xml", + "encyclopedia.xml", + "commands.xml", + "commands2.xml", + "ring_access_point_filter.xml", + "ring_window.xml", + "bg_downloader.xml" +}; + +XMLR2EDInterfaceFiles = +{ + "r2ed.xml", + "r2_triggers.xml", + "r2_logic_entities.xml", + "r2ed_acts.xml", + "r2ed_scenario.xml", + "r2ed_connect.xml" +}; + +FogDistAndDepthLookupBias = 20; // bias for lookup of fog distance and depth + + +// Hardware cursor textures +// These will be extracted from the corresponding packed ui .tga files when they are loaded +// * +// * individual .tga files for hardware cursor bitmap not looked for, and not supported yet +HardwareCursors = +{ + "curs_can_pan.tga", + "curs_can_pan_dup.tga", + "curs_create.tga", + "curs_create_multi.tga", + "curs_create_vertex_invalid.tga", + "curs_default.tga", + "curs_dup.tga", + "curs_L.tga", + "curs_M.tga", + "curs_pan.tga", + "curs_pan_dup.tga", + "curs_pick.tga", + "curs_pick_dup.tga", + "curs_R.tga", + "curs_resize_BL_TR.tga", + "curs_resize_BR_TL.tga", + "curs_resize_LR.tga", + "curs_resize_TB.tga", + "curs_rotate.tga", + "curs_scale.tga", + "curs_stop.tga", + "text_cursor.tga", + "r2_hand_can_pan.tga", + "r2_hand_pan.tga", + "r2ed_tool_can_pick.tga", + "r2ed_tool_can_rotate.tga", + "r2ed_tool_pick.tga", + "r2ed_tool_rotate.tga", + "r2ed_tool_rotating.tga" +}; + +Loading_BG = "new_loading_bg.tga"; // Default name for the loading background file. +Launch_BG = "new_launcher_bg.tga"; // Default name for the launch background file. +TeleportKami_BG = "new_teleport_kami_bg.tga"; +TeleportKaravan_BG = "new_teleport_caravan_bg.tga"; +Elevator_BG = "new_elevator_bg.tga"; // Default name for the loading background file. +ResurectKami_BG = "new_resurect_kami_bg.tga"; +ResurectKaravan_BG = "new_resurect_caravane_bg.tga"; +End_BG = "end_bg.tga"; // Default name for the last background file. + +ScenarioSavePath = "./my_scenarios/"; + +// list ofpredefined keyset +// name will be looked up in the translation file by searching 'uiCP_KeysetName_" + id +// tooltip will be looked up in the translation file by searching 'uiCP_KeysetTooltip_" + id +// 'bi.' stands for built-in +// note : we add a dot in the name to be sure that there cannot be a conflict with character keyset name +BuiltInKeySets = +{ + "", // default ryzom keyboard layout + "bi.zqsd", // european keyboard fps displacement style (NB : don't change this layout name, ryzom will automatically select it if keyboard is french or belgian) + "bi.wasd", // english keyboard fps displacement style (NB : don't change this layout name, ryzom will automatically select it if keyboard is not french nor belgian) + "bi.wow_alike" // 'world of warcraft' like keyboard style. (NB : not available for ring) +}; + +// "Newbie Training", "Story Telling", "Mistery", "Hack & Slash", "Guild Training", "Other" +ScenarioTypes = {"so_newbie_training","so_story_telling","so_mistery","so_hack_slash","so_guild_training","so_other"}; + +ScenarioLanguages = {"fr","de","en","other_lang"}; + +// Map each language to a forum help page +HelpPages = +{ + "fr=http://forums.ryzom.com/forum/showthread.php?t=29130", + "en=http://forums.ryzom.com/forum/showthread.php?t=29129", + "wk=http://forums.ryzom.com/forum/showthread.php?t=29129", + "de=http://forums.ryzom.com/forum/showthread.php?t=29131" +}; + +WebIgMainDomain = "app.ryzom.com"; +WebIgTrustedDomains = { + "api.ryzom.com", "app.ryzom.com" +}; +PatchletUrl = "http://app.ryzom.com/app_patchlet/index.php?patch=preload"; + +SelectedSlot = 0; + +BuildName = "RELEASE_HEAD"; diff --git a/dist/debian/zesty/debian/compat b/dist/debian/zesty/debian/compat new file mode 100644 index 000000000..ec635144f --- /dev/null +++ b/dist/debian/zesty/debian/compat @@ -0,0 +1 @@ +9 diff --git a/dist/debian/zesty/debian/control b/dist/debian/zesty/debian/control new file mode 100644 index 000000000..86864a5aa --- /dev/null +++ b/dist/debian/zesty/debian/control @@ -0,0 +1,212 @@ +Source: ryzom-core +Priority: extra +Maintainer: Debian Games Team +Uploaders: Luboš Novák , Cédric OCHS +Build-Depends: debhelper (>= 9), cmake(>= 2.6), libxml2-dev, + libgl1-mesa-dev, libjpeg8-dev, libpng-dev, libopenal-dev, + libfreetype6-dev, libxxf86vm-dev, libxrandr-dev, libxrender-dev, + libvorbis-dev, libsquish-dev, libcurl4-openssl-dev, libluabind-dev, + libboost-dev, libmysqlclient-dev, libssl-dev, + libcpptest-dev, libqt4-dev, libqt4-opengl-dev +Standards-Version: 3.9.5 +Section: games +Bugs: https://bitbucket.org/ryzom/ryzomcore/issues +Homepage: https://bitbucket.org/ryzom/ryzomcore/ +Vcs-Hg: https://bitbucket.org/ryzom/ryzomcore +Vcs-Browser: https://bitbucket.org/ryzom/ryzomcore + +Package: libnel0 +Section: libdevel +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Massive multi-user 3D game environments library (shared library) + This is a software platform for creating and running massively multi-user + entertainment in a 3D environment over the Internet. + . + This 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 independent from + each other so you can use only the parts you really need in your project. + . + This package contains the shared library. + +Package: libnel-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Depends: ${misc:Depends}, libnel0 (= ${binary:Version}) +Description: Massive multi-user 3D game environments library (development files) + This is a software platform for creating and running massively multi-user + entertainment in a 3D environment over the Internet. + . + This 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 independent from + each other so you can use only the parts you really need in your project. + . + This package contains the headers. + +Package: libnel0-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, libnel0 (= ${binary:Version}) +Description: Massive multi-user 3D game environments library (debugging symbols) + This is a software platform for creating and running massively multi-user + entertainment in a 3D environment over the Internet. + . + This 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 independent from + each other so you can use only the parts you really need in your project. + . + This package contains the debugging symbols. + +Package: nel-tools +Section: devel +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends}, libnel0 (= ${binary:Version}) +Description: Massive multi-user 3D game environments library (tools) + This is a software platform for creating and running massively multi-user + entertainment in a 3D environment over the Internet. + . + This 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 independent from + each other so you can use only the parts you really need in your project. + . + This package contains the tools. + +Package: nel-tools-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, nel-tools (= ${binary:Version}) +Description: Massive multi-user 3D game environments library (tools debugging symbols) + This is a software platform for creating and running massively multi-user + entertainment in a 3D environment over the Internet. + . + This 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 independent from + each other so you can use only the parts you really need in your project. + . + This package contains the tools debugging symbols. + +Package: libryzom-sevenzip0 +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Ryzom science-fantasy MMORPG (decompression library) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the decompression shared library. + +Package: libryzom-sevenzip0-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, libryzom-sevenzip0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (decompression library debugging symbols) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the decompression shared library debugging symbols. + +Package: libryzom-gameshare0 +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends}, libnel0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (common shared library) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the game common shared library. + +Package: libryzom-gameshare0-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, libryzom-gameshare0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (common debugging symbols) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the game common debugging symbols. + +Package: libryzom-clientsheets0 +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends}, libryzom-gameshare0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (client sheets shared library) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the client sheets shared library. + +Package: libryzom-clientsheets0-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, libryzom-clientsheets0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (client sheets debugging symbols) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the client sheets debugging symbols. + +Package: ryzom-client +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends}, libryzom-gameshare0 (= ${binary:Version}), + libryzom-clientsheets0 (= ${binary:Version}), + ryzom-client-config (>= ${source:Version}), rsync, wget, p7zip-full +Description: Ryzom science-fantasy MMORPG (client) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the game client. + +Package: ryzom-client-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, ryzom-client (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (client debugging symbols) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the client debugging symbols. + +Package: ryzom-tools +Section: devel +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends}, libryzom-gameshare0 (= ${binary:Version}), + libryzom-clientsheets0 (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (tools) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the tools. + +Package: ryzom-tools-dbg +Section: debug +Architecture: any +Depends: ${misc:Depends}, ryzom-tools (= ${binary:Version}) +Description: Ryzom science-fantasy MMORPG (tools debugging symbols) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the tools debugging symbols. + +Package: ryzom-client-config +Architecture: all +Depends: ${misc:Depends} +Description: Ryzom science-fantasy MMORPG (client configuration) + Ryzom Core provides the base technologies and a set of development + methodologies for the development of both client and server code. + . + This package contains the client configuration. diff --git a/dist/debian/zesty/debian/copyright b/dist/debian/zesty/debian/copyright new file mode 100644 index 000000000..d5a0f2f10 --- /dev/null +++ b/dist/debian/zesty/debian/copyright @@ -0,0 +1,53 @@ +This package was debianized by Gürkan Sengün on +Tue, 23 Oct 2007 12:56:45 +0200. + +It was downloaded from + +Upstream Authors: + + Olivier Cado + Bertram Felgenhauer + Krzysztof Kotlenga + Henri Kuuste + Vianney Lecroart + Namine + Cédric Ochs + Guillaume Puzin + Matt Raykowski + Robert Timm + Titegus + Ulukyn + Robert Wetzel + Zorglor + TODO: take names from Ryzom credits + +Copyright: + + Copyright (C) 2003-2009 Vianney Lecroart + Copyright (C) 2003-2009 Matt Raykowski + Copyright (C) 2000-2006 Nevrax Ltd. + Copyright (C) 2006-2007 Gameforge France + Copyright (C) 2008-2010 Winch Gate Property Limited + +License: + + 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 . + +The Debian packaging is: + + Copyright (C) 2007 Gürkan Sengün + +and is licensed under the GPL version 2, +see `/usr/share/common-licenses/GPL-2'. + diff --git a/dist/debian/zesty/debian/docs b/dist/debian/zesty/debian/docs new file mode 100644 index 000000000..58e5e3e76 --- /dev/null +++ b/dist/debian/zesty/debian/docs @@ -0,0 +1,2 @@ +changelog +README diff --git a/dist/debian/zesty/debian/libnel-dev.docs b/dist/debian/zesty/debian/libnel-dev.docs new file mode 100644 index 000000000..ba8894c15 --- /dev/null +++ b/dist/debian/zesty/debian/libnel-dev.docs @@ -0,0 +1,2 @@ +README + diff --git a/dist/debian/zesty/debian/libnel-dev.install b/dist/debian/zesty/debian/libnel-dev.install new file mode 100644 index 000000000..9f9310cee --- /dev/null +++ b/dist/debian/zesty/debian/libnel-dev.install @@ -0,0 +1,3 @@ +usr/include/* +usr/lib/*/libnel*.so +usr/lib/*/pkgconfig/* diff --git a/dist/debian/zesty/debian/libnel-dev.manpages b/dist/debian/zesty/debian/libnel-dev.manpages new file mode 100644 index 000000000..bb4027ca9 --- /dev/null +++ b/dist/debian/zesty/debian/libnel-dev.manpages @@ -0,0 +1 @@ +debian/nel-config.1 diff --git a/dist/debian/zesty/debian/libnel-doc.doc-base.nel b/dist/debian/zesty/debian/libnel-doc.doc-base.nel new file mode 100644 index 000000000..6ae95fc9f --- /dev/null +++ b/dist/debian/zesty/debian/libnel-doc.doc-base.nel @@ -0,0 +1,9 @@ +Document: nel +Title: NeL Reference Manual +Author: Nevrax +Abstract: This is a software platform for creating and running massively multi-user entertainment in a 3D environment over the Internet. +Section: Programming/C + +Format: HTML +Index: /usr/share/doc/libnel-doc/html/index.html +Files: /usr/share/doc/libnel-doc/html/*.html diff --git a/dist/debian/zesty/debian/libnel-doc.install b/dist/debian/zesty/debian/libnel-doc.install new file mode 100644 index 000000000..bf3f02a61 --- /dev/null +++ b/dist/debian/zesty/debian/libnel-doc.install @@ -0,0 +1 @@ +usr/share/doc/libnel-doc/html/* diff --git a/dist/debian/zesty/debian/libnel0.install b/dist/debian/zesty/debian/libnel0.install new file mode 100644 index 000000000..4273c0ad1 --- /dev/null +++ b/dist/debian/zesty/debian/libnel0.install @@ -0,0 +1,3 @@ +usr/lib/*/libnel*.so.* +usr/lib/*/nel/libnel_drv_openal.so +usr/lib/*/nel/libnel_drv_opengl.so diff --git a/dist/debian/zesty/debian/libryzom-clientsheets0.install b/dist/debian/zesty/debian/libryzom-clientsheets0.install new file mode 100644 index 000000000..b5ea5b79c --- /dev/null +++ b/dist/debian/zesty/debian/libryzom-clientsheets0.install @@ -0,0 +1,2 @@ +usr/lib/*/libryzom_clientsheets.so.* + diff --git a/dist/debian/zesty/debian/libryzom-gameshare0.install b/dist/debian/zesty/debian/libryzom-gameshare0.install new file mode 100644 index 000000000..2f51b0804 --- /dev/null +++ b/dist/debian/zesty/debian/libryzom-gameshare0.install @@ -0,0 +1,2 @@ +usr/lib/*/libryzom_gameshare.so.* + diff --git a/dist/debian/zesty/debian/libryzom-sevenzip0.install b/dist/debian/zesty/debian/libryzom-sevenzip0.install new file mode 100644 index 000000000..1edced3f8 --- /dev/null +++ b/dist/debian/zesty/debian/libryzom-sevenzip0.install @@ -0,0 +1,2 @@ +usr/lib/*/libryzom_sevenzip.so.* + diff --git a/dist/debian/zesty/debian/nel-config.1 b/dist/debian/zesty/debian/nel-config.1 new file mode 100644 index 000000000..be47bf496 --- /dev/null +++ b/dist/debian/zesty/debian/nel-config.1 @@ -0,0 +1,37 @@ +.TH nel-config 1 "26 Oct 2007" +.SH NAME +nel-config \- Get information about a libnel installation +.SH SYNOPSIS +.B nel-config [options] +.SH DESCRIPTION +.B nel-config +displays information about a libnel installation. +.SH OPTIONS +.IP "--cflags" +Set of compiler options (CFLAGS) to use when compiling files that use +libnel. Currently that is only thw include path to the nel include files. +.IP "--libs" +Shows the complete set of libs and other linker options you will need in order +to link your application with libnel. +.IP "--prefix" +This is the prefix used when libnel was installed. libnel is then installed +in $prefix/lib and its header files are installed in $prefix/include and so +on. The prefix is set with "configure \-\-prefix". +.IP "--version" +Outputs version information about the installed libnel. +.SH "EXAMPLES" +What linker options do I need when I link with libnel? + + $ nel-config \-\-libs + +What compiler options do I need when I compile using libnel functions? + + $ nel-config \-\-cflags + +What's the installed libnel version? + + $ nel-config \-\-version +.SH AUTHOR +.PP +This manual page was written by G\[:u]rkan Seng\[:u]n +,for the Debian project (but may be used by others). diff --git a/dist/debian/zesty/debian/nel-tools.install b/dist/debian/zesty/debian/nel-tools.install new file mode 100644 index 000000000..4ca03208c --- /dev/null +++ b/dist/debian/zesty/debian/nel-tools.install @@ -0,0 +1,87 @@ +etc/nel/build_ig_boxes.cfg +etc/nel/build_indoor_rbank.cfg +etc/nel/build_rbank.cfg +etc/nel/make_sheet_id.cfg +etc/nel/words_dic.cfg +etc/nel/zviewer.cfg +usr/bin/animation_set_builder +usr/bin/anim_builder +usr/bin/bnp_make +usr/bin/build_clod_bank +usr/bin/build_clodtex +usr/bin/build_coarse_mesh +usr/bin/build_far_bank +usr/bin/build_ig_boxes +usr/bin/build_indoor_rbank +usr/bin/build_interface +usr/bin/build_rbank +usr/bin/build_samplebank +usr/bin/build_shadow_skin +usr/bin/build_smallbank +usr/bin/build_sound +usr/bin/build_soundbank +usr/bin/cluster_viewer +usr/bin/disp_sheet_id +usr/bin/extract_filename +usr/bin/file_info +usr/bin/georges2csv +usr/bin/get_neighbors +usr/bin/hls_bank_maker +usr/bin/ig_add +usr/bin/ig_info +usr/bin/ig_lighter +usr/bin/lock +usr/bin/make_sheet_id +usr/bin/memlog +usr/bin/message_box_qt +usr/bin/nl_probe_timers +usr/bin/nl_sample_chatclient +usr/bin/nl_sample_chatserver +usr/bin/nl_sample_clusterview +usr/bin/nl_sample_command +usr/bin/nl_sample_configfile +usr/bin/nl_sample_ct_ai_service +usr/bin/nl_sample_ct_gd_service +usr/bin/nl_sample_debug +usr/bin/nl_sample_font +usr/bin/nl_sample_georges +usr/bin/nl_sample_i18n +usr/bin/nl_sample_log +usr/bin/nl_sample_ls_client +usr/bin/nl_sample_ls_fes +usr/bin/nl_sample_pacs +usr/bin/nl_sample_shapeview +usr/bin/nl_sample_sound_sources +usr/bin/nl_sample_stream_file +usr/bin/nl_sample_stream_ogg_vorbis +usr/bin/nl_sample_strings +usr/bin/nl_sample_udpclient +usr/bin/nl_sample_udpserver +usr/bin/panoply_maker +usr/bin/shapes_exporter +usr/bin/tga2dds +usr/bin/tga_cut +usr/bin/tga_resize +usr/bin/tile_edit_qt +usr/bin/words_dic_qt +usr/bin/xml_packer +usr/bin/zone_check_bind +usr/bin/zone_dependencies +usr/bin/zone_dump +usr/bin/zone_ig_lighter +usr/bin/zone_lighter +usr/bin/zone_welder +usr/bin/zviewer +usr/lib/*/libs3tc_compressor.so.* +usr/share/nel/nl_sample_chat +usr/share/nel/nl_sample_class_transport +usr/share/nel/nl_sample_clusterview +usr/share/nel/nl_sample_configfile +usr/share/nel/nl_sample_font +usr/share/nel/nl_sample_georges +usr/share/nel/nl_sample_i18n +usr/share/nel/nl_sample_login_system +usr/share/nel/nl_sample_pacs +usr/share/nel/nl_sample_sound +usr/share/nel/nl_sample_udp +usr/share/nel/zviewer diff --git a/dist/debian/zesty/debian/rules b/dist/debian/zesty/debian/rules new file mode 100644 index 000000000..26ace8254 --- /dev/null +++ b/dist/debian/zesty/debian/rules @@ -0,0 +1,19 @@ +#!/usr/bin/make -f +%: + dh $@ --buildsystem=cmake --parallel + +override_dh_strip: + dh_strip -plibnel0 --dbg-package=libnel0-dbg + dh_strip -pnel-tools --dbg-package=nel-tools-dbg + dh_strip -plibryzom-sevenzip0 --dbg-package=libryzom-sevenzip0-dbg + dh_strip -plibryzom-gameshare0 --dbg-package=libryzom-gameshare0-dbg + dh_strip -plibryzom-clientsheets0 --dbg-package=libryzom-clientsheets0-dbg + dh_strip -pryzom-client --dbg-package=ryzom-client-dbg + dh_strip -pryzom-tools --dbg-package=ryzom-tools-dbg + +override_dh_auto_configure: + dh_auto_configure -- -DLIBRARY_ARCHITECTURE=$(DEB_HOST_MULTIARCH) -DTARGET_CPU=$(DEB_HOST_GNU_CPU) -DWITH_SYMBOLS=ON -DNL_ETC_PREFIX=/etc/nel -DRYZOM_ETC_PREFIX=/etc/ryzom -DRYZOM_SHARE_PREFIX=/usr/share/games/ryzom -DRYZOM_BIN_PREFIX=/usr/bin -DRYZOM_GAMES_PREFIX=/usr/games -DWITH_RYZOM_SERVER=OFF -DWITH_NEL_TESTS=OFF -DWITH_QT=ON + +override_dh_install: + dh_install + install -m755 debian/ryzom debian/ryzom-client/usr/games/ryzom diff --git a/dist/debian/zesty/debian/ryzom b/dist/debian/zesty/debian/ryzom new file mode 100644 index 000000000..79923e9e9 --- /dev/null +++ b/dist/debian/zesty/debian/ryzom @@ -0,0 +1,116 @@ +#!/bin/sh + +P7ZIP=/usr/bin/7z +RSYNC=/usr/bin/rsync +WGET=/usr/bin/wget +RYZOM_CLIENT=/usr/games/ryzom_client +RYZOM_CONFIG_DEFAULT=/etc/ryzom/client_default.cfg +RYZOM_CONFIG=~/.ryzom/client.cfg + +RYZOM_DIR=~/.ryzom +DATA_DIR=$RYZOM_DIR/data + +mkdir -p $RYZOM_DIR + +if [ ! -d "$DATA_DIR" ] +then + # symlink user's data dir to ryzom data cache + ln -s /var/cache/ryzom/data $DATA_DIR +fi + +# Check if a directory contains Ryzom data +ryzom_data_found() +{ + # Check for directory, gamedev.bnp and ryzom.ttf + COUNT=0 + + if [ -d $1 ] + then + # If there are a least 220 bnp files, we could use this directory + # There are 226 bnp files in last version + COUNT=$(find -L $1 -name *.bnp | wc -l) + fi + + echo $COUNT +} + +COUNT=$(ryzom_data_found $DATA_DIR) + +echo "Found $COUNT BNP files in $DATA_DIR" + +if [ $COUNT -lt 220 ] && [ -f $WGET ] && [ -f $P7ZIP ] +then + mkdir -p "$DATA_DIR/tmp" + + # Check free diskspace + echo "Checking for free disk space..." + DISKSPACE=$(df "$DATA_DIR/tmp" | grep "/dev" | awk '{print $4}') + if [ $? -ne 0 ] + then + exit 1 + fi + if [ "$DISKSPACE" -lt "8000000" ] + then + echo "You don't have enough free space to download and uncompress Ryzom client data." + exit 1 + fi + + # Download + echo "Downloading ryzom_client.7z from sourceforge..." + # wget + $WGET -c http://sourceforge.net/projects/ryzom/files/ryzom_client.7z -O "$DATA_DIR/tmp/ryzom_client.7z" + if [ $? -ne 0 ] + then + exit 1 + fi + + # Extract data + echo "Extracting data from ryzom_client.7z..." + cd "$DATA_DIR/tmp" + # 7z + $P7ZIP x ryzom_client.7z + if [ $? -ne 0 ] + then + exit 1 + fi + cd .. + mv -uf tmp/ryzom/data/* . + # Delete temporary downloaded files + rm -rf tmp +fi + +if [ -f $RYZOM_CONFIG ] +then + echo "Updating $RYZOM_CONFIG..." + + # Escape path for sed using bash find and replace + RYZOM_CONFIG_DEFAULT_ESCAPED=$(echo $RYZOM_CONFIG_DEFAULT | sed 's/\//\\\//g') + + # Update RootConfigFilename to be sure it's using the right default config + sed -i 's/RootConfigFilename.*/RootConfigFilename = \"'$RYZOM_CONFIG_DEFAULT_ESCAPED'\"/g' $RYZOM_CONFIG +fi + +if [ -f $RSYNC ] +then + echo "Patching Ryzom data..." + + # Rsync + $RSYNC -rOtzv --progress --stats www.ryzom.com::ryzom/data/ $DATA_DIR + if [ $? -ne 0 ] + then + exit 1 + fi +fi + +# Launch Ryzom client if it exists +if [ -f $RYZOM_CLIENT ] +then + echo "Launching Ryzom..." + + nohup $RYZOM_CLIENT $1 $2 $3 2> /dev/null & +fi + +# Wait until all previous commands are executed and displayed before exiting +sync + +exit 0 diff --git a/dist/debian/zesty/debian/ryzom-client-config.install b/dist/debian/zesty/debian/ryzom-client-config.install new file mode 100644 index 000000000..bef3f53dd --- /dev/null +++ b/dist/debian/zesty/debian/ryzom-client-config.install @@ -0,0 +1 @@ +debian/client_default.cfg etc/ryzom diff --git a/dist/debian/zesty/debian/ryzom-client.dirs b/dist/debian/zesty/debian/ryzom-client.dirs new file mode 100644 index 000000000..d1571095c --- /dev/null +++ b/dist/debian/zesty/debian/ryzom-client.dirs @@ -0,0 +1,4 @@ +usr/games +usr/share/applications +usr/share/pixmaps +var/cache/ryzom/data diff --git a/dist/debian/zesty/debian/ryzom-client.install b/dist/debian/zesty/debian/ryzom-client.install new file mode 100644 index 000000000..be142a6be --- /dev/null +++ b/dist/debian/zesty/debian/ryzom-client.install @@ -0,0 +1,4 @@ +usr/games/ryzom_client +usr/share/icons +usr/share/pixmaps +debian/ryzom_client.desktop usr/share/applications diff --git a/dist/debian/zesty/debian/ryzom-client.menu b/dist/debian/zesty/debian/ryzom-client.menu new file mode 100644 index 000000000..5e15bf577 --- /dev/null +++ b/dist/debian/zesty/debian/ryzom-client.menu @@ -0,0 +1,6 @@ +?package(ryzom-client): \ + needs="x11" \ + section="Games/Adventure" \ + icon="/usr/share/pixmaps/ryzom.xpm" \ + title="Ryzom" \ + command="/usr/games/ryzom" diff --git a/dist/debian/zesty/debian/ryzom-client.postinst b/dist/debian/zesty/debian/ryzom-client.postinst new file mode 100644 index 000000000..51570a3dc --- /dev/null +++ b/dist/debian/zesty/debian/ryzom-client.postinst @@ -0,0 +1,10 @@ +#!/bin/sh + +if ! getent group ryzom ; then + addgroup --system ryzom +fi + +chgrp -R ryzom /var/cache/ryzom/data +chmod -R g+wrxs /var/cache/ryzom/data + +#DEBHELPER# diff --git a/dist/debian/zesty/debian/ryzom-client.postrm b/dist/debian/zesty/debian/ryzom-client.postrm new file mode 100644 index 000000000..828871eb4 --- /dev/null +++ b/dist/debian/zesty/debian/ryzom-client.postrm @@ -0,0 +1,49 @@ +#! /bin/sh +# postrm script for ryzom-client +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' overwrit>r> +# for details, see /usr/share/doc/packaging-manual/ + +case "$1" in + purge) + + FILES=/home/* + + for f in $FILES + do + FOLDER="$f/.ryzom/data" + + if [ -d $FOLDER ] + then + rm -rf $FOLDER + echo "Deleting $FOLDER..." + fi + done + + ;; + + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + +esac + +#DEBHELPER# + +exit 0 diff --git a/dist/debian/zesty/debian/ryzom-tools.install b/dist/debian/zesty/debian/ryzom-tools.install new file mode 100644 index 000000000..c468e32d8 --- /dev/null +++ b/dist/debian/zesty/debian/ryzom-tools.install @@ -0,0 +1,26 @@ +usr/bin/7zDec +usr/bin/alias_synchronizer +usr/bin/assoc_mem +usr/bin/csv_transform +usr/bin/georges_editor_qt +usr/bin/icon_search +usr/bin/make_alias_file +usr/bin/make_anim_by_race +usr/bin/make_anim_melee_impact +usr/bin/mp_generator +usr/bin/named2csv +usr/bin/patch_gen +usr/bin/patch_gen_service +usr/bin/pd_parser +usr/bin/pdr_util +usr/bin/prim_export +usr/bin/ryzom_mission_compiler +usr/bin/sheets_packer +usr/bin/skill_extractor +usr/bin/stats_scan +usr/bin/translation_tools +usr/bin/uni_conv +usr/games/ryzom_client_patcher +usr/lib/*/libryzom_mission_compiler_lib.so.* +usr/share/games/ryzom/data_leveldesign +usr/share/games/ryzom/georges_editor_qt diff --git a/dist/debian/zesty/debian/ryzom_client.desktop b/dist/debian/zesty/debian/ryzom_client.desktop new file mode 100644 index 000000000..1c62d1b6a --- /dev/null +++ b/dist/debian/zesty/debian/ryzom_client.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Version=1.0 +Name=Ryzom +Name[ru]=Ризом +Type=Application +GenericName=ryzom_client +Exec=/usr/games/ryzom +Icon=ryzom_client +Terminal=true +Hidden=false +Categories=Game;RolePlaying; diff --git a/dist/debian/zesty/debian/source/format b/dist/debian/zesty/debian/source/format new file mode 100644 index 000000000..b9b023757 --- /dev/null +++ b/dist/debian/zesty/debian/source/format @@ -0,0 +1,2 @@ +1.0 + diff --git a/dist/snap/readme.txt b/dist/snap/readme.txt new file mode 100644 index 000000000..a2585a914 --- /dev/null +++ b/dist/snap/readme.txt @@ -0,0 +1,5 @@ +- to install snapcraft : sudo apt-get install snapcraft snapd +- to generate snap : snapcraft +- to clean build directory : snapcraft clean ryzom --step build +- to install a .snap : sudo snap install --dangerous +- to uninstall an installed .snap : sudo snap remove ryzom diff --git a/dist/snap/setup/gui/ryzom.desktop b/dist/snap/setup/gui/ryzom.desktop new file mode 100644 index 000000000..039a43d76 --- /dev/null +++ b/dist/snap/setup/gui/ryzom.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Version=1.0 +Name=Ryzom +Type=Application +GenericName=ryzom +Exec=ryzom.ryzom +Icon=${SNAP}/meta/gui/ryzom.png +Terminal=false +Hidden=false +Keywords=ryzom,mmorpg,game +Categories=Game;RolePlaying; diff --git a/dist/snap/setup/gui/ryzom.png b/dist/snap/setup/gui/ryzom.png new file mode 100644 index 000000000..a51ce87ab Binary files /dev/null and b/dist/snap/setup/gui/ryzom.png differ diff --git a/dist/snap/snapcraft.yaml b/dist/snap/snapcraft.yaml new file mode 100644 index 000000000..7c0bd1813 --- /dev/null +++ b/dist/snap/snapcraft.yaml @@ -0,0 +1,55 @@ +name: ryzom +version: "3.0.2" +summary: Ryzom science-fantasy MMORPG +description: | + Ryzom is a science-fantasy MMORPG. +grade: devel # stable +confinement: strict + +apps: + ryzom: + command: desktop-launch $SNAP/bin/ryzom_installer_qt + plugs: + - home + - unity7 + - x11 + - opengl + +parts: + ryzom: + source: ../../code + plugin: cmake + configflags: + - -DCMAKE_BUILD_TYPE=Release + - -DWITH_3D=OFF + - -DWITH_GUI=OFF + - -DWITH_NET=OFF + - -DWITH_PACS=OFF + - -DWITH_GEORGES=OFF + - -DWITH_LIGO=OFF + - -DWITH_LOGIC=OFF + - -DWITH_SOUND=OFF + - -DWITH_RYZOM_SERVER=OFF + - -DWITH_RYZOM_TOOLS=OFF + - -DWITH_RYZOM_CLIENT=OFF + - -DWITH_RYZOM_INSTALLER=ON + - -DWITH_NEL_TESTS=OFF + - -DWITH_NEL_TOOLS=OFF + - -DWITH_NEL_SAMPLES=OFF + - -DWITH_QT5=ON + - -DWITH_STATIC=ON + - -DWITH_INSTALL_LIBRARIES=OFF + - -DRYZOM_GAMES_PREFIX=bin + build-packages: + - zlib1g-dev + - libpng12-dev + - libjpeg8-dev + - qttools5-dev-tools + - libxml2-dev + - libssl-dev + - libqt5opengl5-dev + stage-packages: + - libqt5widgets5 + - libqt5opengl5 + after: [desktop-qt5] +