Merge remote-tracking branch 'upstream/develop' into ryzomcore

This commit is contained in:
deed 2018-10-14 20:05:30 +02:00
commit 0d1f1067bc
150 changed files with 4055 additions and 1348 deletions

3
.gitignore vendored
View file

@ -223,6 +223,7 @@ 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
@ -243,7 +244,7 @@ code/ryzom/tools/server/ryzom_ams/old
#tools and external dir's
# Tools and external directories
external
external_vc14
external_stlport

268
.hgignore Normal file
View file

@ -0,0 +1,268 @@
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*
#personal projects
personal/
#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

View file

@ -53,8 +53,8 @@ ENDIF()
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(RyzomCore CXX C)
SET(NL_VERSION_MAJOR 0)
SET(NL_VERSION_MINOR 12)
SET(NL_VERSION_MAJOR 1)
SET(NL_VERSION_MINOR 0)
SET(NL_VERSION_PATCH 0)
SET(YEAR "2004-${CURRENT_YEAR}")
SET(AUTHOR "Winch Gate and The Ryzom Core Community")
@ -91,12 +91,12 @@ NL_SETUP_NELNS_DEFAULT_OPTIONS()
NL_SETUP_RYZOM_DEFAULT_OPTIONS()
NL_SETUP_SNOWBALLS_DEFAULT_OPTIONS()
NL_SETUP_PREFIX_PATHS()
RYZOM_SETUP_PREFIX_PATHS()
NL_SETUP_BUILD()
NL_SETUP_BUILD_FLAGS()
NL_SETUP_PREFIX_PATHS()
RYZOM_SETUP_PREFIX_PATHS()
#-----------------------------------------------------------------------------
#Platform specifics
@ -172,6 +172,7 @@ ENDIF()
IF(APPLE)
FIND_LIBRARY(CARBON_FRAMEWORK Carbon)
FIND_LIBRARY(FOUNDATION_FRAMEWORK Foundation)
FIND_LIBRARY(SECURITY_FRAMEWORK Security)
IF(APPLE_CERTIFICATE)
# Find codesign_allocate
@ -196,214 +197,10 @@ IF(APPLE)
ENDIF()
ENDIF()
MACRO(ADD_QT_LIBRARY _NAME)
IF(WIN32)
SET(_PREFIX "Qt5")
SET(_EXT "lib")
ELSE()
SET(_PREFIX "libQt5")
SET(_EXT "a")
ENDIF()
SET(_LIB "${QT_LIBRARY_DIR}/${_PREFIX}${_NAME}.${_EXT}")
IF(EXISTS ${_LIB})
SET(QT_LIBRARIES ${QT_LIBRARIES} optimized ${_LIB})
ENDIF()
SET(_LIB "${QT_LIBRARY_DIR}/${_PREFIX}${_NAME}d.${_EXT}")
IF(EXISTS ${_LIB})
SET(QT_LIBRARIES ${QT_LIBRARIES} debug ${_LIB})
ENDIF()
ENDMACRO()
MACRO(ADD_QT_PLUGIN _TYPE _NAME)
IF(WIN32)
SET(_PREFIX "")
SET(_EXT "lib")
ELSE()
SET(_PREFIX "lib")
SET(_EXT "a")
ENDIF()
SET(_LIB "${QT_PLUGINS_DIR}/${_TYPE}/${_PREFIX}${_NAME}.${_EXT}")
IF(EXISTS ${_LIB})
SET(QT_LIBRARIES ${QT_LIBRARIES} optimized ${_LIB})
ENDIF()
SET(_LIB "${QT_PLUGINS_DIR}/${_TYPE}/${_PREFIX}${_NAME}d.${_EXT}")
IF(EXISTS ${_LIB})
SET(QT_LIBRARIES ${QT_LIBRARIES} debug ${_LIB})
ENDIF()
ENDMACRO()
INCLUDE(FindHelpers)
IF(WITH_QT5)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11 FATAL_ERROR)
SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${QTDIR} $ENV{QTDIR})
FIND_PACKAGE(Qt5Core QUIET)
IF(Qt5Core_FOUND)
# Check if we are using Qt static or shared libraries
GET_TARGET_PROPERTY(_FILE Qt5::Core IMPORTED_LOCATION_RELEASE)
SET(QT_VERSION "${Qt5Core_VERSION_STRING}")
SET(_VERSION "${QT_VERSION}")
IF(_FILE MATCHES "\\.(lib|a)$")
SET(QT_STATIC ON)
SET(_VERSION "${_VERSION} static version")
ELSE()
SET(QT_STATIC OFF)
SET(_VERSION "${_VERSION} shared version")
ENDIF()
MESSAGE(STATUS "Found Qt ${_VERSION}")
# These variables are not defined with Qt5 CMake modules
SET(QT_BINARY_DIR "${_qt5Core_install_prefix}/bin")
SET(QT_LIBRARY_DIR "${_qt5Core_install_prefix}/lib")
SET(QT_PLUGINS_DIR "${_qt5Core_install_prefix}/plugins")
SET(QT_TRANSLATIONS_DIR "${_qt5Core_install_prefix}/translations")
# Fix wrong include directories with Qt 5 under Mac OS X
INCLUDE_DIRECTORIES("${_qt5Core_install_prefix}/include")
FIND_PACKAGE(Qt5Gui)
FIND_PACKAGE(Qt5Widgets)
FIND_PACKAGE(Qt5OpenGL)
FIND_PACKAGE(Qt5Xml)
FIND_PACKAGE(Qt5LinguistTools)
FIND_PACKAGE(Qt5Network)
IF(QT_STATIC)
ADD_DEFINITIONS(-DQT_STATICPLUGIN)
SET(QT_LIBRARIES Qt5::Widgets)
# Gui
SET(QT_LIBRARIES ${QT_LIBRARIES} Qt5::Gui Qt5::OpenGL)
ADD_QT_LIBRARY(PrintSupport)
IF(WIN32)
SET(QT_LIBRARIES ${QT_LIBRARIES}
${WINSDK_LIBRARY_DIR}/Imm32.lib
${WINSDK_LIBRARY_DIR}/OpenGL32.lib
${WINSDK_LIBRARY_DIR}/WinMM.Lib)
ADD_QT_PLUGIN(platforms qwindows)
ADD_QT_LIBRARY(PlatformSupport)
ELSEIF(APPLE)
# Cups needs .dylib
SET(OLD_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
SET(CMAKE_FIND_LIBRARY_SUFFIXES .dylib)
FIND_LIBRARY(CUPS_LIBRARY cups)
SET(CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_CMAKE_FIND_LIBRARY_SUFFIXES})
FIND_LIBRARY(IOKIT_FRAMEWORK IOKit)
FIND_LIBRARY(COCOA_FRAMEWORK Cocoa)
FIND_LIBRARY(SYSTEMCONFIGURATION_FRAMEWORK SystemConfiguration)
FIND_LIBRARY(OPENGL_FRAMEWORK NAMES OpenGL)
SET(QT_LIBRARIES ${QT_LIBRARIES}
${CUPS_LIBRARY}
${COCOA_FRAMEWORK}
${SYSTEMCONFIGURATION_FRAMEWORK}
${IOKIT_FRAMEWORK}
${OPENGL_FRAMEWORK})
ADD_QT_PLUGIN(printsupport cocoaprintersupport)
ADD_QT_PLUGIN(platforms qcocoa)
ADD_QT_LIBRARY(PlatformSupport)
ELSE()
# order is very important there
ADD_QT_PLUGIN(platforms qxcb)
ADD_QT_PLUGIN(xcbglintegrations qxcb-glx-integration)
ADD_QT_LIBRARY(XcbQpa)
ADD_QT_LIBRARY(PlatformSupport)
SET(QT_LIBRARIES ${QT_LIBRARIES} -lX11-xcb -lXi -lSM -lICE -lxcb -lGL -lxcb-glx)
IF(EXISTS "${QT_LIBRARY_DIR}/libxcb-static.a")
SET(QT_LIBRARIES ${QT_LIBRARIES} "${QT_LIBRARY_DIR}/libxcb-static.a")
ENDIF()
SET(QT_LIBRARIES ${QT_LIBRARIES} -lfontconfig)
ADD_QT_LIBRARY(DBus)
ENDIF()
ADD_QT_PLUGIN(imageformats qgif)
ADD_QT_PLUGIN(imageformats qicns)
ADD_QT_PLUGIN(imageformats qico)
ADD_QT_PLUGIN(imageformats qjpeg)
# harfbuzz is needed since Qt 5.3
IF(UNIX)
SET(HB_LIB "${QT_LIBRARY_DIR}/libqtharfbuzzng.a")
ELSEIF(WIN32)
SET(HB_LIB "${QT_LIBRARY_DIR}/qtharfbuzzng.lib")
ENDIF()
IF(EXISTS ${HB_LIB})
SET(QT_LIBRARIES ${QT_LIBRARIES} ${HB_LIB})
ENDIF()
# freetype is needed since Qt 5.5
FIND_PACKAGE(Freetype)
IF(FREETYPE_FOUND)
SET(QT_LIBRARIES ${QT_LIBRARIES} ${FREETYPE_LIBRARIES})
ELSE()
IF(UNIX)
SET(FREETYPE_LIB "${QT_LIBRARY_DIR}/libqtfreetype.a")
ELSEIF(WIN32)
SET(FREETYPE_LIB "${QT_LIBRARY_DIR}/qtfreetype.lib")
ENDIF()
IF(EXISTS ${FREETYPE_LIB})
SET(QT_LIBRARIES ${QT_LIBRARIES} ${FREETYPE_LIB})
ENDIF()
ENDIF()
ADD_QT_PLUGIN(accessible qtaccessiblewidgets)
SET(QT_LIBRARIES ${QT_LIBRARIES} ${PNG_LIBRARIES} ${JPEG_LIBRARY})
# Network
SET(QT_LIBRARIES ${QT_LIBRARIES} Qt5::Network Qt5::Xml)
SET(QT_LIBRARIES ${QT_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES})
IF(WIN32)
SET(QT_LIBRARIES ${QT_LIBRARIES}
${WINSDK_LIBRARY_DIR}/Crypt32.lib
${WINSDK_LIBRARY_DIR}/WS2_32.Lib
${WINSDK_LIBRARY_DIR}/IPHlpApi.Lib)
ENDIF()
# Core
SET(QT_LIBRARIES ${QT_LIBRARIES} Qt5::Core)
# pcre is needed since Qt 5.5
IF(UNIX)
SET(PCRE_LIB "${QT_LIBRARY_DIR}/libqtpcre.a")
ELSEIF(WIN32)
SET(PCRE_LIB "${QT_LIBRARY_DIR}/qtpcre.lib")
ENDIF()
IF(EXISTS ${PCRE_LIB})
SET(QT_LIBRARIES ${QT_LIBRARIES} ${PCRE_LIB})
ENDIF()
IF(APPLE)
FIND_LIBRARY(PCRE_LIBRARY pcre16 pcre)
FIND_LIBRARY(SECURITY_FRAMEWORK Security)
SET(QT_LIBRARIES ${QT_LIBRARIES}
${PCRE_LIBRARY}
${FOUNDATION_FRAMEWORK}
${CARBON_FRAMEWORK}
${SECURITY_FRAMEWORK})
ELSEIF(UNIX)
SET(QT_LIBRARIES ${QT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} -ldl -lrt)
ENDIF()
ELSE()
SET(QT_LIBRARIES Qt5::Widgets Qt5::Network Qt5::Xml Qt5::Gui Qt5::OpenGL Qt5::Core)
ENDIF()
ELSE()
MESSAGE(WARNING "Unable to find Qt 5")
ENDIF()
FIND_QT5()
ENDIF()
IF(WITH_QT)
@ -435,22 +232,41 @@ IF(WITH_NEL)
IF(CURL_STATIC)
SET(CURL_DEFINITIONS -DCURL_STATICLIB)
SET(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR})
SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES})
LIST(APPEND CURL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
LIST(APPEND CURL_LIBRARIES ${OPENSSL_LIBRARIES})
IF(UNIX)
IF(WIN32)
LIST(APPEND CURL_LIBRARIES Crypt32 Cryptui)
ELSE()
# CURL depends on libidn
FIND_LIBRARY(IDN_LIBRARY idn)
IF(IDN_LIBRARY)
SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${IDN_LIBRARY})
LIST(APPEND CURL_LIBRARIES ${IDN_LIBRARY})
ENDIF()
# CURL Macports version depends on libidn, libintl and libiconv too
# CURL Macports version can depend on libidn, libidn2, libintl, libpsl and libiconv too
IF(APPLE)
FIND_LIBRARY(INTL_LIBRARY intl)
IF(INTL_LIBRARY)
SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${INTL_LIBRARY})
LIST(APPEND CURL_LIBRARIES ${INTL_LIBRARY})
ENDIF()
FIND_LIBRARY(IDN2_LIBRARY idn2)
IF(IDN2_LIBRARY)
LIST(APPEND CURL_LIBRARIES ${IDN2_LIBRARY})
ENDIF()
FIND_LIBRARY(PSL_LIBRARY psl)
IF(PSL_LIBRARY)
LIST(APPEND CURL_LIBRARIES ${PSL_LIBRARY})
ENDIF()
FIND_LIBRARY(UNISTRING_LIBRARY unistring)
IF(UNISTRING_LIBRARY)
LIST(APPEND CURL_LIBRARIES ${UNISTRING_LIBRARY})
ENDIF()
LIST(APPEND CURL_LIBRARIES ${SECURITY_FRAMEWORK})
ENDIF()
ENDIF()
ENDIF()
@ -458,6 +274,19 @@ IF(WITH_NEL)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/nel/include)
ADD_SUBDIRECTORY(nel)
# Aliases for targets
SET(NELMISC_LIBRARIES nelmisc)
SET(NELNET_LIBRARIES nelnet)
SET(NELLIGO_LIBRARIES nelligo)
SET(NELGEORGES_LIBRARIES nelgeorges)
SET(NEL3D_LIBRARIES nel3d)
SET(NELGUI_LIBRARIES nelgui)
SET(NELSOUND_LIBRARIES nelsound)
ELSE()
# FIND_PACKAGE(NeL COMPONENTS 3d misc pacs sound nimp REQUIRED)
FIND_PACKAGE(NeL REQUIRED)
INCLUDE_DIRECTORIES(${NEL_INCLUDE_DIRS})
ENDIF()
IF(WITH_RYZOM)
@ -480,6 +309,10 @@ IF(WITH_STUDIO)
ADD_SUBDIRECTORY(studio)
ENDIF()
IF(WITH_PERSONAL)
ADD_SUBDIRECTORY(personal)
ENDIF()
# To build the documention, you will have to enable it
# and then do the equivalent of "make DoxygenDoc".
IF(BUILD_DOCUMENTATION)

View file

@ -0,0 +1,959 @@
MACRO(CONVERT_NUMBER_VERSION _VERSION_NUMBER _BASE _OUT)
SET(${_OUT})
SET(_NUMBER ${_VERSION_NUMBER})
WHILE(_NUMBER GREATER 0)
MATH(EXPR _TEMP "${_NUMBER} % ${_BASE}")
LIST(APPEND ${_OUT} ${_TEMP})
MATH(EXPR _NUMBER "${_NUMBER} / ${_BASE}")
ENDWHILE()
ENDMACRO(CONVERT_NUMBER_VERSION)
FUNCTION(JOIN VALUES GLUE OUTPUT)
STRING(REGEX REPLACE "([^\\]|^);" "\\1${GLUE}" _TMP_STR "${VALUES}")
STRING(REGEX REPLACE "[\\](.)" "\\1" _TMP_STR "${_TMP_STR}") #fixes escaping
SET(${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
ENDFUNCTION()
MACRO(PARSE_VERSION_OTHER FILENAME)
IF(EXISTS ${FILENAME})
SET(_FILTER_ARRAY ${ARGN})
JOIN("${_FILTER_ARRAY}" "|" _FILTER_REGEX)
FILE(STRINGS ${FILENAME} _FILE REGEX "(${_FILTER_REGEX})[: \t=\(\)\"]+([0-9.]+)")
IF(_FILE)
FOREACH(_LINE ${_FILE})
FOREACH(_VAR ${_FILTER_ARRAY})
IF("${${_VAR}}" STREQUAL "")
STRING(REGEX REPLACE "^.*${_VAR}[: \t=\(\)\"]+([0-9.]+).*$" "\\1" ${_VAR} "${_LINE}")
IF(${_VAR} STREQUAL "${_LINE}")
SET(${_VAR})
ENDIF()
IF(NOT ${_VAR} AND NOT STREQUAL "0")
SET(${_VAR} 0)
ENDIF()
ENDIF()
ENDFOREACH()
ENDFOREACH()
ENDIF()
ENDIF()
ENDMACRO()
# macro to define FIND_PACKAGE options with a different package name
MACRO(FIX_PACKAGE_OPTIONS OLDNAME NEWNAME)
# append other options if needed
SET(_OPTIONS COMPONENTS REQUIRED QUIETLY)
# process each options
FOREACH(_OPTION ${_OPTIONS})
SET(OLD_OPTION ${OLDNAME}_FIND_${_OPTION})
IF(DEFINED )
SET(NEW_OPTION ${NEWNAME}_FIND_${_OPTION})
SET(${NEW_OPTION} ${OLD_OPTION})
ENDIF()
ENDFOREACH()
ENDMACRO()
MACRO(FIND_PACKAGE_HELPER NAME INCLUDE)
# Looks for a directory containing NAME.
#
# NAME is the name of the library, lowercase and uppercase can be mixed
# It should be EXACTLY (same case) the same part as XXXX in FindXXXX.cmake
#
# INCLUDE is the file to check for includes
#
# Following parameters are optional variables and must be prefixed by:
#
# RELEASE is the list of libraries to check in release mode
# DEBUG is the list of libraries to check in debug mode
# SUFFIXES is the PATH_SUFFIXES to check for include file
# QUIET don't display anything
# VERBOSE display more details if not found
# REQUIRED throw an error if not found
# DIR is the base directory where to look for
#
# The first match will be used in the specified order and next matches will be ignored
#
# The following values are defined
# NAME_INCLUDE_DIR - where to find NAME
# NAME_LIBRARIES - link against these to use NAME
# NAME_FOUND - True if NAME is available.
SET(_PARAMS ${ARGN})
SET(_RELEASE_LIBRARIES)
SET(_DEBUG_LIBRARIES)
SET(_SUFFIXES)
SET(_BASE_DIRECTORIES)
SET(_IS_RELEASE OFF)
SET(_IS_DEBUG OFF)
SET(_IS_SUFFIXES OFF)
SET(_IS_VERBOSE OFF)
SET(_IS_DIR OFF)
IF(_PARAMS)
FOREACH(_PARAM ${_PARAMS})
IF(_PARAM STREQUAL "RELEASE")
SET(_IS_RELEASE ON)
SET(_IS_DEBUG OFF)
SET(_IS_SUFFIXES OFF)
SET(_IS_DIR OFF)
ELSEIF(_PARAM STREQUAL "DEBUG")
SET(_IS_RELEASE OFF)
SET(_IS_DEBUG ON)
SET(_IS_SUFFIXES OFF)
SET(_IS_DIR OFF)
ELSEIF(_PARAM STREQUAL "SUFFIXES")
SET(_IS_RELEASE OFF)
SET(_IS_DEBUG OFF)
SET(_IS_DIR OFF)
SET(_IS_SUFFIXES ON)
ELSEIF(_PARAM STREQUAL "QUIET")
SET(_IS_RELEASE OFF)
SET(_IS_DEBUG OFF)
SET(_IS_SUFFIXES OFF)
SET(_IS_DIR OFF)
SET(${NAME}_FIND_QUIETLY ON)
ELSEIF(_PARAM STREQUAL "VERBOSE")
SET(_IS_RELEASE OFF)
SET(_IS_DEBUG OFF)
SET(_IS_SUFFIXES OFF)
SET(_IS_DIR OFF)
SET(_IS_VERBOSE ON)
ELSEIF(_PARAM STREQUAL "REQUIRED")
SET(_IS_RELEASE OFF)
SET(_IS_DEBUG OFF)
SET(_IS_SUFFIXES OFF)
SET(_IS_DIR OFF)
SET(${NAME}_FIND_REQUIRED ON)
ELSEIF(_PARAM STREQUAL "DIR")
SET(_IS_RELEASE OFF)
SET(_IS_DEBUG OFF)
SET(_IS_SUFFIXES OFF)
SET(_IS_DIR ON)
ELSE()
IF(_IS_RELEASE)
LIST(APPEND _RELEASE_LIBRARIES ${_PARAM})
ELSEIF(_IS_DEBUG)
LIST(APPEND _DEBUG_LIBRARIES ${_PARAM})
ELSEIF(_IS_SUFFIXES)
LIST(APPEND _SUFFIXES ${_PARAM})
ELSEIF(_IS_DIR)
LIST(APPEND _BASE_DIRECTORIES ${_PARAM})
ELSE()
MESSAGE(STATUS "parameter ${_PARAM} with no prefix")
ENDIF()
ENDIF()
ENDFOREACH()
ENDIF()
# Fixes names if invalid characters are found
IF("${NAME}" MATCHES "^[a-zA-Z0-9]+$")
SET(_NAME_FIXED ${NAME})
ELSE()
# if invalid characters are detected, replace them by valid ones
STRING(REPLACE "+" "p" _NAME_FIXED ${NAME})
ENDIF()
# Create uppercase and lowercase versions of NAME
STRING(TOUPPER ${NAME} _UPNAME)
STRING(TOLOWER ${NAME} _LOWNAME)
STRING(TOUPPER ${_NAME_FIXED} _UPNAME_FIXED)
STRING(TOLOWER ${_NAME_FIXED} _LOWNAME_FIXED)
SET(_SUFFIXES ${_SUFFIXES} ${_LOWNAME} ${_LOWNAME_FIXED} ${NAME})
# Don't use pkg-config
# IF(NOT WIN32 AND NOT IOS)
# FIND_PACKAGE(PkgConfig QUIET)
# SET(_MODULES ${_LOWNAME} ${_RELEASE_LIBRARIES})
# LIST(REMOVE_DUPLICATES _MODULES)
# IF(PKG_CONFIG_EXECUTABLE)
# PKG_SEARCH_MODULE(PKG_${_NAME_FIXED} QUIET ${_MODULES})
# ENDIF()
# ENDIF()
SET(_INCLUDE_PATHS)
SET(_LIBRARY_PATHS)
# Check for root directories passed to CMake with -DXXX_DIR=...
IF(DEFINED ${_UPNAME_FIXED}_DIR)
SET(_TMP ${${_UPNAME_FIXED}_DIR})
GET_FILENAME_COMPONENT(_TMP ${_TMP} ABSOLUTE)
LIST(APPEND _INCLUDE_PATHS ${_TMP}/include ${_TMP})
LIST(APPEND _LIBRARY_PATHS ${_TMP}/lib${LIB_SUFFIX})
IF(_IS_VERBOSE)
MESSAGE(STATUS "Using ${_UPNAME_FIXED}_DIR as root directory ${_TMP}")
ENDIF()
ENDIF()
IF(DEFINED ${_UPNAME}_DIR)
SET(_TMP ${${_UPNAME}_DIR})
LIST(APPEND _INCLUDE_PATHS ${_TMP}/include ${_TMP})
LIST(APPEND _LIBRARY_PATHS ${_TMP}/lib${LIB_SUFFIX})
IF(_IS_VERBOSE)
MESSAGE(STATUS "Using ${_UPNAME_FIXED}_DIR as root directory ${_TMP}")
ENDIF()
ENDIF()
IF(_BASE_DIRECTORIES)
FOREACH(_DIR ${_BASE_DIRECTORIES})
IF(_DIR)
LIST(APPEND _INCLUDE_PATHS ${_DIR}/include ${_DIR})
LIST(APPEND _LIBRARY_PATHS ${_DIR}/lib${LIB_SUFFIX})
IF(_IS_VERBOSE)
MESSAGE(STATUS "Using ${_DIR} as root directory")
ENDIF()
ENDIF()
ENDFOREACH()
ENDIF()
IF(UNIX)
# Append UNIX standard include paths
SET(_UNIX_INCLUDE_PATHS)
# Append multiarch include paths
IF(CMAKE_LIBRARY_ARCHITECTURE)
LIST(APPEND _UNIX_INCLUDE_PATHS
/usr/local/include/${CMAKE_LIBRARY_ARCHITECTURE}
/usr/include/${CMAKE_LIBRARY_ARCHITECTURE})
ENDIF()
LIST(APPEND _UNIX_INCLUDE_PATHS
/usr/local/include
/usr/include
/sw/include
/opt/local/include
/opt/csw/include
/opt/include)
ENDIF()
IF(_IS_VERBOSE)
MESSAGE(STATUS "Searching header ${INCLUDE} in: ${_INCLUDE_PATHS} with suffixes ${_SUFFIXES}")
ENDIF()
# Search for include directory
FIND_PATH(${_UPNAME_FIXED}_INCLUDE_DIR
NAMES ${INCLUDE}
HINTS
${PKG_${_NAME_FIXED}_INCLUDE_DIRS}
${_INCLUDE_PATHS}
$ENV{${_UPNAME}_DIR}/include
$ENV{${_UPNAME_FIXED}_DIR}/include
$ENV{${_UPNAME}_DIR}
$ENV{${_UPNAME_FIXED}_DIR}
PATHS
${_UNIX_INCLUDE_PATHS}
PATH_SUFFIXES
${_SUFFIXES}
DOC "Include path for ${NAME}"
)
IF(_IS_VERBOSE)
IF(${_UPNAME_FIXED}_INCLUDE_DIR)
MESSAGE(STATUS "${INCLUDE} found in ${${_UPNAME_FIXED}_INCLUDE_DIR}")
ELSE()
MESSAGE(STATUS "${INCLUDE} not found")
ENDIF()
ENDIF()
# Append environment variables XXX_DIR
LIST(APPEND _LIBRARY_PATHS
$ENV{${_UPNAME}_DIR}/lib${LIB_SUFFIX}
$ENV{${_UPNAME_FIXED}_DIR}/lib${LIB_SUFFIX})
IF(UNIX)
SET(_UNIX_LIBRARY_PATHS)
# Append multiarch libraries paths
IF(CMAKE_LIBRARY_ARCHITECTURE)
LIST(APPEND _UNIX_LIBRARY_PATHS
/usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
/lib/${CMAKE_LIBRARY_ARCHITECTURE}
/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE})
ENDIF()
# Append UNIX standard libraries paths
LIST(APPEND _UNIX_LIBRARY_PATHS
/usr/local/lib
/usr/lib
/lib
/usr/local/X11R6/lib
/usr/X11R6/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib${LIB_SUFFIX})
ENDIF()
LIST(APPEND _RELEASE_LIBRARIES ${_LOWNAME} ${_LOWNAME_FIXED} ${NAME} ${_NAME_FIXED})
LIST(APPEND _DEBUG_LIBRARIES ${_LOWNAME}d ${_LOWNAME_FIXED}d ${NAME}d ${_NAME_FIXED}d)
# Under Windows, some libs may need the lib prefix
IF(WIN32)
SET(_LIBS ${_RELEASE_LIBRARIES})
FOREACH(_LIB ${_LIBS})
LIST(APPEND _RELEASE_LIBRARIES lib${_LIB})
ENDFOREACH()
SET(_LIBS ${_DEBUG_LIBRARIES})
FOREACH(_LIB ${_LIBS})
LIST(APPEND _DEBUG_LIBRARIES lib${_LIB})
ENDFOREACH()
ENDIF()
LIST(REMOVE_DUPLICATES _RELEASE_LIBRARIES)
LIST(REMOVE_DUPLICATES _DEBUG_LIBRARIES)
# Search for release library
FIND_LIBRARY(${_UPNAME_FIXED}_LIBRARY_RELEASE
NAMES
${_RELEASE_LIBRARIES}
HINTS ${PKG_${_NAME_FIXED}_LIBRARY_DIRS}
PATHS
${_LIBRARY_PATHS}
${_UNIX_LIBRARY_PATHS}
NO_CMAKE_SYSTEM_PATH
)
IF(_IS_VERBOSE)
IF(${_UPNAME_FIXED}_LIBRARY_RELEASE)
MESSAGE(STATUS "${NAME} release library found: ${${_UPNAME_FIXED}_LIBRARY_RELEASE}")
ELSE()
MESSAGE(STATUS "${NAME} release library not found in ${_LIBRARY_PATHS};${_UNIX_LIBRARY_PATHS}")
ENDIF()
ENDIF()
# Search for debug library
FIND_LIBRARY(${_UPNAME_FIXED}_LIBRARY_DEBUG
NAMES
${_DEBUG_LIBRARIES}
HINTS ${PKG_${_NAME_FIXED}_LIBRARY_DIRS}
PATHS
${_LIBRARY_PATHS}
${_UNIX_LIBRARY_PATHS}
NO_CMAKE_SYSTEM_PATH
)
IF(_IS_VERBOSE)
IF(${_UPNAME_FIXED}_LIBRARY_DEBUG)
MESSAGE(STATUS "${NAME} debug library found: ${${_UPNAME_FIXED}_LIBRARY_DEBUG}")
ELSE()
MESSAGE(STATUS "${NAME} debug library not found")
ENDIF()
ENDIF()
SET(${_UPNAME_FIXED}_FOUND OFF)
IF(${_UPNAME_FIXED}_INCLUDE_DIR)
# Set also _INCLUDE_DIRS
SET(${_UPNAME_FIXED}_INCLUDE_DIRS ${${_UPNAME_FIXED}_INCLUDE_DIR})
ENDIF()
# Library has been found if at least only one library and include are found
IF(${_UPNAME_FIXED}_LIBRARY_RELEASE AND ${_UPNAME_FIXED}_LIBRARY_DEBUG)
# Release and debug libraries found
SET(${_UPNAME_FIXED}_FOUND ON)
SET(${_UPNAME_FIXED}_LIBRARIES optimized ${${_UPNAME_FIXED}_LIBRARY_RELEASE} debug ${${_UPNAME_FIXED}_LIBRARY_DEBUG})
SET(${_UPNAME_FIXED}_LIBRARY ${${_UPNAME_FIXED}_LIBRARY_RELEASE})
ELSEIF(${_UPNAME_FIXED}_LIBRARY_RELEASE)
# Release library found
SET(${_UPNAME_FIXED}_FOUND ON)
SET(${_UPNAME_FIXED}_LIBRARIES ${${_UPNAME_FIXED}_LIBRARY_RELEASE})
SET(${_UPNAME_FIXED}_LIBRARY ${${_UPNAME_FIXED}_LIBRARY_RELEASE})
ELSEIF(${_UPNAME_FIXED}_LIBRARY_DEBUG)
# Debug library found
SET(${_UPNAME_FIXED}_FOUND ON)
SET(${_UPNAME_FIXED}_LIBRARIES ${${_UPNAME_FIXED}_LIBRARY_DEBUG})
SET(${_UPNAME_FIXED}_LIBRARY ${${_UPNAME_FIXED}_LIBRARY_DEBUG})
ENDIF()
IF(${_UPNAME_FIXED}_FOUND)
IF(NOT ${NAME}_FIND_QUIETLY)
MESSAGE(STATUS "Found ${NAME}: ${${_UPNAME_FIXED}_LIBRARIES}")
ENDIF()
ELSE()
IF(${NAME}_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Error: Unable to find ${NAME}!")
ENDIF()
IF(NOT ${NAME}_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find ${NAME}!")
ENDIF()
ENDIF()
MARK_AS_ADVANCED(${_UPNAME_FIXED}_LIBRARY_RELEASE ${_UPNAME_FIXED}_LIBRARY_DEBUG)
ENDMACRO()
MACRO(MESSAGE_VERSION_PACKAGE_HELPER NAME VERSION)
MESSAGE(STATUS "Found ${NAME} ${VERSION}: ${ARGN}")
ENDMACRO()
MACRO(FIND_LIBRARY_HELPER NAME)
# Looks for libraries.
#
# NAME is the name of the library, lowercase and uppercase can be mixed
#
# Following parameters are optional variables and must be prefixed by:
#
# RELEASE is the list of libraries to check in release mode
# DEBUG is the list of libraries to check in debug mode
# VERBOSE display more details if not found
# REQUIRED throw an error if not found
# DIR is the base directory where to look for
#
# The first match will be used in the specified order and next matches will be ignored
#
# The following values are defined
# NAME_LIBRARIES - link against these to use NAME
SET(_PARAMS ${ARGN})
SET(_RELEASE_LIBRARIES)
SET(_DEBUG_LIBRARIES)
SET(_BASE_DIRECTORIES)
SET(_IS_RELEASE OFF)
SET(_IS_DEBUG OFF)
SET(_IS_VERBOSE OFF)
SET(_IS_DIR OFF)
IF(_PARAMS)
FOREACH(_PARAM ${_PARAMS})
IF(_PARAM STREQUAL "RELEASE")
SET(_IS_RELEASE ON)
SET(_IS_DEBUG OFF)
SET(_IS_DIR OFF)
ELSEIF(_PARAM STREQUAL "DEBUG")
SET(_IS_RELEASE OFF)
SET(_IS_DEBUG ON)
SET(_IS_DIR OFF)
ELSEIF(_PARAM STREQUAL "VERBOSE")
SET(_IS_RELEASE OFF)
SET(_IS_DEBUG OFF)
SET(_IS_DIR OFF)
SET(_IS_VERBOSE ON)
ELSEIF(_PARAM STREQUAL "REQUIRED")
SET(_IS_RELEASE OFF)
SET(_IS_DEBUG OFF)
SET(_IS_DIR OFF)
SET(${NAME}_FIND_REQUIRED ON)
ELSEIF(_PARAM STREQUAL "DIR")
SET(_IS_RELEASE OFF)
SET(_IS_DEBUG OFF)
SET(_IS_DIR ON)
ELSE()
IF(_IS_RELEASE)
LIST(APPEND _RELEASE_LIBRARIES ${_PARAM})
ELSEIF(_IS_DEBUG)
LIST(APPEND _DEBUG_LIBRARIES ${_PARAM})
ELSEIF(_IS_DIR)
LIST(APPEND _BASE_DIRECTORIES ${_PARAM})
ELSE()
MESSAGE(STATUS "parameter ${_PARAM} with no prefix")
ENDIF()
ENDIF()
ENDFOREACH()
ENDIF()
# Fixes names if invalid characters are found
IF("${NAME}" MATCHES "^[a-zA-Z0-9]+$")
SET(_NAME_FIXED ${NAME})
ELSE()
# if invalid characters are detected, replace them by valid ones
STRING(REPLACE "+" "p" _NAME_FIXED ${NAME})
ENDIF()
# Create uppercase and lowercase versions of NAME
STRING(TOUPPER ${NAME} _UPNAME)
STRING(TOLOWER ${NAME} _LOWNAME)
STRING(TOUPPER ${_NAME_FIXED} _UPNAME_FIXED)
STRING(TOLOWER ${_NAME_FIXED} _LOWNAME_FIXED)
SET(_LIBRARY_PATHS)
# Check for root directories passed to CMake with -DXXX_DIR=...
IF(DEFINED ${_UPNAME_FIXED}_DIR)
SET(_TMP ${${_UPNAME_FIXED}_DIR})
GET_FILENAME_COMPONENT(_TMP ${_TMP} ABSOLUTE)
LIST(APPEND _LIBRARY_PATHS ${_TMP}/lib${LIB_SUFFIX})
IF(_IS_VERBOSE)
MESSAGE(STATUS "Using ${_UPNAME_FIXED}_DIR as root directory ${_TMP}")
ENDIF()
ENDIF()
IF(DEFINED ${_UPNAME}_DIR)
SET(_TMP ${${_UPNAME}_DIR})
LIST(APPEND _LIBRARY_PATHS ${_TMP}/lib${LIB_SUFFIX})
IF(_IS_VERBOSE)
MESSAGE(STATUS "Using ${_UPNAME_FIXED}_DIR as root directory ${_TMP}")
ENDIF()
ENDIF()
IF(_BASE_DIRECTORIES)
FOREACH(_DIR ${_BASE_DIRECTORIES})
IF(_DIR)
LIST(APPEND _LIBRARY_PATHS ${_DIR}/lib${LIB_SUFFIX})
IF(_IS_VERBOSE)
MESSAGE(STATUS "Using ${_DIR} as root directory")
ENDIF()
ENDIF()
ENDFOREACH()
ENDIF()
# Append environment variables XXX_DIR
LIST(APPEND _LIBRARY_PATHS
$ENV{${_UPNAME}_DIR}/lib${LIB_SUFFIX}
$ENV{${_UPNAME_FIXED}_DIR}/lib${LIB_SUFFIX})
IF(UNIX)
SET(_UNIX_LIBRARY_PATHS)
# Append multiarch libraries paths
IF(CMAKE_LIBRARY_ARCHITECTURE)
LIST(APPEND _UNIX_LIBRARY_PATHS
/usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
/lib/${CMAKE_LIBRARY_ARCHITECTURE}
/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE})
ENDIF()
# Append UNIX standard libraries paths
LIST(APPEND _UNIX_LIBRARY_PATHS
/usr/local/lib
/usr/lib
/lib
/usr/local/X11R6/lib
/usr/X11R6/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib${LIB_SUFFIX})
ENDIF()
LIST(APPEND _RELEASE_LIBRARIES ${_LOWNAME} ${_LOWNAME_FIXED} ${NAME} ${_NAME_FIXED})
LIST(APPEND _DEBUG_LIBRARIES ${_LOWNAME}d ${_LOWNAME_FIXED}d ${NAME}d ${_NAME_FIXED}d)
# Under Windows, some libs may need the lib prefix
IF(WIN32)
SET(_LIBS ${_RELEASE_LIBRARIES})
FOREACH(_LIB ${_LIBS})
LIST(APPEND _RELEASE_LIBRARIES lib${_LIB})
ENDFOREACH()
SET(_LIBS ${_DEBUG_LIBRARIES})
FOREACH(_LIB ${_LIBS})
LIST(APPEND _DEBUG_LIBRARIES lib${_LIB})
ENDFOREACH()
ENDIF()
LIST(REMOVE_DUPLICATES _RELEASE_LIBRARIES)
LIST(REMOVE_DUPLICATES _DEBUG_LIBRARIES)
# Search for release library
FIND_LIBRARY(${_UPNAME_FIXED}_LIBRARY_RELEASE
NAMES
${_RELEASE_LIBRARIES}
HINTS ${PKG_${_NAME_FIXED}_LIBRARY_DIRS}
PATHS
${_LIBRARY_PATHS}
${_UNIX_LIBRARY_PATHS}
NO_CMAKE_SYSTEM_PATH
)
IF(_IS_VERBOSE)
IF(${_UPNAME_FIXED}_LIBRARY_RELEASE)
MESSAGE(STATUS "${NAME} release library found: ${${_UPNAME_FIXED}_LIBRARY_RELEASE}")
ELSE()
MESSAGE(STATUS "${NAME} release library not found in ${_LIBRARY_PATHS};${_UNIX_LIBRARY_PATHS}")
ENDIF()
ENDIF()
# Search for debug library
FIND_LIBRARY(${_UPNAME_FIXED}_LIBRARY_DEBUG
NAMES
${_DEBUG_LIBRARIES}
HINTS ${PKG_${_NAME_FIXED}_LIBRARY_DIRS}
PATHS
${_LIBRARY_PATHS}
${_UNIX_LIBRARY_PATHS}
NO_CMAKE_SYSTEM_PATH
)
IF(_IS_VERBOSE)
IF(${_UPNAME_FIXED}_LIBRARY_DEBUG)
MESSAGE(STATUS "${NAME} debug library found: ${${_UPNAME_FIXED}_LIBRARY_DEBUG}")
ELSE()
MESSAGE(STATUS "${NAME} debug library not found")
ENDIF()
ENDIF()
# Library has been found if at least only one library and include are found
IF(${_UPNAME_FIXED}_LIBRARY_RELEASE AND ${_UPNAME_FIXED}_LIBRARY_DEBUG)
# Release and debug libraries found
SET(${_UPNAME_FIXED}_LIBRARIES optimized ${${_UPNAME_FIXED}_LIBRARY_RELEASE} debug ${${_UPNAME_FIXED}_LIBRARY_DEBUG})
SET(${_UPNAME_FIXED}_LIBRARY ${${_UPNAME_FIXED}_LIBRARY_RELEASE})
ELSEIF(${_UPNAME_FIXED}_LIBRARY_RELEASE)
# Release library found
SET(${_UPNAME_FIXED}_LIBRARIES ${${_UPNAME_FIXED}_LIBRARY_RELEASE})
SET(${_UPNAME_FIXED}_LIBRARY ${${_UPNAME_FIXED}_LIBRARY_RELEASE})
ELSEIF(${_UPNAME_FIXED}_LIBRARY_DEBUG)
# Debug library found
SET(${_UPNAME_FIXED}_LIBRARIES ${${_UPNAME_FIXED}_LIBRARY_DEBUG})
SET(${_UPNAME_FIXED}_LIBRARY ${${_UPNAME_FIXED}_LIBRARY_DEBUG})
ENDIF()
MARK_AS_ADVANCED(${_UPNAME_FIXED}_LIBRARY_RELEASE ${_UPNAME_FIXED}_LIBRARY_DEBUG)
ENDMACRO()
MACRO(FIND_LIBCURL)
IF(NOT CURL_FOUND)
FIND_PACKAGE(CURL REQUIRED)
IF(WIN32 OR CURL_LIBRARY MATCHES "\\.a" OR WITH_STATIC_CURL)
SET(CURL_STATIC ON)
ELSE()
SET(CURL_STATIC OFF)
ENDIF()
IF(CURL_STATIC)
SET(CURL_DEFINITIONS -DCURL_STATICLIB)
IF(UNIX)
# CURL can depend on libidn
FIND_LIBRARY(IDN_LIBRARY idn)
IF(IDN_LIBRARY)
LIST(APPEND CURL_LIBRARIES ${IDN_LIBRARY})
ENDIF()
# CURL Macports version can depend on libidn, libintl and libiconv too
IF(APPLE)
FIND_LIBRARY(INTL_LIBRARY intl)
IF(INTL_LIBRARY)
LIST(APPEND CURL_LIBRARIES ${INTL_LIBRARY})
ENDIF()
ELSE()
# Only used by libcurl under Linux
FIND_PACKAGE(OpenSSL REQUIRED)
#IF(WIN32)
# SET(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} Crypt32.lib)
#ENDIF()
# Only Linux version of libcurl depends on OpenSSL
LIST(APPEND CURL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
LIST(APPEND CURL_LIBRARIES ${OPENSSL_LIBRARIES})
ENDIF()
ENDIF()
ENDIF()
ENDIF()
ENDMACRO()
MACRO(FIND_LIBXML2)
IF(NOT LIBXML2_FOUND)
FIND_PACKAGE(LibXml2 REQUIRED)
IF(WIN32 OR WITH_STATIC_LIBXML2)
LIST(APPEND LIBXML2_DEFINITIONS -DLIBXML_STATIC)
ENDIF()
IF(WITH_LIBXML2_ICONV)
FIND_PACKAGE(Iconv REQUIRED)
# LIST(APPEND CURL_INCLUDE_DIRS ${ICONV_INCLUDE_DIR})
LIST(APPEND LIBXML2_LIBRARIES ${ICONV_LIBRARIES})
ENDIF()
IF(WITH_STATIC)
# libxml2 could need winsock2 library
IF(WIN32)
FIND_LIBRARY(WINSOCK2_LIB ws2_32)
IF(WINSOCK2_LIB)
LIST(APPEND LIBXML2_LIBRARIES ${WINSOCK2_LIB})
ENDIF()
FIND_LIBRARY(CRYPT32_LIB Crypt32)
IF(CRYPT32_LIB)
LIST(APPEND LIBXML2_LIBRARIES ${CRYPT32_LIB})
ENDIF()
ELSE()
# under Linux and OS X, recent libxml2 versions are linked against liblzma
FIND_PACKAGE(LibLZMA)
IF(LIBLZMA_LIBRARIES)
LIST(APPEND LIBXML2_LIBRARIES ${LIBLZMA_LIBRARIES})
ENDIF()
ENDIF()
ENDIF()
ENDIF()
ENDMACRO()
MACRO(ADD_QT_LIBRARY _NAME)
IF(WIN32)
SET(_PREFIX "Qt5")
SET(_EXT "lib")
ELSE()
SET(_PREFIX "libQt5")
SET(_EXT "a")
ENDIF()
SET(_LIB "${QT_LIBRARY_DIR}/${_PREFIX}${_NAME}.${_EXT}")
IF(EXISTS ${_LIB})
LIST(APPEND QT_LIBRARIES optimized ${_LIB})
ENDIF()
SET(_LIB "${QT_LIBRARY_DIR}/${_PREFIX}${_NAME}d.${_EXT}")
IF(EXISTS ${_LIB})
LIST(APPEND QT_LIBRARIES debug ${_LIB})
ENDIF()
ENDMACRO()
MACRO(ADD_QT_PLUGIN _TYPE _NAME)
IF(WIN32)
SET(_PREFIX "")
SET(_EXT "lib")
ELSE()
SET(_PREFIX "lib")
SET(_EXT "a")
ENDIF()
SET(_LIB "${QT_PLUGINS_DIR}/${_TYPE}/${_PREFIX}${_NAME}.${_EXT}")
IF(EXISTS ${_LIB})
LIST(APPEND QT_LIBRARIES optimized ${_LIB})
ENDIF()
SET(_LIB "${QT_PLUGINS_DIR}/${_TYPE}/${_PREFIX}${_NAME}d.${_EXT}")
IF(EXISTS ${_LIB})
LIST(APPEND QT_LIBRARIES debug ${_LIB})
ENDIF()
ENDMACRO()
MACRO(ADD_QT_SYSTEM_LIBRARY _NAME)
# Save default suffixes
SET(_OLD_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
# Define specific suffixes
SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX})
# Find the library with specified suffixes
FIND_LIBRARY(${_NAME}_LIBRARY NAMES ${_NAME})
# Restore default suffixes
SET(CMAKE_FIND_LIBRARY_SUFFIXES ${_OLD_SUFFIXES})
IF(${_NAME}_LIBRARY)
MESSAGE(STATUS "Found ${${_NAME}_LIBRARY} ${_NAME}")
LIST(APPEND QT_LIBRARIES ${${_NAME}_LIBRARY})
ELSE()
MESSAGE(STATUS "Didn't find ${_NAME}")
ENDIF()
ENDMACRO()
MACRO(FIND_QT5)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11 FATAL_ERROR)
SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${QTDIR} $ENV{QTDIR})
FIND_PACKAGE(Qt5Core QUIET)
IF(Qt5Core_FOUND)
# Check if we are using Qt static or shared libraries
GET_TARGET_PROPERTY(_FILE Qt5::Core IMPORTED_LOCATION_RELEASE)
SET(QT_VERSION "${Qt5Core_VERSION_STRING}")
SET(_VERSION "${QT_VERSION}")
IF(_FILE MATCHES "\\.(lib|a)$")
SET(QT_STATIC ON)
SET(_VERSION "${_VERSION} static version")
ELSE()
SET(QT_STATIC OFF)
SET(_VERSION "${_VERSION} shared version")
ENDIF()
MESSAGE(STATUS "Found Qt ${_VERSION}")
# These variables are not defined with Qt5 CMake modules
SET(QT_BINARY_DIR "${_qt5Core_install_prefix}/bin")
SET(QT_LIBRARY_DIR "${_qt5Core_install_prefix}/lib")
SET(QT_PLUGINS_DIR "${_qt5Core_install_prefix}/plugins")
SET(QT_TRANSLATIONS_DIR "${_qt5Core_install_prefix}/translations")
# Fix wrong include directories with Qt 5 under Mac OS X
INCLUDE_DIRECTORIES("${_qt5Core_install_prefix}/include")
FIND_PACKAGE(Qt5Gui)
FIND_PACKAGE(Qt5Widgets)
FIND_PACKAGE(Qt5OpenGL)
FIND_PACKAGE(Qt5Xml)
FIND_PACKAGE(Qt5LinguistTools)
FIND_PACKAGE(Qt5Network)
IF(QT_STATIC)
FIND_PACKAGE(PNG REQUIRED)
FIND_PACKAGE(Jpeg REQUIRED)
ADD_DEFINITIONS(-DQT_STATICPLUGIN)
SET(QT_LIBRARIES Qt5::Widgets)
# Gui
LIST(APPEND QT_LIBRARIES Qt5::Gui Qt5::OpenGL)
ADD_QT_LIBRARY(PrintSupport)
IF(WIN32)
LIST(APPEND QT_LIBRARIES
${WINSDK_LIBRARY_DIR}/Imm32.lib
${WINSDK_LIBRARY_DIR}/OpenGL32.lib
${WINSDK_LIBRARY_DIR}/WinMM.Lib)
ADD_QT_PLUGIN(platforms qwindows)
ADD_QT_LIBRARY(PlatformSupport)
ELSEIF(APPLE)
# Cups needs .dylib
SET(OLD_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
SET(CMAKE_FIND_LIBRARY_SUFFIXES .dylib)
FIND_LIBRARY(CUPS_LIBRARY cups)
SET(CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_CMAKE_FIND_LIBRARY_SUFFIXES})
FIND_LIBRARY(IOKIT_FRAMEWORK IOKit)
FIND_LIBRARY(COCOA_FRAMEWORK Cocoa)
FIND_LIBRARY(SYSTEMCONFIGURATION_FRAMEWORK SystemConfiguration)
FIND_LIBRARY(OPENGL_FRAMEWORK NAMES OpenGL)
LIST(APPEND QT_LIBRARIES
${CUPS_LIBRARY}
${COCOA_FRAMEWORK}
${SYSTEMCONFIGURATION_FRAMEWORK}
${IOKIT_FRAMEWORK}
${OPENGL_FRAMEWORK})
ADD_QT_PLUGIN(printsupport cocoaprintersupport)
ADD_QT_PLUGIN(platforms qcocoa)
ADD_QT_LIBRARY(PlatformSupport)
ELSE()
# order is very important there
ADD_QT_PLUGIN(platforms qxcb)
ADD_QT_PLUGIN(xcbglintegrations qxcb-glx-integration)
ADD_QT_LIBRARY(XcbQpa)
ADD_QT_LIBRARY(GlxSupport)
ADD_QT_LIBRARY(ServiceSupport)
ADD_QT_LIBRARY(EdidSupport)
ADD_QT_LIBRARY(FontDatabaseSupport)
ADD_QT_LIBRARY(ThemeSupport)
ADD_QT_LIBRARY(EventDispatcherSupport)
ADD_QT_LIBRARY(PlatformSupport)
ADD_QT_LIBRARY(DBus)
IF(EXISTS "${QT_LIBRARY_DIR}/libxcb-static.a")
LIST(APPEND QT_LIBRARIES "${QT_LIBRARY_DIR}/libxcb-static.a")
ENDIF()
# always link these in dynamic, API never changes
ADD_QT_SYSTEM_LIBRARY(X11)
ADD_QT_SYSTEM_LIBRARY(Xmu)
ADD_QT_SYSTEM_LIBRARY(X11-xcb)
ADD_QT_SYSTEM_LIBRARY(Xi)
ADD_QT_SYSTEM_LIBRARY(SM)
ADD_QT_SYSTEM_LIBRARY(ICE)
ADD_QT_SYSTEM_LIBRARY(xcb)
ADD_QT_SYSTEM_LIBRARY(GL)
ADD_QT_SYSTEM_LIBRARY(xcb-glx)
ADD_QT_SYSTEM_LIBRARY(fontconfig)
ADD_QT_SYSTEM_LIBRARY(Xrender)
ENDIF()
ADD_QT_PLUGIN(imageformats qgif)
ADD_QT_PLUGIN(imageformats qicns)
ADD_QT_PLUGIN(imageformats qico)
ADD_QT_PLUGIN(imageformats qjpeg)
# harfbuzz is needed since Qt 5.3
IF(UNIX)
SET(HB_LIB "${QT_LIBRARY_DIR}/libqtharfbuzzng.a")
IF(NOT EXISTS ${HB_LIB})
SET(HB_LIB "${QT_LIBRARY_DIR}/libqtharfbuzz.a")
ENDIF()
ELSEIF(WIN32)
SET(HB_LIB "${QT_LIBRARY_DIR}/qtharfbuzzng.lib")
ENDIF()
IF(EXISTS ${HB_LIB})
LIST(APPEND QT_LIBRARIES ${HB_LIB})
ENDIF()
# freetype is needed since Qt 5.5
FIND_PACKAGE(Freetype)
IF(FREETYPE_FOUND)
LIST(APPEND QT_LIBRARIES ${FREETYPE_LIBRARIES})
ELSE()
IF(UNIX)
SET(FREETYPE_LIB "${QT_LIBRARY_DIR}/libqtfreetype.a")
ELSEIF(WIN32)
SET(FREETYPE_LIB "${QT_LIBRARY_DIR}/qtfreetype.lib")
ENDIF()
IF(EXISTS ${FREETYPE_LIB})
LIST(APPEND QT_LIBRARIES ${FREETYPE_LIB})
ENDIF()
ENDIF()
ADD_QT_PLUGIN(accessible qtaccessiblewidgets)
LIST(APPEND QT_LIBRARIES ${PNG_LIBRARIES} ${JPEG_LIBRARY})
# Network
LIST(APPEND QT_LIBRARIES Qt5::Network Qt5::Xml)
LIST(APPEND QT_LIBRARIES ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES})
IF(WIN32)
LIST(APPEND QT_LIBRARIES
${WINSDK_LIBRARY_DIR}/Crypt32.lib
${WINSDK_LIBRARY_DIR}/WS2_32.Lib
${WINSDK_LIBRARY_DIR}/IPHlpApi.Lib)
ENDIF()
# Core
LIST(APPEND QT_LIBRARIES Qt5::Core)
# pcre is needed since Qt 5.5
IF(UNIX)
SET(PCRE_LIB "${QT_LIBRARY_DIR}/libqtpcre.a")
IF(NOT EXISTS ${PCRE_LIB})
SET(PCRE_LIB "${QT_LIBRARY_DIR}/libqtpcre2.a")
ENDIF()
ELSEIF(WIN32)
SET(PCRE_LIB "${QT_LIBRARY_DIR}/qtpcre.lib")
ENDIF()
IF(EXISTS ${PCRE_LIB})
LIST(APPEND QT_LIBRARIES ${PCRE_LIB})
ENDIF()
IF(APPLE)
FIND_LIBRARY(PCRE_LIBRARY pcre16 pcre)
FIND_LIBRARY(SECURITY_FRAMEWORK Security)
LIST(APPEND QT_LIBRARIES
${PCRE_LIBRARY}
${FOUNDATION_FRAMEWORK}
${CARBON_FRAMEWORK}
${SECURITY_FRAMEWORK})
ELSEIF(UNIX)
FIND_PACKAGE(Threads)
LIST(APPEND QT_LIBRARIES ${ZLIB_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS} -lrt)
ENDIF()
ELSE()
SET(QT_LIBRARIES Qt5::Widgets Qt5::Network Qt5::Xml Qt5::Gui Qt5::OpenGL Qt5::Core)
ENDIF()
ELSE()
MESSAGE(WARNING "Unable to find Qt 5")
ENDIF()
ENDMACRO()

View file

@ -0,0 +1,398 @@
# NEL_DIR can be specified as root directory
# Returned variables
# NELDRIVER_XXX_BINARY_DEBUG
# NELDRIVER_XXX_BINARY_RELEASE
# NELDRIVER_XXX_LIBRARY_DEBUG
# NELDRIVER_XXX_LIBRARY_RELEASE
# NELDRIVER_XXX_FOUND
# NEL_DEFINITIONS
# NEL_INCLUDE_DIR
# NEL_INCLUDE_DIRS
# NEL_LIBRARIES
# NELXXX_FOUND
# NELXXX_LIBRARIES
INCLUDE(FindHelpers)
# Init all variables we'll set
SET(NEL_LIBRARIES)
SET(NEL_INCLUDE_DIR)
SET(NEL_INCLUDE_DIRS)
SET(NEL_VERSION)
SET(NEL_STATIC)
SET(NEL_STATIC_DRIVERS)
SET(NEL_VERSION_MAJOR)
SET(NEL_VERSION_MINOR)
SET(NEL_VERSION_PATCH)
SET(NEL_REVISION)
SET(NEL_VERSION)
SET(NEL_MODULES_FOUND)
SET(NEL_MODULES_AVAILABLE 3d georges gui ligo logic net pacs sound) # cegui pipeline
SET(NEL_DRIVERS_FOUND)
SET(NEL_DRIVERS_AVAILABLE opengl opengles direct3d dsound fmod openal xaudio2)
SET(NELMISC_FIND_REQUIRED ${NeL_FIND_REQUIRED})
# Force search of NELMISC
FIND_PACKAGE_HELPER(nelmisc nel/misc/types_nl.h RELEASE nelmisc_r nelmisc DEBUG nelmisc_d DIR ${NEL_DIR} VERBOSE QUIET)
IF(NELMISC_FOUND)
# define NEL_DIR if not specified
IF(NOT NEL_DIR)
GET_FILENAME_COMPONENT(NEL_DIR ${NELMISC_INCLUDE_DIR}/.. ABSOLUTE)
ENDIF()
# Aliases for include directory
SET(NEL_INCLUDE_DIR ${NELMISC_INCLUDE_DIR})
SET(NEL_INCLUDE_DIRS ${NEL_INCLUDE_DIR})
MESSAGE(STATUS "Found NeL headers in ${NEL_INCLUDE_DIR}")
GET_FILENAME_COMPONENT(NEL_LIBRARY_DIR ${NELMISC_LIBRARY} DIRECTORY)
MESSAGE(STATUS "Found NeL library in ${NEL_LIBRARY_DIR}")
# TODO: implement static version checks for Windows
# static libraries
IF(UNIX)
GET_FILENAME_COMPONENT(_LIBEXT ${NELMISC_LIBRARY} EXT)
IF(_LIBEXT STREQUAL ".a")
SET(NEL_STATIC ON)
MESSAGE(STATUS "NeL is using static libraries")
ENDIF()
ENDIF()
IF(WIN32)
SET(NELDRIVER_DIRS_TO_CHECK
${NEL_DIR}/bin${LIB_SUFFIX}
${NEL_DIR}
)
ELSE()
SET(NELDRIVER_DIRS_TO_CHECK
/usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}/nel
/usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/nel
/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
/usr/lib/nel
/usr/lib
)
ENDIF()
# check for static drivers
FOREACH(_DRIVER ${NEL_DRIVERS_AVAILABLE})
IF(WIN32)
SET(_DRIVER_RELASE_FILE "nel_drv_${_DRIVER}_win_r")
SET(_DRIVER_DEBUG_FILE "nel_drv_${_DRIVER}_win_d")
SET(_DRIVER_SHARED_EXT dll)
SET(_DRIVER_STATIC_EXT lib)
ELSE()
SET(_DRIVER_RELEASE_FILE "nel_drv_${_DRIVER}")
SET(_DRIVER_DEBUG_FILE)
SET(_DRIVER_SHARED_EXT so)
SET(_DRIVER_STATIC_EXT a)
ENDIF()
STRING(TOUPPER ${_DRIVER} _UPDRIVER)
FOREACH(_DIR ${NELDRIVER_DIRS_TO_CHECK})
SET(_FOUND OFF)
IF(_DRIVER_RELASE_FILE)
SET(_FILE "${_DIR}/${_DRIVER_RELASE_FILE}.${_DRIVER_SHARED_EXT}")
IF(EXISTS ${_FILE})
SET(NELDRIVER_${_UPDRIVER}_BINARY_RELEASE ${_FILE})
MESSAGE(STATUS "Found NeL release shared driver ${_DRIVER}: ${_FILE}")
SET(NEL_STATIC_DRIVERS OFF)
IF(NOT NEL_DRIVER_DIR)
SET(NEL_DRIVER_DIR ${_DIR})
ENDIF()
ENDIF()
SET(_FILE "${_DIR}/${_DRIVER_RELASE_FILE}.${_DRIVER_STATIC_EXT}")
IF(EXISTS ${_FILE})
SET(NELDRIVER_${_UPDRIVER}_LIBRARY_RELEASE ${_FILE})
MESSAGE(STATUS "Found NeL release static driver ${_DRIVER}: ${_FILE}")
SET(NEL_STATIC_DRIVERS ON)
IF(NOT NEL_DRIVER_DIR)
SET(NEL_DRIVER_DIR ${_DIR})
ENDIF()
ENDIF()
ENDIF()
IF(_DRIVER_DEBUG_FILE)
SET(_FILE "${_DIR}/${_DRIVER_RELASE_FILE}.${_DRIVER_SHARED_EXT}")
IF(EXISTS ${_FILE})
SET(NELDRIVER_${_UPDRIVER}_BINARY_DEBUG ${_FILE})
MESSAGE(STATUS "Found NeL debug shared driver ${_DRIVER}: ${_FILE}")
SET(NEL_STATIC_DRIVERS OFF)
IF(NOT NEL_DRIVER_DIR)
SET(NEL_DRIVER_DIR ${_DIR})
ENDIF()
ENDIF()
SET(_FILE "${_DIR}/${_DRIVER_RELASE_FILE}.${_DRIVER_STATIC_EXT}")
IF(EXISTS ${_FILE})
SET(NELDRIVER_${_UPDRIVER}_LIBRARY_DEBUG ${_FILE})
MESSAGE(STATUS "Found NeL debug static driver ${_DRIVER}: ${_FILE}")
SET(NEL_STATIC_DRIVERS ON)
IF(NOT NEL_DRIVER_DIR)
SET(NEL_DRIVER_DIR ${_DIR})
ENDIF()
ENDIF()
IF(_FOUND)
SET(NELDRIVER_${_UPDRIVER}_FOUND ON)
LIST(APPEND NEL_DRIVERS_FOUND ${_DRIVER})
ENDIF()
ENDIF()
ENDFOREACH()
ENDFOREACH()
MESSAGE(STATUS "Found NeL driver in ${NEL_DRIVER_DIR}")
PARSE_VERSION_OTHER(${NEL_INCLUDE_DIR}/nel/misc/version_nl.h NL_VERSION_MAJOR NL_VERSION_MINOR NL_VERSION_PATCH NL_REVISION)
SET(NEL_VERSION_MAJOR ${NL_VERSION_MAJOR})
SET(NEL_VERSION_MINOR ${NL_VERSION_MINOR})
SET(NEL_VERSION_PATCH ${NL_VERSION_PATCH})
SET(NEL_REVISION ${NL_REVISION})
IF(NOT NEL_VERSION)
IF(NEL_VERSION_MAJOR OR NEL_VERSION_MINOR} OR NEL_VERSION_PATCH)
SET(NEL_VERSION "${NEL_VERSION_MAJOR}.${NEL_VERSION_MINOR}.${NEL_VERSION_PATCH}")
ELSE()
SET(NEL_VERSION "0.5.0")
ENDIF()
IF(NEL_REVISION)
SET(NEL_VERSION "${NEL_VERSION}.${NEL_REVISION}")
ENDIF()
ENDIF()
FIND_PACKAGE(PNG REQUIRED)
IF(PNG_FOUND)
LIST(APPEND NELMISC_LIBRARIES ${PNG_LIBRARIES})
ENDIF()
FIND_PACKAGE(Jpeg REQUIRED)
IF(JPEG_FOUND)
LIST(APPEND NELMISC_LIBRARIES ${JPEG_LIBRARY})
ENDIF()
FIND_PACKAGE(GIF)
IF(GIF_FOUND)
LIST(APPEND NELMISC_LIBRARIES ${GIF_LIBRARY})
ENDIF()
FIND_LIBXML2()
IF(LIBXML2_FOUND)
LIST(APPEND NELMISC_LIBRARIES ${LIBXML2_LIBRARIES})
ENDIF()
LIST(REMOVE_ITEM NeL_FIND_COMPONENTS misc)
LIST(APPEND NEL_MODULES_FOUND misc)
LIST(APPEND NEL_LIBRARIES ${NELMISC_LIBRARIES})
ENDIF()
IF(NOT NeL_FIND_COMPONENTS)
SET(NeL_FIND_COMPONENTS ${NEL_MODULES_AVAILABLE})
# We can skip not installed modules
SET(NeL_FIND_REQUIRED OFF)
ENDIF()
FOREACH(COMPONENT ${NeL_FIND_COMPONENTS})
SET(_NAME NeL${COMPONENT})
STRING(TOUPPER ${_NAME} _UPNAME)
# module is required
SET(${_NAME}_FIND_REQUIRED ${NeL_FIND_REQUIRED})
IF(COMPONENT STREQUAL "3d")
SET(HEADER_FILE shape.h)
# ELSEIF(COMPONENT STREQUAL "cegui")
# SET(HEADER_FILE shape.h)
ELSEIF(COMPONENT STREQUAL "georges")
SET(HEADER_FILE form.h)
ELSEIF(COMPONENT STREQUAL "gui")
SET(HEADER_FILE reflect.h)
ELSEIF(COMPONENT STREQUAL "ligo")
SET(HEADER_FILE primitive.h)
ELSEIF(COMPONENT STREQUAL "logic")
SET(HEADER_FILE logic_state.h)
ELSEIF(COMPONENT STREQUAL "net")
SET(HEADER_FILE sock.h)
ELSEIF(COMPONENT STREQUAL "pacs")
SET(HEADER_FILE primitive_block.h)
# ELSEIF(COMPONENT STREQUAL "pipeline")
# SET(HEADER_FILE shape.h)
ELSEIF(COMPONENT STREQUAL "sound")
SET(HEADER_FILE shape.h)
ELSE()
SET(HEADER_FILE)
ENDIF()
# display if a component has a wrong name
IF(NOT HEADER_FILE)
MESSAGE(STATUS "NeL module ${COMPONENT} not supported, ignoring it...")
CONTINUE()
ENDIF()
FIND_PACKAGE_HELPER(${_NAME} nel/${COMPONENT}/${HEADER_FILE}
RELEASE nel${COMPONENT}_r nel${COMPONENT}
DEBUG nel${COMPONENT}_d
QUIET)
IF(${_UPNAME}_FOUND)
LIST(APPEND NEL_MODULES_FOUND ${COMPONENT})
IF(COMPONENT STREQUAL "3d")
IF(NEL_STATIC)
# 3rd party dependencies
FIND_PACKAGE(Freetype REQUIRED)
IF(FREETYPE_FOUND)
LIST(APPEND ${_UPNAME}_LIBRARIES ${FREETYPE_LIBRARIES})
ENDIF()
# Append static 3D drivers
IF(NEL_STATIC_DRIVERS)
# Direct3D driver (only under Windows)
IF(WIN32)
IF(NELDRIVER_DIRECT3D_LIBRARY_DEBUG)
LIST(APPEND ${_UPNAME}_LIBRARIES debug ${NELDRIVER_DIRECT3D_LIBRARY_DEBUG})
ENDIF()
IF(NELDRIVER_DIRECT3D_LIBRARY_RELEASE)
LIST(APPEND ${_UPNAME}_LIBRARIES optimized ${NELDRIVER_DIRECT3D_LIBRARY_RELEASE})
ENDIF()
ENDIF()
# OpenGL driver
IF(NELDRIVER_OPENGL_LIBRARY_DEBUG)
LIST(APPEND ${_UPNAME}_LIBRARIES debug ${NELDRIVER_OPENGL_LIBRARY_DEBUG})
ENDIF()
IF(NELDRIVER_OPENGL_LIBRARY_RELEASE)
LIST(APPEND ${_UPNAME}_LIBRARIES optimized ${NELDRIVER_OPENGL_LIBRARY_RELEASE})
ENDIF()
ENDIF()
ENDIF()
ELSEIF(COMPONENT STREQUAL "gui")
FIND_PACKAGE(Luabind REQUIRED)
LIST(APPEND ${_UPNAME}_LIBRARIES ${LUABIND_LIBRARIES})
FIND_LIBCURL()
IF(CURL_FOUND)
LIST(APPEND ${_UPNAME}_LIBRARIES ${CURL_LIBRARIES})
LIST(APPEND ${_UPNAME}_DEFINITIONS ${CURL_DEFINITIONS})
ENDIF()
# TODO: remove complately OpenSSL requirement on Windows
# Only used by libcurl under Linux
FIND_PACKAGE(OpenSSL REQUIRED)
IF(WIN32)
LIST(APPEND OPENSSL_LIBRARIES Crypt32.lib)
ENDIF()
# Only Linux version of libcurl depends on OpenSSL
LIST(APPEND CURL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
LIST(APPEND CURL_LIBRARIES ${OPENSSL_LIBRARIES})
LIST(APPEND ${_UPNAME}_LIBRARIES ${LUABIND_LIBRARIES} ${CURL_LIBRARIES})
LIST(APPEND NEL_DEFINITIONS ${${_UPNAME}_DEFINITIONS})
ELSEIF(COMPONENT STREQUAL "sound")
FIND_PACKAGE(Ogg REQUIRED)
IF(OGG_FOUND)
LIST(APPEND ${_UPNAME}_LIBRARIES ${OGG_LIBRARY})
ENDIF()
FIND_PACKAGE(Vorbis REQUIRED)
IF(VORBIS_FOUND)
LIST(APPEND ${_UPNAME}_LIBRARIES ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY})
ENDIF()
IF(NEL_STATIC)
# Link to snd_lowlevel
FIND_LIBRARY_HELPER(nelsnd_lowlevel RELEASE nelsnd_lowlevel_r DEBUG nelsnd_lowlevel_d DIR ${NEL_DIR} REQUIRED)
IF(NELSND_LOWLEVEL_LIBRARIES)
MESSAGE(STATUS "Found NeL sound lowlevel ${NELSND_LOWLEVEL_LIBRARIES}")
LIST(APPEND NELSOUND_LIBRARIES ${NELSND_LOWLEVEL_LIBRARIES})
IF(NEL_STATIC_DRIVERS)
# DirectSound, XAudio2 and FMod drivers (only under Windows)
IF(WIN32)
# DirectSound
IF(NELDRIVER_DIRECTSOUND_LIBRARY_DEBUG)
LIST(APPEND NELSOUND_LIBRARIES debug ${NELDRIVER_DIRECTSOUND_LIBRARY_DEBUG})
ENDIF()
IF(NELDRIVER_DIRECTSOUND_LIBRARY_RELEASE)
LIST(APPEND NELSOUND_LIBRARIES optimized ${NELDRIVER_DIRECTSOUND_LIBRARY_RELEASE})
ENDIF()
# FMod
IF(NELDRIVER_FMOD_LIBRARY_DEBUG)
LIST(APPEND NELSOUND_LIBRARIES debug ${NELDRIVER_FMOD_LIBRARY_DEBUG})
ENDIF()
IF(NELDRIVER_FMOD_LIBRARY_RELEASE)
LIST(APPEND NELSOUND_LIBRARIES optimized ${NELDRIVER_FMOD_LIBRARY_RELEASE})
ENDIF()
# XAudio2
IF(NELDRIVER_XAUDIO2_LIBRARY_DEBUG)
LIST(APPEND NELSOUND_LIBRARIES debug ${NELDRIVER_XAUDIO2_LIBRARY_DEBUG})
ENDIF()
IF(NELDRIVER_XAUDIO2_LIBRARY_RELEASE)
LIST(APPEND NELSOUND_LIBRARIES optimized ${NELDRIVER_XAUDIO2_LIBRARY_RELEASE})
ENDIF()
ENDIF()
# OpenAL driver
IF(NELDRIVER_OPENAL_LIBRARY_DEBUG)
LIST(APPEND NELSOUND_LIBRARIES debug ${NELDRIVER_OPENAL_LIBRARY_DEBUG})
ENDIF()
IF(NELDRIVER_OPENAL_LIBRARY_RELEASE)
LIST(APPEND NELSOUND_LIBRARIES optimized ${NELDRIVER_OPENAL_LIBRARY_RELEASE})
ENDIF()
ENDIF()
ENDIF()
ENDIF()
ENDIF()
LIST(APPEND NEL_LIBRARIES ${${_UPNAME}_LIBRARIES})
ENDIF()
ENDFOREACH()
MESSAGE_VERSION_PACKAGE_HELPER(NeL ${NEL_VERSION} ${NEL_MODULES_FOUND})

View file

@ -0,0 +1,14 @@
INCLUDE(FindHelpers)
FIND_PACKAGE_HELPER(RyzomGameShare game_share/continent.h RELEASE ryzom_gameshare_r ryzom_gameshare DEBUG ryzom_gameshare_d DIR ${NEL_DIR} ${RYZOM_DIR} SUFFIXES ryzom)
IF(RYZOMGAMESHARE_FOUND)
FIND_PACKAGE(NeL REQUIRED)
LIST(APPEND RYZOMGAMESHARE_INCLUDE_DIRS ${NEL_INCLUDE_DIRS})
LIST(APPEND RYZOMGAMESHARE_LIBRARIES ${NELMISC_LIBRARIES} ${NELLIGO_LIBRARIES} ${NELNET_LIBRARIES} ${NELGEORGES_LIBRARIES})
SET(RYZOM_GAMESHARE_LIBRARIES ${RYZOMGAMESHARE_LIBRARIES})
SET(RYZOM_GAMESHARE_FOUND ${RYZOMGAMESHARE_FOUND})
SET(RYZOM_GAMESHARE_INCLUDE_DIR ${RYZOMGAMESHARE_INCLUDE_DIR})
SET(RYZOM_GAMESHARE_INCLUDE_DIRS ${RYZOMGAMESHARE_INCLUDE_DIRS})
ENDIF()

View file

@ -1,8 +1,8 @@
# - Locate Steam API
# This module defines
# STEAM_LIBRARY, the library to link against
# VORBIS_FOUND, if false, do not try to link to VORBIS
# VORBIS_INCLUDE_DIR, where to find headers.
# STEAM_FOUND, if false, do not try to link to STEAM
# STEAM_INCLUDE_DIR, where to find headers.
IF(STEAM_LIBRARY AND STEAM_INCLUDE_DIR)
# in cache already

View file

@ -98,4 +98,6 @@ ENDIF()
IF(DEFINED REVISION)
MESSAGE(STATUS "Found revision ${REVISION}")
ELSE()
SET(REVISION 0)
ENDIF()

View file

@ -209,8 +209,8 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
ENDIF()
ENDIF()
IF(USE_CPP0X AND gcc_compiler_version GREATER "6.2.0")
LIST(APPEND _FLAGS "-std=gnu++11")
IF(CMAKE_CXX11_EXTENSION_COMPILE_OPTION)
LIST(APPEND _FLAGS ${CMAKE_CXX11_EXTENSION_COMPILE_OPTION})
ENDIF()
# Format definitions

View file

@ -238,6 +238,7 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS)
OPTION(WITH_EXTERNAL "With provided external." OFF)
ENDIF()
OPTION(WITH_STATIC_EXTERNAL "With static external libraries" OFF)
OPTION(WITH_STATIC_RUNTIMES "Use only static C++ runtimes" OFF)
IF(UNIX AND NOT APPLE)
OPTION(WITH_UNIX_STRUCTURE "Use UNIX structure (bin, include, lib)" ON )
ELSE()
@ -373,8 +374,14 @@ MACRO(ADD_PLATFORM_LINKFLAGS _FLAGS)
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${_FLAGS}")
ENDMACRO()
MACRO(NL_SETUP_BUILD)
MACRO(CONVERT_VERSION_NUMBER _VERSION_NUMBER _BASE)
SET(${_VERSION_NUMBER} 0)
FOREACH(_ARG ${ARGN})
MATH(EXPR ${_VERSION_NUMBER} "${${_VERSION_NUMBER}} * ${_BASE} + ${_ARG}")
ENDFOREACH()
ENDMACRO()
MACRO(NL_SETUP_BUILD)
#-----------------------------------------------------------------------------
# Setup the buildmode variables.
#
@ -636,8 +643,14 @@ MACRO(NL_SETUP_BUILD)
SET(NL_RELEASE_LINKFLAGS "/RELEASE ${NL_RELEASE_LINKFLAGS}")
ENDIF()
SET(NL_DEBUG_CFLAGS "/Zi /MDd /RTC1 /D_DEBUG ${DEBUG_CFLAGS} ${NL_DEBUG_CFLAGS}")
SET(NL_RELEASE_CFLAGS "/MD /DNDEBUG ${RELEASE_CFLAGS} ${NL_RELEASE_CFLAGS}")
IF(WITH_STATIC_RUNTIMES)
SET(RUNTIME_FLAG "/MT")
ELSE()
SET(RUNTIME_FLAG "/MD")
ENDIF()
SET(NL_DEBUG_CFLAGS "/Zi ${RUNTIME_FLAG}d /RTC1 /D_DEBUG ${DEBUG_CFLAGS} ${NL_DEBUG_CFLAGS}")
SET(NL_RELEASE_CFLAGS "${RUNTIME_FLAG} /DNDEBUG ${RELEASE_CFLAGS} ${NL_RELEASE_CFLAGS}")
SET(NL_DEBUG_LINKFLAGS "/DEBUG /OPT:NOREF /OPT:NOICF /NODEFAULTLIB:msvcrt ${MSVC_INCREMENTAL_YES_FLAG} ${NL_DEBUG_LINKFLAGS}")
SET(NL_RELEASE_LINKFLAGS "/OPT:REF /OPT:ICF /INCREMENTAL:NO ${NL_RELEASE_LINKFLAGS}")
@ -874,7 +887,9 @@ MACRO(NL_SETUP_BUILD)
ENDIF()
# use c++0x standard to use std::unique_ptr and std::shared_ptr
SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} -std=c++0x")
IF(CMAKE_CXX11_EXTENSION_COMPILE_OPTION)
SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} ${CMAKE_CXX11_EXTENSION_COMPILE_OPTION}")
ENDIF()
ADD_PLATFORM_FLAGS("-D_REENTRANT")
@ -950,8 +965,6 @@ MACRO(NL_SETUP_BUILD)
ADD_PLATFORM_FLAGS("-fPIC")
ENDIF()
SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} -ftemplate-depth-48")
# hardening
ADD_PLATFORM_FLAGS("-fstack-protector --param=ssp-buffer-size=4")
@ -965,6 +978,10 @@ MACRO(NL_SETUP_BUILD)
IF(NOT APPLE)
ADD_PLATFORM_LINKFLAGS("-Wl,--no-undefined -Wl,--as-needed")
IF(WITH_STATIC_RUNTIMES)
ADD_PLATFORM_LINKFLAGS("-static-libstdc++")
ENDIF()
ENDIF()
IF(NOT APPLE)
@ -1023,6 +1040,12 @@ MACRO(NL_MAKE_ABSOLUTE_PREFIX NAME_RELATIVE NAME_ABSOLUTE)
ENDMACRO(NL_MAKE_ABSOLUTE_PREFIX)
MACRO(NL_SETUP_PREFIX_PATHS)
IF(TARGET_X64 AND WIN32)
SET(LIB_SUFFIX "64")
ELSE()
SET(LIB_SUFFIX "")
ENDIF()
## Allow override of install_prefix/etc path.
IF(NOT NL_ETC_PREFIX)
IF(WITH_UNIX_STRUCTURE)
@ -1046,7 +1069,7 @@ MACRO(NL_SETUP_PREFIX_PATHS)
## Allow override of install_prefix/sbin path.
IF(NOT NL_SBIN_PREFIX)
IF(WITH_UNIX_STRUCTURE)
SET(NL_SBIN_PREFIX "sbin" CACHE PATH "Installation path for admin tools and services.")
SET(NL_SBIN_PREFIX "sbin${LIB_SUFFIX}" CACHE PATH "Installation path for admin tools and services.")
ELSE()
SET(NL_SBIN_PREFIX "." CACHE PATH "Installation path for admin tools and services.")
ENDIF()
@ -1056,7 +1079,7 @@ MACRO(NL_SETUP_PREFIX_PATHS)
## Allow override of install_prefix/bin path.
IF(NOT NL_BIN_PREFIX)
IF(WITH_UNIX_STRUCTURE)
SET(NL_BIN_PREFIX "bin" CACHE PATH "Installation path for tools and applications.")
SET(NL_BIN_PREFIX "bin${LIB_SUFFIX}" CACHE PATH "Installation path for tools and applications.")
ELSE()
SET(NL_BIN_PREFIX "." CACHE PATH "Installation path for tools and applications.")
ENDIF()
@ -1068,7 +1091,7 @@ MACRO(NL_SETUP_PREFIX_PATHS)
IF(LIBRARY_ARCHITECTURE)
SET(NL_LIB_PREFIX "lib/${LIBRARY_ARCHITECTURE}" CACHE PATH "Installation path for libraries.")
ELSE()
SET(NL_LIB_PREFIX "lib" CACHE PATH "Installation path for libraries.")
SET(NL_LIB_PREFIX "lib${LIB_SUFFIX}" CACHE PATH "Installation path for libraries.")
ENDIF()
ENDIF()
NL_MAKE_ABSOLUTE_PREFIX(NL_LIB_PREFIX NL_LIB_ABSOLUTE_PREFIX)
@ -1079,7 +1102,11 @@ MACRO(NL_SETUP_PREFIX_PATHS)
IF(LIBRARY_ARCHITECTURE)
SET(NL_DRIVER_PREFIX "lib/${LIBRARY_ARCHITECTURE}/nel" CACHE PATH "Installation path for drivers.")
ELSE()
SET(NL_DRIVER_PREFIX "lib/nel" CACHE PATH "Installation path for drivers.")
IF(WIN32)
SET(NL_DRIVER_PREFIX "bin${LIB_SUFFIX}" CACHE PATH "Installation path for drivers.")
ELSE()
SET(NL_DRIVER_PREFIX "lib${LIB_SUFFIX}/nel" CACHE PATH "Installation path for drivers.")
ENDIF()
ENDIF()
ELSE()
SET(NL_DRIVER_PREFIX "." CACHE PATH "Installation path for drivers.")
@ -1112,7 +1139,7 @@ MACRO(RYZOM_SETUP_PREFIX_PATHS)
## Allow override of install_prefix/sbin path.
IF(NOT RYZOM_SBIN_PREFIX)
IF(WITH_UNIX_STRUCTURE)
SET(RYZOM_SBIN_PREFIX "sbin" CACHE PATH "Installation path for admin tools and services.")
SET(RYZOM_SBIN_PREFIX "sbin${LIB_SUFFIX}" CACHE PATH "Installation path for admin tools and services.")
ELSE()
SET(RYZOM_SBIN_PREFIX "." CACHE PATH "Installation path for admin tools and services.")
ENDIF()
@ -1122,7 +1149,7 @@ MACRO(RYZOM_SETUP_PREFIX_PATHS)
## Allow override of install_prefix/bin path.
IF(NOT RYZOM_BIN_PREFIX)
IF(WITH_UNIX_STRUCTURE)
SET(RYZOM_BIN_PREFIX "bin" CACHE PATH "Installation path for tools.")
SET(RYZOM_BIN_PREFIX "bin${LIB_SUFFIX}" CACHE PATH "Installation path for tools.")
ELSE()
SET(RYZOM_BIN_PREFIX "." CACHE PATH "Installation path for tools and applications.")
ENDIF()
@ -1134,7 +1161,7 @@ MACRO(RYZOM_SETUP_PREFIX_PATHS)
IF(LIBRARY_ARCHITECTURE)
SET(RYZOM_LIB_PREFIX "lib/${LIBRARY_ARCHITECTURE}" CACHE PATH "Installation path for libraries.")
ELSE()
SET(RYZOM_LIB_PREFIX "lib" CACHE PATH "Installation path for libraries.")
SET(RYZOM_LIB_PREFIX "lib${LIB_SUFFIX}" CACHE PATH "Installation path for libraries.")
ENDIF()
ENDIF()
NL_MAKE_ABSOLUTE_PREFIX(RYZOM_LIB_PREFIX RYZOM_LIB_ABSOLUTE_PREFIX)
@ -1210,4 +1237,4 @@ MACRO(SETUP_EXTERNAL)
FIND_PACKAGE(MSVC REQUIRED)
FIND_PACKAGE(WindowsSDK REQUIRED)
ENDIF()
ENDMACRO(SETUP_EXTERNAL)
ENDMACRO()

View file

@ -224,7 +224,7 @@ public:
// @{
// first param is the associated window.
// Must be a HWND for Windows (WIN32).
virtual bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show = true, bool resizeable = true) throw(EBadDisplay) = 0;
virtual bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show = true, bool resizeable = true) = 0;
// Must be called after a setDisplay that initialize the mode
virtual bool setMode(const GfxMode &mode) = 0;
virtual bool getModes(std::vector<GfxMode> &modes) = 0;

View file

@ -134,14 +134,14 @@ class CDRU
public:
/// Portable Function which create a GL Driver (using gl dll...).
static IDriver *createGlDriver() throw(EDru);
static IDriver *createGlDriver();
/// Portable Function which create a GL ES Driver (using gl dll...).
static IDriver *createGlEsDriver() throw(EDru);
static IDriver *createGlEsDriver();
#ifdef NL_OS_WINDOWS
/// Windows Function which create a Direct3d Driver.
static IDriver *createD3DDriver() throw(EDru);
static IDriver *createD3DDriver();
#endif // NL_OS_WINDOWS
/// \name 2D render.

View file

@ -168,9 +168,9 @@ public:
void clear();
/// Verify the binding of patchs of all zones. throw EBadBind if error.
void checkBinds() throw(EBadBind);
void checkBinds();
/// Verify the binding of patchs of one zone. throw EBadBind if error. nop if zone not loaded.
void checkBinds(uint16 zoneId) throw(EBadBind);
void checkBinds(uint16 zoneId);
/**
* Build tileBank. Call this after loading the near and far tile banks.

View file

@ -64,7 +64,7 @@ public:
*
* You can access the driver with CNELU::Driver.
*/
static bool initDriver(uint w, uint h, uint bpp=32, bool windowed=true, nlWindow systemWindow=EmptyWindow, bool offscreen=false, bool direct3d=false) throw(EDru);
static bool initDriver(uint w, uint h, uint bpp=32, bool windowed=true, nlWindow systemWindow=EmptyWindow, bool offscreen=false, bool direct3d=false);
/** Init all that we need for a Scene.
* - register scene basics models,
@ -108,7 +108,7 @@ public:
* - initScene();
* - initEventServer();
*/
static bool init(uint w, uint h, CViewport viewport=CViewport(), uint bpp=32, bool windowed=true, nlWindow systemWindow=EmptyWindow, bool offscreen = false, bool direct3d = false) throw(EDru);
static bool init(uint w, uint h, CViewport viewport=CViewport(), uint bpp=32, bool windowed=true, nlWindow systemWindow=EmptyWindow, bool offscreen = false, bool direct3d = false);
/** Delete all:
* - releaseEventServer();

View file

@ -88,7 +88,7 @@ public:
void setShadeOutline (bool b) { _ShadeOutline = b; }
void setShadeExtent (float shext) { _ShadeExtent = shext; }
void setShadeExtent (float x, float y) { _ShadeExtentX = x; _ShadeExtentY = y; }
/// The alpha of the shade is multiplied at each draw with the alpha of the color. Default: (0,0,0,255)
void setShadeColor (NLMISC::CRGBA color) { _ShadeColor = color; }
@ -157,19 +157,20 @@ public:
rCS.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8);
if (_ShadeOutline)
{
float rext = _ShadeExtent * 0.7071f;
rCS.render2D(*_Driver, x+rext, z-rext, _HotSpot, _ScaleX, _ScaleZ);
rCS.render2D(*_Driver, x-rext, z-rext, _HotSpot, _ScaleX, _ScaleZ);
rCS.render2D(*_Driver, x-rext, z+rext, _HotSpot, _ScaleX, _ScaleZ);
rCS.render2D(*_Driver, x+rext, z+rext, _HotSpot, _ScaleX, _ScaleZ);
rCS.render2D(*_Driver, x+_ShadeExtent, z, _HotSpot, _ScaleX, _ScaleZ);
rCS.render2D(*_Driver, x-_ShadeExtent, z, _HotSpot, _ScaleX, _ScaleZ);
rCS.render2D(*_Driver, x, z-_ShadeExtent, _HotSpot, _ScaleX, _ScaleZ);
rCS.render2D(*_Driver, x, z-_ShadeExtent, _HotSpot, _ScaleX, _ScaleZ);
float rextX = _ShadeExtentX * 0.7071f;
float rextY = _ShadeExtentY * 0.7071f;
rCS.render2D(*_Driver, x+rextX, z-rextY, _HotSpot, _ScaleX, _ScaleZ);
rCS.render2D(*_Driver, x-rextX, z-rextY, _HotSpot, _ScaleX, _ScaleZ);
rCS.render2D(*_Driver, x-rextX, z+rextY, _HotSpot, _ScaleX, _ScaleZ);
rCS.render2D(*_Driver, x+rextX, z+rextY, _HotSpot, _ScaleX, _ScaleZ);
rCS.render2D(*_Driver, x+_ShadeExtentX, z, _HotSpot, _ScaleX, _ScaleZ);
rCS.render2D(*_Driver, x-_ShadeExtentX, z, _HotSpot, _ScaleX, _ScaleZ);
rCS.render2D(*_Driver, x, z-_ShadeExtentY, _HotSpot, _ScaleX, _ScaleZ);
rCS.render2D(*_Driver, x, z-_ShadeExtentY, _HotSpot, _ScaleX, _ScaleZ);
}
else
{
rCS.render2D(*_Driver, x+_ShadeExtent, z-_ShadeExtent, _HotSpot, _ScaleX, _ScaleZ);
rCS.render2D(*_Driver, x+_ShadeExtentX, z-_ShadeExtentY, _HotSpot, _ScaleX, _ScaleZ);
}
rCS.Color= bkup;
}
@ -190,19 +191,20 @@ public:
rCS.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8);
if (_ShadeOutline)
{
float rext = _ShadeExtent * 0.7071f;
rCS.render2DClip(*_Driver, rdrBuffer, x+rext, z-rext, xmin, ymin, xmax, ymax);
rCS.render2DClip(*_Driver, rdrBuffer, x-rext, z-rext, xmin, ymin, xmax, ymax);
rCS.render2DClip(*_Driver, rdrBuffer, x-rext, z+rext, xmin, ymin, xmax, ymax);
rCS.render2DClip(*_Driver, rdrBuffer, x+rext, z+rext, xmin, ymin, xmax, ymax);
rCS.render2DClip(*_Driver, rdrBuffer, x+_ShadeExtent, z, xmin, ymin, xmax, ymax);
rCS.render2DClip(*_Driver, rdrBuffer, x-_ShadeExtent, z, xmin, ymin, xmax, ymax);
rCS.render2DClip(*_Driver, rdrBuffer, x, z+_ShadeExtent, xmin, ymin, xmax, ymax);
rCS.render2DClip(*_Driver, rdrBuffer, x, z-_ShadeExtent, xmin, ymin, xmax, ymax);
float rextX = _ShadeExtentX * 0.7071f;
float rextY = _ShadeExtentY * 0.7071f;
rCS.render2DClip(*_Driver, rdrBuffer, x+rextX, z-rextY, xmin, ymin, xmax, ymax);
rCS.render2DClip(*_Driver, rdrBuffer, x-rextX, z-rextY, xmin, ymin, xmax, ymax);
rCS.render2DClip(*_Driver, rdrBuffer, x-rextX, z+rextY, xmin, ymin, xmax, ymax);
rCS.render2DClip(*_Driver, rdrBuffer, x+rextX, z+rextY, xmin, ymin, xmax, ymax);
rCS.render2DClip(*_Driver, rdrBuffer, x+_ShadeExtentX, z, xmin, ymin, xmax, ymax);
rCS.render2DClip(*_Driver, rdrBuffer, x-_ShadeExtentX, z, xmin, ymin, xmax, ymax);
rCS.render2DClip(*_Driver, rdrBuffer, x, z+_ShadeExtentY, xmin, ymin, xmax, ymax);
rCS.render2DClip(*_Driver, rdrBuffer, x, z-_ShadeExtentY, xmin, ymin, xmax, ymax);
}
else
{
rCS.render2DClip(*_Driver, rdrBuffer, x+_ShadeExtent, z-_ShadeExtent, xmin, ymin, xmax, ymax);
rCS.render2DClip(*_Driver, rdrBuffer, x+_ShadeExtentX, z-_ShadeExtentY, xmin, ymin, xmax, ymax);
}
rCS.Color= bkup;
}
@ -223,19 +225,20 @@ public:
rCS.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8);
if (_ShadeOutline)
{
float rext = _ShadeExtent * 0.7071f;
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+rext, y-rext, depth, xmin, ymin, xmax, ymax);
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x-rext, y-rext, depth, xmin, ymin, xmax, ymax);
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x-rext, y+rext, depth, xmin, ymin, xmax, ymax);
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+rext, y+rext, depth, xmin, ymin, xmax, ymax);
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+_ShadeExtent, y, depth, xmin, ymin, xmax, ymax);
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x-_ShadeExtent, y, depth, xmin, ymin, xmax, ymax);
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x, y+_ShadeExtent, depth, xmin, ymin, xmax, ymax);
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x, y-_ShadeExtent, depth, xmin, ymin, xmax, ymax);
float rextX = _ShadeExtentX * 0.7071f;
float rextY = _ShadeExtentY * 0.7071f;
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+rextX, y-rextY, depth, xmin, ymin, xmax, ymax);
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x-rextX, y-rextY, depth, xmin, ymin, xmax, ymax);
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x-rextX, y+rextY, depth, xmin, ymin, xmax, ymax);
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+rextX, y+rextY, depth, xmin, ymin, xmax, ymax);
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+_ShadeExtentX, y, depth, xmin, ymin, xmax, ymax);
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x-_ShadeExtentX, y, depth, xmin, ymin, xmax, ymax);
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x, y+_ShadeExtentY, depth, xmin, ymin, xmax, ymax);
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x, y-_ShadeExtentY, depth, xmin, ymin, xmax, ymax);
}
else
{
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+_ShadeExtent, y-_ShadeExtent, depth, xmin, ymin, xmax, ymax);
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+_ShadeExtentX, y-_ShadeExtentY, depth, xmin, ymin, xmax, ymax);
}
rCS.Color= bkup;
}
@ -258,19 +261,20 @@ public:
_TempString.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8);
if (_ShadeOutline)
{
float rext = _ShadeExtent * 0.7071f;
_TempString.render2D(*_Driver,x+rext,z-rext,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x-rext,z-rext,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x-rext,z+rext,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x+rext,z+rext,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x+_ShadeExtent,z,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x-_ShadeExtent,z,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x,z+_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x,z-_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ);
float rextX = _ShadeExtentX * 0.7071f;
float rextY = _ShadeExtentY * 0.7071f;
_TempString.render2D(*_Driver,x+rextX,z-rextY,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x-rextX,z-rextY,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x-rextX,z+rextY,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x+rextX,z+rextY,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x+_ShadeExtentX,z,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x-_ShadeExtentX,z,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x,z+_ShadeExtentY,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x,z-_ShadeExtentY,_HotSpot,_ScaleX,_ScaleZ);
}
else
{
_TempString.render2D(*_Driver,x+_ShadeExtent,z-_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver, x+_ShadeExtentX, z-_ShadeExtentY, _HotSpot, _ScaleX, _ScaleZ);
}
_TempString.Color = bkup;
}
@ -297,19 +301,20 @@ public:
_TempString.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8);
if (_ShadeOutline)
{
float rext = _ShadeExtent * 0.7071f;
_TempString.render2D(*_Driver,x+rext,z-rext,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x-rext,z-rext,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x-rext,z+rext,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x+rext,z+rext,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x+_ShadeExtent,z,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x-_ShadeExtent,z,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x,z+_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x,z-_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ);
float rextX = _ShadeExtentX * 0.7071f;
float rextY = _ShadeExtentY * 0.7071f;
_TempString.render2D(*_Driver,x+rextX,z-rextY,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x-rextX,z-rextY,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x-rextX,z+rextY,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x+rextX,z+rextY,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x+_ShadeExtentX,z,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x-_ShadeExtentX,z,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x,z+_ShadeExtentY,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x,z-_ShadeExtentY,_HotSpot,_ScaleX,_ScaleZ);
}
else
{
_TempString.render2D(*_Driver,x+_ShadeExtent,z-_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver, x+_ShadeExtentX, z-_ShadeExtentY, _HotSpot, _ScaleX, _ScaleZ);
}
_TempString.Color = bkup;
}
@ -412,7 +417,8 @@ private:
bool _ShadeOutline;
/// shade's extent (shadow size)
float _ShadeExtent;
float _ShadeExtentX;
float _ShadeExtentY;
/// Shade color (default is black)
NLMISC::CRGBA _ShadeColor;

View file

@ -80,7 +80,7 @@ public:
bool getShaded() const;
void setShadeOutline(bool b);
bool getShadeOutline() const;
void setShadeExtent(float shext) ;
void setShadeExtent(float x, float y);
void setShadeColor (NLMISC::CRGBA sc);
NLMISC::CRGBA getShadeColor () const;
void setKeep800x600Ratio(bool keep);

View file

@ -205,7 +205,7 @@ public:
* set the shadow's size
* \param the shade extent
*/
virtual void setShadeExtent (float shext) = 0;
virtual void setShadeExtent (float x, float y) = 0;
/**
* set the shadow's color
* The alpha of the shade is multiplied at each draw with the alpha of the color. Default: (0,0,0,255)

View file

@ -17,19 +17,22 @@
#ifndef CL_CURL_CERTIFICATES_HTML_H
#define CL_CURL_CERTIFICATES_HTML_H
#include <curl/curl.h>
#include "nel/misc/types_nl.h"
// forward declaration to avoid curl.h inclusion everywhere
typedef void CURL;
namespace NLGUI
{
#if defined(NL_OS_WINDOWS)
class CCurlCertificates {
class CCurlCertificates
{
public:
// cURL SSL certificate loading
static CURLcode sslCtxFunction(CURL *curl, void *sslctx, void *parm);
// allow to use custom PEM certificates
static void addCertificateFile(const std::string &cert);
// set all CURL options to use custom SSL context function
static void useCertificates(CURL *curl);
};
#endif // NL_OS_WINDOWS
} // namespace
#endif

View file

@ -17,8 +17,6 @@
#ifndef CL_GROUP_HTML_H
#define CL_GROUP_HTML_H
#include <curl/curl.h>
#include "nel/misc/types_nl.h"
#include "nel/gui/interface_group.h"
#include "nel/gui/group_scrolltext.h"
@ -27,6 +25,9 @@
#include "nel/gui/group_table.h"
#include "nel/gui/libwww_types.h"
// forward declaration
typedef void CURLM;
typedef std::map<std::string, std::string> TStyle;
namespace NLGUI
@ -74,10 +75,25 @@ namespace NLGUI
static SWebOptions options;
// text-shadow
struct STextShadow
{
public:
STextShadow(bool enabled = false, bool outline = false, sint32 x=1, sint32 y=1, NLMISC::CRGBA color=NLMISC::CRGBA::Black)
: Enabled(enabled), Outline(outline), X(x), Y(y), Color(color)
{ }
bool Enabled;
bool Outline;
sint32 X;
sint32 Y;
NLMISC::CRGBA Color;
};
class CStyleParams
{
public:
CStyleParams () : FontFamily(""), TextColor(255,255,255,255)
CStyleParams () : FontFamily(""), TextColor(255,255,255,255), TextShadow()
{
FontSize=10;
FontWeight=400;
@ -95,6 +111,7 @@ namespace NLGUI
bool FontOblique;
std::string FontFamily;
NLMISC::CRGBA TextColor;
STextShadow TextShadow;
bool GlobalColor;
bool Underlined;
bool StrikeThrough;
@ -104,6 +121,10 @@ namespace NLGUI
sint32 MaxHeight;
};
// ImageDownload system
enum TDataType {ImgType= 0, BnpType};
enum TImageType {NormalImage=0, OverImage};
// Constructor
CGroupHTML(const TCtorParam &param);
~CGroupHTML();
@ -150,6 +171,10 @@ namespace NLGUI
// End of the paragraph
void endParagraph();
// add image download (used by view_bitmap.cpp to load web images)
void addImageDownload(const std::string &url, CViewBase *img, const CStyleParams &style = CStyleParams(), const TImageType type = NormalImage);
std::string localImageName(const std::string &url);
// Timeout
void setTimeout(float tm) {_TimeoutValue= std::max(0.f, tm);}
float getTimeout() const {return (float)_TimeoutValue;}
@ -495,78 +520,32 @@ namespace NLGUI
// IL mode
bool _LI;
// Current text color
std::vector<NLMISC::CRGBA> _TextColor;
inline const NLMISC::CRGBA &getTextColor() const
// Current active style
CStyleParams _Style;
// Default style
CStyleParams _StyleDefault;
// Nested style stack
std::vector<CStyleParams> _StyleParams;
inline void pushStyle()
{
if (_TextColor.empty())
return TextColor;
return _TextColor.back();
_StyleParams.push_back(_Style);
}
inline void popStyle()
{
if (_StyleParams.empty())
_Style = _StyleDefault;
else
{
_Style = _StyleParams.back();
_StyleParams.pop_back();
}
}
// Current global color flag
std::vector<bool> _GlobalColor;
inline bool getGlobalColor() const
{
if (_GlobalColor.empty())
return false;
return _GlobalColor.back();
}
// Current font name
std::vector<std::string> _FontFamily;
inline const char* getFontFamily() const
{
if (_FontFamily.empty())
return "";
return _FontFamily.back().c_str();
}
// Current font size
std::vector<uint> _FontSize;
inline uint getFontSize() const
{
if (_FontSize.empty())
return TextFontSize;
return _FontSize.back();
}
inline uint getFontSizeSmaller() const
{
if (getFontSize() < 5)
if (_Style.FontSize < 5)
return 3;
return getFontSize()-2;
}
std::vector<uint> _FontWeight;
inline uint getFontWeight() const
{
if (_FontWeight.empty())
return 400;
return _FontWeight.back();
}
std::vector<bool> _FontOblique;
inline bool getFontOblique() const
{
if (_FontOblique.empty())
return false;
return _FontOblique.back();
}
std::vector<bool> _FontUnderlined;
inline bool getFontUnderlined() const
{
if (_FontUnderlined.empty())
return false;
return _FontUnderlined.back();
}
std::vector<bool> _FontStrikeThrough;
inline bool getFontStrikeThrough() const
{
if (_FontStrikeThrough.empty())
return false;
return _FontStrikeThrough.back();
return _Style.FontSize-2;
}
// Current link
@ -631,6 +610,14 @@ namespace NLGUI
return _TR.back();
}
std::vector<STextShadow> _TextShadow;
inline STextShadow getTextShadow() const
{
if (_TextShadow.empty())
return STextShadow();
return _TextShadow.back();
}
// Forms
class CForm
{
@ -721,6 +708,8 @@ namespace NLGUI
return _Indent.back();
}
// Current node is a title
bool _Title;
@ -810,10 +799,6 @@ namespace NLGUI
// decode all HTML entities
static ucstring decodeHTMLEntities(const ucstring &str);
// ImageDownload system
enum TDataType {ImgType= 0, BnpType};
enum TImageType {NormalImage=0, OverImage};
struct CDataImageDownload
{
public:
@ -855,8 +840,6 @@ namespace NLGUI
void initImageDownload();
void checkImageDownload();
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 getAbsoluteUrl(const std::string &url);
bool isTrustedDomain(const std::string &domain);
@ -874,11 +857,6 @@ namespace NLGUI
// HtmlType download finished
void htmlDownloadFinished(const std::string &content, const std::string &type, long code);
// cURL transfer callbacks
static size_t curlHeaderCallback(char *buffer, size_t size, size_t nmemb, void *pCCurlWWWData);
static size_t curlDataCallback(char *buffer, size_t size, size_t nmemb, void *pCCurlWWWData);
static size_t curlProgressCallback(void *pCCurlWWWData, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow);
};
// adapter group that store y offset for inputs inside an html form

View file

@ -42,7 +42,7 @@ namespace NLGUI
class CStrictTransportSecurity
{
public:
typedef std::map<std::string, SHSTSObject> THSTSObject;
typedef std::map<std::string, SHSTSObject> THSTSObjectMap;
static CStrictTransportSecurity* getInstance();
static void release();
@ -66,7 +66,7 @@ namespace NLGUI
~CStrictTransportSecurity();
std::string _Filename;
THSTSObject _Domains;
THSTSObjectMap _Domains;
};
}

View file

@ -182,6 +182,9 @@ namespace NLGUI
void setMarginLeft(sint32 m) { _MarginLeft = m; }
sint32 getMarginLeft() const { return _MarginLeft; }
// Return inner width for child elements
virtual sint32 getInnerWidth() const;
/**
* Get the max width used by the window.
*

View file

@ -164,6 +164,7 @@ namespace NLGUI
sint32 getMaxH () const { return _MaxH; }
sint32 getMaxWReal () const { return _Active ? _MaxWReal : 0; }
sint32 getMaxHReal () const { return _Active ? _MaxHReal : 0; }
sint32 getInnerWidth () const;
sint32 getOfsX () const { return _OffsetX; }
sint32 getOfsY () const { return _OffsetY; }
bool getResizeFromChildW() const { return _ResizeFromChildW; }

View file

@ -20,11 +20,12 @@
#ifndef CL_LIB_WWW_H
#define CL_LIB_WWW_H
#include <curl/curl.h>
#include "nel/misc/rgba.h"
#include "nel/gui/libwww_types.h"
// forward declaration to avoid curl.h inclusion everywhere
typedef void CURL;
namespace NLGUI
{
class CCtrlBaseButton;
@ -102,6 +103,7 @@ namespace NLGUI
HTML_ATTR(TR,L_MARGIN),
HTML_ATTR(TR,NOWRAP),
HTML_ATTR(TR,VALIGN),
HTML_ATTR(TR,STYLE),
};
enum

View file

@ -118,7 +118,7 @@ namespace NLGUI
/** read/write between values on a lua stack & a property exported from a 'CReflectable' derived object
* (throws on error)
*/
static void luaValueToReflectedProperty(CLuaState &ls, int stackIndex, CReflectable &target, const CReflectedProperty &property) throw(ELuaIHMException);
static void luaValueToReflectedProperty(CLuaState &ls, int stackIndex, CReflectable &target, const CReflectedProperty &property);
// push a reflected property on the stack
// NB : no check is done that 'property' is part of the class info of 'reflectedObject'

View file

@ -110,7 +110,7 @@ namespace NLGUI
/** create a sub table for this object, with a string as a key
* This object must be a table or an exception if thrown
*/
CLuaObject newTable(const char *tableName) throw(ELuaNotATable);
CLuaObject newTable(const char *tableName);
/** Set a value in a table.
@ -118,29 +118,29 @@ namespace NLGUI
* NB : value should came from the same lua environment
* \TODO other type of keys
*/
void setValue(const char *key, const CLuaObject &value) throw(ELuaNotATable);
void setValue(const std::string &key, const CLuaObject &value) throw(ELuaNotATable) { setValue(key.c_str(), value); }
void setValue(const char *key, const std::string &value) throw(ELuaNotATable);
void setValue(const char *key, const char *value) throw(ELuaNotATable);
void setValue(const char *key, bool value) throw(ELuaNotATable);
void setValue(const char *key, TLuaWrappedFunction value) throw(ELuaNotATable);
void setValue(const char *key, double value) throw(ELuaNotATable);
void setValue(const char *key, uint32 value) throw(ELuaNotATable);
void setValue(const char *key, sint32 value) throw(ELuaNotATable);
void setValue(const char *key, sint64 value) throw(ELuaNotATable);
void setValue(const std::string &key, const std::string &value) throw(ELuaNotATable) { setValue(key.c_str(), value); }
void setNil(const char *key) throw(ELuaNotATable);
void setNil(const std::string &key) throw(ELuaNotATable) { setNil(key.c_str()); }
void setValue(const char *key, const CLuaObject &value);
void setValue(const std::string &key, const CLuaObject &value) { setValue(key.c_str(), value); }
void setValue(const char *key, const std::string &value);
void setValue(const char *key, const char *value);
void setValue(const char *key, bool value);
void setValue(const char *key, TLuaWrappedFunction value);
void setValue(const char *key, double value);
void setValue(const char *key, uint32 value);
void setValue(const char *key, sint32 value);
void setValue(const char *key, sint64 value);
void setValue(const std::string &key, const std::string &value) { setValue(key.c_str(), value); }
void setNil(const char *key);
void setNil(const std::string &key) { setNil(key.c_str()); }
/** Erase a value in a table by its key.
* If this object is not a table then an exception is thrown.
* \TODO other type of keys
*/
void eraseValue(const char *key) throw(ELuaNotATable);
void eraseValue(const std::string &key) throw(ELuaNotATable) { eraseValue(key.c_str()); }
void eraseValue(const char *key);
void eraseValue(const std::string &key) { eraseValue(key.c_str()); }
// test is this object is enumerable
bool isEnumerable() const;
// Enumeration of a table. If the object is not a table, an exception is thrown.
CLuaEnumeration enumerate() throw(ELuaNotATable);
CLuaEnumeration enumerate();
// retrieve metatable of an object (or nil if object has no metatable)
CLuaObject getMetaTable() const;
// set metatable for this object
@ -155,7 +155,7 @@ namespace NLGUI
CLuaObject operator[](const std::string &key) const { return operator[](key.c_str()); }
/** Checked access to a sub element of a table. An exception is thrown is the element is not a table.
*/
CLuaObject at(const char *key) const throw (ELuaNotATable);
CLuaObject at(const char *key) const;
CLuaObject at(const std::string &key) const { return at(key.c_str()); }
// Test is that table has the given key. The object must be a table or an exception is thrown

View file

@ -88,6 +88,7 @@ namespace NLGUI
void setShadow (bool bShadow);
void setShadowOutline (bool bShadowOutline);
void setShadowColor (const NLMISC::CRGBA &color);
void setShadowOffset (sint x, sint y);
void setLineMaxW (sint nMaxW, bool invalidate=true);
void setMultiLine (bool bMultiLine);
void setMultiLineSpace (sint nMultiLineSpace);
@ -112,6 +113,7 @@ namespace NLGUI
bool getShadow() { return _Shadow; }
bool getShadowOutline() { return _ShadowOutline; }
NLMISC::CRGBA getShadowColor() { return _ShadowColor; }
void getShadowOffset(sint &x, sint &y) { x = _ShadowX; y = _ShadowY; }
sint getLineMaxW() const { return _LineMaxW; }
bool getMultiLine() const { return _MultiLine; }
sint getMultiLineSpace() const { return _MultiLineSpace; }
@ -247,6 +249,8 @@ namespace NLGUI
/// the shadow mode
bool _Shadow;
bool _ShadowOutline;
sint32 _ShadowX;
sint32 _ShadowY;
/// the case mode
TCaseMode _CaseMode;
/// the text shadow color

View file

@ -1,3 +1,7 @@
CONVERT_VERSION_NUMBER(NL_VERSION_NUM 100 ${NL_VERSION_MAJOR} ${NL_VERSION_MINOR} ${NL_VERSION_PATCH})
CONFIGURE_FILE(version_nl.cmake ${CMAKE_BINARY_DIR}/version_nl.h)
FILE(GLOB HEADERS *.h)
INSTALL(FILES ${HEADERS} DESTINATION include/nel/misc COMPONENT headers)
INSTALL(FILES ${HEADERS} ${CMAKE_BINARY_DIR}/version_nl.h DESTINATION include/nel/misc COMPONENT headers)

View file

@ -86,10 +86,10 @@ public:
static void release();
/// Register your class for future Instanciation.
static void registerClass(const std::string &className, IClassable* (*creator)(), const std::string &typeidCheck) throw(ERegistry);
static void registerClass(const std::string &className, IClassable* (*creator)(), const std::string &typeidCheck);
/// Create an object from his class name.
static IClassable *create(const std::string &className) throw(ERegistry);
static IClassable *create(const std::string &className);
/// check if the object has been correctly registered. Must be used for debug only, and Must compile with RTTI.
static bool checkObject(IClassable* obj);

View file

@ -108,9 +108,9 @@ public: // Advanced Usage.
/// flush the file.
void flush();
/// Seek the file
bool seek (sint32 offset, IStream::TSeekOrigin origin) const throw(EStream);
bool seek (sint32 offset, IStream::TSeekOrigin origin) const;
/// Get the location of the file pointer
sint32 getPos () const throw(EStream);
sint32 getPos () const;
// Imp the Name of the stream as the name of the file.
virtual std::string getStreamName() const;
@ -125,7 +125,7 @@ public: // Advanced Usage.
// return true if there's nothing more to read (same as ifstream)
bool eof ();
virtual void serialBuffer(uint8 *buf, uint len)throw(EReadError);
virtual void serialBuffer(uint8 *buf, uint len);
/// \name Statistics
@ -148,7 +148,7 @@ public: // Advanced Usage.
static void clearDump ();
protected:
virtual void serialBit(bool &bit) throw(EReadError);
virtual void serialBit(bool &bit);
virtual uint getDbgStreamSize() const;
@ -223,20 +223,20 @@ public: // Advanced Usage.
/// flush the file.
void flush();
/// Seek the file
bool seek (sint32 offset, IStream::TSeekOrigin origin) const throw(EStream);
bool seek (sint32 offset, IStream::TSeekOrigin origin) const;
/// Get the location of the file pointer
sint32 getPos () const throw(EStream);
sint32 getPos () const;
// Imp the Name of the stream as the name of the file.
virtual std::string getStreamName() const;
// very useful to serialize string in text mode (without the size)
virtual void serialBuffer(uint8 *buf, uint len) throw(EWriteError);
virtual void serialBuffer(uint8 *buf, uint len);
protected:
/// Internal close.
void internalClose(bool success);
virtual void serialBit(bool &bit) throw(EWriteError);
virtual void serialBit(bool &bit);
private:
FILE *_F;

View file

@ -197,7 +197,7 @@ public:
* \return true if seek sucessfull.
* \see ESeekNotSupported SeekOrigin getPos
*/
virtual bool seek (sint32 offset, TSeekOrigin origin) const throw(EStream);
virtual bool seek (sint32 offset, TSeekOrigin origin) const;
/**
* Get the location of the stream pointer.
@ -210,7 +210,7 @@ public:
* \return the new offset regarding from the origin.
* \see ESeekNotSupported SeekOrigin seek
*/
virtual sint32 getPos () const throw(EStream)
virtual sint32 getPos () const
{
return sint32(_Buffer.Pos);
}

View file

@ -226,7 +226,7 @@ public:
std::string toString() { if(Ptr) return toString(*Ptr); else return "<null>"; }
// serial using serialPtr
void serialPtr(NLMISC::IStream &f) throw(NLMISC::EStream )
void serialPtr(NLMISC::IStream &f)
{
T* obj= NULL;
if(f.isReading())
@ -242,7 +242,7 @@ public:
}
}
// serial using serialPloyPtr
void serialPolyPtr(NLMISC::IStream &f) throw(NLMISC::EStream )
void serialPolyPtr(NLMISC::IStream &f)
{
T* obj= NULL;
if(f.isReading())
@ -337,7 +337,7 @@ public:
void kill();
// serial using serialPloyPtr
void serialPolyPtr(NLMISC::IStream &f) throw(NLMISC::EStream )
void serialPolyPtr(NLMISC::IStream &f)
{
T* obj= NULL;
if(f.isReading())

View file

@ -177,10 +177,10 @@ public:
uint32 getCount() { return _IdCounter; }
// helper serialize a string id as a string
void serial(NLMISC::IStream &f, TSStringId &strId) throw(EStream);
void serial(NLMISC::IStream &f, TSStringId &strId);
// helper serialize a string id vector
void serial(NLMISC::IStream &f, std::vector<TSStringId> &strIdVect) throw(EStream);
void serial(NLMISC::IStream &f, std::vector<TSStringId> &strIdVect);
};

View file

@ -79,6 +79,9 @@
# elif _MSC_VER >= 1600
# define NL_COMP_VC10
# define NL_COMP_VC_VERSION 100
# ifdef _HAS_CPP0X
# undef _HAS_CPP0X // VC++ 2010 doesn't implement C++11 stuff we need
# endif
# elif _MSC_VER >= 1500
# define NL_COMP_VC9
# define NL_COMP_VC_VERSION 90
@ -409,8 +412,16 @@ typedef unsigned int uint; // at least 32bits (depend of processor)
#define NL_DEFAULT_MEMORY_ALIGNMENT 16
#define NL_ALIGN_SSE2 NL_ALIGN(NL_DEFAULT_MEMORY_ALIGNMENT)
#ifndef NL_CPU_X86_64
#ifdef NL_CPU_X86_64
// on x86_64, new and delete are already aligned on 16 bytes
#elif (defined(NL_COMP_VC) && defined(NL_DEBUG))
// don't use aligned memory if debugging with VC++ in 32 bits
#else
// use aligned memory in all other cases
#define NL_USE_ALIGNED_MEMORY_OPERATORS
#endif
#ifdef NL_USE_ALIGNED_MEMORY_OPERATORS
#ifdef NL_NO_EXCEPTION_SPECS
extern void *operator new(size_t size);
@ -422,9 +433,9 @@ 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();
#endif
#endif /* NL_NO_EXCEPTION_SPECS */
#endif
#endif /* NL_USE_ALIGNED_MEMORY_OPERATORS */
#else /* NL_HAS_SSE2 */

View file

@ -0,0 +1,14 @@
#ifndef NL_VERSION_H
#define NL_VERSION_H
#define NL_VERSION "${NL_VERSION}"
#define NL_VERSION_MAJOR ${NL_VERSION_MAJOR}
#define NL_VERSION_MINOR ${NL_VERSION_MINOR}
#define NL_VERSION_PATCH ${NL_VERSION_PATCH}
#define NL_VERSION_NUM ${NL_VERSION_NUM}
#define NL_REVISION ${REVISION}
#define NL_BUILD_DATE "${BUILD_DATE}"
#endif

View file

@ -146,7 +146,7 @@ public:
return _LengthR;
}
virtual sint32 getPos () const throw(NLMISC::EStream)
virtual sint32 getPos() const
{
// return (_BufPos - _Buffer.getPtr()) - _SubMessagePosR;
return _Buffer.Pos - _SubMessagePosR;

View file

@ -213,18 +213,14 @@ namespace NLNET
* Note that a module can be plugged in several socket at the same
* time, but not twice in the same socket.
*/
virtual void plugModule(IModuleSocket *moduleSocket)
throw (EModuleAlreadyPluggedHere)
=0;
virtual void plugModule(IModuleSocket *moduleSocket) =0;
/** Unplug this module from the specified socket.
* Note that a module can be plugged in several socket at the same
* time, but not twice in the same socket.
* Throw an exception if the socket is not currently plug into
* the specified socket.
*/
virtual void unplugModule(IModuleSocket *moduleSocket)
throw (EModuleNotPluggedHere)
=0;
virtual void unplugModule(IModuleSocket *moduleSocket) =0;
/** Fill resultList vector with the list of socket into
* witch this module is currently plugged.
* This method don't clear the result vector before filling it.
@ -265,9 +261,7 @@ namespace NLNET
* The call is blocking until receptions of the operation
* result message (or detection of the dest module module is down)
*/
virtual void invokeModuleOperation(IModuleProxy *destModule, const NLNET::CMessage &opMsg, NLNET::CMessage &resultMsg)
throw (EInvokeFailed)
=0;
virtual void invokeModuleOperation(IModuleProxy *destModule, const NLNET::CMessage &opMsg, NLNET::CMessage &resultMsg) =0;
//@}
@ -448,9 +442,7 @@ namespace NLNET
* This method do the job of finding a valid socket to effectively send
* the message.
*/
virtual void sendModuleMessage(IModule *senderModule, const NLNET::CMessage &message)
throw (EModuleNotReachable)
=0;
virtual void sendModuleMessage(IModule *senderModule, const NLNET::CMessage &message) =0;
/** Return the first item of the security item list
* If no security data are available, the method
@ -779,10 +771,10 @@ namespace NLNET
// Init base module, init module name
bool initModule(const TParsedCommandLine &initInfo);
void plugModule(IModuleSocket *moduleSocket) throw (EModuleAlreadyPluggedHere);
void unplugModule(IModuleSocket *moduleSocket) throw (EModuleNotPluggedHere);
void plugModule(IModuleSocket *moduleSocket);
void unplugModule(IModuleSocket *moduleSocket);
void getPluggedSocketList(std::vector<IModuleSocket*> &resultList);
void invokeModuleOperation(IModuleProxy *destModule, const NLNET::CMessage &opMsg, NLNET::CMessage &resultMsg) throw (EInvokeFailed);
void invokeModuleOperation(IModuleProxy *destModule, const NLNET::CMessage &opMsg, NLNET::CMessage &resultMsg);
void _onModuleUp(IModuleProxy *removedProxy);
void _onModuleDown(IModuleProxy *removedProxy);
@ -879,8 +871,7 @@ namespace NLNET
/** Send a message to the module.
*/
virtual void sendModuleMessage(IModule *senderModule, const NLNET::CMessage &message)
throw (EModuleNotReachable);
virtual void sendModuleMessage(IModule *senderModule, const NLNET::CMessage &message);
virtual const TSecurityData *getFirstSecurityData() const
{

View file

@ -171,8 +171,7 @@ namespace NLNET
virtual void setTransportPeerInvisible(const std::string &transportInstanceName, bool peerInvisible) =0;
/// Activate/stop firewalling mode on a transport
virtual void setTransportFirewallMode(const std::string &transportInstanceName, bool firewalled)
throw (EGatewayFirewallBreak) =0;
virtual void setTransportFirewallMode(const std::string &transportInstanceName, bool firewalled) =0;
/// Send a command to a transport
virtual void transportCommand(const TParsedCommandLine &commandLine) =0;
@ -233,9 +232,7 @@ namespace NLNET
/** Disclose module information to a connected gateway.
* This can also be this gateway itself.
*/
virtual void discloseModule(IModuleProxy *moduleProxy)
throw (EGatewayNotConnected)
=0;
virtual void discloseModule(IModuleProxy *moduleProxy) =0;
/** Retrieve the proxy for a locally plugged module.
* Each local module plugged in a gateway has an associated
@ -346,9 +343,9 @@ namespace NLNET
virtual const std::string &getClassName() const =0;
/// The gateway send a command message to the transport
virtual void onCommand(const CMessage &command) throw (EInvalidCommand) = 0;
virtual void onCommand(const CMessage &command) = 0;
/// The gateway send a textual command to the transport
virtual bool onCommand(const TParsedCommandLine &command) throw (EInvalidCommand) = 0;
virtual bool onCommand(const TParsedCommandLine &command) = 0;
/// The gateway update the transport regularly
virtual void update() =0;

View file

@ -42,15 +42,11 @@ namespace NLNET
* If the destination module is not accessible through this socket,
* an exception is thrown.
*/
virtual void sendModuleMessage(IModule *senderModule, TModuleId destModuleProxyId, const NLNET::CMessage &message )
throw (EModuleNotPluggedHere)
=0;
virtual void sendModuleMessage(IModule *senderModule, TModuleId destModuleProxyId, const NLNET::CMessage &message) =0;
/** A plugged module send a message to all the module reachable
* with this socket.
*/
virtual void broadcastModuleMessage(IModule *senderModule, const NLNET::CMessage &message)
throw (EModuleNotPluggedHere)
=0;
virtual void broadcastModuleMessage(IModule *senderModule, const NLNET::CMessage &message) =0;
/** Fill the resultList with the list of module that are
* reachable with this socket.
@ -95,21 +91,15 @@ namespace NLNET
virtual void _onModulePlugged(const TModulePtr &pluggedModule);
virtual void _onModuleUnplugged(const TModulePtr &pluggedModule);
virtual void _sendModuleMessage(IModule *senderModule, TModuleId destModuleProxyId, const NLNET::CMessage &message )
throw (EModuleNotPluggedHere, NLNET::EModuleNotReachable)
=0;
virtual void _sendModuleMessage(IModule *senderModule, TModuleId destModuleProxyId, const NLNET::CMessage &message) =0;
virtual void _broadcastModuleMessage(IModule *senderModule, const NLNET::CMessage &message)
throw (EModuleNotPluggedHere)
=0;
virtual void _broadcastModuleMessage(IModule *senderModule, const NLNET::CMessage &message) =0;
virtual void sendModuleMessage(IModule *senderModule, TModuleId destModuleProxyId, const NLNET::CMessage &message )
throw (EModuleNotPluggedHere);
virtual void sendModuleMessage(IModule *senderModule, TModuleId destModuleProxyId, const NLNET::CMessage &message);
/** A plugged module send a message to all the module reachable
* with this socket.
*/
virtual void broadcastModuleMessage(IModule *senderModule, const NLNET::CMessage &message)
throw (EModuleNotPluggedHere);
virtual void broadcastModuleMessage(IModule *senderModule, const NLNET::CMessage &message);
};

View file

@ -1328,7 +1328,7 @@ const D3DFORMAT FinalPixelFormat[ITexture::UploadFormatCount][CDriverD3D::FinalP
// ***************************************************************************
bool CDriverD3D::setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable) throw(EBadDisplay)
bool CDriverD3D::setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable)
{
H_AUTO_D3D(CDriver3D_setDisplay);

View file

@ -849,7 +849,7 @@ public:
// Mode initialisation, requests
virtual bool init (uintptr_t windowIcon = 0, emptyProc exitFunc = 0);
virtual bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable) throw(EBadDisplay);
virtual bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable);
virtual bool release();
virtual bool setMode(const GfxMode& mode);
virtual bool getModes(std::vector<GfxMode> &modes);

View file

@ -325,7 +325,7 @@ public:
virtual void disableHardwareVertexArrayAGP();
virtual void disableHardwareTextureShader();
virtual bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable) throw(EBadDisplay);
virtual bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable);
virtual bool setMode(const GfxMode& mode);
virtual bool getModes(std::vector<GfxMode> &modes);
virtual bool getCurrentScreenMode(GfxMode &mode);

View file

@ -611,7 +611,7 @@ void CDriverGL::setWindowIcon(const std::vector<NLMISC::CBitmap> &bitmaps)
}
// --------------------------------------------------
bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool resizeable) throw(EBadDisplay)
bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool resizeable)
{
H_AUTO_OGL(CDriverGL_setDisplay)

View file

@ -77,7 +77,7 @@ extern IDriver* createGlEsDriverInstance ();
#endif
// ***************************************************************************
IDriver *CDRU::createGlDriver() throw (EDru)
IDriver *CDRU::createGlDriver()
{
#ifdef NL_STATIC
@ -131,7 +131,7 @@ IDriver *CDRU::createGlDriver() throw (EDru)
}
// ***************************************************************************
IDriver *CDRU::createGlEsDriver() throw (EDru)
IDriver *CDRU::createGlEsDriver()
{
#ifdef NL_STATIC
@ -188,7 +188,7 @@ IDriver *CDRU::createGlEsDriver() throw (EDru)
#ifdef NL_OS_WINDOWS
IDriver *CDRU::createD3DDriver() throw (EDru)
IDriver *CDRU::createD3DDriver()
{
#ifdef NL_STATIC

View file

@ -2423,7 +2423,7 @@ void CLandscape::checkZoneBinds(CZone &curZone, EBadBind &bindError)
// ***************************************************************************
void CLandscape::checkBinds() throw(EBadBind)
void CLandscape::checkBinds()
{
EBadBind bindError;
@ -2439,7 +2439,7 @@ void CLandscape::checkBinds() throw(EBadBind)
// ***************************************************************************
void CLandscape::checkBinds(uint16 zoneId) throw(EBadBind)
void CLandscape::checkBinds(uint16 zoneId)
{
EBadBind bindError;

View file

@ -51,7 +51,7 @@ CEventServer CNELU::EventServer;
CEventListenerAsync CNELU::AsyncListener;
bool CNELU::initDriver (uint w, uint h, uint bpp, bool windowed, nlWindow systemWindow, bool offscreen, bool direct3d) throw(EDru)
bool CNELU::initDriver (uint w, uint h, uint bpp, bool windowed, nlWindow systemWindow, bool offscreen, bool direct3d)
{
// Init debug system
// NLMISC::InitDebug();
@ -183,7 +183,7 @@ void CNELU::releaseDriver()
}
}
bool CNELU::init (uint w, uint h, CViewport viewport, uint bpp, bool windowed, nlWindow systemWindow, bool offscreen, bool direct3d) throw(EDru)
bool CNELU::init (uint w, uint h, CViewport viewport, uint bpp, bool windowed, nlWindow systemWindow, bool offscreen, bool direct3d)
{
NL3D::registerSerial3d();
if (initDriver(w,h,bpp,windowed,systemWindow,offscreen,direct3d))

View file

@ -47,7 +47,8 @@ CTextContext::CTextContext()
_Shaded = false;
_ShadeOutline = false;
_ShadeExtent = 0.001f;
_ShadeExtentX = 0.001f;
_ShadeExtentY = 0.001f;
_ShadeColor = NLMISC::CRGBA(0,0,0);
_Keep800x600Ratio= true;

View file

@ -187,11 +187,11 @@ bool CTextContextUser::getShadeOutline() const
return _TextContext.getShadeOutline();
}
void CTextContextUser::setShadeExtent(float shext)
void CTextContextUser::setShadeExtent(float x, float y)
{
H_AUTO2;
_TextContext.setShadeExtent(shext);
_TextContext.setShadeExtent(x, y);
}
void CTextContextUser::setShadeColor (NLMISC::CRGBA sc)
{

View file

@ -6,9 +6,10 @@ SOURCE_GROUP("src" FILES ${SRC})
NL_TARGET_LIB(nelgui ${SRC} ${HEADERS})
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${LUA_INCLUDE_DIR} ${LUABIND_INCLUDE_DIR} ${CURL_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${LUA_INCLUDE_DIR} ${LUABIND_INCLUDE_DIR} ${CURL_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(nelgui nelmisc nel3d ${LUA_LIBRARIES} ${LUABIND_LIBRARIES} ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES})
TARGET_LINK_LIBRARIES(nelgui nelmisc nel3d ${LUA_LIBRARIES} ${LUABIND_LIBRARIES} ${CURL_LIBRARIES})
NL_DEFAULT_PROPS(nelgui "NeL, Library: NeL GUI")
NL_ADD_RUNTIME_FLAGS(nelgui)

View file

@ -885,7 +885,7 @@ namespace NLGUI
}
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousewheel && _Vertical)
{
moveTrackY (eventDesc.getWheel() * 12);
moveTargetY (-(eventDesc.getWheel() * 12));
return true;
}
}
@ -1226,6 +1226,12 @@ namespace NLGUI
if(hReal <= maxHReal)
return;
if (_TargetStepY > 1)
{
sint sign = (0 < dy) - (dy < 0);
dy = sign * max(1, (dy / _TargetStepY)) * _TargetStepY;
}
// compute the new ofsY.
sint32 ofsY= _Target->getOfsY();
ofsY+= dy;

View file

@ -21,12 +21,18 @@
#include <openssl/x509.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#if defined(NL_OS_WINDOWS)
#pragma comment(lib, "crypt32.lib")
#pragma comment(lib, "cryptui.lib")
#include <curl/curl.h>
// for compatibility with older versions
#ifndef CURL_AT_LEAST_VERSION
#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|z)
#define CURL_AT_LEAST_VERSION(x,y,z) \
(LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
#endif
using namespace std;
using namespace NLMISC;
@ -36,36 +42,143 @@ using namespace NLMISC;
namespace NLGUI
{
#if defined(NL_OS_WINDOWS)
static std::vector<X509 *> x509CertList;
//
// x509CertList lifetime manager
//
class SX509Certificates {
class SX509Certificates
{
public:
SX509Certificates()
struct CertEntry
{
curl_version_info_data *data;
data = curl_version_info(CURLVERSION_NOW);
if (!(data && data->features & CURL_VERSION_SSPI))
X509 *cert;
std::string name;
std::string file;
bool operator == (const std::string &str)
{
addCertificatesFrom("CA");
addCertificatesFrom("AuthRoot");
addCertificatesFrom("ROOT");
return file == str;
}
};
std::vector<CertEntry> CertList;
bool isUsingOpenSSLBackend;
bool isInitialized;
SX509Certificates():isUsingOpenSSLBackend(false), isInitialized(false)
{
init();
}
~SX509Certificates()
{
for (uint i = 0; i < x509CertList.size(); ++i)
for (uint i = 0; i < CertList.size(); ++i)
{
X509_free(x509CertList[i]);
X509_free(CertList[i].cert);
}
x509CertList.clear();
CertList.clear();
}
void init()
{
// init CURL
CURL *curl = curl_easy_init();
if (!curl) return;
// get information on CURL
curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
bool useOpenSSLBackend = false;
#if CURL_AT_LEAST_VERSION(7, 34, 0)
// get more information on CURL session
curl_tlssessioninfo *sessionInfo;
CURLINFO info;
#if CURL_AT_LEAST_VERSION(7, 48, 0)
info = CURLINFO_TLS_SSL_PTR;
#else
info = CURLINFO_TLS_SESSION;
#endif
CURLcode res = curl_easy_getinfo(curl, info, &sessionInfo);
// CURL using OpenSSL backend
if ((res == CURLE_OK) && sessionInfo && sessionInfo->backend == CURLSSLBACKEND_OPENSSL) useOpenSSLBackend = true;
#elif CURL_AT_LEAST_VERSION(7, 12, 3)
// get a list of OpenSSL engines
struct curl_slist *engines;
CURLcode res = curl_easy_getinfo(curl, CURLINFO_SSL_ENGINES, &engines);
// CURL using OpenSSL backend
// With OpenSSL compiled without any engine, engines will too return NULL
// Fortunately, if OpenSSL isn't compiled with engines means we compiled it ourself and CURL is a recent version
if ((res == CURLE_OK) && engines)
{
// free engines
curl_slist_free_all(engines);
useOpenSSLBackend = true;
}
#else
// TODO: implement an equivalent, but CURL 7.12 was released in 2004
#endif
// only use OpenSSL callback if not using Windows SSPI and using OpenSSL backend
if (useOpenSSLBackend && !(data && data->features & CURL_VERSION_SSPI))
{
#ifdef NL_OS_WINDOWS
// load native Windows CA Certs
addCertificatesFrom("CA");
addCertificatesFrom("AuthRoot");
addCertificatesFrom("ROOT");
#endif
isUsingOpenSSLBackend = true;
}
else
{
// if CURL is using SSPI or SChannel under Windows or DarwinSSL under OS X, we'll use native system CA Certs
isUsingOpenSSLBackend = false;
}
// clean up CURL
curl_easy_cleanup(curl);
isInitialized = true;
}
static std::string getCertName(X509 *cert)
{
// NULL certificate
if (!cert) return "";
X509_NAME *subject = X509_get_subject_name(cert);
std::string name;
unsigned char *tmp = NULL;
// construct a multiline string with name
for (int j = 0, jlen = X509_NAME_entry_count(subject); j < jlen; ++j)
{
X509_NAME_ENTRY *e = X509_NAME_get_entry(subject, j);
ASN1_STRING *d = X509_NAME_ENTRY_get_data(e);
if (ASN1_STRING_to_UTF8(&tmp, d) > 0)
{
name += NLMISC::toString("%s\n", tmp);
OPENSSL_free(tmp);
}
}
return name;
}
#ifdef NL_OS_WINDOWS
void addCertificatesFrom(LPCSTR root)
{
HCERTSTORE hStore;
@ -78,36 +191,154 @@ namespace NLGUI
{
x509 = NULL;
x509 = d2i_X509(NULL, (const unsigned char **)&pContext->pbCertEncoded, pContext->cbCertEncoded);
if (x509)
{
x509CertList.push_back(x509);
CertEntry entry;
entry.cert = x509;
entry.file = root;
entry.name = getCertName(x509);
CertList.push_back(entry);
}
}
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);
//nlinfo("Loaded %d certificates from '%s' certificate store", (int)CertList.size(), root);
}
#endif
void addCertificatesFromFile(const std::string &cert)
{
if (!isInitialized)
{
nlwarning("CURL not initialized! Check if there are another errors");
return;
}
if (!isUsingOpenSSLBackend)
{
nlinfo("CURL not using OpenSSL backend! Unable to use custom certificates");
return;
}
else
{
nlinfo("CURL using OpenSSL backend!");
}
// this file was already loaded
if (std::find(CertList.begin(), CertList.end(), cert) != CertList.end()) return;
// look for certificate in search paths
string path = CPath::lookup(cert, false);
if (path.empty())
{
nlwarning("Unable to find %s", cert.c_str());
return;
}
nlinfo("CURL CA bundle '%s'", path.c_str());
CIFile file;
// open certificate
if (!file.open(path))
{
nlwarning("Unable to open %s", path.c_str());
return;
}
// load certificate content into memory
std::vector<uint8> buffer(file.getFileSize());
file.serialBuffer(&buffer[0], file.getFileSize());
// get a BIO
BIO *bio = BIO_new_mem_buf(&buffer[0], file.getFileSize());
if (bio)
{
// use it to read the PEM formatted certificate from memory into an X509
// structure that SSL can use
STACK_OF(X509_INFO) *info = PEM_X509_INFO_read_bio(bio, NULL, NULL, NULL);
if (info)
{
// iterate over all entries from the PEM file, add them to the x509_store one by one
for (sint i = 0; i < sk_X509_INFO_num(info); ++i)
{
X509_INFO *itmp = sk_X509_INFO_value(info, i);
if (itmp && itmp->x509)
{
CertEntry entry;
entry.cert = X509_dup(itmp->x509);
entry.file = cert;
entry.name = getCertName(entry.cert);
CertList.push_back(entry);
}
}
// cleanup
sk_X509_INFO_pop_free(info, X509_INFO_free);
}
else
{
nlwarning("Unable to read PEM info");
}
// decrease reference counts
BIO_free(bio);
}
else
{
nlwarning("Unable to allocate BIO buffer for certificates");
}
}
};
/// this will be initialized on startup and cleared on exit
static SX509Certificates x509CertListManager;
// ***************************************************************************
// static
CURLcode CCurlCertificates::sslCtxFunction(CURL *curl, void *sslctx, void *parm)
// cURL SSL certificate loading
static CURLcode sslCtxFunction(CURL *curl, void *sslctx, void *parm)
{
if (x509CertList.size() > 0)
CURLcode res = CURLE_OK;
if (x509CertListManager.CertList.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)
char errorBuffer[1024];
for (uint i = 0, ilen = x509CertListManager.CertList.size(); i < ilen; ++i)
{
X509_STORE_add_cert(x509store, x509CertList[i]);
SX509Certificates::CertEntry entry = x509CertListManager.CertList[i];
// add our certificate to this store
if (X509_STORE_add_cert(x509store, entry.cert) == 0)
{
uint errCode = ERR_get_error();
// ignore already in hash table errors
if (ERR_GET_LIB(errCode) != ERR_LIB_X509 || ERR_GET_REASON(errCode) != X509_R_CERT_ALREADY_IN_HASH_TABLE)
{
ERR_error_string_n(errCode, errorBuffer, 1024);
nlwarning("Error adding certificate %s: %s", entry.name.c_str(), errorBuffer);
res = CURLE_SSL_CACERT;
}
}
else
{
nldebug("Added certificate %s", entry.name.c_str());
}
}
}
else
@ -115,9 +346,40 @@ namespace NLGUI
nlwarning("SSL_CTX_get_cert_store returned NULL");
}
}
return CURLE_OK;
else
{
res = CURLE_SSL_CACERT;
}
return res;
}
// ***************************************************************************
// static
void CCurlCertificates::addCertificateFile(const std::string &cert)
{
x509CertListManager.addCertificatesFromFile(cert);
}
// ***************************************************************************
// static
void CCurlCertificates::useCertificates(CURL *curl)
{
// CURL must be valid, using OpenSSL backend and certificates must be loaded, else return
if (!curl || !x509CertListManager.isInitialized || !x509CertListManager.isUsingOpenSSLBackend || x509CertListManager.CertList.empty()) return;
curl_easy_setopt(curl, CURLOPT_SSLCERTTYPE, "PEM");
// would allow to provide the CA in memory instead of using CURLOPT_CAINFO, but needs to include and link OpenSSL
if (curl_easy_setopt(curl, CURLOPT_SSL_CTX_FUNCTION, &sslCtxFunction) != CURLE_OK)
{
nlwarning("Unable to support CURLOPT_SSL_CTX_FUNCTION, curl not compiled with OpenSSL ?");
}
// set both CURLOPT_CAINFO and CURLOPT_CAPATH to NULL to be sure we won't use default values (these files can be missing and generate errors)
curl_easy_setopt(curl, CURLOPT_CAINFO, NULL);
curl_easy_setopt(curl, CURLOPT_CAPATH, NULL);
}
#endif // NL_OS_WINDOWS
}// namespace

View file

@ -2473,7 +2473,7 @@ namespace NLGUI
if (_LayerSetup == 0)
{
_List->forceSizeW(_W - pLayer->W_M_Open);
_List->forceSizeW(_W - (pLayer->W_M_Open + pLayer->W_R) );
}
else
{
@ -2748,6 +2748,9 @@ namespace NLGUI
if (_Content != NULL)
h += _Content->getHReal();
if (_List != NULL)
h += _List->getHReal();
h -= _ContentYOffset;
}
else

View file

@ -1005,7 +1005,6 @@ namespace NLGUI
{
case KeyESCAPE:
_CurrentHistoricIndex= -1;
CWidgetManager::getInstance()->setCaptureKeyboard(NULL);
// stop selection
_CurrSelection = NULL;
_CursorAtPreviousLineEnd = false;
@ -1014,6 +1013,7 @@ namespace NLGUI
setInputString(ucstring(""));
triggerOnChangeAH();
}
CWidgetManager::getInstance()->setCaptureKeyboard(NULL);
break;
case KeyTAB:
makeTopWindow();

File diff suppressed because it is too large Load diff

View file

@ -1410,7 +1410,7 @@ namespace NLGUI
// Get the child width
maxWidth += _Elements[k].Element->getMaxUsedW();
}
return maxWidth;
return maxWidth + _MarginLeft;
}
// ----------------------------------------------------------------------------
@ -1425,7 +1425,7 @@ namespace NLGUI
if (width > minWidth)
minWidth = width;
}
return minWidth;
return minWidth + _MarginLeft;
}

View file

@ -703,7 +703,7 @@ namespace NLGUI
{
if (ContinuousUpdate)
{
sint parentWidth = std::min(_Parent->getMaxWReal(), _Parent->getWReal());
sint parentWidth = _Parent->getInnerWidth();
if (_LastParentW != (sint) parentWidth)
{
_LastParentW = parentWidth;
@ -813,10 +813,6 @@ namespace NLGUI
for(sint span = 0; span < cell->ColSpan -1; ++span)
{
++column;
_Columns[column].Width = std::max(_Columns[column].Width, _Columns[column-1].Width);
_Columns[column].WidthMax = std::max(_Columns[column].WidthMax, _Columns[column-1].WidthMax);
_Columns[column].TableRatio = std::max(_Columns[column].TableRatio, _Columns[column-1].TableRatio);
_Columns[column].WidthWanted = std::max(_Columns[column].WidthWanted, _Columns[column-1].WidthWanted);
_Columns[column].RowSpan = _Columns[column-1].RowSpan;
}
}
@ -1163,7 +1159,7 @@ namespace NLGUI
{
if (_Parent != NULL)
{
sint parentWidth = std::min(_Parent->getMaxWReal(), _Parent->getWReal());
sint parentWidth = _Parent->getInnerWidth();
if (_LastParentW != (sint) parentWidth)
{
if (ContinuousUpdate)
@ -1311,6 +1307,9 @@ namespace NLGUI
// ----------------------------------------------------------------------------
void CGroupTable::draw ()
{
// move X for clip and borders
_XReal += _MarginLeft;
// search a parent container
CInterfaceGroup *gr = getParent();
while (gr)
@ -1391,6 +1390,9 @@ namespace NLGUI
}
CInterfaceGroup::draw ();
// restore
_XReal -= _MarginLeft;
}
std::string CGroupTable::getProperties( const std::string &name ) const

View file

@ -87,9 +87,12 @@ namespace NLGUI {
if (domain.empty() || _Domains.empty())
return false;
if (_Domains.count(domain) > 0)
THSTSObjectMap::const_iterator itHsts;
itHsts = _Domains.find(domain);
if (itHsts != _Domains.end())
{
hsts = _Domains.at(domain);
hsts = itHsts->second;
return true;
}
@ -99,11 +102,12 @@ namespace NLGUI {
{
std::string tmp;
tmp = domain.substr(firstOf+1);
if (_Domains.count(tmp))
itHsts = _Domains.find(tmp);
if (itHsts != _Domains.end())
{
if (_Domains.at(tmp).IncludeSubDomains)
if (itHsts->second.IncludeSubDomains)
{
hsts = _Domains.at(tmp);
hsts = itHsts->second;
return true;
}
@ -182,7 +186,7 @@ namespace NLGUI {
{
uint32 nbItems = _Domains.size();
f.serial(nbItems);
for (THSTSObject::iterator it = _Domains.begin(); it != _Domains.end(); ++it)
for (THSTSObjectMap::iterator it = _Domains.begin(); it != _Domains.end(); ++it)
{
std::string domain(it->first);
f.serial(domain);

View file

@ -506,10 +506,16 @@ namespace NLGUI
}
}
// ------------------------------------------------------------------------------------------------
sint32 CInterfaceElement::getInnerWidth() const
{
return _WReal - _MarginLeft;
}
// ------------------------------------------------------------------------------------------------
void CInterfaceElement::updateCoords()
{
_XReal = _X + _MarginLeft;
_XReal = _X;
_YReal = _Y;
_WReal = getW();
_HReal = getH();
@ -526,7 +532,7 @@ namespace NLGUI
if (el == NULL)
return;
_XReal += el->_XReal - el->_MarginLeft;
_XReal += el->_XReal;
_YReal += el->_YReal;
THotSpot hsParent = _ParentPosRef;

View file

@ -1305,7 +1305,7 @@ namespace NLGUI
CInterfaceGroup *currParent = _Parent;
while (currParent)
{
if (currParent->moveSBTrackY (this, eventDesc.getWheel()*12))
if (currParent->moveSBTargetY (this, -(eventDesc.getWheel()*12)))
return true;
currParent = currParent->getParent();
}
@ -1397,9 +1397,19 @@ namespace NLGUI
restoreClip (oldSciX, oldSciY, oldSciW, oldSciH);
}
// ------------------------------------------------------------------------------------------------
sint32 CInterfaceGroup::getInnerWidth() const
{
sint width = CInterfaceElement::getInnerWidth();
return std::min(width, _MaxWReal - _MarginLeft);
}
// ------------------------------------------------------------------------------------------------
void CInterfaceGroup::checkCoords()
{
// Make XReal same as in updateCoords() as some elements (CViewText) depends on it
_XReal += _MarginLeft;
//update all children elements
vector<CViewBase*>::const_iterator ite;
for (ite = _EltOrder.begin() ; ite != _EltOrder.end(); ite++)
@ -1408,6 +1418,8 @@ namespace NLGUI
if(pIE->getActive())
pIE->checkCoords();
}
_XReal -= _MarginLeft;
executeLuaScriptOnDraw();
}
@ -1468,7 +1480,7 @@ namespace NLGUI
pIE->updateCoords();
}
_XReal -= _OffsetX - _MarginLeft;
_XReal -= (_OffsetX + _MarginLeft);
_YReal -= _OffsetY;
}
@ -1958,9 +1970,11 @@ namespace NLGUI
newSciH = newSciH - ((newSciY+newSciH)-(oldSciY+oldSciH));
}
newSciXDest = newSciX - _MarginLeft;
// Don't apply margins because HTML list marker is drawn outside group paragraph inner content.
// Should not be an issue because horizontal scolling not used.
newSciXDest = newSciX/* + _MarginLeft*/;
newSciYDest = newSciY;
newSciWDest = newSciW + _MarginLeft;
newSciWDest = newSciW/* - _MarginLeft*/;
newSciHDest = newSciH;
}

View file

@ -19,6 +19,8 @@
#include "nel/gui/libwww.h"
#include "nel/gui/group_html.h"
#include <curl/curl.h>
using namespace NLMISC;
#ifdef DEBUG_NEW
@ -101,6 +103,7 @@ namespace NLGUI
HTML_ATTR(TR,L_MARGIN),
HTML_ATTR(TR,NOWRAP),
HTML_ATTR(TR,VALIGN),
HTML_ATTR(TR,STYLE),
{ 0 }
};

View file

@ -1434,7 +1434,7 @@ namespace NLGUI
}
// ***************************************************************************
void CLuaIHM::luaValueToReflectedProperty(CLuaState &ls, int stackIndex, CReflectable &target, const CReflectedProperty &property) throw(ELuaIHMException)
void CLuaIHM::luaValueToReflectedProperty(CLuaState &ls, int stackIndex, CReflectable &target, const CReflectedProperty &property)
{
//H_AUTO(Lua_property_throw)
if(ls.isNil(stackIndex))

View file

@ -222,7 +222,7 @@ namespace NLGUI
}
// *************************************************
CLuaEnumeration CLuaObject::enumerate() throw(ELuaNotATable)
CLuaEnumeration CLuaObject::enumerate()
{
if (!isEnumerable())
{
@ -271,7 +271,7 @@ namespace NLGUI
}
// *************************************************
CLuaObject CLuaObject::at(const char *key) const throw(ELuaNotATable)
CLuaObject CLuaObject::at(const char *key) const
{
if (!isEnumerable()) throw ELuaNotATable(NLMISC::toString("Can't get key '%s' in object '%s' because type is '%s', it is not a table.", key, getId().c_str(), getTypename()).c_str());
return operator[](key);
@ -286,7 +286,7 @@ namespace NLGUI
}
// *************************************************
CLuaObject CLuaObject::newTable(const char *tableName) throw(ELuaNotATable)
CLuaObject CLuaObject::newTable(const char *tableName)
{
nlassert(tableName);
nlassert(isValid());
@ -301,7 +301,7 @@ namespace NLGUI
}
// *************************************************
void CLuaObject::setValue(const char *key, const CLuaObject &value) throw(ELuaNotATable)
void CLuaObject::setValue(const char *key, const CLuaObject &value)
{
nlassert(key);
nlassert(isValid());
@ -317,7 +317,7 @@ namespace NLGUI
}
// *************************************************
void CLuaObject::setNil(const char *key) throw(ELuaNotATable)
void CLuaObject::setNil(const char *key)
{
nlassert(key);
nlassert(isValid());
@ -331,7 +331,7 @@ namespace NLGUI
}
// *************************************************
void CLuaObject::setValue(const char *key, const char *value) throw(ELuaNotATable)
void CLuaObject::setValue(const char *key, const char *value)
{
nlassert(value);
nlassert(key);
@ -346,13 +346,13 @@ namespace NLGUI
}
// *************************************************
void CLuaObject::setValue(const char *key, const std::string &value) throw(ELuaNotATable)
void CLuaObject::setValue(const char *key, const std::string &value)
{
setValue(key, value.c_str());
}
// *************************************************
void CLuaObject::setValue(const char *key, bool value) throw(ELuaNotATable)
void CLuaObject::setValue(const char *key, bool value)
{
nlassert(key);
nlassert(isValid());
@ -366,7 +366,7 @@ namespace NLGUI
}
// *************************************************
void CLuaObject::setValue(const char *key, TLuaWrappedFunction value) throw(ELuaNotATable)
void CLuaObject::setValue(const char *key, TLuaWrappedFunction value)
{
nlassert(key);
nlassert(isValid());
@ -380,7 +380,7 @@ namespace NLGUI
}
// *************************************************
void CLuaObject::setValue(const char *key, double value) throw(ELuaNotATable)
void CLuaObject::setValue(const char *key, double value)
{
nlassert(key);
nlassert(isValid());
@ -394,7 +394,7 @@ namespace NLGUI
}
// *************************************************
void CLuaObject::setValue(const char *key, uint32 value) throw(ELuaNotATable)
void CLuaObject::setValue(const char *key, uint32 value)
{
nlassert(key);
nlassert(isValid());
@ -408,7 +408,7 @@ namespace NLGUI
}
// *************************************************
void CLuaObject::setValue(const char *key, sint32 value) throw(ELuaNotATable)
void CLuaObject::setValue(const char *key, sint32 value)
{
nlassert(key);
nlassert(isValid());
@ -422,7 +422,7 @@ namespace NLGUI
}
// *************************************************
void CLuaObject::setValue(const char *key, sint64 value) throw(ELuaNotATable)
void CLuaObject::setValue(const char *key, sint64 value)
{
nlassert(key);
nlassert(isValid());
@ -436,7 +436,7 @@ namespace NLGUI
}
// *************************************************
void CLuaObject::eraseValue(const char *key) throw(ELuaNotATable)
void CLuaObject::eraseValue(const char *key)
{
nlassert(isValid());
nlassert(key);

View file

@ -21,6 +21,7 @@
#include "nel/gui/widget_manager.h"
#include "nel/gui/interface_group.h"
#include "nel/gui/group_container_base.h"
#include "nel/gui/group_html.h"
using namespace std;
using namespace NLMISC;
@ -452,6 +453,18 @@ namespace NLGUI
// ----------------------------------------------------------------------------
void CViewBitmap::setTexture(const std::string & TxName)
{
if (TxName.find("://") != string::npos || TxName.find("//") == 0)
{
CGroupHTML *groupHtml = dynamic_cast<CGroupHTML*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:webig:content:html"));
if (groupHtml) {
string localname = groupHtml->localImageName(TxName);
if (!CFile::fileExists(localname))
localname = "web_del.tga";
_TextureId.setTexture (localname.c_str(), _TxtOffsetX, _TxtOffsetY, _TxtWidth, _TxtHeight, false);
groupHtml->addImageDownload(TxName, dynamic_cast<CViewBase*>(this));
}
}
else
_TextureId.setTexture (TxName.c_str (), _TxtOffsetX, _TxtOffsetY, _TxtWidth, _TxtHeight, false);
}

View file

@ -72,6 +72,8 @@ namespace NLGUI
_Shadow = false;
_ShadowOutline = false;
_ShadowColor = CRGBA(0,0,0,255);
_ShadowX = 1;
_ShadowY = 1;
_MultiLine = false;
_TextMode = DontClipWord;
@ -436,6 +438,22 @@ namespace NLGUI
return true;
}
else
if( name == "shadow_x" )
{
sint sx;
if( fromString( value, sx ) )
_ShadowX = sx;
return true;
}
else
if( name == "shadow_y" )
{
sint sy;
if( fromString( value, sy ) )
_ShadowY = sy;
return true;
}
else
if( name == "multi_line" )
{
bool b;
@ -616,6 +634,8 @@ namespace NLGUI
xmlSetProp( node, BAD_CAST "shadow", BAD_CAST toString( _Shadow ).c_str() );
xmlSetProp( node, BAD_CAST "shadow_outline", BAD_CAST toString( _ShadowOutline ).c_str() );
xmlSetProp( node, BAD_CAST "shadow_color", BAD_CAST toString( _ShadowColor ).c_str() );
xmlSetProp( node, BAD_CAST "shadow_x", BAD_CAST toString( _ShadowX ).c_str() );
xmlSetProp( node, BAD_CAST "shadow_y", BAD_CAST toString( _ShadowY ).c_str() );
xmlSetProp( node, BAD_CAST "multi_line", BAD_CAST toString( _MultiLine ).c_str() );
std::string just;
@ -727,6 +747,16 @@ namespace NLGUI
if (prop)
_ShadowColor = convertColor(prop);
prop= (char*) xmlGetProp( cur, (xmlChar*)"shadow_x" );
_ShadowX = 1;
if (prop)
fromString( (const char *)prop, _ShadowX);
prop= (char*) xmlGetProp( cur, (xmlChar*)"shadow_y" );
_ShadowY = 1;
if (prop)
fromString( (const char *)prop, _ShadowY);
prop = (char*) xmlGetProp( cur, (xmlChar*)"multi_line" );
_MultiLine = false;
if (prop)
@ -886,8 +916,8 @@ namespace NLGUI
return _LineMaxW;
else
{
sint parentWidth = std::min(_Parent->getMaxWReal(), _Parent->getWReal());
return std::min(parentWidth-(sint)(_XReal-_Parent->getXReal()), (sint)_LineMaxW);
sint offset = (sint)_XReal - (sint)_Parent->getXReal();
return std::min(_Parent->getInnerWidth() - offset, (sint)_LineMaxW);
}
}
@ -955,6 +985,19 @@ namespace NLGUI
((_YReal) > (ClipY+ClipH)) || ((_YReal+_HReal) < ClipY))
return;
// hack: allow shadow to overflow outside parent box.
// In CGroupHTML context, clip is set for row
if (std::abs(_ShadowX) > 0)
{
ClipX -= 3;
ClipW += 3;
}
if (std::abs(_ShadowY) > 0)
{
ClipY -= 3;
ClipH += 3;
}
// *** Screen Minimized?
uint32 w, h;
float oow, ooh;
@ -992,6 +1035,7 @@ namespace NLGUI
TextContext->setShaded (_Shadow);
TextContext->setShadeOutline (_ShadowOutline);
TextContext->setShadeColor (shcol);
TextContext->setShadeExtent (_ShadowX*oow, _ShadowY*ooh);
TextContext->setFontSize (_FontSize);
TextContext->setEmbolden (_Embolden);
TextContext->setOblique (_Oblique);
@ -1119,6 +1163,7 @@ namespace NLGUI
TextContext->setShaded (_Shadow);
TextContext->setShadeOutline (_ShadowOutline);
TextContext->setShadeColor (shcol);
TextContext->setShadeExtent (_ShadowX*oow, _ShadowY*ooh);
TextContext->setFontSize (_FontSize);
TextContext->setEmbolden (_Embolden);
TextContext->setOblique (_Oblique);
@ -1339,6 +1384,13 @@ namespace NLGUI
_ShadowColor = color;
}
// ***************************************************************************
void CViewText::setShadowOffset(sint32 x, sint32 y)
{
_ShadowX = x;
_ShadowY = y;
}
// ***************************************************************************
void CViewText::setLineMaxW (sint nMaxW, bool invalidate)
{

View file

@ -1356,10 +1356,14 @@ bool CBitmap::decompressDXT1(bool alpha)
{
for(k=0; k<4; k++)
{
dataTmp[m][pixelsCount + j*wtmp*4 + 4*k]= c[bits&3].R;
dataTmp[m][pixelsCount + j*wtmp*4 + 4*k+1]= c[bits&3].G;
dataTmp[m][pixelsCount + j*wtmp*4 + 4*k+2]= c[bits&3].B;
dataTmp[m][pixelsCount + j*wtmp*4 + 4*k+3]= c[bits&3].A;
uint32 index = pixelsCount + (j*wtmp+k)*4;
// incase input image does not have proper width/height
if (index+3 > mipMapSz) break;
dataTmp[m][index+0]= c[bits&3].R;
dataTmp[m][index+1]= c[bits&3].G;
dataTmp[m][index+2]= c[bits&3].B;
dataTmp[m][index+3]= c[bits&3].A;
bits>>=2;
}
}
@ -1466,10 +1470,14 @@ bool CBitmap::decompressDXT3()
{
for(k=0; k<4; k++)
{
dataTmp[m][pixelsCount + j*wtmp*4 + 4*k]= c[bits&3].R;
dataTmp[m][pixelsCount + j*wtmp*4 + 4*k+1]= c[bits&3].G;
dataTmp[m][pixelsCount + j*wtmp*4 + 4*k+2]= c[bits&3].B;
dataTmp[m][pixelsCount + j*wtmp*4 + 4*k+3]= alpha[4*j+k];
uint32 index = pixelsCount + (j*wtmp+k)*4;
// incase input image does not have proper width/height
if (index+3 > mipMapSz) break;
dataTmp[m][index+0]= c[bits&3].R;
dataTmp[m][index+1]= c[bits&3].G;
dataTmp[m][index+2]= c[bits&3].B;
dataTmp[m][index+3]= alpha[4*j+k];
bits>>=2;
}
}
@ -1602,10 +1610,14 @@ bool CBitmap::decompressDXT5()
{
for(k=0; k<4; k++)
{
dataTmp[m][pixelsCount + (j*wtmp+k)*4 +0]= c[bits&3].R;
dataTmp[m][pixelsCount + (j*wtmp+k)*4 +1]= c[bits&3].G;
dataTmp[m][pixelsCount + (j*wtmp+k)*4 +2]= c[bits&3].B;
dataTmp[m][pixelsCount + (j*wtmp+k)*4 +3]= (uint8) alpha[codeAlpha[4*j+k]];
uint32 index = pixelsCount + (j*wtmp+k)*4;
// incase input image does not have proper width/height
if (index+3 > mipMapSz) break;
dataTmp[m][index+0]= c[bits&3].R;
dataTmp[m][index+1]= c[bits&3].G;
dataTmp[m][index+2]= c[bits&3].B;
dataTmp[m][index+3]= (uint8) alpha[codeAlpha[4*j+k]];
bits>>=2;
}
}

View file

@ -49,7 +49,7 @@ void CClassRegistry::release()
}
// ======================================================================================================
IClassable *CClassRegistry::create(const string &className) throw(ERegistry)
IClassable *CClassRegistry::create(const string &className)
{
init();
@ -72,7 +72,7 @@ IClassable *CClassRegistry::create(const string &className) throw(ERegistry)
}
// ======================================================================================================
void CClassRegistry::registerClass(const string &className, IClassable* (*creator)(), const string &typeidCheck) throw(ERegistry)
void CClassRegistry::registerClass(const string &className, IClassable* (*creator)(), const string &typeidCheck)
{
init();

View file

@ -80,7 +80,7 @@ extern "C" long _ftol2( double dblSource ) { return _ftol( dblSource ); }
#endif // !NL_COMP_MINGW
#if defined(NL_HAS_SSE2) && !defined(NL_CPU_X86_64)
#ifdef NL_USE_ALIGNED_MEMORY_OPERATORS
#ifdef NL_NO_EXCEPTION_SPECS
void *operator new(size_t size)

View file

@ -401,7 +401,7 @@ bool CIFile::eof ()
}
// ======================================================================================================
void CIFile::serialBuffer(uint8 *buf, uint len) throw(EReadError)
void CIFile::serialBuffer(uint8 *buf, uint len)
{
if (len == 0)
return;
@ -444,7 +444,7 @@ void CIFile::serialBuffer(uint8 *buf, uint len) throw(EReadError)
}
// ======================================================================================================
void CIFile::serialBit(bool &bit) throw(EReadError)
void CIFile::serialBit(bool &bit)
{
// Simple for now.
uint8 v=bit;
@ -453,7 +453,7 @@ void CIFile::serialBit(bool &bit) throw(EReadError)
}
// ======================================================================================================
bool CIFile::seek (sint32 offset, IStream::TSeekOrigin origin) const throw(EStream)
bool CIFile::seek (sint32 offset, IStream::TSeekOrigin origin) const
{
if ((_CacheFileOnOpen) && (_Cache == NULL))
return false;
@ -485,7 +485,7 @@ bool CIFile::seek (sint32 offset, IStream::TSeekOrigin origin) const throw(EStr
}
// ======================================================================================================
sint32 CIFile::getPos () const throw(EStream)
sint32 CIFile::getPos () const
{
return _ReadPos;
}
@ -652,7 +652,7 @@ void COFile::flush()
// ======================================================================================================
void COFile::serialBuffer(uint8 *buf, uint len) throw(EWriteError)
void COFile::serialBuffer(uint8 *buf, uint len)
{
if(!_F)
throw EFileNotOpened(_FileName);
@ -667,14 +667,14 @@ void COFile::serialBuffer(uint8 *buf, uint len) throw(EWriteError)
}
}
// ======================================================================================================
void COFile::serialBit(bool &bit) throw(EWriteError)
void COFile::serialBit(bool &bit)
{
// Simple for now.
uint8 v=bit;
serialBuffer(&v, 1);
}
// ======================================================================================================
bool COFile::seek (sint32 offset, IStream::TSeekOrigin origin) const throw(EStream)
bool COFile::seek (sint32 offset, IStream::TSeekOrigin origin) const
{
if (_F)
{
@ -701,7 +701,7 @@ bool COFile::seek (sint32 offset, IStream::TSeekOrigin origin) const throw(EStr
return false;
}
// ======================================================================================================
sint32 COFile::getPos () const throw(EStream)
sint32 COFile::getPos () const
{
if (_F)
{

View file

@ -107,7 +107,7 @@ void CMemStream::serialBit(bool &bit)
* (to prevent from an "inside serial" to increment it).
* Then a seek(end) would get back to the pointer.
*/
bool CMemStream::seek (sint32 offset, TSeekOrigin origin) const throw(EStream)
bool CMemStream::seek (sint32 offset, TSeekOrigin origin) const
{
switch (origin)
{

View file

@ -211,7 +211,7 @@ void CStaticStringMapper::clear()
}
// ****************************************************************************
void CStaticStringMapper::serial(IStream &f, TSStringId &strId) throw(EStream)
void CStaticStringMapper::serial(IStream &f, TSStringId &strId)
{
std::string tmp;
if (f.isReading())
@ -227,7 +227,7 @@ void CStaticStringMapper::serial(IStream &f, TSStringId &strId) throw(EStream)
}
// ****************************************************************************
void CStaticStringMapper::serial(IStream &f, std::vector<TSStringId> &strIdVect) throw(EStream)
void CStaticStringMapper::serial(IStream &f, std::vector<TSStringId> &strIdVect)
{
std::vector<std::string> vsTmp;
std::string sTmp;

View file

@ -1470,9 +1470,9 @@ uint64 CSystemInfo::availableHDSpace (const string &filename)
uint64 CSystemInfo::availablePhysicalMemory ()
{
#ifdef NL_OS_WINDOWS
MEMORYSTATUS ms;
GlobalMemoryStatus (&ms);
return uint64(ms.dwAvailPhys);
MEMORYSTATUSEX ms;
GlobalMemoryStatusEx(&ms);
return ms.ullAvailPhys;
#elif defined NL_OS_MAC
return uint64(getsysctlnum64("hw.usermem"));
#elif defined NL_OS_UNIX
@ -1485,9 +1485,9 @@ uint64 CSystemInfo::availablePhysicalMemory ()
uint64 CSystemInfo::totalPhysicalMemory ()
{
#ifdef NL_OS_WINDOWS
MEMORYSTATUS ms;
GlobalMemoryStatus (&ms);
return uint64(ms.dwTotalPhys);
MEMORYSTATUSEX ms;
GlobalMemoryStatusEx(&ms);
return ms.ullTotalPhys;
#elif defined NL_OS_MAC
return uint64(getsysctlnum64("hw.physmem"));
#elif defined NL_OS_UNIX
@ -1867,9 +1867,9 @@ bool CSystemInfo::getVideoInfo (std::string &deviceName, uint64 &driverVersion)
uint64 CSystemInfo::virtualMemory ()
{
#ifdef NL_OS_WINDOWS
MEMORYSTATUS ms;
GlobalMemoryStatus (&ms);
return uint64(ms.dwTotalVirtual - ms.dwAvailVirtual);
MEMORYSTATUSEX ms;
GlobalMemoryStatusEx(&ms);
return ms.ullTotalVirtual - ms.ullAvailVirtual;
#else
return 0;
#endif

View file

@ -397,7 +397,7 @@ namespace NLNET
}
void CModuleBase::plugModule(IModuleSocket *moduleSocket) throw (EModuleAlreadyPluggedHere)
void CModuleBase::plugModule(IModuleSocket *moduleSocket)
{
CModuleSocket *sock = dynamic_cast<CModuleSocket*>(moduleSocket);
nlassert(sock != NULL);
@ -415,7 +415,7 @@ namespace NLNET
_ModuleSockets.insert(moduleSocket);
}
void CModuleBase::unplugModule(IModuleSocket *moduleSocket) throw (EModuleNotPluggedHere)
void CModuleBase::unplugModule(IModuleSocket *moduleSocket)
{
CModuleSocket *sock = dynamic_cast<CModuleSocket*>(moduleSocket);
nlassert(sock != NULL);
@ -443,7 +443,7 @@ namespace NLNET
* The call is blocking until receptions of the operation
* result message (or a module down)
*/
void CModuleBase::invokeModuleOperation(IModuleProxy *destModule, const NLNET::CMessage &opMsg, NLNET::CMessage &resultMsg) throw (EInvokeFailed)
void CModuleBase::invokeModuleOperation(IModuleProxy *destModule, const NLNET::CMessage &opMsg, NLNET::CMessage &resultMsg)
{
H_AUTO(CModuleBase_invokeModuleOperation);
@ -867,7 +867,6 @@ namespace NLNET
}
void CModuleProxy::sendModuleMessage(IModule *senderModule, const NLNET::CMessage &message)
throw (EModuleNotReachable)
{
H_AUTO(CModuleProxy_sendModuleMessage);

View file

@ -448,7 +448,6 @@ namespace NLNET
/// Activate/stop firewalling mode on a transport
virtual void setTransportFirewallMode(const std::string &transportInstanceName, bool firewalled)
throw (EGatewayFirewallBreak)
{
TTransportList::iterator it(_Transports.find(transportInstanceName));
if (it == _Transports.end())
@ -1246,7 +1245,6 @@ namespace NLNET
}
virtual void discloseModule(IModuleProxy *moduleProxy)
throw (EGatewayNotConnected)
{
nlassert(moduleProxy->getModuleGateway() == this);
@ -1561,7 +1559,6 @@ namespace NLNET
}
void _sendModuleMessage(IModule *senderModule, TModuleId destModuleProxyId, const NLNET::CMessage &message)
throw (EModuleNotReachable, EModuleNotPluggedHere)
{
// the socket implementation already checked that the module is plugged here
// just check that the destination module effectively from here
@ -1585,7 +1582,6 @@ namespace NLNET
}
virtual void _broadcastModuleMessage(IModule *senderModule, const NLNET::CMessage &message)
throw (EModuleNotPluggedHere)
{
H_AUTO(CModuleGetaway__broadcastModuleMessage);
// send the message to all proxies (except the sender module)

View file

@ -184,13 +184,13 @@ namespace NLNET
}
}
void onCommand(const CMessage &/* command */) throw (EInvalidCommand)
void onCommand(const CMessage &/* command */)
{
// nothing done for now
throw EInvalidCommand();
}
/// The gateway send a textual command to the transport
bool onCommand(const TParsedCommandLine &command) throw (EInvalidCommand)
bool onCommand(const TParsedCommandLine &command)
{
if (command.SubParams.size() < 1)
throw EInvalidCommand();
@ -218,7 +218,7 @@ namespace NLNET
}
/// Open the server by starting listing for incoming connection on the specified port
void openServer(uint16 port) throw (ETransportError)
void openServer(uint16 port)
{
if (_CallbackServer.get() != NULL)
throw ETransportError("openServer : The server is already open");
@ -607,13 +607,13 @@ namespace NLNET
}
}
void onCommand(const CMessage &/* command */) throw (EInvalidCommand)
void onCommand(const CMessage &/* command */)
{
// nothing done for now
throw EInvalidCommand();
}
/// The gateway send a textual command to the transport
bool onCommand(const TParsedCommandLine &command) throw (EInvalidCommand)
bool onCommand(const TParsedCommandLine &command)
{
if (command.SubParams.size() < 1)
throw EInvalidCommand();

View file

@ -218,13 +218,13 @@ namespace NLNET
}
}
void onCommand(const CMessage &/* command */) throw (EInvalidCommand)
void onCommand(const CMessage &/* command */)
{
// nothing done for now
throw EInvalidCommand();
}
/// The gateway send a textual command to the transport
bool onCommand(const TParsedCommandLine &command) throw (EInvalidCommand)
bool onCommand(const TParsedCommandLine &command)
{
if (command.SubParams.size() < 1)
throw EInvalidCommand();
@ -255,7 +255,7 @@ namespace NLNET
/// Open the server by establishing route with all known services
void open(const std::string &subNetName) throw (ETransportError)
void open(const std::string &subNetName)
{
H_AUTO(L5_open);

View file

@ -102,7 +102,6 @@ namespace NLNET
/// Activate/stop firewalling mode on a transport
virtual void setTransportFirewallMode(const std::string &/* transportInstanceName */, bool /* firewalled */)
throw (EGatewayFirewallBreak)
{
// unsupported
nlstop;
@ -174,12 +173,10 @@ namespace NLNET
// return;
// }
// virtual void openGatewayServer(uint16 listeningPort)
// throw (EGatewayAlreadyOpen, EGatewayPortInUse)
// {
// nlstop;
// }
// virtual void closeGatewayServer()
// throw (EGatewayNotOpen)
// {
// nlstop;
// }
@ -233,7 +230,6 @@ namespace NLNET
{
}
virtual void discloseModule(IModuleProxy *moduleProxy)
throw (EGatewayNotConnected)
{
// check that the module is plugged here
nlassert(_ModuleProxies.getB(moduleProxy) != NULL);
@ -365,7 +361,6 @@ namespace NLNET
}
void _sendModuleMessage(IModule *senderModule, TModuleId destModuleProxyId, const NLNET::CMessage &message)
throw (EModuleNotReachable, EModuleNotPluggedHere)
{
TModuleProxies::TAToBMap::const_iterator first(_ModuleProxies.getAToBMap().begin()), last(_ModuleProxies.getAToBMap().end());
for (; first != last && first->first->getModuleProxyId() != destModuleProxyId; ++first) {}
@ -373,7 +368,6 @@ namespace NLNET
throw EModuleNotReachable();
}
virtual void _broadcastModuleMessage(IModule * /* senderModule */, const NLNET::CMessage &/* message */)
throw (EModuleNotPluggedHere)
{
nlstop;
}

View file

@ -86,7 +86,6 @@ namespace NLNET
}
void CModuleSocket::sendModuleMessage(IModule *senderModule, TModuleId destModuleProxyId, const NLNET::CMessage &message)
throw (EModuleNotPluggedHere)
{
TPluggedModules::TBToAMap::const_iterator it(_PluggedModules.getBToAMap().find(senderModule));
if (it == _PluggedModules.getBToAMap().end())
@ -100,7 +99,6 @@ namespace NLNET
}
void CModuleSocket::broadcastModuleMessage(IModule *senderModule, const NLNET::CMessage &message)
throw (EModuleNotPluggedHere)
{
TPluggedModules::TBToAMap::const_iterator it(_PluggedModules.getBToAMap().find(senderModule));
if (it == _PluggedModules.getBToAMap().end())

View file

@ -357,7 +357,7 @@ void CParticleWorkspace::setName(const std::string &name)
//***********************************************************************************************
CParticleWorkspace::CNode *CParticleWorkspace::addNode(const std::string &filenameWithFullPath) throw( NLMISC::EStream)
CParticleWorkspace::CNode *CParticleWorkspace::addNode(const std::string &filenameWithFullPath)
{
nlassert(_OV);
// Check that file is not already inserted

View file

@ -186,7 +186,7 @@ public:
*
* \return pointer to new node, or NULL if already inserted
*/
CNode *addNode(const std::string &filenameWithFullPath) throw( NLMISC::Exception);
CNode *addNode(const std::string &filenameWithFullPath);
// remove a node by its index
void removeNode(uint index);
// remove a node by its pointer

View file

@ -671,7 +671,7 @@ bool NLPACS::CComputableSurface::checkConsistency()
CComputableSurfaceBorder& border = (*BorderKeeper)[BorderIds[i]];
for (j=0; j+1<border.Vertices.size(); ++j)
edges.push_back(std::make_pair<NLMISC::CVectorD, NLMISC::CVectorD>(border.Vertices[j], border.Vertices[j+1]));
edges.push_back(std::make_pair(border.Vertices[j], border.Vertices[j+1]));
}
for (i=0; i+1<edges.size(); ++i)

9
code/personal/README.md Normal file
View file

@ -0,0 +1,9 @@
cmake option to include CMakeLists.txt from this directory is `-DWITH_PERSONAL=ON`
Example:
```
ADD_SUBDIRECTORY(example)
```

View file

@ -56,6 +56,11 @@ LoginSupportURL = "https://www.khaganat.net/irc";
ConditionsTermsURL = "khaganat.net/wikhan/fr:charte";
// Full path and filename where cURL can find certificate bundle file
// cacert.pem file can be downloaded from https://curl.haxx.se/docs/caextract.html
// and added to client data path or system specific bundle can be used
// Ubuntu has "/etc/ssl/certs/ca-certificates.crt"
//CurlCABundle = "cacert.pem";
////////////////
// INTERFACES //
@ -326,6 +331,10 @@ CameraSpeedMin = 2.0;
CameraSpeedMax = 100.0;
CameraResetSpeed = 10.0; // Speed in radian/s
// Default values for map
MaxMapScale = 2.0;
R2EDMaxMapScale = 8.0;
//////////////////
// SOUND CONFIG //
//////////////////

View file

@ -436,6 +436,9 @@
<variable entry="UI:TEMP:GUILD:BACK:NAME"
type="sint64"
value="0" />
<variable entry="UI:VARIABLES:GUILD_COST" type="sint32"
value="100000" />
<!-- INIT FLAGS CREATION PARAMS -->
<proc id="init_guild_creation">
<action handler="set"
@ -466,7 +469,7 @@
<group id="bot_chat_create_guild"
style="bot_chat_window"
posref="BL TL"
w="254"
w="400"
x="352"
y="200"
active="false"
@ -488,7 +491,7 @@
h="16"
posref="TL TL"></group>
<group id="content"
w="246"
w="398"
child_resize_h="true"
child_resize_hmargin="4"
x="0"
@ -498,40 +501,19 @@
<instance template="bc_border_text"
id="intro"
w="0"
y="-4"
text_id="SERVER:BOTCHAT:CREATE_GUILD" />
<!-- GUILD ICON -->
<ctrl type="sheet"
id="blason"
posref="BL TL"
x="0"
y="-16"
posparent="intro"
nature="guild_flag"
value="UI:TEMP:GUILD_CREATION"
dragable="false"
color="255 255 255 255" />
<view type="text"
id="guild_blason"
posref="TL BL"
posparent="blason"
x="0"
y="0"
color="255 255 255 255"
fontsize="10"
shadow="true"
hardtext="uiGuildBlason" />
text_id="SERVER:BOTCHAT:CREATE_GUILD" />
<!-- NAME OF GUILD -->
<instance template="edit_box_widget"
id="edit"
posparent="blason"
posref="MR ML"
x="4"
w="200"
y="0"
h="20"
posparent="intro"
posref="TL TL"
x="0"
w="380"
y="-24"
h="12"
text_x="0"
text_y="-1"
text_y="0"
text_ref="ML ML"
fontsize="12"
prompt=""
@ -543,13 +525,15 @@
enter_recover_focus="false"
reset_focus_on_hide="true"
max_historic="0"
title="uiGuildNameWarning"
tooltip="uiGuildNameWarning"
entry_type="text" />
<view type="text"
id="guild_name"
posparent="edit"
posref="TL BL"
x="0"
y="5"
y="0"
color="255 255 255 255"
fontsize="10"
shadow="true"
@ -558,11 +542,15 @@
<instance template="edit_box_widget"
id="desc"
posref="BL TL"
multi_line="true"
max_num_chars="200"
y="-24"
posparent="blason"
posparent="edit"
child_resize_h="true"
w="238"
onenter="" />
w="380"
onenter=""
title="uiGuildDescWarning"
tooltip="uiGuildDescWarning" />
<view type="text"
id="guild_desc"
posparent="desc"
@ -578,10 +566,32 @@
id="back"
posparent="desc"
posref="BM TM"
w="180"
h="77"
w="300"
h="120"
x="0"
y="-24" />
<!-- GUILD ICON -->
<ctrl type="sheet"
id="blason"
posref="TL TL"
x="5"
y="-18"
posparent="back"
nature="guild_flag"
value="UI:TEMP:GUILD_CREATION"
dragable="false"
color="255 255 255 255" />
<view type="text"
id="guild_blason"
posref="TL BL"
posparent="blason"
x="0"
y="0"
color="255 255 255 255"
fontsize="10"
shadow="true"
hardtext="uiGuildBlason" />
<!-- GUILD ICON Desinger -->
<view type="text"
id="guild_blason_design"
posref="TL BL"
@ -595,7 +605,7 @@
<ctrl type="sheet"
id="back_layer"
posref="TL TL"
x="4"
x="100"
y="-18"
posparent="back"
nature="guild_flag"
@ -603,13 +613,6 @@
global_color="false"
onclick_l="enter_modal"
params_l="group=ui:interface:guild_flag_back" />
<view type="bitmap"
id="fore_sheet"
posparent="back_layer"
posref="TR TL"
x="4"
y="0"
texture="W_slot_blason.tga" />
<view type="text"
id="blason_back"
posref="TL BL"
@ -623,9 +626,9 @@
<view type="text"
id="blason_fore"
posref="TL BL"
posparent="fore_sheet"
x="0"
y="0"
posparent="back"
x="100"
y="-80"
color="255 255 255 255"
fontsize="10"
shadow="true"
@ -633,8 +636,9 @@
<ctrl type="button"
button_type="push_button"
id="fore_flag"
posparent="fore_sheet"
posparent="blason_fore"
posref="TL TL"
y="-16"
tx_normal="W_slot_blason_over.tga"
tx_over="W_slot_blason_over.tga"
tx_pushed="W_slot_blason_over.tga"
@ -648,9 +652,9 @@
id="fore_layer"
posref="TL TL"
x="1"
y="-1"
y="-16"
render_layer="5"
posparent="fore_sheet"
posparent="blason_fore"
texture="Guild_Symbol_S_08.tga"
scale="true"
w="32"
@ -663,7 +667,7 @@
tooltip="uiGuildBlasonColor1"
posref="TL TL"
posparent="back"
x="80"
x="150"
y="-19" />
<instance template="tgcw_color2"
id="col_2"
@ -678,21 +682,29 @@
id="negative"
text="uiNegativeSymbol"
posparent="back"
posref="BM BM"
x="0"
y="4" />
posref="BL BL"
x="150"
y="15" />
<group id="pipo"
w="238"
w="390"
h="8"
x="0"
y="0"
posparent="back"
posref="BM TM" />
<instance template="argent"
id="GuildCreatMoney"
posparent="pipo"
posref="BL TL"
x="5"
y="-14"
tooltip="uiGuildCostInfo"
value="UI:VARIABLES:GUILD_COST" />
<instance template="button_ok_cancel"
posparent="pipo"
posref="BR TR"
x="-4"
y="-4"
y="-14"
ok_text="uiBotCreateGuild"
onclick_ok="enter_guild_creation"
onclick_ok_param="guild=ui:interface:bot_chat_create_guild:content:edit:eb|icon=ui:interface:bot_chat_create_guild:content:blason|desc=ui:interface:bot_chat_create_guild:content:desc:eb"

View file

@ -122,6 +122,9 @@
<command name="loot" action="inv_temp_all" params="" />
<command name="mapsearch" action="proc" params="map_search_show_set|+" />
<command name="mapsearch" action="proc" params="map_search_show" />
<!-- WebIG -->
<command name="go" action="browse" params="name=ui:interface:webig:content:html|url=home"/>
<command name="webdev" action="browse" params="name=ui:interface:webig:content:html|url=http://localhost/index.html"/>

View file

@ -97,7 +97,6 @@
<action id="pa_free" name="uimGcmFree" handler="beast_order" params="order=free|beast_index=@UI:GCM_BEAST_SELECTED"/>
<action id="pa_enter_stable" name="uimGcmEnterStable" handler="beast_order" params="order=enter_stable|beast_index=@UI:GCM_BEAST_SELECTED"/>
<action id="extract_rm" name="uimGcmExtractRM" handler="context_extract_rm" params="" />
<action id="quit_team" name="uimGcmQuitTeam" handler="context_quit_team" params="" />
<action id="info" name="uimGcmInfo" handler="open_title_help" params="from=target" />
<action id="build_totem" name="uimGcmChooseBuilding" handler="build_totem" params="" />
@ -107,6 +106,9 @@
<action id="move" name="uimGcmMove" handler="context_move" params="" />
<action id="stop" name="uimGcmStopMove" handler="context_stop" params="" />
<action id="unseat" name="uimUnmount" handler="beast_order" params="order=unmount|beast_index=0" />
<separator/>
<action id="quit_team" name="uimGcmQuitTeam" handler="context_quit_team" params="" />
</group>
<!-- TEMPORARY FOR TESTS -->

View file

@ -63,7 +63,7 @@
</template>
<template name="edit_box_log" posref="TL TL" text_x="0" text_y="-1" text_ref="BL BL" multi_line="false" x="0" y="0" w="0" h="0"
<template name="edit_box_log" posref="TL TL" text_x="0" text_y="0" text_ref="BL BL" multi_line="false" x="0" y="0" w="0" h="0"
id="eb" posparent="parent" onenter="chat_box_entry" params="" reset_focus_on_hide="true" on_focus="" on_focus_params=""
enter_loose_focus="true" prompt="&gt;"
enter_recover_focus="true"
@ -75,6 +75,11 @@
keep="true"
max_historic="0"
fontsize="10"
shadow="true"
shadow_x="1"
shadow_y="1"
shadow_color="0 0 0 255"
shadow_outline="false"
backup_father_container_pos="false"
want_return="false"
color="255 255 255 255"
@ -93,14 +98,14 @@
<view type="bitmap" id="r" texture="log_eb_r.tga" posref="MR MR" scale="true" sizeref="h" h="-16" w="8" />
<group type="edit_box" sizeref="wh" w="-8" h="-8" id="eb" posref="MM MM" on_focus="#on_focus" on_focus_params="#on_focus_params" onenter="#onenter" params="#params" onchange="#onchange" onchange_params="#onchange_params" max_num_chars="#max_num_chars" prompt="#prompt" enter_loose_focus="#enter_loose_focus" enter_recover_focus="#enter_recover_focus" entry_type="#entry_type" reset_focus_on_hide="#reset_focus_on_hide" menu_r="#menu_r" max_historic="#max_historic" want_return="#want_return" backup_father_container_pos="#backup_father_container_pos">
<view id="edit_text" type="text" x="#text_x" y="#text_y" posref="#text_ref" multi_line="#multi_line" multi_line_space="0" fontsize="#fontsize" color="#color" shadow="true" hardtext="" global_color="false"/>
<view id="edit_text" type="text" x="#text_x" y="#text_y" posref="#text_ref" multi_line="#multi_line" multi_line_space="0" fontsize="#fontsize" color="#color" shadow="#shadow" shadow_x="#shadow_x" shadow_y="#shadow_y" shadow_color="#shadow_color" shadow_outline="#shadow_outline" hardtext="" global_color="false"/>
</group>
</group>
</template>
<template name="edit_box_widget_multiline" posref="TL TL" text_x="0" text_y="-1" text_ref="BL BL" child_resize_h="true" multi_line="true" x="0" y="0" w="0" h="0"
<template name="edit_box_widget_multiline" posref="TL TL" text_x="0" text_y="0" text_ref="BL BL" child_resize_h="true" multi_line="true" x="0" y="0" w="0" h="0"
sizeref="" id="eb" posparent="parent" onenter="chat_box_entry" params="" reset_focus_on_hide="true"
enter_loose_focus="true" prompt="&gt;"
enter_recover_focus="true"
@ -112,16 +117,24 @@
keep="true"
max_historic="40"
fontsize="10"
fontweight=""
fontstyle=""
shadow="true"
shadow_x="1"
shadow_y="1"
shadow_color="0 0 0 255"
shadow_outline="false"
backup_father_container_pos="false"
want_return="false"
color="255 255 255 255"
sizeref_eb="w"
render_layer="0"
multi_min_line="0"
>
<group id="#id" posref="#posref" x="#x" y="#y" posparent="#posparent" child_resize_h="#child_resize_h" sizeref="#sizeref" w="#w" h="#h" render_layer="#render_layer">
<group type="edit_box" sizeref="#sizeref_eb" w="-16" id="eb" posref="TL TL" x="8" y="-8" child_resize_h="#child_resize_h" onenter="#onenter" params="#params" onchange="#onchange" onchange_params="#onchange_params" max_num_chars="#max_num_chars" prompt="#prompt" enter_loose_focus="#enter_loose_focus" enter_recover_focus="#enter_recover_focus" entry_type="#entry_type" reset_focus_on_hide="#reset_focus_on_hide" menu_r="#menu_r" max_historic="#max_historic" want_return="#want_return" backup_father_container_pos="#backup_father_container_pos" render_layer="#render_layer">
<view type="bitmap" id="bg" scale="true" sizeref="hw" h="0" w="0" texture="log_eb_m.tga" inherit_gc_alpha="false" render_layer="#render_layer"/>
<view id="edit_text" type="text" x="#text_x" y="#text_y" posref="#text_ref" multi_line="#multi_line" multi_line_space="0" fontsize="#fontsize" color="#color" shadow="true" hardtext="" global_color="false" render_layer="#render_layer"/>
<view id="edit_text" type="text" x="#text_x" y="#text_y" posref="#text_ref" multi_line="#multi_line" multi_line_space="0" multi_min_line="#multi_min_line" fontsize="#fontsize" color="#color" fontweight="#fontweight" fontstyle="#fontstyle" shadow="#shadow" shadow_x="#shadow_x" shadow_y="#shadow_y" shadow_color="#shadow_color" shadow_outline="#shadow_outline" hardtext="" global_color="false" render_layer="#render_layer"/>
</group>
<!-- border around the list -->
@ -138,7 +151,7 @@
<!-- Alternate look for multi line input -->
<template name="edit_box_widget_multiline_2" posref="TL TL" text_x="0" text_y="-1" text_ref="BL BL" child_resize_h="true" multi_line="true" x="0" y="0" w="0" h="0"
<template name="edit_box_widget_multiline_2" posref="TL TL" text_x="0" text_y="0" text_ref="BL BL" child_resize_h="true" multi_line="true" x="0" y="0" w="0" h="0"
sizeref="" id="eb" posparent="parent" onenter="chat_box_entry" params="" reset_focus_on_hide="true"
enter_loose_focus="true" prompt="&gt;"
enter_recover_focus="true"
@ -150,6 +163,11 @@
keep="true"
max_historic="40"
fontsize="10"
shadow="true"
shadow_x="1"
shadow_y="1"
shadow_color="0 0 0 255"
shadow_outline="false"
backup_father_container_pos="false"
want_return="false"
color="255 255 255 255"
@ -159,7 +177,7 @@
<group id="#id" posref="#posref" x="#x" y="#y" posparent="#posparent" child_resize_h="#child_resize_h" sizeref="#sizeref" w="#w" h="#h" render_layer="#render_layer">
<group type="edit_box" sizeref="#sizeref_eb" w="-8" id="eb" posref="TL TL" x="4" y="-4" child_resize_h="#child_resize_h" onenter="#onenter" params="#params" onchange="#onchange" onchange_params="#onchange_params" max_num_chars="#max_num_chars" prompt="#prompt" enter_loose_focus="#enter_loose_focus" enter_recover_focus="#enter_recover_focus" entry_type="#entry_type" reset_focus_on_hide="#reset_focus_on_hide" menu_r="#menu_r" max_historic="#max_historic" want_return="#want_return" backup_father_container_pos="#backup_father_container_pos" render_layer="#render_layer">
<view type="bitmap" id="bg" scale="true" sizeref="hw" h="0" w="0" texture="W_box_blank.tga" inherit_gc_alpha="true" render_layer="#render_layer"/>
<view id="edit_text" type="text" x="#text_x" y="#text_y" posref="#text_ref" multi_line="#multi_line" multi_line_space="0" fontsize="#fontsize" color="#color" shadow="true" hardtext="" global_color="false" render_layer="#render_layer"/>
<view id="edit_text" type="text" x="#text_x" y="#text_y" posref="#text_ref" multi_line="#multi_line" multi_line_space="0" fontsize="#fontsize" color="#color" shadow="#shadow" shadow_x="#shadow_x" shadow_y="#shadow_y" shadow_color="#shadow_color" shadow_outline="#shadow_outline" hardtext="" global_color="false" render_layer="#render_layer"/>
</group>
<!-- border around the list -->
@ -179,7 +197,7 @@
<style style="log_button" type="text_button" button_type="push_button"
tx_normal="log_but" tx_pushed="log_but_over" tx_over="log_but_over" wmargin="48"
color="255 255 255 255" col_over="255 255 255 255" col_pushed="255 255 255 255"
text_y="-3" fontsize="10" shadow="true"
text_y="0" fontsize="10" shadow="true"
text_color_normal="255 255 255 160"
text_color_pushed="255 255 255 255"
text_color_over="255 255 255 255"
@ -192,10 +210,10 @@
<style style="log_std_but" type="text_button" button_type="push_button"
tx_normal="but" tx_pushed="but" tx_over="but_over" wmargin="16"
color="255 255 255 160" col_over="255 255 255 255" col_pushed="255 255 255 255"
text_y="-3" fontsize="10" shadow="true"
text_color_normal="255 254 243 160"
text_color_pushed="255 254 243 255"
text_color_over="255 254 243 255"
text_y="-1" fontsize="10" shadow="true"
text_color_normal="135 243 28 160"
text_color_pushed="135 243 28 255"
text_color_over="135 243 28 255"
text_shadow_color_normal="0 0 0 255"
text_shadow_color_pushed="0 0 0 255"
text_shadow_color_over="0 0 0 255"
@ -205,9 +223,9 @@
tx_normal="but" tx_pushed="but" tx_over="but_over" wmargin="16" wmin="552"
color="255 255 255 160" col_over="255 255 255 255" col_pushed="255 255 255 255"
text_y="-3" fontsize="10" shadow="true"
text_color_normal="255 254 243 160"
text_color_pushed="255 254 243 255"
text_color_over="255 254 243 255"
text_color_normal="135 243 28 160"
text_color_pushed="135 243 28 255"
text_color_over="135 243 28 255"
text_shadow_color_normal="0 0 0 255"
text_shadow_color_pushed="0 0 0 255"
text_shadow_color_over="0 0 0 255"
@ -218,9 +236,9 @@
tx_normal="serv_note" tx_pushed="serv_note" tx_over="serv_note_over" wmargin="16"
color="255 255 255 160" col_over="255 255 255 255" col_pushed="255 255 255 255"
text_y="-3" fontsize="10" shadow="true"
text_color_normal="255 254 243 160"
text_color_pushed="255 254 243 255"
text_color_over="255 254 243 255"
text_color_normal="135 243 28 160"
text_color_pushed="135 243 28 255"
text_color_over="135 243 28 255"
text_shadow_color_normal="0 0 0 255"
text_shadow_color_pushed="0 0 0 255"
text_shadow_color_over="0 0 0 255"
@ -229,7 +247,7 @@
<style style="text_button_16" type="text_button" button_type="push_button"
tx_normal="w_text_button_normal" tx_pushed="w_text_button_pushed" tx_over="w_text_button_over"
global_color_normal="true" global_color_over="true" global_color_pushed="true"
text_y="-2" fontsize="10" shadow="true" case_mode="%case_upper" wmargin="8"
text_y="0" fontsize="10" shadow="true" case_mode="%case_upper" wmargin="8"
text_color_normal="255 255 255 128" text_color_pushed="255 255 255 255" text_color_over="255 255 255 255" />
@ -241,7 +259,7 @@
<instance template="log_box_frame" id="bk" posref="MM MM" sizeref="wh" w="0" h="0" />
<view type="text" id="text" posref="MM MM" line_maxw="420" w="420" x="0" y="12"
color="255 254 243 255" fontsize="12" shadow="true" multi_line="true" multi_line_space="0" case_mode="%case_first_sentence_letter_up"/>
color="135 243 28 255" fontsize="12" shadow="true" multi_line="true" multi_line_space="0" case_mode="%case_first_sentence_letter_up"/>
<ctrl style="log_std_but" id="but_ok" posparent="text" posref="BM TM" y="-6" onclick_l="leave_modal" hardtext="uittOK"/>
@ -276,7 +294,7 @@
<instance template="log_box_frame" id="bk" posref="MM MM" sizeref="wh" w="0" h="0" />
<view type="text" id="text" posref="MM MM" line_maxw="420" w="420" x="0" y="12"
color="255 254 243 255" fontsize="12" shadow="true" multi_line="true" multi_line_space="0" case_mode="%case_first_sentence_letter_up"/>
color="135 243 28 255" fontsize="12" shadow="true" multi_line="true" multi_line_space="0" case_mode="%case_first_sentence_letter_up"/>
<ctrl style="log_std_but" id="but_ok" posparent="text" posref="BM TL" x="2" y="-6" onclick_l="proc" params_l="proc_message_box_with_help_ok" hardtext="uittOK"/>
<ctrl style="log_std_but" id="but_help" posparent="text" posref="BM TR" x="-2" y="-6" onclick_l="proc" params_l="proc_browse_faq" hardtext="uittBrowseFaq"/>
@ -382,7 +400,7 @@
<!-- * EDIT BOX WIDGET * -->
<!-- ********************* -->
<template name="edit_box_widget" posref="TL TL" text_x="0" text_y="-1" text_ref="BL BL" child_resize_h="true" multi_line="false" x="0" y="0" w="0" h="0"
<template name="edit_box_widget" posref="TL TL" text_x="0" text_y="0" text_ref="BL BL" child_resize_h="true" multi_line="false" x="0" y="0" w="0" h="0"
sizeref="" id="eb" posparent="parent" onenter="chat_box_entry" params="" reset_focus_on_hide="true"
enter_loose_focus="true" prompt="&gt;"
enter_recover_focus="true"
@ -394,6 +412,11 @@
keep="true"
max_historic="40"
fontsize="10"
shadow="true"
shadow_x="1"
shadow_y="1"
shadow_color="0 0 0 255"
shadow_outline="false"
backup_father_container_pos="false"
want_return="false"
color="255 255 255 255"
@ -404,7 +427,7 @@
<group type="edit_box" sizeref="#sizeref_eb" w="-16" id="eb" posref="TL TL" x="8" y="-8" child_resize_h="#child_resize_h" onenter="#onenter" params="#params" onchange="#onchange" onchange_params="#onchange_params" max_num_chars="#max_num_chars" prompt="#prompt" enter_loose_focus="#enter_loose_focus" enter_recover_focus="#enter_recover_focus" entry_type="#entry_type" reset_focus_on_hide="#reset_focus_on_hide" menu_r="#menu_r" max_historic="#max_historic" want_return="#want_return" backup_father_container_pos="#backup_father_container_pos" render_layer="#render_layer">
<view type="bitmap" id="bg" scale="true" sizeref="hw" h="0" w="0" texture="log_eb_m.tga" inherit_gc_alpha="false" render_layer="#render_layer"/>
<view id="edit_text" type="text" x="#text_x" y="#text_y" posref="#text_ref" multi_line="#multi_line" multi_line_space="0" fontsize="#fontsize" color="#color" shadow="true" hardtext="" global_color="false" render_layer="#render_layer"/>
<view id="edit_text" type="text" x="#text_x" y="#text_y" posref="#text_ref" multi_line="#multi_line" multi_line_space="0" fontsize="#fontsize" color="#color" shadow="#shadow" shadow_x="#shadow_x" shadow_y="#shadow_y" shadow_color="#shadow_color" shadow_outline="#shadow_outline" hardtext="" global_color="false" render_layer="#render_layer"/>
</group>
<!-- border around the list -->
@ -420,7 +443,7 @@
</template>
<!-- alternate look for edit box -->
<template name="edit_box_widget_2" posref="TL TL" text_x="0" text_y="-1" text_ref="BL BL" child_resize_h="true" multi_line="false" x="0" y="0" w="0" h="0"
<template name="edit_box_widget_2" posref="TL TL" text_x="0" text_y="0" text_ref="BL BL" child_resize_h="true" multi_line="false" x="0" y="0" w="0" h="0"
sizeref="" id="eb" posparent="parent" onenter="chat_box_entry" params="" reset_focus_on_hide="true"
enter_loose_focus="true" prompt="&gt;"
enter_recover_focus="true"
@ -432,6 +455,11 @@
keep="true"
max_historic="40"
fontsize="10"
shadow="true"
shadow_x="1"
shadow_y="1"
shadow_color="0 0 0 255"
shadow_outline="false"
backup_father_container_pos="false"
want_return="false"
color="255 255 255 255"
@ -441,7 +469,7 @@
<view type="bitmap" id="bg" scale="true" sizeref="hw" h="0" w="0" texture="blank.tga" color="255 255 255 0" />
<view id="edit_text" type="text" x="#text_x" y="#text_y" posref="#text_ref" multi_line="#multi_line" multi_line_space="0" fontsize="#fontsize" color="#color" shadow="true" hardtext="" global_color="false"/>
<view id="edit_text" type="text" x="#text_x" y="#text_y" posref="#text_ref" multi_line="#multi_line" multi_line_space="0" fontsize="#fontsize" color="#color" shadow="#shadow" shadow_x="#shadow_x" shadow_y="#shadow_y" shadow_color="#shadow_color" shadow_outline="#shadow_outline" hardtext="" global_color="false"/>
</group>
<!-- border around the list -->
@ -595,8 +623,8 @@
<template name="button_ok_cancel" id="ok_cancel" ok_text="uittOK" cancel_text="uittCancel" posparent="parent" posref="BM TM"
onclick_ok="" onclick_ok_param="" onclick_cancel="" onclick_cancel_param="" x="0" y="0" keep="true" >
<group id="#id" posparent="#posparent" posref="#posref" child_resize_w="true" child_resize_h="true" x="#x" y="#y">
<ctrl style="button_ok" x="0" y="0" posref="TL TL" text_y="-2" onclick_l="#onclick_ok" params_l="#onclick_ok_param" hardtext="#ok_text" />
<ctrl style="button_cancel" x="4" posparent="ok" text_y="-2" posref ="TR TL" onclick_l="#onclick_cancel" params_l="#onclick_cancel_param" hardtext="#cancel_text" />
<ctrl style="button_ok" x="0" y="0" posref="TL TL" text_y="0" onclick_l="#onclick_ok" params_l="#onclick_ok_param" hardtext="#ok_text" />
<ctrl style="button_cancel" x="4" posparent="ok" text_y="0" posref ="TR TL" onclick_l="#onclick_cancel" params_l="#onclick_cancel_param" hardtext="#cancel_text" />
</group>
</template>
@ -611,7 +639,7 @@
<template name="html_text_button" id="" text="" posparent="parent" posref="TL TL"
onclick="" onclick_param="" x="0" y="0" keep="true" active="true" wmin="0">
<group type="html_input_offset" y_offset="-8" id="#id" posparent="#posparent" posref="#posref" child_resize_w="true" child_resize_h="true" x="#x" y="#y" active="#active">
<ctrl style="log_spe_but" id="button" wmin="#wmin" x="0" y="0" posref="TL TL" text_y="-2" onclick_l="#onclick" params_l="#onclick_param" hardtext="#text" color="255 255 255 200"/>
<ctrl style="log_spe_but" id="button" wmin="#wmin" x="0" y="0" posref="TL TL" text_y="0" onclick_l="#onclick" params_l="#onclick_param" hardtext="#text" color="255 255 255 200"/>
</group>
</template>
@ -620,7 +648,7 @@
<template name="html_text_button_look2" id="" text="" posparent="parent" posref="TL TL"
onclick="" onclick_param="" x="0" y="0" keep="true" >
<group type="html_input_offset" y_offset="-8" id="#id" posparent="#posparent" posref="#posref" child_resize_w="true" child_resize_h="true" x="#x" y="#y">
<ctrl style="log_button" id="button" wmin="0" x="0" y="0" posref="TL TL" text_y="-2" onclick_l="#onclick" params_l="#onclick_param" hardtext="#text" color="255 255 255 200"/>
<ctrl style="log_button" id="button" wmin="0" x="0" y="0" posref="TL TL" text_y="0" onclick_l="#onclick" params_l="#onclick_param" hardtext="#text" color="255 255 255 200"/>
</group>
</template>
@ -629,7 +657,7 @@
<template name="html_text_button_look3" id="" text="" posparent="parent" posref="TL TL"
onclick="" onclick_param="" x="0" y="0" keep="true" >
<group type="html_input_offset" y_offset="-8" id="#id" posparent="#posparent" posref="#posref" child_resize_w="true" child_resize_h="true" x="#x" y="#y">
<ctrl style="server_note" id="button" wmin="0" x="0" y="0" posref="TL TL" text_y="-2" onclick_l="#onclick" params_l="#onclick_param" hardtext="#text" color="255 255 255 200"/>
<ctrl style="server_note" id="button" wmin="0" x="0" y="0" posref="TL TL" text_y="0" onclick_l="#onclick" params_l="#onclick_param" hardtext="#text" color="255 255 255 200"/>
</group>
</template>
@ -826,7 +854,7 @@
>
<view type="bitmap" posref="MM MM" id="log" texture="new_launcher_bg.tga" global_color="false" render_layer="-1" />
<view type="text" id="text" posref="MM MM" line_maxw="412" w="412" x="0" y="0" color="255 254 243 255" fontsize="18" shadow="true" multi_line="true" multi_line_space="0" case_mode="%case_first_sentence_letter_up"/>
<view type="text" id="text" posref="MM MM" line_maxw="412" w="412" x="0" y="0" color="135 243 28 255" fontsize="18" shadow="true" multi_line="true" multi_line_space="0" case_mode="%case_first_sentence_letter_up"/>
<ctrl type="button" button_type="push_button" id="but_cancel" posref="BR BR" x="-304" y="157"
@ -955,6 +983,46 @@
highlight_over="255 255 255 128"
force_inside_screen="true"
/>
<!-- html <hr> element -->
<template name="html_hr"
keep="true">
<group id="sep_gr"
posref="ML ML"
sizeref="w"
w="0"
h="0"
child_resize_h="true"
child_resize_hmargin="12">
<view type="bitmap"
id="hr"
posref="MM MM"
sizeref="w"
w="-2"
h="2"
inherit_gc_alpha="true"
scale="true"
texture="blank.tga"
global_color="false" />
</group>
</template>
<template name="html_form_select_box_menu_widget"
keep="true"
id="sb">
<group type="menu"
id="#id"
posref="BL TL"
x="0"
y="0"
mouse_pos="false"
space="2"
shadow="false"
color="255 255 255 128"
color_over="255 255 255 255"
color_grayed="0 0 0 255"
fontsize="12"
highlight_over="255 255 255 128"
force_inside_screen="false"></group>
</template>
</interface_config>

View file

@ -232,6 +232,8 @@
<group type="menu" id="options_macro" exit_click_b="true" extends="base_menu" >
<action name="uimMacroExec" handler="macros_exec" />
<action name="uimMacroEdit" handler="macros_edit" />
<action name="uimMacroCopy" handler="macros_copy" />
<separator/>
<action name="uimMacroDel" handler="macros_del" />
</group>
@ -322,6 +324,8 @@
<action name="uimMCMoveUp" handler="new_macro_cmd_move_up" />
<action name="uimMCMoveDown" handler="new_macro_cmd_move_down" />
<action name="uimMCEdit" handler="new_macro_cmd_edit" />
<action name="uimMCCopy" handler="new_macro_cmd_copy" />
<separator/>
<action name="uimMCDel" handler="new_macro_cmd_delete" />
</group>

View file

@ -25,6 +25,8 @@
<action id="teleport" name="uiTeleport" handler="map_teleport" params=""/>
<action id="create_at_user_pos" name="uiCreateUserLMAtUserPos" handler="create_user_landmark_at_user_pos" params=""/>
<separator/>
<action id="search" name="uiMapSearch" handler="proc" params="map_search_show"/>
<separator/>
<action id="center" name="uiMenuCenter" handler="map_center" params="map=ui:interface:map:content:map_content:actual_map"/>
</group>
@ -144,6 +146,7 @@
<!-- * USER MAP * -->
<!-- ******************************************************************** -->
<variable entry="UI:VARIABLES:ISACTIVE:MAP_SEARCH" type="sint32" value="0" />
<proc id="map_proc_active">
<action handler="set" params="dblink=UI:VARIABLES:ISACTIVE:MAP|value=1" />
@ -155,10 +158,77 @@
<action handler="lua" params="if (r2 and r2.Mode == 'Edit') then r2.ToolUI:updateToggleWindowButtons() end" />
</proc>
<proc id="map_search_toggle">
<action handler="set" params="dblink=UI:VARIABLES:ISACTIVE:MAP_SEARCH|value=not(@UI:VARIABLES:ISACTIVE:MAP_SEARCH)"/>
<action handler="proc" params="map_search_focus" cond="@UI:VARIABLES:ISACTIVE:MAP_SEARCH"/>
<action handler="proc" params="map_search_reset" cond="not(@UI:VARIABLES:ISACTIVE:MAP_SEARCH)"/>
</proc>
<proc id="map_search_focus">
<action handler="set_keyboard_focus" params="target=ui:interface:map:content:map_content:lm_search:search:eb|select_all=true" />
</proc>
<proc id="map_search_reset">
<action handler="proc" params="map_search_setfilter" />
</proc>
<proc id="map_search_show">
<action handler="set" params="dblink=UI:VARIABLES:ISACTIVE:MAP_SEARCH|value=1" />
<action handler="proc" params="map_search_focus" />
</proc>
<proc id="map_search_hide">
<action handler="set" params="dblink=UI:VARIABLES:ISACTIVE:MAP_SEARCH|value=0" />
</proc>
<proc id="map_search_setfilter">
<action handler="set" params="target_property=ui:interface:map:content:map_content:lm_search:search:eb:input_string|value='@0'" />
<action handler="land_mark_filter" params="map=ui:interface:map:content:map_content:actual_map|text=@0" />
</proc>
<!-- set search string from /mapsearch command -->
<proc id="map_search_show_set">
<action handler="set" params="dblink=UI:VARIABLES:ISACTIVE:MAP_SEARCH|value=1" />
<action handler="proc" params="map_search_setfilter|@0" />
</proc>
<!-- hide search if focus was lost and input is empty (esc key) -->
<proc id="map_search_focuslost">
<action handler="proc" params="map_search_hide"
cond="eq(getprop('ui:interface:map:content:map_content:lm_search:search:eb:input_string'),'')" />
</proc>
<proc id="map_search_onchange">
<action handler="land_mark_filter" params="map=ui:interface:map:content:map_content:actual_map|group=@0" />
</proc>
<define id="map_min_size" value="256" />
<!-- used to override onclick handler -->
<proc id="dummy_proc" />
<template name="lm_search_result" keep="true" active="true" id="" x="0" y="0" w="0" h="17" posparent="parent" posref="TL TL"
hardtext="" fontsize="10" y_text="-2" onclick_l="lua" params_l="" tooltip="" index="0">
<group id="#id" active="#active" x="#x" y="#y" w="#w" h="#h" posparent="#posparent" posref="#posref" sizeref="w">
<ctrl type="button" id="over" sizeref="wh" w="0" h="0" posref="MM MM"
scale="true" tx_normal="blank.tga" tx_over="blank.tga" color="0 0 0 0" col_over="255 255 255 127"
onclick_l="land_mark_result_selected" params_l="map=ui:interface:map:content:map_content:actual_map|index=#index"
onclick_r="proc" params_r="dummy_proc"
tooltip="#tooltip" />
<view type="bitmap" id="icon" posref="ML ML" w="16" h="16"
scale="true" color="255 255 255 255" global_color="false" texture="blank.tga" />
<view type="text" id="title" posref="TL TL" x="16" y="#y_text"
color="255 255 255 255" global_color="true" fontsize="#fontsize" shadow="true" hardtext="#hardtext"
auto_clamp="true" over_extend_view_text="false" over_extend_parent_rect="false" />
</group>
</template>
<group id="map" type="container" posref="BL TL" min_w="%map_min_size" max_w="16384" w="256" h="256" x="352" y="200" min_h="%map_min_size" max_h="16384"
resizer="true" pop_max_h="16384" pop_min_h="%map_min_size" pop_max_w="16384" pop_min_w="%map_min_size"
openable="false" opened="true"
@ -191,8 +261,10 @@
<!-- center on player -->
<ctrl type="button" id="center" button_type="push_button" posparent="zoom_out" posref="TR TL" y="0" x="4" tx_normal="w_center_map.tga" tx_pushed="W_button_16_over.tga" tx_over="W_button_16_over.tga"
onclick_l="map_center" params_l="map=ui:interface:map:content:map_content:actual_map" tooltip="uittCenter" />
<ctrl type="button" id="lm_search_btn" button_type="push_button" posparent="center" posref="TR TL" y="0" x="4" tx_normal="w_help_1.tga" tx_pushed="W_button_16_over.tga" tx_over="W_button_16_over.tga"
onclick_l="proc" params_l="map_search_toggle" tooltip="uittMapSearch" />
<view type="text" id="time" x="12" y="0" posparent="center" posref="MR ML" color="255 255 255 255" fontsize="12" shadow="true" hardtext="" />
<view type="text" id="time" x="12" y="0" posparent="lm_search_btn" posref="MR ML" color="255 255 255 255" fontsize="12" shadow="true" hardtext="" />
<view type="text" id="weather" x="8" y="-16" posref="TL TL" color="255 255 255 255" fontsize="12" shadow="true" hardtext="" />
<instance template="box_widget" id="back" posref="TL TL" sizeref="wh" w="-2" h="-32" x="1" y="-32" render_layer="0" />
@ -315,11 +387,53 @@
selection_axis_color = "0 0 0 127"
compass="ui:interface:compass"
scale_max="2"
scale_max_r2="8"
/>
<!-- border around the map -->
<group id="lm_search"
posparent="back"
posref="TR TR"
sizeref="h"
x="-2"
y="-2"
h="-4"
child_resize_w="true">
<view type="bitmap" id="bg" posref="ML ML" sizeref="wh" h="25"
scale="true" color="100 100 100 120" global_color="false" texture="blank.tga" />
<instance template="edit_box_widget"
id="search"
posref="TR TR"
w="150"
clear_on_escape="true"
enter_recover_focus="false"
on_focus_lost="proc" on_focus_lost_params="map_search_focuslost"
onenter=""
onchange="proc" onchange_params="map_search_onchange|ui:interface:map:content:map_content:lm_search:search:eb" />
<ctrl type="button"
id="reset"
button_type="push_button"
posparent="search"
posref="ML MR"
x="-2"
tx_normal="w_close_0.tga"
tx_pushed="w_close_0.tga"
tx_over="W_button_16_over"
onclick_l="proc" params_l="map_search_toggle"
tooltip="" />
<view type="text" id="lm_count" posparent="search" posref="BR TR" x="-2" color="200 200 200 255" fontsize="10" shadow="true" hardtext="0" />
<group id="result" posref="TR TR" x="0" y="-25" w="0" h="-20" over="true" sizeref="wh">
<group id="rows" x="10" w="-10" y="0" sizeref="w" posref="TL TL" child_resize_h="true" child_resize_hmargin="4" max_h="0" max_sizeref="h" max_sizeparent="parent">
<group id="lm_result" type="list" x="0" y="0" posref="TL TL" sizeref="w" dynamic_display_size="true" />
</group>
<ctrl style="skin_scroll" id="sv" posref="TL TL" x="0" y="0" target="rows" />
</group>
</group>
<link expr="@UI:VARIABLES:ISACTIVE:MAP_SEARCH" target="lm_search:active" />
</group>
</group>
</group>
@ -408,7 +522,6 @@
player_pos_tex="player_pos.tga"
scale_max="2"
/>
<!-- border around the map -->

View file

@ -2653,6 +2653,11 @@
keep="true"
max_historic="40"
fontsize="10"
shadow="true"
shadow_x="1"
shadow_y="1"
shadow_color="0 0 0 255"
shadow_outline="false"
backup_father_container_pos="false"
want_return="false"
clear_on_escape="false"
@ -2722,7 +2727,11 @@
multi_line_space="0"
fontsize="#fontsize"
color="#color"
shadow="true"
shadow="#shadow"
shadow_x="#shadow_x"
shadow_y="#shadow_y"
shadow_color="#shadow_color"
shadow_outline="#shadow_outline"
hardtext=""
global_color="false" />
</group>
@ -2826,6 +2835,11 @@
keep="true"
max_historic="40"
fontsize="10"
shadow="true"
shadow_x="1"
shadow_y="1"
shadow_color="0 0 0 255"
shadow_outline="false"
backup_father_container_pos="false"
want_return="false"
color="255 255 255 255"
@ -2886,7 +2900,11 @@
multi_min_line="#multi_min_line"
fontsize="#fontsize"
color="#color"
shadow="true"
shadow="#shadow"
shadow_x="#shadow_x"
shadow_y="#shadow_y"
shadow_color="#shadow_color"
shadow_outline="#shadow_outline"
hardtext=""
global_color="false"
render_layer="#render_layer" />

View file

@ -56,7 +56,7 @@ public:
CVector Heading;
//CVMatrix Matrix;
public:
void serial(NLMISC::IStream &f) throw(EStream)
void serial(NLMISC::IStream &f)
{
f.serial(Date);
f.serial(Pos);

View file

@ -426,6 +426,7 @@ CClientConfig::CClientConfig()
WebIgTrustedDomains.push_back(WebIgMainDomain);
CurlMaxConnections = 2;
CurlCABundle.clear();
RingReleaseNotePath = "http://" + WebIgMainDomain + "/releasenotes_ring/index.php";
ReleaseNotePath = "http://" + WebIgMainDomain + "/releasenotes/index.php";
@ -599,6 +600,9 @@ CClientConfig::CClientConfig()
CameraSpeedMax = 1.0f;
CameraResetSpeed = 2.0f;
MaxMapScale = 2.0f;
R2EDMaxMapScale = 8.0f;
// VERBOSES
VerboseVP = false;
VerboseAnimUser = false;
@ -1074,6 +1078,8 @@ void CClientConfig::setValues()
if (ClientCfg.CurlMaxConnections < 0)
ClientCfg.CurlMaxConnections = 2;
READ_STRING_FV(CurlCABundle);
///////////////
// ANIMATION //
// AnimatedAngleThreshold
@ -1456,6 +1462,9 @@ void CClientConfig::setValues()
READ_FLOAT_FV(CameraDistance)
}
// Default values for CGroupMap
READ_FLOAT_FV(MaxMapScale);
READ_FLOAT_FV(R2EDMaxMapScale);
/////////////
// SHADOWS //

View file

@ -308,6 +308,7 @@ struct CClientConfig
std::vector<string> WebIgTrustedDomains;
sint32 CurlMaxConnections;
string CurlCABundle;
///////////////
// ANIMATION //
@ -591,6 +592,10 @@ struct CClientConfig
float CameraSpeedMax;
float CameraResetSpeed;
// Default values for CGroupMap
float MaxMapScale;
float R2EDMaxMapScale;
//////////////
// VERBOSES //
bool VerboseVP;

View file

@ -201,9 +201,9 @@ void connectionRestoreVideoMode ()
mode.Height = height;
}
// don't allow sizes smaller than 800x600
if (ClientCfg.Width < 800) ClientCfg.Width = 800;
if (ClientCfg.Height < 600) ClientCfg.Height = 600;
// don't allow sizes smaller than 1024x768
if (ClientCfg.Width < 1024) ClientCfg.Width = 1024;
if (ClientCfg.Height < 768) ClientCfg.Height = 768;
if (StereoDisplay)
StereoDisplayAttached = StereoDisplay->attachToDisplay();
@ -253,41 +253,13 @@ REGISTER_ACTION_HANDLER (CAHOnReloadTestPage, "on_reload_test_page");
// ------------------------------------------------------------------------------------------------
void setOutGameFullScreen()
{
// Setup full screen (special 1024x768 for outgame) if we have to.
// NB: don't setup fullscreen if player wants to play in window
if (!ClientCfg.Local && ClientCfg.SelectCharacter == -1)
{
if (StereoDisplayAttached)
StereoDisplay->detachFromDisplay();
StereoDisplayAttached = false;
UDriver::CMode currMode;
Driver->getCurrentScreenMode(currMode);
UDriver::CMode wantedMode;
wantedMode.Windowed = true;
wantedMode.Width = 1024;
wantedMode.Height = 768;
wantedMode.Depth = uint8(ClientCfg.Depth);
wantedMode.Frequency = ClientCfg.Frequency;
// change mode only if necessary
if ((wantedMode.Windowed != currMode.Windowed) ||
(wantedMode.Width != currMode.Width) ||
(wantedMode.Height != currMode.Height))
{
setVideoMode(wantedMode);
}
InitMouseWithCursor(ClientCfg.HardwareCursor && !StereoDisplayAttached);
/*
InitMouseWithCursor (true);
Driver->showCursor(false);
Driver->showCursor(true);
Driver->clearBuffers(CRGBA::Black);
Driver->swapBuffers();
Driver->showCursor(false);
Driver->showCursor(true);
*/
}
}
@ -307,8 +279,8 @@ bool connection (const string &cookie, const string &fsaddr)
game_exit = false;
// Setup full screen (special 1024x768 for outgame) if we have to.
setOutGameFullScreen();
// set resolution from cfg after login
connectionRestoreVideoMode ();
// Preload continents
{
@ -342,13 +314,14 @@ bool connection (const string &cookie, const string &fsaddr)
// init the string manager cache.
STRING_MANAGER::CStringManagerClient::instance()->initCache("", ClientCfg.LanguageCode); // VOIR BORIS
#endif
connectionRestoreVideoMode ();
return true;
}
ProgressBar.setFontFactor(1.0f);
// Init out game
setOutGameFullScreen();
ucstring nmsg("Initializing outgame...");
ProgressBar.newMessage (ClientCfg.buildLoadingString(nmsg) );
pIM->initOutGame();
@ -484,7 +457,6 @@ bool reconnection()
game_exit = false;
// Setup full screen (special 1024x768 for outgame) if we have to.
setOutGameFullScreen();
// Preload continents
@ -1269,6 +1241,16 @@ TInterfaceState globalMenu()
// Restore video mode
if (ClientCfg.SelectCharacter == -1)
{
if (ClientCfg.Windowed)
{
// if used changed window resolution in char select
// if we don't update ClientCfg, then UI from icfg is restored wrong
uint32 width, height;
Driver->getWindowSize(width, height);
ClientCfg.Width = width;
ClientCfg.Height = height;
}
connectionRestoreVideoMode ();
}

View file

@ -3055,6 +3055,7 @@ void CEntityCL::updateVisiblePostPos(const NLMISC::TTime &/* currentTimeInMs */,
if (!instance.empty())
{
_SelectionFX.cast (instance);
_SelectionFX.setLoadBalancingGroup("SelectionFx");
if (_SelectionFX.empty())
{
// shape found, but not a particle system
@ -3083,6 +3084,7 @@ void CEntityCL::updateVisiblePostPos(const NLMISC::TTime &/* currentTimeInMs */,
if (!instance.empty())
{
_MouseOverFX.cast (instance);
_MouseOverFX.setLoadBalancingGroup("SelectionFx");
if (_MouseOverFX.empty())
{
// shape found, but not a particle system

View file

@ -216,13 +216,13 @@ public:
}
}
void onCommand(const CMessage &/* command */) throw (IGatewayTransport::EInvalidCommand)
void onCommand(const CMessage &/* command */)
{
// nothing done for now
throw EInvalidCommand();
}
/// The gateway send a textual command to the transport
bool onCommand(const TParsedCommandLine &command) throw (IGatewayTransport::EInvalidCommand)
bool onCommand(const TParsedCommandLine &command)
{
if (command.SubParams.size() < 1)
throw EInvalidCommand();
@ -256,7 +256,7 @@ public:
}
/// Open the connection by intercepting client gateway message
void open() throw (ETransportError)
void open()
{
if (_Open)
{

View file

@ -19,8 +19,7 @@
#include <curl/curl.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#include "nel/gui/curl_certificates.h"
using namespace NLMISC;
using namespace NLNET;
@ -64,135 +63,20 @@ bool CCurlHttpClient::authenticate(const std::string &user, const std::string &p
return true;
}
const char *CAFilename = "ssl_ca_cert.pem"; // this is the certificate "Thawte Server CA"
// ***************************************************************************
static CURLcode sslctx_function(CURL * /* curl */, void *sslctx, void * /* parm */)
{
// look for certificate in search paths
string path = CPath::lookup(CAFilename);
nlinfo("Cert path '%s'", path.c_str());
if (path.empty())
{
nlwarning("Unable to find %s", CAFilename);
return CURLE_SSL_CACERT;
}
CIFile file;
// open certificate
if (!file.open(path))
{
nlwarning("Unable to open %s", path.c_str());
return CURLE_SSL_CACERT;
}
CURLcode res = CURLE_OK;
// load certificate content into memory
std::vector<uint8> buffer(file.getFileSize());
file.serialBuffer(&buffer[0], file.getFileSize());
// get a BIO
BIO *bio = BIO_new_mem_buf(&buffer[0], file.getFileSize());
char errorBuffer[1024];
if (bio)
{
// get a pointer to the X509 certificate store (which may be empty!)
X509_STORE *store = SSL_CTX_get_cert_store((SSL_CTX *)sslctx);
// use it to read the PEM formatted certificate from memory into an X509
// structure that SSL can use
STACK_OF(X509_INFO) *info = PEM_X509_INFO_read_bio(bio, NULL, NULL, NULL);
if (info)
{
// iterate over all entries from the PEM file, add them to the x509_store one by one
for (sint i = 0; i < sk_X509_INFO_num(info); ++i)
{
X509_INFO *itmp = sk_X509_INFO_value(info, i);
if (itmp && itmp->x509)
{
X509_NAME *subject = X509_get_subject_name(itmp->x509);
std::string name;
unsigned char *tmp = NULL;
// construct a multiline string with name
for (int i = 0, ilen = X509_NAME_entry_count(subject); i < ilen; ++i)
{
X509_NAME_ENTRY *e = X509_NAME_get_entry(subject, i);
ASN1_STRING *d = X509_NAME_ENTRY_get_data(e);
if (ASN1_STRING_to_UTF8(&tmp, d) > 0)
{
name += NLMISC::toString("%s\n", tmp);
OPENSSL_free(tmp);
}
}
// add our certificate to this store
if (X509_STORE_add_cert(store, itmp->x509) == 0)
{
uint errCode = ERR_get_error();
// ignore already in hash table errors
if (ERR_GET_LIB(errCode) != ERR_LIB_X509 || ERR_GET_REASON(errCode) != X509_R_CERT_ALREADY_IN_HASH_TABLE)
{
ERR_error_string_n(errCode, errorBuffer, 1024);
nlwarning("Error adding certificate %s: %s", name.c_str(), errorBuffer);
res = CURLE_SSL_CACERT;
}
}
else
{
nlinfo("Added certificate %s", name.c_str());
}
}
}
// cleanup
sk_X509_INFO_pop_free(info, X509_INFO_free);
}
else
{
nlwarning("Unable to read PEM info");
res = CURLE_SSL_CACERT;
}
// decrease reference counts
BIO_free(bio);
}
else
{
nlwarning("Unable to allocate BIO buffer for certificates");
res = CURLE_SSL_CACERT;
}
// all set to go
return res;
}
static const std::string CAFilename = "ssl_ca_cert.pem"; // this is the certificate "Thawte Server CA"
// ***************************************************************************
bool CCurlHttpClient::verifyServer(bool verify)
{
curl_easy_setopt(_Curl, CURLOPT_SSL_VERIFYHOST, verify ? 2 : 0);
curl_easy_setopt(_Curl, CURLOPT_SSL_VERIFYPEER, verify ? 1 : 0);
curl_easy_setopt(_Curl, CURLOPT_SSLCERTTYPE, "PEM");
// would allow to provide the CA in memory instead of using CURLOPT_CAINFO, but needs to include and link OpenSSL
if (curl_easy_setopt(_Curl, CURLOPT_SSL_CTX_FUNCTION, *sslctx_function) != CURLE_OK)
{
nlwarning("Unable to support CURLOPT_SSL_CTX_FUNCTION, curl not compiled with OpenSSL ?");
}
// set both CURLOPT_CAINFO and CURLOPT_CAPATH to NULL to be sure we won't use default values (these files can be missing and generate errors)
curl_easy_setopt(_Curl, CURLOPT_CAINFO, NULL);
curl_easy_setopt(_Curl, CURLOPT_CAPATH, NULL);
// specify custom CA certs
NLGUI::CCurlCertificates::addCertificateFile(CAFilename);
// if supported, use custom SSL context function to load certificates
NLGUI::CCurlCertificates::useCertificates(_Curl);
return true;
}

View file

@ -593,6 +593,8 @@ void initMainLoop()
Scene->setGroupLoadMaxPolygon("Skin", ClientCfg.SkinNbMaxPoly);
Scene->setGroupLoadMaxPolygon("Fx", ClientCfg.FxNbMaxPoly);
Scene->setMaxSkeletonsInNotCLodForm(ClientCfg.NbMaxSkeletonNotCLod);
// separate group for mouse/target selection reticle
Scene->setGroupLoadMaxPolygon("SelectionFx", 10000);
// enable Scene Lighting
Scene->enableLightingSystem(true);
Scene->setAmbientGlobal(CRGBA::Black);

View file

@ -187,7 +187,21 @@ static inline bool isUrlTag(const ucstring &s, ucstring::size_type index, ucstri
if (isUrl && i > 0 && !markdown)
{
// '}' is in the list because of color tags, ie "@{FFFF}http://..."
#ifdef NL_ISO_CPP0X_AVAILABLE
const vector<ucchar> chars{ ' ', '"', '\'', '(', '[', '}' };
#else
static std::vector<ucchar> chars;
if (chars.empty())
{
chars.push_back(' ');
chars.push_back('"');
chars.push_back('\'');
chars.push_back('(');
chars.push_back('[');
chars.push_back('}');
}
#endif
isUrl = std::find(chars.begin(), chars.end(), s[i - 1]) != chars.end();
}
return isUrl;

View file

@ -1548,12 +1548,48 @@ void CDBCtrlSheet::setupDisplayAsPhrase(const std::vector<NLMISC::CSheetId> &bri
// Get the best SBrick to display.
CSheetId rootBrickSheetId= bricks[0];
{
CSheetId bestBrickSheetId= pBM->getSabrinaCom().getPhraseBestDisplayBrick(bricks);
setupDisplayAsSBrick (rootBrickSheetId.asInt(), bestBrickSheetId.asInt() );
}
// Override background if type is forace extraction/prospection and ecosystem brick is used
{
BRICK_FAMILIES::TBrickFamily family = pBM->getSabrinaCom().getPhraseForageFamily(bricks);
std::string icon;
switch(family)
{
case BRICK_FAMILIES::BHFEMA:
case BRICK_FAMILIES::BHFPMA:
icon = "bk_matis_brick.tga";
break;
case BRICK_FAMILIES::BHFEMB:
case BRICK_FAMILIES::BHFPMB:
icon = "bk_fyros_brick.tga";
break;
case BRICK_FAMILIES::BHFEMC:
case BRICK_FAMILIES::BHFPMC:
icon = "bk_zorai_brick.tga";
break;
case BRICK_FAMILIES::BHFEMD:
case BRICK_FAMILIES::BHFPMD:
icon = "bk_tryker_brick.tga";
break;
case BRICK_FAMILIES::BHFEME:
case BRICK_FAMILIES::BHFPME:
icon = "bk_generic_brick.tga";
break;
default:
icon = "";
break;
}
if (!icon.empty())
{
CViewRenderer &rVR = *CViewRenderer::getInstance();
_DispBackBmpId = rVR.getTextureIdFromName(icon);
}
}
// not so beautiful to display .sphrase name in progression, and in botchat
if(_ActualType==SheetType_SPhraseId)
{

View file

@ -28,6 +28,8 @@
#include "../net_manager.h"
#include "../connection.h"
#include <curl/curl.h>
using namespace std;
using namespace NLMISC;

View file

@ -426,6 +426,8 @@ CGroupMap::CGroupMap(const TCtorParam &param)
//
_TargetLM = NULL;
_HomeLM = NULL;
_LandmarkFilter.clear();
_MatchedLandmarks.clear();
//
_ScaleMax = 8.f;
_ScaleMaxR2 = 8.f;
@ -711,9 +713,11 @@ bool CGroupMap::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup)
}
//
_ScaleMax = ClientCfg.MaxMapScale;
ptr = (char*) xmlGetProp( cur, (xmlChar*)"scale_max" );
if (ptr) fromString((const char *) ptr, _ScaleMax);
//
_ScaleMaxR2 = ClientCfg.R2EDMaxMapScale;
ptr = (char*) xmlGetProp( cur, (xmlChar*)"scale_max_r2" );
if (ptr) fromString((const char *) ptr, _ScaleMaxR2);
//
@ -900,9 +904,19 @@ void CGroupMap::updateCoords()
// bool newLandMarkShown = false;
uint i;
for (i = 0; i < _ContinentLM.size(); ++i)
{
if (_ContinentLM[i]->SearchMatch)
_ContinentLM[i]->setActive(true);
else
setupFromZoom(_ContinentLM[i], _ContinentLM[i]->Type, _MeterPerPixel);
}
for (i = 0; i < _ContinentText.size(); ++i)
{
if (_ContinentText[i]->SearchMatch)
_ContinentText[i]->setActive(true);
else
setupFromZoom(_ContinentText[i], _ContinentText[i]->Type, _MeterPerPixel);
}
//
updateLandMarkList(_ContinentLM);
updateLandMarkTextList(_ContinentText);
@ -2235,6 +2249,31 @@ void CGroupMap::centerOnPlayer()
computeOffsets();
invalidateCoords();
}
//============================================================================================================
void CGroupMap::centerOnWorldPos(const CVector2f &worldPos)
{
CVector2f mapPos;
worldToMap(mapPos, worldPos);
sint32 sx, sy;
mapToScreen(sx, sy, mapPos);
sint32 x, y, w, h;
computeMapRectInsideGroup(x, y, w, h);
sint32 dx, dy;
if (sx < getXReal())
dx = -(getXReal() - sx + w/2);
else
dx = sx - getXReal() - w/2;
if (sy < getYReal())
dy = -(getYReal() - sy + h/2);
else
dy = sy - getYReal() - h/2;
pan(dx, dy);
}
//============================================================================================================
void CGroupMap::setScale(float newUserScale, const NLMISC::CVector2f &/* center */)
@ -2257,7 +2296,6 @@ void CGroupMap::setScale(float newScale)
setScale(newScale, mapCoords);
}
//============================================================================================================
void CGroupMap::updateLandMarkList(TLandMarkButtonVect &lmVect)
{
@ -2289,6 +2327,63 @@ void CGroupMap::updateLandMarkTextList(TLandMarkTextVect &lmVect)
}
}
//============================================================================================================
void CGroupMap::updateMatchedLandmarks()
{
CInterfaceGroup *gc = getParentContainer();
if (!gc) return;
// visible landmark count
CViewText *pVT = dynamic_cast<CViewText *>(gc->getView("lm_count"));
if (pVT)
{
// show total landmark count if search filter has not been set
uint c = _MatchedLandmarks.size();
if (c == 0 && _LandmarkFilter.size() == 0)
c = _UserLM.size();
pVT->setText(toString(c));
}
// list of matched landmarks
CGroupList *pL = dynamic_cast<CGroupList *>(gc->getGroup("lm_result"));
if (!pL) return;
pL->clearGroups();
if (_LandmarkFilter.size() == 0) return;
// create result list
for(uint k = 0; k < _MatchedLandmarks.size(); ++k)
{
std::vector<std::pair<string,string> > params;
params.clear();
params.push_back(std::pair<string,string>("id", toString("lm%d", k)));
params.push_back(std::pair<string,string>("tooltip", _MatchedLandmarks[k].Title.toUtf8()));
params.push_back(std::pair<string,string>("index", toString(k)));
CInterfaceGroup *g = CWidgetManager::getInstance()->getParser()->createGroupInstance("lm_search_result", pL->getId(), params);
if (g)
{
pL->addChild(g);
CViewText* t = dynamic_cast<CViewText *>(g->getView("title"));
if (t)
{
t->setSingleLineTextFormatTaged(_MatchedLandmarks[k].Title);
}
CViewBitmap* b = dynamic_cast<CViewBitmap *>(g->getView("icon"));
if (b)
{
b->setTexture(_MatchedLandmarks[k].Options.LandMarkTexNormal);
b->setColor(_MatchedLandmarks[k].Options.ColorNormal);
}
}
}
pL->invalidateCoords();
}
//============================================================================================================
void CGroupMap::removeLandMarks(TLandMarkButtonVect &lm)
{
@ -2306,6 +2401,9 @@ void CGroupMap::removeLandMarks(TLandMarkButtonVect &lm)
//============================================================================================================
void CGroupMap::createLMWidgets(const std::vector<CContLandMark> &lms)
{
// disable any match in "world" mode
bool notWorldMode = _CurMap->Name != "world";
for (uint32 k = 0; k < lms.size(); ++k)
{
const CContLandMark &rCLM =lms[k];
@ -2314,6 +2412,12 @@ void CGroupMap::createLMWidgets(const std::vector<CContLandMark> &lms)
worldToMap(mapPos, rCLM.Pos);
const ucstring ucsTmp(CStringManagerClient::getPlaceLocalizedName(rCLM.TitleTextID));
const ucstring lcTitle = toLower(ucsTmp);
bool searchMatch = notWorldMode && _LandmarkFilter.size() > 0 && filterLandmark(lcTitle);
if (searchMatch)
_MatchedLandmarks.push_back(SMatchedLandmark(rCLM.Pos, ucsTmp, _ContinentLMOptions));
// Add button if not a region nor a place
if ((rCLM.Type != CContLandMark::Region) && (rCLM.Type != CContLandMark::Place) &&
(rCLM.Type != CContLandMark::Street))
@ -2323,6 +2427,7 @@ void CGroupMap::createLMWidgets(const std::vector<CContLandMark> &lms)
else
addLandMark(_ContinentLM, mapPos, CI18N::get("uiStable"), _ContinentLMOptions);
_ContinentLM.back()->Type = rCLM.Type;
_ContinentLM.back()->SearchMatch = searchMatch;
}
else // just add a text
{
@ -2341,6 +2446,7 @@ void CGroupMap::createLMWidgets(const std::vector<CContLandMark> &lms)
pNewText->setShadowColor(CRGBA(0,0,0,255));
pNewText->setModulateGlobalColor(false);
pNewText->Type = rCLM.Type;
pNewText->SearchMatch = searchMatch;
_ContinentText.push_back(pNewText);
addView(pNewText);
}
@ -2369,6 +2475,7 @@ void CGroupMap::createLMWidgets(const std::vector<CContLandMark> &lms)
void CGroupMap::createContinentLandMarks()
{
uint32 k;
_MatchedLandmarks.clear();
if (_MapMode != MapMode_Normal) return;
if (_CurMap == NULL) return;
@ -2387,12 +2494,9 @@ void CGroupMap::createContinentLandMarks()
if (_CurMap->Name == "world")
{
createLMWidgets(ContinentMngr.WorldMap);
invalidateCoords();
return;
}
if (_CurContinent == NULL) return;
else if (_CurContinent)
{
// Continent Landmarks
createLMWidgets(_CurContinent->ContLandMarks);
// User Landmarks
@ -2401,8 +2505,24 @@ void CGroupMap::createContinentLandMarks()
NLMISC::CVector2f mapPos;
worldToMap(mapPos, _CurContinent->UserLandMarks[k].Pos);
addLandMark(_UserLM, mapPos, _CurContinent->UserLandMarks[k].Title, getUserLandMarkOptions(k));
CLandMarkOptions options = getUserLandMarkOptions(k);
addLandMark(_UserLM, mapPos, _CurContinent->UserLandMarks[k].Title, options);
if (_LandmarkFilter.size() > 0)
{
if (filterLandmark(_CurContinent->UserLandMarks[k].Title))
{
_MatchedLandmarks.push_back(SMatchedLandmark(_CurContinent->UserLandMarks[k].Pos, _CurContinent->UserLandMarks[k].Title, options));
}
else
{
_UserLM.back()->setActive(false);
}
}
}
}
updateMatchedLandmarks();
invalidateCoords();
}
@ -2421,6 +2541,20 @@ static void hideTeleportButtonsInPopupMenuIfNotEnoughPriv()
if(ie) ie->setActive(showTeleport);
}
//============================================================================================================
void CGroupMap::setLandmarkFilter(const std::string &s)
{
_LandmarkFilter.clear();
if (!s.empty()) {
ucstring ucs;
ucs.fromUtf8(s);
splitUCString(toLower(s), ucstring(" "), _LandmarkFilter);
}
// recreate landmarks
createContinentLandMarks();
}
//============================================================================================================
void CGroupMap::updateUserLandMarks()
@ -2440,6 +2574,10 @@ void CGroupMap::updateUserLandMarks()
worldToMap(mapPos, _CurContinent->UserLandMarks[k].Pos);
addLandMark(_UserLM, mapPos, _CurContinent->UserLandMarks[k].Title, getUserLandMarkOptions(k));
// hide landmark if not matching filter
if (!filterLandmark(_CurContinent->UserLandMarks[k].Title))
_UserLM.back()->setActive(false);
}
invalidateCoords();
@ -2482,6 +2620,22 @@ void CGroupMap::updateLandMarkButton(CLandMarkButton *lmb, const CLandMarkOption
lmb->setColorPushed(options.ColorPushed);
}
//============================================================================================================
bool CGroupMap::filterLandmark(const ucstring &title) const
{
if (_LandmarkFilter.size() > 0)
{
ucstring lcTitle = toLower(title);
for(uint i = 0; i< _LandmarkFilter.size(); ++i) {
if (lcTitle.find(_LandmarkFilter[i]) == ucstring::npos) {
return false;
}
}
}
return true;
}
//============================================================================================================
void CGroupMap::addLandMark(TLandMarkButtonVect &destList, const NLMISC::CVector2f &pos, const ucstring &title, const CLandMarkOptions &options)
{
@ -2511,18 +2665,8 @@ CCtrlButton *CGroupMap::addUserLandMark(const NLMISC::CVector2f &pos, const ucst
addLandMark(_UserLM, pos, title, getUserLandMarkOptions((uint32)_CurContinent->UserLandMarks.size() - 1));
// Save the config file each time a user landmark is created
CInterfaceManager *pIM = CInterfaceManager::getInstance();
uint8 currMode = pIM->getMode();
std::string filename = "save/interface_" + PlayerSelectedFileName + ".icfg";
if (!CFile::fileExists(filename) && CFile::fileExists("save/shared_interface.icfg"))
{
filename = "save/shared_interface.icfg";
}
pIM->saveConfig (filename);
if (currMode != pIM->getMode())
{
pIM->setMode(currMode);
}
CInterfaceManager::getInstance()->saveConfig();
return _UserLM.back();
}
@ -2965,6 +3109,30 @@ void CGroupMap::targetLandmark(CCtrlButton *lm)
}
}
//=========================================================================================================
void CGroupMap::targetLandmarkResult(uint32 index)
{
if (index > _MatchedLandmarks.size()) return;
CCompassTarget ct;
ct.Pos = _MatchedLandmarks[index].Pos;
ct.Name = _MatchedLandmarks[index].Title;
// type sets compass arrow color
ct.setType(CCompassTarget::UserLandMark);
centerOnWorldPos(ct.Pos);
CInterfaceManager *im = CInterfaceManager::getInstance();
CGroupCompas *gc = dynamic_cast<CGroupCompas *>(CWidgetManager::getInstance()->getElementFromId(_CompassId));
if (gc)
{
gc->setActive(true);
gc->setTarget(ct);
gc->blink();
CWidgetManager::getInstance()->setTopWindow(gc);
}
}
//=========================================================================================================
void CGroupMap::getLandmarkPosition(const CCtrlButton *lm, NLMISC::CVector2f &worldPos)
{
@ -3159,6 +3327,51 @@ SMap *CGroupMap::getParentMap(SMap *map)
// ACTION HANDLERS //
/////////////////////
//=========================================================================================================
// Set landmark filter
class CAHLandMarkFilter : public IActionHandler
{
virtual void execute (CCtrlBase * /* pCaller */, const string &params )
{
string id = getParam(params, "map");
CGroupMap* map = dynamic_cast<CGroupMap*>(CWidgetManager::getInstance()->getElementFromId(id));
if (!map) return;
string text = getParam(params, "text");
if (text.empty() && params.find("text=") == std::string::npos)
{
string group = getParam(params, "group");
CGroupEditBox* eb = dynamic_cast<CGroupEditBox*>(CWidgetManager::getInstance()->getElementFromId(group));
if (!eb) return;
text = eb->getInputString().toUtf8();
}
map->setLandmarkFilter(text);
}
};
REGISTER_ACTION_HANDLER(CAHLandMarkFilter, "land_mark_filter");
//=========================================================================================================
// Landmark selected from result list
class CAHLandMarkResultSelected : public IActionHandler
{
virtual void execute (CCtrlBase * /* pCaller */, const string &params)
{
string id = getParam(params, "map");
CGroupMap* map = dynamic_cast<CGroupMap*>(CWidgetManager::getInstance()->getElementFromId(id));
if (!map) return;
sint index;
string nr = getParam(params, "index");
if (!fromString(nr, index)) return;
map->targetLandmarkResult(index);
}
};
REGISTER_ACTION_HANDLER(CAHLandMarkResultSelected, "land_mark_result_selected");
//=========================================================================================================
// A land mark button has been pushed
class CAHLandMarkSelected : public IActionHandler

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