Merge with dfighter-tools

This commit is contained in:
kaetemi 2015-02-22 10:45:48 +01:00
commit d75b7f3491
147 changed files with 2092 additions and 946 deletions

View file

@ -1,8 +1,8 @@
#-----------------------------------------------------------------------------
#
# NeL
# Authors: Nevrax and the NeL Community
# Version: 0.10.0
# Ryzom Core
# Authors: Nevrax and the Ryzom Core Community
# Version: 0.11.2
#
# Notes:
# * Changing install location: add -DCMAKE_INSTALL_PREFIX:PATH=/my/new/path
@ -47,8 +47,8 @@ CHECK_OUT_OF_SOURCE()
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(RyzomCore CXX C)
SET(NL_VERSION_MAJOR 0)
SET(NL_VERSION_MINOR 10)
SET(NL_VERSION_PATCH 0)
SET(NL_VERSION_MINOR 11)
SET(NL_VERSION_PATCH 2)
SET(NL_VERSION "${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}.${NL_VERSION_PATCH}")
#-----------------------------------------------------------------------------
@ -110,10 +110,6 @@ FIND_PACKAGE(Jpeg)
IF(WITH_STATIC_LIBXML2)
SET(LIBXML2_DEFINITIONS ${LIBXML2_DEFINITIONS} -DLIBXML_STATIC)
IF(NOT WIN32 AND NOT APPLE)
FIND_PACKAGE(LibLZMA REQUIRED)
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${LIBLZMA_LIBRARIES})
ENDIF(NOT WIN32 AND NOT APPLE)
ENDIF(WITH_STATIC_LIBXML2)
IF(WITH_STATIC)
@ -232,30 +228,31 @@ IF(WITH_NEL_TESTS)
ENDIF(WITH_NEL_TESTS)
# packaging information
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "NeL MMORPG Framework")
SET(CPACK_PACKAGE_VENDOR "NeL")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Ryzom Core MMORPG Framework")
SET(CPACK_PACKAGE_VENDOR "Ryzom Core")
SET(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_SOURCE_DIR}/README)
SET(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/COPYING)
SET(CPACK_PACKAGE_VERSION_MAJOR "${NL_VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${NL_VERSION_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${NL_VERSION_PATCH}")
SET(CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_BINARY_DIR};NeL;ALL;/")
SET(CPACK_PACKAGE_EXECUTABLES "nel${NL_VERSION}" "nel")
SET(CPACK_PACKAGE_EXECUTABLES "ryzomcore${NL_VERSION}" "ryzomcore")
SET(CPACK_SET_DESTDIR TRUE)
# NSIS Specific Packing Setup
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "NeL")
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "RyzomCore")
SET(CPACK_NSIS_MODIFY_PATH "ON")
SET(CPACK_NSIS_MUI_ICON ${CMAKE_SOURCE_DIR}/resources/nevraxpill.ico)
SET(CPACK_NSIS_MUI_UNIICON ${CMAKE_SOURCE_DIR}/resources/nevraxpill.ico)
SET(CPACK_PACKAGE_ICON ${CMAKE_SOURCE_DIR}/resources\\\\nel.bmp)
SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} NeL")
SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} RyzomCore")
SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\dev.ryzom.com")
SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\dev.ryzom.com\\\\projects\\\\nel\\\\wiki")
SET(CPACK_NSIS_CONTACT "matt.raykowski@gmail.com")
## Source Packages
SET(CPACK_PACKAGE_FILE_NAME "nel-${NL_VERSION}")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "nel-${NL_VERSION}")
SET(CPACK_PACKAGE_FILE_NAME "ryzomcore-${NL_VERSION}")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "ryzomcore-${NL_VERSION}")
IF(WIN32)
#SET(CPACK_GENERATOR "NSIS")
SET(CPACK_GENERATOR "NSIS;ZIP")

View file

@ -26,63 +26,46 @@ IF(TARGET_CPU STREQUAL "armv7")
SET(LIBRARY_ARCHITECTURE "armeabi-v7a")
SET(CMAKE_SYSTEM_PROCESSOR "armv7")
SET(TOOLCHAIN_ARCH "arm")
SET(TOOLCHAIN_PREFIX "arm-linux-androideabi")
SET(GCC_TOOLCHAIN_PREFIX "arm-linux-androideabi")
SET(TOOLCHAIN_BIN_PREFIX "arm")
SET(MINIMUM_NDK_TARGET 4)
ELSEIF(TARGET_CPU STREQUAL "armv5")
SET(LIBRARY_ARCHITECTURE "armeabi")
SET(CMAKE_SYSTEM_PROCESSOR "armv5")
SET(TOOLCHAIN_ARCH "arm")
SET(TOOLCHAIN_PREFIX "arm-linux-androideabi")
SET(GCC_TOOLCHAIN_PREFIX "arm-linux-androideabi")
SET(TOOLCHAIN_BIN_PREFIX "arm")
SET(MINIMUM_NDK_TARGET 4)
ELSEIF(TARGET_CPU STREQUAL "x86")
SET(LIBRARY_ARCHITECTURE "x86")
SET(CMAKE_SYSTEM_PROCESSOR "x86")
SET(TOOLCHAIN_ARCH "x86")
SET(TOOLCHAIN_PREFIX "x86")
SET(GCC_TOOLCHAIN_PREFIX "x86")
SET(TOOLCHAIN_BIN_PREFIX "i686")
SET(MINIMUM_NDK_TARGET 9)
ELSEIF(TARGET_CPU STREQUAL "mips")
SET(LIBRARY_ARCHITECTURE "mips")
SET(CMAKE_SYSTEM_PROCESSOR "mips")
SET(TOOLCHAIN_ARCH "mips")
SET(TOOLCHAIN_PREFIX "mipsel-linux-android")
SET(GCC_TOOLCHAIN_PREFIX "mipsel-linux-android")
SET(TOOLCHAIN_BIN_PREFIX "mipsel")
SET(MINIMUM_NDK_TARGET 9)
ENDIF(TARGET_CPU STREQUAL "armv7")
SET(ANDROID_COMPILER "GCC")
IF(NDK_TOOLCHAIN_VERSION STREQUAL "clang")
SET(ANDROID_COMPILER "clang")
SET(CLANG_TOOLCHAIN_PREFIX "llvm")
SET(CLANG ON)
ELSE()
SET(GCC_TOOLCHAIN_VERSION ${NDK_TOOLCHAIN_VERSION})
ENDIF()
IF(NOT NDK_TARGET)
SET(NDK_TARGET ${MINIMUM_NDK_TARGET})
ENDIF(NOT NDK_TARGET)
FILE(GLOB _TOOLCHAIN_VERSIONS "${NDK_ROOT}/toolchains/${TOOLCHAIN_PREFIX}-*")
IF(_TOOLCHAIN_VERSIONS)
LIST(SORT _TOOLCHAIN_VERSIONS)
LIST(REVERSE _TOOLCHAIN_VERSIONS)
FOREACH(_TOOLCHAIN_VERSION ${_TOOLCHAIN_VERSIONS})
STRING(REGEX REPLACE ".+${TOOLCHAIN_PREFIX}-([0-9.]+)" "\\1" _TOOLCHAIN_VERSION "${_TOOLCHAIN_VERSION}")
IF(_TOOLCHAIN_VERSION MATCHES "^([0-9.]+)$")
LIST(APPEND NDK_TOOLCHAIN_VERSIONS ${_TOOLCHAIN_VERSION})
ENDIF(_TOOLCHAIN_VERSION MATCHES "^([0-9.]+)$")
ENDFOREACH(_TOOLCHAIN_VERSION)
ENDIF(_TOOLCHAIN_VERSIONS)
IF(NOT NDK_TOOLCHAIN_VERSIONS)
MESSAGE(FATAL_ERROR "No Android toolchain found in default search path ${NDK_ROOT}/toolchains")
ENDIF(NOT NDK_TOOLCHAIN_VERSIONS)
IF(NDK_TOOLCHAIN_VERSION)
LIST(FIND NDK_TOOLCHAIN_VERSIONS "${NDK_TOOLCHAIN_VERSION}" _INDEX)
IF(_INDEX EQUAL -1)
LIST(GET NDK_TOOLCHAIN_VERSIONS 0 NDK_TOOLCHAIN_VERSION)
ENDIF(_INDEX EQUAL -1)
ELSE(NDK_TOOLCHAIN_VERSION)
LIST(GET NDK_TOOLCHAIN_VERSIONS 0 NDK_TOOLCHAIN_VERSION)
ENDIF(NDK_TOOLCHAIN_VERSION)
MESSAGE(STATUS "Target Android NDK ${NDK_TARGET} and use GCC ${NDK_TOOLCHAIN_VERSION}")
IF(CMAKE_HOST_WIN32)
SET(TOOLCHAIN_HOST "windows")
SET(TOOLCHAIN_BIN_SUFFIX ".exe")
@ -94,33 +77,73 @@ ELSEIF(CMAKE_HOST_UNIX)
SET(TOOLCHAIN_BIN_SUFFIX "")
ENDIF(CMAKE_HOST_WIN32)
SET(TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${TOOLCHAIN_PREFIX}-${NDK_TOOLCHAIN_VERSION}/prebuilt/${TOOLCHAIN_HOST}")
MACRO(SEARCH_TOOLCHAIN _COMPILER)
SET(${_COMPILER}_TOOLCHAIN_VERSIONS)
FILE(GLOB _TOOLCHAIN_VERSIONS "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}-*")
IF(_TOOLCHAIN_VERSIONS)
LIST(SORT _TOOLCHAIN_VERSIONS)
LIST(REVERSE _TOOLCHAIN_VERSIONS)
FOREACH(_TOOLCHAIN_VERSION ${_TOOLCHAIN_VERSIONS})
STRING(REGEX REPLACE ".+${_PREFIX}-([0-9.]+)" "\\1" _TOOLCHAIN_VERSION "${_TOOLCHAIN_VERSION}")
IF(_TOOLCHAIN_VERSION MATCHES "^([0-9.]+)$")
LIST(APPEND ${_COMPILER}_TOOLCHAIN_VERSIONS ${_TOOLCHAIN_VERSION})
ENDIF()
ENDFOREACH()
ENDIF()
IF(NOT ${_COMPILER}_TOOLCHAIN_VERSIONS)
MESSAGE(FATAL_ERROR "No Android ${_COMPILER} toolchain found in default search path ${NDK_ROOT}/toolchains")
ENDIF()
IF(${_COMPILER}_TOOLCHAIN_VERSIONS)
LIST(FIND ${_COMPILER}_TOOLCHAIN_VERSIONS "${${_COMPILER}_TOOLCHAIN_VERSION}" _INDEX)
IF(_INDEX EQUAL -1)
LIST(GET ${_COMPILER}_TOOLCHAIN_VERSIONS 0 ${_COMPILER}_TOOLCHAIN_VERSION)
ENDIF()
ELSE()
LIST(GET ${_COMPILER}_TOOLCHAIN_VERSIONS 0 ${_COMPILER}_TOOLCHAIN_VERSION)
ENDIF()
SET(${_COMPILER}_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}-${${_COMPILER}_TOOLCHAIN_VERSION}/prebuilt/${TOOLCHAIN_HOST}")
IF(NOT EXISTS "${${_COMPILER}_TOOLCHAIN_ROOT}")
FILE(GLOB _TOOLCHAIN_PREFIXES "${${_COMPILER}_TOOLCHAIN_ROOT}*")
IF(_TOOLCHAIN_PREFIXES)
LIST(GET _TOOLCHAIN_PREFIXES 0 ${_COMPILER}_TOOLCHAIN_ROOT)
ENDIF(_TOOLCHAIN_PREFIXES)
ENDIF()
ENDMACRO()
IF(CLANG)
SEARCH_TOOLCHAIN(CLANG)
MESSAGE(STATUS "Target Android NDK ${NDK_TARGET} and use clang ${CLANG_TOOLCHAIN_VERSION}")
ENDIF()
SEARCH_TOOLCHAIN(GCC)
MESSAGE(STATUS "Target Android NDK ${NDK_TARGET} and use GCC ${GCC_TOOLCHAIN_VERSION}")
MESSAGE(STATUS "Found Android LLVM toolchain in ${CLANG_TOOLCHAIN_ROOT}")
MESSAGE(STATUS "Found Android GCC toolchain in ${GCC_TOOLCHAIN_ROOT}")
SET(PLATFORM_ROOT "${NDK_ROOT}/platforms/android-${NDK_TARGET}/arch-${TOOLCHAIN_ARCH}")
IF(NOT EXISTS "${TOOLCHAIN_ROOT}")
FILE(GLOB _TOOLCHAIN_PREFIXES "${TOOLCHAIN_ROOT}*")
IF(_TOOLCHAIN_PREFIXES)
LIST(GET _TOOLCHAIN_PREFIXES 0 TOOLCHAIN_ROOT)
ENDIF(_TOOLCHAIN_PREFIXES)
ENDIF(NOT EXISTS "${TOOLCHAIN_ROOT}")
MESSAGE(STATUS "Found Android toolchain in ${TOOLCHAIN_ROOT}")
MESSAGE(STATUS "Found Android platform in ${PLATFORM_ROOT}")
# include dirs
SET(PLATFORM_INCLUDE_DIR "${PLATFORM_ROOT}/usr/include")
SET(STL_DIR "${NDK_ROOT}/sources/cxx-stl/gnu-libstdc++")
IF(EXISTS "${STL_DIR}/${NDK_TOOLCHAIN_VERSION}")
IF(EXISTS "${STL_DIR}/${GCC_TOOLCHAIN_VERSION}")
# NDK version >= 8b
SET(STL_DIR "${STL_DIR}/${NDK_TOOLCHAIN_VERSION}")
ENDIF(EXISTS "${STL_DIR}/${NDK_TOOLCHAIN_VERSION}")
SET(STL_DIR "${STL_DIR}/${GCC_TOOLCHAIN_VERSION}")
ENDIF(EXISTS "${STL_DIR}/${GCC_TOOLCHAIN_VERSION}")
# Determine bin prefix for toolchain
FILE(GLOB _TOOLCHAIN_BIN_PREFIXES "${TOOLCHAIN_ROOT}/bin/${TOOLCHAIN_BIN_PREFIX}-*-gcc${TOOLCHAIN_BIN_SUFFIX}")
FILE(GLOB _TOOLCHAIN_BIN_PREFIXES "${GCC_TOOLCHAIN_ROOT}/bin/${TOOLCHAIN_BIN_PREFIX}-*-gcc${TOOLCHAIN_BIN_SUFFIX}")
IF(_TOOLCHAIN_BIN_PREFIXES)
LIST(GET _TOOLCHAIN_BIN_PREFIXES 0 _TOOLCHAIN_BIN_PREFIX)
STRING(REGEX REPLACE "${TOOLCHAIN_ROOT}/bin/([a-z0-9-]+)-gcc${TOOLCHAIN_BIN_SUFFIX}" "\\1" TOOLCHAIN_BIN_PREFIX "${_TOOLCHAIN_BIN_PREFIX}")
STRING(REGEX REPLACE "${GCC_TOOLCHAIN_ROOT}/bin/([a-z0-9-]+)-gcc${TOOLCHAIN_BIN_SUFFIX}" "\\1" TOOLCHAIN_BIN_PREFIX "${_TOOLCHAIN_BIN_PREFIX}")
ENDIF(_TOOLCHAIN_BIN_PREFIXES)
SET(STL_INCLUDE_DIR "${STL_DIR}/include")
@ -128,22 +151,48 @@ SET(STL_LIBRARY_DIR "${STL_DIR}/libs/${LIBRARY_ARCHITECTURE}")
SET(STL_INCLUDE_CPU_DIR "${STL_LIBRARY_DIR}/include")
SET(STL_LIBRARY "${STL_LIBRARY_DIR}/libgnustl_static.a")
SET(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_ROOT} ${PLATFORM_ROOT}/usr ${CMAKE_PREFIX_PATH} ${CMAKE_INSTALL_PREFIX} $ENV{EXTERNAL_ANDROID_PATH} CACHE string "Android find search path root")
MESSAGE(STATUS "STL include dir: ${STL_INCLUDE_DIR}")
MESSAGE(STATUS "STL library dir: ${STL_LIBRARY_DIR}")
SET(CMAKE_FIND_ROOT_PATH ${CLANG_TOOLCHAIN_ROOT} ${GCC_TOOLCHAIN_ROOT} ${PLATFORM_ROOT}/usr ${CMAKE_PREFIX_PATH} ${CMAKE_INSTALL_PREFIX} $ENV{EXTERNAL_ANDROID_PATH} CACHE string "Android find search path root")
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
INCLUDE_DIRECTORIES(${STL_INCLUDE_DIR} ${STL_INCLUDE_CPU_DIR})
MACRO(SET_TOOLCHAIN_BINARY _NAME _BINARY)
SET(${_NAME} ${TOOLCHAIN_ROOT}/bin/${TOOLCHAIN_BIN_PREFIX}-${_BINARY}${TOOLCHAIN_BIN_SUFFIX})
IF("${_BINARY}" MATCHES "clang")
SET(${_NAME} ${CLANG_TOOLCHAIN_ROOT}/bin/${_BINARY}${TOOLCHAIN_BIN_SUFFIX} CACHE PATH "" FORCE )
ELSE()
SET(${_NAME} ${GCC_TOOLCHAIN_ROOT}/bin/${TOOLCHAIN_BIN_PREFIX}-${_BINARY}${TOOLCHAIN_BIN_SUFFIX} CACHE PATH "" FORCE)
ENDIF()
ENDMACRO(SET_TOOLCHAIN_BINARY)
SET_TOOLCHAIN_BINARY(CMAKE_C_COMPILER gcc)
SET_TOOLCHAIN_BINARY(CMAKE_CXX_COMPILER g++)
# Force the compilers to GCC for Android
include (CMakeForceCompiler)
CMAKE_FORCE_C_COMPILER(${CMAKE_C_COMPILER} GNU)
CMAKE_FORCE_CXX_COMPILER(${CMAKE_CXX_COMPILER} GNU)
IF(CLANG)
SET_TOOLCHAIN_BINARY(CMAKE_C_COMPILER clang)
SET_TOOLCHAIN_BINARY(CMAKE_CXX_COMPILER clang++)
CMAKE_FORCE_C_COMPILER(${CMAKE_C_COMPILER} clang)
CMAKE_FORCE_CXX_COMPILER(${CMAKE_CXX_COMPILER} clang)
MESSAGE(STATUS "Using clang compiler")
ELSE()
SET_TOOLCHAIN_BINARY(CMAKE_C_COMPILER gcc)
SET_TOOLCHAIN_BINARY(CMAKE_CXX_COMPILER g++)
CMAKE_FORCE_C_COMPILER(${CMAKE_C_COMPILER} GNU)
CMAKE_FORCE_CXX_COMPILER(${CMAKE_CXX_COMPILER} GNU)
MESSAGE(STATUS "Using GCC compiler")
ENDIF()
SET_TOOLCHAIN_BINARY(CMAKE_STRIP strip)
SET_TOOLCHAIN_BINARY(CMAKE_AR ar)
SET_TOOLCHAIN_BINARY(CMAKE_LINKER ld)
SET_TOOLCHAIN_BINARY(CMAKE_NM nm)
SET_TOOLCHAIN_BINARY(CMAKE_OBJCOPY objcopy)
SET_TOOLCHAIN_BINARY(CMAKE_OBJDUMP objdump)
SET_TOOLCHAIN_BINARY(CMAKE_RANLIB ranlib)

View file

@ -57,6 +57,7 @@ ENDMACRO(DETECT_EXPRESS_VERSION)
IF(MSVC12)
DETECT_VC_VERSION("12.0")
SET(MSVC_TOOLSET "120")
IF(NOT MSVC12_REDIST_DIR)
# If you have VC++ 2013 Express, put x64/Microsoft.VC120.CRT/*.dll in ${EXTERNAL_PATH}/redist
@ -64,6 +65,7 @@ IF(MSVC12)
ENDIF(NOT MSVC11_REDIST_DIR)
ELSEIF(MSVC11)
DETECT_VC_VERSION("11.0")
SET(MSVC_TOOLSET "110")
IF(NOT MSVC11_REDIST_DIR)
# If you have VC++ 2012 Express, put x64/Microsoft.VC110.CRT/*.dll in ${EXTERNAL_PATH}/redist
@ -71,6 +73,7 @@ ELSEIF(MSVC11)
ENDIF(NOT MSVC11_REDIST_DIR)
ELSEIF(MSVC10)
DETECT_VC_VERSION("10.0")
SET(MSVC_TOOLSET "100")
IF(NOT MSVC10_REDIST_DIR)
# If you have VC++ 2010 Express, put x64/Microsoft.VC100.CRT/*.dll in ${EXTERNAL_PATH}/redist
@ -78,8 +81,10 @@ ELSEIF(MSVC10)
ENDIF(NOT MSVC10_REDIST_DIR)
ELSEIF(MSVC90)
DETECT_VC_VERSION("9.0")
SET(MSVC_TOOLSET "90")
ELSEIF(MSVC80)
DETECT_VC_VERSION("8.0")
SET(MSVC_TOOLSET "80")
ENDIF(MSVC12)
# If you plan to use VC++ compilers with WINE, set VC_DIR environment variable

View file

@ -13,7 +13,7 @@
IF(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
SET(MYSQL_FOUND TRUE)
ELSE(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
ELSE()
FIND_PATH(MYSQL_INCLUDE_DIR mysql.h
PATH_SUFFIXES mysql
@ -33,7 +33,7 @@ ELSE(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
PATHS
$ENV{ProgramFiles}/MySQL/*/lib/opt
$ENV{SystemDrive}/MySQL/*/lib/opt)
ELSE(WIN32 AND MSVC)
ELSE()
FIND_LIBRARY(MYSQL_LIBRARY_RELEASE NAMES mysqlclient
PATHS
/usr/lib
@ -51,31 +51,30 @@ ELSE(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
/usr/local/lib/mysql
/opt/local/lib/mysql5/mysql
)
ENDIF(WIN32 AND MSVC)
ENDIF()
IF(MYSQL_INCLUDE_DIR)
IF(MYSQL_LIBRARY_RELEASE)
SET(MYSQL_LIBRARIES optimized ${MYSQL_LIBRARY_RELEASE})
IF(MYSQL_LIBRARY_DEBUG)
SET(MYSQL_LIBRARIES ${MYSQL_LIBRARIES} debug ${MYSQL_LIBRARY_DEBUG})
ELSE(MYSQL_LIBRARY_DEBUG)
SET(MYSQL_LIBRARIES ${MYSQL_LIBRARIES} debug ${MYSQL_LIBRARY_RELEASE})
ENDIF(MYSQL_LIBRARY_DEBUG)
SET(MYSQL_LIBRARIES optimized ${MYSQL_LIBRARY_RELEASE} debug ${MYSQL_LIBRARY_DEBUG})
ELSE()
SET(MYSQL_LIBRARIES ${MYSQL_LIBRARY_RELEASE})
ENDIF()
FIND_PACKAGE(OpenSSL)
IF(OPENSSL_FOUND)
SET(MYSQL_LIBRARIES ${MYSQL_LIBRARIES} ${OPENSSL_LIBRARIES})
ENDIF(OPENSSL_FOUND)
ENDIF(MYSQL_LIBRARY_RELEASE)
ENDIF(MYSQL_INCLUDE_DIR)
ENDIF()
ENDIF()
ENDIF()
IF(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
SET(MYSQL_FOUND TRUE)
MESSAGE(STATUS "Found MySQL: ${MYSQL_INCLUDE_DIR}, ${MYSQL_LIBRARIES}")
ELSE(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
ELSE()
SET(MYSQL_FOUND FALSE)
MESSAGE(STATUS "MySQL not found.")
ENDIF(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
ENDIF()
MARK_AS_ADVANCED(MYSQL_LIBRARY_RELEASE MYSQL_LIBRARY_DEBUG)
ENDIF(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
ENDIF()

View file

@ -55,10 +55,12 @@ FIND_LIBRARY(SQUISH_LIBRARY_DEBUG
IF(SQUISH_INCLUDE_DIR)
IF(SQUISH_LIBRARY_RELEASE)
SET(SQUISH_FOUND "YES")
SET(SQUISH_LIBRARIES "optimized;${SQUISH_LIBRARY_RELEASE}")
IF(SQUISH_LIBRARY_DEBUG)
SET(SQUISH_LIBRARIES "${SQUISH_LIBRARIES};debug;${SQUISH_LIBRARY_DEBUG}")
ELSE(SQUISH_LIBRARY_DEBUG)
SET(SQUISH_LIBRARIES "${SQUISH_LIBRARIES};debug;${SQUISH_LIBRARY_RELEASE}")
MESSAGE("Debug Squish NOT found, using the release version!")
ENDIF(SQUISH_LIBRARY_DEBUG)
ENDIF(SQUISH_LIBRARY_RELEASE)
ENDIF(SQUISH_INCLUDE_DIR)

View file

@ -68,6 +68,10 @@ ENDIF(WINSDKCURRENT_VERSION_INCLUDE)
SET(WINSDKENV_DIR $ENV{WINSDK_DIR})
IF(NOT WINSDKENV_DIR)
SET(WINSDKENV_DIR $ENV{WindowsSDKDir})
ENDIF(NOT WINSDKENV_DIR)
MACRO(FIND_WINSDK_VERSION_HEADERS)
IF(WINSDK_DIR AND NOT WINSDK_VERSION)
# Search version in headers
@ -78,7 +82,6 @@ MACRO(FIND_WINSDK_VERSION_HEADERS)
)
IF(_MSI_FILE)
# Look for Windows SDK 8.0
FILE(STRINGS ${_MSI_FILE} _CONTENT REGEX "^#ifndef NTDDI_WIN8")
@ -181,7 +184,7 @@ MACRO(USE_CURRENT_WINSDK)
# Look for Windows.h because there are several paths
IF(EXISTS ${_INCLUDE}/Windows.h)
STRING(REGEX REPLACE "/(include|INCLUDE|Include)(.*)" "" WINSDK_DIR ${_INCLUDE})
MESSAGE(STATUS "Found Windows SDK from include environment variable in ${WINSDK_DIR}")
MESSAGE(STATUS "Found Windows SDK in INCLUDE environment variable: ${WINSDK_DIR}")
BREAK()
ENDIF(EXISTS ${_INCLUDE}/Windows.h)
ENDFOREACH(_INCLUDE)
@ -280,6 +283,13 @@ FIND_PATH(WINSDK_SHARED_INCLUDE_DIR d3d9.h
${WINSDK_DIR}/Include
)
# directory where OpenGL headers are found
FIND_PATH(WINSDK_OPENGL_INCLUDE_DIR GL.h
HINTS
${WINSDK_DIR}/Include/gl
${WINSDK_DIR}/Include
)
# directory where all libraries are found
FIND_PATH(WINSDK_LIBRARY_DIR ComCtl32.lib
HINTS
@ -303,7 +313,7 @@ FIND_PROGRAM(WINSDK_MIDL midl
IF(WINSDK_INCLUDE_DIR)
SET(WINSDK_FOUND ON)
SET(WINSDK_INCLUDE_DIRS ${WINSDK_INCLUDE_DIR} ${WINSDK_SHARED_INCLUDE_DIR})
SET(WINSDK_INCLUDE_DIRS ${WINSDK_INCLUDE_DIR} ${WINSDK_SHARED_INCLUDE_DIR} ${WINSDK_OPENGL_INCLUDE_DIR})
SET(CMAKE_LIBRARY_PATH ${WINSDK_LIBRARY_DIR} ${CMAKE_LIBRARY_PATH})
INCLUDE_DIRECTORIES(${WINSDK_INCLUDE_DIRS})

View file

@ -13,38 +13,44 @@ IF(SOURCE_DIR)
IF(NOT ROOT_DIR AND SOURCE_DIR)
SET(ROOT_DIR ${SOURCE_DIR})
ENDIF(NOT ROOT_DIR AND SOURCE_DIR)
ENDIF()
IF(NOT SOURCE_DIR AND ROOT_DIR)
SET(SOURCE_DIR ${ROOT_DIR})
ENDIF(NOT SOURCE_DIR AND ROOT_DIR)
ELSE(SOURCE_DIR)
ENDIF()
ELSE()
SET(SOURCE_DIR ${CMAKE_SOURCE_DIR})
SET(ROOT_DIR ${CMAKE_SOURCE_DIR})
ENDIF(SOURCE_DIR)
ENDIF()
MACRO(NOW RESULT)
IF (WIN32)
EXECUTE_PROCESS(COMMAND "wmic" "os" "get" "localdatetime" OUTPUT_VARIABLE DATETIME)
IF(NOT DATETIME MATCHES "ERROR")
STRING(REGEX REPLACE ".*\n([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9]).*" "\\1-\\2-\\3 \\4:\\5:\\6" ${RESULT} "${DATETIME}")
ENDIF(NOT DATETIME MATCHES "ERROR")
ENDIF()
ELSEIF(UNIX)
EXECUTE_PROCESS(COMMAND "date" "+%Y-%m-%d %H:%M:%S" OUTPUT_VARIABLE DATETIME)
STRING(REGEX REPLACE "([0-9: -]+).*" "\\1" ${RESULT} "${DATETIME}")
ELSE (WIN32)
ELSE()
MESSAGE(SEND_ERROR "date not implemented")
SET(${RESULT} "0000-00-00 00:00:00")
ENDIF (WIN32)
ENDIF()
ENDMACRO(NOW)
IF(EXISTS "${ROOT_DIR}/.svn/")
FIND_PACKAGE(Subversion)
FIND_PACKAGE(Subversion QUIET)
IF(SUBVERSION_FOUND)
Subversion_WC_INFO(${ROOT_DIR} ER)
SET(REVISION ${ER_WC_REVISION})
ENDIF(SUBVERSION_FOUND)
FIND_PACKAGE(TortoiseSVN QUIET)
IF(TORTOISESVN_FOUND)
TORTOISESVN_GET_REVISION(${ROOT_DIR} REVISION)
ENDIF(TORTOISESVN_FOUND)
ENDIF(EXISTS "${ROOT_DIR}/.svn/")
IF(EXISTS "${ROOT_DIR}/.hg/")
@ -55,8 +61,8 @@ IF(EXISTS "${ROOT_DIR}/.hg/")
SET(REVISION ${ER_WC_REVISION})
SET(CHANGESET ${ER_WC_CHANGESET})
SET(BRANCH ${ER_WC_BRANCH})
ENDIF(MERCURIAL_FOUND)
ENDIF(EXISTS "${ROOT_DIR}/.hg/")
ENDIF()
ENDIF()
# if processing exported sources, use "revision" file if exists
IF(SOURCE_DIR AND NOT DEFINED REVISION)
@ -64,8 +70,8 @@ IF(SOURCE_DIR AND NOT DEFINED REVISION)
IF(EXISTS ${REVISION_FILE})
FILE(STRINGS ${REVISION_FILE} REVISION LIMIT_COUNT 1)
MESSAGE(STATUS "Read revision ${REVISION} from file")
ENDIF(EXISTS ${REVISION_FILE})
ENDIF(SOURCE_DIR AND NOT DEFINED REVISION)
ENDIF()
ENDIF()
IF(SOURCE_DIR AND DEFINED REVISION)
IF(EXISTS ${SOURCE_DIR}/revision.h.in)
@ -73,5 +79,5 @@ IF(SOURCE_DIR AND DEFINED REVISION)
NOW(BUILD_DATE)
CONFIGURE_FILE(${SOURCE_DIR}/revision.h.in revision.h.txt)
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy revision.h.txt revision.h) # copy_if_different
ENDIF(EXISTS ${SOURCE_DIR}/revision.h.in)
ENDIF(SOURCE_DIR AND DEFINED REVISION)
ENDIF()
ENDIF()

View file

@ -6,6 +6,9 @@ IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)
# Declare CMAKE_CONFIGURATION_TYPES before PROJECT
SET(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
###
# Helper macro that generates .pc and installs it.
# Argument: name - the name of the .pc package, e.g. "nel-pacs.pc"
@ -384,8 +387,6 @@ MACRO(NL_SETUP_BUILD)
# Debug = NL_DEBUG
# Release = NL_RELEASE
SET(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
IF(CMAKE_BUILD_TYPE MATCHES "Debug")
SET(NL_BUILD_MODE "NL_DEBUG")
ELSE(CMAKE_BUILD_TYPE MATCHES "Debug")

View file

@ -147,12 +147,21 @@ public:
CRGBA bkup = rCS.Color;
rCS.Color = _ShadeColor;
rCS.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8);
rCS.render2D(*_Driver, x+_ShadeExtent, z-_ShadeExtent, _HotSpot, _ScaleX, _ScaleZ);
if (_ShadeOutline)
{
rCS.render2D(*_Driver, x-_ShadeExtent, z-_ShadeExtent, _HotSpot, _ScaleX, _ScaleZ);
rCS.render2D(*_Driver, x-_ShadeExtent, z+_ShadeExtent, _HotSpot, _ScaleX, _ScaleZ);
rCS.render2D(*_Driver, x+_ShadeExtent, z+_ShadeExtent, _HotSpot, _ScaleX, _ScaleZ);
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);
}
else
{
rCS.render2D(*_Driver, x+_ShadeExtent, z-_ShadeExtent, _HotSpot, _ScaleX, _ScaleZ);
}
rCS.Color= bkup;
}
@ -171,12 +180,21 @@ public:
CRGBA bkup = rCS.Color;
rCS.Color= _ShadeColor;
rCS.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8);
rCS.render2DClip(*_Driver, rdrBuffer, x+_ShadeExtent, z-_ShadeExtent, xmin, ymin, xmax, ymax);
if (_ShadeOutline)
{
rCS.render2DClip(*_Driver, rdrBuffer, x-_ShadeExtent, z-_ShadeExtent, xmin, ymin, xmax, ymax);
rCS.render2DClip(*_Driver, rdrBuffer, x-_ShadeExtent, z+_ShadeExtent, xmin, ymin, xmax, ymax);
rCS.render2DClip(*_Driver, rdrBuffer, x+_ShadeExtent, z+_ShadeExtent, xmin, ymin, xmax, ymax);
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);
}
else
{
rCS.render2DClip(*_Driver, rdrBuffer, x+_ShadeExtent, z-_ShadeExtent, xmin, ymin, xmax, ymax);
}
rCS.Color= bkup;
}
@ -195,12 +213,21 @@ public:
CRGBA bkup = rCS.Color;
rCS.Color= _ShadeColor;
rCS.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8);
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+_ShadeExtent, y-_ShadeExtent, depth, xmin, ymin, xmax, ymax);
if (_ShadeOutline)
{
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x-_ShadeExtent, y-_ShadeExtent, depth, xmin, ymin, xmax, ymax);
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x-_ShadeExtent, y+_ShadeExtent, depth, xmin, ymin, xmax, ymax);
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+_ShadeExtent, y+_ShadeExtent, depth, xmin, ymin, xmax, ymax);
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);
}
else
{
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+_ShadeExtent, y-_ShadeExtent, depth, xmin, ymin, xmax, ymax);
}
rCS.Color= bkup;
}
@ -221,12 +248,21 @@ public:
CRGBA bkup = _TempString.Color;
_TempString.Color = _ShadeColor;
_TempString.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8);
_TempString.render2D(*_Driver,x+_ShadeExtent,z-_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ);
if (_ShadeOutline)
{
_TempString.render2D(*_Driver,x-_ShadeExtent,z-_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x-_ShadeExtent,z+_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x+_ShadeExtent,z+_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ);
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);
}
else
{
_TempString.render2D(*_Driver,x+_ShadeExtent,z-_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ);
}
_TempString.Color = bkup;
}
@ -251,12 +287,21 @@ public:
CRGBA bkup = _TempString.Color;
_TempString.Color = _ShadeColor;
_TempString.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8);
_TempString.render2D(*_Driver,x+_ShadeExtent,z-_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ);
if (_ShadeOutline)
{
_TempString.render2D(*_Driver,x-_ShadeExtent,z-_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x-_ShadeExtent,z+_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ);
_TempString.render2D(*_Driver,x+_ShadeExtent,z+_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ);
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);
}
else
{
_TempString.render2D(*_Driver,x+_ShadeExtent,z-_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ);
}
_TempString.Color = bkup;
}

View file

@ -218,7 +218,7 @@ protected:
date*= previous->OODeltaTime;
NLMISC::clamp(date, 0,1);
date = this->ease(previous, date);
date = this->ease(previous, (float)date);
float hb[4];
this->computeHermiteBasis(date, hb);

View file

@ -51,6 +51,7 @@ namespace NLGUI
// Init part
virtual bool parse (xmlNodePtr cur,CInterfaceGroup * parentGroup);
virtual void checkCoords();
virtual void updateCoords();
virtual uint32 getMemory() { return (uint32)(sizeof(*this)+_Id.size()); }

View file

@ -528,7 +528,7 @@ namespace NLGUI
CCellParams () : BgColor(0,0,0,0)
{
Align = CGroupCell::Left;
VAlign = CGroupCell::Top;
VAlign = CGroupCell::Middle;
LeftMargin = 0;
NoWrap = false;
}

View file

@ -78,6 +78,9 @@ namespace NLGUI
// The Width you want in pixel. This is the <td width="100"> parameter
sint32 WidthWanted;
sint32 ColSpan;
sint32 RowSpan;
sint32 TableColumnIndex;
// The min height of the cell
sint32 Height;
@ -142,6 +145,7 @@ namespace NLGUI
// Table borders
sint32 Border;
NLMISC::CRGBA BorderColor;
sint32 CellPadding;
sint32 CellSpacing;
@ -191,13 +195,14 @@ namespace NLGUI
WidthMax = 0;
WidthWanted = 0;
TableRatio = 0;
Height = 0;
RowSpan = 1;
}
sint32 Width;
sint32 Height;
sint32 WidthWanted;
sint32 WidthMax;
float TableRatio;
sint32 RowSpan;
};
// Table row

View file

@ -25,6 +25,8 @@ extern "C"
#include "WWWInit.h"
}
#include "nel/misc/rgba.h"
namespace NLGUI
{
class CCtrlBaseButton;
@ -79,6 +81,7 @@ namespace NLGUI
HTML_ATTR(TABLE,ALIGN) = 0,
HTML_ATTR(TABLE,BGCOLOR),
HTML_ATTR(TABLE,BORDER),
HTML_ATTR(TABLE,BORDERCOLOR),
HTML_ATTR(TABLE,CELLPADDING),
HTML_ATTR(TABLE,CELLSPACING),
HTML_ATTR(TABLE,CLASS),

View file

@ -0,0 +1,327 @@
/*
Copyright (c) 2009-2014, Jan BOON
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef NLMISC_CALLBACK_H
#define NLMISC_CALLBACK_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
#include <nel/misc/debug.h>
// Project includes
namespace NLMISC {
#define NLMISC_CALLBACK_TEMPLATE \
/** \
* \brief NLMISC_CALLBACK_ARGS_CLASS \
* \date 2009-03-03 18:09GMT \
* \author Jan BOON \
* Callback template \
*/ \
template<typename TReturn NLMISC_CALLBACK_ARGS_TYPENAME> \
class NLMISC_CALLBACK_ARGS_CLASS \
{ \
/* Very simple reference counting callback base */ \
class CCallbackBase \
{ \
public: \
CCallbackBase() : m_RefCount(0) \
{ \
\
} \
\
virtual ~CCallbackBase() \
{ \
nlassert(!m_RefCount); \
} \
\
void refAdd() \
{ \
++m_RefCount; \
} \
\
void refRemove() \
{ \
--m_RefCount; \
if (!m_RefCount) \
delete this; \
} \
\
virtual TReturn callback(NLMISC_CALLBACK_ARGS_DECL) = 0; \
\
virtual bool equals(const CCallbackBase *callbackBase) = 0; \
\
/* disable copy */ \
CCallbackBase(const CCallbackBase &); \
CCallbackBase &operator=(const CCallbackBase &); \
\
private: \
uint m_RefCount; \
}; \
\
typedef TReturn TCallbackFunction(NLMISC_CALLBACK_ARGS_DECL); \
class CCallbackFunction : public CCallbackBase \
{ \
public: \
CCallbackFunction(TCallbackFunction *callbackFunction) : m_CallbackFunction(callbackFunction) \
{ \
nlassert(m_CallbackFunction); \
} \
\
virtual ~CCallbackFunction() \
{ \
m_CallbackFunction = NULL; \
} \
\
virtual TReturn callback(NLMISC_CALLBACK_ARGS_DECL) \
{ \
return m_CallbackFunction(NLMISC_CALLBACK_ARGS_IMPL); \
} \
\
virtual bool equals(const CCallbackBase *callbackBase) \
{ \
const CCallbackFunction *callbackFunction = \
dynamic_cast<const CCallbackFunction *>(callbackBase); \
if (!callbackFunction) return false; \
return m_CallbackFunction == callbackFunction->m_CallbackFunction; \
} \
\
private: \
TCallbackFunction *m_CallbackFunction; \
}; \
\
template<typename TClass> \
class CCallbackMethod : public CCallbackBase \
{ \
typedef TReturn (TClass::*TCallbackMethod)(NLMISC_CALLBACK_ARGS_DECL); \
public: \
CCallbackMethod(TClass *callbackObject, TCallbackMethod callbackMethod) : m_CallbackObject(callbackObject), m_CallbackMethod(callbackMethod) \
{ \
nlassert(m_CallbackObject); \
nlassert(m_CallbackMethod); \
} \
\
virtual ~CCallbackMethod() \
{ \
m_CallbackObject = NULL; \
m_CallbackMethod = NULL; \
} \
\
virtual TReturn callback(NLMISC_CALLBACK_ARGS_DECL) \
{ \
return (m_CallbackObject->*m_CallbackMethod)(NLMISC_CALLBACK_ARGS_IMPL); \
} \
\
virtual bool equals(const CCallbackBase *callbackBase) \
{ \
const CCallbackMethod *callbackMethod = \
dynamic_cast<const CCallbackMethod *>(callbackBase); \
if (!callbackMethod) return false; \
return m_CallbackObject == callbackMethod->m_CallbackObject \
&& m_CallbackMethod == callbackMethod->m_CallbackMethod; \
} \
\
private: \
TClass *m_CallbackObject; \
TCallbackMethod m_CallbackMethod; \
}; \
\
public: \
CCallback() : m_CallbackBase(NULL) \
{ \
\
} \
\
CCallback(TCallbackFunction *callbackFunction) : m_CallbackBase(new CCallbackFunction(callbackFunction)) \
{ \
nlassert(m_CallbackBase); \
m_CallbackBase->refAdd(); \
} \
\
template<typename TClass> \
CCallback(TClass *callbackObject, TReturn (TClass::*callbackMethod)(NLMISC_CALLBACK_ARGS_DECL)) : m_CallbackBase(new CCallbackMethod<TClass>(callbackObject, callbackMethod)) \
{ \
nlassert(m_CallbackBase); \
m_CallbackBase->refAdd(); \
} \
\
CCallback(const CCallback &callback) \
{ \
m_CallbackBase = callback.m_CallbackBase; \
if (m_CallbackBase) \
m_CallbackBase->refAdd(); \
} \
\
CCallback &operator=(const CCallback &callback) \
{ \
if (m_CallbackBase != callback.m_CallbackBase) \
{ \
if (m_CallbackBase) \
m_CallbackBase->refRemove(); \
m_CallbackBase = callback.m_CallbackBase; \
if (m_CallbackBase) \
m_CallbackBase->refAdd(); \
} \
return *this; \
} \
\
~CCallback() \
{ \
if (m_CallbackBase) \
{ \
m_CallbackBase->refRemove(); \
m_CallbackBase = NULL; \
} \
} \
\
TReturn callback(NLMISC_CALLBACK_ARGS_DECL) \
{ \
nlassert(m_CallbackBase); \
return m_CallbackBase->callback(NLMISC_CALLBACK_ARGS_IMPL); \
} \
\
TReturn operator()(NLMISC_CALLBACK_ARGS_DECL) \
{ \
nlassert(m_CallbackBase); \
return m_CallbackBase->callback(NLMISC_CALLBACK_ARGS_IMPL); \
} \
\
bool valid() const \
{ \
return m_CallbackBase != NULL; \
} \
\
operator bool() const \
{ \
return m_CallbackBase != NULL; \
} \
\
bool operator==(const CCallback &callback) \
{ \
return m_CallbackBase->equals(callback.m_CallbackBase); \
} \
\
private: \
CCallbackBase *m_CallbackBase; \
\
}; /* class CCallback */ \
template<typename TReturn, typename TArgsA = void, typename TArgsB = void, typename TArgsC = void, typename TArgsD = void, typename TArgsE = void, typename TArgsF = void, typename TArgsG = void, typename TDummy = void>
class CCallback;
#define NLMISC_CALLBACK_ARGS_CLASS CCallback<TReturn, void, void, void, void, void, void, void, void>
#define NLMISC_CALLBACK_ARGS_TYPENAME
#define NLMISC_CALLBACK_ARGS_DECL
#define NLMISC_CALLBACK_ARGS_IMPL
NLMISC_CALLBACK_TEMPLATE
#undef NLMISC_CALLBACK_ARGS_CLASS
#undef NLMISC_CALLBACK_ARGS_TYPENAME
#undef NLMISC_CALLBACK_ARGS_DECL
#undef NLMISC_CALLBACK_ARGS_IMPL
#define NLMISC_CALLBACK_ARGS_CLASS CCallback<TReturn, TArgsA, void, void, void, void, void, void, void>
#define NLMISC_CALLBACK_ARGS_TYPENAME , typename TArgsA
#define NLMISC_CALLBACK_ARGS_DECL TArgsA argsA
#define NLMISC_CALLBACK_ARGS_IMPL argsA
NLMISC_CALLBACK_TEMPLATE
#undef NLMISC_CALLBACK_ARGS_CLASS
#undef NLMISC_CALLBACK_ARGS_TYPENAME
#undef NLMISC_CALLBACK_ARGS_DECL
#undef NLMISC_CALLBACK_ARGS_IMPL
#define NLMISC_CALLBACK_ARGS_CLASS CCallback<TReturn, TArgsA, TArgsB, void, void, void, void, void, void>
#define NLMISC_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB
#define NLMISC_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB
#define NLMISC_CALLBACK_ARGS_IMPL argsA, argsB
NLMISC_CALLBACK_TEMPLATE
#undef NLMISC_CALLBACK_ARGS_CLASS
#undef NLMISC_CALLBACK_ARGS_TYPENAME
#undef NLMISC_CALLBACK_ARGS_DECL
#undef NLMISC_CALLBACK_ARGS_IMPL
#define NLMISC_CALLBACK_ARGS_CLASS CCallback<TReturn, TArgsA, TArgsB, TArgsC, void, void, void, void, void>
#define NLMISC_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB, typename TArgsC
#define NLMISC_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB, TArgsC argsC
#define NLMISC_CALLBACK_ARGS_IMPL argsA, argsB, argsC
NLMISC_CALLBACK_TEMPLATE
#undef NLMISC_CALLBACK_ARGS_CLASS
#undef NLMISC_CALLBACK_ARGS_TYPENAME
#undef NLMISC_CALLBACK_ARGS_DECL
#undef NLMISC_CALLBACK_ARGS_IMPL
#define NLMISC_CALLBACK_ARGS_CLASS CCallback<TReturn, TArgsA, TArgsB, TArgsC, TArgsD, void, void, void, void>
#define NLMISC_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB, typename TArgsC, typename TArgsD
#define NLMISC_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB, TArgsC argsC, TArgsD argsD
#define NLMISC_CALLBACK_ARGS_IMPL argsA, argsB, argsC, argsD
NLMISC_CALLBACK_TEMPLATE
#undef NLMISC_CALLBACK_ARGS_CLASS
#undef NLMISC_CALLBACK_ARGS_TYPENAME
#undef NLMISC_CALLBACK_ARGS_DECL
#undef NLMISC_CALLBACK_ARGS_IMPL
#define NLMISC_CALLBACK_ARGS_CLASS CCallback<TReturn, TArgsA, TArgsB, TArgsC, TArgsD, TArgsE, void, void, void>
#define NLMISC_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB, typename TArgsC, typename TArgsD, typename TArgsE
#define NLMISC_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB, TArgsC argsC, TArgsD argsD, TArgsE argsE
#define NLMISC_CALLBACK_ARGS_IMPL argsA, argsB, argsC, argsD, argsE
NLMISC_CALLBACK_TEMPLATE
#undef NLMISC_CALLBACK_ARGS_CLASS
#undef NLMISC_CALLBACK_ARGS_TYPENAME
#undef NLMISC_CALLBACK_ARGS_DECL
#undef NLMISC_CALLBACK_ARGS_IMPL
#define NLMISC_CALLBACK_ARGS_CLASS CCallback<TReturn, TArgsA, TArgsB, TArgsC, TArgsD, TArgsE, TArgsF, void, void>
#define NLMISC_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB, typename TArgsC, typename TArgsD, typename TArgsE, typename TArgsF
#define NLMISC_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB, TArgsC argsC, TArgsD argsD, TArgsE argsE, TArgsF argsF
#define NLMISC_CALLBACK_ARGS_IMPL argsA, argsB, argsC, argsD, argsE, argsF
NLMISC_CALLBACK_TEMPLATE
#undef NLMISC_CALLBACK_ARGS_CLASS
#undef NLMISC_CALLBACK_ARGS_TYPENAME
#undef NLMISC_CALLBACK_ARGS_DECL
#undef NLMISC_CALLBACK_ARGS_IMPL
#define NLMISC_CALLBACK_ARGS_CLASS CCallback<TReturn, TArgsA, TArgsB, TArgsC, TArgsD, TArgsE, TArgsF, TArgsG, void>
#define NLMISC_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB, typename TArgsC, typename TArgsD, typename TArgsE, typename TArgsF, typename TArgsG
#define NLMISC_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB, TArgsC argsC, TArgsD argsD, TArgsE argsE, TArgsF argsF, TArgsG argsG
#define NLMISC_CALLBACK_ARGS_IMPL argsA, argsB, argsC, argsD, argsE, argsF, argsG
NLMISC_CALLBACK_TEMPLATE
#undef NLMISC_CALLBACK_ARGS_CLASS
#undef NLMISC_CALLBACK_ARGS_TYPENAME
#undef NLMISC_CALLBACK_ARGS_DECL
#undef NLMISC_CALLBACK_ARGS_IMPL
#undef NLMISC_CALLBACK_ARGS_CLASSNAME
#undef NLMISC_CALLBACK_TEMPLATE
} /* namespace NLMISC */
#endif /* #ifndef NLMISC_CALLBACK_H */
/* end of file */

View file

@ -28,7 +28,11 @@
# endif
#elif defined(NL_OS_UNIX)
# include <pthread.h> // PThread
# include <semaphore.h> // PThread POSIX semaphores
# ifdef NL_OS_MAC
# include <dispatch/dispatch.h>
# else
# include <semaphore.h> // PThread POSIX semaphores
# endif
# include <unistd.h>
# define __forceinline
# ifdef NL_OS_MAC
@ -532,8 +536,10 @@ private:
#ifdef NL_OS_WINDOWS
TNelRtlCriticalSection _Cs;
#elif defined NL_OS_UNIX
sem_t _Sem;
#elif defined(NL_OS_MAC)
dispatch_semaphore_t _Sem;
#elif defined(NL_OS_UNIX)
sem_t _Sem;
#else
# error "No fair mutex implementation for this OS"
#endif

View file

@ -507,6 +507,13 @@ public:
*/
static bool makePathRelative (const char *basePath, std::string &relativePath);
/** Make path absolute
* \param relativePath - The relative path
* \param directory - the directory to which the path is relative to
* returns the absolute path, or empty if something went wrong.
*/
static std::string makePathAbsolute (const std::string &relativePath, const std::string &directory );
/** If File in this list is added more than one in an addSearchPath, it doesn't launch a warning.
*/
static void addIgnoredDoubleFile(const std::string &ignoredFile);

View file

@ -1,3 +1,4 @@
ADD_SUBDIRECTORY(callback)
ADD_SUBDIRECTORY(command)
ADD_SUBDIRECTORY(configfile)
ADD_SUBDIRECTORY(debug)

View file

@ -0,0 +1,9 @@
FILE(GLOB SRC *.cpp)
ADD_EXECUTABLE(nl_sample_callback ${SRC})
TARGET_LINK_LIBRARIES(nl_sample_callback nelmisc)
NL_DEFAULT_PROPS(nl_sample_callback "NeL, Samples, Misc: Callback")
NL_ADD_RUNTIME_FLAGS(nl_sample_callback)
INSTALL(TARGETS nl_sample_callback RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT samplesmisc)

View file

@ -0,0 +1,62 @@
/*
Copyright (c) 2014, Jan BOON
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <nel/misc/callback.h>
#include <nel/misc/debug.h>
class CTestClass
{
public:
void helloWorld(int y)
{
nldebug("Method call: %i, %i", y, x);
}
int x;
};
void functionCall(int i)
{
nldebug("Function call: %i", i);
}
typedef NLMISC::CCallback<void, int> TCallbackType;
int main(int argc, char **argv)
{
CTestClass tc;
tc.x = 42;
TCallbackType cbMethod = TCallbackType(&tc, &CTestClass::helloWorld);
TCallbackType cbFunction = TCallbackType(functionCall);
cbMethod(100);
cbFunction(99);
getchar();
return EXIT_SUCCESS;
}

View file

@ -463,6 +463,7 @@ bool CDriverGL::unInit()
{
nlwarning("Can't unregister NLClass");
}
_Registered = 0;
// Restaure monitor color parameters
if (_NeedToRestaureGammaRamp)

View file

@ -109,10 +109,6 @@ void UDriver::purgeMemory()
// ***************************************************************************
// ***************************************************************************
bool CDriverUser::_StaticInit= false;
// ***************************************************************************
CDriverUser::CDriverUser (uintptr_t windowIcon, TDriver driver, emptyProc exitFunc)
{
@ -122,16 +118,7 @@ CDriverUser::CDriverUser (uintptr_t windowIcon, TDriver driver, emptyProc exitFu
nlassert((uint)IDriver::iconCount == (uint)UDriver::iconCount);
// Static Initialisation.
if(!_StaticInit)
{
_StaticInit= true;
// Register basic serial.
NL3D::registerSerial3d();
// Register basic csene.
CScene::registerBasics();
}
NL3D::init3d();
_Driver = NULL;

View file

@ -19,19 +19,35 @@
#include "nel/3d/init_3d.h"
#include <cfloat>
#include "nel/3d/scene.h"
#include "nel/3d/register_3d.h"
namespace
{
static bool _Initialized = false;
}
namespace NL3D
{
void init3d ()
{
if( _Initialized )
return;
// Init for windows
#ifdef NL_OS_WINDOWS
// Enable FPU exceptions
// Enable divid by zero and overflow exception
_control87 (_EM_INVALID|_EM_DENORMAL/*|_EM_ZERODIVIDE|_EM_OVERFLOW*/|_EM_UNDERFLOW|_EM_INEXACT, _MCW_EM);
//_control87 (_EM_INVALID|_EM_DENORMAL/*|_EM_ZERODIVIDE|_EM_OVERFLOW*/|_EM_UNDERFLOW|_EM_INEXACT, _MCW_EM);
#endif // NL_OS_WINDOWS
NL3D::registerSerial3d();
CScene::registerBasics();
_Initialized = true;
}
} // NL3D

View file

@ -17,7 +17,86 @@
#include "std3d.h"
#include "nel/3d/vertex_program_parse.h"
enum TArguments
{
#ifdef NL_LITTLE_ENDIAN
ADD = 1094992928,
ARL = 1095912480,
BFC0 = 1111900976,
BFC1 = 1111900977,
COL0 = 1129270320,
COL1 = 1129270321,
DP3 = 1146106656,
DP4 = 1146106912,
DST = 1146311712,
END = 1162757152,
EXP = 1163415584,
EXPP = 1163415632,
FOGC = 1179600707,
HPOS = 1213222739,
LIT = 1279874080,
LOG = 1280263968,
MAD = 1296122912,
MAX = 1296128032,
MIN = 1296649760,
MOV = 1297045024,
MUL = 1297435680,
NRML = 1314016588,
OPOS = 1330663251,
PSIZ = 1347635546,
RCP = 1380143136,
RSQ = 1381191968,
SGE = 1397179680,
SLT = 1397511200,
TEX0 = 1413830704,
TEX1 = 1413830705,
TEX2 = 1413830706,
TEX3 = 1413830707,
TEX4 = 1413830708,
TEX5 = 1413830709,
TEX6 = 1413830710,
TEX7 = 1413830711,
WGHT = 1464289364,
#else
ADD = 541344833,
ARL = 541872705,
BFC0 = 809715266,
BFC1 = 826492482,
COL0 = 810307395,
COL1 = 827084611,
DP3 = 540233796,
DP4 = 540299332,
DST = 542397252,
END = 541347397,
EXP = 542136389,
EXPP = 1347442757,
FOGC = 1128746822,
HPOS = 1397706824,
LIT = 542394700,
LOG = 541544268,
MAD = 541344077,
MAX = 542654797,
MIN = 542001485,
MOV = 542527309,
MUL = 541873485,
NRML = 1280135758,
OPOS = 1397706831,
PSIZ = 1514754896,
RCP = 542131026,
RSQ = 542200658,
SGE = 541411155,
SLT = 542395475,
TEX0 = 811091284,
TEX1 = 827868500,
TEX2 = 844645716,
TEX3 = 861422932,
TEX4 = 878200148,
TEX5 = 894977364,
TEX6 = 911754580,
TEX7 = 928531796,
WGHT = 1414022999,
#endif
};
//=====================================
bool CVPParser::parseWriteMask(uint &mask, std::string &errorOutput)
@ -256,23 +335,23 @@ bool CVPParser::parseInputRegister(CVPOperand &operand, std::string &errorOutput
strValue |= ((uint32) *_CurrChar) << (8 * (3 - k));
++_CurrChar;
}
switch (strValue)
switch ((TArguments)strValue)
{
case 'OPOS': operand.Value.InputRegisterValue = CVPOperand::IPosition; break;
case 'WGHT': operand.Value.InputRegisterValue = CVPOperand::IWeight; break;
case 'NRML': operand.Value.InputRegisterValue = CVPOperand::INormal; break;
case 'COL0': operand.Value.InputRegisterValue = CVPOperand::IPrimaryColor; break;
case 'COL1': operand.Value.InputRegisterValue = CVPOperand::ISecondaryColor; break;
case 'FOGC': operand.Value.InputRegisterValue = CVPOperand::IFogCoord; break;
case OPOS: operand.Value.InputRegisterValue = CVPOperand::IPosition; break;
case WGHT: operand.Value.InputRegisterValue = CVPOperand::IWeight; break;
case NRML: operand.Value.InputRegisterValue = CVPOperand::INormal; break;
case COL0: operand.Value.InputRegisterValue = CVPOperand::IPrimaryColor; break;
case COL1: operand.Value.InputRegisterValue = CVPOperand::ISecondaryColor; break;
case FOGC: operand.Value.InputRegisterValue = CVPOperand::IFogCoord; break;
// texture argument
case 'TEX0':
case 'TEX1':
case 'TEX2':
case 'TEX3':
case 'TEX4':
case 'TEX5':
case 'TEX6':
case 'TEX7':
case TEX0:
case TEX1:
case TEX2:
case TEX3:
case TEX4:
case TEX5:
case TEX6:
case TEX7:
operand.Value.InputRegisterValue = (CVPOperand::EInputRegister) (((CVPOperand::ITex0 + strValue) & 0xff) - '0');
break;
default:
@ -384,23 +463,23 @@ bool CVPParser::parseOutputRegister(CVPOperand &operand, std::string &errorOutpu
++_CurrChar;
}
// convert to enum
switch(strValue)
switch((TArguments)strValue)
{
case 'HPOS': operand.Value.OutputRegisterValue = CVPOperand::OHPosition; break;
case 'COL0': operand.Value.OutputRegisterValue = CVPOperand::OPrimaryColor; break;
case 'COL1': operand.Value.OutputRegisterValue = CVPOperand::OSecondaryColor; break;
case 'BFC0': operand.Value.OutputRegisterValue = CVPOperand::OBackFacePrimaryColor; break;
case 'BFC1': operand.Value.OutputRegisterValue = CVPOperand::OBackFaceSecondaryColor; break;
case 'FOGC': operand.Value.OutputRegisterValue = CVPOperand::OFogCoord; break;
case 'PSIZ': operand.Value.OutputRegisterValue = CVPOperand::OPointSize; break;
case 'TEX0': operand.Value.OutputRegisterValue = CVPOperand::OTex0; break;
case 'TEX1': operand.Value.OutputRegisterValue = CVPOperand::OTex1; break;
case 'TEX2': operand.Value.OutputRegisterValue = CVPOperand::OTex2; break;
case 'TEX3': operand.Value.OutputRegisterValue = CVPOperand::OTex3; break;
case 'TEX4': operand.Value.OutputRegisterValue = CVPOperand::OTex4; break;
case 'TEX5': operand.Value.OutputRegisterValue = CVPOperand::OTex5; break;
case 'TEX6': operand.Value.OutputRegisterValue = CVPOperand::OTex6; break;
case 'TEX7': operand.Value.OutputRegisterValue = CVPOperand::OTex7; break;
case HPOS: operand.Value.OutputRegisterValue = CVPOperand::OHPosition; break;
case COL0: operand.Value.OutputRegisterValue = CVPOperand::OPrimaryColor; break;
case COL1: operand.Value.OutputRegisterValue = CVPOperand::OSecondaryColor; break;
case BFC0: operand.Value.OutputRegisterValue = CVPOperand::OBackFacePrimaryColor; break;
case BFC1: operand.Value.OutputRegisterValue = CVPOperand::OBackFaceSecondaryColor; break;
case FOGC: operand.Value.OutputRegisterValue = CVPOperand::OFogCoord; break;
case PSIZ: operand.Value.OutputRegisterValue = CVPOperand::OPointSize; break;
case TEX0: operand.Value.OutputRegisterValue = CVPOperand::OTex0; break;
case TEX1: operand.Value.OutputRegisterValue = CVPOperand::OTex1; break;
case TEX2: operand.Value.OutputRegisterValue = CVPOperand::OTex2; break;
case TEX3: operand.Value.OutputRegisterValue = CVPOperand::OTex3; break;
case TEX4: operand.Value.OutputRegisterValue = CVPOperand::OTex4; break;
case TEX5: operand.Value.OutputRegisterValue = CVPOperand::OTex5; break;
case TEX6: operand.Value.OutputRegisterValue = CVPOperand::OTex6; break;
case TEX7: operand.Value.OutputRegisterValue = CVPOperand::OTex7; break;
default:
errorOutput = "Can't read index for output register.";
return false;
@ -753,9 +832,9 @@ bool CVPParser::parseInstruction(CVPInstruction &instr, std::string &errorOutput
{
instrStr |= (uint32) ' ';
}
switch (instrStr)
switch ((TArguments)instrStr)
{
case 'ARL ':
case ARL:
instr.Opcode = CVPInstruction::ARL;
if (!parseOp2(instr, errorOutput)) return false;
if (!instr.Src1.Swizzle.isScalar())
@ -764,7 +843,7 @@ bool CVPParser::parseInstruction(CVPInstruction &instr, std::string &errorOutput
return false;
}
break;
case 'RSQ ':
case RSQ:
instr.Opcode = CVPInstruction::RSQ;
if (!parseOp2(instr, errorOutput)) return false;
if (!instr.Src1.Swizzle.isScalar())
@ -773,8 +852,8 @@ bool CVPParser::parseInstruction(CVPInstruction &instr, std::string &errorOutput
return false;
}
break;
case 'EXP ':
case 'EXPP':
case EXP:
case EXPP:
instr.Opcode = CVPInstruction::EXPP;
if (!parseOp2(instr, errorOutput)) return false;
if (!instr.Src1.Swizzle.isScalar())
@ -789,7 +868,7 @@ bool CVPParser::parseInstruction(CVPInstruction &instr, std::string &errorOutput
return false;
}*/
break;
case 'LOG ':
case LOG:
instr.Opcode = CVPInstruction::LOG;
if (!parseOp2(instr, errorOutput)) return false;
if (!instr.Src1.Swizzle.isScalar())
@ -805,7 +884,7 @@ bool CVPParser::parseInstruction(CVPInstruction &instr, std::string &errorOutput
}
*/
break;
case 'RCP ':
case RCP:
instr.Opcode = CVPInstruction::RCP;
if (!parseOp2(instr, errorOutput)) return false;
if (!instr.Src1.Swizzle.isScalar())
@ -815,60 +894,60 @@ bool CVPParser::parseInstruction(CVPInstruction &instr, std::string &errorOutput
}
break;
/////////////////
case 'MOV ':
case MOV:
instr.Opcode = CVPInstruction::MOV;
if (!parseOp2(instr, errorOutput)) return false;
break;
case 'LIT ':
case LIT:
instr.Opcode = CVPInstruction::LIT;
if (!parseOp2(instr, errorOutput)) return false;
break;
/////////////////
case 'MAD ':
case MAD:
instr.Opcode = CVPInstruction::MAD;
if (!parseOp4(instr, errorOutput)) return false;
break;
/////////////////
case 'ADD ':
case ADD:
instr.Opcode = CVPInstruction::ADD;
if (!parseOp3(instr, errorOutput)) return false;
break;
/////////////////
case 'MUL ':
case MUL:
instr.Opcode = CVPInstruction::MUL;
if (!parseOp3(instr, errorOutput)) return false;
break;
case 'DP3 ':
case DP3:
instr.Opcode = CVPInstruction::DP3;
if (!parseOp3(instr, errorOutput)) return false;
break;
case 'DP4 ':
case DP4:
instr.Opcode = CVPInstruction::DP4;
if (!parseOp3(instr, errorOutput)) return false;
break;
case 'DST ':
case DST:
instr.Opcode = CVPInstruction::DST;
if (!parseOp3(instr, errorOutput)) return false;
break;
case 'MIN ':
case MIN:
instr.Opcode = CVPInstruction::MIN;
if (!parseOp3(instr, errorOutput)) return false;
break;
case 'MAX ':
case MAX:
instr.Opcode = CVPInstruction::MAX;
if (!parseOp3(instr, errorOutput)) return false;
break;
case 'SLT ':
case SLT:
instr.Opcode = CVPInstruction::SLT;
if (!parseOp3(instr, errorOutput)) return false;
break;
case 'SGE ':
case SGE:
instr.Opcode = CVPInstruction::SGE;
if (!parseOp3(instr, errorOutput)) return false;
break;
/////////////////
case 'END ':
case END:
endEncountered = true;
return true;
break;

View file

@ -231,7 +231,7 @@ bool CFormElm::isAtom () const
const CType* CFormElm::getType ()
{
warning (false, "getType", "This node is not an atom.");
return 0;
return NULL;
}
// ***************************************************************************

View file

@ -868,6 +868,15 @@ namespace NLGUI
}
}
// ***************************************************************************
void CCtrlTextButton::checkCoords()
{
if( _ViewText != NULL )
_ViewText->checkCoords();
CCtrlBaseButton::checkCoords();
}
// ***************************************************************************
void CCtrlTextButton::updateCoords()

View file

@ -1453,6 +1453,8 @@ namespace NLGUI
getPercentage (table->ForceWidthMin, table->TableRatio, value[MY_HTML_TABLE_WIDTH]);
if (present[MY_HTML_TABLE_BORDER] && value[MY_HTML_TABLE_BORDER])
fromString(value[MY_HTML_TABLE_BORDER], table->Border);
if (present[MY_HTML_TABLE_BORDERCOLOR] && value[MY_HTML_TABLE_BORDERCOLOR])
table->BorderColor = getColor (value[MY_HTML_TABLE_BORDERCOLOR]);
if (present[MY_HTML_TABLE_CELLSPACING] && value[MY_HTML_TABLE_CELLSPACING])
fromString(value[MY_HTML_TABLE_CELLSPACING], table->CellSpacing);
if (present[MY_HTML_TABLE_CELLPADDING] && value[MY_HTML_TABLE_CELLPADDING])
@ -1517,11 +1519,19 @@ namespace NLGUI
}
}
}
if (present[MY_HTML_TD_COLSPAN] && value[MY_HTML_TD_COLSPAN])
fromString(value[MY_HTML_TD_COLSPAN], _Cells.back()->ColSpan);
if (present[MY_HTML_TD_ROWSPAN] && value[MY_HTML_TD_ROWSPAN])
fromString(value[MY_HTML_TD_ROWSPAN], _Cells.back()->RowSpan);
_Cells.back()->BgColor = _CellParams.back().BgColor;
_Cells.back()->Align = _CellParams.back().Align;
_Cells.back()->VAlign = _CellParams.back().VAlign;
_Cells.back()->LeftMargin = _CellParams.back().LeftMargin;
_Cells.back()->NoWrap = _CellParams.back().NoWrap;
_Cells.back()->ColSpan = std::max(1, _Cells.back()->ColSpan);
_Cells.back()->RowSpan = std::max(1, _Cells.back()->RowSpan);
float temp;
if (present[MY_HTML_TD_WIDTH] && value[MY_HTML_TD_WIDTH])
@ -1681,21 +1691,19 @@ namespace NLGUI
break;
case HTML_TEXTAREA:
{
// Add the editbox
// nlinfo("textarea temp '%s'", _TextAreaTemplate.c_str());
// nlinfo("textarea name '%s'", _TextAreaName.c_str());
// nlinfo("textarea %d %d", _TextAreaRow, _TextAreaCols);
// nlinfo("textarea content '%s'", _TextAreaContent.toUtf8().c_str());
CInterfaceGroup *textArea = addTextArea (_TextAreaTemplate, _TextAreaName.c_str (), _TextAreaRow, _TextAreaCols, true, _TextAreaContent, _TextAreaMaxLength);
if (textArea)
{
// Add the text area to the form
CGroupHTML::CForm::CEntry entry;
entry.Name = _TextAreaName;
entry.TextArea = textArea;
_Forms.back().Entries.push_back (entry);
}
_TextArea = false;
if (!(_Forms.empty()))
{
CInterfaceGroup *textArea = addTextArea (_TextAreaTemplate, _TextAreaName.c_str (), _TextAreaRow, _TextAreaCols, true, _TextAreaContent, _TextAreaMaxLength);
if (textArea)
{
// Add the text area to the form
CGroupHTML::CForm::CEntry entry;
entry.Name = _TextAreaName;
entry.TextArea = textArea;
_Forms.back().Entries.push_back (entry);
}
}
}
break;
case HTML_TITLE:
@ -3155,111 +3163,57 @@ namespace NLGUI
void CGroupHTML::addImage(const char *img, bool globalColor, bool reloadImg)
{
// In a paragraph ?
if (_Paragraph)
if (!_Paragraph)
{
string finalUrl;
newParagraph (0);
paragraphChange ();
}
string finalUrl;
// No more text in this text view
_CurrentViewLink = NULL;
// Not added ?
CViewBitmap *newImage = new CViewBitmap (TCtorParam());
//
// 1/ try to load the image with the old system (local files in bnp)
//
string image = CFile::getPath(img) + CFile::getFilenameWithoutExtension(img) + ".tga";
if (lookupLocalFile (finalUrl, image.c_str(), false))
{
newImage->setRenderLayer(getRenderLayer()+1);
image = finalUrl;
}
else
{
//
// 1/ try to load the image with the old system (local files in bnp)
// 2/ if it doesn't work, try to load the image in cache
//
string image = CFile::getPath(img) + CFile::getFilenameWithoutExtension(img) + ".tga";
if (lookupLocalFile (finalUrl, image.c_str(), false))
image = localImageName(img);
if (!reloadImg && lookupLocalFile (finalUrl, image.c_str(), false))
{
// No more text in this text view
_CurrentViewLink = NULL;
// Not added ?
CViewBitmap *newImage = new CViewBitmap (TCtorParam());
/* todo link in image
if (getA())
{
newImage->Link = getLink();
newImage->setHTMLView (this);
}*/
newImage->setRenderLayer(getRenderLayer()+1);
newImage->setTexture (finalUrl);
newImage->setModulateGlobalColor(globalColor);
/* todo link in image
if (getA())
getParagraph()->addChildLink(newImage);
else*/
getParagraph()->addChild(newImage);
paragraphChange ();
// don't display image that are not power of 2
uint32 w, h;
CBitmap::loadSize (image, w, h);
if (w == 0 || h == 0 || ((!NLMISC::isPowerOf2(w) || !NLMISC::isPowerOf2(h)) && !NL3D::CTextureFile::supportNonPowerOfTwoTextures()))
image.clear();
}
else
{
//
// 2/ if it doesn't work, try to load the image in cache
// 3/ if it doesn't work, display a placeholder and ask to dl the image into the cache
//
image = localImageName(img);
if (!reloadImg && lookupLocalFile (finalUrl, image.c_str(), false))
{
// No more text in this text view
_CurrentViewLink = NULL;
// Not added ?
CViewBitmap *newImage = new CViewBitmap (TCtorParam());
/* todo link in image
if (getA())
{
newImage->Link = getLink();
newImage->setHTMLView (this);
}*/
// don't display image that are not power of 2
uint32 w, h;
CBitmap::loadSize (image, w, h);
if (w == 0 || h == 0 || ((!NLMISC::isPowerOf2(w) || !NLMISC::isPowerOf2(h)) && !NL3D::CTextureFile::supportNonPowerOfTwoTextures()))
image.clear();
newImage->setTexture (image);
// newImage->setTexture (finalUrl);
newImage->setModulateGlobalColor(globalColor);
/* todo link in image
if (getA())
getParagraph()->addChildLink(newImage);
else*/
getParagraph()->addChild(newImage);
paragraphChange ();
}
else
{
//
// 3/ if it doesn't work, display a placeholder and ask to dl the image into the cache
//
image = "web_del.tga";
if (lookupLocalFile (finalUrl, image.c_str(), false))
{
// No more text in this text view
_CurrentViewLink = NULL;
// Not added ?
CViewBitmap *newImage = new CViewBitmap (TCtorParam());
/* todo link in image
if (getA())
{
newImage->Link = getLink();
newImage->setHTMLView (this);
}*/
newImage->setTexture (image);
// newImage->setTexture (finalUrl);
newImage->setModulateGlobalColor(globalColor);
addImageDownload(img, newImage);
/* todo link in image
if (getA())
getParagraph()->addChildLink(newImage);
else*/
getParagraph()->addChild(newImage);
paragraphChange ();
}
}
image = "web_del.tga";
addImageDownload(img, newImage);
}
}
newImage->setTexture (image);
newImage->setModulateGlobalColor(globalColor);
getParagraph()->addChild(newImage);
paragraphChange ();
}
// ***************************************************************************

View file

@ -44,9 +44,12 @@ namespace NLGUI
TableRatio = 0.f;
WidthWanted = 0;
Height = 0;
ColSpan = 1;
RowSpan = 1;
TableColumnIndex = 0;
Group = new CInterfaceGroup(CViewBase::TCtorParam());
Align = Left;
VAlign = Top;
VAlign = Middle;
LeftMargin = 0;
NoWrap = false;
IgnoreMaxWidth = false;
@ -249,6 +252,22 @@ namespace NLGUI
AddChildW = b;
return;
}
else
if (name == "colspan" )
{
sint32 i;
if (fromString( value, i ) )
ColSpan = std::max(1, i);
return;
}
else
if (name == "rowspan" )
{
sint32 i;
if (fromString( value, i ) )
RowSpan = std::max(1, i);
return;
}
else
CInterfaceGroup::setProperty( name, value );
}
@ -310,6 +329,8 @@ namespace NLGUI
xmlSetProp( node, BAD_CAST "ignore_max_width", BAD_CAST toString( IgnoreMaxWidth ).c_str() );
xmlSetProp( node, BAD_CAST "ignore_min_width", BAD_CAST toString( IgnoreMinWidth ).c_str() );
xmlSetProp( node, BAD_CAST "add_child_w", BAD_CAST toString( AddChildW ).c_str() );
xmlSetProp( node, BAD_CAST "colspan", BAD_CAST toString( ColSpan ).c_str() );
xmlSetProp( node, BAD_CAST "rowspan", BAD_CAST toString( RowSpan ).c_str() );
return node;
}
@ -422,6 +443,22 @@ namespace NLGUI
{
AddChildW = convertBool(ptr);
}
//
ptr = (char*) xmlGetProp( cur, (xmlChar*)"colspan" );
if (ptr)
{
sint32 i;
if (fromString((const char*)ptr, i))
ColSpan = std::max(1, i);
}
//
ptr = (char*) xmlGetProp( cur, (xmlChar*)"rowspan" );
if (ptr)
{
sint32 i;
if (fromString((const char*)ptr, i))
RowSpan = std::max(1, i);
}
return true;
}
@ -499,6 +536,29 @@ namespace NLGUI
}
}
// Get the parent table
if (getParent ())
{
CGroupTable *table = static_cast<CGroupTable*> (getParent ());
if (table->Border) {
CRGBA lighter = blend(table->BorderColor, CRGBA::White, 0.5f);
CRGBA borderColorTL;
borderColorTL.modulateFromColor (lighter, CWidgetManager::getInstance()->getGlobalColor());
borderColorTL.A = (uint8) (((uint16) table->CurrentAlpha * (uint16) borderColorTL.A) >> 8);
CRGBA borderColorBR;
borderColorBR.modulateFromColor (table->BorderColor, CWidgetManager::getInstance()->getGlobalColor());
borderColorBR.A = (uint8) (((uint16) table->CurrentAlpha * (uint16) borderColorBR.A) >> 8);
CViewRenderer &rVR = *CViewRenderer::getInstance();
rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal, _WReal, 1, 0, false, rVR.getBlankTextureId(), borderColorTL );
rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal, 1, _HReal, 0, false, rVR.getBlankTextureId(), borderColorBR );
rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal+_HReal-1, _WReal, 1, 0, false, rVR.getBlankTextureId(), borderColorBR );
rVR.drawRotFlipBitmap (_RenderLayer, _XReal+_WReal-1, _YReal, 1, _HReal, 0, false, rVR.getBlankTextureId(), borderColorTL );
}
}
CInterfaceGroup::draw ();
}
@ -559,8 +619,9 @@ namespace NLGUI
TableRatio = 0.f;
ForceWidthMin = 0;
Border=0;
CellPadding=0;
CellSpacing=0;
BorderColor = CRGBA(32, 32, 32, 255);
CellPadding=1;
CellSpacing=2;
ContinuousUpdate = false;
}
@ -692,35 +753,75 @@ namespace NLGUI
// New cell ?
if (cell->NewLine)
{
while (column < _Columns.size())
{
if (_Columns[column].RowSpan > 1)
_Columns[column].RowSpan--;
column++;
}
column = 0;
}
// Resize the array
if (column>=_Columns.size())
_Columns.resize(column+1);
// Handle rowspan from previous row
while (_Columns[column].RowSpan > 1)
{
_Columns[column].RowSpan--;
column++;
// if previous row had less <TD> elements, then we missing columns
if (column>=_Columns.size())
_Columns.resize(column+1);
}
// remember column index for later use
cell->TableColumnIndex = column;
// new column, set rowspan from current <TD>
_Columns[column].RowSpan = cell->RowSpan;
float colspan = 1.f / cell->ColSpan;
float rowspan = 1.f / cell->RowSpan;
// Update sizes
if (cellWidth > _Columns[column].Width)
_Columns[column].Width = cellWidth;
if (cell->WidthMax > _Columns[column].WidthMax)
_Columns[column].WidthMax = cell->WidthMax;
if (cell->TableRatio > _Columns[column].TableRatio)
_Columns[column].TableRatio = cell->TableRatio;
if (cell->WidthWanted + additionnalWidth > _Columns[column].WidthWanted)
_Columns[column].WidthWanted = cell->WidthWanted + additionnalWidth;
if (cell->Height > _Columns[column].Height)
_Columns[column].Height = cell->Height;
if (cellWidth*colspan > _Columns[column].Width)
_Columns[column].Width = cellWidth*colspan;
if (cell->WidthMax*colspan > _Columns[column].WidthMax)
_Columns[column].WidthMax = cell->WidthMax*colspan;
if (cell->TableRatio*colspan > _Columns[column].TableRatio)
_Columns[column].TableRatio = cell->TableRatio*colspan;
if (cell->WidthWanted*colspan + additionnalWidth > _Columns[column].WidthWanted)
_Columns[column].WidthWanted = (sint32)(cell->WidthWanted*colspan) + additionnalWidth;
if (_Columns[column].WidthWanted + additionnalWidth)
_Columns[column].WidthMax = _Columns[column].WidthWanted + additionnalWidth;
if (_Columns[column].WidthWanted > _Columns[column].Width)
_Columns[column].Width = _Columns[column].WidthWanted;
if (cell->ColSpan > 1) {
// copy this info to all spanned columns, create new columns as needed
uint newsize = column + cell->ColSpan - 1;
if (newsize >= _Columns.size())
_Columns.resize(newsize+1);
for(uint span = 0; span < cell->ColSpan -1; span++){
column++;
_Columns[column].Width = _Columns[column-1].Width;
_Columns[column].WidthMax = _Columns[column-1].WidthMax;
_Columns[column].TableRatio = _Columns[column-1].TableRatio;
_Columns[column].WidthWanted = _Columns[column-1].WidthWanted;
_Columns[column].RowSpan = _Columns[column-1].RowSpan;
}
}
// Next column
column++;
}
// Width of cells and table borders
sint32 borderWidth = 2*Border + ((sint32)_Columns.size()+1) * CellSpacing + ((sint32)_Columns.size()*2) * CellPadding;
sint32 padding = CellPadding + (Border ? 1 : 0);
sint32 borderWidth = 2*Border + ((sint32)_Columns.size()+1) * CellSpacing + ((sint32)_Columns.size()*2) * padding;
// Get the width
sint32 tableWidthMax = ForceWidthMin?ForceWidthMin:_LastParentW; // getWReal();
@ -802,7 +903,6 @@ namespace NLGUI
// Some space ?
space = finalWidth - tableWidth;
if (space > 0)
{
// Then add in wanted Width cells
@ -892,6 +992,18 @@ namespace NLGUI
}
}
}
// If there is still space left, then sum up column widths
// and add all the remaining space to final column.
if (space > 0)
{
sint32 innerWidth = 0;
for(i=0;i<_Columns.size();i++)
innerWidth += _Columns[i].Width;
if (innerWidth > 0 && finalWidth > innerWidth)
_Columns[_Columns.size()-1].Width += finalWidth - innerWidth;
}
}
}
}
@ -902,7 +1014,8 @@ namespace NLGUI
column = 0;
sint32 row = 0;
sint32 currentX = Border + CellSpacing + CellPadding;
sint32 currentX = Border + CellSpacing + padding;
_Rows.clear ();
for (i=0; i<_Cells.size(); i++)
{
@ -911,25 +1024,41 @@ namespace NLGUI
if (cell->NewLine)
{
column = 0;
currentX = Border + CellSpacing + CellPadding;
currentX = Border + CellSpacing + padding;
_Rows.push_back(CRow());
}
if (cell->TableColumnIndex > 0)
{
// we have active rowspan, must add up 'skipped' columns
for( ; column<cell->TableColumnIndex; column++)
currentX += _Columns[column].Width + padding*2 + CellSpacing;
}
// Set the x and width
// Check align
sint32 alignmentX = 0;
sint32 widthReduceX = 0;
if (cell->WidthMax < _Columns[column].Width)
sint32 columnWidth = _Columns[column].Width;
if (cell->ColSpan > 1)
{
// scan ahead and add up column widths as they might be different
for(int j = 1; j<cell->ColSpan; j++)
columnWidth += CellSpacing + padding*2 + _Columns[column+j].Width;
}
if (cell->WidthMax < columnWidth)
{
switch (cell->Align)
{
case CGroupCell::Center:
alignmentX = (_Columns[column].Width - cell->WidthMax) / 2;
alignmentX = (columnWidth - cell->WidthMax) / 2;
widthReduceX = alignmentX * 2;
break;
case CGroupCell::Right:
alignmentX = _Columns[column].Width - cell->WidthMax;
alignmentX = columnWidth - cell->WidthMax;
widthReduceX = alignmentX;
break;
default:
@ -937,11 +1066,11 @@ namespace NLGUI
}
}
cell->setX(currentX);
cell->setW(_Columns[column].Width);
cell->setX(currentX - padding);
cell->setW(columnWidth + padding*2);
cell->Group->setX(alignmentX+cell->LeftMargin);
cell->Group->setW(_Columns[column].Width - widthReduceX);
cell->Group->setX(alignmentX + cell->LeftMargin + padding);
cell->Group->setW(columnWidth - widthReduceX);
cell->Group->CInterfaceElement::updateCoords();
// Update coords to get H
@ -949,16 +1078,17 @@ namespace NLGUI
cell->Group->updateCoords();
// Resize the row array
_Rows.back().Height = std::max(cell->Height, std::max(_Rows.back().Height, (sint32)cell->Group->getH()));
float rowspan = 1 / cell->RowSpan;
_Rows.back().Height = std::max((sint32)(cell->Height*rowspan), std::max(_Rows.back().Height, (sint32)(cell->Group->getH()*rowspan)));
// Next column
currentX += _Columns[column].Width + 2*CellPadding + CellSpacing;
column ++;
currentX += columnWidth + 2*padding + CellSpacing;
column += cell->ColSpan;
}
// Set cell Y
row = 0;
sint32 currentY = -(Border + CellSpacing + CellPadding);
sint32 currentY = -(Border + CellSpacing + padding);
for (i=0; i<_Cells.size(); i++)
{
// New cell ?
@ -967,37 +1097,45 @@ namespace NLGUI
{
if (_Rows[row].Height != 0)
{
currentY -= _Rows[row].Height + 2*CellPadding + CellSpacing;
currentY -= _Rows[row].Height + 2*padding + CellSpacing;
}
row++;
}
// Check align
sint32 alignmentY = 0;
if ((sint32)cell->Group->getH() < _Rows[row].Height)
sint32 rowHeight = _Rows[row].Height;
if (cell->RowSpan > 1)
{
// we need to scan down and add up row heights
int k = std::min((sint32)_Rows.size(), row + cell->RowSpan);
for(int j=row+1; j<k; j++)
rowHeight += CellSpacing + padding*2 + _Rows[j].Height;
}
if ((sint32)cell->Group->getH() < rowHeight)
{
switch (cell->VAlign)
{
case CGroupCell::Middle:
alignmentY = (_Rows[row].Height - (sint32)cell->Group->getH()) / 2;
alignmentY = (rowHeight - (sint32)cell->Group->getH()) / 2;
break;
case CGroupCell::Bottom:
alignmentY = _Rows[row].Height - (sint32)cell->Group->getH();
alignmentY = rowHeight - (sint32)cell->Group->getH();
break;
default:
break;
}
}
cell->setY(currentY);
cell->setH (_Rows[row].Height);
cell->Group->setY(-alignmentY);
cell->setY(currentY + padding);
cell->setH (rowHeight + 2*padding);
cell->Group->setY(-(alignmentY + padding));
}
// Resize the table
setW(finalWidth+borderWidth-_LastParentW);
if (!_Rows.empty())
currentY -= _Rows[row].Height + CellPadding + CellSpacing + Border;
currentY -= _Rows[row].Height + padding + CellSpacing + Border;
setH(-currentY);
// All done
@ -1177,60 +1315,66 @@ namespace NLGUI
if (gr == NULL)
CurrentAlpha = 255;
if (!_Columns.empty() && !_Rows.empty() && BgColor.A)
if (!_Columns.empty() && !_Rows.empty())
{
sint32 border = Border + CellSpacing + CellPadding;
if (border)
sint32 border = Border + CellSpacing;
if (border && BgColor.A)
{
CRGBA finalColor;
finalColor.modulateFromColor (BgColor, CWidgetManager::getInstance()->getGlobalColor());
finalColor.A = CurrentAlpha;
// Draw the top and bottom lines
// Draw the top line
CViewRenderer &rVR = *CViewRenderer::getInstance();
rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal, _WReal, border, 0, false, rVR.getBlankTextureId(), finalColor);
rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal-border+_HReal, _WReal, border, 0, false, rVR.getBlankTextureId(), finalColor);
// Draw the left and right lines
sint32 insideHeight = std::max((sint32)0, (sint32)_HReal - (sint32)2*border);
rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal+border, border, insideHeight, 0, false, rVR.getBlankTextureId(), finalColor);
rVR.drawRotFlipBitmap (_RenderLayer, _XReal+_WReal-border, _YReal+border, border, insideHeight, 0, false, rVR.getBlankTextureId(), finalColor);
// Draw the left line
sint32 insideHeight = std::max((sint32)0, (sint32)_HReal - (sint32)border);
rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal, border, insideHeight, 0, false, rVR.getBlankTextureId(), finalColor);
// Draw the inside borders
sint32 insideWidth = 2*CellPadding + CellSpacing;
if (insideWidth)
if (CellSpacing)
{
// Draw the inside verticals
uint i;
sint32 x = _XReal + _Columns[0].Width + border;
for (i=1; i<_Columns.size(); i++)
sint32 x, y;
for (i=0; i<_Cells.size(); i++)
{
rVR.drawRotFlipBitmap (_RenderLayer, x, _YReal+border, insideWidth, insideHeight, 0, false, rVR.getBlankTextureId(), finalColor);
x += _Columns[i].Width + insideWidth;
}
CGroupCell *cell = _Cells[i];
// Draw the inside horizontals
sint32 y = _YReal + _HReal - border - _Rows[0].Height;
if (_Rows[0].Height != 0)
{
y -= insideWidth;
}
for (i=1; i<_Rows.size(); i++)
{
uint j;
x = _XReal + border;
if (_Rows[i].Height != 0)
{
for (j=0; j<_Columns.size(); j++)
{
rVR.drawRotFlipBitmap (_RenderLayer, x, y, _Columns[j].Width, insideWidth, 0, false, rVR.getBlankTextureId(), finalColor);
x += _Columns[j].Width + insideWidth;
}
y -= _Rows[i].Height+ insideWidth;
}
x = cell->getXReal();
y = cell->getYReal() - CellSpacing;
// right
rVR.drawRotFlipBitmap (_RenderLayer, x + cell->getW(), y, CellSpacing, cell->getH() + CellSpacing, 0, false, rVR.getBlankTextureId(), finalColor);
// bottom
rVR.drawRotFlipBitmap (_RenderLayer, x, y, cell->getW(), CellSpacing, 0, false, rVR.getBlankTextureId(), finalColor);
}
}
}
if (Border)
{
CViewRenderer &rVR = *CViewRenderer::getInstance();
CRGBA borderColorTL;
CRGBA lighter = blend(BorderColor, CRGBA::White, 0.5f);
borderColorTL.modulateFromColor (lighter, CWidgetManager::getInstance()->getGlobalColor());
borderColorTL.A = CurrentAlpha;
CRGBA borderColorBR;
borderColorBR.modulateFromColor (BorderColor, CWidgetManager::getInstance()->getGlobalColor());
borderColorBR.A = CurrentAlpha;
// beveled table border
for (sint32 i=0; i<Border; i++)
{
// bottom, left, top, right
rVR.drawRotFlipBitmap (_RenderLayer, _XReal+i, _YReal+i, _WReal-i*2, 1, 0, false, rVR.getBlankTextureId(), borderColorBR);
rVR.drawRotFlipBitmap (_RenderLayer, _XReal+i, _YReal+i, 1, _HReal-i*2, 0, false, rVR.getBlankTextureId(), borderColorTL);
rVR.drawRotFlipBitmap (_RenderLayer, _XReal+i, _YReal+_HReal-i-1, _WReal-i*2, 1, 0, false, rVR.getBlankTextureId(), borderColorTL);
rVR.drawRotFlipBitmap (_RenderLayer, _XReal+_WReal-i-1, _YReal+i, 1, _HReal-i*2, 0, false, rVR.getBlankTextureId(), borderColorBR);
}
}
}
CInterfaceGroup::draw ();
@ -1243,6 +1387,11 @@ namespace NLGUI
return toString( Border );
}
else
if( name == "bordercolor" )
{
return toString( BorderColor );
}
else
if( name == "cellpadding" )
{
return toString( CellPadding );
@ -1279,6 +1428,14 @@ namespace NLGUI
return;
}
else
if( name == "bordercolor" )
{
CRGBA c;
if( fromString( value, c ) )
BorderColor = c;
return;
}
else
if( name == "cellpadding" )
{
sint32 i;
@ -1321,6 +1478,7 @@ namespace NLGUI
xmlSetProp( node, BAD_CAST "type", BAD_CAST "table" );
xmlSetProp( node, BAD_CAST "border", BAD_CAST toString( Border ).c_str() );
xmlSetProp( node, BAD_CAST "bordercolor", BAD_CAST toString( BorderColor ).c_str() );
xmlSetProp( node, BAD_CAST "cellpadding", BAD_CAST toString( CellPadding ).c_str() );
xmlSetProp( node, BAD_CAST "cellspacing", BAD_CAST toString( CellSpacing ).c_str() );
xmlSetProp( node, BAD_CAST "bgcolor", BAD_CAST toString( BgColor ).c_str() );
@ -1345,6 +1503,12 @@ namespace NLGUI
fromString((const char*)ptr, Border);
}
//
ptr = (char*) xmlGetProp( cur, (xmlChar*)"bordercolor" );
if (ptr)
{
BorderColor = convertColor((const char*)ptr);
}
//
ptr = (char*) xmlGetProp( cur, (xmlChar*)"cellpadding" );
if (ptr)
{

View file

@ -86,6 +86,7 @@ namespace NLGUI
HTML_ATTR(TABLE,ALIGN),
HTML_ATTR(TABLE,BGCOLOR),
HTML_ATTR(TABLE,BORDER),
HTML_ATTR(TABLE,BORDERCOLOR),
HTML_ATTR(TABLE,CELLPADDING),
HTML_ATTR(TABLE,CELLSPACING),
HTML_ATTR(TABLE,CLASS),

View file

@ -21,7 +21,7 @@
extern "C"
{
/* Library Includes */
/* Library Includes */
#include "wwwsys.h"
#include "WWWUtil.h"
#include "WWWCore.h"
@ -41,8 +41,9 @@ using namespace NLMISC;
extern "C"
{
/* Final states have negative value */
typedef enum _FileState {
/* Final states have negative value */
typedef enum _FileState
{
FS_RETRY = -4,
FS_ERROR = -3,
FS_NO_DATA = -2,
@ -57,26 +58,29 @@ typedef enum _FileState {
} FileState;
/* This is the context structure for the this module */
typedef struct _file_info {
FileState state; /* Current state of the connection */
char * local; /* Local representation of file name */
struct stat stat_info; /* Contains actual file chosen */
typedef struct _file_info
{
FileState state; /* Current state of the connection */
char * local; /* Local representation of file name */
struct stat stat_info; /* Contains actual file chosen */
HTNet * net;
HTTimer * timer;
} file_info;
struct _HTStream {
struct _HTStream
{
const HTStreamClass * isa;
};
struct _HTInputStream {
struct _HTInputStream
{
const HTInputStreamClass * isa;
HTChannel * ch;
HTHost * host;
char * write; /* Last byte written */
char * read; /* Last byte read */
char * write; /* Last byte written */
char * read; /* Last byte read */
int b_read;
char data [INPUT_BUFFER_SIZE]; /* buffer */
char data [INPUT_BUFFER_SIZE]; /* buffer */
};
PRIVATE int FileCleanup (HTRequest *req, int status)
@ -96,7 +100,7 @@ PRIVATE int FileCleanup (HTRequest *req, int status)
}
/*
** Remove if we have registered a timer function as a callback
** Remove if we have registered a timer function as a callback
*/
if (file->timer)
{
@ -123,10 +127,8 @@ PUBLIC int HTLoadNeLFile (SOCKET soc, HTRequest * request)
HTNet * net = HTRequest_net(request);
HTParentAnchor * anchor = HTRequest_anchor(request);
HTTRACE(PROT_TRACE, "HTLoadFile.. Looking for `%s\'\n" _
HTAnchor_physical(anchor));
if ((file = (file_info *) HT_CALLOC(1, sizeof(file_info))) == NULL)
HT_OUTOFMEM((char*)"HTLoadFILE");
HTTRACE(PROT_TRACE, "HTLoadFile.. Looking for `%s\'\n" _ HTAnchor_physical(anchor));
if ((file = (file_info *) HT_CALLOC(1, sizeof(file_info))) == NULL) HT_OUTOFMEM("HTLoadFILE");
file->state = FS_BEGIN;
file->net = net;
HTNet_setContext(net, file);
@ -139,8 +141,8 @@ PUBLIC int HTLoadNeLFile (SOCKET soc, HTRequest * request)
PRIVATE int ReturnEvent (HTTimer * timer, void * param, HTEventType /* type */)
{
file_info * file = (file_info *) param;
if (timer != file->timer)
HTDEBUGBREAK((char*)"File timer %p not in sync\n" _ timer);
if (timer != file->timer) HTDEBUGBREAK("File timer %p not in sync\n" _ timer);
HTTRACE(PROT_TRACE, "HTLoadFile.. Continuing %p with timer %p\n" _ file _ timer);
/*
@ -163,7 +165,7 @@ PUBLIC int HTNeLFileOpen (HTNet * net, char * local, HTLocalMode /* mode */)
if (!fp->open (local))
{
HTRequest_addSystemError(request, ERR_FATAL, errno, NO, (char*)"CIFile::open");
HTRequest_addSystemError(request, ERR_FATAL, errno, NO, "CIFile::open");
return HT_ERROR;
}
@ -186,7 +188,7 @@ PRIVATE int FileEvent (SOCKET /* soc */, void * pVoid, HTEventType type)
{
/* Interrupted */
HTRequest_addError(request, ERR_FATAL, NO, HTERR_INTERRUPTED,
NULL, 0, (char*)"HTLoadFile");
NULL, 0, "HTLoadFile");
FileCleanup(request, HT_INTERRUPTED);
return HT_OK;
}
@ -202,7 +204,7 @@ PRIVATE int FileEvent (SOCKET /* soc */, void * pVoid, HTEventType type)
/* We only support safe (GET, HEAD, etc) methods for the moment */
if (!HTMethod_isSafe(HTRequest_method(request))) {
HTRequest_addError(request, ERR_FATAL, NO, HTERR_NOT_ALLOWED,
NULL, 0, (char*)"HTLoadFile");
NULL, 0, "HTLoadFile");
file->state = FS_ERROR;
break;
}
@ -234,166 +236,188 @@ PRIVATE int FileEvent (SOCKET /* soc */, void * pVoid, HTEventType type)
/* Create a new host object and link it to the net object */
{
HTHost * host = NULL;
if ((host = HTHost_new((char*)"localhost", 0)) == NULL) return HT_ERROR;
HTNet_setHost(net, host);
if (HTHost_addNet(host, net) == HT_PENDING) {
HTTRACE(PROT_TRACE, "HTLoadFile.. Pending...\n");
/* move to the hack state */
file->state = FS_PENDING;
return HT_OK;
}
HTHost * host = NULL;
if ((host = HTHost_new("localhost", 0)) == NULL) return HT_ERROR;
HTNet_setHost(net, host);
if (HTHost_addNet(host, net) == HT_PENDING)
{
HTTRACE(PROT_TRACE, "HTLoadFile.. Pending...\n");
/* move to the hack state */
file->state = FS_PENDING;
return HT_OK;
}
}
file->state = FS_DO_CN;
break;
case FS_PENDING:
{
HTHost * host = NULL;
if ((host = HTHost_new((char*)"localhost", 0)) == NULL) return HT_ERROR;
HTNet_setHost(net, host);
if (HTHost_addNet(host, net) == HT_PENDING) {
HTTRACE(PROT_TRACE, "HTLoadFile.. Pending...\n");
file->state = FS_PENDING;
return HT_OK;
}
HTHost * host = NULL;
if ((host = HTHost_new((char*)"localhost", 0)) == NULL) return HT_ERROR;
HTNet_setHost(net, host);
if (HTHost_addNet(host, net) == HT_PENDING)
{
HTTRACE(PROT_TRACE, "HTLoadFile.. Pending...\n");
file->state = FS_PENDING;
return HT_OK;
}
}
file->state = FS_DO_CN;
break;
case FS_DO_CN:
if (HTRequest_negotiation(request) &&
HTMethod_isSafe(HTRequest_method(request))) {
HTMethod_isSafe(HTRequest_method(request)))
{
HTAnchor_setPhysical(anchor, file->local);
HTTRACE(PROT_TRACE, "Load File... Found `%s\'\n" _ file->local);
}
else
{
if (HT_STAT(file->local, &file->stat_info) == -1)
{
HTTRACE(PROT_TRACE, "Load File... Not found `%s\'\n" _ file->local);
HTRequest_addError(request, ERR_FATAL, NO, HTERR_NOT_FOUND, NULL, 0, "HTLoadFile");
file->state = FS_ERROR;
break;
}
}
HTAnchor_setPhysical(anchor, file->local);
HTTRACE(PROT_TRACE, "Load File... Found `%s\'\n" _ file->local);
} else {
if (HT_STAT(file->local, &file->stat_info) == -1) {
HTTRACE(PROT_TRACE, "Load File... Not found `%s\'\n" _ file->local);
HTRequest_addError(request, ERR_FATAL, NO, HTERR_NOT_FOUND,
NULL, 0, (char*)"HTLoadFile");
file->state = FS_ERROR;
if (((file->stat_info.st_mode) & S_IFMT) == S_IFDIR)
{
if (HTRequest_method(request) == METHOD_GET)
{
file->state = FS_PARSE_DIR;
}
else
{
HTRequest_addError(request, ERR_INFO, NO, HTERR_NO_CONTENT, NULL, 0, "HTLoadFile");
file->state = FS_NO_DATA;
}
break;
}
}
if (((file->stat_info.st_mode) & S_IFMT) == S_IFDIR) {
if (HTRequest_method(request) == METHOD_GET)
file->state = FS_PARSE_DIR;
else {
HTRequest_addError(request, ERR_INFO, NO, HTERR_NO_CONTENT,
NULL, 0, (char*)"HTLoadFile");
file->state = FS_NO_DATA;
}
break;
}
{
BOOL editable = FALSE;
HTBind_getAnchorBindings(anchor);
if (editable) HTAnchor_appendAllow(anchor, METHOD_PUT);
BOOL editable = FALSE;
HTBind_getAnchorBindings(anchor);
if (editable) HTAnchor_appendAllow(anchor, METHOD_PUT);
/* Set the file size */
CIFile nelFile;
if (nelFile.open (file->local))
{
file->stat_info.st_size = nelFile.getFileSize();
}
nelFile.close();
/* Set the file size */
CIFile nelFile;
if (nelFile.open (file->local))
{
file->stat_info.st_size = nelFile.getFileSize();
}
nelFile.close();
if (file->stat_info.st_size)
HTAnchor_setLength(anchor, file->stat_info.st_size);
if (file->stat_info.st_size)
HTAnchor_setLength(anchor, file->stat_info.st_size);
/* Set the file last modified time stamp */
if (file->stat_info.st_mtime > 0)
HTAnchor_setLastModified(anchor, file->stat_info.st_mtime);
/* Set the file last modified time stamp */
if (file->stat_info.st_mtime > 0)
HTAnchor_setLastModified(anchor, file->stat_info.st_mtime);
/* Check to see if we can edit it */
if (!editable && !file->stat_info.st_size) {
HTRequest_addError(request, ERR_INFO, NO, HTERR_NO_CONTENT,
NULL, 0, (char*)"HTLoadFile");
file->state = FS_NO_DATA;
} else {
file->state = (HTRequest_method(request)==METHOD_GET) ?
FS_NEED_OPEN_FILE : FS_GOT_DATA;
}
/* Check to see if we can edit it */
if (!editable && !file->stat_info.st_size)
{
HTRequest_addError(request, ERR_INFO, NO, HTERR_NO_CONTENT, NULL, 0, "HTLoadFile");
file->state = FS_NO_DATA;
}
else
{
file->state = (HTRequest_method(request)==METHOD_GET) ? FS_NEED_OPEN_FILE : FS_GOT_DATA;
}
}
break;
case FS_NEED_OPEN_FILE:
status = HTNeLFileOpen(net, file->local, HT_FB_RDONLY);
if (status == HT_OK) {
if (status == HT_OK)
{
HTStream * rstream = HTStreamStack(HTAnchor_format(anchor),
HTRequest_outputFormat(request),
HTRequest_outputStream(request),
request, YES);
HTNet_setReadStream(net, rstream);
HTRequest_setOutputConnected(request, YES);
}
{
HTOutputStream * output = HTNet_getOutput(net, NULL, 0);
HTRequest_setInputStream(request, (HTStream *) output);
}
if (HTRequest_isSource(request) && !HTRequest_destinationsReady(request))
return HT_OK;
HTRequest_addError(request, ERR_INFO, NO, HTERR_OK, NULL, 0,
(char*)"HTLoadFile");
file->state = FS_NEED_BODY;
if (HTEvent_isCallbacksRegistered()) {
if (!HTRequest_preemptive(request)) {
if (!HTNet_preemptive(net)) {
HTTRACE(PROT_TRACE, "HTLoadFile.. Returning\n");
HTHost_register(HTNet_host(net), net, HTEvent_READ);
} else if (!file->timer) {
HTTRACE(PROT_TRACE, "HTLoadFile.. Returning\n");
file->timer =
HTTimer_new(NULL, ReturnEvent, file, 1, YES, NO);
{
HTStream * rstream = HTStreamStack(HTAnchor_format(anchor),
HTRequest_outputFormat(request),
HTRequest_outputStream(request),
request, YES);
HTNet_setReadStream(net, rstream);
HTRequest_setOutputConnected(request, YES);
}
return HT_OK;
{
HTOutputStream * output = HTNet_getOutput(net, NULL, 0);
HTRequest_setInputStream(request, (HTStream *) output);
}
if (HTRequest_isSource(request) && !HTRequest_destinationsReady(request)) return HT_OK;
HTRequest_addError(request, ERR_INFO, NO, HTERR_OK, NULL, 0, "HTLoadFile");
file->state = FS_NEED_BODY;
if (HTEvent_isCallbacksRegistered())
{
if (!HTRequest_preemptive(request))
{
if (!HTNet_preemptive(net))
{
HTTRACE(PROT_TRACE, "HTLoadFile.. Returning\n");
HTHost_register(HTNet_host(net), net, HTEvent_READ);
}
else if (!file->timer)
{
HTTRACE(PROT_TRACE, "HTLoadFile.. Returning\n");
file->timer = HTTimer_new(NULL, ReturnEvent, file, 1, YES, NO);
}
return HT_OK;
}
}
}
} else if (status == HT_WOULD_BLOCK || status == HT_PENDING)
return HT_OK;
else {
HTRequest_addError(request, ERR_INFO, NO, HTERR_INTERNAL,
NULL, 0, (char*)"HTLoadFile");
file->state = FS_ERROR; /* Error or interrupt */
else if (status == HT_WOULD_BLOCK || status == HT_PENDING)
{
return HT_OK;
}
else
{
HTRequest_addError(request, ERR_INFO, NO, HTERR_INTERNAL, NULL, 0, "HTLoadFile");
file->state = FS_ERROR; /* Error or interrupt */
}
break;
case FS_NEED_BODY:
case FS_NEED_BODY:
status = HTHost_read(HTNet_host(net), net);
if (status == HT_WOULD_BLOCK)
return HT_OK;
else if (status == HT_LOADED || status == HT_CLOSED) {
file->state = FS_GOT_DATA;
} else {
HTRequest_addError(request, ERR_INFO, NO, HTERR_FORBIDDEN,
NULL, 0, (char*)"HTLoadFile");
file->state = FS_ERROR;
{
return HT_OK;
}
else if (status == HT_LOADED || status == HT_CLOSED)
{
file->state = FS_GOT_DATA;
}
else
{
HTRequest_addError(request, ERR_INFO, NO, HTERR_FORBIDDEN, NULL, 0, "HTLoadFile");
file->state = FS_ERROR;
}
break;
case FS_TRY_FTP:
{
char *url = HTAnchor_physical(anchor);
HTAnchor *anchor;
char *newname = NULL;
StrAllocCopy(newname, "ftp:");
if (!strncmp(url, "file:", 5))
StrAllocCat(newname, url+5);
else
StrAllocCat(newname, url);
anchor = HTAnchor_findAddress(newname);
HTRequest_setAnchor(request, anchor);
HT_FREE(newname);
FileCleanup(request, HT_IGNORE);
return HTLoad(request, YES);
char *url = HTAnchor_physical(anchor);
HTAnchor *anchor;
char *newname = NULL;
StrAllocCopy(newname, "ftp:");
if (!strncmp(url, "file:", 5))
{
StrAllocCat(newname, url+5);
}
else
{
StrAllocCat(newname, url);
}
anchor = HTAnchor_findAddress(newname);
HTRequest_setAnchor(request, anchor);
HT_FREE(newname);
FileCleanup(request, HT_IGNORE);
return HTLoad(request, YES);
}
break;
@ -461,7 +485,8 @@ PRIVATE int HTNeLReader_read (HTInputStream * me)
{
HTAlertCallback * cbf = HTAlert_find(HT_PROG_READ);
HTNet_addBytesRead(net, me->b_read);
if (cbf) {
if (cbf)
{
int tr = HTNet_bytesRead(net);
(*cbf)(net->request, HT_PROG_READ, HT_MSG_NULL, NULL, &tr, NULL);
}
@ -472,18 +497,28 @@ PRIVATE int HTNeLReader_read (HTInputStream * me)
/* Now push the data down the stream */
if ((status = (*net->readStream->isa->put_block)
(net->readStream, me->data, me->b_read)) != HT_OK) {
if (status == HT_WOULD_BLOCK) {
(net->readStream, me->data, me->b_read)) != HT_OK)
{
if (status == HT_WOULD_BLOCK)
{
HTTRACE(PROT_TRACE, "ANSI read... Target WOULD BLOCK\n");
return HT_WOULD_BLOCK;
} else if (status == HT_PAUSE) {
}
else if (status == HT_PAUSE)
{
HTTRACE(PROT_TRACE, "ANSI read... Target PAUSED\n");
return HT_PAUSE;
} else if (status > 0) { /* Stream specific return code */
}
else if (status > 0)
{
/* Stream specific return code */
HTTRACE(PROT_TRACE, "ANSI read... Target returns %d\n" _ status);
me->write = me->data + me->b_read;
return status;
} else { /* We have a real error */
}
else
{
/* We have a real error */
HTTRACE(PROT_TRACE, "ANSI read... Target ERROR\n");
return status;
}
@ -506,13 +541,15 @@ PRIVATE int HTNeLReader_close (HTInputStream * me)
HTNet * net = HTHost_getReadNet(me->host);
if (net && net->readStream) {
if ((status = (*net->readStream->isa->_free)(net->readStream))==HT_WOULD_BLOCK)
return HT_WOULD_BLOCK;
net->readStream = NULL;
if (net && net->readStream)
{
if ((status = (*net->readStream->isa->_free)(net->readStream))==HT_WOULD_BLOCK) return HT_WOULD_BLOCK;
net->readStream = NULL;
}
HTTRACE(STREAM_TRACE, "Socket read. FREEING....\n");
HT_FREE(me);
return status;
}
@ -540,7 +577,8 @@ PRIVATE int HTNeLReader_free (HTInputStream * me)
}
HTNet * net = HTHost_getReadNet(me->host);
if (net && net->readStream) {
if (net && net->readStream)
{
int status = (*net->readStream->isa->_free)(net->readStream);
if (status == HT_OK) net->readStream = NULL;
return status;
@ -551,7 +589,8 @@ PRIVATE int HTNeLReader_free (HTInputStream * me)
PRIVATE int HTNeLReader_abort (HTInputStream * me, HTList * /* e */)
{
HTNet * net = HTHost_getReadNet(me->host);
if (net && net->readStream) {
if (net && net->readStream)
{
int status = (*net->readStream->isa->abort)(net->readStream, NULL);
if (status != HT_IGNORE) net->readStream = NULL;
}
@ -560,7 +599,7 @@ PRIVATE int HTNeLReader_abort (HTInputStream * me, HTList * /* e */)
PRIVATE const HTInputStreamClass HTNeLReader =
{
(char*)"SocketReader",
"SocketReader",
HTNeLReader_flush,
HTNeLReader_free,
HTNeLReader_abort,
@ -569,20 +608,20 @@ PRIVATE const HTInputStreamClass HTNeLReader =
HTNeLReader_consumed
};
PUBLIC HTInputStream * HTNeLReader_new (HTHost * host, HTChannel * ch,
void * /* param */, int /* mode */)
PUBLIC HTInputStream * HTNeLReader_new (HTHost * host, HTChannel * ch, void * /* param */, int /* mode */)
{
if (host && ch) {
HTInputStream * me = HTChannel_input(ch);
if (me == NULL) {
if ((me=(HTInputStream *) HT_CALLOC(1, sizeof(HTInputStream))) == NULL)
HT_OUTOFMEM((char*)"HTNeLReader_new");
me->isa = &HTNeLReader;
me->ch = ch;
me->host = host;
HTTRACE(STREAM_TRACE, "Reader...... Created reader stream %p\n" _ me);
}
return me;
if (host && ch)
{
HTInputStream * me = HTChannel_input(ch);
if (me == NULL)
{
if ((me=(HTInputStream *) HT_CALLOC(1, sizeof(HTInputStream))) == NULL) HT_OUTOFMEM("HTNeLReader_new");
me->isa = &HTNeLReader;
me->ch = ch;
me->host = host;
HTTRACE(STREAM_TRACE, "Reader...... Created reader stream %p\n" _ me);
}
return me;
}
return NULL;
}

View file

@ -2547,8 +2547,8 @@ namespace NLGUI
// Letter size
UTextContext::CStringInfo si = TextContext->getStringInfo(ucstring("|")); // for now we can't now that directly from UTextContext
_FontHeight = (uint) si.StringHeight + (_Shadow?(_ShadowOutline?2:1):0);
_FontLegHeight = (uint) si.StringLine + (_Shadow?(_ShadowOutline?2:1):0);
_FontHeight = (uint) si.StringHeight; // + (_Shadow?(_ShadowOutline?2:1):0);
_FontLegHeight = (uint) si.StringLine; // + (_Shadow?(_ShadowOutline?2:1):0);
// Space width
si = TextContext->getStringInfo(ucstring(" "));
@ -2834,7 +2834,8 @@ namespace NLGUI
pTooltip->setId(_Id+"_tt"+toString(i));
pTooltip->setAvoidResizeParent(avoidResizeParent());
pTooltip->setRenderLayer(getRenderLayer());
pTooltip->setDefaultContextHelp(CI18N::get(tempTooltips[i].toString()));
bool isI18N = tempTooltips[i].size() >= 2 && tempTooltips[i][0] == 'u' && tempTooltips[i][1] == 'i';
pTooltip->setDefaultContextHelp(isI18N ? CI18N::get(tempTooltips[i].toString()) : tempTooltips[i]);
pTooltip->setParentPos(this);
pTooltip->setParentPosRef(Hotspot_BR);
pTooltip->setPosRef(Hotspot_BR);

View file

@ -1499,7 +1499,7 @@ void cf_setVar (NLMISC::CConfigFile::CVar &Var, cf_value Val)
switch (Val.Type)
{
case NLMISC::CConfigFile::CVar::T_REAL: Var.IntValues.push_back ((int)Val.Real); break;
case NLMISC::CConfigFile::CVar::T_STRING: Var.IntValues.push_back (atoi(Val.String)); break;
case NLMISC::CConfigFile::CVar::T_STRING: { int val = 0; NLMISC::fromString(Val.String, val); Var.IntValues.push_back(val); break; }
default: break;
}
break;
@ -1507,7 +1507,7 @@ void cf_setVar (NLMISC::CConfigFile::CVar &Var, cf_value Val)
switch (Val.Type)
{
case NLMISC::CConfigFile::CVar::T_INT: Var.RealValues.push_back ((double)Val.Int); break;
case NLMISC::CConfigFile::CVar::T_STRING: Var.RealValues.push_back (atof(Val.String)); break;
case NLMISC::CConfigFile::CVar::T_STRING: { double val = 0.0; NLMISC::fromString(Val.String, val); Var.RealValues.push_back(val); break; }
default: break;
}
break;

View file

@ -517,7 +517,7 @@ void cf_setVar (NLMISC::CConfigFile::CVar &Var, cf_value Val)
switch (Val.Type)
{
case NLMISC::CConfigFile::CVar::T_REAL: Var.IntValues.push_back ((int)Val.Real); break;
case NLMISC::CConfigFile::CVar::T_STRING: Var.IntValues.push_back (atoi(Val.String)); break;
case NLMISC::CConfigFile::CVar::T_STRING: { int val = 0; NLMISC::fromString(Val.String, val); Var.RealValues.push_back(val); break; }
default: break;
}
break;
@ -525,7 +525,7 @@ void cf_setVar (NLMISC::CConfigFile::CVar &Var, cf_value Val)
switch (Val.Type)
{
case NLMISC::CConfigFile::CVar::T_INT: Var.RealValues.push_back ((double)Val.Int); break;
case NLMISC::CConfigFile::CVar::T_STRING: Var.RealValues.push_back (atof(Val.String)); break;
case NLMISC::CConfigFile::CVar::T_STRING: { double val = 0.0; NLMISC::fromString(Val.String, val); Var.RealValues.push_back(val); break; }
default: break;
}
break;

View file

@ -2337,7 +2337,7 @@ YY_RULE_SETUP
if (!cf_Ignore)
{
cflval.Val.Type = T_REAL;
cflval.Val.Real = atof (yytext);
NLMISC::fromString(yytext, cflval.Val.Real);
DEBUG_PRINTF("lex: real '%s' '%f\n", yytext, cflval.Val.Real);
return REAL;
}

View file

@ -85,8 +85,12 @@ double CConfigFile::CVar::asDouble (int index) const
if (index >= (int)IntValues.size () || index < 0) throw EBadSize (Name, (int)IntValues.size (), index);
return (double)IntValues[index];
case T_STRING:
{
if (index >= (int)StrValues.size () || index < 0) throw EBadSize (Name, (int)StrValues.size (), index);
return atof(StrValues[index].c_str());
double val;
NLMISC::fromString(StrValues[index], val);
return val;
}
default:
if (index >= (int)RealValues.size () || index < 0) throw EBadSize (Name, (int)RealValues.size (), index);
return RealValues[index];

View file

@ -406,13 +406,21 @@ void CUnfairMutex::leave()
*/
CFairMutex::CFairMutex()
{
#ifdef NL_OS_MAC
_Sem = dispatch_semaphore_create(1);
#else
sem_init( const_cast<sem_t*>(&_Sem), 0, 1 );
#endif
}
CFairMutex::CFairMutex( const std::string &name )
{
#ifdef NL_OS_MAC
_Sem = dispatch_semaphore_create(1);
#else
sem_init( const_cast<sem_t*>(&_Sem), 0, 1 );
#endif
}
@ -421,7 +429,11 @@ CFairMutex::CFairMutex( const std::string &name )
*/
CFairMutex::~CFairMutex()
{
#ifdef NL_OS_MAC
dispatch_release(_Sem);
#else
sem_destroy( const_cast<sem_t*>(&_Sem) ); // needs that no thread is waiting on the semaphore
#endif
}
@ -430,7 +442,11 @@ CFairMutex::~CFairMutex()
*/
void CFairMutex::enter()
{
#ifdef NL_OS_MAC
dispatch_semaphore_wait(_Sem, DISPATCH_TIME_FOREVER);
#else
sem_wait( const_cast<sem_t*>(&_Sem) );
#endif
}
@ -439,7 +455,11 @@ void CFairMutex::enter()
*/
void CFairMutex::leave()
{
#ifdef NL_OS_MAC
dispatch_semaphore_signal(_Sem);
#else
sem_post( const_cast<sem_t*>(&_Sem) );
#endif
}

View file

@ -2544,6 +2544,57 @@ bool CPath::makePathRelative (const char *basePath, std::string &relativePath)
return false;
}
std::string CPath::makePathAbsolute( const std::string &relativePath, const std::string &directory )
{
if( relativePath.empty() )
return "";
if( directory.empty() )
return "";
#ifdef NL_OS_WINDOWS
// Windows network address. Eg.: \\someshare\path
if( ( relativePath[ 0 ] == '\\' ) && ( relativePath[ 1 ] == '\\' ) )
return relativePath;
// Normal Windows absolute path. Eg.: C:\something
//
if( isalpha( relativePath[ 0 ] ) && ( relativePath[ 1 ] == ':' ) && ( ( relativePath[ 2 ] == '\\' ) || ( relativePath[ 2 ] == '/' ) ) )
return relativePath;
#else
// Unix filesystem absolute path
if( relativePath[ 0 ] == '/' )
return relativePath;
#endif
// Add a slash to the directory if necessary.
// If the relative path starts with dots we need a slash.
// If the relative path starts with a slash we don't.
// If it starts with neither, we need a slash.
bool needSlash = true;
char c = relativePath[ 0 ];
if( ( c == '\\' ) || ( c == '/' ) )
needSlash = false;
bool hasSlash = false;
std::string npath = directory;
c = npath[ npath.size() - 1 ];
if( ( c == '\\' ) || ( c == '/' ) )
hasSlash = true;
if( needSlash && !hasSlash )
npath += '/';
else
if( hasSlash && !needSlash )
npath.resize( npath.size() - 1 );
// Now build the new absolute path
npath += relativePath;
npath = standardizePath( npath, false );
return npath;
}
bool CFile::setRWAccess(const std::string &filename)
{
#ifdef NL_OS_WINDOWS

View file

@ -185,7 +185,7 @@ namespace NLQT
NL3D::CBloomEffect::instance().setDriver(_Driver);
NL3D::CBloomEffect::instance().setScene(_Scene);
NL3D::CBloomEffect::instance().init(!_Direct3D);
NL3D::CBloomEffect::instance().init();
//NL3D::CBloomEffect::instance().setDensityBloom(Modules::config().getConfigFile().getVar("BloomDensity").asInt());
//NL3D::CBloomEffect::instance().setSquareBloom(Modules::config().getConfigFile().getVar("BloomSquare").asBool());
}
@ -366,7 +366,7 @@ namespace NLQT
// Render the scene.
if((NL3D::CBloomEffect::instance().getDriver() != NULL) && (_BloomEffect))
{
NL3D::CBloomEffect::instance().initBloom();
NL3D::CBloomEffect::instance().init();
}
_Driver->clearBuffers(_BackgroundColor);
}
@ -378,8 +378,7 @@ namespace NLQT
if((NL3D::CBloomEffect::instance().getDriver() != NULL) && (_BloomEffect))
{
NL3D::CBloomEffect::instance().endBloom();
NL3D::CBloomEffect::instance().endInterfacesDisplayBloom();
NL3D::CBloomEffect::instance().applyBloom();
}
}

View file

@ -70,7 +70,6 @@ void CColorModifier::convertBitmap(NLMISC::CBitmap &destBitmap, const NLMISC::CB
// blend to the destination by using the mask alpha
result.blendFromui(*dest, result, mask->R);
/// keep alpha from the source
dest->R = result.R;
@ -78,7 +77,6 @@ void CColorModifier::convertBitmap(NLMISC::CBitmap &destBitmap, const NLMISC::CB
dest->B = result.B;
dest->A = src->A;
++ mask;
++ src;
++ dest;

View file

@ -575,8 +575,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0, 10, 0, 0
PRODUCTVERSION 0, 10, 0, 0
FILEVERSION 0, 11, 0, 0
PRODUCTVERSION 0, 11, 0, 0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -593,14 +593,14 @@ BEGIN
BEGIN
VALUE "Comments", "Based on Kinetix 3D Studio Max 3.0 plugin sample\0"
VALUE "CompanyName", "Ryzom Core\0"
VALUE "FileVersion", "0.10.0\0"
VALUE "FileVersion", "0.11.0\0"
VALUE "InternalName", "CNelExport\0"
VALUE "LegalCopyright", "\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "CNelExport.dlu\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "Ryzom Core\0"
VALUE "ProductVersion", "0.10.0\0"
VALUE "ProductVersion", "0.11.0\0"
VALUE "SpecialBuild", "\0"
END
END

View file

@ -85,8 +85,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0, 10, 0, 0
PRODUCTVERSION 0, 10, 0, 0
FILEVERSION 0, 11, 0, 0
PRODUCTVERSION 0, 11, 0, 0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -103,12 +103,12 @@ BEGIN
BEGIN
VALUE "Comments", "http://www.ryzomcore.org/"
VALUE "FileDescription", "PatchMesh to RykolPatchMesh"
VALUE "FileVersion", "0.10.0"
VALUE "FileVersion", "0.11.0"
VALUE "InternalName", "PatchMesh to RykolPatchMesh"
VALUE "LegalCopyright", "Copyright, 2000 Nevrax Ltd."
VALUE "OriginalFilename", "nel_convert_patch.dlm"
VALUE "ProductName", "NeL Patch Converter"
VALUE "ProductVersion", "0.10.0"
VALUE "ProductVersion", "0.11.0"
END
END
BLOCK "VarFileInfo"

View file

@ -514,8 +514,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0, 10, 0, 0
PRODUCTVERSION 0, 10, 0, 0
FILEVERSION 0, 11, 2, 0
PRODUCTVERSION 0, 11, 2, 0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -533,13 +533,13 @@ BEGIN
VALUE "Comments", "Based on Kinetix 3D Studio Max 3.0 plugin sample\0"
VALUE "CompanyName", "Ryzom Core"
VALUE "FileDescription", "NeL Patch Edit"
VALUE "FileVersion", "0.10.0"
VALUE "FileVersion", "0.11.2"
VALUE "InternalName", "neleditpatch"
VALUE "LegalCopyright", "Copyright © 2000 Nevrax Ltd. Copyright © 1998 Autodesk Inc."
VALUE "LegalTrademarks", "The following are registered trademarks of Autodesk, Inc.: 3D Studio MAX. The following are trademarks of Autodesk, Inc.: Kinetix, Kinetix(logo), BIPED, Physique, Character Studio, MAX DWG, DWG Unplugged, Heidi, FLI, FLC, DXF."
VALUE "OriginalFilename", "neleditpatch.dlm"
VALUE "ProductName", "Ryzom Core"
VALUE "ProductVersion", "0.10.0"
VALUE "ProductVersion", "0.11.2"
END
END
BLOCK "VarFileInfo"

View file

@ -37,7 +37,6 @@ int EditPatchMod::DoAttach(INode *node, PatchMesh *attPatch, RPatchMesh *rattPat
nodes.DisposeTemporary();
return 0;
}
patchData->BeginEdit(ip->GetTime());
// If the mesh isn't yet cached, this will cause it to get cached.
RPatchMesh *rpatch;
@ -49,6 +48,7 @@ int EditPatchMod::DoAttach(INode *node, PatchMesh *attPatch, RPatchMesh *rattPat
}
patchData->RecordTopologyTags(patch);
RecordTopologyTags();
patchData->BeginEdit(ip->GetTime());
// Transform the shape for attachment:
// If reorienting, just translate to align pivots

View file

@ -96,8 +96,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0, 10, 0, 0
PRODUCTVERSION 0, 10, 0, 0
FILEVERSION 0, 11, 1, 0
PRODUCTVERSION 0, 11, 1, 0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -116,14 +116,14 @@ BEGIN
VALUE "Comments", "TECH: cyril.corvazier\0"
VALUE "CompanyName", "Ryzom Core\0"
VALUE "FileDescription", "NeL Patch Paint\0"
VALUE "FileVersion", "0.10.0\0"
VALUE "FileVersion", "0.11.1\0"
VALUE "InternalName", "mods\0"
VALUE "LegalCopyright", "Copyright © 2000 Nevrax Ltd\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "nelpatchpaint.dlm\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "Ryzom Core\0"
VALUE "ProductVersion", "0.10.0\0"
VALUE "ProductVersion", "0.11.1\0"
VALUE "SpecialBuild", "\0"
END
END

View file

@ -125,8 +125,8 @@ IDC_DROPPER_CURSOR CURSOR DISCARDABLE "dropcurs.cur"
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0, 10, 0, 0
PRODUCTVERSION 0, 10, 0, 0
FILEVERSION 0, 11, 0, 0
PRODUCTVERSION 0, 11, 0, 0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -145,13 +145,13 @@ BEGIN
VALUE "Comments", "TECH: \0"
VALUE "CompanyName", "Ryzom Core\0"
VALUE "FileDescription", "Vertex Tree Paint\0"
VALUE "FileVersion", "0.10.0\0"
VALUE "FileVersion", "0.11.0\0"
VALUE "InternalName", "VertexTreePaint\0"
VALUE "LegalCopyright", "Copyright © 2000 Nevrax Ltd. Copyright © 1998 Autodesk Inc.\0"
VALUE "LegalTrademarks", "The following are registered trademarks of Autodesk, Inc.: 3D Studio MAX. The following are trademarks of Autodesk, Inc.: Kinetix, Kinetix(logo), BIPED, Physique, Character Studio, MAX DWG, DWG Unplugged, Heidi, FLI, FLC, DXF.\0"
VALUE "OriginalFilename", "nel_vertex_tree_paint.dlm\0"
VALUE "ProductName", "Ryzom Core\0"
VALUE "ProductVersion", "0.10.0\0"
VALUE "ProductVersion", "0.11.0\0"
END
END
BLOCK "VarFileInfo"

View file

@ -124,8 +124,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0, 10, 0, 0
PRODUCTVERSION 0, 10, 0, 0
FILEVERSION 0, 11, 0, 0
PRODUCTVERSION 0, 11, 0, 0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -142,12 +142,12 @@ BEGIN
BEGIN
VALUE "Comments", "Based on Kinetix 3D Studio Max 3.0 plugin sample\0"
VALUE "CompanyName", "Ryzom Core\0"
VALUE "FileVersion", "0.10.0\0"
VALUE "FileVersion", "0.11.0\0"
VALUE "InternalName", "Tile_utility\0"
VALUE "LegalCopyright", "\0"
VALUE "OriginalFilename", "Tile_utility.dlu\0"
VALUE "ProductName", "Ryzom Core\0"
VALUE "ProductVersion", "0.10.0\0"
VALUE "ProductVersion", "0.11.0\0"
VALUE "FileDescription", "Create material for tiles\0"
VALUE "Comments", "TECH: \0"
VALUE "LegalTrademarks", "\0"

View file

@ -184,8 +184,8 @@ void CEventsListener::operator()(const CEvent& event)
}
// NOTE: No 0, 0 center mouse message in Windows (lower mouse message rate), but safe to assume any movement messages are requeued relative to our new position
// In case free look bugs on other platform, we may need to push in our own message on setMousePos for Windows
if (s_MouseFreeLookWaitCenter) // scX == 0 && scY == 0)
bool outsideBounds = ((abs(scX) > (drW >> 3)) || (abs(scY) > (drH >> 3)));
if (s_MouseFreeLookWaitCenter && !outsideBounds)
{
// Centered, set last to 0
s_MouseFreeLookLastX = 0;
@ -204,8 +204,7 @@ void CEventsListener::operator()(const CEvent& event)
// updateFreeLookPos is called in updateMouseSmoothing per frame
// Center cursor
bool outsideBounds = ((abs(scX) > (drW >> 3)) || (abs(scY) > (drH >> 3)));
if (outsideBounds)
if (outsideBounds && !s_MouseFreeLookWaitCenter)
{
s_MouseFreeLookWaitCenter = true;
Driver->setMousePos(0.5f, 0.5f);

View file

@ -45,20 +45,20 @@ void CHairSet::init (NLMISC::IProgressCallback &progress)
progress.progress ((float)k/(float)numHairItem);
const CItemSheet *item = SheetMngr.getItem(SLOTTYPE::HEAD_SLOT, k);
if( (item) && (!item->getShape().empty()) )
if (item && !item->getShape().empty())
{
std::string itemName = NLMISC::toLower(item->getShape());
if (item->getShape().find("cheveux", 0) != std::string::npos)
{
// get race
uint16 race = (uint16) itemName[1] | ((uint16) itemName[0] << 8);
switch(race)
std::string itemName = NLMISC::toLower(item->getShape());
// fortunately, first character of each race is distinct
switch(itemName[0])
{
case 'ma': _Hairs[Matis].push_back(k); break;
case 'tr': _Hairs[Tryker].push_back(k); break;
case 'zo': _Hairs[Zorai].push_back(k); break;
case 'fy': _Hairs[Fyros].push_back(k); break;
case 'm': _Hairs[Matis].push_back(k); break;
case 't': _Hairs[Tryker].push_back(k); break;
case 'z': _Hairs[Zorai].push_back(k); break;
case 'f': _Hairs[Fyros].push_back(k); break;
}
}
}

View file

@ -556,10 +556,9 @@ void checkDriverDepth ()
static std::string replaceApplicationDirToken(const std::string &dir)
{
#ifdef NL_OS_MAC
// if client_default.cfg is not in current directory, and it's not an absolute path, use application default directory
if (!CFile::isExists("client_default.cfg") && dir.size()>0 && dir[0]!='/')
if (!CFile::isExists("client_default.cfg") && !dir.empty() && dir[0]!='/')
{
return getAppBundlePath() + "/Contents/Resources/" + dir;
}

View file

@ -797,7 +797,7 @@ void CCharacter3D::setup (const SCharacter3DSetup &c3ds)
}
// Instance skin color
if (c3ds.People != -1)
if (c3ds.People != EGSPD::CPeople::Undefined)
if ((c3ds.People != _CurrentSetup.People) || bInstanceRebuilt || bQualityRebuilt)
{
if (!_Instances[i].empty())

View file

@ -604,7 +604,11 @@ void CChatGroupWindow::displayMessage(const ucstring &msg, NLMISC::CRGBA col, CC
pos = newmsg.find(ucstring("}"));;
prefix += " ";
}
newmsg = newmsg.substr(0, pos + 1) + prefix + newmsg.substr(pos + 1);
if (pos == ucstring::npos)
newmsg = prefix + newmsg;
else
newmsg = newmsg.substr(0, pos + 1) + prefix + newmsg.substr(pos + 1);
// Add dynchannel number and optionally name before text if user channel
CCDBNodeLeaf* node = NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_DYN_CHANNEL_NAME_IN_CHAT_CB", false);
@ -615,7 +619,11 @@ void CChatGroupWindow::displayMessage(const ucstring &msg, NLMISC::CRGBA col, CC
STRING_MANAGER::CStringManagerClient::instance()->getDynString(textId, title);
prefix = title.empty() ? ucstring("") : ucstring(" ") + title;
pos = newmsg.find(ucstring("] "));
newmsg = newmsg.substr(0, pos) + prefix + newmsg.substr(pos);
if (pos == ucstring::npos)
newmsg = prefix + newmsg;
else
newmsg = newmsg.substr(0, pos) + prefix + newmsg.substr(pos);
}
}
break;

View file

@ -456,7 +456,7 @@ bool CCtrlSheetInfo::parseCtrlInfo(xmlNodePtr cur, CInterfaceGroup * /* parentGr
else
{
// must not have so much brick type, else must change code!
nlassert(brickType<32);
// nlassert(brickType<32);
// Ok set the bit associated
_BrickTypeBitField|= 1<<brickType;

View file

@ -22,6 +22,7 @@
#include "../user_entity.h"
#include "../entities.h"
#include "interface_manager.h"
#include "user_agent.h"
// used for login cookie to be sent to the web server
#include "../net_manager.h"
@ -157,7 +158,7 @@ struct CWebigNotificationThread : public NLMISC::IRunnable
if(!Curl) return;
curl_easy_setopt(Curl, CURLOPT_COOKIEFILE, "");
curl_easy_setopt(Curl, CURLOPT_NOPROGRESS, 1);
curl_easy_setopt(Curl, CURLOPT_USERAGENT, "Ryzom");
curl_easy_setopt(Curl, CURLOPT_USERAGENT, getUserAgent().c_str());
curl_easy_setopt(Curl, CURLOPT_FOLLOWLOCATION, 1);
curl_easy_setopt(Curl, CURLOPT_WRITEFUNCTION, writeDataFromCurl);
//nlinfo("ctor CWebigNotificationThread");

View file

@ -467,8 +467,8 @@ CInterfaceManager::CInterfaceManager()
CGroupHTML::options.trustedDomains = ClientCfg.WebIgTrustedDomains;
CGroupHTML::options.languageCode = ClientCfg.getHtmlLanguageCode();
CGroupHTML::options.appName = "Ryzom";
CGroupHTML::options.appVersion = getUserAgent();
CGroupHTML::options.appName = getUserAgentName();
CGroupHTML::options.appVersion = getUserAgentVersion();
NLGUI::CDBManager::getInstance()->resizeBanks( NB_CDB_BANKS );
interfaceLinkUpdater = new CInterfaceLink::CInterfaceLinkUpdater();
@ -2925,7 +2925,7 @@ void CInterfaceManager::initEmotes()
CSkillManager *pSM = CSkillManager::getInstance();
betaTester = pSM->isTitleUnblocked(CHARACTER_TITLE::FBT);
string previousMind = "";
string previousMind;
CGroupSubMenu *pFirstMenu = 0;
for (list<CEmoteEntry>::const_iterator it = entries.begin(); it != entries.end(); it++)

View file

@ -1068,12 +1068,12 @@ float CPatchManager::getCurrentFileProgress() const
}
// ****************************************************************************
void CPatchManager::setRWAccess (const string &filename)
void CPatchManager::setRWAccess (const string &filename, bool bThrowException)
{
ucstring s = CI18N::get("uiSetAttrib") + " " + filename;
setState(true, s);
if (!NLMISC::CFile::setRWAccess(filename))
if (!NLMISC::CFile::setRWAccess(filename) && bThrowException)
{
s = CI18N::get("uiAttribErr") + " " + filename + " (" + toString(errno) + "," + strerror(errno) + ")";
setState(true, s);
@ -1351,7 +1351,7 @@ void CPatchManager::downloadFileWithCurl (const string &source, const string &de
// create the local file
if (NLMISC::CFile::fileExists(dest))
{
setRWAccess(dest);
setRWAccess(dest, false);
NLMISC::CFile::deleteFile(dest.c_str());
}
FILE *fp = fopen (dest.c_str(), "wb");
@ -1492,7 +1492,7 @@ void CPatchManager::decompressFile (const string &filename)
}
string dest = filename.substr(0, filename.size ()-4);
setRWAccess(dest);
setRWAccess(dest, false);
//if(isVerboseLog()) nlinfo("Calling fopen('%s','wb')", dest.c_str());
FILE *fp = fopen (dest.c_str(), "wb");
if (fp == NULL)
@ -1566,7 +1566,7 @@ void CPatchManager::applyDate (const string &sFilename, uint32 nDate)
{
// _utimbuf utb;
// utb.actime = utb.modtime = nDate;
setRWAccess(sFilename);
setRWAccess(sFilename, false);
ucstring s = CI18N::get("uiChangeDate") + " " + NLMISC::CFile::getFilename(sFilename) + " " + toString(NLMISC::CFile::getFileModificationDate (sFilename)) +
" -> " + toString(nDate);
setState(true,s);
@ -3398,6 +3398,7 @@ bool CPatchManager::extract(const std::string& patchPath,
ok = true;
}
}
if (!ok)
{
// nothing to extract
@ -3407,15 +3408,21 @@ bool CPatchManager::extract(const std::string& patchPath,
// extract
uint nblab = 0;
pPM->deleteFile(updateBatchFilename, false, false);
FILE *fp = fopen (updateBatchFilename.c_str(), "wt");
if (fp == 0)
{
string err = toString("Can't open file '%s' for writing: code=%d %s (error code 29)", updateBatchFilename.c_str(), errno, strerror(errno));
throw Exception (err);
}
#ifdef NL_OS_WINDOWS
fprintf(fp, "@echo off\n");
fprintf(fp, "ping 127.0.0.1 -n 7 -w 1000 > nul\n"); // wait
#else
// TODO: for Linux and OS X
#endif
// Unpack files with category ExtractPath non empty
for (uint32 j = 0; j < sourceFilename.size(); ++j)
@ -3442,21 +3449,32 @@ bool CPatchManager::extract(const std::string& patchPath,
string DstPath = CPath::standardizeDosPath(extractPath[j]);
string DstName = DstPath + vFilenames[fff];
NLMISC::CFile::createDirectoryTree(extractPath[j]);
// this file must be moved
// this file must be moved
#ifdef NL_OS_WINDOWS
fprintf(fp, ":loop%u\n", nblab);
fprintf(fp, "attrib -r -a -s -h %s\n", DstName.c_str());
fprintf(fp, "del %s\n", DstName.c_str());
fprintf(fp, "if exist %s goto loop%u\n", DstName.c_str(), nblab);
fprintf(fp, "move %s %s\n", SrcName.c_str(), DstPath.c_str());
#else
// TODO: for Linux and OS X
#endif
nblab++;
}
}
}
}
#ifdef NL_OS_WINDOWS
fprintf(fp, "start %s %%1 %%2 %%3\n", execName.c_str());
#else
// TODO: for Linux and OS X
#endif
fclose(fp);
if (stopFun)

View file

@ -302,7 +302,7 @@ private:
/// Read the description of the highest client version file found
void readClientVersionAndDescFile();
void setRWAccess (const std::string &filename);
void setRWAccess (const std::string &filename, bool bThrowException=true);
std::string deleteFile (const std::string &filename, bool bThrowException=true, bool bWarning=true);

View file

@ -85,7 +85,7 @@ static std::string sizeToHumanStd(uint64 size)
static std::string getVideoInfoDeviceName()
{
uint64 version;
std::string ret = "";
std::string ret;
bool ok = CSystemInfo::getVideoInfo(ret, version);
if (ok)
{

View file

@ -1013,6 +1013,7 @@ bool mainLoop()
SetMouseCursor ();
// Set the cursor.
ContextCur.context("STAND BY");
UserControls.reset();
// set the default box for keyboard
setDefaultChatWindow(PeopleInterraction.ChatGroup.Window);
@ -2463,6 +2464,7 @@ bool mainLoop()
SetMouseCursor ();
// Set the cursor.
ContextCur.context("STAND BY");
UserControls.reset();
// set the default box for keyboard
CChatWindow *defaultChatWindow;

View file

@ -920,7 +920,7 @@ std::string getStringCategory(const ucstring &src, ucstring &dest, bool alwaysAd
std::string getStringCategoryIfAny(const ucstring &src, ucstring &dest)
{
std::string colorCode = "";
std::string colorCode;
if (src.size() >= 3)
{
uint startPos = 0;

View file

@ -174,6 +174,10 @@ void CUserControls::init()
}// init //
void CUserControls::reset()
{
init();
}
//-----------------------------------------------
// needReleaseForward :

View file

@ -152,6 +152,8 @@ public:
/// Constructor
CUserControls();
void reset();
/// Return the string associated to the motion Mode.
std::string modeStr() const;
/// Return the motion Mode.

View file

@ -4109,7 +4109,7 @@ void CNetManagerMulti::init( const std::string& cookie, const std::string& addr
//
uint32 ShardId = 0;
std::string WebServer = "";
std::string WebServer;

View file

@ -564,7 +564,7 @@ void CDisplayerVisualEntity::updateWorldMapPresence()
_MapDeco.setDisplayedInstance(getDisplayedInstance(), true);
// retrieve icon from the displayed object (lua code)
CLuaState &ls = getEditor().getLua();
std::string texName = "";
std::string texName;
{
CLuaStackChecker lsc(&ls);
if (getDisplayedInstance()->getLuaProjection().callMethodByNameNoThrow("getSelectBarIcon", 0, 1))
@ -984,7 +984,7 @@ void CDisplayerVisualEntity::updateName()
break;
}
}
std::string firstPart = "";
std::string firstPart;
if(actNb>0)
firstPart = CI18N::get("uiR2EDDefaultActTitle").toString() + " " + NLMISC::toString(actNb);

View file

@ -1116,12 +1116,12 @@ void CClientEditionModule::startingScenario(class NLNET::IModuleProxy * /* serve
uint32 myUserId = NetMngr.getUserId();
std::string connectionState = "";
std::string connectionState;
if (myUserId == (charId>>4) || ClientCfg.Local)
{
std::string errorMsg = "";
std::string errorMsg;
CObject* hlScenario = _Scenario->getHighLevel();
hlData.setData(hlScenario); // clone before modify by translateFeatures
@ -2425,10 +2425,10 @@ bool CClientEditionModule::addToLoadList( const std::string& filename, CScenario
void CClientEditionModule::loadScenarioSucceded(const std::string& filename, const std::string& body, const CScenarioValidator::TValues& values)
{
//H_AUTO(R2_CClientEditionModule_loadScenarioSucceded)
string initialIsland="", initialEntryPoint="", initialSeason = "";
string creatorMD5 = "", modifiedByMD5="";
string name = "";
string locked = "";
string initialIsland, initialEntryPoint, initialSeason;
string creatorMD5, modifiedByMD5;
string name;
string locked;
for(uint i=0; i<values.size(); i++)
{
const std::pair<std::string, std::string>& pair = values[i];

View file

@ -834,7 +834,7 @@ sint CComLuaModule::luaRequestEraseNode(lua_State* state)
if (args>2) { luaL_checknumber(state, 3); }
std::string instanceId(lua_tostring(state, 1));
std::string attrName = "";
std::string attrName;
sint position = -1;
if (args>1){ attrName = lua_tostring(state, 2);}
if (args>2){ position = static_cast<sint>(lua_tonumber(state, 3));}
@ -1255,7 +1255,7 @@ CObject* CComLuaModule::getObjectFromLua(lua_State* state, sint idx)
lua_pushnil(state);
while (lua_next(state, -2) != 0)
{
std::string key = "";
std::string key;
if ( lua_type(state, -2) == LUA_TSTRING)
{
key = lua_tostring(state, -2);
@ -1285,7 +1285,7 @@ CObject* CComLuaModule::getObjectFromLua(lua_State* state, sint idx)
CObject* CComLuaModule::loadLocal(const std::string& filename, const CScenarioValidator::TValues& values)
{
CScenarioValidator::TValues::const_iterator first(values.begin()), last(values.end());
std::string name = "";
std::string name;
for (; first != last; ++first)
{
if (first->first == "Name" ) { name = first->second; }
@ -1347,7 +1347,7 @@ bool CComLuaModule::loadUserComponent(const std::string& filename)
CObject* CComLuaModule::loadFromBuffer(const std::string& data, const std::string& filename, const CScenarioValidator::TValues& values)
{
CScenarioValidator::TValues::const_iterator first(values.begin()), last(values.end());
std::string name = "";
std::string name;
for (; first != last; ++first)
{
if (first->first == "Name" ) { name = first->second; }

View file

@ -267,7 +267,7 @@ void CDynamicMapClient::save(const std::string& /* filename */)
void CDynamicMapClient::saveRtData(const std::string& filename)
{
//H_AUTO(R2_CDynamicMapClient_saveRtData)
std::string name = "";
std::string name;
name += filename;
//std::ostringstream out2;
std::string out2;

View file

@ -21,7 +21,6 @@
#include "session_browser.h"
#include "game_share/ring_session_manager_itf.h"
#include "nel/gui/lua_helper.h"
using namespace NLGUI;
#include "far_tp.h"
class CSessionBrowserImpl : public CSessionBrowser,
@ -37,7 +36,7 @@ public:
* - RingAccessPoint:onConnectionClosed()
* - RingAccessPoint:onConnectionFailed()
*/
void init(CLuaState *ls);
void init(NLGUI::CLuaState *ls);
// from CSessionBrowser
virtual void on_connectionFailed();
virtual void on_connectionClosed();
@ -99,17 +98,17 @@ public:
static const std::string &getFrontEndAddress();
private:
CLuaState::TRefPtr _Lua;
static int luaGetRingSessionList(CLuaState &ls);
static int luaGetRingCharList(CLuaState &ls);
static int luaJoinRingSession(CLuaState &ls);
static int luaCheckRingAccess(CLuaState &ls);
static int luaGetFileHeader(CLuaState &ls);
static int luaGetRingStats(CLuaState &ls);
static int luaGetScenarioScores(CLuaState &ls);
static int luaUpdateScenarioScores(CLuaState &ls);
static int luaGetSessionAverageScores(CLuaState &ls);
static int luaGetScenarioAverageScores(CLuaState &ls);
NLGUI::CLuaState::TRefPtr _Lua;
static int luaGetRingSessionList(NLGUI::CLuaState &ls);
static int luaGetRingCharList(NLGUI::CLuaState &ls);
static int luaJoinRingSession(NLGUI::CLuaState &ls);
static int luaCheckRingAccess(NLGUI::CLuaState &ls);
static int luaGetFileHeader(NLGUI::CLuaState &ls);
static int luaGetRingStats(NLGUI::CLuaState &ls);
static int luaGetScenarioScores(NLGUI::CLuaState &ls);
static int luaUpdateScenarioScores(NLGUI::CLuaState &ls);
static int luaGetSessionAverageScores(NLGUI::CLuaState &ls);
static int luaGetScenarioAverageScores(NLGUI::CLuaState &ls);
// Call a method inside the 'RingAccessPoint' lua table
void callRingAccessPointMethod(const char *name, int numArg, int numResult);
void callRingCharTrackingMethod(const char *name, int numArg, int numResult);

View file

@ -21,7 +21,7 @@
#include "game_share/ryzom_version.h"
#ifdef HAVE_REVISION_H
#if defined(RYZOM_COMPATIBILITY_VERSION) && defined(HAVE_REVISION_H)
#include "revision.h"
#endif
@ -45,6 +45,16 @@
#endif
std::string getUserAgent()
{
return getUserAgentName() + "/" + getUserAgentVersion();
}
std::string getUserAgentName()
{
return "Ryzom";
}
std::string getUserAgentVersion()
{
static std::string s_userAgent;
@ -52,8 +62,9 @@ std::string getUserAgent()
{
char buffer[256];
#ifdef REVISION
sprintf(buffer, "%s.%s-%s-%s", RYZOM_VERSION, REVISION, RYZOM_SYSTEM, RYZOM_ARCH);
#if defined(REVISION) && defined(RYZOM_COMPATIBILITY_VERSION)
// we don't need RYZOM_VERSION if we already have a numeric form a.b.c, we just need to append revision to it
sprintf(buffer, "%s.%s-%s-%s", RYZOM_COMPATIBILITY_VERSION, REVISION, RYZOM_SYSTEM, RYZOM_ARCH);
#else
sprintf(buffer, "%s-%s-%s", RYZOM_VERSION, RYZOM_SYSTEM, RYZOM_ARCH);
#endif

View file

@ -18,6 +18,8 @@
#define CL_USER_AGENT_H
std::string getUserAgent();
std::string getUserAgentName();
std::string getUserAgentVersion();
#endif // CL_USER_AGENT_H

View file

@ -43,7 +43,7 @@ namespace BRICK_TYPE
TIMED_ACTION,
BRICK_TYPE_COUNT,
BONUS,
UNKNOWN
UNKNOWN // Warning: Shouldn't exceed 32
};

View file

@ -51,6 +51,7 @@ public:
enum TPeople
{
Undefined = -1,
Humanoid = 0,
Playable = 0,
Fyros = 0,

View file

@ -138,7 +138,7 @@ void initRyzomVisualPropertyIndices( CMirroredDataSet& dataset );
#define TYPE_BOT_TRADE_SELECTOR2 uint64
#define TYPE_EVENT_FACTION_ID uint32
#define TYPE_PVP_MODE uint32
#define TYPE_PVP_MODE uint16
#define TYPE_PVP_CLAN uint32
#define TYPE_FUEL bool

View file

@ -17,7 +17,10 @@
#ifndef RYZOM_VERSION_H
#define RYZOM_VERSION_H
#define RYZOM_VERSION "ryzomcore/v0.10.0-dev"
#define RYZOM_VERSION "ryzomcore" \
"/" \
"v0.11.2" \
""
#endif // RYZOM_VERSION_H

View file

@ -292,14 +292,14 @@
</STRUCT>
<STRUCT>
<ATOM Name="name" Value="PvpMode"/>
<ATOM Name="type" Value="uint8"/>
<ATOM Name="type" Value="uint16"/>
<ATOM Name="persistant" Value="true"/>
<ATOM Name="mirror" Value="true"/>
<ATOM Name="weight" Value="1"/>
</STRUCT>
<STRUCT>
<ATOM Name="name" Value="PvpClan"/>
<ATOM Name="type" Value="uint8"/>
<ATOM Name="type" Value="uint32"/>
<ATOM Name="persistant" Value="true"/>
<ATOM Name="mirror" Value="true"/>
<ATOM Name="weight" Value="1"/>

View file

@ -99,14 +99,14 @@ then
for f in $DOMAIN_LIST
do
# see if we're setup to run this domain
if [ -e /srv/core/${f}.screen.rc ] && [ -e /srv/core/bin/${f} ]
if [ -e /srv/core/${f}.screen.rc ] && [ -e /srv/core/bin/domain_${f} ]
then
# see whether the domain is alredy running
if [ $( screen -list | grep \( | cut -f2 | cut -d. -f2| grep \^$f\$ | wc -l) == 0 ]
if [ $( screen -list | grep \\\.${f} | wc -w ) = 0 ]
then
# the domain isn't running yet so start it
echo '****' starting domain: $f '****'
/srv/core/bin/$f batchstart
/srv/core/bin/domain_$f batchstart
else
echo '****' Domain is already running: $f '****'
fi

View file

@ -3,7 +3,7 @@
while true
do
if [ "$2" == "" ]
if [ "$2" = "" ]
then
echo
echo USAGE: $0 sleep_time command_line

View file

@ -4,8 +4,8 @@ cd /srv/core
rm */*.state */*/*.launch_ctrl */*/*.state
/bin/bash /srv/core/bin/admin start
# special case for the "ep1.std01.ryzomcore.org" machine - start the admin tool graph sync script
if [ $(hostname) = "ep1.std01.ryzomcore.org" ]
# special case for the "ep1.std01.ryzomcore.local" machine - start the admin tool graph sync script
if [ $(hostname) = "ep1.std01.ryzomcore.local" ]
then
nohup /bin/sh /srv/core/bin/sync_rrd_graphs.sh &
fi

View file

@ -4,7 +4,7 @@ echo Launched: $(date)
while true
do
# retrieve ATS files from ATS admin tool machine
rsync -t ep1.std01.ryzomcore.org:ats/graph_datas/* /srv/core/mini01/rrd_graphs/
rsync -t ep1.std01.ryzomcore.local:ats/graph_datas/* /srv/core/mini01/rrd_graphs/
# deal with live files - duplicate files that correspond to unique services to aid with graphing of su & co
cd /srv/core/std01/rrd_graphs/

View file

@ -10,7 +10,7 @@ AESAliasName= "aes";
DontUseStdIn = 0;
// Adress ofthe admin service (default port is 49996)
ASHost = "ep1.mini01.ryzomcore.org";
ASHost = "ep1.mini01.ryzomcore.local";
// Config for AES
AESPort = "46712";

View file

@ -10,7 +10,7 @@ AESAliasName= "aes";
DontUseStdIn = 0;
// Adress ofthe admin service (default port is 49996)
ASHost = "ep1.std01.ryzomcore.org";
ASHost = "ep1.std01.ryzomcore.local";
// Config for AES
AESPort = "46702";

View file

@ -10,6 +10,7 @@ do
chmod 775 bin/ps_services 2> /dev/null
chmod 775 bin/run_forever 2> /dev/null
chmod 775 bin/shard 2> /dev/null
chmod 775 bin/domain_* 2> /dev/null
chmod 775 bin/startup 2> /dev/null
chmod 775 bin/*.sh 2> /dev/null
chmod 775 patchman/*_service 2> /dev/null

View file

@ -3,8 +3,8 @@
CFGFILENAME=patchman_service.${SERVER_TYPE}.cfg
echo cfg file: $CFGFILENAME
AESCFGFILENAME=admin_executor_service_default.${SERVER_TYPE}.cfg
echo aes cfg file: $AESCFGFILENAME
#AESCFGFILENAME=admin_executor_service_default.${SERVER_TYPE}.cfg
#echo aes cfg file: $AESCFGFILENAME
cd /srv/core/patchman
if [ -e $CFGFILENAME ]
@ -15,8 +15,8 @@ if [ -e $CFGFILENAME ]
cp $CFGFILENAME patchman_service.cfg
# setup the config file for the admin executor service
echo Using aes configuration file: $AESCFGFILENAME
if [ -e $AESCFGFILENAME ] ; then cp $AESCFGFILENAME admin_executor_service_default.cfg ; fi
#echo Using aes configuration file: $AESCFGFILENAME
#if [ -e $AESCFGFILENAME ] ; then cp $AESCFGFILENAME admin_executor_service_default.cfg ; fi
# start the patchman service
echo Launching patchman...

View file

@ -1,6 +1,6 @@
#!/bin/sh
if [ "$1" == "" ]
if [ "$1" = "" ]
then
echo
echo USAGE: $0 command_line

View file

@ -84,7 +84,7 @@ rm -v */*.*launch_ctrl *.*launch_ctrl 2> /dev/null
# initialise the state files for the new services to "xxxxx" and remove directories that are no longer of interest
for D in $(ls */log.log | sed "s%/.*%%" | sort -u)
do
if [ $(grep \"$D\" admin_executor_service.cfg | wc -l) == 1 ]
if [ $(grep \"$D\" admin_executor_service.cfg | wc -l) = 1 ]
then
printf "xxxxx" > $D/$D.state
else
@ -97,7 +97,7 @@ done
printf "1" > ./global.launch_ctrl
# create a script for accessing the screen for this shard
SCRIPT_FILE=/srv/core/bin/${DOMAIN}
SCRIPT_FILE=/srv/core/bin/domain_${DOMAIN}
echo "#!/bin/sh" > $SCRIPT_FILE
echo "cd "$(pwd) >> $SCRIPT_FILE
echo '/bin/sh /srv/core/bin/ryzom_domain_screen_wrapper.sh $*' >> $SCRIPT_FILE

View file

@ -1,23 +1,23 @@
// default values for different sites
mini01 ep1.mini01.ryzomcore.org
std01 ep1.std01.ryzomcore.org
std01 su1.std01.ryzomcore.org
std01 pd1.std01.ryzomcore.org
std01 pd2.std01.ryzomcore.org
std01 pd3.std01.ryzomcore.org
std01 pd4.std01.ryzomcore.org
std01 mla1.std01.ryzomcore.org
std01 mla2.std01.ryzomcore.org
std01 mla3.std01.ryzomcore.org
std01 mla4.std01.ryzomcore.org
std01 mla5.std01.ryzomcore.org
std01 mlb1.std01.ryzomcore.org
std01 mlb2.std01.ryzomcore.org
std01 mlb3.std01.ryzomcore.org
std01 mlb4.std01.ryzomcore.org
std01 mlb5.std01.ryzomcore.org
std01 rra1.std01.ryzomcore.org
std01 rra2.std01.ryzomcore.org
std01 rrb1.std01.ryzomcore.org
std01 rrb2.std01.ryzomcore.org
mini01 ep1.mini01.ryzomcore.local
std01 ep1.std01.ryzomcore.local
std01 su1.std01.ryzomcore.local
std01 pd1.std01.ryzomcore.local
std01 pd2.std01.ryzomcore.local
std01 pd3.std01.ryzomcore.local
std01 pd4.std01.ryzomcore.local
std01 mla1.std01.ryzomcore.local
std01 mla2.std01.ryzomcore.local
std01 mla3.std01.ryzomcore.local
std01 mla4.std01.ryzomcore.local
std01 mla5.std01.ryzomcore.local
std01 mlb1.std01.ryzomcore.local
std01 mlb2.std01.ryzomcore.local
std01 mlb3.std01.ryzomcore.local
std01 mlb4.std01.ryzomcore.local
std01 mlb5.std01.ryzomcore.local
std01 rra1.std01.ryzomcore.local
std01 rra2.std01.ryzomcore.local
std01 rrb1.std01.ryzomcore.local
std01 rrb2.std01.ryzomcore.local

View file

@ -10,7 +10,7 @@ StartCommands =
// Create a gateway module on layer 3 transport and open it
"moduleManager.createModule StandardGateway bridge_gw",
"bridge_gw.transportAdd L3Client l3client",
"bridge_gw.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.org:44749)",
"bridge_gw.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.local:44749)",
//------------------------------------------------------------------------------
@ -19,7 +19,7 @@ StartCommands =
// Create a gateway module on layer 3 transport and open it
"moduleManager.createModule StandardGateway spm_gw",
"spm_gw.transportAdd L3Client l3client",
"spm_gw.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.org:44752)",
"spm_gw.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.local:44752)",
//------------------------------------------------------------------------------
@ -28,10 +28,3 @@ StartCommands =
"pam.plug spm_gw",
"pam.plug bridge_gw",
};
SpaPreCmdLineText="/bin/sh /srv/core/patchman/service_launcher.sh";
DeploymentRootDirectory="/srv/core/patchman/";
MakeInstalledVersionLiveCmdLine="/bin/sh /srv/core/patchman/make_next_live.sh";
SpaLaunchAESCmdLine="/bin/sh /srv/core/patchman/loop_aes.sh";
InstallArchiveDirectory="/srv/core/";
InstallArchiveFileName="admin_install.tgz";

View file

@ -10,7 +10,7 @@ StartCommands =
// Create a gateway module on layer 3 transport and open it
"moduleManager.createModule StandardGateway bridge_gw",
"bridge_gw.transportAdd L3Client l3client",
"bridge_gw.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.org:44749)",
"bridge_gw.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.local:44749)",
//------------------------------------------------------------------------------
@ -19,7 +19,7 @@ StartCommands =
// Create a gateway module on layer 3 transport and open it
"moduleManager.createModule StandardGateway spm_gw",
"spm_gw.transportAdd L3Client l3client",
"spm_gw.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.org:44751)",
"spm_gw.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.local:44751)",
//------------------------------------------------------------------------------
@ -36,10 +36,3 @@ StartCommands =
"pam.plug spm_gw",
"pam.plug bridge_gw",
};
SpaPreCmdLineText="/bin/sh /srv/core/patchman/service_launcher.sh";
DeploymentRootDirectory="/srv/core/patchman/";
MakeInstalledVersionLiveCmdLine="/bin/sh /srv/core/patchman/make_next_live.sh";
SpaLaunchAESCmdLine="/bin/sh /srv/core/patchman/loop_aes.sh";
InstallArchiveDirectory="/srv/core/";
InstallArchiveFileName="admin_install.tgz";

View file

@ -43,7 +43,7 @@ StartCommands +=
// Create a gateway module on layer 3 transport and open it
"moduleManager.createModule StandardGateway spm_gw",
"spm_gw.transportAdd L3Client l3client",
"spm_gw.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.org:44751)",
"spm_gw.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.local:44751)",
//------------------------------------------------------------------------------

View file

@ -10,7 +10,7 @@ StartCommands =
// Create a gateway module on layer 3 transport and open it
"moduleManager.createModule StandardGateway bridge_gw",
"bridge_gw.transportAdd L3Client l3client",
"bridge_gw.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.org:44749)",
"bridge_gw.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.local:44749)",
//------------------------------------------------------------------------------
@ -19,7 +19,7 @@ StartCommands =
// Create a gateway module on layer 3 transport and open it
"moduleManager.createModule StandardGateway spm_gw",
"spm_gw.transportAdd L3Client l3client",
"spm_gw.transportCmd l3client(connect addr=ep1.std01.ryzomcore.org:44752)",
"spm_gw.transportCmd l3client(connect addr=ep1.std01.ryzomcore.local:44752)",
//------------------------------------------------------------------------------
@ -36,10 +36,3 @@ StartCommands =
"pam.plug spm_gw",
"pam.plug bridge_gw",
};
SpaPreCmdLineText="/bin/sh /srv/core/patchman/service_launcher.sh";
DeploymentRootDirectory="/srv/core/patchman/";
MakeInstalledVersionLiveCmdLine="/bin/sh /srv/core/patchman/make_next_live.sh";
SpaLaunchAESCmdLine="/bin/sh /srv/core/patchman/loop_aes.sh";
InstallArchiveDirectory="/srv/core/";
InstallArchiveFileName="admin_install.tgz";

View file

@ -14,4 +14,9 @@ DontUseStdIn = 0;
// 4 = nothing
UseYieldMethod = 0;
SpaPreCmdLineText="/bin/sh /srv/core/patchman/service_launcher.sh";
DeploymentRootDirectory="/srv/core/patchman/";
MakeInstalledVersionLiveCmdLine="/bin/sh /srv/core/patchman/make_next_live.sh";
SpaLaunchAESCmdLine="/bin/sh /srv/core/patchman/loop_aes.sh";
InstallArchiveDirectory="/srv/core/";
InstallArchiveFileName="admin_install.tgz";

View file

@ -1,25 +1,26 @@
#!/bin/sh
# the object is to make a launcher script that works with a command file to determine when to launch the application that it is responsible for
# the objective is to make a launcher script that works with a command file to determine when to launch the application that it is responsible for
DOMAIN=$(pwd |sed "s%/srv/core/%%" | sed "s%/.*%%")
NAME_BASE=$(pwd | sed 's/\/srv\/core\///' | sed 's/^.*\///')
#if [ _$DOMAIN == _pre_live ]
# then
CTRL_FILE=${NAME_BASE}.launch_ctrl
NEXT_CTRL_FILE=${NAME_BASE}.deferred_launch_ctrl
# then
CTRL_FILE=${NAME_BASE}.launch_ctrl
NEXT_CTRL_FILE=${NAME_BASE}.deferred_launch_ctrl
#elif [ _$DOMAIN == _pre_pre_live ]
# then
# CTRL_FILE=${NAME_BASE}.launch_ctrl
# NEXT_CTRL_FILE=${NAME_BASE}.deferred_launch_ctrl
# then
# CTRL_FILE=${NAME_BASE}.launch_ctrl
# NEXT_CTRL_FILE=${NAME_BASE}.deferred_launch_ctrl
#else
# CTRL_FILE=${NAME_BASE}_immediate.launch_ctrl
# NEXT_CTRL_FILE=${NAME_BASE}_waiting.launch_ctrl
# CTRL_FILE=${NAME_BASE}_immediate.launch_ctrl
# NEXT_CTRL_FILE=${NAME_BASE}_waiting.launch_ctrl
#fi
STATE_FILE=${NAME_BASE}.state
START_COUNTER_FILE=${NAME_BASE}.start_count
CTRL_CMDLINE=$*
CTRL_COMMAND=""
echo
echo ---------------------------------------------------------------------------------
@ -36,6 +37,13 @@ echo
echo 0 > $START_COUNTER_FILE
START_COUNTER=0
# always give ras a first run
if [ "${NAME_BASE}" = "ras" ]
then
echo Force admin service first startup
printf LAUNCH > $CTRL_FILE
fi
echo Press ENTER to launch program
while true
do
@ -45,37 +53,37 @@ do
then
# a control file exists so read it's contents
CTRL_COMMAND=_$(cat $CTRL_FILE)_
CTRL_COMMAND=$(cat $CTRL_FILE)
# do we have a 'launch' command?
if [ $CTRL_COMMAND = _LAUNCH_ ]
if [ "$CTRL_COMMAND" = "LAUNCH" ]
then
# update the start counter
START_COUNTER=$(( $START_COUNTER + 1 ))
echo $START_COUNTER > $START_COUNTER_FILE
# update the start counter
START_COUNTER=$(( $START_COUNTER + 1 ))
echo $START_COUNTER > $START_COUNTER_FILE
# big nasty hack to deal with the special cases of ryzom_naming_service and ryzom_admin_service who have badly names cfg files
for f in ryzom_*cfg
do
cp $f $(echo $f | sed "s/ryzom_//")
done
# big nasty hack to deal with the special cases of ryzom_naming_service and ryzom_admin_service who have badly names cfg files
for f in ryzom_*cfg
do
cp $f $(echo $f | sed "s/ryzom_//")
done
# we have a launch command so prepare, launch, wait for exit and do the housekeeping
echo -----------------------------------------------------------------------
echo Launching ...
echo
printf RUNNING > $STATE_FILE
# we have a launch command so prepare, launch, wait for exit and do the housekeeping
echo -----------------------------------------------------------------------
echo Launching ...
echo
printf RUNNING > $STATE_FILE
$CTRL_CMDLINE
$CTRL_CMDLINE
echo -----------------------------------------------------------------------
printf STOPPED > $STATE_FILE
echo -----------------------------------------------------------------------
printf STOPPED > $STATE_FILE
# consume (remove) the control file to allow start once
rm $CTRL_FILE
# consume (remove) the control file to allow start once
rm $CTRL_FILE
echo Press ENTER to relaunch
echo Press ENTER to relaunch
fi
fi
@ -87,9 +95,9 @@ do
else
# give the terminal user a chance to press enter to provoke a re-launch
HOLD=`sh -ic '{ read a; echo "ENTER" 1>&3; kill 0; } | { sleep 2; kill 0; }' 3>&1 2>/dev/null`
if [ _${HOLD}_ != _HOLD_ ]
then
printf LAUNCH > $CTRL_FILE
if [ "${HOLD}" = "ENTER" ]
then
printf LAUNCH > $CTRL_FILE
fi
fi

View file

@ -1,10 +1,10 @@
// mini01 - mini manager
mini01_spm ep1.mini01.ryzomcore.org
mini01_bridge ep1.mini01.ryzomcore.org
mini01_spm ep1.mini01.ryzomcore.local
mini01_bridge ep1.mini01.ryzomcore.local
// std01 - std manager
std01_spm ep1.std01.ryzomcore.org
std01_spm ep1.std01.ryzomcore.local

View file

@ -1 +1 @@
SPAHost = "ep1.mini01.ryzomcore.org";
SPAHost = "ep1.mini01.ryzomcore.local";

View file

@ -6,7 +6,7 @@ SystemCmd = {};
//NegFiltersDebug += { "LNET", "HNET", "FEVIS"};
//NegFiltersInfo += { "LNET", "HNET", "VISION_DELTA", "FEIMPE", "FEVIS" };
// NegFiltersWarning += { "LNET", "FEHACK", "FERECV"};
// NegFiltersWarning += { "positional", "faction", "pet" };
// NegFiltersWarning += { "positional", "faction", "pet" };
//////////////////////////////////////////////////////////////////////////////
//- Basic (specific) heal profile parameters ---------------------------------
@ -49,7 +49,7 @@ DefaultNpcAggroDist = 15;
DefaultEscortRange = 10;
//////////////////////////////////////////////////////////////////////////////
// Aggro //
// Aggro //
//////////////////////////////////////////////////////////////////////////////
AggroReturnDistCheck = 15.0;
AggroReturnDistCheckFauna = 15.0;
@ -318,25 +318,25 @@ StartCommandsWhenMirrorReadyPost =
// commands for Ring continents
StartCommandsWhenMirrorReadyRing =
{
"loadContinent r2_desert",
"loadContinent r2_desert",
"createDynamicAIInstance 10000",
"loadPrimitiveFile dummy.primitive",
"loadContinent r2_forest",
"createDynamicAIInstance 10001",
"loadPrimitiveFile dummy.primitive",
// "loadContinent r2_forest",
// "createDynamicAIInstance 10001",
// "loadPrimitiveFile dummy.primitive",
"loadContinent r2_lakes",
"createDynamicAIInstance 10003",
"loadPrimitiveFile dummy.primitive",
// "loadContinent r2_lakes",
// "createDynamicAIInstance 10003",
// "loadPrimitiveFile dummy.primitive",
"loadContinent r2_jungle",
"createDynamicAIInstance 10002",
"loadPrimitiveFile dummy.primitive",
// "loadContinent r2_jungle",
// "createDynamicAIInstance 10002",
// "loadPrimitiveFile dummy.primitive",
"loadContinent r2_roots",
"createDynamicAIInstance 10004",
"loadPrimitiveFile dummy.primitive",
// "loadContinent r2_roots",
// "createDynamicAIInstance 10004",
// "loadPrimitiveFile dummy.primitive",
// "spawnInstances",
"updateAI",

View file

@ -0,0 +1,9 @@
DelayBeforeStartAct = 1;
MaxNpcs = 300;
MaxStaticObjects = 200;
StartCommands +=
{
"unifiedNetwork.addService ShardUnifier ( address="+SUAddress+" sendId external autoRetry )",
};

View file

@ -0,0 +1,5 @@
DontUseNS = 1;
QueryTimeout = 300;
LinePerPage = 50;

View file

@ -1,7 +1,7 @@
DontUseNS = 1;
RRDToolPath = "rrdtool";
RRDVarPath = "../graph_datas";
RRDVarPath = "../rrd_graphs";
// Variables required to be defined by other cfgs
//AESHost="localhost";

View file

@ -26,7 +26,7 @@ define exe_set_mini_ring
define exe_set_mini_mainland
use raes
use ms_mini_mainland
use ais_newbyland
use ais_newbieland
use egs_mainland
use gpms_mainland
use ios_mainland
@ -100,7 +100,7 @@ define exe_set_std_mainland_be03
define exe_set_std_mainland_be03_basics
// use ais_matis
// use ais_tryker
use ais_newbyland
use ais_newbieland
// unifier and co ------------------
@ -170,12 +170,14 @@ define ais_ring
cmdLine ai_service -C. -L. --nobreak --writepid -mCommon:Ring
use ais
data data_r2_desert
data data_r2_forest
data data_r2_jungle
data data_r2_lakes
data data_r2_roots
// data data_r2_forest
// data data_r2_jungle
// data data_r2_lakes
// data data_r2_roots
define ais_mainland
name ais
cmdLine ai_service -C. -L. --nobreak --writepid -mCommon:Indoors:Newbieland:Post
use ais
data data_mainland_common_primitives
data data_newbieland_primitives
@ -188,8 +190,8 @@ define ais_mini_mainland
cmdLine ai_service -C. -L. --nobreak --writepid -mCommon:Indoors:Newbieland:Post
use ais_mainland
define ais_newbyland
name ais_newbyland
define ais_newbieland
name ais_newbieland
cmdLine ai_service -C. -L. --nobreak --writepid -mCommon:Indoors:Newbieland:Post
use ais
data data_mainland_common_primitives
@ -213,36 +215,40 @@ define bms_master
use bms
cmdLine backup_service -C. -L. --nobreak --writepid -P49990
//cfg #include "../live/cfg/backup_module_service_master.cfg"
cfg #include "../live/service_backup_service/backup_service.cfg"
cfgAfter ListeningPort = 49990;
cfgAfter L3ListeningPort = 49950;
cfgAfter WebPort = 49970;
cfgAfter BSReadState = 1;
cfgAfter SaveShardRoot = "../save_shard/";
cfgAfter SaveShardRoot = "../save_shard_bs/";
define bms_master2
use bms
cmdLine backup_service -C. -L. --nobreak --writepid -P49994
//cfg #include "../live/cfg/backup_module_service_master.cfg"
cfg #include "../live/service_backup_service/backup_service.cfg"
cfgAfter ListeningPort = 49994;
cfgAfter L3ListeningPort = 49954;
cfgAfter WebPort = 49974;
cfgAfter BSReadState = 1;
cfgAfter SaveShardRoot = "../save_shard/";
cfgAfter SaveShardRoot = "../save_shard_bs/";
define bms_slave
use bms
cmdLine backup_service -C. -L. --nobreak --writepid -P49991
cfg #include "../live/cfg/backup_module_service_slave.cfg"
//cfg #include "../live/cfg/backup_module_service_slave.cfg"
cfg #include "../live/service_backup_service/backup_service.cfg"
cfgAfter ListeningPort = 49991;
cfgAfter L3ListeningPort = 49951;
cfgAfter WebPort = 49971;
cfgAfter BSReadState = 0;
cfgAfter SaveShardRoot = "../save_shard/";
cfgAfter SaveShardRoot = "../save_shard_bs/";
define bms_pd_master
use bms
cmdLine backup_service -C. -L. --nobreak --writepid -P49992
//cfg #include "../live/cfg/backup_module_service_master.cfg"
cfg #include "../live/service_backup_service/backup_service.cfg"
cfgAfter ListeningPort = 49992;
cfgAfter L3ListeningPort = 49952;
cfgAfter WebPort = 49972;
@ -252,7 +258,8 @@ define bms_pd_master
define bms_pd_slave
use bms
cmdLine backup_service -C. -L. --nobreak --writepid -P49993
cfg #include "../live/cfg/backup_module_service_slave.cfg"
//cfg #include "../live/cfg/backup_module_service_slave.cfg"
cfg #include "../live/service_backup_service/backup_service.cfg"
cfgAfter ListeningPort = 49993;
cfgAfter L3ListeningPort = 49953;
cfgAfter WebPort = 49973;
@ -263,6 +270,7 @@ define backup_lgs
use bms
cmdLine backup_service -C. -L. --nobreak --writepid -P49994
//cfg #include "../live/cfg/backup_module_service_master.cfg"
cfg #include "../live/service_backup_service/backup_service.cfg"
cfgAfter ListeningPort = 49994;
cfgAfter L3ListeningPort = 49995;
cfgAfter WebPort = 49972;
@ -320,7 +328,7 @@ define dss
define dss_ring
use dss
cfg #include "../live/cfg/dynamic_scenario_service_ring.cfg"
// cfg #include "../live/cfg/dynamic_scenario_service_ring.cfg"
// egs -----------------------------
@ -374,17 +382,17 @@ define egs_mainland
define egs_ring
use egs
data data_mainland_common_primitives
data data_newbieland_primitives
data data_newbieland
data data_indoors
cfg #include "../live/cfg/entities_game_service_ring.cfg"
// data data_newbieland_primitives
// data data_newbieland
// data data_indoors
//cfg #include "../live/cfg/entities_game_service_ring.cfg" // care
cfg UsedContinents =
cfg {
cfg "r2_desert", "10000",
cfg "r2_forest", "10001",
cfg "r2_jungle", "10002",
cfg "r2_lakes", "10003",
cfg "r2_roots", "10004",
// cfg "r2_forest", "10001",
// cfg "r2_jungle", "10002",
// cfg "r2_lakes", "10003",
// cfg "r2_roots", "10004",
cfg };
cfgAfter MaxXPGainPerPlayer = 30.0;
cfgAfter DeathXPFactor = 0.0;
@ -460,16 +468,16 @@ define gpms_mainland
use gpms
data data_newbieland
data data_indoors
cfg #include "../live/cfg/gpm_service_mainland.cfg"
//cfg #include "../live/cfg/gpm_service_mainland.cfg"
define gpms_ring
use gpms
data data_r2_desert
data data_r2_forest
data data_r2_jungle
data data_r2_lakes
data data_r2_roots
cfg #include "../live/cfg/gpm_service_ring.cfg"
// data data_r2_forest
// data data_r2_jungle
// data data_r2_lakes
// data data_r2_roots
//cfg #include "../live/cfg/gpm_service_ring.cfg"
// pdss ----------------------------
@ -534,7 +542,7 @@ define ios_mainland
define ios_ring
use ios
cfg #include "../live/cfg/input_output_service_ring.cfg"
//cfg #include "../live/cfg/input_output_service_ring.cfg"
// las -----------------------------

View file

@ -30,15 +30,15 @@ define domain_mini01
// domain hosts
cfg AESHost = "localhost";
cfg SUHost = "ep1.mini01.ryzomcore.org";
cfg MFSHost = "ep1.mini01.ryzomcore.org";
cfg BSHost = "ep1.mini01.ryzomcore.org:49990";
cfg SlaveBSHost= "ep1.mini01.ryzomcore.org:49991";
cfg MasterLGSHost = "ep1.mini01.ryzomcore.org";
cfg SlaveLGSHost = "ep1.mini01.ryzomcore.org";
cfg LGSBSHost = "ep1.mini01.ryzomcore.org";
cfg DBHost = "localhost"; // FIXME "sql.core.ryzomcore.org";
cfgAfter WebSrvHost = "http://ep1.mini01.ryzomcore.org:50000/";
cfg SUHost = "ep1.mini01.ryzomcore.local";
cfg MFSHost = "ep1.mini01.ryzomcore.local";
cfg BSHost = "ep1.mini01.ryzomcore.local:49990";
cfg SlaveBSHost= "ep1.mini01.ryzomcore.local:49991";
cfg MasterLGSHost = "ep1.mini01.ryzomcore.local";
cfg SlaveLGSHost = "ep1.mini01.ryzomcore.local";
cfg LGSBSHost = "ep1.mini01.ryzomcore.local";
cfg DBHost = "ep1.mini01.ryzomcore.local";
cfgAfter WebSrvHost = "http://ep1.mini01.ryzomcore.local:50000/";
// initial config files
cfgFile ../cfg/00_base.cfg
@ -84,7 +84,7 @@ define shard_mini01_unifier
use exe_set_std_lgs_slave
use backup_lgs
cfg DBPass = DBNelPass;
host ep1.mini01.ryzomcore.org
host ep1.mini01.ryzomcore.local
// shard mainland01 ----------------
@ -95,10 +95,10 @@ define shard_mini01_mainland01
cfg ShardId = 301;
cfg BasePort = 52000;
cfg SaveFilesDirectory="mini01_mainland01/";
cfg NSHost = "ep1.mini01.ryzomcore.org";
cfg FSListenHost = "ep1.mini01.ryzomcore.org";
cfg NSHost = "ep1.mini01.ryzomcore.local";
cfg FSListenHost = "ep1.mini01.ryzomcore.local";
cfgFile ../cfg/02_shard_type_mini_mainland.cfg
host ep1.mini01.ryzomcore.org
host ep1.mini01.ryzomcore.local
// shard ring01 --------------------
@ -110,7 +110,7 @@ define shard_mini01_ring01
cfg BasePort = 52400;
cfg SaveFilesDirectory="mini01_ring01/";
cfg NSPort = 51100;
cfg NSHost = "ep1.mini01.ryzomcore.org" + 51100;
cfg NSHost = "ep1.mini01.ryzomcore.local" + 51100;
cfgFile ../cfg/02_shard_type_std_ring.cfg
host ep1.mini01.ryzomcore.org
host ep1.mini01.ryzomcore.local

View file

@ -32,15 +32,15 @@ define domain_std01
// domain hosts
cfg AESHost = "localhost";
cfg SUHost = "su1.std01.ryzomcore.org";
cfg MFSHost = "su1.std01.ryzomcore.org";
cfg BSHost = "pd1.std01.ryzomcore.org:49990"; // Backup service host for domain
cfg SlaveBSHost= "pd2.std01.ryzomcore.org:49991";
cfg MasterLGSHost = "pd3.std01.ryzomcore.org";
cfg SlaveLGSHost = "pd4.std01.ryzomcore.org";
cfg LGSBSHost = "csr.core.ryzomcore.org"; // Backup service host for log service
cfg DBHost = "sql.core.ryzomcore.org";
cfgAfter WebSrvHost = "http://su1.std01.ryzomcore.org:50000/";
cfg SUHost = "su1.std01.ryzomcore.local";
cfg MFSHost = "su1.std01.ryzomcore.local";
cfg BSHost = "pd1.std01.ryzomcore.local:49990"; // Backup service host for domain
cfg SlaveBSHost= "pd2.std01.ryzomcore.local:49991";
cfg MasterLGSHost = "pd3.std01.ryzomcore.local";
cfg SlaveLGSHost = "pd4.std01.ryzomcore.local";
cfg LGSBSHost = "csr.core.ryzomcore.local"; // Backup service host for log service
cfg DBHost = "sql.core.ryzomcore.local";
cfgAfter WebSrvHost = "http://su1.std01.ryzomcore.local:50000/";
// initial config files
cfgFile ../cfg/00_base.cfg
@ -86,11 +86,11 @@ define shard_std01_unifier
define shard_exe_set_std01_ras
use ras
host ep1.std01.ryzomcore.org
host ep1.std01.ryzomcore.local
define shard_exe_set_std01_unifier
use exe_set_std_unifier
host su1.std01.ryzomcore.org
host su1.std01.ryzomcore.local
cfg DBPass = DBNelPass;
@ -106,30 +106,30 @@ define shard_std01_mainland01
cfg ShardId = 101;
cfg BasePort = 51000;
cfg SaveFilesDirectory="std01_mainland01/";
cfg NSHost = "mla1.std01.ryzomcore.org";
cfg NSHost = "mla1.std01.ryzomcore.local";
cfgFile ../cfg/02_shard_type_std_mainland.cfg
define shard_exe_set_std01_mainland01_be01
use exe_set_std_mainland_be01
host mla1.std01.ryzomcore.org
host mla1.std01.ryzomcore.local
define shard_exe_set_std01_mainland01_be02
use exe_set_std_mainland_be02
host mla2.std01.ryzomcore.org
host mla2.std01.ryzomcore.local
define shard_exe_set_std01_mainland01_be03
use exe_set_std_mainland_be03
host mla3.std01.ryzomcore.org
host mla3.std01.ryzomcore.local
define shard_exe_set_std01_mainland01_fe01
use exe_set_std_mainland_fe
host mla4.std01.ryzomcore.org
cfg FSListenHost = "mla4.std01.ryzomcore.org";
host mla4.std01.ryzomcore.local
cfg FSListenHost = "mla4.std01.ryzomcore.local";
define shard_exe_set_std01_mainland01_fe02
use exe_set_std_mainland_fe
host mla5.std01.ryzomcore.org
cfg FSListenHost = "mla5.std01.ryzomcore.org";
host mla5.std01.ryzomcore.local
cfg FSListenHost = "mla5.std01.ryzomcore.local";
// shard mainland02 ----------------
@ -144,30 +144,30 @@ define shard_std01_mainland02
cfg ShardId = 102;
cfg BasePort = 51100;
cfg SaveFilesDirectory="std01_mainland02/";
cfg NSHost = "mlb1.std01.ryzomcore.org";
cfg NSHost = "mlb1.std01.ryzomcore.local";
cfgFile ../cfg/02_shard_type_std_mainland.cfg
define shard_exe_set_std01_mainland02_be01
use exe_set_std_mainland_be01
host mlb1.std01.ryzomcore.org
host mlb1.std01.ryzomcore.local
define shard_exe_set_std01_mainland02_be02
use exe_set_std_mainland_be02
host mlb2.std01.ryzomcore.org
host mlb2.std01.ryzomcore.local
define shard_exe_set_std01_mainland02_be03
use exe_set_std_mainland_be03
host mlb3.std01.ryzomcore.org
host mlb3.std01.ryzomcore.local
define shard_exe_set_std01_mainland02_fe01
use exe_set_std_mainland_fe
host mlb4.std01.ryzomcore.org
cfg FSListenHost = "mlb4.std01.ryzomcore.org";
host mlb4.std01.ryzomcore.local
cfg FSListenHost = "mlb4.std01.ryzomcore.local";
define shard_exe_set_std01_mainland02_fe02
use exe_set_std_mainland_fe
host mlb5.std01.ryzomcore.org
cfg FSListenHost = "mlb5.std01.ryzomcore.org";
host mlb5.std01.ryzomcore.local
cfg FSListenHost = "mlb5.std01.ryzomcore.local";
// shard ring01 --------------------
@ -179,17 +179,17 @@ define shard_std01_ring01
cfg ShardId = 201;
cfg BasePort = 51400;
cfg SaveFilesDirectory="std01_ring01/";
cfg NSHost = "rra1.std01.ryzomcore.org";
cfg NSHost = "rra1.std01.ryzomcore.local";
cfgFile ../cfg/02_shard_type_std_ring.cfg
define shard_exe_set_std01_ring01_be
use exe_set_std_ring_be
host rra1.std01.ryzomcore.org
host rra1.std01.ryzomcore.local
define shard_exe_set_std01_ring01_fe
use exe_set_std_ring_fe
host rra2.std01.ryzomcore.org
cfg FSListenHost = "rra2.std01.ryzomcore.org";
host rra2.std01.ryzomcore.local
cfg FSListenHost = "rra2.std01.ryzomcore.local";
// shard ring02 --------------------
@ -201,17 +201,17 @@ define shard_std01_ring02
cfg ShardId = 202;
cfg BasePort = 51500;
cfg SaveFilesDirectory="std01_ring02/";
cfg NSHost = "rrb1.std01.ryzomcore.org";
cfg NSHost = "rrb1.std01.ryzomcore.local";
cfgFile ../cfg/02_shard_type_std_ring.cfg
define shard_exe_set_std01_ring02_be
use exe_set_std_ring_be
host rrb1.std01.ryzomcore.org
host rrb1.std01.ryzomcore.local
define shard_exe_set_std01_ring02_fe
use exe_set_std_ring_fe
host rrb2.std01.ryzomcore.org
cfg FSListenHost = "rrb2.std01.ryzomcore.org";
host rrb2.std01.ryzomcore.local
cfg FSListenHost = "rrb2.std01.ryzomcore.local";
// the std01 backup domain ----------
@ -260,7 +260,7 @@ define shard_std01_backup_ras
shard std01_backup_ras
cfg ShardId = 100;
use ras
host ep1.std01.ryzomcore.org
host ep1.std01.ryzomcore.local
// the main backup pair ------------
@ -273,15 +273,15 @@ define shard_std01_backup
define shard_exe_set_std01_backup_master
name bs_master
use exe_set_std_backup_master
host pd1.std01.ryzomcore.org
host pd1.std01.ryzomcore.local
define shard_exe_set_std01_backup_slave
name bs_slave
// hack to workaround bug in backup service
// use exe_set_std_backup_slave
use exe_set_std01_backup_slave
host pd2.std01.ryzomcore.org
cfgAfter MasterBSHost = "pd1.std01.ryzomcore.org:49990";
host pd2.std01.ryzomcore.local
cfgAfter MasterBSHost = "pd1.std01.ryzomcore.local:49990";
// hack to workaround bug in backup service
define exe_set_std01_backup_slave
@ -312,27 +312,27 @@ define shard_std01_lgs
cfg L3SlaveLGSPort = 49993;
cfg LGSBSPort = 49994;
cfg L3LGSBSPort = 49995;
cfg MasterLGSHost = "pd3.std01.ryzomcore.org";
cfg SlaveLGSHost = "pd4.std01.ryzomcore.org";
cfg LGSBSHost = "csr.core.ryzomcore.org";
cfg MasterLGSHost = "pd3.std01.ryzomcore.local";
cfg SlaveLGSHost = "pd4.std01.ryzomcore.local";
cfg LGSBSHost = "csr.core.ryzomcore.local";
define shard_exe_set_std01_lgs_primary
name lgs_primary
use raes
use exe_set_std_lgs_master
host pd3.std01.ryzomcore.org
host pd3.std01.ryzomcore.local
define shard_exe_set_std01_lgs_secondary
name lgs_secondary
use raes
use exe_set_std_lgs_slave
host pd4.std01.ryzomcore.org
host pd4.std01.ryzomcore.local
define shard_exe_set_std01_lgs_bs
name lgs_bs
use raes
use backup_lgs
host csr.core.ryzomcore.org
host csr.core.ryzomcore.local
// the std01 las domain -------------
@ -365,7 +365,7 @@ define shard_std01_las_ras
shard std01_las_ras
cfg ShardId = 100;
use ras
host ep1.std01.ryzomcore.org
host ep1.std01.ryzomcore.local
// master las ----------------------
@ -378,7 +378,7 @@ define shard_std01_las_master
use las_mainland02
use las_ring01
use las_ring02
host pd3.std01.ryzomcore.org
host pd3.std01.ryzomcore.local
define las_mainland01
cfgAfter StartCommands += {"PDRootDirectory /srv/core/backup01/save_shard_pd/std01_mainland01/pds"};
@ -415,7 +415,7 @@ define shard_std01_las_slave
use las_mainland02_slave
use las_ring01_slave
use las_ring02_slave
host pd4.std01.ryzomcore.org
host pd4.std01.ryzomcore.local
define las_mainland01_slave
cfgAfter StartCommands += {"PDRootDirectory /srv/core/backup01/save_shard_pd/std01_mainland01/pds"};

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