Merge branch 'ryzomcore' into feature/merge_ryzomcore171003

This commit is contained in:
compil 2017-10-14 19:23:02 +02:00
commit 98942e57b3
3365 changed files with 240399 additions and 179976 deletions

28
.hgeol Normal file
View file

@ -0,0 +1,28 @@
[patterns]
**.h = native
**.cpp = native
**/database.xml = BIN
**/msg.xml = BIN
**.txt = native
**.xml = native
**.layout = native
**.looknfeel = native
**.imageset = native
**.font = native
**.scheme = native
**.tpl = native
**.xsd = native
**.dox = native
**.py = native
**.lua = native
**.pkg = native
[repository]
native = LF

265
.hgignore Normal file
View file

@ -0,0 +1,265 @@
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 dir's
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

18
.hgtags Normal file
View file

@ -0,0 +1,18 @@
950d650ca92e6041611258d7e5131ccf661e4ec2 compatibility-merge
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
9d41f2994d44b9aad92b83f945f114e4b6bed44a ryzom-patch-3.0.2
4300cc14aad098b1f86ea4c55577b7fa4a4cb5d2 ryzom-patch-3.1.0
d4060f217f4f834cc62a33f2f1ccdf3c28298066 ryzom-patch-3.1.0-hotfix
043aaeb3d8a2a54177581b57bda87a9deaad510e ryzom-patch-3.1.0-april_patch
4036ecf59e83960f03acebc2089eb2ff5eeaed0a ryzom-patch-3.2.0
18403bb9485da3d9742c6f007a16d5619ebfb196 ryzom-patch-3.2.1

48
.travis.yml Normal file
View file

@ -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_LUA51=ON"
- 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}"

View file

@ -28,10 +28,6 @@ IF(COMMAND cmake_policy)
# have absolute paths (e.g. -lpthread) # have absolute paths (e.g. -lpthread)
cmake_policy(SET CMP0003 NEW) cmake_policy(SET CMP0003 NEW)
# Works around warnings about escaped quotes in ADD_DEFINITIONS
# statements
cmake_policy(SET CMP0005 OLD)
# allow to link to qtmain automatically under Windows # allow to link to qtmain automatically under Windows
IF(POLICY CMP0020) IF(POLICY CMP0020)
CMAKE_POLICY(SET CMP0020 NEW) CMAKE_POLICY(SET CMP0020 NEW)
@ -64,8 +60,8 @@ SET(YEAR "2004-${CURRENT_YEAR}")
SET(AUTHOR "Winch Gate and The Ryzom Core Community") SET(AUTHOR "Winch Gate and The Ryzom Core Community")
SET(RYZOM_VERSION_MAJOR 3) SET(RYZOM_VERSION_MAJOR 3)
SET(RYZOM_VERSION_MINOR 1) SET(RYZOM_VERSION_MINOR 2)
SET(RYZOM_VERSION_PATCH 0) SET(RYZOM_VERSION_PATCH 1)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Redirect output files # Redirect output files
@ -168,25 +164,30 @@ IF(WITH_SSE2)
ENDIF() ENDIF()
ENDIF() ENDIF()
IF(APPLE_CERTIFICATE) IF(APPLE)
# Find codesign_allocate FIND_LIBRARY(CARBON_FRAMEWORK Carbon)
FIND_LIBRARY(FOUNDATION_FRAMEWORK Foundation)
# Xcode 7.0 and later versions IF(APPLE_CERTIFICATE)
SET(CODESIGN_ALLOCATE ${OSX_DEVELOPER_ROOT}/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate) # Find codesign_allocate
IF(NOT EXISTS "${CODESIGN_ALLOCATE}") # Xcode 7.0 and later versions
# Xcode 6.4 and previous versions SET(CODESIGN_ALLOCATE ${OSX_DEVELOPER_ROOT}/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate)
SET(CODESIGN_ALLOCATE ${CMAKE_OSX_SYSROOT}/usr/bin/codesign_allocate)
ENDIF()
IF(NOT EXISTS "${CODESIGN_ALLOCATE}") IF(NOT EXISTS "${CODESIGN_ALLOCATE}")
# System path # Xcode 6.4 and previous versions
SET(CODESIGN_ALLOCATE /usr/bin/codesign_allocate) SET(CODESIGN_ALLOCATE ${CMAKE_OSX_SYSROOT}/usr/bin/codesign_allocate)
ENDIF() ENDIF()
IF(NOT EXISTS "${CODESIGN_ALLOCATE}") IF(NOT EXISTS "${CODESIGN_ALLOCATE}")
MESSAGE(WARNING "Unable to find codesign_allocate in standard directories") # System path
SET(CODESIGN_ALLOCATE) 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()
ENDIF() ENDIF()
@ -336,7 +337,7 @@ IF(WITH_QT5)
ENDIF() ENDIF()
# freetype is needed since Qt 5.5 # freetype is needed since Qt 5.5
FIND_PACKAGE(FreeType) FIND_PACKAGE(Freetype)
IF(FREETYPE_FOUND) IF(FREETYPE_FOUND)
SET(QT_LIBRARIES ${QT_LIBRARIES} ${FREETYPE_LIBRARIES}) SET(QT_LIBRARIES ${QT_LIBRARIES} ${FREETYPE_LIBRARIES})
@ -382,8 +383,6 @@ IF(WITH_QT5)
IF(APPLE) IF(APPLE)
FIND_LIBRARY(PCRE_LIBRARY pcre16 pcre) FIND_LIBRARY(PCRE_LIBRARY pcre16 pcre)
FIND_LIBRARY(FOUNDATION_FRAMEWORK Foundation)
FIND_LIBRARY(CARBON_FRAMEWORK Carbon)
FIND_LIBRARY(SECURITY_FRAMEWORK Security) FIND_LIBRARY(SECURITY_FRAMEWORK Security)
SET(QT_LIBRARIES ${QT_LIBRARIES} SET(QT_LIBRARIES ${QT_LIBRARIES}
@ -448,6 +447,8 @@ IF(WITH_NEL)
SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${INTL_LIBRARY}) SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${INTL_LIBRARY})
ENDIF() ENDIF()
ENDIF() ENDIF()
ELSEIF(WIN32)
SET(CURL_LIBRARIES ${CURL_LIBRARIES} Crypt32.lib)
ENDIF() ENDIF()
ENDIF() ENDIF()
ENDIF() ENDIF()

View file

@ -28,14 +28,14 @@ IF(TARGET_CPU STREQUAL "armv7")
SET(TOOLCHAIN_ARCH "arm") SET(TOOLCHAIN_ARCH "arm")
SET(GCC_TOOLCHAIN_PREFIX "arm-linux-androideabi") SET(GCC_TOOLCHAIN_PREFIX "arm-linux-androideabi")
SET(TOOLCHAIN_BIN_PREFIX "arm-linux-androideabi") SET(TOOLCHAIN_BIN_PREFIX "arm-linux-androideabi")
SET(MINIMUM_NDK_TARGET 4) SET(MINIMUM_NDK_TARGET 9)
ELSEIF(TARGET_CPU STREQUAL "armv5") ELSEIF(TARGET_CPU STREQUAL "armv5")
SET(LIBRARY_ARCHITECTURE "armeabi") SET(LIBRARY_ARCHITECTURE "armeabi")
SET(CMAKE_SYSTEM_PROCESSOR "armv5") SET(CMAKE_SYSTEM_PROCESSOR "armv5")
SET(TOOLCHAIN_ARCH "arm") SET(TOOLCHAIN_ARCH "arm")
SET(GCC_TOOLCHAIN_PREFIX "arm-linux-androideabi") SET(GCC_TOOLCHAIN_PREFIX "arm-linux-androideabi")
SET(TOOLCHAIN_BIN_PREFIX "arm-linux-androideabi") SET(TOOLCHAIN_BIN_PREFIX "arm-linux-androideabi")
SET(MINIMUM_NDK_TARGET 4) SET(MINIMUM_NDK_TARGET 9)
ELSEIF(TARGET_CPU STREQUAL "arm64") ELSEIF(TARGET_CPU STREQUAL "arm64")
SET(LIBRARY_ARCHITECTURE "arm64-v8a") SET(LIBRARY_ARCHITECTURE "arm64-v8a")
SET(CMAKE_SYSTEM_PROCESSOR "arm64") SET(CMAKE_SYSTEM_PROCESSOR "arm64")
@ -76,14 +76,9 @@ ELSE()
ENDIF() ENDIF()
SET(CLANG_TOOLCHAIN_PREFIX "llvm") SET(CLANG_TOOLCHAIN_PREFIX "llvm")
SET(ANDROID_COMPILER "GCC") SET(ANDROID_COMPILER "clang")
SET(ANDROID_COMPILER "clang")
IF(NDK_TOOLCHAIN_VERSION STREQUAL "clang") SET(CLANG ON)
SET(ANDROID_COMPILER "clang")
SET(CLANG ON)
ELSE()
SET(GCC_TOOLCHAIN_VERSION ${NDK_TOOLCHAIN_VERSION})
ENDIF()
IF(NOT NDK_TARGET) IF(NOT NDK_TARGET)
SET(NDK_TARGET ${MINIMUM_NDK_TARGET}) SET(NDK_TARGET ${MINIMUM_NDK_TARGET})
@ -94,88 +89,71 @@ ELSE()
ENDIF() ENDIF()
IF(CMAKE_HOST_WIN32) IF(CMAKE_HOST_WIN32)
SET(TOOLCHAIN_HOST "windows") SET(TOOLCHAIN_HOST "windows-x86_64")
SET(TOOLCHAIN_BIN_SUFFIX ".exe") SET(TOOLCHAIN_BIN_SUFFIX ".exe")
ELSEIF(CMAKE_HOST_APPLE) ELSEIF(CMAKE_HOST_APPLE)
SET(TOOLCHAIN_HOST "apple") SET(TOOLCHAIN_HOST "apple")
SET(TOOLCHAIN_BIN_SUFFIX "") SET(TOOLCHAIN_BIN_SUFFIX "")
ELSEIF(CMAKE_HOST_UNIX) ELSEIF(CMAKE_HOST_UNIX)
SET(TOOLCHAIN_HOST "linux") SET(TOOLCHAIN_HOST "linux-x86_64")
SET(TOOLCHAIN_BIN_SUFFIX "") SET(TOOLCHAIN_BIN_SUFFIX "")
ENDIF() ENDIF()
MACRO(SEARCH_TOOLCHAIN _COMPILER) # clang
SET(${_COMPILER}_TOOLCHAIN_VERSIONS) SET(CLANG_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${CLANG_TOOLCHAIN_PREFIX}/prebuilt/${TOOLCHAIN_HOST}")
FILE(GLOB _TOOLCHAIN_VERSIONS "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}-*")
IF(_TOOLCHAIN_VERSIONS)
LIST(SORT _TOOLCHAIN_VERSIONS)
LIST(REVERSE _TOOLCHAIN_VERSIONS)
FOREACH(_TOOLCHAIN_VERSION ${_TOOLCHAIN_VERSIONS})
STRING(REGEX REPLACE ".+${_PREFIX}-([0-9.]+)" "\\1" _TOOLCHAIN_VERSION "${_TOOLCHAIN_VERSION}")
IF(_TOOLCHAIN_VERSION MATCHES "^([0-9.]+)$")
LIST(APPEND ${_COMPILER}_TOOLCHAIN_VERSIONS ${_TOOLCHAIN_VERSION})
ENDIF()
ENDFOREACH()
ENDIF()
# try prefixes without version IF(EXISTS ${CLANG_TOOLCHAIN_ROOT})
SET(_TOOLCHAIN_WITHOUT_VERSION "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}") MESSAGE(STATUS "Found LLVM toolchain in ${CLANG_TOOLCHAIN_ROOT}")
IF(EXISTS ${_TOOLCHAIN_WITHOUT_VERSION}) ELSE()
LIST(APPEND ${_COMPILER}_TOOLCHAIN_VERSIONS "default") MESSAGE(FATAL_ERROR "No LLVM toolchain found in default search path ${CLANG_TOOLCHAIN_ROOT}")
ENDIF() ENDIF()
IF(NOT ${_COMPILER}_TOOLCHAIN_VERSIONS) # gcc
MESSAGE(FATAL_ERROR "No Android ${_COMPILER} toolchain found in default search path ${NDK_ROOT}/toolchains") SET(GCC_TOOLCHAIN_VERSIONS)
ENDIF() FILE(GLOB _TOOLCHAIN_VERSIONS "${NDK_ROOT}/toolchains/${GCC_TOOLCHAIN_PREFIX}-*")
IF(_TOOLCHAIN_VERSIONS)
IF(${_COMPILER}_TOOLCHAIN_VERSIONS) LIST(SORT _TOOLCHAIN_VERSIONS)
LIST(FIND ${_COMPILER}_TOOLCHAIN_VERSIONS "${${_COMPILER}_TOOLCHAIN_VERSION}" _INDEX) LIST(REVERSE _TOOLCHAIN_VERSIONS)
IF(_INDEX EQUAL -1) FOREACH(_TOOLCHAIN_VERSION ${_TOOLCHAIN_VERSIONS})
LIST(GET ${_COMPILER}_TOOLCHAIN_VERSIONS 0 ${_COMPILER}_TOOLCHAIN_VERSION) STRING(REGEX REPLACE ".+${_PREFIX}-([0-9.]+)" "\\1" _TOOLCHAIN_VERSION "${_TOOLCHAIN_VERSION}")
IF(_TOOLCHAIN_VERSION MATCHES "^([0-9.]+)$")
LIST(APPEND GCC_TOOLCHAIN_VERSIONS ${_TOOLCHAIN_VERSION})
ENDIF() ENDIF()
ELSE() ENDFOREACH()
LIST(GET ${_COMPILER}_TOOLCHAIN_VERSIONS 0 ${_COMPILER}_TOOLCHAIN_VERSION)
ENDIF()
MESSAGE(STATUS "TOOLCHAIN_PREFIX = ${${_COMPILER}_TOOLCHAIN_VERSION}")
IF("${${_COMPILER}_TOOLCHAIN_VERSION}" STREQUAL "default")
MESSAGE(STATUS "default")
SET(${_COMPILER}_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}/prebuilt/${TOOLCHAIN_HOST}")
ELSE()
MESSAGE(STATUS "not default")
SET(${_COMPILER}_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}-${${_COMPILER}_TOOLCHAIN_VERSION}/prebuilt/${TOOLCHAIN_HOST}")
ENDIF()
IF(NOT EXISTS "${${_COMPILER}_TOOLCHAIN_ROOT}")
FILE(GLOB _TOOLCHAIN_PREFIXES "${${_COMPILER}_TOOLCHAIN_ROOT}*")
IF(_TOOLCHAIN_PREFIXES)
LIST(GET _TOOLCHAIN_PREFIXES 0 ${_COMPILER}_TOOLCHAIN_ROOT)
ENDIF()
ENDIF()
ENDMACRO()
IF(CLANG)
SEARCH_TOOLCHAIN(CLANG)
MESSAGE(STATUS "Target Android NDK ${NDK_TARGET} and use clang ${CLANG_TOOLCHAIN_VERSION}")
ENDIF() ENDIF()
SEARCH_TOOLCHAIN(GCC) IF(NOT GCC_TOOLCHAIN_VERSIONS)
MESSAGE(FATAL_ERROR "No GCC version found in default search path ${NDK_ROOT}/toolchains")
MESSAGE(STATUS "Target Android NDK ${NDK_TARGET} and use GCC ${GCC_TOOLCHAIN_VERSION}")
IF(CLANG_TOOLCHAIN_ROOT)
MESSAGE(STATUS "Found Android LLVM toolchain in ${CLANG_TOOLCHAIN_ROOT}")
ENDIF() ENDIF()
IF(GCC_TOOLCHAIN_ROOT) IF(GCC_TOOLCHAIN_VERSIONS)
MESSAGE(STATUS "Found Android GCC toolchain in ${GCC_TOOLCHAIN_ROOT}") LIST(FIND GCC_TOOLCHAIN_VERSIONS "${GCC_TOOLCHAIN_VERSION}" _INDEX)
IF(_INDEX EQUAL -1)
LIST(GET GCC_TOOLCHAIN_VERSIONS 0 GCC_TOOLCHAIN_VERSION)
ENDIF()
ELSE()
LIST(GET GCC_TOOLCHAIN_VERSIONS 0 GCC_TOOLCHAIN_VERSION)
ENDIF() ENDIF()
SET(GCC_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${GCC_TOOLCHAIN_PREFIX}-${GCC_TOOLCHAIN_VERSION}/prebuilt/${TOOLCHAIN_HOST}")
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()
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()
# NDK
SET(PLATFORM_ROOT "${NDK_ROOT}/platforms/android-${NDK_TARGET}/arch-${TOOLCHAIN_ARCH}") SET(PLATFORM_ROOT "${NDK_ROOT}/platforms/android-${NDK_TARGET}/arch-${TOOLCHAIN_ARCH}")
MESSAGE(STATUS "Found Android platform in ${PLATFORM_ROOT}") MESSAGE(STATUS "Target Android NDK ${NDK_TARGET} found in ${PLATFORM_ROOT}")
# include dirs # include dirs
SET(PLATFORM_INCLUDE_DIR "${PLATFORM_ROOT}/usr/include") SET(PLATFORM_INCLUDE_DIR "${PLATFORM_ROOT}/usr/include")
@ -208,41 +186,29 @@ MACRO(SET_TOOLCHAIN_BINARY_GCC _NAME _BINARY)
SET(${_NAME} ${GCC_TOOLCHAIN_ROOT}/bin/${TOOLCHAIN_BIN_PREFIX}-${_BINARY}${TOOLCHAIN_BIN_SUFFIX} CACHE PATH "" FORCE) SET(${_NAME} ${GCC_TOOLCHAIN_ROOT}/bin/${TOOLCHAIN_BIN_PREFIX}-${_BINARY}${TOOLCHAIN_BIN_SUFFIX} CACHE PATH "" FORCE)
ENDMACRO() ENDMACRO()
# Force the compilers to GCC for Android SET(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
include (CMakeForceCompiler)
IF(CLANG) SET_TOOLCHAIN_BINARY_LLVM(CMAKE_C_COMPILER clang)
MESSAGE(STATUS "Using clang compiler") SET_TOOLCHAIN_BINARY_LLVM(CMAKE_CXX_COMPILER clang++)
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_C_COMPILER clang) SET(CMAKE_C_COMPILER ${CMAKE_C_COMPILER})
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_CXX_COMPILER clang++) SET(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN_BIN_PREFIX})
SET(CMAKE_C_COMPILER_FORCED TRUE)
CMAKE_FORCE_C_COMPILER(${CMAKE_C_COMPILER} clang) SET(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER})
CMAKE_FORCE_CXX_COMPILER(${CMAKE_CXX_COMPILER} clang) 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_ASM_COMPILER llvm-as)
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_AR llvm-ar) SET_TOOLCHAIN_BINARY_LLVM(CMAKE_AR llvm-ar)
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_LINKER clang++) 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()
ELSE()
MESSAGE(STATUS "Using GCC compiler")
SET_TOOLCHAIN_BINARY_GCC(CMAKE_C_COMPILER gcc)
SET_TOOLCHAIN_BINARY_GCC(CMAKE_CXX_COMPILER g++)
CMAKE_FORCE_C_COMPILER(${CMAKE_C_COMPILER} GNU)
CMAKE_FORCE_CXX_COMPILER(${CMAKE_CXX_COMPILER} GNU)
IF(NOT EXISTS "${CMAKE_ASM_COMPILER}")
SET_TOOLCHAIN_BINARY_GCC(CMAKE_ASM_COMPILER as) SET_TOOLCHAIN_BINARY_GCC(CMAKE_ASM_COMPILER as)
ENDIF()
IF(NOT EXISTS "${CMAKE_AR}")
SET_TOOLCHAIN_BINARY_GCC(CMAKE_AR ar) SET_TOOLCHAIN_BINARY_GCC(CMAKE_AR ar)
SET_TOOLCHAIN_BINARY_GCC(CMAKE_LINKER ld)
ENDIF() ENDIF()
SET_TOOLCHAIN_BINARY_GCC(CMAKE_STRIP strip) SET_TOOLCHAIN_BINARY_GCC(CMAKE_STRIP strip)

View file

@ -1,114 +1,168 @@
# - Find MS Visual C++ # - Find MS Visual C++
# #
# VC_INCLUDE_DIR - where to find headers # VC_INCLUDE_DIR - where to find headers
# VC_INCLUDE_DIRS - where to find headers # VC_INCLUDE_DIRS - where to find headers
# VC_LIBRARY_DIR - where to find libraries # VC_LIBRARY_DIR - where to find libraries
# VC_FOUND - True if MSVC found. # VC_FOUND - True if MSVC found.
MACRO(DETECT_VC_VERSION_HELPER _ROOT _VERSION) MACRO(ADD_TRAILING_SLASH _FILENAME_VAR)
# Software/Wow6432Node/... # put content in a new variable
GET_FILENAME_COMPONENT(VC${_VERSION}_DIR "[${_ROOT}\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;${_VERSION}]" ABSOLUTE) SET(_FILENAME ${${_FILENAME_VAR}})
# get length of the string
IF(VC${_VERSION}_DIR AND VC${_VERSION}_DIR STREQUAL "/registry") STRING(LENGTH ${_FILENAME} _LEN)
SET(VC${_VERSION}_DIR) # convert length to last pos
GET_FILENAME_COMPONENT(VC${_VERSION}_DIR "[${_ROOT}\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7;${_VERSION}]" ABSOLUTE) MATH(EXPR _POS "${_LEN}-1")
IF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry") # get last character of the string
SET(VC${_VERSION}_DIR "${VC${_VERSION}_DIR}VC/") STRING(SUBSTRING ${_FILENAME} ${_POS} 1 _FILENAME_END)
ENDIF() # compare it with a slash
ENDIF() IF(NOT _FILENAME_END STREQUAL "/")
# not a slash, append it
IF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry") SET(${_FILENAME_VAR} "${_FILENAME}/")
SET(VC${_VERSION}_FOUND ON) ELSE()
DETECT_EXPRESS_VERSION(${_VERSION}) # already a slash
IF(NOT MSVC_FIND_QUIETLY) ENDIF()
SET(_VERSION_STR ${_VERSION}) ENDMACRO()
IF(MSVC_EXPRESS)
SET(_VERSION_STR "${_VERSION_STR} Express") MACRO(DETECT_VC_VERSION_HELPER _ROOT _VERSION)
ENDIF() # Software/Wow6432Node/...
MESSAGE(STATUS "Found Visual C++ ${_VERSION_STR} in ${VC${_VERSION}_DIR}") GET_FILENAME_COMPONENT(VC${_VERSION}_DIR "[${_ROOT}\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;${_VERSION}]" ABSOLUTE)
ENDIF()
ELSEIF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry") IF(VC${_VERSION}_DIR AND VC${_VERSION}_DIR STREQUAL "/registry")
SET(VC${_VERSION}_FOUND OFF) SET(VC${_VERSION}_DIR)
SET(VC${_VERSION}_DIR "") GET_FILENAME_COMPONENT(VC${_VERSION}_DIR "[${_ROOT}\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7;${_VERSION}]" ABSOLUTE)
ENDIF()
ENDMACRO() IF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry")
# be sure it's finishing by a /
MACRO(DETECT_VC_VERSION _VERSION) ADD_TRAILING_SLASH(VC${_VERSION}_DIR)
SET(VC${_VERSION}_FOUND OFF)
DETECT_VC_VERSION_HELPER("HKEY_CURRENT_USER" ${_VERSION}) SET(VC${_VERSION}_DIR "${VC${_VERSION}_DIR}VC/")
ENDIF()
IF(NOT VC${_VERSION}_FOUND) ENDIF()
DETECT_VC_VERSION_HELPER("HKEY_LOCAL_MACHINE" ${_VERSION})
ENDIF() IF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry")
SET(VC${_VERSION}_FOUND ON)
IF(VC${_VERSION}_FOUND) DETECT_EXPRESS_VERSION(${_VERSION})
SET(VC_FOUND ON) IF(NOT MSVC_FIND_QUIETLY)
SET(VC_DIR "${VC${_VERSION}_DIR}") SET(_VERSION_STR ${_VERSION})
ENDIF() IF(MSVC_EXPRESS)
ENDMACRO() SET(_VERSION_STR "${_VERSION_STR} Express")
ENDIF()
MACRO(DETECT_EXPRESS_VERSION _VERSION) MESSAGE(STATUS "Found Visual C++ ${_VERSION_STR} in ${VC${_VERSION}_DIR}")
GET_FILENAME_COMPONENT(MSVC_EXPRESS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\${_VERSION}\\Setup\\VC;ProductDir]" ABSOLUTE) ENDIF()
ELSEIF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry")
IF(MSVC_EXPRESS AND NOT MSVC_EXPRESS STREQUAL "/registry") SET(VC${_VERSION}_FOUND OFF)
SET(MSVC_EXPRESS ON) SET(VC${_VERSION}_DIR "")
ENDIF() ENDIF()
ENDMACRO() ENDMACRO()
IF(MSVC14) MACRO(DETECT_VC_VERSION _VERSION)
DETECT_VC_VERSION("14.0") SET(VC${_VERSION}_FOUND OFF)
SET(MSVC_TOOLSET "140") DETECT_VC_VERSION_HELPER("HKEY_CURRENT_USER" ${_VERSION})
IF(NOT MSVC14_REDIST_DIR) IF(NOT VC${_VERSION}_FOUND)
# If you have VC++ 2015 Express, put x64/Microsoft.VC140.CRT/*.dll in ${EXTERNAL_PATH}/redist DETECT_VC_VERSION_HELPER("HKEY_LOCAL_MACHINE" ${_VERSION})
SET(MSVC14_REDIST_DIR "${EXTERNAL_PATH}/redist") ENDIF()
ENDIF()
ELSEIF(MSVC12) IF(VC${_VERSION}_FOUND)
DETECT_VC_VERSION("12.0") SET(VC_FOUND ON)
SET(MSVC_TOOLSET "120") SET(VC_DIR "${VC${_VERSION}_DIR}")
ENDIF()
IF(NOT MSVC12_REDIST_DIR) ENDMACRO()
# If you have VC++ 2013 Express, put x64/Microsoft.VC120.CRT/*.dll in ${EXTERNAL_PATH}/redist
SET(MSVC12_REDIST_DIR "${EXTERNAL_PATH}/redist") MACRO(DETECT_EXPRESS_VERSION _VERSION)
ENDIF() GET_FILENAME_COMPONENT(MSVC_EXPRESS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\${_VERSION}\\Setup\\VC;ProductDir]" ABSOLUTE)
ELSEIF(MSVC11)
DETECT_VC_VERSION("11.0") IF(MSVC_EXPRESS AND NOT MSVC_EXPRESS STREQUAL "/registry")
SET(MSVC_TOOLSET "110") SET(MSVC_EXPRESS ON)
ENDIF()
IF(NOT MSVC11_REDIST_DIR) ENDMACRO()
# If you have VC++ 2012 Express, put x64/Microsoft.VC110.CRT/*.dll in ${EXTERNAL_PATH}/redist
SET(MSVC11_REDIST_DIR "${EXTERNAL_PATH}/redist") IF(MSVC1411 OR MSVC1410)
ENDIF() DETECT_VC_VERSION("15.0")
ELSEIF(MSVC10) SET(MSVC_TOOLSET "140")
DETECT_VC_VERSION("10.0")
SET(MSVC_TOOLSET "100") SET(VC_DIR "${VC_DIR}Tools/MSVC")
IF(NOT MSVC10_REDIST_DIR) FILE(GLOB MSVC_TOOLCHAIN_VERSIONS RELATIVE ${VC_DIR} "${VC_DIR}/*")
# If you have VC++ 2010 Express, put x64/Microsoft.VC100.CRT/*.dll in ${EXTERNAL_PATH}/redist
SET(MSVC10_REDIST_DIR "${EXTERNAL_PATH}/redist") IF(MSVC_TOOLCHAIN_VERSIONS)
ENDIF() LIST(SORT MSVC_TOOLCHAIN_VERSIONS)
ELSEIF(MSVC90) LIST(REVERSE MSVC_TOOLCHAIN_VERSIONS)
DETECT_VC_VERSION("9.0") ENDIF()
SET(MSVC_TOOLSET "90")
ELSEIF(MSVC80) IF(NOT MSVC_TOOLCHAIN_VERSIONS)
DETECT_VC_VERSION("8.0") MESSAGE(FATAL_ERROR "No MSVC version found in default search path ${VC_DIR}")
SET(MSVC_TOOLSET "80") ENDIF()
ENDIF()
LIST(GET MSVC_TOOLCHAIN_VERSIONS 0 MSVC_TOOLCHAIN_VERSION)
# If you plan to use VC++ compilers with WINE, set VC_DIR environment variable
IF(NOT VC_DIR) SET(VC_DIR "${VC_DIR}/${MSVC_TOOLCHAIN_VERSION}")
SET(VC_DIR $ENV{VC_DIR}) SET(VC_INCLUDE_DIR "${VC_DIR}/include")
ENDIF()
IF(NOT MSVC14_REDIST_DIR)
IF(NOT VC_DIR) # If you have VC++ 2017 Express, put x64/Microsoft.VC141.CRT/*.dll in ${EXTERNAL_PATH}/redist
IF(CMAKE_CXX_COMPILER) # original files whould be in ${VC_DIR}/Redist/MSVC/14.11.25325/x64/Microsoft.VC141.CRT
SET(_COMPILER ${CMAKE_CXX_COMPILER}) SET(MSVC14_REDIST_DIR "${EXTERNAL_PATH}/redist")
ELSE() ENDIF()
SET(_COMPILER ${CMAKE_C_COMPILER}) ELSEIF(MSVC14)
ENDIF() DETECT_VC_VERSION("14.0")
STRING(REGEX REPLACE "/(bin|BIN|Bin)/.+" "" VC_DIR ${_COMPILER}) SET(MSVC_TOOLSET "140")
ENDIF()
IF(NOT MSVC14_REDIST_DIR)
SET(VC_INCLUDE_DIR "${VC_DIR}/include") # If you have VC++ 2015 Express, put x64/Microsoft.VC140.CRT/*.dll in ${EXTERNAL_PATH}/redist
SET(VC_INCLUDE_DIRS ${VC_INCLUDE_DIR}) SET(MSVC14_REDIST_DIR "${EXTERNAL_PATH}/redist")
INCLUDE_DIRECTORIES(${VC_INCLUDE_DIR}) ENDIF()
ELSEIF(MSVC12)
DETECT_VC_VERSION("12.0")
SET(MSVC_TOOLSET "120")
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()
ELSEIF(MSVC11)
DETECT_VC_VERSION("11.0")
SET(MSVC_TOOLSET "110")
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()
ELSEIF(MSVC10)
DETECT_VC_VERSION("10.0")
SET(MSVC_TOOLSET "100")
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()
ELSEIF(MSVC90)
DETECT_VC_VERSION("9.0")
SET(MSVC_TOOLSET "90")
ELSEIF(MSVC80)
DETECT_VC_VERSION("8.0")
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()
IF(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)
SET(VC_INCLUDE_DIR "${VC_DIR}/include")
ENDIF()
MESSAGE(STATUS "Using headers from ${VC_INCLUDE_DIR}")
SET(VC_INCLUDE_DIRS ${VC_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${VC_INCLUDE_DIR})

View file

@ -35,7 +35,7 @@ MACRO(DETECT_WINKIT_VERSION _VERSION _SUFFIX)
SET(WINSDK${_VERSION}_FOUND ON) SET(WINSDK${_VERSION}_FOUND ON)
SET(WINSDK${_VERSION}_VERSION_FULL "${_VERSION}") SET(WINSDK${_VERSION}_VERSION_FULL "${_VERSION}")
IF(NOT WindowsSDK_FIND_QUIETLY) IF(NOT WindowsSDK_FIND_QUIETLY)
MESSAGE(STATUS "Found Windows SDK ${_VERSION} in ${WINSDK${_VERSION}_DIR}") MESSAGE(STATUS "Found Windows Kit ${_VERSION} in ${WINSDK${_VERSION}_DIR}")
ENDIF() ENDIF()
LIST(APPEND WINSDK_DETECTED_VERSIONS ${_VERSION}) LIST(APPEND WINSDK_DETECTED_VERSIONS ${_VERSION})
ELSE() ELSE()
@ -240,7 +240,11 @@ MACRO(USE_CURRENT_WINSDK)
IF(NOT WINSDK_DIR) IF(NOT WINSDK_DIR)
# Use Windows SDK versions installed with VC++ when possible # Use Windows SDK versions installed with VC++ when possible
IF(MSVC14) IF(MSVC1411 OR MSVC1410)
# Special case, use Kits for SDK
SET(WINSDK_VERSION "10.0")
SET(WINSDK_DIR ${WINSDK_UCRT_DIR})
ELSEIF(MSVC14)
SET(WINSDK_VERSION "8.1") SET(WINSDK_VERSION "8.1")
ELSEIF(MSVC12) ELSEIF(MSVC12)
SET(WINSDK_VERSION "8.1") SET(WINSDK_VERSION "8.1")
@ -305,7 +309,7 @@ MACRO(USE_CURRENT_WINSDK)
ENDMACRO() ENDMACRO()
IF(MSVC14) IF(MSVC14)
# Under VC++ 2015, stdio.h, stdlib.h, etc... are part of UCRT # Under VC++ 2015 and 2017, stdio.h, stdlib.h, etc... are part of UCRT
SET(WINSDK_UCRT_VERSION "10.0") SET(WINSDK_UCRT_VERSION "10.0")
ENDIF() ENDIF()
@ -314,6 +318,40 @@ IF(WINSDK_UCRT_VERSION AND WINSDK${WINSDK_UCRT_VERSION}_FOUND)
SET(WINSDK_UCRT_DIR "${WINSDK${WINSDK_UCRT_VERSION}_DIR}") SET(WINSDK_UCRT_DIR "${WINSDK${WINSDK_UCRT_VERSION}_DIR}")
ENDIF() 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") IF(WINSDK_VERSION STREQUAL "CURRENT")
USE_CURRENT_WINSDK() USE_CURRENT_WINSDK()
ELSE() ELSE()
@ -334,93 +372,87 @@ ENDIF()
# directory where Win32 headers are found # directory where Win32 headers are found
FIND_PATH(WINSDK_INCLUDE_DIR Windows.h FIND_PATH(WINSDK_INCLUDE_DIR Windows.h
HINTS HINTS
${WINSDK_DIR}/Include/${UCRT_VERSION}/um
${WINSDK_DIR}/Include/um ${WINSDK_DIR}/Include/um
${WINSDK_DIR}/Include ${WINSDK_DIR}/Include
NO_DEFAULT_PATH
) )
MESSAGE(STATUS "Found Windows.h in ${WINSDK_INCLUDE_DIR}")
# directory where WinRT headers are found # directory where WinRT headers are found
FIND_PATH(WINSDK_WINRT_INCLUDE_DIR winstring.h FIND_PATH(WINSDK_WINRT_INCLUDE_DIR winstring.h
HINTS HINTS
${WINSDK_DIR}/Include/${UCRT_VERSION}/winrt
${WINSDK_DIR}/Include/winrt ${WINSDK_DIR}/Include/winrt
NO_DEFAULT_PATH
) )
MESSAGE(STATUS "Found winstring.h in ${WINSDK_WINRT_INCLUDE_DIR}")
# directory where DirectX headers are found # directory where DirectX headers are found
FIND_PATH(WINSDK_SHARED_INCLUDE_DIR d3d9.h FIND_PATH(WINSDK_SHARED_INCLUDE_DIR d3d9.h
HINTS HINTS
${WINSDK_DIR}/Include/${UCRT_VERSION}/shared
${WINSDK_DIR}/Include/shared ${WINSDK_DIR}/Include/shared
NO_DEFAULT_PATH
) )
MESSAGE(STATUS "Found d3d9.h in ${WINSDK_SHARED_INCLUDE_DIR}")
# directory where OpenGL headers are found # directory where OpenGL headers are found
FIND_PATH(WINSDK_OPENGL_INCLUDE_DIR GL.h FIND_PATH(WINSDK_OPENGL_INCLUDE_DIR GL.h
HINTS HINTS
${WINSDK_INCLUDE_DIR}/gl
${WINSDK_DIR}/Include/um/gl ${WINSDK_DIR}/Include/um/gl
${WINSDK_DIR}/Include/gl ${WINSDK_DIR}/Include/gl
NO_DEFAULT_PATH
) )
MESSAGE(STATUS "Found GL.h in ${WINSDK_OPENGL_INCLUDE_DIR}")
SET(WINSDK_LIBRARY_DIRS SET(WINSDK_LIBRARY_DIRS
${WINSDK_DIR}/Lib/${UCRT_VERSION}/um/${WINSDK8_SUFFIX}
${WINSDK_DIR}/Lib/winv6.3/um/${WINSDK8_SUFFIX} ${WINSDK_DIR}/Lib/winv6.3/um/${WINSDK8_SUFFIX}
${WINSDK_DIR}/Lib/win8/um/${WINSDK8_SUFFIX} ${WINSDK_DIR}/Lib/win8/um/${WINSDK8_SUFFIX}
) )
IF(WINSDK_SUFFIXES) IF(WINSDK_SUFFIXES)
FOREACH(_SUFFIX ${WINSDK_SUFFIXES}) FOREACH(_SUFFIX ${WINSDK_SUFFIXES})
SET(WINSDK_LIBRARY_DIRS ${WINSDK_LIBRARY_DIRS} ${WINSDK_DIR}/Lib/${_SUFFIX}) LIST(APPEND WINSDK_LIBRARY_DIRS ${WINSDK_DIR}/Lib/${_SUFFIX})
ENDFOREACH() ENDFOREACH()
ELSE() ELSE()
SET(WINSDK_LIBRARY_DIRS ${WINSDK_LIBRARY_DIRS} ${WINSDK_DIR}/Lib) LIST(APPEND WINSDK_LIBRARY_DIRS ${WINSDK_DIR}/Lib)
ENDIF() ENDIF()
# directory where all libraries are found # directory where all libraries are found
FIND_PATH(WINSDK_LIBRARY_DIR ComCtl32.lib FIND_PATH(WINSDK_LIBRARY_DIR ComCtl32.lib
HINTS HINTS
${WINSDK_LIBRARY_DIRS} ${WINSDK_LIBRARY_DIRS}
NO_DEFAULT_PATH
) )
IF(WINSDK_UCRT_DIR) MESSAGE(STATUS "Found ComCtl32.lib in ${WINSDK_LIBRARY_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(WINSDK_BINARY_DIRS
SET(UCRT_VERSION) ${WINSDK_DIR}/Bin/${UCRT_VERSION}/${WINSDK8_SUFFIX}
${WINSDK_DIR}/Bin/${WINSDK8_SUFFIX}
FOREACH(UCRT_SUBDIR ${UCRT_SUBDIRS}) ${WINSDK_DIR}/Bin/x86
IF(NOT UCRT_VERSION OR UCRT_SUBDIR VERSION_GREATER UCRT_VERSION) ${WINSDK_DIR}/Bin
SET(UCRT_VERSION ${UCRT_SUBDIR}) )
ENDIF()
ENDFOREACH()
IF(UCRT_VERSION)
MESSAGE(STATUS "Using Windows UCRT ${UCRT_VERSION}")
# directory where UCRT headers are found
FIND_PATH(WINSDK_UCRT_INCLUDE_DIR corecrt.h
HINTS
${WINSDK_UCRT_INCLUDE_ROOT_DIR}/${UCRT_VERSION}/ucrt
)
# directory where UCRT libraries are found
FIND_PATH(WINSDK_UCRT_LIBRARY_DIR ucrt.lib
HINTS
${WINSDK_UCRT_LIB_ROOT_DIR}/${UCRT_VERSION}/ucrt/${WINSDK8_SUFFIX}
)
ENDIF()
ENDIF()
# signtool is used to sign executables # signtool is used to sign executables
FIND_PROGRAM(WINSDK_SIGNTOOL signtool FIND_PROGRAM(WINSDK_SIGNTOOL signtool
HINTS HINTS
${WINSDK_DIR}/Bin/${WINSDK8_SUFFIX} ${WINSDK_BINARY_DIRS}
${WINSDK_DIR}/Bin/x86 NO_DEFAULT_PATH
${WINSDK_DIR}/Bin
) )
# midl is used to generate IDL interfaces # midl is used to generate IDL interfaces
FIND_PROGRAM(WINSDK_MIDL midl FIND_PROGRAM(WINSDK_MIDL midl
HINTS HINTS
${WINSDK_DIR}/Bin/${WINSDK8_SUFFIX} ${WINSDK_BINARY_DIRS}
${WINSDK_DIR}/Bin/x86 NO_DEFAULT_PATH
${WINSDK_DIR}/Bin
) )
IF(WINSDK_INCLUDE_DIR) IF(WINSDK_INCLUDE_DIR)
@ -444,7 +476,7 @@ IF(WINSDK_INCLUDE_DIR)
SET(WINSDK_INCLUDE_DIRS ${WINSDK_INCLUDE_DIRS} ${WINSDK_WINRT_INCLUDE_DIR}) SET(WINSDK_INCLUDE_DIRS ${WINSDK_INCLUDE_DIRS} ${WINSDK_WINRT_INCLUDE_DIR})
ENDIF() ENDIF()
INCLUDE_DIRECTORIES(${WINSDK_INCLUDE_DIRS}) # TODO: Move this after all other includes somehow... INCLUDE_DIRECTORIES(${WINSDK_INCLUDE_DIRS})
IF(WINSDK_UCRT_LIBRARY_DIR) IF(WINSDK_UCRT_LIBRARY_DIR)
SET(CMAKE_LIBRARY_PATH ${WINSDK_UCRT_LIBRARY_DIR} ${CMAKE_LIBRARY_PATH}) SET(CMAKE_LIBRARY_PATH ${WINSDK_UCRT_LIBRARY_DIR} ${CMAKE_LIBRARY_PATH})

View file

@ -0,0 +1,115 @@
# 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
SET(CMAKE_C_COMPILER x86_64-apple-darwin15-clang)
SET(CMAKE_CXX_COMPILER x86_64-apple-darwin15-clang++)
set(CMAKE_CXX_COMPILER_ID "AppleClang")
# 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)

View file

@ -114,12 +114,16 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
GET_TARGET_PROPERTY(oldProps ${_target} COMPILE_FLAGS) GET_TARGET_PROPERTY(oldProps ${_target} COMPILE_FLAGS)
IF(oldProps) IF(oldProps)
LIST(APPEND _FLAGS ${oldProps}) SET(_FLAG ${oldProps})
SEPARATE_ARGUMENTS(_FLAG)
LIST(APPEND _FLAGS ${_FLAG})
ENDIF() ENDIF()
GET_TARGET_PROPERTY(oldPropsBuild ${_target} COMPILE_FLAGS_${_UPPER_BUILD}) GET_TARGET_PROPERTY(oldPropsBuild ${_target} COMPILE_FLAGS_${_UPPER_BUILD})
IF(oldPropsBuild) IF(oldPropsBuild)
LIST(APPEND _FLAGS ${oldPropsBuild}) SET(_FLAG ${oldPropsBuild})
SEPARATE_ARGUMENTS(_FLAG)
LIST(APPEND _FLAGS ${_FLAG})
ENDIF() ENDIF()
GET_TARGET_PROPERTY(DIRINC ${_target} INCLUDE_DIRECTORIES) GET_TARGET_PROPERTY(DIRINC ${_target} INCLUDE_DIRECTORIES)
@ -205,6 +209,10 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
ENDIF() ENDIF()
ENDIF() ENDIF()
IF(USE_CPP0X AND gcc_compiler_version GREATER "6.2.0")
LIST(APPEND _FLAGS "-std=gnu++11")
ENDIF()
# Format definitions # Format definitions
IF(MSVC) IF(MSVC)
# Fix path with space # Fix path with space
@ -316,7 +324,7 @@ MACRO(PCH_SET_COMPILE_COMMAND _inputcpp _compile_FLAGS)
SET(_FLAGS "") SET(_FLAGS "")
IF(APPLE) IF(APPLE)
SET(HEADER_FORMAT "objective-${HEADER_FORMAT}") SET(HEADER_FORMAT "objective-${HEADER_FORMAT}")
SET(_FLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch) SET(_FLAGS ${OBJC_FLAGS})
ENDIF() ENDIF()
SET(PCH_COMMAND ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} ${_FLAGS} -x ${HEADER_FORMAT} -o ${PCH_OUTPUT} -c ${PCH_INPUT}) SET(PCH_COMMAND ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} ${_FLAGS} -x ${HEADER_FORMAT} -o ${PCH_OUTPUT} -c ${PCH_INPUT})
ENDIF() ENDIF()
@ -402,7 +410,8 @@ MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName)
ENDIF() ENDIF()
IF(APPLE) IF(APPLE)
SET(PCH_ADDITIONAL_COMPILER_FLAGS "-fobjc-abi-version=2 -fobjc-legacy-dispatch -x objective-c++ ${PCH_ADDITIONAL_COMPILER_FLAGS}") STRING(REPLACE ";" " " OBJC_FLAGS_STR "${OBJC_FLAGS}")
SET(PCH_ADDITIONAL_COMPILER_FLAGS "${OBJC_FLAGS_STR} -x objective-c++ ${PCH_ADDITIONAL_COMPILER_FLAGS}")
ENDIF() ENDIF()
IF(WITH_PCH_DEBUG) IF(WITH_PCH_DEBUG)

View file

@ -35,23 +35,6 @@ SET(UNIX ON)
SET(APPLE ON) SET(APPLE ON)
SET(IOS 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)
IF(CMAKE_CXX_COMPILER)
EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} --version
OUTPUT_VARIABLE CLANG_VERSION_RAW
OUTPUT_STRIP_TRAILING_WHITESPACE)
STRING(REGEX REPLACE "Apple LLVM version ([\\.0-9]+).*"
"\\1" CMAKE_CXX_COMPILER_VERSION "${CLANG_VERSION_RAW}")
SET(CMAKE_C_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION})
SET(CMAKE_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION})
ENDIF()
# Setup iOS platform # Setup iOS platform
IF(NOT DEFINED IOS_PLATFORM) IF(NOT DEFINED IOS_PLATFORM)
SET(IOS_PLATFORM "OS") SET(IOS_PLATFORM "OS")
@ -162,14 +145,14 @@ IF(CMAKE_GENERATOR MATCHES Xcode)
ENDIF() ENDIF()
ELSE() ELSE()
IF(${IOS_PLATFORM} STREQUAL "OS") IF(${IOS_PLATFORM} STREQUAL "OS")
SET(ARCHS "armv7;arm64") SET(ARCHS armv7 arm64)
SET(CMAKE_SYSTEM_PROCESSOR "armv7") SET(CMAKE_SYSTEM_PROCESSOR "armv7")
ELSEIF(${IOS_PLATFORM} STREQUAL "SIMULATOR") ELSEIF(${IOS_PLATFORM} STREQUAL "SIMULATOR")
# iPhone simulator targets i386 # iPhone simulator targets i386
SET(ARCHS "i386") SET(ARCHS "i386")
SET(CMAKE_SYSTEM_PROCESSOR "x86") SET(CMAKE_SYSTEM_PROCESSOR "x86")
ELSEIF(${IOS_PLATFORM} STREQUAL "ALL") ELSEIF(${IOS_PLATFORM} STREQUAL "ALL")
SET(ARCHS "armv7;arm64;i386;x86_64") SET(ARCHS armv7 arm64 i386 x86_64)
SET(CMAKE_SYSTEM_PROCESSOR "armv7") SET(CMAKE_SYSTEM_PROCESSOR "armv7")
ENDIF() ENDIF()
ENDIF() ENDIF()
@ -198,5 +181,13 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE 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)
# determinate location for bin utils based on CMAKE_FIND_ROOT_PATH # determinate location for bin utils based on CMAKE_FIND_ROOT_PATH
include(CMakeFindBinUtils) INCLUDE(CMakeFindBinUtils)

View file

@ -565,11 +565,18 @@ MACRO(NL_SETUP_BUILD)
ADD_PLATFORM_FLAGS("/X") ADD_PLATFORM_FLAGS("/X")
IF(MSVC14) IF(MSVC14)
ADD_PLATFORM_FLAGS("/Gy- /MP") ADD_PLATFORM_FLAGS("/Gy-")
# /Ox is working with VC++ 2015, but custom optimizations don't exist # /Ox is working with VC++ 2015 and 2017, but custom optimizations don't exist
SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}") SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}")
# without inlining it's unusable, use custom optimizations again # without inlining it's unusable, use custom optimizations again
SET(DEBUG_CFLAGS "/Od /Ob1 /GF- ${DEBUG_CFLAGS}") 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) ELSEIF(MSVC12)
ADD_PLATFORM_FLAGS("/Gy-") ADD_PLATFORM_FLAGS("/Gy-")
# /Ox is working with VC++ 2013, but custom optimizations don't exist # /Ox is working with VC++ 2013, but custom optimizations don't exist
@ -657,6 +664,8 @@ MACRO(NL_SETUP_BUILD)
ENDIF() ENDIF()
IF(APPLE) IF(APPLE)
SET(OBJC_FLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch -fobjc-weak)
IF(NOT XCODE) IF(NOT XCODE)
IF(CMAKE_OSX_ARCHITECTURES) IF(CMAKE_OSX_ARCHITECTURES)
SET(TARGETS_COUNT 0) SET(TARGETS_COUNT 0)
@ -1160,6 +1169,7 @@ MACRO(SETUP_EXTERNAL)
IF(APPLE) IF(APPLE)
IF(WITH_STATIC_EXTERNAL) IF(WITH_STATIC_EXTERNAL)
# Look only for static libraries because systems libraries are using Frameworks
SET(CMAKE_FIND_LIBRARY_SUFFIXES .a) SET(CMAKE_FIND_LIBRARY_SUFFIXES .a)
ELSE() ELSE()
SET(CMAKE_FIND_LIBRARY_SUFFIXES .dylib .so .a) SET(CMAKE_FIND_LIBRARY_SUFFIXES .dylib .so .a)
@ -1173,12 +1183,13 @@ MACRO(SETUP_EXTERNAL)
ENDIF() ENDIF()
ENDIF() ENDIF()
# Android and iOS have pthread # Android, iOS and Mac OS X have pthread, but no need to link to libpthread
IF(ANDROID OR IOS) IF(ANDROID OR APPLE)
SET(CMAKE_USE_PTHREADS_INIT 1) SET(CMAKE_USE_PTHREADS_INIT 1)
SET(Threads_FOUND TRUE) SET(Threads_FOUND TRUE)
ELSE() ELSE()
FIND_PACKAGE(Threads REQUIRED) SET(THREADS_HAVE_PTHREAD_ARG ON)
FIND_PACKAGE(Threads)
# TODO: replace all -l<lib> by absolute path to <lib> in CMAKE_THREAD_LIBS_INIT # TODO: replace all -l<lib> by absolute path to <lib> in CMAKE_THREAD_LIBS_INIT
ENDIF() ENDIF()

View file

@ -0,0 +1,35 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef CL_CURL_CERTIFICATES_HTML_H
#define CL_CURL_CERTIFICATES_HTML_H
#include <curl/curl.h>
#include "nel/misc/types_nl.h"
namespace NLGUI
{
#if defined(NL_OS_WINDOWS)
class CCurlCertificates {
public:
// cURL SSL certificate loading
static CURLcode sslCtxFunction(CURL *curl, void *sslctx, void *parm);
};
#endif // NL_OS_WINDOWS
} // namespace
#endif

View file

@ -264,6 +264,7 @@ namespace NLGUI
// because of multiline, thz parent container will be moved to top // because of multiline, thz parent container will be moved to top
// The good position can be restored by a press on enter then // 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 _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 _Savable : 1; // should content be saved ?
bool _DefaultInputString : 1; // Is the current input string the default one (should not be edited) 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) bool _Frozen : 1; // is the control frozen? (cannot edit in it)

View file

@ -84,6 +84,7 @@ namespace NLGUI
FontOblique=false; FontOblique=false;
Underlined=false; Underlined=false;
StrikeThrough=false; StrikeThrough=false;
GlobalColor=false;
Width=-1; Width=-1;
Height=-1; Height=-1;
MaxWidth=-1; MaxWidth=-1;
@ -94,6 +95,7 @@ namespace NLGUI
bool FontOblique; bool FontOblique;
std::string FontFamily; std::string FontFamily;
NLMISC::CRGBA TextColor; NLMISC::CRGBA TextColor;
bool GlobalColor;
bool Underlined; bool Underlined;
bool StrikeThrough; bool StrikeThrough;
sint32 Width; sint32 Width;
@ -339,7 +341,7 @@ namespace NLGUI
void addString(const ucstring &str); void addString(const ucstring &str);
// Add an image in the current paragraph // Add an image in the current paragraph
void addImage(const char *image, bool globalColor, bool reloadImg=false, const CStyleParams &style = CStyleParams()); void addImage(const char *image, bool reloadImg=false, const CStyleParams &style = CStyleParams());
// Add a text area in the current paragraph // 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, uint maxlength); CInterfaceGroup *addTextArea (const std::string &templateName, const char *name, uint rows, uint cols, bool multiLine, const ucstring &content, uint maxlength);
@ -350,7 +352,7 @@ namespace NLGUI
// Add a button in the current paragraph. actionHandler, actionHandlerParams and tooltip can be NULL. // 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, 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()); const CStyleParams &style = CStyleParams());
// Set the background color // Set the background color
@ -712,7 +714,12 @@ namespace NLGUI
std::vector<CCellParams> _CellParams; std::vector<CCellParams> _CellParams;
// Indentation // Indentation
uint _Indent; std::vector<uint> _Indent;
inline uint getIndent() const {
if (_Indent.empty())
return 0;
return _Indent.back();
}
// Current node is a title // Current node is a title
bool _Title; bool _Title;
@ -791,7 +798,7 @@ namespace NLGUI
void doBrowseLocalFile(const std::string &filename); void doBrowseLocalFile(const std::string &filename);
// load remote content using either GET or POST // load remote content using either GET or POST
void doBrowseRemoteUrl(const std::string &url, const std::string &referer, bool doPost = false, const SFormFields &formfields = SFormFields()); void doBrowseRemoteUrl(std::string url, const std::string &referer, bool doPost = false, const SFormFields &formfields = SFormFields());
// render html string as new browser page // render html string as new browser page
bool renderHtmlString(const std::string &html); bool renderHtmlString(const std::string &html);
@ -805,33 +812,37 @@ namespace NLGUI
// ImageDownload system // ImageDownload system
enum TDataType {ImgType= 0, BnpType}; enum TDataType {ImgType= 0, BnpType};
enum TImageType {NormalImage=0, OverImage};
struct CDataImageDownload struct CDataImageDownload
{ {
public: public:
CDataImageDownload(CViewBase *img, CStyleParams style): Image(img), Style(style) CDataImageDownload(CViewBase *img, CStyleParams style, TImageType type): Image(img), Style(style), Type(type)
{ {
} }
public: public:
CViewBase * Image; CViewBase * Image;
CStyleParams Style; CStyleParams Style;
TImageType Type;
}; };
struct CDataDownload struct CDataDownload
{ {
public: public:
CDataDownload(CURL *c, const std::string &u, const std::string &d, FILE *f, TDataType t, CViewBase *i, const std::string &s, const std::string &m, const CStyleParams &style = CStyleParams()) : curl(c), url(u), dest(d), luaScript(s), md5sum(m), type(t), fp(f) CDataDownload(const std::string &u, const std::string &d, TDataType t, CViewBase *i, const std::string &s, const std::string &m, const CStyleParams &style = CStyleParams(), const TImageType imagetype = NormalImage)
: data(NULL), fp(NULL), url(u), dest(d), type(t), luaScript(s), md5sum(m), redirects(0)
{ {
if (t == ImgType) imgs.push_back(CDataImageDownload(i, style)); if (t == ImgType) imgs.push_back(CDataImageDownload(i, style, imagetype));
} }
public: public:
CURL *curl; CCurlWWWData *data;
std::string url; std::string url;
std::string dest; std::string dest;
std::string luaScript; std::string luaScript;
std::string md5sum; std::string md5sum;
TDataType type; TDataType type;
uint32 redirects;
FILE *fp; FILE *fp;
std::vector<CDataImageDownload> imgs; std::vector<CDataImageDownload> imgs;
}; };
@ -840,20 +851,22 @@ namespace NLGUI
CURLM *MultiCurl; CURLM *MultiCurl;
int RunningCurls; int RunningCurls;
bool startCurlDownload(CDataDownload &download);
void initImageDownload(); void initImageDownload();
void checkImageDownload(); void checkImageDownload();
void addImageDownload(const std::string &url, CViewBase *img, const CStyleParams &style = CStyleParams()); void addImageDownload(const std::string &url, CViewBase *img, const CStyleParams &style = CStyleParams(), const TImageType type = NormalImage);
std::string localImageName(const std::string &url); std::string localImageName(const std::string &url);
std::string getAbsoluteUrl(const std::string &url); std::string getAbsoluteUrl(const std::string &url);
bool isTrustedDomain(const std::string &domain); bool isTrustedDomain(const std::string &domain);
void setImage(CViewBase *view, const std::string &file); void setImage(CViewBase *view, const std::string &file, const TImageType type);
void setImageSize(CViewBase *view, const CStyleParams &style = CStyleParams()); void setImageSize(CViewBase *view, const CStyleParams &style = CStyleParams());
// BnpDownload system // BnpDownload system
void initBnpDownload(); void initBnpDownload();
void checkBnpDownload(); void checkBnpDownload();
bool addBnpDownload(const std::string &url, const std::string &action, const std::string &script, const std::string &md5sum); bool addBnpDownload(std::string url, const std::string &action, const std::string &script, const std::string &md5sum);
std::string localBnpName(const std::string &url); std::string localBnpName(const std::string &url);
void releaseDownloads(); void releaseDownloads();

View file

@ -97,6 +97,7 @@ namespace NLGUI
void addChildSortedByBitmap(SNode *pNode); void addChildSortedByBitmap(SNode *pNode);
void setParentTree(CGroupTree *parent); void setParentTree(CGroupTree *parent);
void setFather(SNode *father); void setFather(SNode *father);
void openAll();
void closeAll(); void closeAll();
void makeOrphan(); void makeOrphan();
bool parse (xmlNodePtr cur, CGroupTree *parentGroup); bool parse (xmlNodePtr cur, CGroupTree *parentGroup);

View file

@ -0,0 +1,77 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef CL_HTTP_CACHE_H
#define CL_HTTP_CACHE_H
#include "nel/misc/types_nl.h"
namespace NLGUI
{
struct CHttpCacheObject
{
CHttpCacheObject(uint32 expires = 0, const std::string& lastModified = "", const std::string& etag = "")
: Expires(expires)
, LastModified(lastModified)
, Etag(etag){};
uint32 Expires;
std::string LastModified;
std::string Etag;
void serial(NLMISC::IStream& f);
};
/**
* Keeping track of downloaded files cache related headers
* \author Meelis Mägi (nimetu)
* \date 2017
*/
class CHttpCache
{
typedef std::map<std::string, CHttpCacheObject> THttpCacheMap;
public:
static CHttpCache* getInstance();
static void release();
public:
void setCacheIndex(const std::string& fname);
void init();
CHttpCacheObject lookup(const std::string& fname);
void store(const std::string& fname, const CHttpCacheObject& data);
void flushCache();
void serial(NLMISC::IStream& f);
private:
CHttpCache();
~CHttpCache();
void pruneCache();
static CHttpCache* instance;
THttpCacheMap _List;
std::string _IndexFilename;
bool _Initialized;
size_t _MaxObjects;
};
}
#endif

View file

@ -0,0 +1,73 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef CL_HTTP_HSTS_H
#define CL_HTTP_HSTS_H
#include "nel/misc/types_nl.h"
namespace NLGUI
{
// ********************************************************************************
struct SHSTSObject
{
public:
SHSTSObject(uint64 expires = 0, bool includeSubDomains = false)
: Expires(expires)
, IncludeSubDomains(includeSubDomains)
{ }
uint64 Expires;
bool IncludeSubDomains;
};
/**
* Keeping track of HSTS header
* \author Meelis Mägi (nimetu)
* \date 2017
*/
class CStrictTransportSecurity
{
public:
typedef std::map<std::string, SHSTSObject> THSTSObject;
static CStrictTransportSecurity* getInstance();
static void release();
public:
bool isSecureHost(const std::string &domain) const;
// ************************************************************************
void init(const std::string& fname);
void save();
void erase(const std::string &domain);
void set(const std::string &domain, uint64 expires, bool includeSubDomains);
bool get(const std::string &domain, SHSTSObject &hsts) const;
void setFromHeader(const std::string &domain, const std::string &header);
void serial(NLMISC::IStream& f);
private:
static CStrictTransportSecurity* instance;
~CStrictTransportSecurity();
std::string _Filename;
THSTSObject _Domains;
};
}
#endif

View file

@ -94,6 +94,7 @@ namespace NLGUI
_XReal = _YReal = _WReal = _HReal = 0; _XReal = _YReal = _WReal = _HReal = 0;
_X = _Y = _W = _H = 0; _X = _Y = _W = _H = 0;
//_Snap = 1; //_Snap = 1;
_MarginLeft = 0;
_PosRef = Hotspot_BL; _PosRef = Hotspot_BL;
_ParentPosRef = Hotspot_BL; _ParentPosRef = Hotspot_BL;
@ -178,6 +179,9 @@ namespace NLGUI
sint32 getH() const { return (_Active?_H:0); } sint32 getH() const { return (_Active?_H:0); }
sint32 getH(bool bTestActive) const { return (bTestActive?(_Active?_H:0):_H); } sint32 getH(bool bTestActive) const { return (bTestActive?(_Active?_H:0):_H); }
void setMarginLeft(sint32 m) { _MarginLeft = m; }
sint32 getMarginLeft() const { return _MarginLeft; }
/** /**
* Get the max width used by the window. * Get the max width used by the window.
* *
@ -568,6 +572,8 @@ namespace NLGUI
sint32 _W; sint32 _W;
sint32 _H; sint32 _H;
sint32 _MarginLeft;
//sint32 _Snap; //sint32 _Snap;
// position references e.g. : _PosRef=BL, _ParentPosref=MM : the bottom left corner of the element // position references e.g. : _PosRef=BL, _ParentPosref=MM : the bottom left corner of the element

View file

@ -149,6 +149,8 @@ namespace NLGUI
HTML_ATTR(IMG,USEMAP), HTML_ATTR(IMG,USEMAP),
HTML_ATTR(IMG,VSPACE), HTML_ATTR(IMG,VSPACE),
HTML_ATTR(IMG,WIDTH), HTML_ATTR(IMG,WIDTH),
// not sorted to keep enum values
HTML_ATTR(IMG,DATA_OVER_SRC),
}; };
enum enum

View file

@ -93,7 +93,7 @@ namespace NLGUI
void setMultiLineSpace (sint nMultiLineSpace); void setMultiLineSpace (sint nMultiLineSpace);
void setMultiLineMaxWOnly (bool state); void setMultiLineMaxWOnly (bool state);
void setMultiLineClipEndSpace (bool state); // use it for multiline edit box for instance void setMultiLineClipEndSpace (bool state); // use it for multiline edit box for instance
void setFirstLineX (uint firstLineX); void setFirstLineX (sint firstLineX);
void setMultiMaxLine(uint l) { _MultiMaxLine = l; } void setMultiMaxLine(uint l) { _MultiMaxLine = l; }
void setMultiMinLine(uint l) { _MultiMinLine = l; } void setMultiMinLine(uint l) { _MultiMinLine = l; }
@ -398,7 +398,7 @@ namespace NLGUI
uint _TextSelectionEnd; uint _TextSelectionEnd;
// First line X coordinate // First line X coordinate
uint _FirstLineX; sint _FirstLineX;
/// Dynamic tooltips /// Dynamic tooltips
std::vector<CCtrlToolTip*> _Tooltips; std::vector<CCtrlToolTip*> _Tooltips;

View file

@ -110,6 +110,11 @@ public:
*/ */
bool init (IStream &stream); bool init (IStream &stream);
/** Return the error string.
* if not empty, something wrong appends
*/
static std::string getErrorString();
/** Release the resources used by the stream. /** Release the resources used by the stream.
*/ */
void release (); void release ();
@ -172,7 +177,12 @@ public:
static bool getContentString (std::string &result, xmlNodePtr node); static bool getContentString (std::string &result, xmlNodePtr node);
/** /**
* Release meory used by libxml2, to only call before exit. * Init all structures used by libxml2, to only call once.
*/
static void initLibXml();
/**
* Release memory used by libxml2, to only call before exit.
*/ */
static void releaseLibXml(); static void releaseLibXml();
@ -234,13 +244,16 @@ private:
uint _ContentStringIndex; uint _ContentStringIndex;
// Error message // Error message
std::string _ErrorString; static std::string _ErrorString;
// Try binary mode // Try binary mode
bool _TryBinaryMode; bool _TryBinaryMode;
// If not NULL, binary mode detected, use this stream in serials // If not NULL, binary mode detected, use this stream in serials
IStream *_BinaryStream; IStream *_BinaryStream;
// LibXml has been initialized
static bool _LibXmlIntialized;
}; };

View file

@ -80,7 +80,6 @@ class COXml : public IStream
{ {
friend int xmlOutputWriteCallbackForNeL ( void *context, const char *buffer, int len ); friend int xmlOutputWriteCallbackForNeL ( void *context, const char *buffer, int len );
friend int xmlOutputCloseCallbackForNeL ( void *context ); friend int xmlOutputCloseCallbackForNeL ( void *context );
friend void xmlGenericErrorFuncWrite (void *ctx, const char *msg, ...);
public: public:
/** Stream ctor /** Stream ctor
@ -100,7 +99,7 @@ public:
/** Return the error string. /** Return the error string.
* if not empty, something wrong appends * if not empty, something wrong appends
*/ */
const char *getErrorString () const; static std::string getErrorString ();
/** Default dstor /** Default dstor
* *
@ -178,9 +177,6 @@ private:
// Current content string // Current content string
std::string _ContentString; std::string _ContentString;
// Error message
std::string _ErrorString;
}; };

View file

@ -166,6 +166,10 @@
# define NL_ISO_CPP0X_AVAILABLE # define NL_ISO_CPP0X_AVAILABLE
#endif #endif
#if defined(NL_COMP_GCC) && (__cplusplus >= 201103L)
# define NL_NO_EXCEPTION_SPECS
#endif
// gcc 3.4 introduced ISO C++ with tough template rules // gcc 3.4 introduced ISO C++ with tough template rules
// //
// NL_ISO_SYNTAX can be used using #if NL_ISO_SYNTAX or #if !NL_ISO_SYNTAX // NL_ISO_SYNTAX can be used using #if NL_ISO_SYNTAX or #if !NL_ISO_SYNTAX
@ -407,12 +411,21 @@ typedef unsigned int uint; // at least 32bits (depend of processor)
#ifndef NL_CPU_X86_64 #ifndef NL_CPU_X86_64
// on x86_64, new and delete are already aligned on 16 bytes // on x86_64, new and delete are already aligned on 16 bytes
#ifdef NL_NO_EXCEPTION_SPECS
extern void *operator new(size_t size);
extern void *operator new[](size_t size);
extern void operator delete(void *p) noexcept;
extern void operator delete[](void *p) noexcept;
#else
extern void *operator new(size_t size) throw(std::bad_alloc); extern void *operator new(size_t size) throw(std::bad_alloc);
extern void *operator new[](size_t size) throw(std::bad_alloc); extern void *operator new[](size_t size) throw(std::bad_alloc);
extern void operator delete(void *p) throw(); extern void operator delete(void *p) throw();
extern void operator delete[](void *p) throw(); extern void operator delete[](void *p) throw();
#endif #endif
#endif
#else /* NL_HAS_SSE2 */ #else /* NL_HAS_SSE2 */
#define NL_DEFAULT_MEMORY_ALIGNMENT 4 #define NL_DEFAULT_MEMORY_ALIGNMENT 4

View file

@ -32,6 +32,10 @@
#include "driver_direct3d.h" #include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

View file

@ -480,12 +480,21 @@ public:
virtual ~CStateRecord() {} virtual ~CStateRecord() {}
// use STL allocator for fast alloc. this works because objects are small ( < 128 bytes) // use STL allocator for fast alloc. this works because objects are small ( < 128 bytes)
void *operator new(size_t size) { return CStateRecord::Allocator.allocate(size); } void *operator new(size_t size) { return CStateRecord::Allocator.allocate(size); }
void *operator new(size_t size, int /* blockUse */, char const * /* fileName */, int /* lineNumber */)
{
// TODO: add memory leaks detector
return CStateRecord::Allocator.allocate(size);
}
void operator delete(void *block) { CStateRecord::Allocator.deallocate((uint8 *) block, 1); } void operator delete(void *block) { CStateRecord::Allocator.deallocate((uint8 *) block, 1); }
void operator delete(void *block, int /* blockUse */, char const* /* fileName */, int /* lineNumber */)
{
// TODO: add memory leaks detector
CStateRecord::Allocator.deallocate((uint8 *)block, 1);
}
static std::allocator<uint8> Allocator; static std::allocator<uint8> Allocator;
}; };
// record of a single .fx pass // record of a single .fx pass
class CFXPassRecord class CFXPassRecord
{ {

View file

@ -25,6 +25,10 @@
#include "driver_direct3d.h" #include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

View file

@ -17,6 +17,10 @@
#include "stddirect3d.h" #include "stddirect3d.h"
#include "driver_direct3d.h" #include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

View file

@ -26,6 +26,10 @@
#include "driver_direct3d.h" #include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

View file

@ -27,6 +27,10 @@
#include "driver_direct3d.h" #include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

View file

@ -26,6 +26,10 @@
#include "driver_direct3d.h" #include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

View file

@ -29,6 +29,10 @@
#include "driver_direct3d.h" #include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

View file

@ -19,6 +19,10 @@
#include "driver_direct3d.h" #include "driver_direct3d.h"
#include "nel/misc/hierarchical_timer.h" #include "nel/misc/hierarchical_timer.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

View file

@ -27,6 +27,10 @@
#include "driver_direct3d.h" #include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

View file

@ -20,6 +20,10 @@
#include "nel/misc/path.h" #include "nel/misc/path.h"
#include "nel/misc/file.h" #include "nel/misc/file.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

View file

@ -26,6 +26,10 @@
#include "driver_direct3d.h" #include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

View file

@ -18,6 +18,10 @@
#include "driver_direct3d.h" #include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

View file

@ -26,6 +26,10 @@
#include "driver_direct3d.h" #include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

View file

@ -18,6 +18,10 @@
#include "driver_direct3d.h" #include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

View file

@ -30,6 +30,14 @@ ELSE()
SET(NLDRV_OGL_LIB "nel_drv_opengl") SET(NLDRV_OGL_LIB "nel_drv_opengl")
ENDIF() ENDIF()
# This helps to debug issue 310
IF(DEBUG_OGL_SPECULAR_FALLBACK)
ADD_DEFINITIONS(-DDEBUG_OGL_SPECULAR_FALLBACK)
ENDIF()
IF(DEBUG_OGL_COMBINE43_DISABLE)
ADD_DEFINITIONS(-DDEBUG_OGL_COMBINE43_DISABLE)
ENDIF()
NL_TARGET_DRIVER(${NLDRV_OGL_LIB} ${SRC}) NL_TARGET_DRIVER(${NLDRV_OGL_LIB} ${SRC})
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})

View file

@ -786,7 +786,13 @@ static bool setupNVTextureEnvCombine4(const char *glext)
{ {
H_AUTO_OGL(setupNVTextureEnvCombine4); H_AUTO_OGL(setupNVTextureEnvCombine4);
CHECK_EXT("GL_NV_texture_env_combine4"); CHECK_EXT("GL_NV_texture_env_combine4");
#ifdef DEBUG_OGL_COMBINE43_DISABLE
// issue 310: disable extension to debug bug around CDriverGL::setupSpecularPass()
nlwarning("GL_NV_texture_env_combine4 disabled by request (DEBUG_OGL_COMBINE43_DISABLE)");
return false;
#else
return true; return true;
#endif
} }
// ********************************* // *********************************
@ -802,7 +808,13 @@ static bool setupATITextureEnvCombine3(const char *glext)
// #endif // #endif
CHECK_EXT("GL_ATI_texture_env_combine3"); CHECK_EXT("GL_ATI_texture_env_combine3");
#ifdef DEBUG_OGL_COMBINE43_DISABLE
// issue 310: disable extension to debug bug around CDriverGL::setupSpecularPass()
nlwarning("GL_ATI_texture_env_combine3 disabled by request (DEBUG_OGL_COMBINE43_DISABLE)");
return false;
#else
return true; return true;
#endif
} }
// ********************************* // *********************************

View file

@ -1425,6 +1425,11 @@ void CDriverGL::setupSpecularPass(uint pass)
} }
else else
{ {
// Disabled because of Intel GPU texture bug (issue 310)
// CMake options to debug
// -DDEBUG_OGL_SPECULAR_FALLBACK=ON enables this
// -DDEBUG_OGL_COMBINE43_DISABLE=ON disables GL_NV_texture_env_combine4/GL_ATI_texture_env_combine3
#ifdef DEBUG_OGL_SPECULAR_FALLBACK
// Multiply texture1 by alpha_texture0 and display with add // Multiply texture1 by alpha_texture0 and display with add
_DriverGLStates.enableBlend(true); _DriverGLStates.enableBlend(true);
_DriverGLStates.blendFunc(GL_ONE, GL_ONE); _DriverGLStates.blendFunc(GL_ONE, GL_ONE);
@ -1457,6 +1462,7 @@ void CDriverGL::setupSpecularPass(uint pass)
} }
activateTexEnvMode(1, env); activateTexEnvMode(1, env);
#endif // DEBUG_OGL_SPECULAR_FALLBACK
} }
} }
} }

View file

@ -226,7 +226,8 @@ void CMeshVPWindTree::initVertexPrograms()
{ {
// setup of the VPLight fragment // setup of the VPLight fragment
uint numPls= i/4; uint numPls= i/4;
bool normalize= (i&1)!=0; // FIXME: normalize=true makes trees dance, workaround for issue #160
bool normalize= false; //(i&1)!=0;
bool specular= (i&2)!=0; bool specular= (i&2)!=0;
// combine // combine

View file

@ -24,6 +24,10 @@
#include "nel/georges/form.h" #include "nel/georges/form.h"
#include "nel/georges/form_loader.h" #include "nel/georges/form_loader.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
namespace NLGEORGES namespace NLGEORGES

View file

@ -24,6 +24,10 @@
#include "nel/georges/form_loader.h" #include "nel/georges/form_loader.h"
#include "nel/georges/form_elm.h" #include "nel/georges/form_elm.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
using namespace std; using namespace std;

View file

@ -25,6 +25,10 @@
#include "nel/georges/form_loader.h" #include "nel/georges/form_loader.h"
#include "nel/georges/type.h" #include "nel/georges/type.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
using namespace std; using namespace std;

View file

@ -27,6 +27,10 @@
#include "nel/georges/form.h" #include "nel/georges/form.h"
#include "nel/georges/form_dfn.h" #include "nel/georges/form_dfn.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
using namespace std; using namespace std;

View file

@ -22,6 +22,10 @@
#include "nel/georges/header.h" #include "nel/georges/header.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
namespace NLGEORGES namespace NLGEORGES

View file

@ -14,6 +14,16 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef STDGEORGES_H
#define STDGEORGES_H
#if defined(_MSC_VER) && defined(_DEBUG)
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
#endif
#include "nel/misc/types_nl.h" #include "nel/misc/types_nl.h"
#include <cmath> #include <cmath>
#include <list> #include <list>
@ -27,3 +37,5 @@
// Include from libxml2 // Include from libxml2
#include <libxml/parser.h> #include <libxml/parser.h>
#endif

View file

@ -27,6 +27,10 @@
#include "nel/georges/form_loader.h" #include "nel/georges/form_loader.h"
#include "nel/georges/type.h" #include "nel/georges/type.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
using namespace std; using namespace std;

View file

@ -0,0 +1,123 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//#include <crtdbg.h>
#include "stdpch.h"
#include "nel/gui/curl_certificates.h"
#include <openssl/x509.h>
#include <openssl/ssl.h>
#if defined(NL_OS_WINDOWS)
#pragma comment(lib, "crypt32.lib")
#pragma comment(lib, "cryptui.lib")
#endif
using namespace std;
using namespace NLMISC;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLGUI
{
#if defined(NL_OS_WINDOWS)
static std::vector<X509 *> x509CertList;
//
// x509CertList lifetime manager
//
class SX509Certificates {
public:
SX509Certificates()
{
curl_version_info_data *data;
data = curl_version_info(CURLVERSION_NOW);
if (!(data && data->features & CURL_VERSION_SSPI))
{
addCertificatesFrom("CA");
addCertificatesFrom("AuthRoot");
addCertificatesFrom("ROOT");
}
}
~SX509Certificates()
{
for (uint i = 0; i < x509CertList.size(); ++i)
{
X509_free(x509CertList[i]);
}
x509CertList.clear();
}
void addCertificatesFrom(LPCSTR root)
{
HCERTSTORE hStore;
PCCERT_CONTEXT pContext = NULL;
X509 *x509;
hStore = CertOpenSystemStore(NULL, root);
if (hStore)
{
while (pContext = CertEnumCertificatesInStore(hStore, pContext))
{
x509 = NULL;
x509 = d2i_X509(NULL, (const unsigned char **)&pContext->pbCertEncoded, pContext->cbCertEncoded);
if (x509)
{
x509CertList.push_back(x509);
}
}
CertFreeCertificateContext(pContext);
CertCloseStore(hStore, 0);
}
// this is called before debug context is set and log ends up in log.log
//nlinfo("Loaded %d certificates from '%s' certificate store", List.size(), root);
}
};
/// this will be initialized on startup and cleared on exit
static SX509Certificates x509CertListManager;
// ***************************************************************************
// static
CURLcode CCurlCertificates::sslCtxFunction(CURL *curl, void *sslctx, void *parm)
{
if (x509CertList.size() > 0)
{
SSL_CTX *ctx = (SSL_CTX*)sslctx;
X509_STORE *x509store = SSL_CTX_get_cert_store(ctx);
if (x509store)
{
for (uint i = 0; i < x509CertList.size(); ++i)
{
X509_STORE_add_cert(x509store, x509CertList[i]);
}
}
else
{
nlwarning("SSL_CTX_get_cert_store returned NULL");
}
}
return CURLE_OK;
}
#endif // NL_OS_WINDOWS
}// namespace

View file

@ -77,6 +77,7 @@ namespace NLGUI
_ResetFocusOnHide(false), _ResetFocusOnHide(false),
_BackupFatherContainerPos(false), _BackupFatherContainerPos(false),
_WantReturn(false), _WantReturn(false),
_ClearOnEscape(false),
_Savable(true), _Savable(true),
_DefaultInputString(false), _DefaultInputString(false),
_Frozen(false), _Frozen(false),
@ -239,6 +240,11 @@ namespace NLGUI
return toString( _WantReturn ); return toString( _WantReturn );
} }
else else
if( name == "clear_on_escape" )
{
return toString( _ClearOnEscape );
}
else
if( name == "savable" ) if( name == "savable" )
{ {
return toString( _Savable ); return toString( _Savable );
@ -413,6 +419,14 @@ namespace NLGUI
return; return;
} }
else else
if( name == "clear_on_escape" )
{
bool b;
if( fromString( value, b ) )
_ClearOnEscape = b;
return;
}
else
if( name == "savable" ) if( name == "savable" )
{ {
bool b; bool b;
@ -514,6 +528,7 @@ namespace NLGUI
xmlSetProp( node, BAD_CAST "backup_father_container_pos", xmlSetProp( node, BAD_CAST "backup_father_container_pos",
BAD_CAST toString( _BackupFatherContainerPos ).c_str() ); BAD_CAST toString( _BackupFatherContainerPos ).c_str() );
xmlSetProp( node, BAD_CAST "want_return", BAD_CAST toString( _WantReturn ).c_str() ); xmlSetProp( node, BAD_CAST "want_return", BAD_CAST toString( _WantReturn ).c_str() );
xmlSetProp( node, BAD_CAST "clear_on_escape", BAD_CAST toString( _ClearOnEscape ).c_str() );
xmlSetProp( node, BAD_CAST "savable", BAD_CAST toString( _Savable ).c_str() ); xmlSetProp( node, BAD_CAST "savable", BAD_CAST toString( _Savable ).c_str() );
xmlSetProp( node, BAD_CAST "max_float_prec", BAD_CAST toString( _MaxFloatPrec ).c_str() ); xmlSetProp( node, BAD_CAST "max_float_prec", BAD_CAST toString( _MaxFloatPrec ).c_str() );
@ -620,6 +635,9 @@ namespace NLGUI
prop = (char*) xmlGetProp( cur, (xmlChar*)"want_return" ); prop = (char*) xmlGetProp( cur, (xmlChar*)"want_return" );
if (prop) _WantReturn = convertBool(prop); if (prop) _WantReturn = convertBool(prop);
prop = (char*) xmlGetProp( cur, (xmlChar*)"clear_on_escape" );
if (prop) _ClearOnEscape = convertBool(prop);
prop = (char*) xmlGetProp( cur, (xmlChar*)"savable" ); prop = (char*) xmlGetProp( cur, (xmlChar*)"savable" );
if (prop) _Savable = convertBool(prop); if (prop) _Savable = convertBool(prop);
@ -991,6 +1009,11 @@ namespace NLGUI
// stop selection // stop selection
_CurrSelection = NULL; _CurrSelection = NULL;
_CursorAtPreviousLineEnd = false; _CursorAtPreviousLineEnd = false;
if (_ClearOnEscape)
{
setInputString(ucstring(""));
triggerOnChangeAH();
}
break; break;
case KeyTAB: case KeyTAB:
makeTopWindow(); makeTopWindow();

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1209,6 +1209,13 @@ namespace NLGUI
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
sint32 CGroupTable::getMaxUsedW() const sint32 CGroupTable::getMaxUsedW() const
{ {
// Return table width if its requested by user.
// Need to do this because width of long line of text in here is calculated
// differently than final cell width in updateCoords()
// This will break tables with too narrow width set by user.
if (ForceWidthMin > 0)
return ForceWidthMin;
uint i; uint i;
uint column = 0; uint column = 0;
vector<sint32> columns; vector<sint32> columns;

View file

@ -271,6 +271,14 @@ namespace NLGUI
pNode->setFather(this); pNode->setFather(this);
} }
// ----------------------------------------------------------------------------
void CGroupTree::SNode::openAll()
{
Opened = true;
for (uint i = 0; i < Children.size(); ++i)
Children[i]->openAll();
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void CGroupTree::SNode::closeAll() void CGroupTree::SNode::closeAll()
{ {
@ -1082,7 +1090,9 @@ namespace NLGUI
} }
} }
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown) bool toggleOne = (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown);
bool toggleAll = (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown);
if (toggleOne || toggleAll)
{ {
// line selection // line selection
if (bText) if (bText)
@ -1118,6 +1128,13 @@ namespace NLGUI
{ {
// open/close the node // open/close the node
changedNode->Opened = !changedNode->Opened; changedNode->Opened = !changedNode->Opened;
if (toggleAll)
{
if (changedNode->Opened)
changedNode->openAll();
else
changedNode->closeAll();
}
} }
// else must close all necessary nodes. // else must close all necessary nodes.
else else

View file

@ -0,0 +1,212 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdpch.h"
#include "nel/gui/http_cache.h"
using namespace std;
using namespace NLMISC;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
#if defined(GCC_VERSION) && !defined(CLANG_VERSION) && defined(NL_ISO_CPP0X_AVAILABLE) && (GCC_VERSION <= 40804)
// hack to fix std::map::erase wrong return type (void instead of iterator in C++11) in GCC 4.8.4
#undef NL_ISO_CPP0X_AVAILABLE
#endif
namespace NLGUI
{
CHttpCache* CHttpCache::instance = NULL;
CHttpCache* CHttpCache::getInstance()
{
if (!instance)
{
instance = new CHttpCache();
}
return instance;
}
void CHttpCache::release()
{
delete instance;
instance = NULL;
}
CHttpCache::CHttpCache()
: _Initialized(false)
, _MaxObjects(100)
{ };
CHttpCache::~CHttpCache()
{
flushCache();
}
void CHttpCache::setCacheIndex(const std::string& fname)
{
_IndexFilename = fname;
_Initialized = false;
}
CHttpCacheObject CHttpCache::lookup(const std::string& fname)
{
if (!_Initialized)
init();
if (_List.count(fname) > 0)
return _List[fname];
return CHttpCacheObject();
}
void CHttpCache::store(const std::string& fname, const CHttpCacheObject& data)
{
if (!_Initialized)
init();
_List[fname] = data;
}
void CHttpCache::init()
{
if (_Initialized)
return;
_Initialized = true;
if (_IndexFilename.empty() || !CFile::fileExists(_IndexFilename))
return;
CIFile in;
if (!in.open(_IndexFilename)) {
nlwarning("Unable to open %s for reading", _IndexFilename.c_str());
return;
}
serial(in);
}
void CHttpCacheObject::serial(NLMISC::IStream& f)
{
f.serialVersion(1);
f.serial(Expires);
f.serial(LastModified);
f.serial(Etag);
}
void CHttpCache::serial(NLMISC::IStream& f)
{
// saved state is ignored when version checks fail
try {
f.serialVersion(1);
// CacheIdx
f.serialCheck(NELID("hcaC"));
f.serialCheck(NELID("xdIe"));
if (f.isReading())
{
uint32 numFiles;
f.serial(numFiles);
_List.clear();
for (uint k = 0; k < numFiles; ++k)
{
std::string fname;
f.serial(fname);
CHttpCacheObject obj;
obj.serial(f);
_List[fname] = obj;
}
}
else
{
uint32 numFiles = _List.size();
f.serial(numFiles);
for (THttpCacheMap::iterator it = _List.begin(); it != _List.end(); ++it)
{
std::string fname(it->first);
f.serial(fname);
(*it).second.serial(f);
}
}
} catch (...) {
_List.clear();
nlwarning("Invalid cache index format (%s)", _IndexFilename.c_str());
return;
}
}
void CHttpCache::pruneCache()
{
if (_List.size() < _MaxObjects)
return;
size_t mustDrop = _List.size() - _MaxObjects;
time_t currentTime;
time(&currentTime);
// if we over object limit, then start removing expired objects
// this does not guarantee that max limit is reached
for (THttpCacheMap::iterator it = _List.begin(); it != _List.end();)
{
if (it->second.Expires <= currentTime)
{
#ifdef NL_ISO_CPP0X_AVAILABLE
it = _List.erase(it);
#else
THttpCacheMap::iterator itToErase = it++;
_List.erase(itToErase);
#endif
--mustDrop;
if (mustDrop == 0)
break;
}
else
{
++it;
}
}
}
void CHttpCache::flushCache()
{
if (_IndexFilename.empty())
return;
pruneCache();
COFile out;
if (!out.open(_IndexFilename))
{
nlwarning("Unable to open %s for writing", _IndexFilename.c_str());
return;
}
serial(out);
out.close();
}
}

View file

@ -0,0 +1,245 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdpch.h"
#include "nel/gui/http_hsts.h"
using namespace std;
using namespace NLMISC;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLGUI {
CStrictTransportSecurity* CStrictTransportSecurity::instance = NULL;
CStrictTransportSecurity* CStrictTransportSecurity::getInstance()
{
if (!instance)
{
instance= new CStrictTransportSecurity();
}
return instance;
}
void CStrictTransportSecurity::release()
{
delete instance;
instance = NULL;
}
CStrictTransportSecurity::~CStrictTransportSecurity()
{
save();
}
// ************************************************************************
bool CStrictTransportSecurity::isSecureHost(const std::string &domain) const
{
SHSTSObject hsts;
if (get(domain, hsts))
{
time_t currentTime;
time(&currentTime);
return (hsts.Expires < currentTime);
}
return false;
}
// ************************************************************************
void CStrictTransportSecurity::erase(const std::string &domain)
{
if (_Domains.count(domain) > 0)
{
_Domains.erase(domain);
}
}
void CStrictTransportSecurity::set(const std::string &domain, uint64 expires, bool includeSubDomains)
{
if (expires == 0)
{
erase(domain);
return;
}
_Domains[domain].Expires = expires;
_Domains[domain].IncludeSubDomains = includeSubDomains;
}
bool CStrictTransportSecurity::get(const std::string &domain, SHSTSObject &hsts) const
{
if (domain.empty() || _Domains.empty())
return false;
if (_Domains.count(domain) > 0)
{
hsts = _Domains.at(domain);
return true;
}
size_t firstOf = domain.find_first_of(".");
size_t lastOf = domain.find_last_of(".");
while(firstOf != lastOf)
{
std::string tmp;
tmp = domain.substr(firstOf+1);
if (_Domains.count(tmp))
{
if (_Domains.at(tmp).IncludeSubDomains)
{
hsts = _Domains.at(tmp);
return true;
}
return false;
}
firstOf = domain.find_first_of(".", firstOf + 1);
}
return false;
}
void CStrictTransportSecurity::init(const std::string &fname)
{
_Domains.clear();
_Filename = fname;
if (_Filename.empty() || !CFile::fileExists(_Filename))
{
return;
}
CIFile in;
if (!in.open(_Filename))
{
nlwarning("Unable to open %s for reading", _Filename.c_str());
return;
}
serial(in);
}
void CStrictTransportSecurity::save()
{
if (_Filename.empty())
return;
if (_Domains.empty())
{
CFile::deleteFile(_Filename);
return;
}
COFile out;
if (!out.open(_Filename))
{
nlwarning("Unable to open %s for writing", _Filename.c_str());
return;
}
serial(out);
out.close();
}
void CStrictTransportSecurity::serial(NLMISC::IStream& f)
{
try
{
f.serialVersion(1);
// HSTS
f.serialCheck(NELID("STSH"));
if (f.isReading())
{
uint32 nbItems;
f.serial(nbItems);
for(uint32 k = 0; k < nbItems; ++k)
{
std::string domain;
f.serial(domain);
f.serial(_Domains[domain].Expires);
f.serial(_Domains[domain].IncludeSubDomains);
}
}
else
{
uint32 nbItems = _Domains.size();
f.serial(nbItems);
for (THSTSObject::iterator it = _Domains.begin(); it != _Domains.end(); ++it)
{
std::string domain(it->first);
f.serial(domain);
f.serial(_Domains[domain].Expires);
f.serial(_Domains[domain].IncludeSubDomains);
}
}
}
catch (...)
{
_Domains.clear();
nlwarning("Invalid HTST file format (%s)", _Filename.c_str());
}
}
// ***************************************************************************
void CStrictTransportSecurity::setFromHeader(const std::string &domain, const std::string &header)
{
// max-age=<seconds>; includeSubdomains; preload;
std::vector<std::string> elements;
NLMISC::splitString(toLower(header), ";", elements);
if (elements.empty()) return;
time_t currentTime;
time(&currentTime);
uint64 expire = 0;
bool includeSubDomains = false;
for(uint i=0; i< elements.size(); ++i)
{
std::string str(trim(elements[i]));
if (str.substr(0, 8) == "max-age=")
{
uint64 ttl;
if (fromString(str.substr(8), ttl))
{
if (ttl > 0)
{
expire = currentTime + ttl;
}
}
}
else if (str == "includesubdomains")
{
includeSubDomains = true;
}
}
if (expire == 0)
{
erase(domain);
}
else
{
set(domain, expire, includeSubDomains);
}
}
}

View file

@ -509,7 +509,7 @@ namespace NLGUI
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
void CInterfaceElement::updateCoords() void CInterfaceElement::updateCoords()
{ {
_XReal = _X; _XReal = _X + _MarginLeft;
_YReal = _Y; _YReal = _Y;
_WReal = getW(); _WReal = getW();
_HReal = getH(); _HReal = getH();
@ -526,7 +526,7 @@ namespace NLGUI
if (el == NULL) if (el == NULL)
return; return;
_XReal += el->_XReal; _XReal += el->_XReal - el->_MarginLeft;
_YReal += el->_YReal; _YReal += el->_YReal;
THotSpot hsParent = _ParentPosRef; THotSpot hsParent = _ParentPosRef;

View file

@ -1457,7 +1457,7 @@ namespace NLGUI
} }
CViewBase::updateCoords(); CViewBase::updateCoords();
_XReal += _OffsetX; _XReal += _OffsetX + _MarginLeft;
_YReal += _OffsetY; _YReal += _OffsetY;
//update all children elements //update all children elements
@ -1468,7 +1468,7 @@ namespace NLGUI
pIE->updateCoords(); pIE->updateCoords();
} }
_XReal -= _OffsetX; _XReal -= _OffsetX - _MarginLeft;
_YReal -= _OffsetY; _YReal -= _OffsetY;
} }
@ -1958,9 +1958,9 @@ namespace NLGUI
newSciH = newSciH - ((newSciY+newSciH)-(oldSciY+oldSciH)); newSciH = newSciH - ((newSciY+newSciH)-(oldSciY+oldSciH));
} }
newSciXDest = newSciX; newSciXDest = newSciX - _MarginLeft;
newSciYDest = newSciY; newSciYDest = newSciY;
newSciWDest = newSciW; newSciWDest = newSciW + _MarginLeft;
newSciHDest = newSciH; newSciHDest = newSciH;
} }

View file

@ -150,6 +150,8 @@ namespace NLGUI
HTML_ATTR(IMG,USEMAP), HTML_ATTR(IMG,USEMAP),
HTML_ATTR(IMG,VSPACE), HTML_ATTR(IMG,VSPACE),
HTML_ATTR(IMG,WIDTH), HTML_ATTR(IMG,WIDTH),
// not sorted to keep enum values
HTML_ATTR(IMG,DATA-OVER-SRC),
{ 0 } { 0 }
}; };

View file

@ -26,6 +26,7 @@
#include <string> #include <string>
#include <limits> #include <limits>
#include <ctime>
#include "nel/misc/types_nl.h" #include "nel/misc/types_nl.h"
#include "nel/misc/algo.h" #include "nel/misc/algo.h"

View file

@ -2494,7 +2494,7 @@ namespace NLGUI
} }
// *************************************************************************** // ***************************************************************************
void CViewText::setFirstLineX(uint firstLineX) void CViewText::setFirstLineX(sint firstLineX)
{ {
_FirstLineX = firstLineX; _FirstLineX = firstLineX;
} }

View file

@ -202,7 +202,9 @@ ENDIF()
IF(UNIX) IF(UNIX)
TARGET_LINK_LIBRARIES(nelmisc -lc -ldl) TARGET_LINK_LIBRARIES(nelmisc -lc -ldl)
IF(NOT APPLE) IF(APPLE)
TARGET_LINK_LIBRARIES(nelmisc ${CARBON_FRAMEWORK})
ELSE()
TARGET_LINK_LIBRARIES(nelmisc -lrt) TARGET_LINK_LIBRARIES(nelmisc -lrt)
ENDIF() ENDIF()
ENDIF() ENDIF()

View file

@ -82,6 +82,31 @@ extern "C" long _ftol2( double dblSource ) { return _ftol( dblSource ); }
#if defined(NL_HAS_SSE2) && !defined(NL_CPU_X86_64) #if defined(NL_HAS_SSE2) && !defined(NL_CPU_X86_64)
#ifdef NL_NO_EXCEPTION_SPECS
void *operator new(size_t size)
{
void *p = aligned_malloc(size, NL_DEFAULT_MEMORY_ALIGNMENT);
if (p == NULL) throw std::bad_alloc();
return p;
}
void *operator new[](size_t size)
{
void *p = aligned_malloc(size, NL_DEFAULT_MEMORY_ALIGNMENT);
if (p == NULL) throw std::bad_alloc();
return p;
}
void operator delete(void *p) noexcept
{
aligned_free(p);
}
void operator delete[](void *p) noexcept
{
aligned_free(p);
}
#else
void *operator new(size_t size) throw(std::bad_alloc) void *operator new(size_t size) throw(std::bad_alloc)
{ {
void *p = aligned_malloc(size, NL_DEFAULT_MEMORY_ALIGNMENT); void *p = aligned_malloc(size, NL_DEFAULT_MEMORY_ALIGNMENT);
@ -105,6 +130,7 @@ void operator delete[](void *p) throw()
{ {
aligned_free(p); aligned_free(p);
} }
#endif
#endif /* NL_HAS_SSE2 */ #endif /* NL_HAS_SSE2 */

View file

@ -17,7 +17,6 @@
#include "stdmisc.h" #include "stdmisc.h"
#include "nel/misc/i_xml.h" #include "nel/misc/i_xml.h"
#include "nel/misc/sstring.h"
#ifndef NL_DONT_USE_EXTERNAL_CODE #ifndef NL_DONT_USE_EXTERNAL_CODE
@ -39,6 +38,10 @@ namespace NLMISC
const char SEPARATOR = ' '; const char SEPARATOR = ' ';
std::string CIXml::_ErrorString;
bool CIXml::_LibXmlIntialized = false;
// *************************************************************************** // ***************************************************************************
#define readnumber(dest,digits) \ #define readnumber(dest,digits) \
@ -124,7 +127,7 @@ void xmlGenericErrorFuncRead (void *ctx, const char *msg, ...)
// Get the error string // Get the error string
string str; string str;
NLMISC_CONVERT_VARGS (str, msg, NLMISC::MaxCStringSize); NLMISC_CONVERT_VARGS (str, msg, NLMISC::MaxCStringSize);
((CIXml*)ctx)->_ErrorString += str; CIXml::_ErrorString += str;
} }
// *************************************************************************** // ***************************************************************************
@ -134,7 +137,7 @@ bool CIXml::init (IStream &stream)
// Release // Release
release (); release ();
xmlInitParser(); initLibXml();
// Default : XML mode // Default : XML mode
_BinaryStream = NULL; _BinaryStream = NULL;
@ -190,12 +193,7 @@ bool CIXml::init (IStream &stream)
} }
} }
// Set error handler
_ErrorString.clear(); _ErrorString.clear();
xmlSetGenericErrorFunc (this, xmlGenericErrorFuncRead);
// Ask to get debug info
xmlLineNumbersDefault(1);
// The parser context // The parser context
_Parser = xmlCreatePushParserCtxt(NULL, NULL, buffer, 4, NULL); _Parser = xmlCreatePushParserCtxt(NULL, NULL, buffer, 4, NULL);
@ -1068,6 +1066,7 @@ bool CIXml::getPropertyString (std::string &result, xmlNodePtr node, const std::
// Found // Found
return true; return true;
} }
return false; return false;
} }
@ -1075,18 +1074,21 @@ bool CIXml::getPropertyString (std::string &result, xmlNodePtr node, const std::
int CIXml::getIntProperty(xmlNodePtr node, const std::string &property, int defaultValue) int CIXml::getIntProperty(xmlNodePtr node, const std::string &property, int defaultValue)
{ {
CSString s; std::string s;
bool b;
b=getPropertyString(s,node,property); bool b = getPropertyString(s, node, property);
if (b==false)
if (!b)
return defaultValue; return defaultValue;
s=s.strip(); // remove leading and trailing spaces
sint val=s.atoi(); s = trim(s);
if (val==0 && s!="0")
sint val;
if (!fromString(s, val) || (val == 0 && s != "0"))
{ {
nlwarning("bad integer value: %s",s.c_str()); nlwarning("Bad integer value: %s",s.c_str());
return defaultValue; return defaultValue;
} }
@ -1097,14 +1099,25 @@ int CIXml::getIntProperty(xmlNodePtr node, const std::string &property, int defa
double CIXml::getFloatProperty(xmlNodePtr node, const std::string &property, float defaultValue) double CIXml::getFloatProperty(xmlNodePtr node, const std::string &property, float defaultValue)
{ {
CSString s; std::string s;
bool b;
b=getPropertyString(s,node,property); bool b = getPropertyString(s, node, property);
if (b==false)
if (!b)
return defaultValue; return defaultValue;
return s.strip().atof(); // remove leading and trailing spaces
s = trim(s);
float val;
if (!fromString(s, val))
{
nlwarning("Bad float value: %s", s.c_str());
return defaultValue;
}
return val;
} }
// *************************************************************************** // ***************************************************************************
@ -1112,10 +1125,10 @@ double CIXml::getFloatProperty(xmlNodePtr node, const std::string &property, flo
std::string CIXml::getStringProperty(xmlNodePtr node, const std::string &property, const std::string& defaultValue) std::string CIXml::getStringProperty(xmlNodePtr node, const std::string &property, const std::string& defaultValue)
{ {
std::string s; std::string s;
bool b;
b=getPropertyString(s,node,property); bool b = getPropertyString(s, node, property);
if (b==false)
if (!b)
return defaultValue; return defaultValue;
return s; return s;
@ -1141,9 +1154,43 @@ bool CIXml::getContentString (std::string &result, xmlNodePtr node)
// *************************************************************************** // ***************************************************************************
void CIXml::initLibXml()
{
if (_LibXmlIntialized) return;
_ErrorString.clear();
// Set error handler
xmlSetGenericErrorFunc (NULL, xmlGenericErrorFuncRead);
LIBXML_TEST_VERSION
// an error occured during initialization
if (!_ErrorString.empty())
{
throw EXmlParsingError (_ErrorString);
}
// Ask to get debug info
xmlLineNumbersDefault(1);
_LibXmlIntialized = true;
}
// ***************************************************************************
void CIXml::releaseLibXml() void CIXml::releaseLibXml()
{ {
if (!_LibXmlIntialized) return;
xmlCleanupParser(); xmlCleanupParser();
_LibXmlIntialized = false;
}
std::string CIXml::getErrorString()
{
return _ErrorString;
} }
} // NLMISC } // NLMISC

View file

@ -17,6 +17,7 @@
#include "stdmisc.h" #include "stdmisc.h"
#include "nel/misc/o_xml.h" #include "nel/misc/o_xml.h"
#include "nel/misc/i_xml.h"
#ifndef NL_DONT_USE_EXTERNAL_CODE #ifndef NL_DONT_USE_EXTERNAL_CODE
@ -142,27 +143,15 @@ COXml::COXml () : IStream (false /* Output mode */)
// *************************************************************************** // ***************************************************************************
void xmlGenericErrorFuncWrite (void *ctx, const char *msg, ...)
{
// Get the error string
string str;
NLMISC_CONVERT_VARGS (str, msg, NLMISC::MaxCStringSize);
((COXml*)ctx)->_ErrorString += str;
}
// ***************************************************************************
bool COXml::init (IStream *stream, const std::string &version) bool COXml::init (IStream *stream, const std::string &version)
{ {
resetPtrTable(); resetPtrTable();
CIXml::initLibXml();
// Output stream ? // Output stream ?
if (!stream->isReading()) if (!stream->isReading())
{ {
// Set error handler
_ErrorString.clear();
xmlSetGenericErrorFunc (this, xmlGenericErrorFuncWrite);
// Set XML mode // Set XML mode
setXMLMode (true); setXMLMode (true);
@ -673,9 +662,10 @@ bool COXml::isStringValidForProperties (const std::string &str)
// *************************************************************************** // ***************************************************************************
const char *COXml::getErrorString () const std::string COXml::getErrorString()
{ {
return _ErrorString.c_str (); // error string is managed by CIXml
return CIXml::getErrorString();
} }
} // NLMISC } // NLMISC

View file

@ -1390,7 +1390,7 @@ uint64 CSystemInfo::availableHDSpace (const string &filename)
struct statfs stfs; struct statfs stfs;
if (::statfs(path.c_str(), &stfs) != 0) return 0; if (::statfs(path.c_str(), &stfs) != 0) return 0;
return (uint64)(stfs.f_bavail * stfs.f_bsize); return (uint64)stfs.f_bavail * (uint64)stfs.f_bsize;
#else #else
ULARGE_INTEGER freeSpace = {0}; ULARGE_INTEGER freeSpace = {0};
BOOL bRes = ::GetDiskFreeSpaceExW(utf8ToWide(path), &freeSpace, NULL, NULL); BOOL bRes = ::GetDiskFreeSpaceExW(utf8ToWide(path), &freeSpace, NULL, NULL);

View file

@ -23,6 +23,10 @@
#include <windows.h> #include <windows.h>
#include <mmsystem.h> #include <mmsystem.h>
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
using namespace std; using namespace std;

View file

@ -18,6 +18,9 @@
#include "listener_dsound.h" #include "listener_dsound.h"
#include "sound_driver_dsound.h" #include "sound_driver_dsound.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;

View file

@ -31,6 +31,9 @@
#include "sound_driver_dsound.h" #include "sound_driver_dsound.h"
#include "listener_dsound.h" #include "listener_dsound.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

View file

@ -21,6 +21,9 @@
#include "buffer_dsound.h" #include "buffer_dsound.h"
#include "listener_dsound.h" #include "listener_dsound.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
using namespace std; using namespace std;

View file

@ -14,6 +14,16 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef STDDSOUND_H
#define STDDSOUND_H
#if defined(_MSC_VER) && defined(_DEBUG)
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
#endif
#include "nel/misc/types_nl.h" #include "nel/misc/types_nl.h"
#define EAX_AVAILABLE 0 #define EAX_AVAILABLE 0
@ -44,4 +54,5 @@
#include "nel/sound/driver/source.h" #include "nel/sound/driver/source.h"
#include "nel/sound/driver/listener.h" #include "nel/sound/driver/listener.h"
#endif
/* end of file */ /* end of file */

View file

@ -25,6 +25,10 @@
# include <mmsystem.h> # include <mmsystem.h>
#endif #endif
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
using namespace std; using namespace std;

View file

@ -18,6 +18,9 @@
#include "listener_fmod.h" #include "listener_fmod.h"
#include "sound_driver_fmod.h" #include "sound_driver_fmod.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;

View file

@ -18,6 +18,10 @@
#include "music_channel_fmod.h" #include "music_channel_fmod.h"
#include "sound_driver_fmod.h" #include "sound_driver_fmod.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

View file

@ -26,6 +26,10 @@
#include <Windows.h> #include <Windows.h>
#endif #endif
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

View file

@ -21,6 +21,9 @@
#include "buffer_fmod.h" #include "buffer_fmod.h"
#include "listener_fmod.h" #include "listener_fmod.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
using namespace std; using namespace std;

View file

@ -14,6 +14,16 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef STDFMOD_H
#define STDFMOD_H
#if defined(_MSC_VER) && defined(_DEBUG)
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
#endif
#include <nel/misc/types_nl.h> #include <nel/misc/types_nl.h>
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
@ -42,4 +52,6 @@
#include "nel/sound/driver/source.h" #include "nel/sound/driver/source.h"
#include "nel/sound/driver/listener.h" #include "nel/sound/driver/listener.h"
#endif
/* end of file */ /* end of file */

View file

@ -18,6 +18,10 @@
#include "sound_driver_al.h" #include "sound_driver_al.h"
#include "buffer_al.h" #include "buffer_al.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
namespace NLSOUND namespace NLSOUND

View file

@ -19,6 +19,10 @@
#include "effect_al.h" #include "effect_al.h"
#include "sound_driver_al.h" #include "sound_driver_al.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
// using namespace NLMISC; // using namespace NLMISC;

View file

@ -18,6 +18,10 @@
#include "listener_al.h" #include "listener_al.h"
#include "sound_driver_al.h" #include "sound_driver_al.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
namespace NLSOUND { namespace NLSOUND {

View file

@ -22,6 +22,10 @@
#include "ext_al.h" #include "ext_al.h"
#include "effect_al.h" #include "effect_al.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

View file

@ -22,6 +22,10 @@
#include "source_al.h" #include "source_al.h"
#include "ext_al.h" #include "ext_al.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
// #define NLSOUND_DEBUG_GAIN // #define NLSOUND_DEBUG_GAIN
using namespace std; using namespace std;

View file

@ -20,6 +20,10 @@
#include "buffer_xaudio2.h" #include "buffer_xaudio2.h"
#include "adpcm_xaudio2.h" #include "adpcm_xaudio2.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
// using namespace NLMISC; // using namespace NLMISC;

View file

@ -20,6 +20,10 @@
#include "buffer_xaudio2.h" #include "buffer_xaudio2.h"
#include "sound_driver_xaudio2.h" #include "sound_driver_xaudio2.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

View file

@ -21,6 +21,10 @@
#include "listener_xaudio2.h" #include "listener_xaudio2.h"
#include "effect_xaudio2.h" #include "effect_xaudio2.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

View file

@ -20,6 +20,10 @@
#include "sound_driver_xaudio2.h" #include "sound_driver_xaudio2.h"
#include "listener_xaudio2.h" #include "listener_xaudio2.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

View file

@ -22,6 +22,10 @@
#include "effect_xaudio2.h" #include "effect_xaudio2.h"
#include "sound_driver_xaudio2.h" #include "sound_driver_xaudio2.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

View file

@ -26,6 +26,10 @@
#include "effect_xaudio2.h" #include "effect_xaudio2.h"
#include "source_xaudio2.h" #include "source_xaudio2.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

View file

@ -8,6 +8,6 @@ TARGET_LINK_LIBRARIES(nel_unit_test ${CPPTEST_LIBRARIES} nelmisc nelnet nelligo)
NL_DEFAULT_PROPS(nel_unit_test "Unit Tests") NL_DEFAULT_PROPS(nel_unit_test "Unit Tests")
NL_ADD_RUNTIME_FLAGS(nel_unit_test) NL_ADD_RUNTIME_FLAGS(nel_unit_test)
ADD_DEFINITIONS(-DNEL_UNIT_BASE="${PROJECT_SOURCE_DIR}/tools/nel_unit_test/") ADD_DEFINITIONS(-DNEL_UNIT_BASE="${PROJECT_SOURCE_DIR}/nel/tools/nel_unit_test/")
INSTALL(TARGETS nel_unit_test RUNTIME DESTINATION ${NL_BIN_PREFIX}) INSTALL(TARGETS nel_unit_test RUNTIME DESTINATION ${NL_BIN_PREFIX})

View file

@ -1,9 +1,9 @@
////////////////////////// //////////////////////////
//////////////////////////
/// CLIENT CONFIG FILE /// /// CLIENT CONFIG FILE ///
////////////////////////// //////////////////////////
////////////////////////// //////////////////////////
//////////////////////////
// If you set this variable to 1, your client.cfg will be overwritten when you quit the client. // 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. // You will loose all the comments and identation in this file.
@ -23,16 +23,16 @@ PositionY = 0;
Frequency = 0; Frequency = 0;
Depth = 32; Depth = 32;
Sleep = -1; Sleep = -1;
ProcessPriority = 0; // -2 = idle, -1 = below normal, 0 = normal, 1 = above normal, 2 = high, 3 = real time ProcessPriority = 0; // -2 = idle, -1 = below normal, 0 = normal, 1 = above normal, 2 = high, 3 = real time
Contrast = 0.0; // -1.0 ~ 1.0 Contrast = 0.0; // -1.0 ~ 1.0
Luminosity = 0.0; // -1.0 ~ 1.0 Luminosity = 0.0; // -1.0 ~ 1.0
Gamma = 0.0; // -1.0 ~ 1.0 Gamma = 0.0; // -1.0 ~ 1.0
Contrast_min = -1.0; Contrast_min = -1.0;
Luminosity_min = -1.0; Luminosity_min = -1.0;
Gamma_min = -1.0; Gamma_min = -1.0;
Contrast_max = 1.0; Contrast_max = 1.0;
Luminosity_max = 1.0; Luminosity_max = 1.0;
Gamma_max = 1.0; Gamma_max = 1.0;
///////////// /////////////
@ -67,23 +67,23 @@ LanguageCode = "fr"; // english
XMLInputFile = "input_config_v3.xml"; XMLInputFile = "input_config_v3.xml";
XMLLoginInterfaceFiles = { XMLLoginInterfaceFiles = {
"login_config.xml", "login_config.xml",
"login_widgets.xml", "login_widgets.xml",
"login_main.xml", "login_main.xml",
"login_keys.xml", "login_keys.xml",
}; };
XMLOutGameInterfaceFiles = { XMLOutGameInterfaceFiles = {
"out_v2_config.xml", "out_v2_config.xml",
"out_v2_widgets.xml", "out_v2_widgets.xml",
"out_v2_connect.xml", "out_v2_connect.xml",
"out_v2_intro.xml", "out_v2_intro.xml",
"out_v2_select.xml", "out_v2_select.xml",
"out_v2_appear.xml", "out_v2_appear.xml",
"out_v2_location.xml", "out_v2_location.xml",
"out_v2_crash.xml", "out_v2_crash.xml",
"out_v2_hierarchy.xml", "out_v2_hierarchy.xml",
"out_v2_keys.xml", "out_v2_keys.xml",
}; };
TexturesInterface = { TexturesInterface = {
@ -104,29 +104,29 @@ VerboseLog = 1;
/////////// ///////////
// MOUSE // // MOUSE //
/////////// ///////////
HardwareCursor = 1; HardwareCursor = 1;
CursorSpeed = 1.0; // In pixels per mickey CursorSpeed = 1.0; // In pixels per mickey
CursorSpeed_min = 0.5; CursorSpeed_min = 0.5;
CursorSpeed_max = 2.0; CursorSpeed_max = 2.0;
CursorAcceleration = 40; // Threshold in mickey CursorAcceleration = 40; // Threshold in mickey
CursorAcceleration_min = 20; CursorAcceleration_min = 20;
CursorAcceleration_max = 80; CursorAcceleration_max = 80;
FreeLookSpeed = 0.004; // In radian per mickey FreeLookSpeed = 0.004; // In radian per mickey
FreeLookSpeed_min = 0.0001; FreeLookSpeed_min = 0.0001;
FreeLookSpeed_max = 0.01; FreeLookSpeed_max = 0.01;
FreeLookAcceleration = 40; // Threshold in mickey FreeLookAcceleration = 40; // Threshold in mickey
FreeLookAcceleration_min = 20; FreeLookAcceleration_min = 20;
FreeLookAcceleration_max = 80; FreeLookAcceleration_max = 80;
FreeLookInverted = 0; FreeLookInverted = 0;
FreeLookTablet = 0; FreeLookTablet = 0;
AutomaticCamera = 0; AutomaticCamera = 0;
DblClickMode = 1; DblClickMode = 1;
AutoEquipTool = 1; AutoEquipTool = 1;
/////////////////// ///////////////////
// RENDER CONFIG // // RENDER CONFIG //
@ -158,172 +158,173 @@ LandscapeThreshold_ps1 = 500.0;
LandscapeThreshold_ps2 = 1000.0; LandscapeThreshold_ps2 = 1000.0;
LandscapeThreshold_ps3 = 2000.0; LandscapeThreshold_ps3 = 2000.0;
Vision = 500.000000; Vision = 500.000000;
Vision_min = 200.000000; Vision_min = 200.000000;
Vision_max = 800.000000; Vision_max = 800.000000;
Vision_step = 100.000000; Vision_step = 100.000000;
Vision_ps0 = 200.0; Vision_ps0 = 200.0;
Vision_ps1 = 400.0; Vision_ps1 = 400.0;
Vision_ps2 = 500.0; Vision_ps2 = 500.0;
Vision_ps3 = 800.0; Vision_ps3 = 800.0;
MicroVeget = 1; // Enable/Disable MicroVeget. MicroVeget = 1; // Enable/Disable MicroVeget.
MicroVeget_ps0 = 0; MicroVeget_ps0 = 0;
MicroVeget_ps1 = 1; MicroVeget_ps1 = 1;
MicroVeget_ps2 = 1; MicroVeget_ps2 = 1;
MicroVeget_ps3 = 1; MicroVeget_ps3 = 1;
MicroVegetDensity = 80.0; MicroVegetDensity = 80.0;
MicroVegetDensity_min = 10.0; MicroVegetDensity_min = 10.0;
MicroVegetDensity_max = 100.0; MicroVegetDensity_max = 100.0;
MicroVegetDensity_step = 10.0; MicroVegetDensity_step = 10.0;
MicroVegetDensity_ps0 = 10.0; // not used since disabled! MicroVegetDensity_ps0 = 10.0; // not used since disabled!
MicroVegetDensity_ps1 = 30.0; MicroVegetDensity_ps1 = 30.0;
MicroVegetDensity_ps2 = 80.0; MicroVegetDensity_ps2 = 80.0;
MicroVegetDensity_ps3 = 100.0; MicroVegetDensity_ps3 = 100.0;
// *** FX // *** FX
FxNbMaxPoly = 20000; FxNbMaxPoly = 20000;
FxNbMaxPoly_min = 2000; FxNbMaxPoly_min = 2000;
FxNbMaxPoly_max = 50000; FxNbMaxPoly_max = 50000;
FxNbMaxPoly_step= 2000; FxNbMaxPoly_step= 2000;
FxNbMaxPoly_ps0 = 2000; FxNbMaxPoly_ps0 = 2000;
FxNbMaxPoly_ps1 = 10000; FxNbMaxPoly_ps1 = 10000;
FxNbMaxPoly_ps2 = 20000; FxNbMaxPoly_ps2 = 20000;
FxNbMaxPoly_ps3 = 50000; FxNbMaxPoly_ps3 = 50000;
Cloud = 1; Cloud = 1;
Cloud_ps0 = 0 ; Cloud_ps0 = 0 ;
Cloud_ps1 = 1 ; Cloud_ps1 = 1 ;
Cloud_ps2 = 1 ; Cloud_ps2 = 1 ;
Cloud_ps3 = 1 ; Cloud_ps3 = 1 ;
CloudQuality = 160.0; CloudQuality = 160.0;
CloudQuality_min = 80.0; CloudQuality_min = 80.0;
CloudQuality_max = 320.0; CloudQuality_max = 320.0;
CloudQuality_step = 20.0; CloudQuality_step = 20.0;
CloudQuality_ps0 = 80.0; // not used since disabled! CloudQuality_ps0 = 80.0; // not used since disabled!
CloudQuality_ps1 = 80.0; CloudQuality_ps1 = 80.0;
CloudQuality_ps2 = 160.0; CloudQuality_ps2 = 160.0;
CloudQuality_ps3 = 320.0; CloudQuality_ps3 = 320.0;
CloudUpdate = 1; CloudUpdate = 1;
CloudUpdate_min = 1; CloudUpdate_min = 1;
CloudUpdate_max = 8; CloudUpdate_max = 8;
CloudUpdate_step= 1; CloudUpdate_step= 1;
CloudUpdate_ps0 = 1; // not used since disabled! CloudUpdate_ps0 = 1; // not used since disabled!
CloudUpdate_ps1 = 1; CloudUpdate_ps1 = 1;
CloudUpdate_ps2 = 1; CloudUpdate_ps2 = 1;
CloudUpdate_ps3 = 3; CloudUpdate_ps3 = 3;
Shadows = 1; Shadows = 1;
Shadows_ps0 = 0; Shadows_ps0 = 0;
Shadows_ps1 = 1; Shadows_ps1 = 1;
Shadows_ps2 = 1; Shadows_ps2 = 1;
Shadows_ps3 = 1; Shadows_ps3 = 1;
FXAA = 1; FXAA = 1;
FXAA_ps0 = 0; FXAA_ps0 = 0;
FXAA_ps1 = 1; FXAA_ps1 = 1;
FXAA_ps2 = 1; FXAA_ps2 = 1;
FXAA_ps3 = 1; FXAA_ps3 = 1;
AnisotropicFilter = 0; AnisotropicFilter = 0;
Bloom = 1; Bloom = 1;
Bloom_ps0 = 0; Bloom_ps0 = 0;
Bloom_ps1 = 1; Bloom_ps1 = 1;
Bloom_ps2 = 1; Bloom_ps2 = 1;
Bloom_ps3 = 1; Bloom_ps3 = 1;
SquareBloom = 1; SquareBloom = 1;
SquareBloom_ps0 = 0; SquareBloom_ps0 = 0;
SquareBloom_ps1 = 1; SquareBloom_ps1 = 1;
SquareBloom_ps2 = 1; SquareBloom_ps2 = 1;
SquareBloom_ps3 = 1; SquareBloom_ps3 = 1;
DensityBloom = 255.0; DensityBloom = 255.0;
DensityBloom_min = 0.0; DensityBloom_min = 0.0;
DensityBloom_max = 255.0; DensityBloom_max = 255.0;
DensityBloom_step = 1.0; DensityBloom_step = 1.0;
DensityBloom_ps0 = 255.0; DensityBloom_ps0 = 255.0;
DensityBloom_ps1 = 255.0; DensityBloom_ps1 = 255.0;
DensityBloom_ps2 = 255.0; DensityBloom_ps2 = 255.0;
DensityBloom_ps3 = 255.0; DensityBloom_ps3 = 255.0;
// *** CHARACTERS // *** CHARACTERS
SkinNbMaxPoly = 100000; SkinNbMaxPoly = 100000;
SkinNbMaxPoly_min = 5000; SkinNbMaxPoly_min = 5000;
SkinNbMaxPoly_max = 250000; SkinNbMaxPoly_max = 250000;
SkinNbMaxPoly_step = 5000; SkinNbMaxPoly_step = 5000;
SkinNbMaxPoly_ps0 = 10000; SkinNbMaxPoly_ps0 = 10000;
SkinNbMaxPoly_ps1 = 70000; SkinNbMaxPoly_ps1 = 70000;
SkinNbMaxPoly_ps2 = 100000; SkinNbMaxPoly_ps2 = 100000;
SkinNbMaxPoly_ps3 = 200000; SkinNbMaxPoly_ps3 = 200000;
NbMaxSkeletonNotCLod = 125; NbMaxSkeletonNotCLod = 125;
NbMaxSkeletonNotCLod_min = 5; NbMaxSkeletonNotCLod_min = 5;
NbMaxSkeletonNotCLod_max = 255; NbMaxSkeletonNotCLod_max = 255;
NbMaxSkeletonNotCLod_step = 5; NbMaxSkeletonNotCLod_step = 5;
NbMaxSkeletonNotCLod_ps0 = 10; NbMaxSkeletonNotCLod_ps0 = 10;
NbMaxSkeletonNotCLod_ps1 = 50; NbMaxSkeletonNotCLod_ps1 = 50;
NbMaxSkeletonNotCLod_ps2 = 125; NbMaxSkeletonNotCLod_ps2 = 125;
NbMaxSkeletonNotCLod_ps3 = 255; NbMaxSkeletonNotCLod_ps3 = 255;
CharacterFarClip = 200.0; CharacterFarClip = 200.0;
CharacterFarClip_min = 50.0; CharacterFarClip_min = 50.0;
CharacterFarClip_max = 500.0; CharacterFarClip_max = 500.0;
CharacterFarClip_step = 10.0; CharacterFarClip_step = 10.0;
CharacterFarClip_ps0 = 50.0; CharacterFarClip_ps0 = 50.0;
CharacterFarClip_ps1 = 100.0; CharacterFarClip_ps1 = 100.0;
CharacterFarClip_ps2 = 200.0; CharacterFarClip_ps2 = 200.0;
CharacterFarClip_ps3 = 500.0; CharacterFarClip_ps3 = 500.0;
EnableRacialAnimation = 1; EnableRacialAnimation = 1;
// *** MISC // *** 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 // 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; ScreenAspectRatio = 0.0;
ForceDXTC = 1; // Enable/Disable DXTC. ForceDXTC = 1; // Enable/Disable DXTC.
DivideTextureSizeBy2= 0; // Divide texture size DivideTextureSizeBy2= 0; // Divide texture size
DisableVtxProgram = 0; // Disable Hardware Vertex Program. DisableVtxProgram = 0; // Disable Hardware Vertex Program.
DisableVtxAGP = 0; // Disable Hardware Vertex AGP. DisableVtxAGP = 0; // Disable Hardware Vertex AGP.
DisableTextureShdr = 0; // Disable Hardware Texture Shader. DisableTextureShdr = 0; // Disable Hardware Texture Shader.
HDEntityTexture = 1; HDEntityTexture = 1;
HDTextureInstalled = 1; HDTextureInstalled = 1;
WaitVBL = 0; // 0 or 1 to wait Vertical Sync. WaitVBL = 0; // 0 or 1 to wait Vertical Sync.
////////////////// //////////////////
// GAME OPTIONS // // GAME OPTIONS //
////////////////// //////////////////
SelectWithRClick = 1; SelectWithRClick = 1;
DisplayWeapons = 1; DisplayWeapons = 1;
RotKeySpeedMax = 2.0; RotKeySpeedMax = 2.0;
RotKeySpeedMax_min = 1.0; RotKeySpeedMax_min = 1.0;
RotKeySpeedMax_max = 4.0; RotKeySpeedMax_max = 4.0;
RotKeySpeedMin = 1.0; RotKeySpeedMin = 1.0;
RotKeySpeedMin_min = 0.5; RotKeySpeedMin_min = 0.5;
RotKeySpeedMin_max = 2.0; RotKeySpeedMin_max = 2.0;
RotAccel = 3.0; RotAccel = 3.0;
FollowOnAtk = 0; FollowOnAtk = 0;
AtkOnSelect = 0; AtkOnSelect = 0;
ZCPacsPrim = "gen_bt_col_ext.pacs_prim"; ZCPacsPrim = "gen_bt_col_ext.pacs_prim";
///////////////// /////////////////
// PREFERENCES // // PREFERENCES //
///////////////// /////////////////
FPV = 0; // FPV(First Person View) : default is false (Third Person View). 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). 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). CameraDistance = 3.0; // Camera Distance(in meter) from the user (for the Third Person View).
CameraDistStep = 1.0; CameraDistStep = 1.0;
CameraDistMin = 1.0; CameraDistMin = 1.0;
CameraDistMax = 25.0;
CameraDistMax = 250.0; CameraDistMax = 250.0;
CameraAccel = 5.0; CameraAccel = 5.0;
CameraSpeedMin = 2.0; CameraSpeedMin = 2.0;
CameraSpeedMax = 100.0; CameraSpeedMax = 100.0;
CameraResetSpeed = 10.0; // Speed in radian/s CameraResetSpeed = 10.0; // Speed in radian/s
////////////////// //////////////////
// SOUND CONFIG // // SOUND CONFIG //
@ -350,8 +351,7 @@ SoundGameMusicVolume_max = 1.0;
SoundGameMusicVolume_step = 0.001; SoundGameMusicVolume_step = 0.001;
// MISC // MISC
PreDataPath = { "user", "data", "patch", "examples", }; PreDataPath = { "user", "patch", "data", "examples" };
DataPath = { "data" };
NeedComputeVS = 0; NeedComputeVS = 0;
NegFiltersDebug = {"Update DB", "Reading:", "Read Value :", "impulseCallBack", "CLIMPD:", "LNET" }; NegFiltersDebug = {"Update DB", "Reading:", "Read Value :", "impulseCallBack", "CLIMPD:", "LNET" };
@ -359,15 +359,15 @@ NegFiltersInfo = { "CLIMPD:", "CPath::lookup" , "LNET" };
NegFiltersWarning = { "'basics.Equipment Slot'.", "_usercolor.tga", "PACS" }; NegFiltersWarning = { "'basics.Equipment Slot'.", "_usercolor.tga", "PACS" };
// Big screen shot // Big screen shot
ScreenShotWidth = 0; ScreenShotWidth = 0;
ScreenShotHeight = 0; ScreenShotHeight = 0;
ScreenShotFullDetail = 1; // 1 to switch full detail mode for characters (both standard & big screenshots) ScreenShotFullDetail = 1; // 1 to switch full detail mode for characters (both standard & big screenshots)
// Read : "ID", "R G B A MODE [FX]" // Read : "ID", "R G B A MODE [FX]"
SystemInfoColors = SystemInfoColors =
{ {
// OLD STUFF Here for compatibility // OLD STUFF Here for compatibility
"RG", "0 0 0 255 normal", // Black to see when there is an error "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 "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 "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 "BL", "0 0 0 255 normal", // Black to see when there is an error
@ -375,38 +375,38 @@ SystemInfoColors =
"VI", "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 // NEW System Info Categories
"SYS", "255 255 255 255 normal", // Default system messages "SYS", "255 255 255 255 normal", // Default system messages
"BC", "255 255 255 255 centeraround", // Broadcast 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 "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 "XP", "255 255 64 255 over", // XP Gain
"SP", "255 255 64 255 over", // SP Gain "SP", "255 255 64 255 over", // SP Gain
"TTL", "255 255 64 255 over", // Title "TTL", "255 255 64 255 over", // Title
"TSK", "255 255 255 255 over", // Task "TSK", "255 255 255 255 over", // Task
"ZON", "255 255 255 255 center", // Zone "ZON", "255 255 255 255 center", // Zone
"DG", "255 0 0 255 normal", // Damage to me "DG", "255 0 0 255 normal", // Damage to me
"DMG", "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 "DGP", "200 0 0 255 normal", // Damage to me from player
"DGM", "255 128 64 255 normal", // Damage from me "DGM", "255 128 64 255 normal", // Damage from me
"MIS", "150 150 150 255 normal", // The opponent misses "MIS", "150 150 150 255 normal", // The opponent misses
"MISM", "255 255 255 255 normal", // I miss "MISM", "255 255 255 255 normal", // I miss
"ITM", "0 200 0 255 over", // Item "ITM", "0 200 0 255 over", // Item
"ITMO", "170 170 255 255 overonly", // Item other in group "ITMO", "170 170 255 255 overonly", // Item other in group
"ITMF", "220 0 220 255 over", // Item failed "ITMF", "220 0 220 255 over", // Item failed
"SPL", "50 50 250 255 normal", // Spell to me "SPL", "50 50 250 255 normal", // Spell to me
"SPLM", "50 150 250 255 normal", // Spell from me "SPLM", "50 150 250 255 normal", // Spell from me
"EMT", "255 150 150 255 normal", // Emote "EMT", "255 150 150 255 normal", // Emote
"MTD", "255 255 0 255 over", // Message Of The Day "MTD", "255 255 0 255 over", // Message Of The Day
"FORLD","64 255 64 255 overonly", // Forage Locate Deposit "FORLD","64 255 64 255 overonly", // Forage Locate Deposit
"CHK", "255 120 60 255 center", // Tous ce qui ne remplit pas une condition "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.) "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 "PVPTM","255 120 60 255 overonly", // PVP timer
"THM", "255 255 64 255 over misc_levelup.ps", // Thema finished "THM", "255 255 64 255 over misc_levelup.ps", // Thema finished
"AMB", "255 255 64 255 center", // Ambiance "AMB", "255 255 64 255 center", // Ambiance
"ISE", "192 208 255 255 normal", // Item special effect "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) "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 "OSM", "128 160 255 255 center", // Outpost state message
"AROUND","255 255 0 255 around", // Only in around channel "AROUND","255 255 0 255 around", // Only in around channel
"R2_INVITE","0 255 0 255 around", // Ring invitation "R2_INVITE","0 255 0 255 around", // Ring invitation
}; };
PrintfCommands = { PrintfCommands = {
@ -436,73 +436,74 @@ LoadingStringCount = 54;
// Some R2 parameters ... // Some R2 parameters ...
R2Mode = 1; R2Mode = 1;
R2EDEnabled = 1; R2EDEnabled = 1;
R2EDExtendedDebug = 0; R2EDExtendedDebug = 0;
R2EDLightPalette = 0; R2EDLightPalette = 0;
R2ClientGw = "r2linux01"; R2ClientGw = "r2linux01";
LoadLuaDebugger = 0; LoadLuaDebugger = 0;
CheckR2ScenarioMD5 = 1; CheckR2ScenarioMD5 = 1;
LevelDesignEnabled = 0; LevelDesignEnabled = 0;
DmCameraDistMax = 25; DmCameraDistMax = 25;
DmRun = 20; DmRun = 20;
DmWalk = 6; DmWalk = 6;
R2EDReloadFiles = { R2EDReloadFiles = {
"r2ed.xml", "r2ed.xml",
"r2_basic_bricks.lua", "r2_basic_bricks.lua",
"r2_components.lua", "r2_components.lua",
"r2_core.lua", "r2_core.lua",
"r2_features_default.lua", "r2_features_default.lua",
"r2_features_fauna.lua", "r2_features_fauna.lua",
"r2_features_npc_groups.lua", "r2_features_npc_groups.lua",
"r2_palette.lua", "r2_palette.lua",
"r2_scenario.lua", "r2_scenario.lua",
"r2_ui.lua" "r2_ui.lua"
}; };
XMLInterfaceFiles = { XMLInterfaceFiles = {
"config.xml", "config.xml",
"widgets.xml", "widgets.xml",
"webig_widgets.xml", "webig_widgets.xml",
"appzone.xml", "appzone.xml",
"player.xml", "player.xml",
"inventory.xml", "inventory.xml",
"interaction.xml", "interaction.xml",
"phrase.xml", "phrase.xml",
"harvest.xml", "harvest.xml",
"macros.xml", "macros.xml",
"info_player.xml", "info_player.xml",
"outpost.xml", "outpost.xml",
"guild.xml", "guild.xml",
"taskbar.xml", "taskbar.xml",
"game_config.xml", "game_config.xml",
"game_context_menu.xml", "game_context_menu.xml",
"player_trade.xml", "player_trade.xml",
"bot_chat_v4.xml", "bot_chat_v4.xml",
"compass.xml", "compass.xml",
"map.xml", "map.xml",
"hierarchy.xml", "hierarchy.xml",
"reset.xml", "reset.xml",
"actions.xml", "actions.xml",
"help.xml", "help.xml",
"encyclopedia.xml", "encyclopedia.xml",
"commands.xml", "commands.xml",
"commands2.xml", "commands2.xml",
"ring_access_point_filter.xml", "ring_access_point_filter.xml",
"ring_window.xml", "ring_window.xml",
"bg_downloader.xml", "bg_downloader.xml",
"ryzhome_toolbar.xml"
}; };
XMLR2EDInterfaceFiles = XMLR2EDInterfaceFiles =
{ {
"r2ed.xml", "r2ed.xml",
"r2_triggers.xml", "r2_triggers.xml",
"r2_logic_entities.xml", "r2_logic_entities.xml",
"r2ed_acts.xml", "r2ed_acts.xml",
"r2ed_scenario.xml", "r2ed_scenario.xml",
"r2ed_connect.xml" "r2ed_connect.xml"
}; };
FogDistAndDepthLookupBias = 20; // bias for lookup of fog distance and depth FogDistAndDepthLookupBias = 20; // bias for lookup of fog distance and depth
@ -514,45 +515,45 @@ FogDistAndDepthLookupBias = 20; // bias for lookup of fog distance and depth
// * individual .tga files for hardware cursor bitmap not looked for, and not supported yet // * individual .tga files for hardware cursor bitmap not looked for, and not supported yet
HardwareCursors = HardwareCursors =
{ {
"curs_can_pan.tga", "curs_can_pan.tga",
"curs_can_pan_dup.tga", "curs_can_pan_dup.tga",
"curs_create.tga", "curs_create.tga",
"curs_create_multi.tga", "curs_create_multi.tga",
"curs_create_vertex_invalid.tga", "curs_create_vertex_invalid.tga",
"curs_default.tga", "curs_default.tga",
"curs_dup.tga", "curs_dup.tga",
"curs_L.tga", "curs_L.tga",
"curs_M.tga", "curs_M.tga",
"curs_pan.tga", "curs_pan.tga",
"curs_pan_dup.tga", "curs_pan_dup.tga",
"curs_pick.tga", "curs_pick.tga",
"curs_pick_dup.tga", "curs_pick_dup.tga",
"curs_R.tga", "curs_R.tga",
"curs_resize_BL_TR.tga", "curs_resize_BL_TR.tga",
"curs_resize_BR_TL.tga", "curs_resize_BR_TL.tga",
"curs_resize_LR.tga", "curs_resize_LR.tga",
"curs_resize_TB.tga", "curs_resize_TB.tga",
"curs_rotate.tga", "curs_rotate.tga",
"curs_scale.tga", "curs_scale.tga",
"curs_stop.tga", "curs_stop.tga",
"text_cursor.tga", "text_cursor.tga",
"r2_hand_can_pan.tga", "r2_hand_can_pan.tga",
"r2_hand_pan.tga", "r2_hand_pan.tga",
"r2ed_tool_can_pick.tga", "r2ed_tool_can_pick.tga",
"r2ed_tool_can_rotate.tga", "r2ed_tool_can_rotate.tga",
"r2ed_tool_pick.tga", "r2ed_tool_pick.tga",
"r2ed_tool_rotate.tga", "r2ed_tool_rotate.tga",
"r2ed_tool_rotating.tga" "r2ed_tool_rotating.tga"
}; };
Loading_BG = "new_loading_bg.tga"; // Default name for the loading background file. 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. Launch_BG = "new_launcher_bg.tga"; // Default name for the launch background file.
TeleportKami_BG = "new_teleport_kami_bg.tga"; TeleportKami_BG = "new_teleport_kami_bg.tga";
TeleportKaravan_BG = "new_teleport_caravan_bg.tga"; TeleportKaravan_BG = "new_teleport_caravan_bg.tga";
Elevator_BG = "new_elevator_bg.tga"; // Default name for the loading background file. Elevator_BG = "new_elevator_bg.tga"; // Default name for the loading background file.
ResurectKami_BG = "new_resurect_kami_bg.tga"; ResurectKami_BG = "new_resurect_kami_bg.tga";
ResurectKaravan_BG = "new_resurect_caravane_bg.tga"; ResurectKaravan_BG = "new_resurect_caravane_bg.tga";
End_BG = "end_bg.tga"; // Default name for the last background file. End_BG = "end_bg.tga"; // Default name for the last background file.
ScenarioSavePath = "./my_scenarios/"; ScenarioSavePath = "./my_scenarios/";
@ -564,9 +565,9 @@ ScenarioSavePath = "./my_scenarios/";
BuiltInKeySets = BuiltInKeySets =
{ {
"", // default khanat keyboard layout "", // default khanat 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.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.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) "bi.wow_alike" // 'world of warcraft' like keyboard style. (NB : not available for ring)
}; };
// "Newbie Training", "Story Telling", "Mistery", "Hack & Slash", "Guild Training", "Other" // "Newbie Training", "Story Telling", "Mistery", "Hack & Slash", "Guild Training", "Other"

View file

@ -220,6 +220,21 @@
</parameter> </parameter>
</action> </action>
<action name="phrase_cancel_cast" hardtext="uiCancelCast" contexts="game, r2ed_anim_test"/> <action name="phrase_cancel_cast" hardtext="uiCancelCast" contexts="game, r2ed_anim_test"/>
<action name="item_group_equip" hardtext="uiMacroItemGroupEquip" contexts="game, r2ed_anim_test">
<parameter hardtext="uiMacroItemGroupName" type="%action_param_user_name" name="name" />
</action>
<action name="item_group_move" hardtext="uiMacroItemGroupMove" contexts="game, r2ed_anim_test">
<parameter hardtext="uiMacroItemGroupName" type="%action_param_user_name" name="name" />
<parameter hardtext="uiMacroItemGroupDestination" type="%action_param_constant" name="destination" value="bag">
<value value="bag" hardtext="uimMtBag" />
<value value="pet_animal1" hardtext="uimMtPaPacker0" />
<value value="pet_animal2" hardtext="uimMtPaPacker1" />
<value value="pet_animal3" hardtext="uimMtPaPacker2" />
<value value="pet_animal4" hardtext="uimMtPaPacker3" />
<value value="player_room" hardtext="uimMtRoom" />
<value value="guild" hardtext="uimMtGuild" />
</parameter>
</action>
</action_category> </action_category>
<action_category name="chat" hardtext="uiChat" contexts="game, r2ed, r2ed_anim_test"> <!-- not available in r2ed for now --> <action_category name="chat" hardtext="uiChat" contexts="game, r2ed, r2ed_anim_test"> <!-- not available in r2ed for now -->

View file

@ -2,48 +2,73 @@
<root id="interface" x="0" y="0" w="800" h="600" active="true" /> <root id="interface" x="0" y="0" w="800" h="600" active="true" />
<lua file="bg_downloader.lua" /> <lua file="bg_downloader.lua" />
<proc id="bg_downloader_active"> <proc id="bg_downloader_active">
<action handler="set" params="dblink=UI:VARIABLES:ISACTIVE:BG_DOWNLOADER|value=1" /> <action handler="set" params="dblink=UI:VARIABLES:ISACTIVE:BG_DOWNLOADER|value=1" />
</proc> </proc>
<proc id="bg_downloader_deactive"> <proc id="bg_downloader_deactive">
<action handler="set" params="dblink=UI:VARIABLES:ISACTIVE:BG_DOWNLOADER|value=0" /> <action handler="set" params="dblink=UI:VARIABLES:ISACTIVE:BG_DOWNLOADER|value=0" />
</proc> </proc>
<!-- Window for the background downloader --> <!-- Window for the background downloader -->
<group type="container" id="bg_downloader" title="uiBGD_WindowTitle" global_color="false" line_at_bottom="false" <group type="container" id="bg_downloader" title="uiBGD_WindowTitle" global_color="false" line_at_bottom="false"
movable="true" opened="true" openable="false" movable="true" opened="true" openable="false"
pop_min_w="410" pop_min_h="100" pop_max_w="410" pop_max_h="100" pop_min_w="410" pop_min_h="100" pop_max_w="410" pop_max_h="100"
h="100" h="100"
w="410" w="410"
active="false" active="false"
savable="true" savable="true"
header_color="UI:SAVE:WIN:COLORS:OPT" header_color="UI:SAVE:WIN:COLORS:OPT"
on_deactive="proc" on_deactive_params="bg_downloader_deactive" on_deactive="proc" on_deactive_params="bg_downloader_deactive"
on_active="proc" on_active_params="bg_downloader_active"> on_active="proc" on_active_params="bg_downloader_active"
>
<group id="header_closed" x="0" y="0" child_resize_w="true" h="16" posref="TL TL" group_onclick_r="active_menu" group_params_r="menu=ui:interface:base_menu_with_color"> <group id="header_closed" x="0" y="0" child_resize_w="true" h="16" posref="TL TL"
group_onclick_r="active_menu"
group_params_r="menu=ui:interface:base_menu_with_color"
>
</group> </group>
<group id="header_opened" x="0" y="0" w="800" h="16" posref="TL TL" group_onclick_r="active_menu" group_params_r="menu=ui:interface:base_menu_with_color"> <group id="header_opened" x="0" y="0" w="800" h="16" posref="TL TL"
group_onclick_r="active_menu"
group_params_r="menu=ui:interface:base_menu_with_color"
>
</group> </group>
<group id="content" x="0" y="0" sizeref="wh" w="0" h="0" posref="TL TL" >
<view type="text" id="text" active="true" y="-12" posref="TM TM" hardtext="" fontsize="10" color="255 255 255 255"
auto_clamp="true"
global_color="false"
/>
<view type="text" id="ellipsis" active="true" y="0" posref="BR BL" posparent="text" hardtext="" fontsize="13" color="255 255 255 255"
global_color="false"
/>
<group id="content" x="0" y="0" sizeref="wh" w="0" h="0" posref="TL TL" > <view type="bitmap" id="bm" active="false" y="1" x="-1" texture="W_answer_16_valid.tga" posparent="text" posref="ML MR"
<view type="text" id="text" active="true" y="-12" posref="TM TM" hardtext="" fontsize="10" color="255 255 255 255" auto_clamp="true" global_color="false" /> global_color="false"
<view type="text" id="ellipsis" active="true" y="0" posref="BR BL" posparent="text" hardtext="" fontsize="13" color="255 255 255 255" global_color="false" /> />
<view type="bitmap" id="bm" active="false" y="1" x="-1" texture="W_answer_16_valid.tga" posparent="text" posref="ML MR" global_color="false" /> <view type="bar" id="progress" parent="" active="true" posparent="text" posref="BM TM" y="-2"
<view type="bar" id="progress" parent="" active="true" posparent="text" posref="BM TM" y="-2" global_color="false" /> global_color="false"
<group type="combo_box" id="prio" sizeref="w" w="32" x="0" y="-8" child_resize_h="true" child_resize_hmargin="6" linked_to_db="false" posref="BM TM" posparent="progress" on_change="lua:bgdownloader:onChangePriority()" on_change_params="" tooltip="uiBGD_PriorityTooltip" global_color="false"> />
<instance template="combo_box_def1" tooltip="uiBGD_PriorityTooltip"/>
<group type="combo_box" id="prio" sizeref="w" w="32" x="0" y="-8" child_resize_h="true" child_resize_hmargin="6" linked_to_db="false"
posref="BM TM"
posparent="progress"
on_change="lua:bgdownloader:onChangePriority()" on_change_params=""
tooltip="uiBGD_PriorityTooltip"
global_color="false"
>
<instance template="combo_box_def1" tooltip="uiBGD_PriorityTooltip"/>
<combo_text name="uiBGD_Paused" /> <combo_text name="uiBGD_Paused" />
<combo_text name="uiBGD_LowPriority" /> <combo_text name="uiBGD_LowPriority" />
<combo_text name="uiBGD_NormalPriority" /> <combo_text name="uiBGD_NormalPriority" />
</group> </group>
</group> </group>
</group> </group>
<tree node="bg_downloader"/> <tree node="bg_downloader"/>
</interface_config> </interface_config>

View file

@ -3712,6 +3712,7 @@ This MUST follow the Enum MISSION_DESC::TIconId
<variable entry="UI:SAVE:ISENABLED:DYNAMIC_CHAT$i" <variable entry="UI:SAVE:ISENABLED:DYNAMIC_CHAT$i"
type="sint32" type="sint32"
value="1" value="1"
value="0"
size="%max_dyn_chan_per_player" /> size="%max_dyn_chan_per_player" />
<variable entry="UI:SAVE:ISENABLED:DYNAMIC_CHAT$i" <variable entry="UI:SAVE:ISENABLED:DYNAMIC_CHAT$i"
type="sint32" type="sint32"

View file

@ -529,10 +529,8 @@
posref="TL TL" posref="TL TL"
group_onclick_r="active_menu" group_onclick_r="active_menu"
group_params_r="menu=ui:interface:base_menu_with_color"> group_params_r="menu=ui:interface:base_menu_with_color">
<!--
<view type="text_number" id="fps" posref="MR MR" x="-20" y="-2" color="255 255 255 255" shadow="true" fontsize="10" value="UI:VARIABLES:FPS" global_color="false" positive="true"/> <view type="text_number" id="fps" posref="MR MR" x="-20" y="-2" color="255 255 255 255" shadow="true" fontsize="10" value="UI:VARIABLES:FPS" global_color="false" positive="true"/>
<view type="text" id="fpstext" posref="MR MR" x="-40" y="-2" color="255 255 255 255" shadow="true" fontsize="10" global_color="false" positive="true" hardtext="uiFPS" /> <view type="text" id="fpstext" posref="MR MR" x="-40" y="-2" color="255 255 255 255" shadow="true" fontsize="10" global_color="false" positive="true" hardtext="uiFPS" />
-->
</group> </group>
<group id="content" <group id="content"
x="0" x="0"

View file

@ -1294,4 +1294,170 @@
</group> </group>
</group> </group>
<tree node="web_transactions" /> <tree node="web_transactions" />
<group type="container"
id="web_lua_action"
w="480"
h="400"
title=""
global_color="false"
open_button="false"
force_open_out="true"
header_color="UI:SAVE:WIN:COLORS:COM"
resizer="true"
pop_min_w="220"
pop_min_h="96"
pop_max_w="2000"
pop_max_h="1600"
title_bar_open="false"
lockable="true"
openable="false"
opened="true"
movable="true"
active="true">
<group id="header_closed"
x="0"
y="0"
h="12"
posref="TL TL"></group>
<group id="header_opened"
x="0"
y="0"
w="480"
h="16"
posref="TL TL">
<!-- must be frozen by default cause no undo/redo at start -->
<ctrl style="text_button_header"
button_type="push_button"
id="browse_redo"
posref="MR MR"
x="-16"
y="0"
hardtext="uiBrowseRedoButton"
tooltip="uittBrowseRedo"
onclick_l="browse_redo"
params_l="name=ui:interface:web_lua_action:content:html"
frozen="true" />
<ctrl style="text_button_header"
button_type="push_button"
id="browse_undo"
posparent="browse_redo"
posref="ML MR"
x="-4"
y="0"
hardtext="uiBrowseUndoButton"
tooltip="uittBrowseUndo"
onclick_l="browse_undo"
params_l="name=ui:interface:web_lua_action:content:html"
frozen="true" />
<ctrl style="text_button_header"
button_type="push_button"
id="browse_refresh"
posparent="browse_undo"
posref="ML MR"
x="-4"
y="0"
hardtext="uiBrowseRefresh"
tooltip="uittBrowseRefresh"
onclick_l="browse_refresh"
params_l="name=ui:interface:web_lua_action:content:html" />
<ctrl style="text_button_header"
button_type="push_button"
id="browse_home"
posparent="browse_refresh"
posref="ML MR"
x="-4"
y="0"
hardtext="uiBrowseHome"
tooltip="uittBrowseHome"
onclick_l="browse_home"
params_l="name=ui:interface:web_lua_action:content:html" />
</group>
<group id="content"
x="0"
y="0"
w="0"
h="0"
posref="TL TL">
<group type="webig_html"
id="html"
posref="TL TL"
url=""
home="http://app.ryzom.com/"
sizeref="wh"
x="0"
y="0"
w="0"
h="0"
background_color="0 0 0 255"
error_color="255 240 48 255"
link_color="240 155 100 255"
text_color="210 210 210 255"
h1_color="255 255 255 255"
h2_color="255 255 255 255"
h3_color="255 255 255 255"
h4_color="255 255 255 255"
h5_color="255 255 255 255"
h6_color="255 255 255 255"
text_font_size="10"
h1_font_size="20"
h2_font_size="18"
h3_font_size="16"
h4_font_size="14"
h5_font_size="12"
h6_font_size="12"
paragraph_begin_space="12"
multi_line_space_factor="0.25"
td_begin_space="0"
li_begin_space="4"
ul_begin_space="12"
li_indent="-10"
ul_indent="30"
checkbox_bitmap_normal="w_slot_on.tga"
checkbox_bitmap_pushed="w_opacity_on.tga"
checkbox_bitmap_over=""
background_bitmap_view="black2"
browse_next_time="false"
form_text_area_group="edit_box_widget_multiline"
browse_refresh="ui:interface:web_lua_action:header_opened:browse_refresh"
browse_undo="ui:interface:web_lua_action:header_opened:browse_undo"
browse_redo="ui:interface:web_lua_action:header_opened:browse_redo">
<group id="black"
posref="BR BR"
sizeref="hw"
w="-10"
h="-12"
inherit_gc_alpha="true" />
<instance template="inner_thin_border"
posparent="black"
inherit_gc_alpha="true" />
<view type="bitmap"
id="black2"
posparent="black"
posref="MM MM"
sizeref="wh"
w="-2"
h="-2"
inherit_gc_alpha="true"
scale="true"
texture="blank.tga"
global_color="false" />
<group type="list"
id="text_list"
fontsize="9"
posref="TL TL"
posparent="black"
x="2"
y="-2"
space="0"
sizeref="hw"
w="-4"
h="-4"
maxelements="2000" />
<ctrl style="skin_scroll"
id="scroll_bar" />
</group>
</group>
</group>
<tree node="web_lua_action" />
</interface_config> </interface_config>

Some files were not shown because too many files have changed in this diff Show more