diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 926f66e35..8cf86ecc2 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -48,9 +48,6 @@ SET(NL_VERSION_MINOR 8) SET(NL_VERSION_PATCH 0) SET(NL_VERSION "${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}.${NL_VERSION_PATCH}") -NL_SETUP_BUILD() -NL_SETUP_BUILD_FLAGS() - #----------------------------------------------------------------------------- # Redirect output files SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) @@ -87,6 +84,9 @@ RYZOM_SETUP_PREFIX_PATHS() NL_CONFIGURE_CHECKS() +NL_SETUP_BUILD() +NL_SETUP_BUILD_FLAGS() + #----------------------------------------------------------------------------- #Platform specifics @@ -111,10 +111,11 @@ IF(WITH_STATIC) SET(LIBXML2_DEFINITIONS ${LIBXML2_DEFINITIONS} -DLIBXML_STATIC) SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${WINSOCK2_LIB}) - # on Mac OS X libxml2 requieres iconv + # on Mac OS X libxml2 requires iconv and liblzma IF(APPLE) FIND_PACKAGE(Iconv REQUIRED) - SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${ICONV_LIBRARIES}) + FIND_PACKAGE(LibLZMA REQUIRED) + SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${ICONV_LIBRARIES} ${LIBLZMA_LIBRARIES}) INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR}) ENDIF(APPLE) ENDIF(WITH_STATIC) @@ -230,7 +231,7 @@ IF(WIN32) "${QT_LIBRARY_DIR}/../bin/QtGuid4.dll" "${QT_LIBRARY_DIR}/../bin/QtXmld4.dll" "${QT_LIBRARY_DIR}/../bin/QtCored4.dll" - DESTINATION bin) + DESTINATION ${NL_BIN_PREFIX}) ENDIF(WITH_QT) ELSE(NOT CMAKE_BUILD_TYPE STREQUAL "Release") IF(WITH_QT) @@ -239,18 +240,18 @@ IF(WIN32) "${QT_LIBRARY_DIR}/../bin/QtGui4.dll" "${QT_LIBRARY_DIR}/../bin/QtXml4.dll" "${QT_LIBRARY_DIR}/../bin/QtCore4.dll" - DESTINATION bin) + DESTINATION ${NL_BIN_PREFIX}) ENDIF(WITH_QT) ENDIF(NOT CMAKE_BUILD_TYPE STREQUAL "Release") # Install CEGUI and its dependencies. IF(WITH_NEL_CEGUI) - INSTALL(FILES "${CEGUI_LIB_DIR}/CEGUIBase.dll" DESTINATION bin) - INSTALL(FILES "${CEGUI_LIB_DIR}/CEGUIDevilImageCodec.dll" DESTINATION bin) - INSTALL(FILES "${CEGUI_LIB_DIR}/CEGUIExpatParser.dll" DESTINATION bin) - INSTALL(FILES "${CEGUI_LIB_DIR}/CEGUIFalagardWRBase.dll" DESTINATION bin) - INSTALL(FILES "${CEGUI_LIB_DIR}/Devil.dll" DESTINATION bin) - INSTALL(FILES "${CEGUI_LIB_DIR}/ILU.dll" DESTINATION bin) + INSTALL(FILES "${CEGUI_LIB_DIR}/CEGUIBase.dll" DESTINATION ${NL_BIN_PREFIX}) + INSTALL(FILES "${CEGUI_LIB_DIR}/CEGUIDevilImageCodec.dll" DESTINATION ${NL_BIN_PREFIX}) + INSTALL(FILES "${CEGUI_LIB_DIR}/CEGUIExpatParser.dll" DESTINATION ${NL_BIN_PREFIX}) + INSTALL(FILES "${CEGUI_LIB_DIR}/CEGUIFalagardWRBase.dll" DESTINATION ${NL_BIN_PREFIX}) + INSTALL(FILES "${CEGUI_LIB_DIR}/Devil.dll" DESTINATION ${NL_BIN_PREFIX}) + INSTALL(FILES "${CEGUI_LIB_DIR}/ILU.dll" DESTINATION ${NL_BIN_PREFIX}) ENDIF(WITH_NEL_CEGUI) # Only the tools require MFC. diff --git a/code/CMakeModules/FindMercurial.cmake b/code/CMakeModules/FindMercurial.cmake index 9c252ad17..a18e50c43 100644 --- a/code/CMakeModules/FindMercurial.cmake +++ b/code/CMakeModules/FindMercurial.cmake @@ -60,7 +60,7 @@ IF(Mercurial_HG_EXECUTABLE) "\\1" Mercurial_VERSION_HG "${Mercurial_VERSION_HG}") MACRO(Mercurial_WC_INFO dir prefix) - EXECUTE_PROCESS(COMMAND ${Mercurial_HG_EXECUTABLE} tip + EXECUTE_PROCESS(COMMAND ${Mercurial_HG_EXECUTABLE} tip --template "{rev};{node};{tags};{author}" WORKING_DIRECTORY ${dir} OUTPUT_VARIABLE ${prefix}_WC_INFO ERROR_VARIABLE Mercurial_hg_info_error @@ -70,18 +70,18 @@ IF(Mercurial_HG_EXECUTABLE) IF(NOT ${Mercurial_hg_info_result} EQUAL 0) MESSAGE(SEND_ERROR "Command \"${Mercurial_HG_EXECUTABLE} tip\" failed with output:\n${Mercurial_hg_info_error}") ELSE(NOT ${Mercurial_hg_info_result} EQUAL 0) - - STRING(REGEX REPLACE "^(.*\n)?Repository Root: ([^\n]+).*" - "\\2" ${prefix}_WC_ROOT "${${prefix}_WC_INFO}") - STRING(REGEX REPLACE "^(.*\n)?changeset: *([0-9]+).*" - "\\2" ${prefix}_WC_REVISION "${${prefix}_WC_INFO}") - STRING(REGEX REPLACE "^(.*\n)?Last Changed Author: ([^\n]+).*" - "\\2" ${prefix}_WC_LAST_CHANGED_AUTHOR "${${prefix}_WC_INFO}") - STRING(REGEX REPLACE "^(.*\n)?Last Changed Rev: ([^\n]+).*" - "\\2" ${prefix}_WC_LAST_CHANGED_REV "${${prefix}_WC_INFO}") - STRING(REGEX REPLACE "^(.*\n)?Last Changed Date: ([^\n]+).*" - "\\2" ${prefix}_WC_LAST_CHANGED_DATE "${${prefix}_WC_INFO}") - + LIST(LENGTH ${prefix}_WC_INFO _COUNT) + IF(_COUNT EQUAL 4) + LIST(GET ${prefix}_WC_INFO 0 ${prefix}_WC_REVISION) + LIST(GET ${prefix}_WC_INFO 1 ${prefix}_WC_CHANGESET) + LIST(GET ${prefix}_WC_INFO 2 ${prefix}_WC_BRANCH) + LIST(GET ${prefix}_WC_INFO 3 ${prefix}_WC_LAST_CHANGED_AUTHOR) + ELSE(_COUNT EQUAL 4) + MESSAGE(STATUS "Bad output from HG") + SET(${prefix}_WC_REVISION "unknown") + SET(${prefix}_WC_CHANGESET "unknown") + SET(${prefix}_WC_BRANCH "unknown") + ENDIF(_COUNT EQUAL 4) ENDIF(NOT ${Mercurial_hg_info_result} EQUAL 0) ENDMACRO(Mercurial_WC_INFO) diff --git a/code/CMakeModules/FindSquish.cmake b/code/CMakeModules/FindSquish.cmake index 04f657485..ad0f7ce80 100644 --- a/code/CMakeModules/FindSquish.cmake +++ b/code/CMakeModules/FindSquish.cmake @@ -12,7 +12,7 @@ IF(SQUISH_LIBRARIES AND SQUISH_INCLUDE_DIR) SET(SQUISH_FIND_QUIETLY TRUE) ENDIF(SQUISH_LIBRARIES AND SQUISH_INCLUDE_DIR) -FIND_PATH(SQUISH_INCLUDE_DIR +FIND_PATH(SQUISH_INCLUDE_DIR squish.h PATHS /usr/local/include @@ -67,6 +67,11 @@ IF(SQUISH_FOUND) IF(NOT SQUISH_FIND_QUIETLY) MESSAGE(STATUS "Found Squish: ${SQUISH_LIBRARIES}") ENDIF(NOT SQUISH_FIND_QUIETLY) + FILE(STRINGS ${SQUISH_INCLUDE_DIR}/squish.h METRIC REGEX "metric = 0") + IF(METRIC) + SET(SQUISH_COMPRESS_HAS_METRIC ON) + SET(SQUISH_DEFINITIONS -DSQUISH_COMPRESS_HAS_METRIC) + ENDIF(METRIC) ELSE(SQUISH_FOUND) IF(NOT SQUISH_FIND_QUIETLY) MESSAGE(STATUS "Warning: Unable to find Squish!") diff --git a/code/CMakeModules/FindWindowsSDK.cmake b/code/CMakeModules/FindWindowsSDK.cmake index 25903be14..9d9b91777 100644 --- a/code/CMakeModules/FindWindowsSDK.cmake +++ b/code/CMakeModules/FindWindowsSDK.cmake @@ -2,47 +2,86 @@ # Find the Windows includes # # WINSDK_INCLUDE_DIR - where to find Windows.h +# WINSDK_INCLUDE_DIRS - where to find all Windows headers +# WINSDK_LIBRARY_DIR - where to find libraries # WINSDK_FOUND - True if Windows SDK found. IF(WINSDK_INCLUDE_DIR) # Already in cache, be silent - SET(WINSDK_FIND_QUIETLY TRUE) + SET(WindowsSDK_FIND_QUIETLY TRUE) ENDIF(WINSDK_INCLUDE_DIR) +# TODO: add the possibility to use a specific Windows SDK + +IF(MSVC11) + GET_FILENAME_COMPONENT(WINSDK8_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]" ABSOLUTE CACHE) + GET_FILENAME_COMPONENT(WINSDK8_VERSION "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;ProductVersion]" NAME) + + IF(WINSDK8_DIR) + IF(NOT WindowsSDK_FIND_QUIETLY) + MESSAGE(STATUS "Found Windows SDK ${WINSDK8_VERSION} in ${WINSDK8_DIR}") + ENDIF(NOT WindowsSDK_FIND_QUIETLY) + IF(TARGET_ARM) + SET(WINSDK8_SUFFIX "arm") + ELSEIF(TARGET_X64) + SET(WINSDK8_SUFFIX "x64") + ELSEIF(TARGET_X86) + SET(WINSDK8_SUFFIX "x86") + ENDIF(TARGET_ARM) + ENDIF(WINSDK8_DIR) +ENDIF(MSVC11) + GET_FILENAME_COMPONENT(WINSDK71_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1;InstallationFolder]" ABSOLUTE CACHE) GET_FILENAME_COMPONENT(WINSDK71_VERSION "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1;ProductVersion]" NAME) IF(WINSDK71_DIR) - IF(NOT WINSDK_FIND_QUIETLY) + IF(NOT WindowsSDK_FIND_QUIETLY) MESSAGE(STATUS "Found Windows SDK ${WINSDK71_VERSION} in ${WINSDK71_DIR}") - ENDIF(NOT WINSDK_FIND_QUIETLY) + ENDIF(NOT WindowsSDK_FIND_QUIETLY) ENDIF(WINSDK71_DIR) GET_FILENAME_COMPONENT(WINSDKCURRENT_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" ABSOLUTE CACHE) GET_FILENAME_COMPONENT(WINSDKCURRENT_VERSION "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentVersion]" NAME) IF(WINSDKCURRENT_DIR) - IF(NOT WINSDK_FIND_QUIETLY) + IF(NOT WindowsSDK_FIND_QUIETLY) MESSAGE(STATUS "Found Windows SDK ${WINSDKCURRENT_VERSION} in ${WINSDKCURRENT_DIR}") - ENDIF(NOT WINSDK_FIND_QUIETLY) + ENDIF(NOT WindowsSDK_FIND_QUIETLY) ENDIF(WINSDKCURRENT_DIR) FIND_PATH(WINSDK_INCLUDE_DIR Windows.h - PATHS + HINTS + ${WINSDK8_DIR}/Include/um ${WINSDK71_DIR}/Include ${WINSDKCURRENT_DIR}/Include ) +FIND_PATH(WINSDK_SHARED_INCLUDE_DIR d3d9.h + HINTS + ${WINSDK8_DIR}/Include/shared + ${WINSDK71_DIR}/Include + ${WINSDKCURRENT_DIR}/Include +) + +FIND_PATH(WINSDK_LIBRARY_DIR ComCtl32.lib + HINTS + ${WINSDK8_DIR}/Lib/win8/um/${WINSDK8_SUFFIX} + ${WINSDK71_DIR}/Lib + ${WINSDKCURRENT_DIR}/Lib +) + FIND_PROGRAM(WINSDK_SIGNTOOL signtool - PATHS + HINTS + ${WINSDK8_DIR}/Bin/x86 ${WINSDK71_DIR}/Bin ${WINSDKCURRENT_DIR}/Bin ) IF(WINSDK_INCLUDE_DIR) SET(WINSDK_FOUND TRUE) + SET(WINSDK_INCLUDE_DIRS ${WINSDK_INCLUDE_DIR} ${WINSDK_SHARED_INCLUDE_DIR}) ELSE(WINSDK_INCLUDE_DIR) - IF(NOT WINSDK_FIND_QUIETLY) + IF(NOT WindowsSDK_FIND_QUIETLY) MESSAGE(STATUS "Warning: Unable to find Windows SDK!") - ENDIF(NOT WINSDK_FIND_QUIETLY) + ENDIF(NOT WindowsSDK_FIND_QUIETLY) ENDIF(WINSDK_INCLUDE_DIR) diff --git a/code/CMakeModules/GetRevision.cmake b/code/CMakeModules/GetRevision.cmake index 52f443d5f..18e997af2 100644 --- a/code/CMakeModules/GetRevision.cmake +++ b/code/CMakeModules/GetRevision.cmake @@ -3,20 +3,24 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3) # ROOT_DIR should be set to root of the repository (where to find the .svn or .hg directory) # SOURCE_DIR should be set to root of your code (where to find CMakeLists.txt) -# Replace spaces by semi-columns -IF(CMAKE_MODULE_PATH) - STRING(REPLACE " " ";" CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}) -ENDIF(CMAKE_MODULE_PATH) +IF(SOURCE_DIR) + # Replace spaces by semi-columns + IF(CMAKE_MODULE_PATH) + STRING(REPLACE " " ";" CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}) + ENDIF(CMAKE_MODULE_PATH) -SET(CMAKE_MODULE_PATH ${SOURCE_DIR}/CMakeModules ${CMAKE_MODULE_PATH}) + SET(CMAKE_MODULE_PATH ${SOURCE_DIR}/CMakeModules ${CMAKE_MODULE_PATH}) -IF(NOT ROOT_DIR AND SOURCE_DIR) - SET(ROOT_DIR ${SOURCE_DIR}) -ENDIF(NOT ROOT_DIR AND SOURCE_DIR) + IF(NOT ROOT_DIR AND SOURCE_DIR) + SET(ROOT_DIR ${SOURCE_DIR}) + ENDIF(NOT ROOT_DIR AND SOURCE_DIR) -IF(NOT SOURCE_DIR AND ROOT_DIR) - SET(SOURCE_DIR ${ROOT_DIR}) -ENDIF(NOT SOURCE_DIR AND ROOT_DIR) + IF(NOT SOURCE_DIR AND ROOT_DIR) + SET(SOURCE_DIR ${ROOT_DIR}) + ENDIF(NOT SOURCE_DIR AND ROOT_DIR) +ELSE(SOURCE_DIR) + SET(ROOT_DIR ${CMAKE_SOURCE_DIR}) +ENDIF(SOURCE_DIR) MACRO(NOW RESULT) IF (WIN32) @@ -53,10 +57,11 @@ IF(EXISTS "${ROOT_DIR}/.hg/") ENDIF(MERCURIAL_FOUND) ENDIF(EXISTS "${ROOT_DIR}/.hg/") -IF(DEFINED REVISION) +IF(SOURCE_DIR AND DEFINED REVISION) IF(EXISTS ${SOURCE_DIR}/revision.h.in) + MESSAGE(STATUS "Revision: ${REVISION}") NOW(BUILD_DATE) CONFIGURE_FILE(${SOURCE_DIR}/revision.h.in revision.h.txt) EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy revision.h.txt revision.h) # copy_if_different ENDIF(EXISTS ${SOURCE_DIR}/revision.h.in) -ENDIF(DEFINED REVISION) +ENDIF(SOURCE_DIR AND DEFINED REVISION) diff --git a/code/CMakeModules/PCHSupport.cmake b/code/CMakeModules/PCHSupport.cmake index 7cd4c6c7d..d444bfa3d 100644 --- a/code/CMakeModules/PCHSupport.cmake +++ b/code/CMakeModules/PCHSupport.cmake @@ -9,231 +9,384 @@ # ADD_NATIVE_PRECOMPILED_HEADER _targetName _inputh _inputcpp IF(MSVC) - SET(PCHSupport_FOUND TRUE) - SET(_PCH_include_prefix "/I") + SET(PCHSupport_FOUND TRUE) + SET(_PCH_include_prefix "/I") ELSE(MSVC) - IF(CMAKE_COMPILER_IS_GNUCXX) - EXEC_PROGRAM(${CMAKE_CXX_COMPILER} - ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion - OUTPUT_VARIABLE gcc_compiler_version) - - IF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]") - SET(PCHSupport_FOUND TRUE) - ELSE(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]") - IF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]") - SET(PCHSupport_FOUND TRUE) - ENDIF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]") - ENDIF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]") - ELSE(CMAKE_COMPILER_IS_GNUCXX) - # TODO: make tests for other compilers than GCC - SET(PCHSupport_FOUND TRUE) - ENDIF(CMAKE_COMPILER_IS_GNUCXX) - - SET(_PCH_include_prefix "-I") + IF(CMAKE_COMPILER_IS_GNUCXX) + EXEC_PROGRAM(${CMAKE_CXX_COMPILER} + ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion + OUTPUT_VARIABLE gcc_compiler_version) + + IF(gcc_compiler_version MATCHES "^4\\.1(\\.[0-9]+)?") + SET(PCHSupport_FOUND FALSE) + ELSEIF(gcc_compiler_version MATCHES "^4\\.[0-9]+(\\.[0-9]+)?") + SET(PCHSupport_FOUND TRUE) + ENDIF(gcc_compiler_version MATCHES "^4\\.1(\\.[0-9]+)?") + ELSE(CMAKE_COMPILER_IS_GNUCXX) + # TODO: make tests for other compilers than GCC + SET(PCHSupport_FOUND TRUE) + ENDIF(CMAKE_COMPILER_IS_GNUCXX) + + SET(_PCH_include_prefix "-I") ENDIF(MSVC) -MACRO(_PCH_GET_COMPILE_FLAGS _out_compile_flags) - STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name) - SET(${_out_compile_flags} ${${_flags_var_name}} ) - - IF(NOT MSVC) - GET_TARGET_PROPERTY(_targetType ${_PCH_current_target} TYPE) - IF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY) - LIST(APPEND ${_out_compile_flags} "-fPIC") - ENDIF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY) - ENDIF(NOT MSVC) - - GET_DIRECTORY_PROPERTY(DIRINC INCLUDE_DIRECTORIES ) - FOREACH(item ${DIRINC}) - LIST(APPEND ${_out_compile_flags} " ${_PCH_include_prefix}\"${item}\"") - ENDFOREACH(item) - - # Required for CMake 2.6 - SET(GLOBAL_DEFINITIONS "") - GET_DIRECTORY_PROPERTY(DEFINITIONS COMPILE_DEFINITIONS) - FOREACH(item ${DEFINITIONS}) - LIST(APPEND GLOBAL_DEFINITIONS -D${item}) - ENDFOREACH(item) - - GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS) - GET_DIRECTORY_PROPERTY(_directory_definitions DIRECTORY ${CMAKE_SOURCE_DIR} DEFINITIONS) - LIST(APPEND ${_out_compile_flags} ${GLOBAL_DEFINITIONS}) - LIST(APPEND ${_out_compile_flags} ${_directory_flags}) - LIST(APPEND ${_out_compile_flags} ${_directory_definitions}) - LIST(APPEND ${_out_compile_flags} ${CMAKE_CXX_FLAGS}) - - # Format definitions - SEPARATE_ARGUMENTS(${_out_compile_flags}) -ENDMACRO(_PCH_GET_COMPILE_FLAGS) - -MACRO(_PCH_GET_PDB_FILENAME out_filename _target) - # determine output directory based on target type - GET_TARGET_PROPERTY(_targetType ${_target} TYPE) - IF(${_targetType} STREQUAL EXECUTABLE) - SET(_targetOutput ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) - ELSEIF(${_targetType} STREQUAL STATIC_LIBRARY) - SET(_targetOutput ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}) - ELSE(${_targetType} STREQUAL EXECUTABLE) - SET(_targetOutput ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) - ENDIF(${_targetType} STREQUAL EXECUTABLE) - - # determine target postfix - STRING(TOUPPER "${CMAKE_BUILD_TYPE}_POSTFIX" _postfix_var_name) - GET_TARGET_PROPERTY(_targetPostfix ${_target} ${_postfix_var_name}) - IF(${_targetPostfix} MATCHES NOTFOUND) - SET(_targetPostfix "") - ENDIF(${_targetPostfix} MATCHES NOTFOUND) - - SET(${out_filename} "${_targetOutput}/${_target}${_targetPostfix}.pdb") -ENDMACRO(_PCH_GET_PDB_FILENAME) - -MACRO(_PCH_GET_COMPILE_COMMAND out_command _input _inputcpp _output) - IF(CMAKE_CXX_COMPILER_ARG1) - # remove leading space in compiler argument - STRING(REGEX REPLACE "^ +" "" pchsupport_compiler_cxx_arg1 ${CMAKE_CXX_COMPILER_ARG1}) - ELSE(CMAKE_CXX_COMPILER_ARG1) - SET(pchsupport_compiler_cxx_arg1 "") - ENDIF(CMAKE_CXX_COMPILER_ARG1) - - IF(MSVC) - _PCH_GET_PDB_FILENAME(PDB_FILE ${_PCH_current_target}) - SET(${out_command} ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} /Yc /Fp\"${_output}\" ${_inputcpp} /c /Fd\"${PDB_FILE}\") - ELSE(MSVC) - SET(HEADER_FORMAT "c++-header") - IF(APPLE) - SET(HEADER_FORMAT "objective-${HEADER_FORMAT}") - ENDIF(APPLE) - SET(${out_command} ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} -x ${HEADER_FORMAT} -o ${_output} -c ${_input}) - ENDIF(MSVC) -ENDMACRO(_PCH_GET_COMPILE_COMMAND) - -MACRO(GET_PRECOMPILED_HEADER_OUTPUT _targetName _input _output) - IF(MSVC) - GET_FILENAME_COMPONENT(_name ${_input} NAME_WE) - SET(_output "${CMAKE_CURRENT_BINARY_DIR}/${_name}.pch") - ELSE(MSVC) - GET_FILENAME_COMPONENT(_name ${_input} NAME) - SET(_output "${CMAKE_CURRENT_BINARY_DIR}/${_name}.gch") - ENDIF(MSVC) -ENDMACRO(GET_PRECOMPILED_HEADER_OUTPUT _targetName _input) - -MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName _input _pch_output_to_use ) - GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS) - IF(${oldProps} MATCHES NOTFOUND) - SET(oldProps "") - ENDIF(${oldProps} MATCHES NOTFOUND) - - IF(MSVC) - SET(_target_cflags "${oldProps} /Yu\"${_input}\" /FI\"${_input}\" /Fp\"${_pch_output_to_use}\"") - ELSE(MSVC) - # to do: test whether compiler flags match between target _targetName - # and _pch_output_to_use - FILE(TO_NATIVE_PATH ${_pch_output_to_use} _native_pch_path) - - # for use with distcc and gcc >4.0.1 if preprocessed files are accessible - # on all remote machines set - # PCH_ADDITIONAL_COMPILER_FLAGS to -fpch-preprocess - SET(_target_cflags "${oldProps} ${PCH_ADDITIONAL_COMPILER_FLAGS}-include ${_input} -Winvalid-pch") - ENDIF(MSVC) - - SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS ${_target_cflags}) - IF(oldProps) - SET_TARGET_PROPERTIES(${_targetName}_pch_dephelp PROPERTIES COMPILE_FLAGS ${oldProps}) - ENDIF(oldProps) - ADD_CUSTOM_TARGET(pch_Generate_${_targetName} DEPENDS ${_pch_output_to_use}) - ADD_DEPENDENCIES(${_targetName} pch_Generate_${_targetName}) +# Set PCH_FLAGS for common flags, PCH_ARCH_XXX_FLAGS for specific archs flags and PCH_ARCHS for archs +MACRO(PCH_SET_COMPILE_FLAGS _target) + SET(PCH_FLAGS) + SET(PCH_ARCHS) + + SET(FLAGS) + LIST(APPEND _FLAGS ${CMAKE_CXX_FLAGS}) + + STRING(TOUPPER "${CMAKE_BUILD_TYPE}" _UPPER_BUILD) + LIST(APPEND _FLAGS " ${CMAKE_CXX_FLAGS_${_UPPER_BUILD}}") + + IF(NOT MSVC) + GET_TARGET_PROPERTY(_targetType ${_target} TYPE) + IF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY) + LIST(APPEND _FLAGS " -fPIC") + ENDIF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY) + ENDIF(NOT MSVC) + + GET_DIRECTORY_PROPERTY(DIRINC INCLUDE_DIRECTORIES) + FOREACH(item ${DIRINC}) + LIST(APPEND _FLAGS " ${_PCH_include_prefix}\"${item}\"") + ENDFOREACH(item) + + # Required for CMake 2.6 + SET(GLOBAL_DEFINITIONS) + GET_DIRECTORY_PROPERTY(DEFINITIONS COMPILE_DEFINITIONS) + FOREACH(item ${DEFINITIONS}) + LIST(APPEND GLOBAL_DEFINITIONS " -D${item}") + ENDFOREACH(item) + + GET_DIRECTORY_PROPERTY(DEFINITIONS COMPILE_DEFINITIONS_${_UPPER_BUILD}) + FOREACH(item ${DEFINITIONS}) + LIST(APPEND GLOBAL_DEFINITIONS " -D${item}") + ENDFOREACH(item) + + GET_TARGET_PROPERTY(oldProps ${_target} COMPILE_FLAGS) + IF(oldProps) + LIST(APPEND _FLAGS " ${oldProps}") + ENDIF(oldProps) + + GET_TARGET_PROPERTY(oldPropsBuild ${_target} COMPILE_FLAGS_${_UPPER_BUILD}) + IF(oldPropsBuild) + LIST(APPEND _FLAGS " ${oldPropsBuild}") + ENDIF(oldPropsBuild) + + GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS) + GET_DIRECTORY_PROPERTY(_directory_definitions DIRECTORY ${CMAKE_SOURCE_DIR} DEFINITIONS) + LIST(APPEND _FLAGS " ${GLOBAL_DEFINITIONS}") + LIST(APPEND _FLAGS " ${_directory_flags}") + LIST(APPEND _FLAGS " ${_directory_definitions}") + + STRING(REGEX REPLACE " +" " " _FLAGS ${_FLAGS}) + + # Format definitions + SEPARATE_ARGUMENTS(_FLAGS) + + IF(CLANG) + # Determining all architectures and get common flags + SET(_ARCH_NEXT) + SET(_XARCH_NEXT) + FOREACH(item ${_FLAGS}) + IF(_ARCH_NEXT) + LIST(FIND PCH_ARCHS ${item} ITEM_FOUND) + IF(ITEM_FOUND EQUAL -1) + LIST(APPEND PCH_ARCHS ${item}) + STRING(TOUPPER "${item}" _UPPER_ARCH) + SET(PCH_ARCH_${_UPPER_ARCH}_FLAGS "-arch" ${item}) + ENDIF(ITEM_FOUND EQUAL -1) + SET(_ARCH_NEXT OFF) + ELSEIF(_XARCH_NEXT) + SET(_XARCH_NEXT OFF) + ELSE(_ARCH_NEXT) + IF(item MATCHES "^-arch") + SET(_ARCH_NEXT ON) + ELSEIF(item MATCHES "^-Xarch_") + STRING(REGEX REPLACE "-Xarch_([a-z0-9_]+)" "\\1" item ${item}) + LIST(FIND PCH_ARCHS ${item} ITEM_FOUND) + IF(ITEM_FOUND EQUAL -1) + LIST(APPEND PCH_ARCHS ${item}) + STRING(TOUPPER "${item}" _UPPER_ARCH) + SET(PCH_ARCH_${_UPPER_ARCH}_FLAGS "-arch" ${item}) + ENDIF(ITEM_FOUND EQUAL -1) + SET(_XARCH_NEXT ON) + ELSE(item MATCHES "^-arch") + LIST(APPEND PCH_FLAGS ${item}) + ENDIF(item MATCHES "^-arch") + ENDIF(_ARCH_NEXT) + ENDFOREACH(item) + + # Get architcture specific flags + SET(_XARCH_NEXT) + FOREACH(item ${_FLAGS}) + IF(_XARCH_NEXT) + STRING(TOUPPER "${_XARCH_NEXT}" _UPPER_XARCH) + LIST(APPEND PCH_ARCH_${_UPPER_XARCH}_FLAGS ${item}) + SET(_XARCH_NEXT OFF) + ELSE(_XARCH_NEXT) + IF(item MATCHES "^-Xarch_") + STRING(SUBSTRING "${item}" 7 -1 _XARCH_NEXT) + ENDIF(item MATCHES "^-Xarch_") + ENDIF(_XARCH_NEXT) + ENDFOREACH(item) + + # Remove duplicated architectures + IF(_ARCHS AND PCH_ARCHS) + LIST(REMOVE_DUPLICATES PCH_ARCHS) + ENDIF(_ARCHS AND PCH_ARCHS) + ELSE(CLANG) + SET(PCH_FLAGS ${_FLAGS}) + ENDIF(CLANG) + + IF(PCH_FLAGS) + LIST(REMOVE_DUPLICATES PCH_FLAGS) + ENDIF(PCH_FLAGS) +ENDMACRO(PCH_SET_COMPILE_FLAGS) + +MACRO(GET_PDB_FILENAME _out_filename _target) + # determine output directory based on target type + GET_TARGET_PROPERTY(_targetType ${_target} TYPE) + IF(${_targetType} STREQUAL EXECUTABLE) + SET(_targetOutput ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + ELSEIF(${_targetType} STREQUAL STATIC_LIBRARY) + SET(_targetOutput ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}) + ELSE(${_targetType} STREQUAL EXECUTABLE) + SET(_targetOutput ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) + ENDIF(${_targetType} STREQUAL EXECUTABLE) + + # determine target postfix + STRING(TOUPPER "${CMAKE_BUILD_TYPE}_POSTFIX" _postfix_var_name) + GET_TARGET_PROPERTY(_targetPostfix ${_target} ${_postfix_var_name}) + IF(${_targetPostfix} MATCHES NOTFOUND) + SET(_targetPostfix "") + ENDIF(${_targetPostfix} MATCHES NOTFOUND) + + SET(${_out_filename} "${_targetOutput}/${_target}${_targetPostfix}.pdb") +ENDMACRO(GET_PDB_FILENAME) + +MACRO(PCH_SET_COMPILE_COMMAND _inputcpp _compile_FLAGS) + IF(CMAKE_CXX_COMPILER_ARG1) + # remove leading space in compiler argument + STRING(REGEX REPLACE "^ +" "" pchsupport_compiler_cxx_arg1 ${CMAKE_CXX_COMPILER_ARG1}) + ELSE(CMAKE_CXX_COMPILER_ARG1) + SET(pchsupport_compiler_cxx_arg1 "") + ENDIF(CMAKE_CXX_COMPILER_ARG1) + + IF(MSVC) + GET_PDB_FILENAME(PDB_FILE ${_PCH_current_target}) + SET(PCH_COMMAND ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} /Yc /Fp"${PCH_OUTPUT}" ${_inputcpp} /Fd"${PDB_FILE}" /c /Fo"${PCH_OUTPUT}.obj") + ELSE(MSVC) + SET(HEADER_FORMAT "c++-header") + SET(_FLAGS "") + IF(APPLE) + SET(HEADER_FORMAT "objective-${HEADER_FORMAT}") + SET(_FLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch) + ENDIF(APPLE) + SET(PCH_COMMAND ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} ${_FLAGS} -x ${HEADER_FORMAT} -o ${PCH_OUTPUT} -c ${PCH_INPUT}) + ENDIF(MSVC) +ENDMACRO(PCH_SET_COMPILE_COMMAND) + +MACRO(PCH_SET_PRECOMPILED_HEADER_OUTPUT _targetName _input _arch _language) + SET(_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${_targetName}_pch") + + IF(MSVC) + FILE(MAKE_DIRECTORY ${_OUTPUT_DIR}) + GET_FILENAME_COMPONENT(_name ${_input} NAME_WE) + SET(PCH_INPUT ${_input}) + SET(PCH_OUTPUT "${_OUTPUT_DIR}/${_name}.pch") + ELSE(MSVC) + IF(NOT "${_arch}" STREQUAL "") + SET(_OUTPUT_DIR "${_OUTPUT_DIR}_${_arch}") + ENDIF(NOT "${_arch}" STREQUAL "") + + IF(NOT "${_language}" STREQUAL "") + SET(_OUTPUT_DIR "${_OUTPUT_DIR}_${_language}") + ENDIF(NOT "${_language}" STREQUAL "") + + GET_FILENAME_COMPONENT(_name ${_input} NAME) + + # Copy .h to output dir + SET(PCH_INPUT "${_OUTPUT_DIR}/${_name}") + ADD_CUSTOM_COMMAND(OUTPUT ${PCH_INPUT} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${_input} ${PCH_INPUT} + DEPENDS ${_input} + COMMENT "[${_targetName}] Update precompiled header - done" + ) + + IF(CLANG) + SET(PCH_EXT "pth") + ELSE(CLANG) + SET(PCH_EXT "gch") + ENDIF(CLANG) + + # For GCC and Clang, PCH needs to be in the same directory as .h + SET(PCH_OUTPUT "${_OUTPUT_DIR}/${_name}.${PCH_EXT}") + ENDIF(MSVC) +ENDMACRO(PCH_SET_PRECOMPILED_HEADER_OUTPUT) + +# Add common flags +MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName) + GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS) + + IF(${oldProps} MATCHES NOTFOUND) + SET(oldProps "") + ENDIF(${oldProps} MATCHES NOTFOUND) + + IF(MSVC) + SET(_target_cflags "${oldProps} /Yu\"${PCH_INPUT}\" /FI\"${PCH_INPUT}\" /Fp\"${PCH_OUTPUT}\"") + ELSE(MSVC) + # for use with distcc and gcc >4.0.1 if preprocessed files are accessible + # on all remote machines set + # PCH_ADDITIONAL_COMPILER_FLAGS to -fpch-preprocess + SET(PCH_ADDITIONAL_COMPILER_FLAGS) + LIST(LENGTH PCH_ARCHS PCH_ARCHS_COUNT) + + # If no arch is specified, create common flags + IF(PCH_ARCHS_COUNT LESS 2) + SET(PCH_ADDITIONAL_COMPILER_FLAGS "-include ${PCH_INPUT} ${PCH_ADDITIONAL_COMPILER_FLAGS}") + ENDIF(PCH_ARCHS_COUNT LESS 2) + + IF(APPLE) + SET(PCH_ADDITIONAL_COMPILER_FLAGS "-fobjc-abi-version=2 -fobjc-legacy-dispatch -x objective-c++ ${PCH_ADDITIONAL_COMPILER_FLAGS}") + ENDIF(APPLE) + + IF(WITH_PCH_DEBUG) + SET(PCH_ADDITIONAL_COMPILER_FLAGS "-H ${PCH_ADDITIONAL_COMPILER_FLAGS}") + ENDIF(WITH_PCH_DEBUG) + + SET(_target_cflags "${oldProps} ${PCH_ADDITIONAL_COMPILER_FLAGS} -Winvalid-pch") + ENDIF(MSVC) + + SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS ${_target_cflags}) ENDMACRO(ADD_PRECOMPILED_HEADER_TO_TARGET) -MACRO(ADD_PRECOMPILED_HEADER _targetName _inputh _inputcpp) +# Add specific flags for an arch +MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET_ARCH _targetName _arch) + LIST(LENGTH PCH_ARCHS PCH_ARCHS_COUNT) + + IF(PCH_ARCHS_COUNT GREATER 1) + GET_TARGET_PROPERTY(_FLAGS ${_targetName} COMPILE_FLAGS) + + IF(${_FLAGS} MATCHES NOTFOUND) + SET(_FLAGS "") + ENDIF(${_FLAGS} MATCHES NOTFOUND) + + SET(_FLAGS "${_FLAGS} -Xarch_${_arch} -include${PCH_INPUT}") - SET(_PCH_current_target ${_targetName}) + SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS ${_FLAGS}) + ENDIF(PCH_ARCHS_COUNT GREATER 1) +ENDMACRO(ADD_PRECOMPILED_HEADER_TO_TARGET_ARCH) - IF(NOT CMAKE_BUILD_TYPE) - MESSAGE(FATAL_ERROR - "This is the ADD_PRECOMPILED_HEADER macro. " - "You must set CMAKE_BUILD_TYPE!" - ) - ENDIF(NOT CMAKE_BUILD_TYPE) +MACRO(PCH_CREATE_TARGET _targetName _targetNamePCH) + ADD_CUSTOM_COMMAND(OUTPUT ${PCH_OUTPUT} COMMAND ${PCH_COMMAND} COMMENT "Generating ${_targetNamePCH}" DEPENDS ${PCH_INPUT}) + ADD_CUSTOM_TARGET(${_targetNamePCH} DEPENDS ${PCH_INPUT} ${PCH_OUTPUT}) + ADD_DEPENDENCIES(${_targetName} ${_targetNamePCH}) +ENDMACRO(PCH_CREATE_TARGET _targetName _inputh _inputcpp) - GET_PRECOMPILED_HEADER_OUTPUT( ${_targetName} ${_inputh} _output) +MACRO(ADD_PRECOMPILED_HEADER _targetName _inputh _inputcpp) + SET(_PCH_current_target ${_targetName}) + + IF(NOT CMAKE_BUILD_TYPE) + MESSAGE(FATAL_ERROR + "This is the ADD_PRECOMPILED_HEADER macro. " + "You must set CMAKE_BUILD_TYPE!" + ) + ENDIF(NOT CMAKE_BUILD_TYPE) - GET_TARGET_PROPERTY(_targetType ${_PCH_current_target} TYPE) + PCH_SET_COMPILE_FLAGS(${_targetName}) - # always build static library because it doesn't need linking - ADD_LIBRARY(${_targetName}_pch_dephelp STATIC ${_inputcpp}) + IF(PCH_ARCHS) + SET(PCH_OUTPUTS) + FOREACH(_ARCH ${PCH_ARCHS}) + STRING(TOUPPER "${_ARCH}" _UPPER_ARCH) - _PCH_GET_COMPILE_FLAGS(_compile_FLAGS) + PCH_SET_PRECOMPILED_HEADER_OUTPUT(${_targetName} ${_inputh} ${_ARCH} "") + LIST(APPEND PCH_OUTPUTS ${PCH_OUTPUT}) - SET_SOURCE_FILES_PROPERTIES(${_inputh} PROPERTIES GENERATED 1) + PCH_SET_COMPILE_COMMAND(${_inputcpp} "${PCH_ARCH_${_UPPER_ARCH}_FLAGS};${PCH_FLAGS}") + PCH_CREATE_TARGET(${_targetName} ${_targetName}_pch_${_ARCH}) - _PCH_GET_COMPILE_COMMAND(_command ${_inputh} ${_inputcpp} ${_output}) + ADD_PRECOMPILED_HEADER_TO_TARGET_ARCH(${_targetName} ${_ARCH}) + ENDFOREACH(_ARCH) + ELSE(PCH_ARCHS) + PCH_SET_PRECOMPILED_HEADER_OUTPUT(${_targetName} ${_inputh} "" "") + LIST(APPEND PCH_OUTPUTS ${PCH_OUTPUT}) - ADD_CUSTOM_COMMAND( - OUTPUT ${_output} - COMMAND ${_command} - DEPENDS ${_inputh} ${_targetName}_pch_dephelp - ) + PCH_SET_COMPILE_COMMAND(${_inputcpp} "${PCH_FLAGS}") + PCH_CREATE_TARGET(${_targetName} ${_targetName}_pch) + ENDIF(PCH_ARCHS) - ADD_PRECOMPILED_HEADER_TO_TARGET(${_targetName} ${_inputh} ${_output}) + ADD_PRECOMPILED_HEADER_TO_TARGET(${_targetName}) + + SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PCH_OUTPUTS}") ENDMACRO(ADD_PRECOMPILED_HEADER) # Macro to move PCH creation file to the front of files list +# or remove .cpp from library/executable to avoid warning MACRO(FIX_PRECOMPILED_HEADER _files _pch) - # Remove .cpp creating PCH from the list - LIST(REMOVE_ITEM ${_files} ${_pch}) - # Prepend .cpp creating PCH to the list - LIST(INSERT ${_files} 0 ${_pch}) + # Remove .cpp creating PCH from the list + LIST(REMOVE_ITEM ${_files} ${_pch}) + IF(MSVC) + # Prepend .cpp creating PCH to the list + LIST(INSERT ${_files} 0 ${_pch}) + ENDIF(MSVC) ENDMACRO(FIX_PRECOMPILED_HEADER) MACRO(ADD_NATIVE_PRECOMPILED_HEADER _targetName _inputh _inputcpp) - SET(PCH_METHOD 0) - - # 0 => creating a new target for PCH, works for all makefiles - # 1 => setting PCH for VC++ project, works for VC++ projects - # 2 => setting PCH for XCode project, works for XCode projects - IF(CMAKE_GENERATOR MATCHES "Visual Studio") - SET(PCH_METHOD 1) - ELSEIF(CMAKE_GENERATOR MATCHES "NMake Makefiles" AND MFC_FOUND AND CMAKE_MFC_FLAG) - # To fix a bug with MFC - # Don't forget to use FIX_PRECOMPILED_HEADER before creating the target -# SET(PCH_METHOD 1) - ELSEIF(CMAKE_GENERATOR MATCHES "Xcode") - SET(PCH_METHOD 2) - ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio") - - IF(PCH_METHOD EQUAL 1) - # Auto include the precompile (useful for moc processing, since the use of - # precompiled is specified at the target level - # and I don't want to specifiy /F- for each moc/res/ui generated files (using Qt) - - GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS) - IF(${oldProps} MATCHES NOTFOUND) - SET(oldProps "") - ENDIF(${oldProps} MATCHES NOTFOUND) - - SET(newProperties "${oldProps} /Yu\"${_inputh}\" /FI\"${_inputh}\"") - SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS "${newProperties}") - - #also inlude ${oldProps} to have the same compile options - SET_SOURCE_FILES_PROPERTIES(${_inputcpp} PROPERTIES COMPILE_FLAGS "${oldProps} /Yc\"${_inputh}\"") - ELSEIF(PCH_METHOD EQUAL 2) - # For Xcode, cmake needs my patch to process - # GCC_PREFIX_HEADER and GCC_PRECOMPILE_PREFIX_HEADER as target properties - - GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS) - IF(${oldProps} MATCHES NOTFOUND) - SET(oldProps "") - ENDIF(${oldProps} MATCHES NOTFOUND) - - # When buiding out of the tree, precompiled may not be located - # Use full path instead. - GET_FILENAME_COMPONENT(fullPath ${_inputh} ABSOLUTE) - - SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${fullPath}") - SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES") - ELSE(PCH_METHOD EQUAL 1) - #Fallback to the "old" precompiled suppport - ADD_PRECOMPILED_HEADER(${_targetName} ${_inputh} ${_inputcpp}) - ENDIF(PCH_METHOD EQUAL 1) - + IF(NOT PCHSupport_FOUND) + MESSAGE(STATUS "PCH disabled because compiler doesn't support them") + RETURN() + ENDIF(NOT PCHSupport_FOUND) + + # 0 => creating a new target for PCH, works for all makefiles + # 1 => setting PCH for VC++ project, works for VC++ projects + # 2 => setting PCH for XCode project, works for XCode projects + IF(CMAKE_GENERATOR MATCHES "Visual Studio") + SET(PCH_METHOD 1) + ELSEIF(CMAKE_GENERATOR MATCHES "NMake Makefiles" AND MFC_FOUND AND CMAKE_MFC_FLAG) + # To fix a bug with MFC + # Don't forget to use FIX_PRECOMPILED_HEADER before creating the target +# SET(PCH_METHOD 1) + ELSEIF(CMAKE_GENERATOR MATCHES "Xcode") + SET(PCH_METHOD 2) + ELSE(CMAKE_GENERATOR MATCHES "Visual Studio") + SET(PCH_METHOD 0) + ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio") + + IF(PCH_METHOD EQUAL 1) + # Auto include the precompile (useful for moc processing, since the use of + # precompiled is specified at the target level + # and I don't want to specifiy /F- for each moc/res/ui generated files (using Qt) + + GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS) + IF(${oldProps} MATCHES NOTFOUND) + SET(oldProps "") + ENDIF(${oldProps} MATCHES NOTFOUND) + + SET(newProperties "${oldProps} /Yu\"${_inputh}\" /FI\"${_inputh}\"") + SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS "${newProperties}") + + #also inlude ${oldProps} to have the same compile options + SET_SOURCE_FILES_PROPERTIES(${_inputcpp} PROPERTIES COMPILE_FLAGS "${oldProps} /Yc\"${_inputh}\"") + ELSEIF(PCH_METHOD EQUAL 2) + # For Xcode, cmake needs my patch to process + # GCC_PREFIX_HEADER and GCC_PRECOMPILE_PREFIX_HEADER as target properties + + # When buiding out of the tree, precompiled may not be located + # Use full path instead. + GET_FILENAME_COMPONENT(fullPath ${_inputh} ABSOLUTE) + + SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${fullPath}") + SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES") + ELSE(PCH_METHOD EQUAL 1) + #Fallback to the "old" precompiled suppport + ADD_PRECOMPILED_HEADER(${_targetName} ${_inputh} ${_inputcpp}) + ENDIF(PCH_METHOD EQUAL 1) + + IF(TARGET ${_targetName}_static) + ADD_NATIVE_PRECOMPILED_HEADER(${_targetName}_static ${_inputh} ${_inputcpp}) + ENDIF(TARGET ${_targetName}_static) ENDMACRO(ADD_NATIVE_PRECOMPILED_HEADER) diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index 624d47ab9..1c339fef8 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -13,11 +13,7 @@ ENDIF(NOT CMAKE_BUILD_TYPE) MACRO(NL_GEN_PC name) IF(NOT WIN32 AND WITH_INSTALL_LIBRARIES) CONFIGURE_FILE(${name}.in "${CMAKE_CURRENT_BINARY_DIR}/${name}") - IF(CMAKE_LIBRARY_ARCHITECTURE) - INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/${name}" DESTINATION lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig) - ELSE(CMAKE_LIBRARY_ARCHITECTURE) - INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/${name}" DESTINATION lib/pkgconfig) - ENDIF(CMAKE_LIBRARY_ARCHITECTURE) + INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/${name}" DESTINATION ${NL_LIB_PREFIX}/pkgconfig) ENDIF(NOT WIN32 AND WITH_INSTALL_LIBRARIES) ENDMACRO(NL_GEN_PC) @@ -26,25 +22,52 @@ ENDMACRO(NL_GEN_PC) ### MACRO(NL_GEN_REVISION_H) IF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h.in) - INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}) - ADD_DEFINITIONS(-DHAVE_REVISION_H) - SET(HAVE_REVISION_H ON) - - # a custom target that is always built - ADD_CUSTOM_TARGET(revision ALL - DEPENDS ${CMAKE_BINARY_DIR}/revision.h) - - # creates revision.h using cmake script - ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_BINARY_DIR}/revision.h - COMMAND ${CMAKE_COMMAND} - -DSOURCE_DIR=${CMAKE_SOURCE_DIR} - -DROOT_DIR=${CMAKE_SOURCE_DIR}/.. - -P ${CMAKE_SOURCE_DIR}/CMakeModules/GetRevision.cmake) - - # revision.h is a generated file - SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/revision.h - PROPERTIES GENERATED TRUE - HEADER_FILE_ONLY TRUE) + SET(TOOL_FOUND OFF) + + IF(EXISTS "${CMAKE_SOURCE_DIR}/../.svn/") + FIND_PACKAGE(Subversion) + + IF(SUBVERSION_FOUND) + SET(TOOL_FOUND ON) + ENDIF(SUBVERSION_FOUND) + ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/../.svn/") + + IF(EXISTS "${CMAKE_SOURCE_DIR}/../.hg/") + FIND_PACKAGE(Mercurial) + + IF(MERCURIAL_FOUND) + SET(TOOL_FOUND ON) + ENDIF(MERCURIAL_FOUND) + ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/../.hg/") + + # if already generated + IF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h) + # copy it + MESSAGE(STATUS "Copying provided revision.h...") + FILE(COPY ${CMAKE_SOURCE_DIR}/revision.h DESTINATION ${CMAKE_BINARY_DIR}) + SET(HAVE_REVISION_H ON) + ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h) + + IF(TOOL_FOUND) + # a custom target that is always built + ADD_CUSTOM_TARGET(revision ALL + COMMAND ${CMAKE_COMMAND} + -DSOURCE_DIR=${CMAKE_SOURCE_DIR} + -DROOT_DIR=${CMAKE_SOURCE_DIR}/.. + -DCMAKE_MODULE_PATH=${CMAKE_SOURCE_DIR}/CMakeModules + -P ${CMAKE_SOURCE_DIR}/CMakeModules/GetRevision.cmake) + + # revision.h is a generated file + SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/revision.h + PROPERTIES GENERATED TRUE + HEADER_FILE_ONLY TRUE) + SET(HAVE_REVISION_H ON) + ENDIF(TOOL_FOUND) + + IF(HAVE_REVISION_H) + INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}) + ADD_DEFINITIONS(-DHAVE_REVISION_H) + ENDIF(HAVE_REVISION_H) ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h.in) ENDMACRO(NL_GEN_REVISION_H) @@ -76,6 +99,11 @@ ENDMACRO(NL_TARGET_DRIVER) # Argument: ### MACRO(NL_DEFAULT_PROPS name label) + IF(HAVE_REVISION_H) + # explicitly say that the target depends on revision.h + ADD_DEPENDENCIES(${name} revision) + ENDIF(HAVE_REVISION_H) + # Note: This is just a workaround for a CMake bug generating VS10 files with a colon in the project name. # CMake Bug ID: http://www.cmake.org/Bug/view.php?id=11819 STRING(REGEX REPLACE "\\:" " -" proj_label ${label}) @@ -243,16 +271,7 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS) ### # Optional support ### - - # Check if CMake is launched from a Debian packaging script - SET(DEB_HOST_GNU_CPU $ENV{DEB_HOST_GNU_CPU}) - - # Don't strip if generating a .deb - IF(DEB_HOST_GNU_CPU) - OPTION(WITH_SYMBOLS "Keep debug symbols in binaries" ON ) - ELSE(DEB_HOST_GNU_CPU) - OPTION(WITH_SYMBOLS "Keep debug symbols in binaries" OFF) - ENDIF(DEB_HOST_GNU_CPU) + OPTION(WITH_SYMBOLS "Keep debug symbols in binaries" OFF) IF(WIN32) OPTION(WITH_STLPORT "With STLport support." ON ) @@ -332,6 +351,11 @@ MACRO(NL_SETUP_SNOWBALLS_DEFAULT_OPTIONS) OPTION(WITH_SNOWBALLS_SERVER "Build Snowballs Services" ON ) ENDMACRO(NL_SETUP_SNOWBALLS_DEFAULT_OPTIONS) +MACRO(ADD_PLATFORM_FLAGS _FLAGS) + SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} ${_FLAGS}") + SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} ${_FLAGS}") +ENDMACRO(ADD_PLATFORM_FLAGS) + MACRO(NL_SETUP_BUILD) #----------------------------------------------------------------------------- @@ -364,9 +388,6 @@ MACRO(NL_SETUP_BUILD) ENDIF(HOST_CPU MATCHES "amd64") # Determine target CPU - IF(NOT TARGET_CPU) - SET(TARGET_CPU $ENV{DEB_HOST_GNU_CPU}) - ENDIF(NOT TARGET_CPU) # If not specified, use the same CPU as host IF(NOT TARGET_CPU) @@ -379,9 +400,6 @@ MACRO(NL_SETUP_BUILD) SET(TARGET_CPU "x86") ENDIF(TARGET_CPU MATCHES "amd64") - # DEB_HOST_ARCH_ENDIAN is 'little' or 'big' - # DEB_HOST_ARCH_BITS is '32' or '64' - IF(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") SET(CLANG ON) MESSAGE(STATUS "Using Clang compiler") @@ -393,7 +411,7 @@ MACRO(NL_SETUP_BUILD) ENDIF(CMAKE_GENERATOR MATCHES "Xcode") # If target and host CPU are the same - IF("${HOST_CPU}" STREQUAL "${TARGET_CPU}") + IF("${HOST_CPU}" STREQUAL "${TARGET_CPU}" AND NOT CMAKE_CROSSCOMPILING) # x86-compatible CPU IF(HOST_CPU MATCHES "x86") IF(NOT CMAKE_SIZEOF_VOID_P) @@ -414,75 +432,145 @@ MACRO(NL_SETUP_BUILD) MESSAGE(STATUS "Unknown architecture: ${HOST_CPU}") ENDIF(HOST_CPU MATCHES "x86") # TODO: add checks for PPC - ELSE("${HOST_CPU}" STREQUAL "${TARGET_CPU}") + ELSE("${HOST_CPU}" STREQUAL "${TARGET_CPU}" AND NOT CMAKE_CROSSCOMPILING) MESSAGE(STATUS "Compiling on ${HOST_CPU} for ${TARGET_CPU}") - ENDIF("${HOST_CPU}" STREQUAL "${TARGET_CPU}") - - IF(TARGET_CPU STREQUAL "x86_64") - SET(TARGET_X64 1) - SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DHAVE_X86_64") - ELSEIF(TARGET_CPU STREQUAL "x86") - SET(TARGET_X86 1) - SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DHAVE_X86") - ELSEIF(TARGET_CPU STREQUAL "arm") - SET(TARGET_ARM 1) - SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DHAVE_ARM") - ENDIF(TARGET_CPU STREQUAL "x86_64") + ENDIF("${HOST_CPU}" STREQUAL "${TARGET_CPU}" AND NOT CMAKE_CROSSCOMPILING) + + # Use values from environment variables + SET(PLATFORM_CFLAGS "$ENV{CFLAGS} $ENV{CPPFLAGS} ${PLATFORM_CFLAGS}") + SET(PLATFORM_CXXFLAGS "$ENV{CXXFLAGS} $ENV{CPPFLAGS} ${PLATFORM_CXXFLAGS}") + SET(PLATFORM_LINKFLAGS "$ENV{LDFLAGS} ${PLATFORM_LINKFLAGS}") + + # Remove -g and -O flag because we are managing them ourself + STRING(REPLACE "-g" "" PLATFORM_CFLAGS ${PLATFORM_CFLAGS}) + STRING(REPLACE "-g" "" PLATFORM_CXXFLAGS ${PLATFORM_CXXFLAGS}) + STRING(REGEX REPLACE "-O[0-9s]" "" PLATFORM_CFLAGS ${PLATFORM_CFLAGS}) + STRING(REGEX REPLACE "-O[0-9s]" "" PLATFORM_CXXFLAGS ${PLATFORM_CXXFLAGS}) + + # Strip spaces + STRING(STRIP ${PLATFORM_CFLAGS} PLATFORM_CFLAGS) + STRING(STRIP ${PLATFORM_CXXFLAGS} PLATFORM_CXXFLAGS) + STRING(STRIP ${PLATFORM_LINKFLAGS} PLATFORM_LINKFLAGS) + + IF(NOT CMAKE_OSX_ARCHITECTURES) + IF(TARGET_CPU STREQUAL "x86_64") + SET(TARGET_X64 1) + SET(TARGET_X86 1) + ELSEIF(TARGET_CPU STREQUAL "x86") + SET(TARGET_X86 1) + ELSEIF(TARGET_CPU STREQUAL "armv7s") + SET(TARGET_ARM 1) + SET(TARGET_ARMV7S 1) + ELSEIF(TARGET_CPU STREQUAL "armv7") + SET(TARGET_ARM 1) + SET(TARGET_ARMV7 1) + ELSEIF(TARGET_CPU STREQUAL "armv6") + SET(TARGET_ARM 1) + SET(TARGET_ARMV6 1) + ELSEIF(TARGET_CPU STREQUAL "armv5") + SET(TARGET_ARM 1) + SET(TARGET_ARMV5 1) + ELSEIF(TARGET_CPU STREQUAL "arm") + SET(TARGET_ARM 1) + ELSEIF(TARGET_CPU STREQUAL "mips") + SET(TARGET_MIPS 1) + ENDIF(TARGET_CPU STREQUAL "x86_64") + + IF(TARGET_ARM) + IF(TARGET_ARMV7S) + ADD_PLATFORM_FLAGS("-DHAVE_ARMV7S") + ENDIF(TARGET_ARMV7S) + + IF(TARGET_ARMV7) + ADD_PLATFORM_FLAGS("-DHAVE_ARMV7") + ENDIF(TARGET_ARMV7) + + IF(TARGET_ARMV6) + ADD_PLATFORM_FLAGS("-HAVE_ARMV6") + ENDIF(TARGET_ARMV6) + + ADD_PLATFORM_FLAGS("-DHAVE_ARM") + ENDIF(TARGET_ARM) - # Fix library paths suffixes for Debian MultiArch - SET(DEBIAN_MULTIARCH $ENV{DEB_HOST_MULTIARCH}) + IF(TARGET_X86) + ADD_PLATFORM_FLAGS("-DHAVE_X86") + ENDIF(TARGET_X86) - IF(DEBIAN_MULTIARCH) - SET(CMAKE_LIBRARY_ARCHITECTURE ${DEBIAN_MULTIARCH}) - ENDIF(DEBIAN_MULTIARCH) + IF(TARGET_X64) + ADD_PLATFORM_FLAGS("-DHAVE_X64 -DHAVE_X86_64") + ENDIF(TARGET_X64) - IF(CMAKE_LIBRARY_ARCHITECTURE) - SET(CMAKE_LIBRARY_PATH /lib/${CMAKE_LIBRARY_ARCHITECTURE} /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} ${CMAKE_LIBRARY_PATH}) + IF(TARGET_MIPS) + ADD_PLATFORM_FLAGS("-DHAVE_MIPS") + ENDIF(TARGET_MIPS) + ENDIF(NOT CMAKE_OSX_ARCHITECTURES) + + # Fix library paths suffixes for Debian MultiArch + IF(LIBRARY_ARCHITECTURE) + SET(CMAKE_LIBRARY_PATH /lib/${LIBRARY_ARCHITECTURE} /usr/lib/${LIBRARY_ARCHITECTURE} ${CMAKE_LIBRARY_PATH}) IF(TARGET_X64) SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /lib64 /usr/lib64) - ENDIF(TARGET_X64) - IF(TARGET_X86) + ELSEIF(TARGET_X86) SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /lib32 /usr/lib32) - ENDIF(TARGET_X86) - ENDIF(CMAKE_LIBRARY_ARCHITECTURE) + ENDIF(TARGET_X64) + ENDIF(LIBRARY_ARCHITECTURE) + + IF(APPLE AND NOT IOS) + SET(CMAKE_INCLUDE_PATH /opt/local/include ${CMAKE_INCLUDE_PATH}) + SET(CMAKE_LIBRARY_PATH /opt/local/lib ${CMAKE_LIBRARY_PATH}) + ENDIF(APPLE AND NOT IOS) + + IF(WITH_LOGGING) + ADD_PLATFORM_FLAGS("-DENABLE_LOGS") + ENDIF(WITH_LOGGING) IF(MSVC) - IF(MSVC10) + IF(MSVC_VERSION EQUAL "1700" AND NOT MSVC11) + SET(MSVC11 ON) + ENDIF(MSVC_VERSION EQUAL "1700" AND NOT MSVC11) + + IF(MSVC11) + ADD_PLATFORM_FLAGS("/Gy- /MP") + # /Ox is working with VC++ 2010, but custom optimizations don't exist + SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}") + # without inlining it's unusable, use custom optimizations again + SET(DEBUG_CFLAGS "/Od /Ob1 /GF- ${DEBUG_CFLAGS}") + ELSEIF(MSVC10) + ADD_PLATFORM_FLAGS("/Gy- /MP") # /Ox is working with VC++ 2010, but custom optimizations don't exist - SET(SPEED_OPTIMIZATIONS "/Ox /GF /GS-") + SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}") # without inlining it's unusable, use custom optimizations again - SET(MIN_OPTIMIZATIONS "/Od /Ob1") + SET(DEBUG_CFLAGS "/Od /Ob1 /GF- ${DEBUG_CFLAGS}") ELSEIF(MSVC90) + ADD_PLATFORM_FLAGS("/Gy- /MP") # don't use a /O[012x] flag if you want custom optimizations - SET(SPEED_OPTIMIZATIONS "/Ob2 /Oi /Ot /Oy /GT /GF /GS-") + SET(RELEASE_CFLAGS "/Ob2 /Oi /Ot /Oy /GT /GF /GS- ${RELEASE_CFLAGS}") # without inlining it's unusable, use custom optimizations again - SET(MIN_OPTIMIZATIONS "/Ob1") + SET(DEBUG_CFLAGS "/Ob1 /GF- ${DEBUG_CFLAGS}") ELSEIF(MSVC80) + ADD_PLATFORM_FLAGS("/Gy- /Wp64") # don't use a /O[012x] flag if you want custom optimizations - SET(SPEED_OPTIMIZATIONS "/Ox /GF /GS-") + SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}") # without inlining it's unusable, use custom optimizations again - SET(MIN_OPTIMIZATIONS "/Od /Ob1") - ELSE(MSVC10) + SET(DEBUG_CFLAGS "/Od /Ob1 ${DEBUG_CFLAGS}") + ELSE(MSVC11) MESSAGE(FATAL_ERROR "Can't determine compiler version ${MSVC_VERSION}") - ENDIF(MSVC10) - - SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /DWIN32 /D_WINDOWS /W3 /Zm1000 /MP /Gy-") + ENDIF(MSVC11) - # Common link flags - SET(PLATFORM_LINKFLAGS "") + ADD_PLATFORM_FLAGS("/D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /DWIN32 /D_WINDOWS /Zm1000 /wd4250") IF(TARGET_X64) # Fix a bug with Intellisense - SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} /D_WIN64") + ADD_PLATFORM_FLAGS("/D_WIN64") # Fix a compilation error for some big C++ files - SET(MIN_OPTIMIZATIONS "${MIN_OPTIMIZATIONS} /bigobj") + SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} /bigobj") ELSE(TARGET_X64) # Allows 32 bits applications to use 3 GB of RAM SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /LARGEADDRESSAWARE") ENDIF(TARGET_X64) # Exceptions are only set for C++ - SET(PLATFORM_CXXFLAGS "${PLATFORM_CFLAGS} /EHa") + SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} /EHa") IF(WITH_SYMBOLS) SET(NL_RELEASE_CFLAGS "/Zi ${NL_RELEASE_CFLAGS}") @@ -491,88 +579,315 @@ MACRO(NL_SETUP_BUILD) SET(NL_RELEASE_LINKFLAGS "/RELEASE ${NL_RELEASE_LINKFLAGS}") ENDIF(WITH_SYMBOLS) - SET(NL_DEBUG_CFLAGS "/Zi /MDd /RTC1 /D_DEBUG ${MIN_OPTIMIZATIONS} ${NL_DEBUG_CFLAGS}") - SET(NL_RELEASE_CFLAGS "/MD /DNDEBUG ${SPEED_OPTIMIZATIONS} ${NL_RELEASE_CFLAGS}") + SET(NL_DEBUG_CFLAGS "/Zi /MDd /RTC1 /D_DEBUG ${DEBUG_CFLAGS} ${NL_DEBUG_CFLAGS}") + SET(NL_RELEASE_CFLAGS "/MD /DNDEBUG ${RELEASE_CFLAGS} ${NL_RELEASE_CFLAGS}") SET(NL_DEBUG_LINKFLAGS "/DEBUG /OPT:NOREF /OPT:NOICF /NODEFAULTLIB:msvcrt /INCREMENTAL:YES ${NL_DEBUG_LINKFLAGS}") SET(NL_RELEASE_LINKFLAGS "/OPT:REF /OPT:ICF /INCREMENTAL:NO ${NL_RELEASE_LINKFLAGS}") + + IF(WITH_WARNINGS) + SET(DEBUG_CFLAGS "/W4 ${DEBUG_CFLAGS}") + ELSE(WITH_WARNINGS) + SET(DEBUG_CFLAGS "/W3 ${DEBUG_CFLAGS}") + ENDIF(WITH_WARNINGS) ELSE(MSVC) IF(WIN32) - SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DWIN32 -D_WIN32") + ADD_PLATFORM_FLAGS("-DWIN32 -D_WIN32") + + IF(CLANG) + ADD_PLATFORM_FLAGS("-nobuiltininc") + ENDIF(CLANG) ENDIF(WIN32) IF(APPLE) - IF(TARGET_CPU STREQUAL "x86") - SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -arch i386") - ENDIF(TARGET_CPU STREQUAL "x86") - - IF(TARGET_CPU STREQUAL "x86_64") - SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -arch x86_64") - ENDIF(TARGET_CPU STREQUAL "x86_64") + IF(IOS) + # Disable CMAKE_OSX_DEPLOYMENT_TARGET for iOS + SET(CMAKE_OSX_DEPLOYMENT_TARGET "" CACHE PATH "" FORCE) + ELSE(IOS) + IF(NOT CMAKE_OSX_DEPLOYMENT_TARGET) + SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.6" CACHE PATH "" FORCE) + ENDIF(NOT CMAKE_OSX_DEPLOYMENT_TARGET) + ENDIF(IOS) + + IF(XCODE) + IF(IOS) + SET(CMAKE_OSX_SYSROOT "iphoneos" CACHE PATH "" FORCE) + ELSE(IOS) +# SET(CMAKE_OSX_SYSROOT "macosx" CACHE PATH "" FORCE) + ENDIF(IOS) + ELSE(XCODE) + IF(CMAKE_OSX_ARCHITECTURES) + SET(TARGETS_COUNT 0) + SET(_ARCHS) + FOREACH(_ARCH ${CMAKE_OSX_ARCHITECTURES}) + IF(_ARCH STREQUAL "i386") + SET(_ARCHS "${_ARCHS} i386") + SET(TARGET_X86 1) + MATH(EXPR TARGETS_COUNT "${TARGETS_COUNT}+1") + ELSEIF(_ARCH STREQUAL "x86_64") + SET(_ARCHS "${_ARCHS} x86_64") + SET(TARGET_X64 1) + MATH(EXPR TARGETS_COUNT "${TARGETS_COUNT}+1") + ELSEIF(_ARCH STREQUAL "armv7s") + SET(_ARCHS "${_ARCHS} armv7s") + SET(TARGET_ARMV7S 1) + SET(TARGET_ARM 1) + MATH(EXPR TARGETS_COUNT "${TARGETS_COUNT}+1") + ELSEIF(_ARCH STREQUAL "armv7") + SET(_ARCHS "${_ARCHS} armv7") + SET(TARGET_ARMV7 1) + SET(TARGET_ARM 1) + MATH(EXPR TARGETS_COUNT "${TARGETS_COUNT}+1") + ELSEIF(_ARCH STREQUAL "armv6") + SET(_ARCHS "${_ARCHS} armv6") + SET(TARGET_ARMV6 1) + SET(TARGET_ARM 1) + MATH(EXPR TARGETS_COUNT "${TARGETS_COUNT}+1") + ELSEIF(_ARCH STREQUAL "mips") + SET(_ARCHS "${_ARCHS} mips") + SET(TARGET_MIPS 1) + MATH(EXPR TARGETS_COUNT "${TARGETS_COUNT}+1") + ELSE(_ARCH STREQUAL "i386") + SET(_ARCHS "${_ARCHS} unknwon(${_ARCH})") + ENDIF(_ARCH STREQUAL "i386") + ENDFOREACH(_ARCH) + MESSAGE(STATUS "Compiling under Mac OS X for ${TARGETS_COUNT} architectures: ${_ARCHS}") + ELSE(CMAKE_OSX_ARCHITECTURES) + SET(TARGETS_COUNT 0) + ENDIF(CMAKE_OSX_ARCHITECTURES) + + IF(TARGETS_COUNT EQUAL 1) + IF(TARGET_ARM) + IF(TARGET_ARMV7S) + ADD_PLATFORM_FLAGS("-arch armv7s -DHAVE_ARMV7S") + ENDIF(TARGET_ARMV7S) + + IF(TARGET_ARMV7) + ADD_PLATFORM_FLAGS("-arch armv7 -DHAVE_ARMV7") + ENDIF(TARGET_ARMV7) + + IF(TARGET_ARMV6) + ADD_PLATFORM_FLAGS("-arch armv6 -DHAVE_ARMV6") + ENDIF(TARGET_ARMV6) + + IF(TARGET_ARMV5) + ADD_PLATFORM_FLAGS("-arch armv5 -DHAVE_ARMV5") + ENDIF(TARGET_ARMV5) + + ADD_PLATFORM_FLAGS("-mthumb -DHAVE_ARM") + ENDIF(TARGET_ARM) + + IF(TARGET_X64) + ADD_PLATFORM_FLAGS("-arch x86_64 -DHAVE_X64 -DHAVE_X86_64 -DHAVE_X86") + ELSEIF(TARGET_X86) + ADD_PLATFORM_FLAGS("-arch i386 -DHAVE_X86") + ENDIF(TARGET_X64) + + IF(TARGET_MIPS) + ADD_PLATFORM_FLAGS("-arch mips -DHAVE_MIPS") + ENDIF(TARGET_MIPS) + ELSEIF(TARGETS_COUNT EQUAL 0) + # Not using CMAKE_OSX_ARCHITECTURES, HAVE_XXX already defined before + IF(TARGET_ARM) + IF(TARGET_ARMV7S) + ADD_PLATFORM_FLAGS("-arch armv7s") + ENDIF(TARGET_ARMV7S) + + IF(TARGET_ARMV7) + ADD_PLATFORM_FLAGS("-arch armv7") + ENDIF(TARGET_ARMV7) + + IF(TARGET_ARMV6) + ADD_PLATFORM_FLAGS("-arch armv6") + ENDIF(TARGET_ARMV6) + + IF(TARGET_ARMV5) + ADD_PLATFORM_FLAGS("-arch armv5") + ENDIF(TARGET_ARMV5) + + ADD_PLATFORM_FLAGS("-mthumb") + ENDIF(TARGET_ARM) + + IF(TARGET_X64) + ADD_PLATFORM_FLAGS("-arch x86_64") + ELSEIF(TARGET_X86) + ADD_PLATFORM_FLAGS("-arch i386") + ENDIF(TARGET_X64) + + IF(TARGET_MIPS) + ADD_PLATFORM_FLAGS("-arch mips") + ENDIF(TARGET_MIPS) + ELSE(TARGETS_COUNT EQUAL 1) + IF(TARGET_ARMV6) + ADD_PLATFORM_FLAGS("-Xarch_armv6 -mthumb -Xarch_armv6 -DHAVE_ARM -Xarch_armv6 -DHAVE_ARMV6") + ENDIF(TARGET_ARMV6) + + IF(TARGET_ARMV7) + ADD_PLATFORM_FLAGS("-Xarch_armv7 -mthumb -Xarch_armv7 -DHAVE_ARM -Xarch_armv7 -DHAVE_ARMV7") + ENDIF(TARGET_ARMV7) + + IF(TARGET_X86) + ADD_PLATFORM_FLAGS("-Xarch_i386 -DHAVE_X86") + ENDIF(TARGET_X86) + + IF(TARGET_X64) + ADD_PLATFORM_FLAGS("-Xarch_x86_64 -DHAVE_X64 -Xarch_x86_64 -DHAVE_X86_64") + ENDIF(TARGET_X64) + + IF(TARGET_MIPS) + ADD_PLATFORM_FLAGS("-Xarch_mips -DHAVE_MIPS") + ENDIF(TARGET_MIPS) + ENDIF(TARGETS_COUNT EQUAL 1) + + IF(IOS) + SET(CMAKE_OSX_SYSROOT "" CACHE PATH "" FORCE) + + IF(IOS_VERSION) + PARSE_VERSION_STRING(${IOS_VERSION} IOS_VERSION_MAJOR IOS_VERSION_MINOR IOS_VERSION_PATCH) + CONVERT_VERSION_NUMBER(${IOS_VERSION_MAJOR} ${IOS_VERSION_MINOR} ${IOS_VERSION_PATCH} IOS_VERSION_NUMBER) + + ADD_PLATFORM_FLAGS("-D__IPHONE_OS_VERSION_MIN_REQUIRED=${IOS_VERSION_NUMBER}") + ENDIF(IOS_VERSION) + + IF(CMAKE_IOS_SYSROOT) + IF(TARGET_ARMV7S) + IF(TARGETS_COUNT GREATER 1) + SET(XARCH "-Xarch_armv7s ") + ENDIF(TARGETS_COUNT GREATER 1) + + ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SYSROOT}") + ADD_PLATFORM_FLAGS("${XARCH}-miphoneos-version-min=${IOS_VERSION}") + SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}") + ENDIF(TARGET_ARMV7S) + + IF(TARGET_ARMV7) + IF(TARGETS_COUNT GREATER 1) + SET(XARCH "-Xarch_armv7 ") + ENDIF(TARGETS_COUNT GREATER 1) + + ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SYSROOT}") + ADD_PLATFORM_FLAGS("${XARCH}-miphoneos-version-min=${IOS_VERSION}") + SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}") + ENDIF(TARGET_ARMV7) + + IF(TARGET_ARMV6) + IF(TARGETS_COUNT GREATER 1) + SET(XARCH "-Xarch_armv6 ") + ENDIF(TARGETS_COUNT GREATER 1) + + ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SYSROOT}") + ADD_PLATFORM_FLAGS("${XARCH}-miphoneos-version-min=${IOS_VERSION}") + SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}") + ENDIF(TARGET_ARMV6) + ENDIF(CMAKE_IOS_SYSROOT) + + IF(CMAKE_IOS_SIMULATOR_SYSROOT AND TARGET_X86) + IF(TARGETS_COUNT GREATER 1) + SET(XARCH "-Xarch_i386 ") + ENDIF(TARGETS_COUNT GREATER 1) + + ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SIMULATOR_SYSROOT}") + ADD_PLATFORM_FLAGS("${XARCH}-mios-simulator-version-min=${IOS_VERSION}") + SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}") + ENDIF(CMAKE_IOS_SIMULATOR_SYSROOT AND TARGET_X86) + ELSE(IOS) + FOREACH(_SDK ${_CMAKE_OSX_SDKS}) + IF(${_SDK} MATCHES "MacOSX${CMAKE_OSX_DEPLOYMENT_TARGET}\\.sdk") + SET(CMAKE_OSX_SYSROOT ${_SDK} CACHE PATH "" FORCE) + ENDIF(${_SDK} MATCHES "MacOSX${CMAKE_OSX_DEPLOYMENT_TARGET}\\.sdk") + ENDFOREACH(_SDK) + + IF(CMAKE_OSX_SYSROOT) + ADD_PLATFORM_FLAGS("-isysroot ${CMAKE_OSX_SYSROOT}") + ELSE(CMAKE_OSX_SYSROOT) + MESSAGE(FATAL_ERROR "CMAKE_OSX_SYSROOT can't be determinated") + ENDIF(CMAKE_OSX_SYSROOT) + + # Always force -mmacosx-version-min to override environement variable + ADD_PLATFORM_FLAGS("-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}") + SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}") + ENDIF(IOS) + + SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-headerpad_max_install_names") + + IF(HAVE_FLAG_SEARCH_PATHS_FIRST) + SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-search_paths_first") + ENDIF(HAVE_FLAG_SEARCH_PATHS_FIRST) + ENDIF(XCODE) ELSE(APPLE) IF(HOST_CPU STREQUAL "x86_64" AND TARGET_CPU STREQUAL "x86") - SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -m32 -march=i686") + ADD_PLATFORM_FLAGS("-m32 -march=i686") ENDIF(HOST_CPU STREQUAL "x86_64" AND TARGET_CPU STREQUAL "x86") IF(HOST_CPU STREQUAL "x86" AND TARGET_CPU STREQUAL "x86_64") - SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -m64") + ADD_PLATFORM_FLAGS("-m64") ENDIF(HOST_CPU STREQUAL "x86" AND TARGET_CPU STREQUAL "x86_64") ENDIF(APPLE) - SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -D_REENTRANT -pipe -ftemplate-depth-48 -Wall -W -Wpointer-arith -Wsign-compare -Wno-deprecated-declarations -Wno-multichar -Wno-unused -fno-strict-aliasing") - - IF(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") - SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -ansi") - ENDIF(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") + ADD_PLATFORM_FLAGS("-D_REENTRANT -pipe -fno-strict-aliasing") IF(WITH_COVERAGE) - SET(PLATFORM_CFLAGS "-fprofile-arcs -ftest-coverage ${PLATFORM_CFLAGS}") + ADD_PLATFORM_FLAGS("-fprofile-arcs -ftest-coverage") ENDIF(WITH_COVERAGE) + IF(WITH_WARNINGS) + ADD_PLATFORM_FLAGS("-Wall -W -Wpointer-arith -Wsign-compare -Wno-deprecated-declarations -Wno-multichar -Wno-unused") + IF(CLANG) + ADD_PLATFORM_FLAGS("-std=gnu99") + ELSE(CLANG) + ADD_PLATFORM_FLAGS("-ansi") + ENDIF(CLANG) + ENDIF(WITH_WARNINGS) + + IF(ANDROID) + ADD_PLATFORM_FLAGS("--sysroot=${PLATFORM_ROOT}") + ADD_PLATFORM_FLAGS("-ffunction-sections -funwind-tables") + ADD_PLATFORM_FLAGS("-DANDROID") + ADD_PLATFORM_FLAGS("-Wa,--noexecstack") + + IF(TARGET_ARM) + ADD_PLATFORM_FLAGS("-fpic -fstack-protector") + ADD_PLATFORM_FLAGS("-D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__") + + IF(TARGET_ARMV7) + ADD_PLATFORM_FLAGS("-march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16") + SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -march=armv7-a -Wl,--fix-cortex-a8") + ELSEIF(TARGET_ARMV5) + ADD_PLATFORM_FLAGS("-march=armv5te -mtune=xscale -msoft-float") + ENDIF(TARGET_ARMV7) + + SET(TARGET_THUMB ON) + IF(TARGET_THUMB) + ADD_PLATFORM_FLAGS("-mthumb -fno-strict-aliasing -finline-limit=64") + SET(DEBUG_CFLAGS "${DEBUG_CFLAGS} -marm") + ELSE(TARGET_THUMB) + ADD_PLATFORM_FLAGS("-funswitch-loops -finline-limit=300") + SET(DEBUG_CFLAGS "${DEBUG_CFLAGS} -fno-strict-aliasing") + SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} -fstrict-aliasing") + ENDIF(TARGET_THUMB) + ELSEIF(TARGET_X86) + # Optimizations for Intel Atom + ADD_PLATFORM_FLAGS("-march=i686 -mtune=atom -mstackrealign -msse3 -mfpmath=sse -m32 -flto -ffast-math -funroll-loops") + ADD_PLATFORM_FLAGS("-fstack-protector -funswitch-loops -finline-limit=300") + SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} -fstrict-aliasing") + SET(DEBUG_CFLAGS "${DEBUG_CFLAGS} -fno-strict-aliasing") + ELSEIF(TARGET_MIPS) + ADD_PLATFORM_FLAGS("-fpic -finline-functions -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers -fno-strict-aliasing") + SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} -funswitch-loops -finline-limit=300") + ENDIF(TARGET_ARM) + SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now") + SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -L${PLATFORM_ROOT}/usr/lib") + ENDIF(ANDROID) + IF(APPLE) - SET(PLATFORM_CFLAGS "-gdwarf-2 ${PLATFORM_CFLAGS}") + ADD_PLATFORM_FLAGS("-gdwarf-2") ENDIF(APPLE) - IF(APPLE AND XCODE) -# SET(CMAKE_OSX_SYSROOT "macosx" CACHE PATH "" FORCE) - ELSEIF(APPLE AND NOT XCODE) - IF(NOT CMAKE_OSX_DEPLOYMENT_TARGET) - SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.6") - ENDIF(NOT CMAKE_OSX_DEPLOYMENT_TARGET) - - FOREACH(_SDK ${_CMAKE_OSX_SDKS}) - IF(${_SDK} MATCHES "MacOSX${CMAKE_OSX_DEPLOYMENT_TARGET}\\.sdk") - SET(CMAKE_OSX_SYSROOT ${_SDK} CACHE PATH "" FORCE) - ENDIF(${_SDK} MATCHES "MacOSX${CMAKE_OSX_DEPLOYMENT_TARGET}\\.sdk") - ENDFOREACH(_SDK) - - IF(CMAKE_OSX_SYSROOT) - SET(PLATFORM_CFLAGS "-isysroot ${CMAKE_OSX_SYSROOT} ${PLATFORM_CFLAGS}") - ELSE(CMAKE_OSX_SYSROOT) - MESSAGE(FATAL_ERROR "CMAKE_OSX_SYSROOT can't be determinated") - ENDIF(CMAKE_OSX_SYSROOT) - - IF(CMAKE_OSX_ARCHITECTURES) - FOREACH(_ARCH ${CMAKE_OSX_ARCHITECTURES}) - SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -arch ${_ARCH}") - ENDFOREACH(_ARCH) - ENDIF(CMAKE_OSX_ARCHITECTURES) - IF(CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG) - SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}") - ENDIF(CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG) - - SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-headerpad_max_install_names") - - IF(HAVE_FLAG_SEARCH_PATHS_FIRST) - SET(PLATFORM_LINKFLAGS "-Wl,-search_paths_first ${PLATFORM_LINKFLAGS}") - ENDIF(HAVE_FLAG_SEARCH_PATHS_FIRST) - ENDIF(APPLE AND XCODE) - # Fix "relocation R_X86_64_32 against.." error on x64 platforms IF(TARGET_X64 AND WITH_STATIC AND NOT WITH_STATIC_DRIVERS) - SET(PLATFORM_CFLAGS "-fPIC ${PLATFORM_CFLAGS}") + ADD_PLATFORM_FLAGS("-fPIC") ENDIF(TARGET_X64 AND WITH_STATIC AND NOT WITH_STATIC_DRIVERS) - SET(PLATFORM_CXXFLAGS ${PLATFORM_CFLAGS}) + SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} -ftemplate-depth-48") IF(NOT APPLE) SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,--no-undefined -Wl,--as-needed") @@ -612,125 +927,146 @@ MACRO(NL_SETUP_BUILD_FLAGS) SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${PLATFORM_LINKFLAGS} ${NL_RELEASE_LINKFLAGS}" CACHE STRING "" FORCE) ENDMACRO(NL_SETUP_BUILD_FLAGS) +# Macro to create x_ABSOLUTE_PREFIX from x_PREFIX +MACRO(NL_MAKE_ABSOLUTE_PREFIX NAME_RELATIVE NAME_ABSOLUTE) + IF(IS_ABSOLUTE "${${NAME_RELATIVE}}") + SET(${NAME_ABSOLUTE} ${${NAME_RELATIVE}}) + ELSE(IS_ABSOLUTE "${${NAME_RELATIVE}}") + IF(WIN32) + SET(${NAME_ABSOLUTE} ${${NAME_RELATIVE}}) + ELSE(WIN32) + SET(${NAME_ABSOLUTE} ${CMAKE_INSTALL_PREFIX}/${${NAME_RELATIVE}}) + ENDIF(WIN32) + ENDIF(IS_ABSOLUTE "${${NAME_RELATIVE}}") +ENDMACRO(NL_MAKE_ABSOLUTE_PREFIX) + MACRO(NL_SETUP_PREFIX_PATHS) ## Allow override of install_prefix/etc path. IF(NOT NL_ETC_PREFIX) IF(WIN32) - SET(NL_ETC_PREFIX "../etc/nel" CACHE PATH "Installation path for configurations") + SET(NL_ETC_PREFIX "." CACHE PATH "Installation path for configurations") ELSE(WIN32) - SET(NL_ETC_PREFIX "${CMAKE_INSTALL_PREFIX}/etc/nel" CACHE PATH "Installation path for configurations") + SET(NL_ETC_PREFIX "etc/nel" CACHE PATH "Installation path for configurations") ENDIF(WIN32) ENDIF(NOT NL_ETC_PREFIX) + NL_MAKE_ABSOLUTE_PREFIX(NL_ETC_PREFIX NL_ETC_ABSOLUTE_PREFIX) ## Allow override of install_prefix/share path. IF(NOT NL_SHARE_PREFIX) IF(WIN32) - SET(NL_SHARE_PREFIX "../share/nel" CACHE PATH "Installation path for data.") + SET(NL_SHARE_PREFIX "." CACHE PATH "Installation path for data.") ELSE(WIN32) - SET(NL_SHARE_PREFIX "${CMAKE_INSTALL_PREFIX}/share/nel" CACHE PATH "Installation path for data.") + SET(NL_SHARE_PREFIX "share/nel" CACHE PATH "Installation path for data.") ENDIF(WIN32) ENDIF(NOT NL_SHARE_PREFIX) + NL_MAKE_ABSOLUTE_PREFIX(NL_SHARE_PREFIX NL_SHARE_ABSOLUTE_PREFIX) ## Allow override of install_prefix/sbin path. IF(NOT NL_SBIN_PREFIX) IF(WIN32) - SET(NL_SBIN_PREFIX "../sbin" CACHE PATH "Installation path for admin tools and services.") + SET(NL_SBIN_PREFIX "." CACHE PATH "Installation path for admin tools and services.") ELSE(WIN32) - SET(NL_SBIN_PREFIX "${CMAKE_INSTALL_PREFIX}/sbin" CACHE PATH "Installation path for admin tools and services.") + SET(NL_SBIN_PREFIX "sbin" CACHE PATH "Installation path for admin tools and services.") ENDIF(WIN32) ENDIF(NOT NL_SBIN_PREFIX) + NL_MAKE_ABSOLUTE_PREFIX(NL_SBIN_PREFIX NL_SBIN_ABSOLUTE_PREFIX) ## Allow override of install_prefix/bin path. IF(NOT NL_BIN_PREFIX) IF(WIN32) - SET(NL_BIN_PREFIX "../bin" CACHE PATH "Installation path for tools and applications.") + SET(NL_BIN_PREFIX "." CACHE PATH "Installation path for tools and applications.") ELSE(WIN32) - SET(NL_BIN_PREFIX "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation path for tools and applications.") + SET(NL_BIN_PREFIX "bin" CACHE PATH "Installation path for tools and applications.") ENDIF(WIN32) ENDIF(NOT NL_BIN_PREFIX) + NL_MAKE_ABSOLUTE_PREFIX(NL_BIN_PREFIX NL_BIN_ABSOLUTE_PREFIX) ## Allow override of install_prefix/lib path. IF(NOT NL_LIB_PREFIX) - IF(WIN32) - SET(NL_LIB_PREFIX "../lib" CACHE PATH "Installation path for libraries.") - ELSE(WIN32) - IF(CMAKE_LIBRARY_ARCHITECTURE) - SET(NL_LIB_PREFIX "${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_LIBRARY_ARCHITECTURE}" CACHE PATH "Installation path for libraries.") - ELSE(CMAKE_LIBRARY_ARCHITECTURE) - SET(NL_LIB_PREFIX "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation path for libraries.") - ENDIF(CMAKE_LIBRARY_ARCHITECTURE) - ENDIF(WIN32) + IF(LIBRARY_ARCHITECTURE) + SET(NL_LIB_PREFIX "lib/${LIBRARY_ARCHITECTURE}" CACHE PATH "Installation path for libraries.") + ELSE(LIBRARY_ARCHITECTURE) + SET(NL_LIB_PREFIX "lib" CACHE PATH "Installation path for libraries.") + ENDIF(LIBRARY_ARCHITECTURE) ENDIF(NOT NL_LIB_PREFIX) + NL_MAKE_ABSOLUTE_PREFIX(NL_LIB_PREFIX NL_LIB_ABSOLUTE_PREFIX) ## Allow override of install_prefix/lib path. IF(NOT NL_DRIVER_PREFIX) IF(WIN32) - SET(NL_DRIVER_PREFIX "../lib" CACHE PATH "Installation path for drivers.") + SET(NL_DRIVER_PREFIX "." CACHE PATH "Installation path for drivers.") ELSE(WIN32) - IF(CMAKE_LIBRARY_ARCHITECTURE) - SET(NL_DRIVER_PREFIX "${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_LIBRARY_ARCHITECTURE}/nel" CACHE PATH "Installation path for drivers.") - ELSE(CMAKE_LIBRARY_ARCHITECTURE) - SET(NL_DRIVER_PREFIX "${CMAKE_INSTALL_PREFIX}/lib/nel" CACHE PATH "Installation path for drivers.") - ENDIF(CMAKE_LIBRARY_ARCHITECTURE) + IF(LIBRARY_ARCHITECTURE) + SET(NL_DRIVER_PREFIX "lib/${LIBRARY_ARCHITECTURE}/nel" CACHE PATH "Installation path for drivers.") + ELSE(LIBRARY_ARCHITECTURE) + SET(NL_DRIVER_PREFIX "lib/nel" CACHE PATH "Installation path for drivers.") + ENDIF(LIBRARY_ARCHITECTURE) ENDIF(WIN32) ENDIF(NOT NL_DRIVER_PREFIX) + NL_MAKE_ABSOLUTE_PREFIX(NL_DRIVER_PREFIX NL_DRIVER_ABSOLUTE_PREFIX) ENDMACRO(NL_SETUP_PREFIX_PATHS) MACRO(RYZOM_SETUP_PREFIX_PATHS) - ## Allow override of install_prefix path. - IF(NOT RYZOM_PREFIX) - IF(WIN32) - SET(RYZOM_PREFIX "." CACHE PATH "Installation path") - ELSE(WIN32) - SET(RYZOM_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE PATH "Installation path") - ENDIF(WIN32) - ENDIF(NOT RYZOM_PREFIX) - ## Allow override of install_prefix/etc path. IF(NOT RYZOM_ETC_PREFIX) IF(WIN32) SET(RYZOM_ETC_PREFIX "." CACHE PATH "Installation path for configurations") ELSE(WIN32) - SET(RYZOM_ETC_PREFIX "${RYZOM_PREFIX}/etc/ryzom" CACHE PATH "Installation path for configurations") + SET(RYZOM_ETC_PREFIX "etc/ryzom" CACHE PATH "Installation path for configurations") ENDIF(WIN32) ENDIF(NOT RYZOM_ETC_PREFIX) + NL_MAKE_ABSOLUTE_PREFIX(RYZOM_ETC_PREFIX RYZOM_ETC_ABSOLUTE_PREFIX) ## Allow override of install_prefix/share path. IF(NOT RYZOM_SHARE_PREFIX) IF(WIN32) SET(RYZOM_SHARE_PREFIX "." CACHE PATH "Installation path for data.") ELSE(WIN32) - SET(RYZOM_SHARE_PREFIX "${RYZOM_PREFIX}/share/ryzom" CACHE PATH "Installation path for data.") + SET(RYZOM_SHARE_PREFIX "share/ryzom" CACHE PATH "Installation path for data.") ENDIF(WIN32) ENDIF(NOT RYZOM_SHARE_PREFIX) + NL_MAKE_ABSOLUTE_PREFIX(RYZOM_SHARE_PREFIX RYZOM_SHARE_ABSOLUTE_PREFIX) ## Allow override of install_prefix/sbin path. IF(NOT RYZOM_SBIN_PREFIX) IF(WIN32) SET(RYZOM_SBIN_PREFIX "." CACHE PATH "Installation path for admin tools and services.") ELSE(WIN32) - SET(RYZOM_SBIN_PREFIX "${RYZOM_PREFIX}/sbin" CACHE PATH "Installation path for admin tools and services.") + SET(RYZOM_SBIN_PREFIX "sbin" CACHE PATH "Installation path for admin tools and services.") ENDIF(WIN32) ENDIF(NOT RYZOM_SBIN_PREFIX) + NL_MAKE_ABSOLUTE_PREFIX(RYZOM_SBIN_PREFIX RYZOM_SBIN_ABSOLUTE_PREFIX) ## Allow override of install_prefix/bin path. IF(NOT RYZOM_BIN_PREFIX) IF(WIN32) SET(RYZOM_BIN_PREFIX "." CACHE PATH "Installation path for tools and applications.") ELSE(WIN32) - SET(RYZOM_BIN_PREFIX "${RYZOM_PREFIX}/bin" CACHE PATH "Installation path for tools.") + SET(RYZOM_BIN_PREFIX "bin" CACHE PATH "Installation path for tools.") ENDIF(WIN32) ENDIF(NOT RYZOM_BIN_PREFIX) + NL_MAKE_ABSOLUTE_PREFIX(RYZOM_BIN_PREFIX RYZOM_BIN_ABSOLUTE_PREFIX) + + ## Allow override of install_prefix/lib path. + IF(NOT RYZOM_LIB_PREFIX) + IF(LIBRARY_ARCHITECTURE) + SET(RYZOM_LIB_PREFIX "lib/${LIBRARY_ARCHITECTURE}" CACHE PATH "Installation path for libraries.") + ELSE(LIBRARY_ARCHITECTURE) + SET(RYZOM_LIB_PREFIX "lib" CACHE PATH "Installation path for libraries.") + ENDIF(LIBRARY_ARCHITECTURE) + ENDIF(NOT RYZOM_LIB_PREFIX) + NL_MAKE_ABSOLUTE_PREFIX(RYZOM_LIB_PREFIX RYZOM_LIB_ABSOLUTE_PREFIX) ## Allow override of install_prefix/games path. IF(NOT RYZOM_GAMES_PREFIX) IF(WIN32) SET(RYZOM_GAMES_PREFIX "." CACHE PATH "Installation path for tools and applications.") ELSE(WIN32) - SET(RYZOM_GAMES_PREFIX "${RYZOM_PREFIX}/games" CACHE PATH "Installation path for client.") + SET(RYZOM_GAMES_PREFIX "games" CACHE PATH "Installation path for client.") ENDIF(WIN32) ENDIF(NOT RYZOM_GAMES_PREFIX) + NL_MAKE_ABSOLUTE_PREFIX(RYZOM_GAMES_PREFIX RYZOM_GAMES_ABSOLUTE_PREFIX) ENDMACRO(RYZOM_SETUP_PREFIX_PATHS) @@ -742,11 +1078,41 @@ MACRO(SETUP_EXTERNAL) IF(WIN32) FIND_PACKAGE(External REQUIRED) - IF(MSVC10) - IF(NOT MSVC10_REDIST_DIR) + IF(NOT VC_DIR) + SET(VC_DIR $ENV{VC_DIR}) + ENDIF(NOT VC_DIR) + + IF(MSVC11) + IF(NOT MSVC_REDIST_DIR) + # If you have VC++ 2012 Express, put x64/Microsoft.VC110.CRT/*.dll in ${EXTERNAL_PATH}/redist + SET(MSVC_REDIST_DIR "${EXTERNAL_PATH}/redist") + ENDIF(NOT MSVC_REDIST_DIR) + + IF(NOT VC_DIR) + IF(NOT VC_ROOT_DIR) + GET_FILENAME_COMPONENT(VC_ROOT_DIR "[HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\11.0_Config;InstallDir]" ABSOLUTE) + # VC_ROOT_DIR is set to "registry" when a key is not found + IF(VC_ROOT_DIR MATCHES "registry") + GET_FILENAME_COMPONENT(VC_ROOT_DIR "[HKEY_CURRENT_USER\\Software\\Microsoft\\WDExpress\\11.0_Config\\Setup\\VC;InstallDir]" ABSOLUTE) + IF(VC_ROOT_DIR MATCHES "registry") + SET(VS110COMNTOOLS $ENV{VS110COMNTOOLS}) + IF(VS110COMNTOOLS) + FILE(TO_CMAKE_PATH ${VS110COMNTOOLS} VC_ROOT_DIR) + ENDIF(VS110COMNTOOLS) + IF(NOT VC_ROOT_DIR) + MESSAGE(FATAL_ERROR "Unable to find VC++ 2012 directory!") + ENDIF(NOT VC_ROOT_DIR) + ENDIF(VC_ROOT_DIR MATCHES "registry") + ENDIF(VC_ROOT_DIR MATCHES "registry") + ENDIF(NOT VC_ROOT_DIR) + # convert IDE fullpath to VC++ path + STRING(REGEX REPLACE "Common7/.*" "VC" VC_DIR ${VC_ROOT_DIR}) + ENDIF(NOT VC_DIR) + ELSEIF(MSVC10) + IF(NOT MSVC_REDIST_DIR) # If you have VC++ 2010 Express, put x64/Microsoft.VC100.CRT/*.dll in ${EXTERNAL_PATH}/redist - SET(MSVC10_REDIST_DIR "${EXTERNAL_PATH}/redist") - ENDIF(NOT MSVC10_REDIST_DIR) + SET(MSVC_REDIST_DIR "${EXTERNAL_PATH}/redist") + ENDIF(NOT MSVC_REDIST_DIR) IF(NOT VC_DIR) IF(NOT VC_ROOT_DIR) @@ -755,7 +1121,10 @@ MACRO(SETUP_EXTERNAL) IF(VC_ROOT_DIR MATCHES "registry") GET_FILENAME_COMPONENT(VC_ROOT_DIR "[HKEY_CURRENT_USER\\Software\\Microsoft\\VCExpress\\10.0_Config;InstallDir]" ABSOLUTE) IF(VC_ROOT_DIR MATCHES "registry") - FILE(TO_CMAKE_PATH $ENV{VS100COMNTOOLS} VC_ROOT_DIR) + SET(VS100COMNTOOLS $ENV{VS100COMNTOOLS}) + IF(VS100COMNTOOLS) + FILE(TO_CMAKE_PATH ${VS100COMNTOOLS} VC_ROOT_DIR) + ENDIF(VS100COMNTOOLS) IF(NOT VC_ROOT_DIR) MESSAGE(FATAL_ERROR "Unable to find VC++ 2010 directory!") ENDIF(NOT VC_ROOT_DIR) @@ -765,7 +1134,7 @@ MACRO(SETUP_EXTERNAL) # convert IDE fullpath to VC++ path STRING(REGEX REPLACE "Common7/.*" "VC" VC_DIR ${VC_ROOT_DIR}) ENDIF(NOT VC_DIR) - ELSE(MSVC10) + ELSE(MSVC11) IF(NOT VC_DIR) IF(${CMAKE_MAKE_PROGRAM} MATCHES "Common7") # convert IDE fullpath to VC++ path @@ -775,7 +1144,7 @@ MACRO(SETUP_EXTERNAL) STRING(REGEX REPLACE "VC/bin/.+" "VC" VC_DIR ${CMAKE_CXX_COMPILER}) ENDIF(${CMAKE_MAKE_PROGRAM} MATCHES "Common7") ENDIF(NOT VC_DIR) - ENDIF(MSVC10) + ENDIF(MSVC11) ELSE(WIN32) IF(APPLE) IF(WITH_STATIC_EXTERNAL) @@ -800,7 +1169,7 @@ MACRO(SETUP_EXTERNAL) FIND_PACKAGE(WindowsSDK REQUIRED) # use VC++ and Windows SDK include paths - INCLUDE_DIRECTORIES(${VC_INCLUDE_DIR} ${WINSDK_INCLUDE_DIR}) + INCLUDE_DIRECTORIES(${VC_INCLUDE_DIR} ${WINSDK_INCLUDE_DIRS}) ENDIF(MSVC) ENDIF(WITH_STLPORT) ENDMACRO(SETUP_EXTERNAL) diff --git a/code/config.h.cmake b/code/config.h.cmake index 2f2ff8095..d3c9f701d 100644 --- a/code/config.h.cmake +++ b/code/config.h.cmake @@ -43,15 +43,14 @@ #cmakedefine NL_DSOUND_AVAILABLE ${NL_DSOUND_AVAILABLE} #cmakedefine NL_XAUDIO2_AVAILABLE ${NL_XAUDIO2_AVAILABLE} -#cmakedefine NL_BIN_PREFIX "${NL_BIN_PREFIX}" -#cmakedefine NL_ETC_PREFIX "${NL_ETC_PREFIX}" -#cmakedefine NL_SHARE_PREFIX "${NL_SHARE_PREFIX}" -#cmakedefine NL_LIB_PREFIX "${NL_LIB_PREFIX}" -#cmakedefine NL_DRIVER_PREFIX "${NL_DRIVER_PREFIX}" +#cmakedefine NL_BIN_PREFIX "${NL_BIN_ABSOLUTE_PREFIX}" +#cmakedefine NL_ETC_PREFIX "${NL_ETC_ABSOLUTE_PREFIX}" +#cmakedefine NL_SHARE_PREFIX "${NL_SHARE_ABSOLUTE_PREFIX}" +#cmakedefine NL_LIB_PREFIX "${NL_LIB_ABSOLUTE_PREFIX}" +#cmakedefine NL_DRIVER_PREFIX "${NL_DRIVER_ABSOLUTE_PREFIX}" -#cmakedefine RYZOM_PREFIX "${RYZOM_PREFIX}" -#cmakedefine RYZOM_BIN_PREFIX "${RYZOM_BIN_PREFIX}" -#cmakedefine RYZOM_ETC_PREFIX "${RYZOM_ETC_PREFIX}" -#cmakedefine RYZOM_SHARE_PREFIX "${RYZOM_SHARE_PREFIX}" +#cmakedefine RYZOM_BIN_PREFIX "${RYZOM_BIN_ABSOLUTE_PREFIX}" +#cmakedefine RYZOM_ETC_PREFIX "${RYZOM_ETC_ABSOLUTE_PREFIX}" +#cmakedefine RYZOM_SHARE_PREFIX "${RYZOM_SHARE_ABSOLUTE_PREFIX}" #endif // CONFIG_H diff --git a/code/nel/CMakeLists.txt b/code/nel/CMakeLists.txt index 08b4babf0..745278cd7 100644 --- a/code/nel/CMakeLists.txt +++ b/code/nel/CMakeLists.txt @@ -44,8 +44,8 @@ ENDIF(WITH_GTK) IF(WITH_INSTALL_LIBRARIES) IF(UNIX) SET(prefix ${CMAKE_INSTALL_PREFIX}) - SET(exec_prefix ${CMAKE_INSTALL_PREFIX}/bin) - SET(libdir ${CMAKE_INSTALL_PREFIX}/lib) + SET(exec_prefix ${NL_BIN_ABSOLUTE_PREFIX}) + SET(libdir ${NL_LIB_ABSOLUTE_PREFIX}) SET(includedir ${CMAKE_INSTALL_PREFIX}/include) SET(enable_ligo ${WITH_LIGO}) SET(enable_logic ${WITH_LOGIC}) @@ -56,7 +56,7 @@ IF(WITH_INSTALL_LIBRARIES) SET(enable_sound ${WITH_SOUND}) CONFIGURE_FILE(nel-config.in ${CMAKE_CURRENT_BINARY_DIR}/nel-config) - INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/nel-config DESTINATION bin) + INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/nel-config DESTINATION ${NL_BIN_PREFIX}) ENDIF(UNIX) ADD_SUBDIRECTORY(include) diff --git a/code/nel/include/nel/3d/driver.h b/code/nel/include/nel/3d/driver.h index 630cbcb01..d090d77da 100644 --- a/code/nel/include/nel/3d/driver.h +++ b/code/nel/include/nel/3d/driver.h @@ -293,6 +293,11 @@ public: */ virtual void forceDXTCCompression(bool dxtcComp)=0; + /** if different from 0, enable anisotropic filter on textures. -1 enables max value. + * Default is 0. + */ + virtual void setAnisotropicFilter(sint filter)=0; + /** if !=1, force mostly all the textures (but TextureFonts lightmaps, interfaces etc..) * to be divided by Divisor (2, 4, 8...) * Default is 1. diff --git a/code/nel/include/nel/3d/driver_user.h b/code/nel/include/nel/3d/driver_user.h index a7f6ac7a5..bfe4c1755 100644 --- a/code/nel/include/nel/3d/driver_user.h +++ b/code/nel/include/nel/3d/driver_user.h @@ -471,6 +471,7 @@ public: virtual void delete3dMouseListener (U3dMouseListener *listener); virtual TPolygonMode getPolygonMode (); virtual void forceDXTCCompression(bool dxtcComp); + virtual void setAnisotropicFilter(sint filter); virtual void forceTextureResize(uint divisor); virtual void forceNativeFragmentPrograms(bool nativeOnly); virtual bool setMonitorColorProperties (const CMonitorColorProperties &properties); diff --git a/code/nel/include/nel/3d/landscape_def.h b/code/nel/include/nel/3d/landscape_def.h index 783846d12..ce90c5b4a 100644 --- a/code/nel/include/nel/3d/landscape_def.h +++ b/code/nel/include/nel/3d/landscape_def.h @@ -158,7 +158,7 @@ public: // *************************************************************************** -// Out of CLandscapeGlobals, because myabe used in __asm{} +// Out of CLandscapeGlobals, because maybe used in __asm{} extern uint NL3D_LandscapeGlobals_PassNTri; extern void *NL3D_LandscapeGlobals_PassTriCurPtr; extern CIndexBuffer::TFormat NL3D_LandscapeGlobals_PassTriFormat; diff --git a/code/nel/include/nel/3d/u_driver.h b/code/nel/include/nel/3d/u_driver.h index 9b9eac656..d66a72e47 100644 --- a/code/nel/include/nel/3d/u_driver.h +++ b/code/nel/include/nel/3d/u_driver.h @@ -660,6 +660,11 @@ public: */ virtual void forceDXTCCompression(bool dxtcComp)=0; + /** if different from 0, enable anisotropic filter on textures. -1 enables max value. + * Default is 0. + */ + virtual void setAnisotropicFilter(sint filter)=0; + /** if !=1, force mostly all the textures (but TextureFonts lightmaps, interfaces etc..) * to be divided by Divisor (2, 4, 8...) * Default is 1. diff --git a/code/nel/include/nel/georges/header.h b/code/nel/include/nel/georges/header.h index 769cc0568..3733f0707 100644 --- a/code/nel/include/nel/georges/header.h +++ b/code/nel/include/nel/georges/header.h @@ -19,6 +19,9 @@ #include "nel/misc/types_nl.h" +// Include from libxml2 +#include + namespace NLGEORGES { diff --git a/code/nel/include/nel/misc/big_file.h b/code/nel/include/nel/misc/big_file.h index 3043295a2..4c11b01b0 100644 --- a/code/nel/include/nel/misc/big_file.h +++ b/code/nel/include/nel/misc/big_file.h @@ -19,6 +19,7 @@ #include "types_nl.h" #include "tds.h" +#include "singleton.h" namespace NLMISC { diff --git a/code/nel/include/nel/misc/bitmap.h b/code/nel/include/nel/misc/bitmap.h index f3d532311..0b6940629 100644 --- a/code/nel/include/nel/misc/bitmap.h +++ b/code/nel/include/nel/misc/bitmap.h @@ -297,8 +297,8 @@ public: void swap(CBitmap &other); /** - * Read a bitmap(TGA or DDS) from an IStream. - * Bitmap supported are DDS (DXTC1, DXTC1 with Alpha, DXTC3, DXTC5, and + * Read a bitmap(TGA, JPEG, PNG or DDS) from an IStream. + * Bitmap supported are DDS (DXTC1, DXTC1 with Alpha, DXTC3, DXTC5), PNG, JPEG and * uncompressed TGA (24 and 32 bits). * \param IStream The stream must be in reading mode. * \param mipMapSkip if the file is a DDS with mipMap. N=mipMapSkip mipmaps are skipped. @@ -310,7 +310,7 @@ public: /** * Determinate the bitmap size from a bitmap(TGA or DDS) from an IStream. load just header of the file. - * Bitmap supported are DDS (DXTC1, DXTC1 with Alpha, DXTC3, DXTC5, and + * Bitmap supported are DDS (DXTC1, DXTC1 with Alpha, DXTC3, DXTC5), PNG, JPEG and * uncompressed TGA (24 and 32 bits). * NB: at the end, f is seeked to begin. * \param IStream The stream must be in reading mode. diff --git a/code/nel/include/nel/misc/contiguous_block_allocator.h b/code/nel/include/nel/misc/contiguous_block_allocator.h index 2cdeeade9..7a15d296d 100644 --- a/code/nel/include/nel/misc/contiguous_block_allocator.h +++ b/code/nel/include/nel/misc/contiguous_block_allocator.h @@ -17,6 +17,7 @@ #ifndef NL_CONTIGUOUS_BLOCK_ALLOCATOR_H #define NL_CONTIGUOUS_BLOCK_ALLOCATOR_H +#include "types_nl.h" namespace NLMISC { diff --git a/code/nel/include/nel/misc/debug.h b/code/nel/include/nel/misc/debug.h index dcd9fe68d..8d469b133 100644 --- a/code/nel/include/nel/misc/debug.h +++ b/code/nel/include/nel/misc/debug.h @@ -17,14 +17,14 @@ #ifndef NL_DEBUG_H #define NL_DEBUG_H -#include - #include "common.h" #include "log.h" #include "mutex.h" #include "mem_displayer.h" #include "displayer.h" #include "app_context.h" + +#include #include namespace NLMISC @@ -169,7 +169,7 @@ void setCrashAlreadyReported(bool state); *\endcode */ #ifdef NL_NO_DEBUG -# if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) +# if defined(NL_COMP_VC) && NL_COMP_VC_VERSION >= 71 # define nldebug __noop # else # define nldebug 0&& @@ -184,7 +184,7 @@ void setCrashAlreadyReported(bool state); * Same as nldebug but it will be display in debug and in release mode. */ #ifdef NL_NO_DEBUG -# if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) +# if defined(NL_COMP_VC) && NL_COMP_VC_VERSION >= 71 # define nlinfo __noop # else # define nlinfo 0&& @@ -212,7 +212,7 @@ void setCrashAlreadyReported(bool state); */ #ifdef NL_NO_DEBUG -# if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) +# if defined(NL_COMP_VC) && NL_COMP_VC_VERSION >= 71 # define nlwarning __noop # else # define nlwarning 0&& diff --git a/code/nel/include/nel/misc/eval_num_expr.h b/code/nel/include/nel/misc/eval_num_expr.h index 18cb14725..8551e49df 100644 --- a/code/nel/include/nel/misc/eval_num_expr.h +++ b/code/nel/include/nel/misc/eval_num_expr.h @@ -241,7 +241,7 @@ private: LogicalXor, // ^^ OperatorCount, // NotOperator, // This is not an operator - ExtOperator, // This is a 2 charcters operator + ExtOperator, // This is a 2 characters operator }; // Functions diff --git a/code/nel/include/nel/misc/file.h b/code/nel/include/nel/misc/file.h index 51d9d6cbc..17154e6be 100644 --- a/code/nel/include/nel/misc/file.h +++ b/code/nel/include/nel/misc/file.h @@ -17,6 +17,7 @@ #ifndef NL_FILE_H #define NL_FILE_H +#include "types_nl.h" #include "stream.h" diff --git a/code/nel/include/nel/misc/fixed_size_allocator.h b/code/nel/include/nel/misc/fixed_size_allocator.h index 02e4573a2..9eb1d8a10 100644 --- a/code/nel/include/nel/misc/fixed_size_allocator.h +++ b/code/nel/include/nel/misc/fixed_size_allocator.h @@ -17,6 +17,7 @@ #ifndef NL_FIXED_SIZE_ALLOCATOR_H #define NL_FIXED_SIZE_ALLOCATOR_H +#include "types_nl.h" namespace NLMISC { diff --git a/code/nel/include/nel/misc/grid_traversal.h b/code/nel/include/nel/misc/grid_traversal.h index 2e3f76a1e..893b3978a 100644 --- a/code/nel/include/nel/misc/grid_traversal.h +++ b/code/nel/include/nel/misc/grid_traversal.h @@ -17,6 +17,8 @@ #ifndef _GRID_TRAVERSAL_H #define _GRID_TRAVERSAL_H +#include "types_nl.h" + namespace NLMISC { diff --git a/code/nel/include/nel/misc/input_device_manager.h b/code/nel/include/nel/misc/input_device_manager.h index bb5e01e87..a23437696 100644 --- a/code/nel/include/nel/misc/input_device_manager.h +++ b/code/nel/include/nel/misc/input_device_manager.h @@ -19,7 +19,7 @@ #include "types_nl.h" #include "game_device.h" - +#include "common.h" namespace NLMISC { diff --git a/code/nel/include/nel/misc/inter_window_msg_queue.h b/code/nel/include/nel/misc/inter_window_msg_queue.h index 90fb720b4..f65767bce 100644 --- a/code/nel/include/nel/misc/inter_window_msg_queue.h +++ b/code/nel/include/nel/misc/inter_window_msg_queue.h @@ -17,6 +17,7 @@ #ifndef RY_INTER_WINDOW_MSG_QUEUE_H #define RY_INTER_WINDOW_MSG_QUEUE_H +#include "types_nl.h" #ifdef NL_OS_WINDOWS diff --git a/code/nel/include/nel/misc/mutex.h b/code/nel/include/nel/misc/mutex.h index 7659d05e6..adbc7e7e5 100644 --- a/code/nel/include/nel/misc/mutex.h +++ b/code/nel/include/nel/misc/mutex.h @@ -586,7 +586,7 @@ extern uint32 NbMutexes; /** - * This class ensure that the Value is accessed by only one thread. First you have to create a CSynchronized class with you type. + * This class ensure that the Value is accessed by only one thread. First you have to create a CSynchronized class with your type. * Then, if a thread want to modify or do anything on it, you create a CAccessor in a \b sub \b scope. You can modify the value * of the CUnfairSynchronized using the value() function \b until the end of the scope. So you have to put the smaller scope as you can. * diff --git a/code/nel/include/nel/misc/object_arena_allocator.h b/code/nel/include/nel/misc/object_arena_allocator.h index 6370b9834..6d318aca8 100644 --- a/code/nel/include/nel/misc/object_arena_allocator.h +++ b/code/nel/include/nel/misc/object_arena_allocator.h @@ -17,6 +17,7 @@ #ifndef NL_OBJECT_ARENA_ALLOCATOR_H #define NL_OBJECT_ARENA_ALLOCATOR_H +#include "types_nl.h" #include "singleton.h" namespace NLMISC diff --git a/code/nel/include/nel/misc/p_thread.h b/code/nel/include/nel/misc/p_thread.h index 0ef221760..4f0a9aa63 100644 --- a/code/nel/include/nel/misc/p_thread.h +++ b/code/nel/include/nel/misc/p_thread.h @@ -17,9 +17,10 @@ #ifndef NL_P_THREAD_H #define NL_P_THREAD_H +#include "types_nl.h" + #ifdef NL_OS_UNIX -#include "types_nl.h" #include "thread.h" #include diff --git a/code/nel/include/nel/misc/path.h b/code/nel/include/nel/misc/path.h index 2ac69c4e7..73652a581 100644 --- a/code/nel/include/nel/misc/path.h +++ b/code/nel/include/nel/misc/path.h @@ -19,14 +19,13 @@ #include "types_nl.h" #include "time_nl.h" +#include "common.h" +#include "string_mapper.h" #include #include #include -#include "common.h" -#include "string_mapper.h" - namespace NLMISC { /// Exception throw when a find is not found in a lookup() call diff --git a/code/nel/include/nel/misc/polygon.h b/code/nel/include/nel/misc/polygon.h index 9be40c189..a0183d20d 100644 --- a/code/nel/include/nel/misc/polygon.h +++ b/code/nel/include/nel/misc/polygon.h @@ -21,6 +21,7 @@ #include "matrix.h" #include "stream.h" #include "vector_2f.h" + #include diff --git a/code/nel/include/nel/misc/pool_memory.h b/code/nel/include/nel/misc/pool_memory.h index 05103a569..def4125dc 100644 --- a/code/nel/include/nel/misc/pool_memory.h +++ b/code/nel/include/nel/misc/pool_memory.h @@ -18,6 +18,7 @@ #define NL_POOL_MEMORY_H #include "types_nl.h" + #include #include diff --git a/code/nel/include/nel/misc/quat.h b/code/nel/include/nel/misc/quat.h index 73e6a43d3..3e8a70d5c 100644 --- a/code/nel/include/nel/misc/quat.h +++ b/code/nel/include/nel/misc/quat.h @@ -20,6 +20,7 @@ #include "types_nl.h" #include "vector.h" #include "stream.h" + #include namespace NLMISC diff --git a/code/nel/include/nel/misc/resource_ptr_inline.h b/code/nel/include/nel/misc/resource_ptr_inline.h index fde8da963..b287e9b18 100644 --- a/code/nel/include/nel/misc/resource_ptr_inline.h +++ b/code/nel/include/nel/misc/resource_ptr_inline.h @@ -18,6 +18,8 @@ #ifndef NL_RESOURCE_PTR_INLINE_H #define NL_RESOURCE_PTR_INLINE_H +#include "types_nl.h" + namespace NLMISC { diff --git a/code/nel/include/nel/misc/rgba.h b/code/nel/include/nel/misc/rgba.h index 944b453d8..7eeadaf99 100644 --- a/code/nel/include/nel/misc/rgba.h +++ b/code/nel/include/nel/misc/rgba.h @@ -17,11 +17,11 @@ #ifndef NL_RGBA_H #define NL_RGBA_H -#include - #include "types_nl.h" #include "common.h" +#include + namespace NLMISC { diff --git a/code/nel/include/nel/misc/sha1.h b/code/nel/include/nel/misc/sha1.h index 6fab640d3..d4c630c22 100644 --- a/code/nel/include/nel/misc/sha1.h +++ b/code/nel/include/nel/misc/sha1.h @@ -17,11 +17,12 @@ #ifndef NL_SHA1_H #define NL_SHA1_H -#include - +#include "types_nl.h" #include "common.h" #include "stream.h" +#include + struct CHashKey { CHashKey () { HashKeyString.resize(20); } diff --git a/code/nel/include/nel/misc/smart_ptr.h b/code/nel/include/nel/misc/smart_ptr.h index f345f7f6c..2bfb57cc3 100644 --- a/code/nel/include/nel/misc/smart_ptr.h +++ b/code/nel/include/nel/misc/smart_ptr.h @@ -352,7 +352,7 @@ public: } }; -#if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) +#if defined(NL_COMP_VC) && NL_COMP_VC_VERSION >= 80 // This operator only purpose is to compare with NULL value template diff --git a/code/nel/include/nel/misc/smart_ptr_inline.h b/code/nel/include/nel/misc/smart_ptr_inline.h index 6ea1f9bd4..f6665825a 100644 --- a/code/nel/include/nel/misc/smart_ptr_inline.h +++ b/code/nel/include/nel/misc/smart_ptr_inline.h @@ -18,6 +18,8 @@ #ifndef NL_SMARTPTR_INLINE_H #define NL_SMARTPTR_INLINE_H +#include "types_nl.h" + namespace NLMISC { diff --git a/code/nel/include/nel/misc/stl_block_list.h b/code/nel/include/nel/misc/stl_block_list.h index f901e516c..ccd207187 100644 --- a/code/nel/include/nel/misc/stl_block_list.h +++ b/code/nel/include/nel/misc/stl_block_list.h @@ -19,6 +19,7 @@ #include "types_nl.h" #include "stl_block_allocator.h" + #include diff --git a/code/nel/include/nel/misc/stop_watch.h b/code/nel/include/nel/misc/stop_watch.h index a3a56d51d..b519f4c82 100644 --- a/code/nel/include/nel/misc/stop_watch.h +++ b/code/nel/include/nel/misc/stop_watch.h @@ -19,6 +19,7 @@ #include "types_nl.h" #include "time_nl.h" + #include diff --git a/code/nel/include/nel/misc/stream.h b/code/nel/include/nel/misc/stream.h index b198bc890..ad0e8ddd4 100644 --- a/code/nel/include/nel/misc/stream.h +++ b/code/nel/include/nel/misc/stream.h @@ -21,6 +21,7 @@ #include "ucstring.h" #include "class_registry.h" #include "common.h" + #include #include #include diff --git a/code/nel/include/nel/misc/stream_inline.h b/code/nel/include/nel/misc/stream_inline.h index b36d1eae7..f0b1e3603 100644 --- a/code/nel/include/nel/misc/stream_inline.h +++ b/code/nel/include/nel/misc/stream_inline.h @@ -17,10 +17,11 @@ #ifndef NL_STREAM_INLINE_H #define NL_STREAM_INLINE_H -#include - +#include "types_nl.h" #include "debug.h" +#include + namespace NLMISC { diff --git a/code/nel/include/nel/misc/string_conversion.h b/code/nel/include/nel/misc/string_conversion.h index 0b1aa5487..2c19e0a80 100644 --- a/code/nel/include/nel/misc/string_conversion.h +++ b/code/nel/include/nel/misc/string_conversion.h @@ -19,6 +19,7 @@ #include "types_nl.h" #include "common.h" + #include namespace NLMISC diff --git a/code/nel/include/nel/misc/string_id_array.h b/code/nel/include/nel/misc/string_id_array.h index c1a1739e4..9ca01695e 100644 --- a/code/nel/include/nel/misc/string_id_array.h +++ b/code/nel/include/nel/misc/string_id_array.h @@ -18,6 +18,7 @@ #define NL_STRING_ID_ARRAY_H #include "types_nl.h" +#include "debug.h" #include #include @@ -25,8 +26,6 @@ #include #include -#include "debug.h" - namespace NLMISC { diff --git a/code/nel/include/nel/misc/string_mapper.h b/code/nel/include/nel/misc/string_mapper.h index c3ae832c4..36a73ed4d 100644 --- a/code/nel/include/nel/misc/string_mapper.h +++ b/code/nel/include/nel/misc/string_mapper.h @@ -18,13 +18,12 @@ #define STRING_MAPPER_H #include "types_nl.h" +#include "stream.h" +#include "mutex.h" #include #include -#include "stream.h" -#include "mutex.h" - namespace NLMISC { diff --git a/code/nel/include/nel/misc/types_nl.h b/code/nel/include/nel/misc/types_nl.h index 40d89f879..6485960f7 100644 --- a/code/nel/include/nel/misc/types_nl.h +++ b/code/nel/include/nel/misc/types_nl.h @@ -48,32 +48,44 @@ # define NL_OS_WINDOWS # define NL_LITTLE_ENDIAN # define NL_CPU_INTEL -# ifndef _WIN32_WINNT +# ifndef _WIN32_WINNT # define _WIN32_WINNT 0x0500 // Minimal OS = Windows 2000 (NeL is not supported on Windows 95/98) -# endif -# if _MSC_VER >= 1600 -# define NL_COMP_VC10 -# elif _MSC_VER >= 1500 -# define NL_COMP_VC9 -# elif _MSC_VER >= 1400 -# define NL_COMP_VC8 -# undef nl_time -# define nl_time _time32 // use the old 32 bit time function -# undef nl_mktime -# define nl_mktime _mktime32 // use the old 32 bit time function -# undef nl_gmtime -# define nl_gmtime _gmtime32 // use the old 32 bit time function -# undef nl_localtime -# define nl_localtime _localtime32 // use the old 32 bit time function -# undef nl_difftime -# define nl_difftime _difftime32 // use the old 32 bit time function -# elif _MSC_VER >= 1310 -# define NL_COMP_VC71 -# elif _MSC_VER >= 1300 -# define NL_COMP_VC7 -# elif _MSC_VER >= 1200 -# define NL_COMP_VC6 -# define NL_COMP_NEED_PARAM_ON_METHOD +# endif +# ifdef _MSC_VER +# define NL_COMP_VC +# if _MSC_VER >= 1700 +# define NL_COMP_VC11 +# define NL_COMP_VC_VERSION 110 +# elif _MSC_VER >= 1600 +# define NL_COMP_VC10 +# define NL_COMP_VC_VERSION 100 +# elif _MSC_VER >= 1500 +# define NL_COMP_VC9 +# define NL_COMP_VC_VERSION 90 +# elif _MSC_VER >= 1400 +# define NL_COMP_VC8 +# define NL_COMP_VC_VERSION 80 +# undef nl_time +# define nl_time _time32 // use the old 32 bit time function +# undef nl_mktime +# define nl_mktime _mktime32 // use the old 32 bit time function +# undef nl_gmtime +# define nl_gmtime _gmtime32 // use the old 32 bit time function +# undef nl_localtime +# define nl_localtime _localtime32 // use the old 32 bit time function +# undef nl_difftime +# define nl_difftime _difftime32 // use the old 32 bit time function +# elif _MSC_VER >= 1310 +# define NL_COMP_VC71 +# define NL_COMP_VC_VERSION 71 +# elif _MSC_VER >= 1300 +# define NL_COMP_VC7 +# define NL_COMP_VC_VERSION 70 +# elif _MSC_VER >= 1200 +# define NL_COMP_VC6 +# define NL_COMP_VC_VERSION 60 +# define NL_COMP_NEED_PARAM_ON_METHOD +# endif # endif # if defined(_HAS_TR1) && (_HAS_TR1 + 0) // VC9 TR1 feature pack or later # define NL_ISO_STDTR1_AVAILABLE @@ -320,7 +332,7 @@ typedef unsigned int uint; // at least 32bits (depend of processor) # define CHashMap std::tr1::unordered_map # define CHashSet std::tr1::unordered_set # define CHashMultiMap std::tr1::unordered_multimap -#elif defined(NL_COMP_VC7) || defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) // VC7 through 9 +#elif defined(NL_COMP_VC) && (NL_COMP_VC_VERSION >= 70 && NL_COMP_VC_VERSION <= 90) // VC7 through 9 # include # include # define CHashMap stdext::hash_map @@ -366,7 +378,7 @@ typedef uint16 ucchar; // To define a 64bits constant; ie: UINT64_CONSTANT(0x123456781234) #ifdef NL_OS_WINDOWS -# if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) +# if defined(NL_COMP_VC) && (NL_COMP_VC_VERSION >= 80) # define INT64_CONSTANT(c) (c##LL) # define SINT64_CONSTANT(c) (c##LL) # define UINT64_CONSTANT(c) (c##LL) diff --git a/code/nel/include/nel/misc/win32_util.h b/code/nel/include/nel/misc/win32_util.h index 67fe69883..d040458c1 100644 --- a/code/nel/include/nel/misc/win32_util.h +++ b/code/nel/include/nel/misc/win32_util.h @@ -17,6 +17,7 @@ #ifndef NL_WIN32_UTIL_H #define NL_WIN32_UTIL_H +#include "types_nl.h" #ifdef NL_OS_WINDOWS diff --git a/code/nel/include/nel/net/message_recorder.h b/code/nel/include/nel/net/message_recorder.h index a7b5ac51f..5874aca4c 100644 --- a/code/nel/include/nel/net/message_recorder.h +++ b/code/nel/include/nel/net/message_recorder.h @@ -79,7 +79,7 @@ struct TMessageRecord stream.serial( s_event ); uint32 sockId; stream.serialHex( sockId ); - SockId = (NLNET::TSockId)sockId; + SockId = (NLNET::TSockId)(size_t)sockId; len = Message.length(); stream.serial( len ); stream.serialBuffer( const_cast(Message.buffer()), len ); // assumes the message contains plain text diff --git a/code/nel/src/pacs/build_indoor.h b/code/nel/include/nel/pacs/build_indoor.h similarity index 100% rename from code/nel/src/pacs/build_indoor.h rename to code/nel/include/nel/pacs/build_indoor.h diff --git a/code/nel/src/pacs/chain.h b/code/nel/include/nel/pacs/chain.h similarity index 100% rename from code/nel/src/pacs/chain.h rename to code/nel/include/nel/pacs/chain.h diff --git a/code/nel/src/pacs/chain_quad.h b/code/nel/include/nel/pacs/chain_quad.h similarity index 100% rename from code/nel/src/pacs/chain_quad.h rename to code/nel/include/nel/pacs/chain_quad.h diff --git a/code/nel/src/pacs/collision_callback.h b/code/nel/include/nel/pacs/collision_callback.h similarity index 100% rename from code/nel/src/pacs/collision_callback.h rename to code/nel/include/nel/pacs/collision_callback.h diff --git a/code/nel/src/pacs/collision_desc.h b/code/nel/include/nel/pacs/collision_desc.h similarity index 100% rename from code/nel/src/pacs/collision_desc.h rename to code/nel/include/nel/pacs/collision_desc.h diff --git a/code/nel/src/pacs/collision_mesh_build.h b/code/nel/include/nel/pacs/collision_mesh_build.h similarity index 100% rename from code/nel/src/pacs/collision_mesh_build.h rename to code/nel/include/nel/pacs/collision_mesh_build.h diff --git a/code/nel/src/pacs/collision_ot.h b/code/nel/include/nel/pacs/collision_ot.h similarity index 100% rename from code/nel/src/pacs/collision_ot.h rename to code/nel/include/nel/pacs/collision_ot.h diff --git a/code/nel/src/pacs/collision_surface_temp.h b/code/nel/include/nel/pacs/collision_surface_temp.h similarity index 100% rename from code/nel/src/pacs/collision_surface_temp.h rename to code/nel/include/nel/pacs/collision_surface_temp.h diff --git a/code/nel/src/pacs/edge_collide.h b/code/nel/include/nel/pacs/edge_collide.h similarity index 100% rename from code/nel/src/pacs/edge_collide.h rename to code/nel/include/nel/pacs/edge_collide.h diff --git a/code/nel/src/pacs/edge_quad.h b/code/nel/include/nel/pacs/edge_quad.h similarity index 100% rename from code/nel/src/pacs/edge_quad.h rename to code/nel/include/nel/pacs/edge_quad.h diff --git a/code/nel/src/pacs/exterior_mesh.h b/code/nel/include/nel/pacs/exterior_mesh.h similarity index 100% rename from code/nel/src/pacs/exterior_mesh.h rename to code/nel/include/nel/pacs/exterior_mesh.h diff --git a/code/nel/src/pacs/face_grid.h b/code/nel/include/nel/pacs/face_grid.h similarity index 100% rename from code/nel/src/pacs/face_grid.h rename to code/nel/include/nel/pacs/face_grid.h diff --git a/code/nel/src/pacs/global_retriever.h b/code/nel/include/nel/pacs/global_retriever.h similarity index 100% rename from code/nel/src/pacs/global_retriever.h rename to code/nel/include/nel/pacs/global_retriever.h diff --git a/code/nel/src/pacs/local_retriever.h b/code/nel/include/nel/pacs/local_retriever.h similarity index 100% rename from code/nel/src/pacs/local_retriever.h rename to code/nel/include/nel/pacs/local_retriever.h diff --git a/code/nel/src/pacs/move_cell.h b/code/nel/include/nel/pacs/move_cell.h similarity index 100% rename from code/nel/src/pacs/move_cell.h rename to code/nel/include/nel/pacs/move_cell.h diff --git a/code/nel/src/pacs/move_container.h b/code/nel/include/nel/pacs/move_container.h similarity index 100% rename from code/nel/src/pacs/move_container.h rename to code/nel/include/nel/pacs/move_container.h diff --git a/code/nel/src/pacs/move_container_inline.h b/code/nel/include/nel/pacs/move_container_inline.h similarity index 100% rename from code/nel/src/pacs/move_container_inline.h rename to code/nel/include/nel/pacs/move_container_inline.h diff --git a/code/nel/src/pacs/move_element.h b/code/nel/include/nel/pacs/move_element.h similarity index 100% rename from code/nel/src/pacs/move_element.h rename to code/nel/include/nel/pacs/move_element.h diff --git a/code/nel/src/pacs/move_element_inline.h b/code/nel/include/nel/pacs/move_element_inline.h similarity index 100% rename from code/nel/src/pacs/move_element_inline.h rename to code/nel/include/nel/pacs/move_element_inline.h diff --git a/code/nel/src/pacs/move_primitive.h b/code/nel/include/nel/pacs/move_primitive.h similarity index 100% rename from code/nel/src/pacs/move_primitive.h rename to code/nel/include/nel/pacs/move_primitive.h diff --git a/code/nel/src/pacs/primitive_block.h b/code/nel/include/nel/pacs/primitive_block.h similarity index 100% rename from code/nel/src/pacs/primitive_block.h rename to code/nel/include/nel/pacs/primitive_block.h diff --git a/code/nel/src/pacs/primitive_world_image.h b/code/nel/include/nel/pacs/primitive_world_image.h similarity index 100% rename from code/nel/src/pacs/primitive_world_image.h rename to code/nel/include/nel/pacs/primitive_world_image.h diff --git a/code/nel/src/pacs/quad_grid.h b/code/nel/include/nel/pacs/quad_grid.h similarity index 100% rename from code/nel/src/pacs/quad_grid.h rename to code/nel/include/nel/pacs/quad_grid.h diff --git a/code/nel/src/pacs/retrievable_surface.h b/code/nel/include/nel/pacs/retrievable_surface.h similarity index 100% rename from code/nel/src/pacs/retrievable_surface.h rename to code/nel/include/nel/pacs/retrievable_surface.h diff --git a/code/nel/src/pacs/retriever_bank.h b/code/nel/include/nel/pacs/retriever_bank.h similarity index 99% rename from code/nel/src/pacs/retriever_bank.h rename to code/nel/include/nel/pacs/retriever_bank.h index 3dacb2463..eb7afb31b 100644 --- a/code/nel/src/pacs/retriever_bank.h +++ b/code/nel/include/nel/pacs/retriever_bank.h @@ -142,7 +142,7 @@ public: for (i=0; i= D3DPS_VERSION(2, 0) || caps.PixelShaderVersion < D3DPS_VERSION(1, 4)); _NonPowerOfTwoTexturesSupported = !(caps.TextureCaps & D3DPTEXTURECAPS_POW2) || (caps.TextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL); + _MaxAnisotropy = caps.MaxAnisotropy; + _AnisotropicMinSupported = (caps.TextureFilterCaps & D3DPTFILTERCAPS_MINFANISOTROPIC) != 0; + _AnisotropicMagSupported = (caps.TextureFilterCaps & D3DPTFILTERCAPS_MAGFANISOTROPIC) != 0; + _AnisotropicMinCubeSupported = (caps.CubeTextureFilterCaps & D3DPTFILTERCAPS_MINFANISOTROPIC) != 0; + _AnisotropicMagCubeSupported = (caps.CubeTextureFilterCaps & D3DPTFILTERCAPS_MAGFANISOTROPIC) != 0; } else { @@ -1506,6 +1516,11 @@ bool CDriverD3D::setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool r _MaxVertexIndex = 0xffff; _IsGeforce = false; _NonPowerOfTwoTexturesSupported = false; + _MaxAnisotropy = 0; + _AnisotropicMinSupported = false; + _AnisotropicMagSupported = false; + _AnisotropicMinCubeSupported = false; + _AnisotropicMagCubeSupported = false; } // If 16 bits vertices only, build a vb for quads rendering if (_MaxVertexIndex <= 0xffff) @@ -1607,6 +1622,7 @@ bool CDriverD3D::setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool r // Init some variables _ForceDXTCCompression = false; + _AnisotropicFilter = 0; _ForceTextureResizePower = 0; _FogEnabled = false; @@ -2049,6 +2065,25 @@ void CDriverD3D::forceDXTCCompression(bool dxtcComp) // *************************************************************************** +void CDriverD3D::setAnisotropicFilter(sint filter) +{ + H_AUTO_D3D(CDriverD3D_setAnisotropicFilter); + + // anisotropic filter not supported + if (_MaxAnisotropy < 2) return; + + if (filter < 0 || filter > _MaxAnisotropy) + { + _AnisotropicFilter = _MaxAnisotropy; + } + else + { + _AnisotropicFilter = filter; + } +} + +// *************************************************************************** + void CDriverD3D::forceTextureResize(uint divisor) { H_AUTO_D3D(CDriverD3D_forceTextureResize); @@ -2715,6 +2750,8 @@ bool CDriverD3D::fillPresentParameter (D3DPRESENT_PARAMETERS ¶meters, D3DFOR // Choose a zbuffer format D3DFORMAT zbufferFormats[]= { + //uncomment to save zbuffer D3DFMT_D32F_LOCKABLE, + //uncomment to save zbuffer D3DFMT_D16_LOCKABLE, /*D3DFMT_D32, D3DFMT_D24X8,*/ D3DFMT_D24S8, diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d.h b/code/nel/src/3d/driver/direct3d/driver_direct3d.h index c1b05cc67..351cf10d0 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d.h +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d.h @@ -777,6 +777,7 @@ public: virtual void disableHardwareVertexArrayAGP(); virtual void disableHardwareTextureShader(); virtual void forceDXTCCompression(bool dxtcComp); + virtual void setAnisotropicFilter(sint filter); virtual void forceTextureResize(uint divisor); virtual void forceNativeFragmentPrograms(bool /* nativeOnly */) {} // ignored @@ -1521,6 +1522,7 @@ public: setSamplerState (stage, D3DSAMP_MAGFILTER, d3dtext->MagFilter); setSamplerState (stage, D3DSAMP_MINFILTER, d3dtext->MinFilter); setSamplerState (stage, D3DSAMP_MIPFILTER, d3dtext->MipFilter); + setSamplerState (stage, D3DSAMP_MAXANISOTROPY, _AnisotropicFilter); // Profile, log the use of this texture if (_SumTextureMemoryUsed) @@ -2205,6 +2207,11 @@ private: bool _CubbedMipMapSupported; bool _IsGeforce; bool _NonPowerOfTwoTexturesSupported; + uint _MaxAnisotropy; + bool _AnisotropicMinSupported; + bool _AnisotropicMagSupported; + bool _AnisotropicMinCubeSupported; + bool _AnisotropicMagCubeSupported; uint _NbNeLTextureStages; // Number of texture stage for NeL (max IDRV_MAT_MAXTEXTURES) uint _MaxVerticesByVertexBufferHard; uint _MaxLight; @@ -2411,6 +2418,7 @@ private: bool _MustRestoreLight; D3DXMATRIX _D3DMatrixIdentity; DWORD _FogColor; + uint _AnisotropicFilter; // stencil buffer bool _CurStencilTest; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp index 419027577..b9b757de1 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp @@ -355,8 +355,8 @@ bool CDriverD3D::activeShader(CShader *shd) // Assemble the shader LPD3DXBUFFER pErrorMsgs; - if (D3DXCreateEffect(_DeviceInterface, shd->getText(), (UINT)strlen(shd->getText())+1, NULL, NULL, 0, NULL, &(shaderInfo->Effect), &pErrorMsgs) - == D3D_OK) + HRESULT hr = D3DXCreateEffect(_DeviceInterface, shd->getText(), (UINT)strlen(shd->getText())+1, NULL, NULL, 0, NULL, &(shaderInfo->Effect), &pErrorMsgs); + if (hr == D3D_OK) { // Get the texture handle uint i; @@ -374,7 +374,7 @@ bool CDriverD3D::activeShader(CShader *shd) } else { - nlwarning ("Can't create shader '%s':", shd->getName()); + nlwarning ("Can't create shader '%s' (0x%x):", shd->getName(), hr); if (pErrorMsgs) nlwarning ((const char*)pErrorMsgs->GetBufferPointer()); shd->_ShaderChanged = false; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp index 2cd16bf1c..7922b30ea 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp @@ -442,7 +442,7 @@ bool CDriverD3D::generateD3DTexture (ITexture& tex, bool textureDegradation, D3D if (d3dtext->Texture == NULL) { // profiling: count TextureMemory usage. - uint32 textureMeory = computeTextureMemoryUsage (width, height, levels, destFormat, cube); + uint32 textureMemory = computeTextureMemoryUsage (width, height, levels, destFormat, cube); // Create the texture bool createSuccess; @@ -454,6 +454,7 @@ bool CDriverD3D::generateD3DTexture (ITexture& tex, bool textureDegradation, D3D } else { +/* // textures with mipmaps doesn't support not power of two sizes // only DXTC formats are beginning with a 'D' if (supportNonPowerOfTwoTextures() && (!isPowerOf2(width) || !isPowerOf2(height)) && levels == 1) @@ -464,8 +465,16 @@ bool CDriverD3D::generateD3DTexture (ITexture& tex, bool textureDegradation, D3D _DeviceInterface->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP); _DeviceInterface->SetSamplerState(0, D3DSAMP_ADDRESSW, D3DTADDRESS_CLAMP); } +*/ - createSuccess = _DeviceInterface->CreateTexture (width, height, levels, renderTarget?D3DUSAGE_RENDERTARGET:0, destFormat, renderTarget?D3DPOOL_DEFAULT:D3DPOOL_MANAGED, &(d3dtext->Texture2d), NULL) == D3D_OK; + HRESULT hr = _DeviceInterface->CreateTexture (width, height, levels, renderTarget?D3DUSAGE_RENDERTARGET:0, destFormat, renderTarget?D3DPOOL_DEFAULT:D3DPOOL_MANAGED, &(d3dtext->Texture2d), NULL); + + if (hr != D3D_OK) + { + nlwarning("CreateTexture failed with code 0x%x for texture %s in %ux%u", hr, tex.getShareName().c_str(), width, height); + } + + createSuccess = hr == D3D_OK; d3dtext->Texture = d3dtext->Texture2d; } @@ -473,7 +482,7 @@ bool CDriverD3D::generateD3DTexture (ITexture& tex, bool textureDegradation, D3D return false; // Stats - d3dtext->TextureMemory = textureMeory; + d3dtext->TextureMemory = textureMemory; _AllocatedTextureMemory += d3dtext->TextureMemory; // Copy parameters @@ -499,6 +508,19 @@ inline void CDriverD3D::setupTextureWrapMode(ITexture& tex) d3dtext->MagFilter = RemapMagTextureFilterTypeNeL2D3D[tex.getMagFilter()]; d3dtext->MinFilter = RemapMinTextureFilterTypeNeL2D3D[tex.getMinFilter()]; d3dtext->MipFilter = RemapMipTextureFilterTypeNeL2D3D[tex.getMinFilter()]; + + // only enable for min filter, because it's never supported for mag filter + if (_AnisotropicFilter > 1 && tex.getMinFilter() > ITexture::NearestMipMapLinear) + { + if (tex.isTextureCube()) + { + if (_AnisotropicMinCubeSupported) d3dtext->MinFilter = D3DTEXF_ANISOTROPIC; + } + else + { + if (_AnisotropicMinSupported) d3dtext->MinFilter = D3DTEXF_ANISOTROPIC; + } + } } diff --git a/code/nel/src/3d/driver/opengl/CMakeLists.txt b/code/nel/src/3d/driver/opengl/CMakeLists.txt index d68bef5f2..aea202e8b 100644 --- a/code/nel/src/3d/driver/opengl/CMakeLists.txt +++ b/code/nel/src/3d/driver/opengl/CMakeLists.txt @@ -27,7 +27,7 @@ ENDIF(WIN32) NL_TARGET_DRIVER(${NLDRV_OGL_LIB} ${SRC}) -INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} nel3d nelmisc ${OPENGL_gl_LIBRARY}) NL_DEFAULT_PROPS(${NLDRV_OGL_LIB} "NeL, Driver, Video: OpenGL") @@ -74,7 +74,7 @@ IF(WITH_PCH) ENDIF(WITH_PCH) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC_DRIVERS) OR NOT WITH_STATIC_DRIVERS) - INSTALL(TARGETS ${NLDRV_OGL_LIB} LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d) + INSTALL(TARGETS ${NLDRV_OGL_LIB} LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_DRIVER_PREFIX} COMPONENT drivers3d) IF(WITH_MAXPLUGIN) INSTALL(TARGETS ${NLDRV_OGL_LIB} RUNTIME DESTINATION maxplugin COMPONENT drivers3d) ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/src/3d/driver/opengl/EGL/eglext.h b/code/nel/src/3d/driver/opengl/EGL/eglext.h index 0d318b258..a28f5b88e 100644 --- a/code/nel/src/3d/driver/opengl/EGL/eglext.h +++ b/code/nel/src/3d/driver/opengl/EGL/eglext.h @@ -34,8 +34,8 @@ extern "C" { /* Header file version number */ /* Current version at http://www.khronos.org/registry/egl/ */ -/* $Revision: 17614 $ on $Date: 2012-04-26 06:56:02 -0700 (Thu, 26 Apr 2012) $ */ -#define EGL_EGLEXT_VERSION 12 +/* $Revision: 19332 $ on $Date: 2012-09-28 17:56:20 -0700 (Fri, 28 Sep 2012) $ */ +#define EGL_EGLEXT_VERSION 14 #ifndef EGL_KHR_config_attribs #define EGL_KHR_config_attribs 1 @@ -293,6 +293,25 @@ EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface sur typedef EGLBoolean (EGLAPIENTRYP PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); #endif +#ifndef EGL_ANDROID_image_native_buffer +#define EGL_ANDROID_image_native_buffer 1 +struct ANativeWindowBuffer; +#define EGL_NATIVE_BUFFER_ANDROID 0x3140 /* eglCreateImageKHR target */ +#endif + +#ifndef EGL_ANDROID_swap_rectangle +#define EGL_ANDROID_swap_rectangle 1 +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglSetSwapRectangleANDROID (EGLDisplay dpy, EGLSurface draw, EGLint left, EGLint top, EGLint width, EGLint height); +#endif /* EGL_EGLEXT_PROTOTYPES */ +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETSWAPRECTANGLEANDROIDPROC) (EGLDisplay dpy, EGLSurface draw, EGLint left, EGLint top, EGLint width, EGLint height); +#endif + +#ifndef EGL_ANDROID_recordable +#define EGL_ANDROID_recordable 1 +#define EGL_RECORDABLE_ANDROID 0x3142 /* EGLConfig attribute */ +#endif + #ifndef EGL_ANGLE_query_surface_pointer #define EGL_ANGLE_query_surface_pointer 1 #ifdef EGL_EGLEXT_PROTOTYPES @@ -333,38 +352,38 @@ typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC) (void); #define EGL_KHR_stream 1 typedef void* EGLStreamKHR; typedef khronos_uint64_t EGLuint64KHR; -#define EGL_NO_STREAM_KHR ((EGLStreamKHR)0) -#define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210 -#define EGL_PRODUCER_FRAME_KHR 0x3212 -#define EGL_CONSUMER_FRAME_KHR 0x3213 -#define EGL_STREAM_STATE_KHR 0x3214 -#define EGL_STREAM_STATE_CREATED_KHR 0x3215 -#define EGL_STREAM_STATE_CONNECTING_KHR 0x3216 -#define EGL_STREAM_STATE_EMPTY_KHR 0x3217 +#define EGL_NO_STREAM_KHR ((EGLStreamKHR)0) +#define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210 +#define EGL_PRODUCER_FRAME_KHR 0x3212 +#define EGL_CONSUMER_FRAME_KHR 0x3213 +#define EGL_STREAM_STATE_KHR 0x3214 +#define EGL_STREAM_STATE_CREATED_KHR 0x3215 +#define EGL_STREAM_STATE_CONNECTING_KHR 0x3216 +#define EGL_STREAM_STATE_EMPTY_KHR 0x3217 #define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR 0x3218 #define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR 0x3219 -#define EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A -#define EGL_BAD_STREAM_KHR 0x321B -#define EGL_BAD_STATE_KHR 0x321C +#define EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A +#define EGL_BAD_STREAM_KHR 0x321B +#define EGL_BAD_STATE_KHR 0x321C #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamKHR(EGLDisplay dpy, const EGLint *attrib_list); EGLAPI EGLBoolean EGLAPIENTRY eglDestroyStreamKHR(EGLDisplay dpy, EGLStreamKHR stream); EGLAPI EGLBoolean EGLAPIENTRY eglStreamAttribKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryStream64KHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value); #endif /* EGL_EGLEXT_PROTOTYPES */ typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMKHRPROC)(EGLDisplay dpy, const EGLint *attrib_list); typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream); typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMATTRIBKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAM64KHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMU64KHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value); #endif #endif #ifdef EGL_KHR_stream /* Requires KHR_stream extension */ #ifndef EGL_KHR_stream_consumer_gltexture #define EGL_KHR_stream_consumer_gltexture 1 -#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E +#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalKHR(EGLDisplay dpy, EGLStreamKHR stream); EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireKHR(EGLDisplay dpy, EGLStreamKHR stream); @@ -379,7 +398,7 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEKHRPROC)(EGLDisplay #ifdef EGL_KHR_stream /* Requires KHR_stream extension */ #ifndef EGL_KHR_stream_producer_eglsurface #define EGL_KHR_stream_producer_eglsurface 1 -#define EGL_STREAM_BIT_KHR 0x0800 +#define EGL_STREAM_BIT_KHR 0x0800 #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR(EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list); #endif /* EGL_EGLEXT_PROTOTYPES */ @@ -397,10 +416,10 @@ typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC)(EGLDi #ifndef EGL_KHR_stream_fifo #define EGL_KHR_stream_fifo 1 /* reuse EGLTimeKHR */ -#define EGL_STREAM_FIFO_LENGTH_KHR 0x31FC -#define EGL_STREAM_TIME_NOW_KHR 0x31FD -#define EGL_STREAM_TIME_CONSUMER_KHR 0x31FE -#define EGL_STREAM_TIME_PRODUCER_KHR 0x31FF +#define EGL_STREAM_FIFO_LENGTH_KHR 0x31FC +#define EGL_STREAM_TIME_NOW_KHR 0x31FD +#define EGL_STREAM_TIME_CONSUMER_KHR 0x31FE +#define EGL_STREAM_TIME_PRODUCER_KHR 0x31FF #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamTimeKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value); #endif /* EGL_EGLEXT_PROTOTYPES */ @@ -421,6 +440,47 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMTIMEKHRPROC)(EGLDisplay dpy, E /* reuse EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE */ #endif +#ifndef EGL_KHR_create_context +#define EGL_KHR_create_context 1 +#define EGL_CONTEXT_MAJOR_VERSION_KHR EGL_CONTEXT_CLIENT_VERSION +#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB +#define EGL_CONTEXT_FLAGS_KHR 0x30FC +#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD +#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD +#define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE +#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF +#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001 +#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002 +#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004 +#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001 +#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002 +#define EGL_OPENGL_ES3_BIT_KHR 0x00000040 +#endif + +#ifndef EGL_KHR_surfaceless_context +#define EGL_KHR_surfaceless_context 1 +/* No tokens/entry points, just relaxes an error condition */ +#endif + +#ifdef EGL_KHR_stream /* Requires KHR_stream extension */ +#ifndef EGL_KHR_stream_cross_process_fd +#define EGL_KHR_stream_cross_process_fd 1 +typedef int EGLNativeFileDescriptorKHR; +#define EGL_NO_FILE_DESCRIPTOR_KHR ((EGLNativeFileDescriptorKHR)(-1)) +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLNativeFileDescriptorKHR EGLAPIENTRY eglGetStreamFileDescriptorKHR(EGLDisplay dpy, EGLStreamKHR stream); +EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamFromFileDescriptorKHR(EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor); +#endif /* EGL_EGLEXT_PROTOTYPES */ +typedef EGLNativeFileDescriptorKHR (EGLAPIENTRYP PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC)(EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor); +#endif +#endif + +#ifndef EGL_EXT_multiview_window +#define EGL_EXT_multiview_window 1 +#define EGL_MULTIVIEW_VIEW_COUNT_EXT 0x3134 +#endif + #ifdef __cplusplus } #endif diff --git a/code/nel/src/3d/driver/opengl/GL/glext.h b/code/nel/src/3d/driver/opengl/GL/glext.h index bd7b9b863..44ab7c62e 100644 --- a/code/nel/src/3d/driver/opengl/GL/glext.h +++ b/code/nel/src/3d/driver/opengl/GL/glext.h @@ -29,9 +29,9 @@ extern "C" { */ /* Header file version number, required by OpenGL ABI for Linux */ -/* glext.h last updated $Date: 2012-04-26 00:59:42 -0700 (Thu, 26 Apr 2012) $ */ +/* glext.h last updated $Date: 2012-09-19 19:02:24 -0700 (Wed, 19 Sep 2012) $ */ /* Current version at http://www.opengl.org/registry/ */ -#define GL_GLEXT_VERSION 81 +#define GL_GLEXT_VERSION 85 /* Function declaration macros - to move into glplatform.h */ #if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) @@ -88,9 +88,6 @@ extern "C" { #define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 #define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 #define GL_ALIASED_LINE_WIDTH_RANGE 0x846E -#endif - -#ifndef GL_VERSION_1_2_DEPRECATED #define GL_RESCALE_NORMAL 0x803A #define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 #define GL_SINGLE_COLOR 0x81F9 @@ -110,9 +107,6 @@ extern "C" { #define GL_BLEND_EQUATION 0x8009 #define GL_FUNC_SUBTRACT 0x800A #define GL_FUNC_REVERSE_SUBTRACT 0x800B -#endif - -#ifndef GL_ARB_imaging_DEPRECATED #define GL_CONVOLUTION_1D 0x8010 #define GL_CONVOLUTION_2D 0x8011 #define GL_SEPARABLE_2D 0x8012 @@ -239,9 +233,6 @@ extern "C" { #define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 #define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 #define GL_CLAMP_TO_BORDER 0x812D -#endif - -#ifndef GL_VERSION_1_3_DEPRECATED #define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 #define GL_MAX_TEXTURE_UNITS 0x84E2 #define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 @@ -298,9 +289,6 @@ extern "C" { #define GL_TEXTURE_DEPTH_SIZE 0x884A #define GL_TEXTURE_COMPARE_MODE 0x884C #define GL_TEXTURE_COMPARE_FUNC 0x884D -#endif - -#ifndef GL_VERSION_1_4_DEPRECATED #define GL_POINT_SIZE_MIN 0x8126 #define GL_POINT_SIZE_MAX 0x8127 #define GL_POINT_DISTANCE_ATTENUATION 0x8129 @@ -354,9 +342,7 @@ extern "C" { #define GL_DYNAMIC_READ 0x88E9 #define GL_DYNAMIC_COPY 0x88EA #define GL_SAMPLES_PASSED 0x8914 -#endif - -#ifndef GL_VERSION_1_5_DEPRECATED +#define GL_SRC1_ALPHA 0x8589 #define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 #define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 #define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 @@ -378,7 +364,6 @@ extern "C" { #define GL_SRC1_RGB 0x8581 #define GL_SRC2_RGB 0x8582 #define GL_SRC0_ALPHA 0x8588 -#define GL_SRC1_ALPHA 0x8589 #define GL_SRC2_ALPHA 0x858A #endif @@ -463,9 +448,6 @@ extern "C" { #define GL_STENCIL_BACK_REF 0x8CA3 #define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 #define GL_STENCIL_BACK_WRITEMASK 0x8CA5 -#endif - -#ifndef GL_VERSION_2_0_DEPRECATED #define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 #define GL_POINT_SPRITE 0x8861 #define GL_COORD_REPLACE 0x8862 @@ -489,9 +471,6 @@ extern "C" { #define GL_SRGB8_ALPHA8 0x8C43 #define GL_COMPRESSED_SRGB 0x8C48 #define GL_COMPRESSED_SRGB_ALPHA 0x8C49 -#endif - -#ifndef GL_VERSION_2_1_DEPRECATED #define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F #define GL_SLUMINANCE_ALPHA 0x8C44 #define GL_SLUMINANCE8_ALPHA8 0x8C45 @@ -726,9 +705,6 @@ extern "C" { /* reuse GL_RG32UI */ /* Reuse tokens from ARB_vertex_array_object */ /* reuse GL_VERTEX_ARRAY_BINDING */ -#endif - -#ifndef GL_VERSION_3_0_DEPRECATED #define GL_CLAMP_VERTEX_COLOR 0x891A #define GL_CLAMP_FRAGMENT_COLOR 0x891B #define GL_ALPHA_INTEGER 0x8D97 @@ -749,7 +725,6 @@ extern "C" { #define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B #define GL_TEXTURE_BINDING_BUFFER 0x8C2C #define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D -#define GL_TEXTURE_BUFFER_FORMAT 0x8C2E #define GL_TEXTURE_RECTANGLE 0x84F5 #define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 #define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 @@ -1015,6 +990,7 @@ extern "C" { /* reuse GL_MEDIUM_INT */ /* reuse GL_HIGH_INT */ /* reuse GL_SHADER_COMPILER */ +/* reuse GL_SHADER_BINARY_FORMATS */ /* reuse GL_NUM_SHADER_BINARY_FORMATS */ /* reuse GL_MAX_VERTEX_UNIFORM_VECTORS */ /* reuse GL_MAX_VARYING_VECTORS */ @@ -1164,6 +1140,290 @@ extern "C" { /* reuse GL_TEXTURE_IMMUTABLE_FORMAT */ #endif +#ifndef GL_VERSION_4_3 +#define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9 +#define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E +/* Reuse tokens from ARB_arrays_of_arrays (none, GLSL only) */ +/* Reuse tokens from ARB_fragment_layer_viewport (none, GLSL only) */ +/* Reuse tokens from ARB_shader_image_size (none, GLSL only) */ +/* Reuse tokens from ARB_ES3_compatibility */ +/* reuse GL_COMPRESSED_RGB8_ETC2 */ +/* reuse GL_COMPRESSED_SRGB8_ETC2 */ +/* reuse GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 */ +/* reuse GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 */ +/* reuse GL_COMPRESSED_RGBA8_ETC2_EAC */ +/* reuse GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC */ +/* reuse GL_COMPRESSED_R11_EAC */ +/* reuse GL_COMPRESSED_SIGNED_R11_EAC */ +/* reuse GL_COMPRESSED_RG11_EAC */ +/* reuse GL_COMPRESSED_SIGNED_RG11_EAC */ +/* reuse GL_PRIMITIVE_RESTART_FIXED_INDEX */ +/* reuse GL_ANY_SAMPLES_PASSED_CONSERVATIVE */ +/* reuse GL_MAX_ELEMENT_INDEX */ +/* Reuse tokens from ARB_clear_buffer_object (none) */ +/* Reuse tokens from ARB_compute_shader */ +/* reuse GL_COMPUTE_SHADER */ +/* reuse GL_MAX_COMPUTE_UNIFORM_BLOCKS */ +/* reuse GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS */ +/* reuse GL_MAX_COMPUTE_IMAGE_UNIFORMS */ +/* reuse GL_MAX_COMPUTE_SHARED_MEMORY_SIZE */ +/* reuse GL_MAX_COMPUTE_UNIFORM_COMPONENTS */ +/* reuse GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS */ +/* reuse GL_MAX_COMPUTE_ATOMIC_COUNTERS */ +/* reuse GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS */ +/* reuse GL_MAX_COMPUTE_LOCAL_INVOCATIONS */ +/* reuse GL_MAX_COMPUTE_WORK_GROUP_COUNT */ +/* reuse GL_MAX_COMPUTE_WORK_GROUP_SIZE */ +/* reuse GL_COMPUTE_LOCAL_WORK_SIZE */ +/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER */ +/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER */ +/* reuse GL_DISPATCH_INDIRECT_BUFFER */ +/* reuse GL_DISPATCH_INDIRECT_BUFFER_BINDING */ +/* Reuse tokens from ARB_copy_image (none) */ +/* Reuse tokens from KHR_debug */ +/* reuse GL_DEBUG_OUTPUT_SYNCHRONOUS */ +/* reuse GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH */ +/* reuse GL_DEBUG_CALLBACK_FUNCTION */ +/* reuse GL_DEBUG_CALLBACK_USER_PARAM */ +/* reuse GL_DEBUG_SOURCE_API */ +/* reuse GL_DEBUG_SOURCE_WINDOW_SYSTEM */ +/* reuse GL_DEBUG_SOURCE_SHADER_COMPILER */ +/* reuse GL_DEBUG_SOURCE_THIRD_PARTY */ +/* reuse GL_DEBUG_SOURCE_APPLICATION */ +/* reuse GL_DEBUG_SOURCE_OTHER */ +/* reuse GL_DEBUG_TYPE_ERROR */ +/* reuse GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR */ +/* reuse GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR */ +/* reuse GL_DEBUG_TYPE_PORTABILITY */ +/* reuse GL_DEBUG_TYPE_PERFORMANCE */ +/* reuse GL_DEBUG_TYPE_OTHER */ +/* reuse GL_MAX_DEBUG_MESSAGE_LENGTH */ +/* reuse GL_MAX_DEBUG_LOGGED_MESSAGES */ +/* reuse GL_DEBUG_LOGGED_MESSAGES */ +/* reuse GL_DEBUG_SEVERITY_HIGH */ +/* reuse GL_DEBUG_SEVERITY_MEDIUM */ +/* reuse GL_DEBUG_SEVERITY_LOW */ +/* reuse GL_DEBUG_TYPE_MARKER */ +/* reuse GL_DEBUG_TYPE_PUSH_GROUP */ +/* reuse GL_DEBUG_TYPE_POP_GROUP */ +/* reuse GL_DEBUG_SEVERITY_NOTIFICATION */ +/* reuse GL_MAX_DEBUG_GROUP_STACK_DEPTH */ +/* reuse GL_DEBUG_GROUP_STACK_DEPTH */ +/* reuse GL_BUFFER */ +/* reuse GL_SHADER */ +/* reuse GL_PROGRAM */ +/* reuse GL_QUERY */ +/* reuse GL_PROGRAM_PIPELINE */ +/* reuse GL_SAMPLER */ +/* reuse GL_DISPLAY_LIST */ +/* reuse GL_MAX_LABEL_LENGTH */ +/* reuse GL_DEBUG_OUTPUT */ +/* reuse GL_CONTEXT_FLAG_DEBUG_BIT */ +/* reuse GL_STACK_UNDERFLOW */ +/* reuse GL_STACK_OVERFLOW */ +/* Reuse tokens from ARB_explicit_uniform_location */ +/* reuse GL_MAX_UNIFORM_LOCATIONS */ +/* Reuse tokens from ARB_framebuffer_no_attachments */ +/* reuse GL_FRAMEBUFFER_DEFAULT_WIDTH */ +/* reuse GL_FRAMEBUFFER_DEFAULT_HEIGHT */ +/* reuse GL_FRAMEBUFFER_DEFAULT_LAYERS */ +/* reuse GL_FRAMEBUFFER_DEFAULT_SAMPLES */ +/* reuse GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS */ +/* reuse GL_MAX_FRAMEBUFFER_WIDTH */ +/* reuse GL_MAX_FRAMEBUFFER_HEIGHT */ +/* reuse GL_MAX_FRAMEBUFFER_LAYERS */ +/* reuse GL_MAX_FRAMEBUFFER_SAMPLES */ +/* Reuse tokens from ARB_internalformat_query2 */ +/* reuse GL_INTERNALFORMAT_SUPPORTED */ +/* reuse GL_INTERNALFORMAT_PREFERRED */ +/* reuse GL_INTERNALFORMAT_RED_SIZE */ +/* reuse GL_INTERNALFORMAT_GREEN_SIZE */ +/* reuse GL_INTERNALFORMAT_BLUE_SIZE */ +/* reuse GL_INTERNALFORMAT_ALPHA_SIZE */ +/* reuse GL_INTERNALFORMAT_DEPTH_SIZE */ +/* reuse GL_INTERNALFORMAT_STENCIL_SIZE */ +/* reuse GL_INTERNALFORMAT_SHARED_SIZE */ +/* reuse GL_INTERNALFORMAT_RED_TYPE */ +/* reuse GL_INTERNALFORMAT_GREEN_TYPE */ +/* reuse GL_INTERNALFORMAT_BLUE_TYPE */ +/* reuse GL_INTERNALFORMAT_ALPHA_TYPE */ +/* reuse GL_INTERNALFORMAT_DEPTH_TYPE */ +/* reuse GL_INTERNALFORMAT_STENCIL_TYPE */ +/* reuse GL_MAX_WIDTH */ +/* reuse GL_MAX_HEIGHT */ +/* reuse GL_MAX_DEPTH */ +/* reuse GL_MAX_LAYERS */ +/* reuse GL_MAX_COMBINED_DIMENSIONS */ +/* reuse GL_COLOR_COMPONENTS */ +/* reuse GL_DEPTH_COMPONENTS */ +/* reuse GL_STENCIL_COMPONENTS */ +/* reuse GL_COLOR_RENDERABLE */ +/* reuse GL_DEPTH_RENDERABLE */ +/* reuse GL_STENCIL_RENDERABLE */ +/* reuse GL_FRAMEBUFFER_RENDERABLE */ +/* reuse GL_FRAMEBUFFER_RENDERABLE_LAYERED */ +/* reuse GL_FRAMEBUFFER_BLEND */ +/* reuse GL_READ_PIXELS */ +/* reuse GL_READ_PIXELS_FORMAT */ +/* reuse GL_READ_PIXELS_TYPE */ +/* reuse GL_TEXTURE_IMAGE_FORMAT */ +/* reuse GL_TEXTURE_IMAGE_TYPE */ +/* reuse GL_GET_TEXTURE_IMAGE_FORMAT */ +/* reuse GL_GET_TEXTURE_IMAGE_TYPE */ +/* reuse GL_MIPMAP */ +/* reuse GL_MANUAL_GENERATE_MIPMAP */ +/* reuse GL_AUTO_GENERATE_MIPMAP */ +/* reuse GL_COLOR_ENCODING */ +/* reuse GL_SRGB_READ */ +/* reuse GL_SRGB_WRITE */ +/* reuse GL_FILTER */ +/* reuse GL_VERTEX_TEXTURE */ +/* reuse GL_TESS_CONTROL_TEXTURE */ +/* reuse GL_TESS_EVALUATION_TEXTURE */ +/* reuse GL_GEOMETRY_TEXTURE */ +/* reuse GL_FRAGMENT_TEXTURE */ +/* reuse GL_COMPUTE_TEXTURE */ +/* reuse GL_TEXTURE_SHADOW */ +/* reuse GL_TEXTURE_GATHER */ +/* reuse GL_TEXTURE_GATHER_SHADOW */ +/* reuse GL_SHADER_IMAGE_LOAD */ +/* reuse GL_SHADER_IMAGE_STORE */ +/* reuse GL_SHADER_IMAGE_ATOMIC */ +/* reuse GL_IMAGE_TEXEL_SIZE */ +/* reuse GL_IMAGE_COMPATIBILITY_CLASS */ +/* reuse GL_IMAGE_PIXEL_FORMAT */ +/* reuse GL_IMAGE_PIXEL_TYPE */ +/* reuse GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST */ +/* reuse GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST */ +/* reuse GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE */ +/* reuse GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE */ +/* reuse GL_TEXTURE_COMPRESSED_BLOCK_WIDTH */ +/* reuse GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT */ +/* reuse GL_TEXTURE_COMPRESSED_BLOCK_SIZE */ +/* reuse GL_CLEAR_BUFFER */ +/* reuse GL_TEXTURE_VIEW */ +/* reuse GL_VIEW_COMPATIBILITY_CLASS */ +/* reuse GL_FULL_SUPPORT */ +/* reuse GL_CAVEAT_SUPPORT */ +/* reuse GL_IMAGE_CLASS_4_X_32 */ +/* reuse GL_IMAGE_CLASS_2_X_32 */ +/* reuse GL_IMAGE_CLASS_1_X_32 */ +/* reuse GL_IMAGE_CLASS_4_X_16 */ +/* reuse GL_IMAGE_CLASS_2_X_16 */ +/* reuse GL_IMAGE_CLASS_1_X_16 */ +/* reuse GL_IMAGE_CLASS_4_X_8 */ +/* reuse GL_IMAGE_CLASS_2_X_8 */ +/* reuse GL_IMAGE_CLASS_1_X_8 */ +/* reuse GL_IMAGE_CLASS_11_11_10 */ +/* reuse GL_IMAGE_CLASS_10_10_10_2 */ +/* reuse GL_VIEW_CLASS_128_BITS */ +/* reuse GL_VIEW_CLASS_96_BITS */ +/* reuse GL_VIEW_CLASS_64_BITS */ +/* reuse GL_VIEW_CLASS_48_BITS */ +/* reuse GL_VIEW_CLASS_32_BITS */ +/* reuse GL_VIEW_CLASS_24_BITS */ +/* reuse GL_VIEW_CLASS_16_BITS */ +/* reuse GL_VIEW_CLASS_8_BITS */ +/* reuse GL_VIEW_CLASS_S3TC_DXT1_RGB */ +/* reuse GL_VIEW_CLASS_S3TC_DXT1_RGBA */ +/* reuse GL_VIEW_CLASS_S3TC_DXT3_RGBA */ +/* reuse GL_VIEW_CLASS_S3TC_DXT5_RGBA */ +/* reuse GL_VIEW_CLASS_RGTC1_RED */ +/* reuse GL_VIEW_CLASS_RGTC2_RG */ +/* reuse GL_VIEW_CLASS_BPTC_UNORM */ +/* reuse GL_VIEW_CLASS_BPTC_FLOAT */ +/* Reuse tokens from ARB_invalidate_subdata (none) */ +/* Reuse tokens from ARB_multi_draw_indirect (none) */ +/* Reuse tokens from ARB_program_interface_query */ +/* reuse GL_UNIFORM */ +/* reuse GL_UNIFORM_BLOCK */ +/* reuse GL_PROGRAM_INPUT */ +/* reuse GL_PROGRAM_OUTPUT */ +/* reuse GL_BUFFER_VARIABLE */ +/* reuse GL_SHADER_STORAGE_BLOCK */ +/* reuse GL_VERTEX_SUBROUTINE */ +/* reuse GL_TESS_CONTROL_SUBROUTINE */ +/* reuse GL_TESS_EVALUATION_SUBROUTINE */ +/* reuse GL_GEOMETRY_SUBROUTINE */ +/* reuse GL_FRAGMENT_SUBROUTINE */ +/* reuse GL_COMPUTE_SUBROUTINE */ +/* reuse GL_VERTEX_SUBROUTINE_UNIFORM */ +/* reuse GL_TESS_CONTROL_SUBROUTINE_UNIFORM */ +/* reuse GL_TESS_EVALUATION_SUBROUTINE_UNIFORM */ +/* reuse GL_GEOMETRY_SUBROUTINE_UNIFORM */ +/* reuse GL_FRAGMENT_SUBROUTINE_UNIFORM */ +/* reuse GL_COMPUTE_SUBROUTINE_UNIFORM */ +/* reuse GL_TRANSFORM_FEEDBACK_VARYING */ +/* reuse GL_ACTIVE_RESOURCES */ +/* reuse GL_MAX_NAME_LENGTH */ +/* reuse GL_MAX_NUM_ACTIVE_VARIABLES */ +/* reuse GL_MAX_NUM_COMPATIBLE_SUBROUTINES */ +/* reuse GL_NAME_LENGTH */ +/* reuse GL_TYPE */ +/* reuse GL_ARRAY_SIZE */ +/* reuse GL_OFFSET */ +/* reuse GL_BLOCK_INDEX */ +/* reuse GL_ARRAY_STRIDE */ +/* reuse GL_MATRIX_STRIDE */ +/* reuse GL_IS_ROW_MAJOR */ +/* reuse GL_ATOMIC_COUNTER_BUFFER_INDEX */ +/* reuse GL_BUFFER_BINDING */ +/* reuse GL_BUFFER_DATA_SIZE */ +/* reuse GL_NUM_ACTIVE_VARIABLES */ +/* reuse GL_ACTIVE_VARIABLES */ +/* reuse GL_REFERENCED_BY_VERTEX_SHADER */ +/* reuse GL_REFERENCED_BY_TESS_CONTROL_SHADER */ +/* reuse GL_REFERENCED_BY_TESS_EVALUATION_SHADER */ +/* reuse GL_REFERENCED_BY_GEOMETRY_SHADER */ +/* reuse GL_REFERENCED_BY_FRAGMENT_SHADER */ +/* reuse GL_REFERENCED_BY_COMPUTE_SHADER */ +/* reuse GL_TOP_LEVEL_ARRAY_SIZE */ +/* reuse GL_TOP_LEVEL_ARRAY_STRIDE */ +/* reuse GL_LOCATION */ +/* reuse GL_LOCATION_INDEX */ +/* reuse GL_IS_PER_PATCH */ +/* Reuse tokens from ARB_robust_buffer_access_behavior (none) */ +/* Reuse tokens from ARB_shader_storage_buffer_object */ +/* reuse GL_SHADER_STORAGE_BUFFER */ +/* reuse GL_SHADER_STORAGE_BUFFER_BINDING */ +/* reuse GL_SHADER_STORAGE_BUFFER_START */ +/* reuse GL_SHADER_STORAGE_BUFFER_SIZE */ +/* reuse GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS */ +/* reuse GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS */ +/* reuse GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS */ +/* reuse GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS */ +/* reuse GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS */ +/* reuse GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS */ +/* reuse GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS */ +/* reuse GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS */ +/* reuse GL_MAX_SHADER_STORAGE_BLOCK_SIZE */ +/* reuse GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT */ +/* reuse GL_SHADER_STORAGE_BARRIER_BIT */ +/* reuse GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES */ +/* Reuse tokens from ARB_stencil_texturing */ +/* reuse GL_DEPTH_STENCIL_TEXTURE_MODE */ +/* Reuse tokens from ARB_texture_buffer_range */ +/* reuse GL_TEXTURE_BUFFER_OFFSET */ +/* reuse GL_TEXTURE_BUFFER_SIZE */ +/* reuse GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT */ +/* Reuse tokens from ARB_texture_query_levels (none) */ +/* Reuse tokens from ARB_texture_storage_multisample (none) */ +/* Reuse tokens from ARB_texture_view */ +/* reuse GL_TEXTURE_VIEW_MIN_LEVEL */ +/* reuse GL_TEXTURE_VIEW_NUM_LEVELS */ +/* reuse GL_TEXTURE_VIEW_MIN_LAYER */ +/* reuse GL_TEXTURE_VIEW_NUM_LAYERS */ +/* reuse GL_TEXTURE_IMMUTABLE_LEVELS */ +/* Reuse tokens from ARB_vertex_attrib_binding */ +/* reuse GL_VERTEX_ATTRIB_BINDING */ +/* reuse GL_VERTEX_ATTRIB_RELATIVE_OFFSET */ +/* reuse GL_VERTEX_BINDING_DIVISOR */ +/* reuse GL_VERTEX_BINDING_OFFSET */ +/* reuse GL_VERTEX_BINDING_STRIDE */ +/* reuse GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET */ +/* reuse GL_MAX_VERTEX_ATTRIB_BINDINGS */ +#endif + #ifndef GL_ARB_multitexture #define GL_TEXTURE0_ARB 0x84C0 #define GL_TEXTURE1_ARB 0x84C1 @@ -1746,9 +2006,6 @@ extern "C" { #define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 #define GL_MAX_SAMPLES 0x8D57 -#endif - -#ifndef GL_ARB_framebuffer_object_DEPRECATED #define GL_INDEX 0x8222 #define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 #define GL_TEXTURE_INTENSITY_TYPE 0x8C15 @@ -1980,6 +2237,7 @@ extern "C" { #ifndef GL_ARB_texture_gather #define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E #define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F +#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F #endif #ifndef GL_ARB_texture_query_lod @@ -2157,6 +2415,7 @@ extern "C" { #define GL_MEDIUM_INT 0x8DF4 #define GL_HIGH_INT 0x8DF5 #define GL_SHADER_COMPILER 0x8DFA +#define GL_SHADER_BINARY_FORMATS 0x8DF8 #define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 #define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB #define GL_MAX_VARYING_VECTORS 0x8DFC @@ -2399,6 +2658,386 @@ extern "C" { #define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F #endif +#ifndef GL_KHR_texture_compression_astc_ldr +#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 +#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 +#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 +#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 +#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 +#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 +#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 +#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 +#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 +#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 +#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA +#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB +#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC +#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD +#endif + +#ifndef GL_KHR_debug +#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245 +#define GL_DEBUG_SOURCE_API 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION 0x824A +#define GL_DEBUG_SOURCE_OTHER 0x824B +#define GL_DEBUG_TYPE_ERROR 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E +#define GL_DEBUG_TYPE_PORTABILITY 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE 0x8250 +#define GL_DEBUG_TYPE_OTHER 0x8251 +#define GL_DEBUG_TYPE_MARKER 0x8268 +#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 +#define GL_DEBUG_TYPE_POP_GROUP 0x826A +#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B +#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C +#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D +#define GL_BUFFER 0x82E0 +#define GL_SHADER 0x82E1 +#define GL_PROGRAM 0x82E2 +#define GL_QUERY 0x82E3 +#define GL_PROGRAM_PIPELINE 0x82E4 +#define GL_SAMPLER 0x82E6 +#define GL_DISPLAY_LIST 0x82E7 +/* DISPLAY_LIST used in compatibility profile only */ +#define GL_MAX_LABEL_LENGTH 0x82E8 +#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES 0x9145 +#define GL_DEBUG_SEVERITY_HIGH 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 +#define GL_DEBUG_SEVERITY_LOW 0x9148 +#define GL_DEBUG_OUTPUT 0x92E0 +#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 +/* reuse GL_STACK_UNDERFLOW */ +/* reuse GL_STACK_OVERFLOW */ +#endif + +#ifndef GL_ARB_arrays_of_arrays +#endif + +#ifndef GL_ARB_clear_buffer_object +#endif + +#ifndef GL_ARB_compute_shader +#define GL_COMPUTE_SHADER 0x91B9 +#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB +#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC +#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD +#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 +#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 +#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 +#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 +#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 +#define GL_MAX_COMPUTE_LOCAL_INVOCATIONS 0x90EB +#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE +#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF +#define GL_COMPUTE_LOCAL_WORK_SIZE 0x8267 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED +#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE +#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF +#define GL_COMPUTE_SHADER_BIT 0x00000020 +#endif + +#ifndef GL_ARB_copy_image +#endif + +#ifndef GL_ARB_texture_view +#define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB +#define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC +#define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD +#define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF +#endif + +#ifndef GL_ARB_vertex_attrib_binding +#define GL_VERTEX_ATTRIB_BINDING 0x82D4 +#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 +#define GL_VERTEX_BINDING_DIVISOR 0x82D6 +#define GL_VERTEX_BINDING_OFFSET 0x82D7 +#define GL_VERTEX_BINDING_STRIDE 0x82D8 +#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 +#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA +#endif + +#ifndef GL_ARB_robustness_isolation +#endif + +#ifndef GL_ARB_ES3_compatibility +#define GL_COMPRESSED_RGB8_ETC2 0x9274 +#define GL_COMPRESSED_SRGB8_ETC2 0x9275 +#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 +#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 +#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 +#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 +#define GL_COMPRESSED_R11_EAC 0x9270 +#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 +#define GL_COMPRESSED_RG11_EAC 0x9272 +#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 +#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 +#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A +#define GL_MAX_ELEMENT_INDEX 0x8D6B +#endif + +#ifndef GL_ARB_explicit_uniform_location +#define GL_MAX_UNIFORM_LOCATIONS 0x826E +#endif + +#ifndef GL_ARB_fragment_layer_viewport +#endif + +#ifndef GL_ARB_framebuffer_no_attachments +#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310 +#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 +#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312 +#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 +#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314 +#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315 +#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316 +#define GL_MAX_FRAMEBUFFER_LAYERS 0x9317 +#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318 +#endif + +#ifndef GL_ARB_internalformat_query2 +/* reuse GL_IMAGE_FORMAT_COMPATIBILITY_TYPE */ +/* reuse GL_NUM_SAMPLE_COUNTS */ +/* reuse GL_RENDERBUFFER */ +/* reuse GL_SAMPLES */ +/* reuse GL_TEXTURE_1D */ +/* reuse GL_TEXTURE_1D_ARRAY */ +/* reuse GL_TEXTURE_2D */ +/* reuse GL_TEXTURE_2D_ARRAY */ +/* reuse GL_TEXTURE_3D */ +/* reuse GL_TEXTURE_CUBE_MAP */ +/* reuse GL_TEXTURE_CUBE_MAP_ARRAY */ +/* reuse GL_TEXTURE_RECTANGLE */ +/* reuse GL_TEXTURE_BUFFER */ +/* reuse GL_TEXTURE_2D_MULTISAMPLE */ +/* reuse GL_TEXTURE_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_TEXTURE_COMPRESSED */ +#define GL_INTERNALFORMAT_SUPPORTED 0x826F +#define GL_INTERNALFORMAT_PREFERRED 0x8270 +#define GL_INTERNALFORMAT_RED_SIZE 0x8271 +#define GL_INTERNALFORMAT_GREEN_SIZE 0x8272 +#define GL_INTERNALFORMAT_BLUE_SIZE 0x8273 +#define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 +#define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 +#define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 +#define GL_INTERNALFORMAT_SHARED_SIZE 0x8277 +#define GL_INTERNALFORMAT_RED_TYPE 0x8278 +#define GL_INTERNALFORMAT_GREEN_TYPE 0x8279 +#define GL_INTERNALFORMAT_BLUE_TYPE 0x827A +#define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B +#define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C +#define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D +#define GL_MAX_WIDTH 0x827E +#define GL_MAX_HEIGHT 0x827F +#define GL_MAX_DEPTH 0x8280 +#define GL_MAX_LAYERS 0x8281 +#define GL_MAX_COMBINED_DIMENSIONS 0x8282 +#define GL_COLOR_COMPONENTS 0x8283 +#define GL_DEPTH_COMPONENTS 0x8284 +#define GL_STENCIL_COMPONENTS 0x8285 +#define GL_COLOR_RENDERABLE 0x8286 +#define GL_DEPTH_RENDERABLE 0x8287 +#define GL_STENCIL_RENDERABLE 0x8288 +#define GL_FRAMEBUFFER_RENDERABLE 0x8289 +#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A +#define GL_FRAMEBUFFER_BLEND 0x828B +#define GL_READ_PIXELS 0x828C +#define GL_READ_PIXELS_FORMAT 0x828D +#define GL_READ_PIXELS_TYPE 0x828E +#define GL_TEXTURE_IMAGE_FORMAT 0x828F +#define GL_TEXTURE_IMAGE_TYPE 0x8290 +#define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 +#define GL_GET_TEXTURE_IMAGE_TYPE 0x8292 +#define GL_MIPMAP 0x8293 +#define GL_MANUAL_GENERATE_MIPMAP 0x8294 +#define GL_AUTO_GENERATE_MIPMAP 0x8295 +#define GL_COLOR_ENCODING 0x8296 +#define GL_SRGB_READ 0x8297 +#define GL_SRGB_WRITE 0x8298 +#define GL_SRGB_DECODE_ARB 0x8299 +#define GL_FILTER 0x829A +#define GL_VERTEX_TEXTURE 0x829B +#define GL_TESS_CONTROL_TEXTURE 0x829C +#define GL_TESS_EVALUATION_TEXTURE 0x829D +#define GL_GEOMETRY_TEXTURE 0x829E +#define GL_FRAGMENT_TEXTURE 0x829F +#define GL_COMPUTE_TEXTURE 0x82A0 +#define GL_TEXTURE_SHADOW 0x82A1 +#define GL_TEXTURE_GATHER 0x82A2 +#define GL_TEXTURE_GATHER_SHADOW 0x82A3 +#define GL_SHADER_IMAGE_LOAD 0x82A4 +#define GL_SHADER_IMAGE_STORE 0x82A5 +#define GL_SHADER_IMAGE_ATOMIC 0x82A6 +#define GL_IMAGE_TEXEL_SIZE 0x82A7 +#define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 +#define GL_IMAGE_PIXEL_FORMAT 0x82A9 +#define GL_IMAGE_PIXEL_TYPE 0x82AA +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF +#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 +#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 +#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 +#define GL_CLEAR_BUFFER 0x82B4 +#define GL_TEXTURE_VIEW 0x82B5 +#define GL_VIEW_COMPATIBILITY_CLASS 0x82B6 +#define GL_FULL_SUPPORT 0x82B7 +#define GL_CAVEAT_SUPPORT 0x82B8 +#define GL_IMAGE_CLASS_4_X_32 0x82B9 +#define GL_IMAGE_CLASS_2_X_32 0x82BA +#define GL_IMAGE_CLASS_1_X_32 0x82BB +#define GL_IMAGE_CLASS_4_X_16 0x82BC +#define GL_IMAGE_CLASS_2_X_16 0x82BD +#define GL_IMAGE_CLASS_1_X_16 0x82BE +#define GL_IMAGE_CLASS_4_X_8 0x82BF +#define GL_IMAGE_CLASS_2_X_8 0x82C0 +#define GL_IMAGE_CLASS_1_X_8 0x82C1 +#define GL_IMAGE_CLASS_11_11_10 0x82C2 +#define GL_IMAGE_CLASS_10_10_10_2 0x82C3 +#define GL_VIEW_CLASS_128_BITS 0x82C4 +#define GL_VIEW_CLASS_96_BITS 0x82C5 +#define GL_VIEW_CLASS_64_BITS 0x82C6 +#define GL_VIEW_CLASS_48_BITS 0x82C7 +#define GL_VIEW_CLASS_32_BITS 0x82C8 +#define GL_VIEW_CLASS_24_BITS 0x82C9 +#define GL_VIEW_CLASS_16_BITS 0x82CA +#define GL_VIEW_CLASS_8_BITS 0x82CB +#define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC +#define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD +#define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE +#define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF +#define GL_VIEW_CLASS_RGTC1_RED 0x82D0 +#define GL_VIEW_CLASS_RGTC2_RG 0x82D1 +#define GL_VIEW_CLASS_BPTC_UNORM 0x82D2 +#define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 +#endif + +#ifndef GL_ARB_invalidate_subdata +#endif + +#ifndef GL_ARB_multi_draw_indirect +#endif + +#ifndef GL_ARB_program_interface_query +#define GL_UNIFORM 0x92E1 +#define GL_UNIFORM_BLOCK 0x92E2 +#define GL_PROGRAM_INPUT 0x92E3 +#define GL_PROGRAM_OUTPUT 0x92E4 +#define GL_BUFFER_VARIABLE 0x92E5 +#define GL_SHADER_STORAGE_BLOCK 0x92E6 +/* reuse GL_ATOMIC_COUNTER_BUFFER */ +#define GL_VERTEX_SUBROUTINE 0x92E8 +#define GL_TESS_CONTROL_SUBROUTINE 0x92E9 +#define GL_TESS_EVALUATION_SUBROUTINE 0x92EA +#define GL_GEOMETRY_SUBROUTINE 0x92EB +#define GL_FRAGMENT_SUBROUTINE 0x92EC +#define GL_COMPUTE_SUBROUTINE 0x92ED +#define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE +#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF +#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0 +#define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1 +#define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2 +#define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3 +#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4 +#define GL_ACTIVE_RESOURCES 0x92F5 +#define GL_MAX_NAME_LENGTH 0x92F6 +#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7 +#define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8 +#define GL_NAME_LENGTH 0x92F9 +#define GL_TYPE 0x92FA +#define GL_ARRAY_SIZE 0x92FB +#define GL_OFFSET 0x92FC +#define GL_BLOCK_INDEX 0x92FD +#define GL_ARRAY_STRIDE 0x92FE +#define GL_MATRIX_STRIDE 0x92FF +#define GL_IS_ROW_MAJOR 0x9300 +#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301 +#define GL_BUFFER_BINDING 0x9302 +#define GL_BUFFER_DATA_SIZE 0x9303 +#define GL_NUM_ACTIVE_VARIABLES 0x9304 +#define GL_ACTIVE_VARIABLES 0x9305 +#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306 +#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307 +#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308 +#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309 +#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A +#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B +#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C +#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D +#define GL_LOCATION 0x930E +#define GL_LOCATION_INDEX 0x930F +#define GL_IS_PER_PATCH 0x92E7 +/* reuse GL_NUM_COMPATIBLE_SUBROUTINES */ +/* reuse GL_COMPATIBLE_SUBROUTINES */ +#endif + +#ifndef GL_ARB_robust_buffer_access_behavior +#endif + +#ifndef GL_ARB_shader_image_size +#endif + +#ifndef GL_ARB_shader_storage_buffer_object +#define GL_SHADER_STORAGE_BUFFER 0x90D2 +#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3 +#define GL_SHADER_STORAGE_BUFFER_START 0x90D4 +#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5 +#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6 +#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7 +#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8 +#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9 +#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA +#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB +#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC +#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD +#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE +#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF +#define GL_SHADER_STORAGE_BARRIER_BIT 0x2000 +#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS +/* reuse GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS */ +#endif + +#ifndef GL_ARB_stencil_texturing +#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA +#endif + +#ifndef GL_ARB_texture_buffer_range +#define GL_TEXTURE_BUFFER_OFFSET 0x919D +#define GL_TEXTURE_BUFFER_SIZE 0x919E +#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F +#endif + +#ifndef GL_ARB_texture_query_levels +#endif + +#ifndef GL_ARB_texture_storage_multisample +#endif + #ifndef GL_EXT_abgr #define GL_ABGR_EXT 0x8000 #endif @@ -4255,6 +4894,8 @@ extern "C" { #define GL_RGB4_S3TC 0x83A1 #define GL_RGBA_S3TC 0x83A2 #define GL_RGBA4_S3TC 0x83A3 +#define GL_RGBA_DXT5_S3TC 0x83A4 +#define GL_RGBA4_DXT5_S3TC 0x83A5 #endif #ifndef GL_ATI_draw_buffers @@ -4278,7 +4919,7 @@ extern "C" { #endif #ifndef GL_ATI_pixel_format_float -#define GL_TYPE_RGBA_FLOAT_ATI 0x8820 +#define GL_RGBA_FLOAT_MODE_ATI 0x8820 #define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 #endif @@ -4738,7 +5379,7 @@ extern "C" { #define GL_PRIMITIVES_GENERATED_NV 0x8C87 #define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 #define GL_RASTERIZER_DISCARD_NV 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_ATTRIBS_NV 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B #define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C #define GL_SEPARATE_ATTRIBS_NV 0x8C8D @@ -5255,6 +5896,7 @@ extern "C" { #endif #ifndef GL_AMD_debug_output +#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 #define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 #define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 #define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 @@ -5478,6 +6120,24 @@ extern "C" { #ifndef GL_NV_shader_atomic_float #endif +#ifndef GL_AMD_query_buffer_object +#define GL_QUERY_BUFFER_AMD 0x9192 +#define GL_QUERY_BUFFER_BINDING_AMD 0x9193 +#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 +#endif + +#ifndef GL_AMD_sparse_texture +#define GL_VIRTUAL_PAGE_SIZE_X_AMD 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_AMD 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_AMD 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_AMD 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS 0x919A +#define GL_MIN_SPARSE_LEVEL_AMD 0x919B +#define GL_MIN_LOD_WARNING_AMD 0x919C +#define GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001 +#endif + /*************************************************************/ @@ -5502,9 +6162,7 @@ typedef ptrdiff_t GLsizeiptrARB; #ifndef GL_ARB_shader_objects /* GL types for program/shader text and shader object handles */ typedef char GLcharARB; -//#if !defined(MAC_OS_X_VERSION_10_7) typedef unsigned int GLhandleARB; -//#endif #endif /* GL type for "half" precision (s10e5) float data in host memory */ @@ -5579,6 +6237,10 @@ typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLen typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); #endif +#ifndef GL_KHR_debug +typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); +#endif + #ifndef GL_NV_vdpau_interop typedef GLintptr GLvdpauSurfaceNV; #endif @@ -5592,18 +6254,6 @@ GLAPI void APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLAPI void APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); GLAPI void APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); GLAPI void APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); -typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#endif - -#ifndef GL_VERSION_1_2_DEPRECATED -#define GL_VERSION_1_2_DEPRECATED 1 -#ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); GLAPI void APIENTRY glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params); GLAPI void APIENTRY glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params); @@ -5637,6 +6287,12 @@ GLAPI void APIENTRY glMinmax (GLenum target, GLenum internalformat, GLboolean si GLAPI void APIENTRY glResetHistogram (GLenum target); GLAPI void APIENTRY glResetMinmax (GLenum target); #endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); @@ -5683,21 +6339,6 @@ GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); GLAPI void APIENTRY glGetCompressedTexImage (GLenum target, GLint level, GLvoid *img); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); -#endif - -#ifndef GL_VERSION_1_3_DEPRECATED -#define GL_VERSION_1_3_DEPRECATED 1 -#ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glClientActiveTexture (GLenum texture); GLAPI void APIENTRY glMultiTexCoord1d (GLenum target, GLdouble s); GLAPI void APIENTRY glMultiTexCoord1dv (GLenum target, const GLdouble *v); @@ -5736,6 +6377,15 @@ GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *m); GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *m); GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *m); #endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); @@ -5779,25 +6429,12 @@ typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); #define GL_VERSION_1_4 1 #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -GLAPI void APIENTRY glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -GLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount); +GLAPI void APIENTRY glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); +GLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount); GLAPI void APIENTRY glPointParameterf (GLenum pname, GLfloat param); GLAPI void APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params); GLAPI void APIENTRY glPointParameteri (GLenum pname, GLint param); GLAPI void APIENTRY glPointParameteriv (GLenum pname, const GLint *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); -#endif - -#ifndef GL_VERSION_1_4_DEPRECATED -#define GL_VERSION_1_4_DEPRECATED 1 -#ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glFogCoordf (GLfloat coord); GLAPI void APIENTRY glFogCoordfv (const GLfloat *coord); GLAPI void APIENTRY glFogCoordd (GLdouble coord); @@ -5837,6 +6474,13 @@ GLAPI void APIENTRY glWindowPos3iv (const GLint *v); GLAPI void APIENTRY glWindowPos3s (GLshort x, GLshort y, GLshort z); GLAPI void APIENTRY glWindowPos3sv (const GLshort *v); #endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord); typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord); @@ -6263,13 +6907,13 @@ typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint ind /* ARB_copy_buffer */ /* ARB_uniform_buffer_object */ #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -GLAPI void APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +GLAPI void APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei instancecount); +GLAPI void APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount); GLAPI void APIENTRY glTexBuffer (GLenum target, GLenum internalformat, GLuint buffer); GLAPI void APIENTRY glPrimitiveRestartIndex (GLuint index); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount); typedef void (APIENTRYP PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer); typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint index); #endif @@ -6364,6 +7008,33 @@ typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, /* ARB_texture_storage */ #endif +#ifndef GL_VERSION_4_3 +#define GL_VERSION_4_3 1 +/* OpenGL 4.3 reuses entry points from these extensions: */ +/* ARB_arrays_of_arrays (no entry points, GLSL only) */ +/* ARB_fragment_layer_viewport (no entry points, GLSL only) */ +/* ARB_shader_image_size (no entry points, GLSL only) */ +/* ARB_ES3_compatibility (no entry points) */ +/* ARB_clear_buffer_object */ +/* ARB_compute_shader */ +/* ARB_copy_image */ +/* KHR_debug (includes ARB_debug_output commands promoted to KHR without suffixes) */ +/* ARB_explicit_uniform_location (no entry points) */ +/* ARB_framebuffer_no_attachments */ +/* ARB_internalformat_query2 */ +/* ARB_invalidate_subdata */ +/* ARB_multi_draw_indirect */ +/* ARB_program_interface_query */ +/* ARB_robust_buffer_access_behavior (no entry points) */ +/* ARB_shader_storage_buffer_object */ +/* ARB_stencil_texturing (no entry points) */ +/* ARB_texture_buffer_range */ +/* ARB_texture_query_levels (no entry points) */ +/* ARB_texture_storage_multisample */ +/* ARB_texture_view */ +/* ARB_vertex_attrib_binding */ +#endif + #ifndef GL_ARB_multitexture #define GL_ARB_multitexture 1 #ifdef GL_GLEXT_PROTOTYPES @@ -7118,13 +7789,13 @@ typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum w #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); GLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); -GLAPI void APIENTRY glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex); -GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, const GLint *basevertex); +GLAPI void APIENTRY glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount, GLint basevertex); +GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount, const GLint *basevertex); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, const GLint *basevertex); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount, GLint basevertex); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount, const GLint *basevertex); #endif #ifndef GL_ARB_fragment_coord_conventions @@ -7802,13 +8473,13 @@ typedef void (APIENTRYP PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint locati #ifndef GL_ARB_base_instance #define GL_ARB_base_instance 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawArraysInstancedBaseInstance (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance); -GLAPI void APIENTRY glDrawElementsInstancedBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLuint baseinstance); -GLAPI void APIENTRY glDrawElementsInstancedBaseVertexBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLint basevertex, GLuint baseinstance); +GLAPI void APIENTRY glDrawArraysInstancedBaseInstance (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); +GLAPI void APIENTRY glDrawElementsInstancedBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); +GLAPI void APIENTRY glDrawElementsInstancedBaseVertexBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLuint baseinstance); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLint basevertex, GLuint baseinstance); +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); #endif #ifndef GL_ARB_shading_language_420pack @@ -7818,11 +8489,11 @@ typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (G #ifndef GL_ARB_transform_feedback_instanced #define GL_ARB_transform_feedback_instanced 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawTransformFeedbackInstanced (GLenum mode, GLuint id, GLsizei primcount); -GLAPI void APIENTRY glDrawTransformFeedbackStreamInstanced (GLenum mode, GLuint id, GLuint stream, GLsizei primcount); +GLAPI void APIENTRY glDrawTransformFeedbackInstanced (GLenum mode, GLuint id, GLsizei instancecount); +GLAPI void APIENTRY glDrawTransformFeedbackStreamInstanced (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei primcount); -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei instancecount); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount); #endif #ifndef GL_ARB_compressed_texture_pixel_storage @@ -7885,6 +8556,242 @@ typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum ta typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); #endif +#ifndef GL_KHR_texture_compression_astc_ldr +#define GL_KHR_texture_compression_astc_ldr 1 +#endif + +#ifndef GL_KHR_debug +#define GL_KHR_debug 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDebugMessageControl (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +GLAPI void APIENTRY glDebugMessageInsert (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +GLAPI void APIENTRY glDebugMessageCallback (GLDEBUGPROC callback, const void *userParam); +GLAPI GLuint APIENTRY glGetDebugMessageLog (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +GLAPI void APIENTRY glPushDebugGroup (GLenum source, GLuint id, GLsizei length, const GLchar *message); +GLAPI void APIENTRY glPopDebugGroup (void); +GLAPI void APIENTRY glObjectLabel (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); +GLAPI void APIENTRY glGetObjectLabel (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); +GLAPI void APIENTRY glObjectPtrLabel (const void *ptr, GLsizei length, const GLchar *label); +GLAPI void APIENTRY glGetObjectPtrLabel (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam); +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +typedef void (APIENTRYP PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message); +typedef void (APIENTRYP PFNGLPOPDEBUGGROUPPROC) (void); +typedef void (APIENTRYP PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); +typedef void (APIENTRYP PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); +typedef void (APIENTRYP PFNGLOBJECTPTRLABELPROC) (const void *ptr, GLsizei length, const GLchar *label); +typedef void (APIENTRYP PFNGLGETOBJECTPTRLABELPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); +#endif + +#ifndef GL_ARB_arrays_of_arrays +#define GL_ARB_arrays_of_arrays 1 +#endif + +#ifndef GL_ARB_clear_buffer_object +#define GL_ARB_clear_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClearBufferData (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glClearBufferSubData (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glClearNamedBufferDataEXT (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glClearNamedBufferSubDataEXT (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, GLsizeiptr offset, GLsizeiptr size, const void *data); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, GLsizeiptr offset, GLsizeiptr size, const void *data); +#endif + +#ifndef GL_ARB_compute_shader +#define GL_ARB_compute_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDispatchCompute (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); +GLAPI void APIENTRY glDispatchComputeIndirect (GLintptr indirect); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); +typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect); +#endif + +#ifndef GL_ARB_copy_image +#define GL_ARB_copy_image 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyImageSubData (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +#endif + +#ifndef GL_ARB_texture_view +#define GL_ARB_texture_view 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureView (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); +#endif + +#ifndef GL_ARB_vertex_attrib_binding +#define GL_ARB_vertex_attrib_binding 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindVertexBuffer (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +GLAPI void APIENTRY glVertexAttribFormat (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +GLAPI void APIENTRY glVertexAttribIFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI void APIENTRY glVertexAttribLFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI void APIENTRY glVertexAttribBinding (GLuint attribindex, GLuint bindingindex); +GLAPI void APIENTRY glVertexBindingDivisor (GLuint bindingindex, GLuint divisor); +GLAPI void APIENTRY glVertexArrayBindVertexBufferEXT (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +GLAPI void APIENTRY glVertexArrayVertexAttribFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +GLAPI void APIENTRY glVertexArrayVertexAttribIFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI void APIENTRY glVertexArrayVertexAttribLFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI void APIENTRY glVertexArrayVertexAttribBindingEXT (GLuint vaobj, GLuint attribindex, GLuint bindingindex); +GLAPI void APIENTRY glVertexArrayVertexBindingDivisorEXT (GLuint vaobj, GLuint bindingindex, GLuint divisor); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex); +typedef void (APIENTRYP PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor); +typedef void (APIENTRYP PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor); +#endif + +#ifndef GL_ARB_robustness_isolation +#define GL_ARB_robustness_isolation 1 +#endif + +#ifndef GL_ARB_ES3_compatibility +#define GL_ARB_ES3_compatibility 1 +#endif + +#ifndef GL_ARB_explicit_uniform_location +#define GL_ARB_explicit_uniform_location 1 +#endif + +#ifndef GL_ARB_fragment_layer_viewport +#define GL_ARB_fragment_layer_viewport 1 +#endif + +#ifndef GL_ARB_framebuffer_no_attachments +#define GL_ARB_framebuffer_no_attachments 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFramebufferParameteri (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glGetFramebufferParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glNamedFramebufferParameteriEXT (GLuint framebuffer, GLenum pname, GLint param); +GLAPI void APIENTRY glGetNamedFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params); +#endif + +#ifndef GL_ARB_internalformat_query2 +#define GL_ARB_internalformat_query2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetInternalformati64v (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params); +#endif + +#ifndef GL_ARB_invalidate_subdata +#define GL_ARB_invalidate_subdata 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glInvalidateTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); +GLAPI void APIENTRY glInvalidateTexImage (GLuint texture, GLint level); +GLAPI void APIENTRY glInvalidateBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr length); +GLAPI void APIENTRY glInvalidateBufferData (GLuint buffer); +GLAPI void APIENTRY glInvalidateFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments); +GLAPI void APIENTRY glInvalidateSubFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); +typedef void (APIENTRYP PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (APIENTRYP PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments); +typedef void (APIENTRYP PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); +#endif + +#ifndef GL_ARB_multi_draw_indirect +#define GL_ARB_multi_draw_indirect 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysIndirect (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); +GLAPI void APIENTRY glMultiDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); +#endif + +#ifndef GL_ARB_program_interface_query +#define GL_ARB_program_interface_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetProgramInterfaceiv (GLuint program, GLenum programInterface, GLenum pname, GLint *params); +GLAPI GLuint APIENTRY glGetProgramResourceIndex (GLuint program, GLenum programInterface, const GLchar *name); +GLAPI void APIENTRY glGetProgramResourceName (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); +GLAPI void APIENTRY glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params); +GLAPI GLint APIENTRY glGetProgramResourceLocation (GLuint program, GLenum programInterface, const GLchar *name); +GLAPI GLint APIENTRY glGetProgramResourceLocationIndex (GLuint program, GLenum programInterface, const GLchar *name); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint *params); +typedef GLuint (APIENTRYP PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name); +typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); +typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params); +typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name); +#endif + +#ifndef GL_ARB_robust_buffer_access_behavior +#define GL_ARB_robust_buffer_access_behavior 1 +#endif + +#ifndef GL_ARB_shader_image_size +#define GL_ARB_shader_image_size 1 +#endif + +#ifndef GL_ARB_shader_storage_buffer_object +#define GL_ARB_shader_storage_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glShaderStorageBlockBinding (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); +#endif + +#ifndef GL_ARB_stencil_texturing +#define GL_ARB_stencil_texturing 1 +#endif + +#ifndef GL_ARB_texture_buffer_range +#define GL_ARB_texture_buffer_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBufferRange (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glTextureBufferRangeEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLTEXTUREBUFFERRANGEEXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +#endif + +#ifndef GL_ARB_texture_query_levels +#define GL_ARB_texture_query_levels 1 +#endif + +#ifndef GL_ARB_texture_storage_multisample +#define GL_ARB_texture_storage_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexStorage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTexStorage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTextureStorage2DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTextureStorage3DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +#endif + #ifndef GL_EXT_abgr #define GL_EXT_abgr 1 #endif @@ -8626,11 +9533,15 @@ GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum target, GLenum pname, GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum target, GLenum pname, GLfloat param); GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum target, GLenum pname, const GLint *params); GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetPixelTransformParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetPixelTransformParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); #endif #ifndef GL_EXT_pixel_transform_color_table @@ -8982,11 +9893,11 @@ typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLen #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glVertexWeightfEXT (GLfloat weight); GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *weight); -GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glVertexWeightPointerEXT (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); #endif #ifndef GL_NV_light_max_exponent @@ -10050,10 +10961,10 @@ typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, c #ifndef GL_NV_pixel_data_range #define GL_NV_pixel_data_range 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelDataRangeNV (GLenum target, GLsizei length, GLvoid *pointer); +GLAPI void APIENTRY glPixelDataRangeNV (GLenum target, GLsizei length, const GLvoid *pointer); GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum target); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, const GLvoid *pointer); typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); #endif @@ -11562,7 +12473,7 @@ typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glVDPAUInitNV (const GLvoid *vdpDevice, const GLvoid *getProcAddress); GLAPI void APIENTRY glVDPAUFiniNV (void); -GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceNV (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceNV (const GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterOutputSurfaceNV (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); GLAPI void APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface); GLAPI void APIENTRY glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface); @@ -11573,7 +12484,7 @@ GLAPI void APIENTRY glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSur #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLVDPAUINITNVPROC) (const GLvoid *vdpDevice, const GLvoid *getProcAddress); typedef void (APIENTRYP PFNGLVDPAUFININVPROC) (void); -typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); typedef void (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); typedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); @@ -11807,6 +12718,20 @@ typedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle) #define GL_NV_shader_atomic_float 1 #endif +#ifndef GL_AMD_query_buffer_object +#define GL_AMD_query_buffer_object 1 +#endif + +#ifndef GL_AMD_sparse_texture +#define GL_AMD_sparse_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexStorageSparseAMD (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +GLAPI void APIENTRY glTextureStorageSparseAMD (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXSTORAGESPARSEAMDPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +typedef void (APIENTRYP PFNGLTEXTURESTORAGESPARSEAMDPROC) (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +#endif + #ifdef __cplusplus } diff --git a/code/nel/src/3d/driver/opengl/GL/glxext.h b/code/nel/src/3d/driver/opengl/GL/glxext.h index e640ff7e3..580ba347d 100644 --- a/code/nel/src/3d/driver/opengl/GL/glxext.h +++ b/code/nel/src/3d/driver/opengl/GL/glxext.h @@ -444,6 +444,10 @@ extern "C" { #define GLX_LATE_SWAPS_TEAR_EXT 0x20F3 #endif +#ifndef GLX_EXT_buffer_age +#define GLX_BACK_BUFFER_AGE_EXT 0x20F4 +#endif + /*************************************************************/ @@ -993,6 +997,10 @@ typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, #define GLX_EXT_swap_control_tear 1 #endif +#ifndef GLX_EXT_buffer_age +#define GLX_EXT_buffer_age 1 +#endif + #ifdef __cplusplus } diff --git a/code/nel/src/3d/driver/opengl/GLES/glext.h b/code/nel/src/3d/driver/opengl/GLES/glext.h index d591832bf..5b46ae6d0 100644 --- a/code/nel/src/3d/driver/opengl/GLES/glext.h +++ b/code/nel/src/3d/driver/opengl/GLES/glext.h @@ -1,7 +1,7 @@ #ifndef __glext_h_ #define __glext_h_ -/* $Revision: 16481 $ on $Date:: 2012-01-04 10:43:56 -0800 #$ */ +/* $Revision: 19260 $ on $Date:: 2012-09-20 11:30:36 -0700 #$ */ #ifdef __cplusplus extern "C" { @@ -165,6 +165,9 @@ typedef void* GLeglImageOES; #define GL_DEPTH24_STENCIL8_OES 0x88F0 #endif +/* GL_OES_required_internalformat */ +/* No new tokens introduced by this extension. */ + /* GL_OES_rgb8_rgba8 */ #ifndef GL_OES_rgb8_rgba8 #define GL_RGB8_OES 0x8051 @@ -240,7 +243,7 @@ typedef void* GLeglImageOES; * APPLE extension tokens *------------------------------------------------------------------------*/ -/* GL_APPLE_texture_2D_limited_npot */ +/* GL_APPLE_copy_texture_levels */ /* No new tokens introduced by this extension. */ /* GL_APPLE_framebuffer_multisample */ @@ -254,6 +257,41 @@ typedef void* GLeglImageOES; #define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA #endif +/* GL_APPLE_sync */ +#ifndef GL_APPLE_sync + +/* These types are defined with reference to + * in the Apple extension spec, but here we use the Khronos + * portable types in khrplatform.h, and assume those types + * are always defined. + * If any other extensions using these types are defined, + * the typedefs must move out of this block and be shared. + */ +typedef khronos_int64_t GLint64; +typedef khronos_uint64_t GLuint64; +typedef struct __GLsync *GLsync; + +#define GL_SYNC_OBJECT_APPLE 0x8A53 +#define GL_MAX_SERVER_WAIT_TIMEOUT_APPLE 0x9111 +#define GL_OBJECT_TYPE_APPLE 0x9112 +#define GL_SYNC_CONDITION_APPLE 0x9113 +#define GL_SYNC_STATUS_APPLE 0x9114 +#define GL_SYNC_FLAGS_APPLE 0x9115 +#define GL_SYNC_FENCE_APPLE 0x9116 +#define GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE 0x9117 +#define GL_UNSIGNALED_APPLE 0x9118 +#define GL_SIGNALED_APPLE 0x9119 +#define GL_ALREADY_SIGNALED_APPLE 0x911A +#define GL_TIMEOUT_EXPIRED_APPLE 0x911B +#define GL_CONDITION_SATISFIED_APPLE 0x911C +#define GL_WAIT_FAILED_APPLE 0x911D +#define GL_SYNC_FLUSH_COMMANDS_BIT_APPLE 0x00000001 +#define GL_TIMEOUT_IGNORED_APPLE 0xFFFFFFFFFFFFFFFFull +#endif + +/* GL_APPLE_texture_2D_limited_npot */ +/* No new tokens introduced by this extension. */ + /* GL_APPLE_texture_format_BGRA8888 */ #ifndef GL_APPLE_texture_format_BGRA8888 #define GL_BGRA_EXT 0x80E1 @@ -288,12 +326,23 @@ typedef void* GLeglImageOES; #define GL_STENCIL_EXT 0x1802 #endif +/* GL_EXT_map_buffer_range */ +#ifndef GL_EXT_map_buffer_range +#define GL_MAP_READ_BIT_EXT 0x0001 +#define GL_MAP_WRITE_BIT_EXT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT_EXT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT_EXT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT_EXT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT_EXT 0x0020 +#endif + /* GL_EXT_multisampled_render_to_texture */ #ifndef GL_EXT_multisampled_render_to_texture #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C -#define GL_RENDERBUFFER_SAMPLES_EXT 0x9133 -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x9134 -#define GL_MAX_SAMPLES_EXT 0x9135 +/* reuse values from GL_EXT_framebuffer_multisample (desktop extension) */ +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 #endif /* GL_EXT_multi_draw_arrays */ @@ -353,10 +402,10 @@ typedef void* GLeglImageOES; /* GL_EXT_texture_storage */ #ifndef GL_EXT_texture_storage #define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F -#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA8_EXT 0x803C #define GL_LUMINANCE8_EXT 0x8040 #define GL_LUMINANCE8_ALPHA8_EXT 0x8045 -#define GL_RGBA32F_EXT 0x8814 +#define GL_RGBA32F_EXT 0x8814 #define GL_RGB32F_EXT 0x8815 #define GL_ALPHA32F_EXT 0x8816 #define GL_LUMINANCE32F_EXT 0x8818 @@ -366,7 +415,7 @@ typedef void* GLeglImageOES; #define GL_ALPHA16F_EXT 0x881C #define GL_LUMINANCE16F_EXT 0x881E #define GL_LUMINANCE_ALPHA16F_EXT 0x881F -#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGB10_A2_EXT 0x8059 #define GL_RGB10_EXT 0x8052 #define GL_BGRA8_EXT 0x93A1 #endif @@ -771,6 +820,11 @@ typedef void (GL_APIENTRYP PFNGLWEIGHTPOINTEROESPROC) (GLint size, GLenum type, #define GL_OES_packed_depth_stencil 1 #endif +/* GL_OES_required_internalformat */ +#ifndef GL_OES_required_internalformat +#define GL_OES_required_internalformat 1 +#endif + /* GL_OES_query_matrix */ #ifndef GL_OES_query_matrix #define GL_OES_query_matrix 1 @@ -892,9 +946,13 @@ typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array); * APPLE extension functions *------------------------------------------------------------------------*/ -/* GL_APPLE_texture_2D_limited_npot */ -#ifndef GL_APPLE_texture_2D_limited_npot -#define GL_APPLE_texture_2D_limited_npot 1 +/* GL_APPLE_copy_texture_levels */ +#ifndef GL_APPLE_copy_texture_levels +#define GL_APPLE_copy_texture_levels 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glCopyTextureLevelsAPPLE (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); +#endif +typedef void (GL_APIENTRYP PFNGLCOPYTEXTURELEVELSAPPLEPROC) (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); #endif /* GL_APPLE_framebuffer_multisample */ @@ -908,6 +966,32 @@ typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void); #endif +/* GL_APPLE_sync */ +#ifndef GL_APPLE_sync +#define GL_APPLE_sync 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API GLsync GL_APIENTRY glFenceSyncAPPLE (GLenum condition, GLbitfield flags); +GL_API GLboolean GL_APIENTRY glIsSyncAPPLE (GLsync sync); +GL_API void GL_APIENTRY glDeleteSyncAPPLE (GLsync sync); +GL_API GLenum GL_APIENTRY glClientWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout); +GL_API void GL_APIENTRY glWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout); +GL_API void GL_APIENTRY glGetInteger64vAPPLE (GLenum pname, GLint64 *params); +GL_API void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +#endif +typedef GLsync (GL_APIENTRYP PFNGLFENCESYNCAPPLEPROC) (GLenum condition, GLbitfield flags); +typedef GLboolean (GL_APIENTRYP PFNGLISSYNCAPPLEPROC) (GLsync sync); +typedef void (GL_APIENTRYP PFNGLDELETESYNCAPPLEPROC) (GLsync sync); +typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (GL_APIENTRYP PFNGLWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (GL_APIENTRYP PFNGLGETINTEGER64VAPPLEPROC) (GLenum pname, GLint64 *params); +typedef void (GL_APIENTRYP PFNGLGETSYNCIVAPPLEPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +#endif + +/* GL_APPLE_texture_2D_limited_npot */ +#ifndef GL_APPLE_texture_2D_limited_npot +#define GL_APPLE_texture_2D_limited_npot 1 +#endif + /* GL_APPLE_texture_format_BGRA8888 */ #ifndef GL_APPLE_texture_format_BGRA8888 #define GL_APPLE_texture_format_BGRA8888 1 @@ -945,6 +1029,17 @@ GL_API void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttac typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments); #endif +/* GL_EXT_map_buffer_range */ +#ifndef GL_EXT_map_buffer_range +#define GL_EXT_map_buffer_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY *glMapBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +GL_API void GL_APIENTRY glFlushMappedBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length); +#endif +typedef void* (GL_APIENTRYP PFNGLMAPBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +#endif + /* GL_EXT_multisampled_render_to_texture */ #ifndef GL_EXT_multisampled_render_to_texture #define GL_EXT_multisampled_render_to_texture 1 @@ -1068,8 +1163,8 @@ typedef void (GL_APIENTRYP PFNGLCLIPPLANEXIMGPROC) (GLenum p, const GLfixed *eqn GL_API void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum, GLsizei, GLenum, GLsizei, GLsizei); GL_API void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei); #endif -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMG) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMG) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); +typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); #endif /*------------------------------------------------------------------------* diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.cpp b/code/nel/src/3d/driver/opengl/driver_opengl.cpp index b4cff6121..29e14a1a0 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl.cpp @@ -161,21 +161,12 @@ const uint CDriverGL::_EVSNumConstant = 97; GLenum CDriverGL::NLCubeFaceToGLCubeFace[6] = { -#ifdef USE_OPENGLES - GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES, - GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES, - GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES, - GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES, - GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES, - GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES -#else GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB, GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB, GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB -#endif }; // *************************************************************************** @@ -305,6 +296,8 @@ CDriverGL::CDriverGL() _NVTextureShaderEnabled = false; + _AnisotropicFilter = 0.f; + // Compute the Flag which say if one texture has been changed in CMaterial. _MaterialAllTextureTouchedFlag= 0; for(i=0; i < IDRV_MAT_MAXTEXTURES; i++) @@ -1337,11 +1330,7 @@ void CDriverGL::copyFrameBufferToTexture(ITexture *tex, { if(_Extensions.ARBTextureCubeMap) { -#ifdef USE_OPENGLES - glBindTexture(GL_TEXTURE_CUBE_MAP_OES, gltext->ID); -#else glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, gltext->ID); -#endif glCopyTexSubImage2D(NLCubeFaceToGLCubeFace[cubeFace], level, offsetx, offsety, x, y, width, height); } } @@ -2626,11 +2615,10 @@ void CDriverGL::checkTextureOn() const GLboolean flagCM; GLboolean flagTR; glGetBooleanv(GL_TEXTURE_2D, &flag2D); + glGetBooleanv(GL_TEXTURE_CUBE_MAP_ARB, &flagCM); #ifdef USE_OPENGLES - glGetBooleanv(GL_TEXTURE_CUBE_MAP_OES, &flagCM); flagTR = true; // always true in OpenGL ES #else - glGetBooleanv(GL_TEXTURE_CUBE_MAP_ARB, &flagCM); glGetBooleanv(GL_TEXTURE_RECTANGLE_NV, &flagTR); #endif switch(dgs.getTextureMode()) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.h b/code/nel/src/3d/driver/opengl/driver_opengl.h index 66e0b1325..bfe73492d 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.h +++ b/code/nel/src/3d/driver/opengl/driver_opengl.h @@ -364,6 +364,7 @@ public: virtual bool uploadTextureCube (ITexture& tex, NLMISC::CRect& rect, uint8 nNumMipMap, uint8 nNumFace); virtual void forceDXTCCompression(bool dxtcComp); + virtual void setAnisotropicFilter(sint filter); virtual void forceTextureResize(uint divisor); @@ -955,6 +956,8 @@ private: bool _NVTextureShaderEnabled; // Which stages support EMBM bool _StageSupportEMBM[IDRV_MAT_MAXTEXTURES]; + // Anisotropic filtering value + float _AnisotropicFilter; // Prec settings for material. CDriverGLStates _DriverGLStates; diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp index 770e273dc..d38ff8f51 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp @@ -628,7 +628,7 @@ static bool setupARBTextureNonPowerOfTwo(const char *glext) { H_AUTO_OGL(setupARBTextureCompression); -#ifndef USE_OPENGL_ES +#ifndef USE_OPENGLES CHECK_EXT("GL_ARB_texture_non_power_of_two"); #endif @@ -805,20 +805,20 @@ static bool setupARBTextureCubeMap(const char *glext) #ifdef USE_OPENGLES CHECK_EXT("OES_texture_cube_map"); + + CHECK_ADDRESS(NEL_PFNGLTEXGENFOESPROC, glTexGenfOES); + CHECK_ADDRESS(NEL_PFNGLTEXGENFVOESPROC, glTexGenfvOES); + CHECK_ADDRESS(NEL_PFNGLTEXGENIOESPROC, glTexGeniOES); + CHECK_ADDRESS(NEL_PFNGLTEXGENIVOESPROC, glTexGenivOES); + CHECK_ADDRESS(NEL_PFNGLTEXGENXOESPROC, glTexGenxOES); + CHECK_ADDRESS(NEL_PFNGLTEXGENXVOESPROC, glTexGenxvOES); + CHECK_ADDRESS(NEL_PFNGLGETTEXGENFVOESPROC, glGetTexGenfvOES); + CHECK_ADDRESS(NEL_PFNGLGETTEXGENIVOESPROC, glGetTexGenivOES); + CHECK_ADDRESS(NEL_PFNGLGETTEXGENXVOESPROC, glGetTexGenxvOES); #else CHECK_EXT("GL_ARB_texture_cube_map"); #endif -// CHECK_ADDRESS(NEL_PFNGLTEXGENFOESPROC, glTexGenfOES); -// CHECK_ADDRESS(NEL_PFNGLTEXGENFVOESPROC, glTexGenfvOES); -// CHECK_ADDRESS(NEL_PFNGLTEXGENIOESPROC, glTexGeniOES); -// CHECK_ADDRESS(NEL_PFNGLTEXGENIVOESPROC, glTexGenivOES); -// CHECK_ADDRESS(NEL_PFNGLTEXGENXOESPROC, glTexGenxOES); -// CHECK_ADDRESS(NEL_PFNGLTEXGENXVOESPROC, glTexGenxvOES); -// CHECK_ADDRESS(NEL_PFNGLGETTEXGENFVOESPROC, glGetTexGenfvOES); -// CHECK_ADDRESS(NEL_PFNGLGETTEXGENIVOESPROC, glGetTexGenivOES); -// CHECK_ADDRESS(NEL_PFNGLGETTEXGENXVOESPROC, glGetTexGenxvOES); - return true; } @@ -1499,11 +1499,7 @@ void registerGlExtensions(CGlExtensions &ext) ext.ARBMultiTexture= setupARBMultiTexture(glext); if(ext.ARBMultiTexture) { -#ifdef USE_OPENGLES - glGetIntegerv(GL_MAX_TEXTURE_UNITS, &ntext); -#else glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &ntext); -#endif // We could have more than IDRV_MAT_MAXTEXTURES but the interface only // support IDRV_MAT_MAXTEXTURES texture stages so take min ext.NbTextureStages= (ntext<((GLint)IDRV_MAT_MAXTEXTURES)?ntext:IDRV_MAT_MAXTEXTURES); diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_extension.h b/code/nel/src/3d/driver/opengl/driver_opengl_extension.h index 5d58840c1..9d28a15ab 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_extension.h +++ b/code/nel/src/3d/driver/opengl/driver_opengl_extension.h @@ -55,12 +55,12 @@ struct CGlExtensions bool NVTextureEnvCombine4; bool ARBTextureCubeMap; bool NVVertexProgram; - bool EXTVertexShader; + bool EXTVertexShader; bool NVTextureShader; - bool NVOcclusionQuery; + bool NVOcclusionQuery; bool NVTextureRectangle; - bool EXTTextureRectangle; - bool ARBTextureRectangle; + bool EXTTextureRectangle; + bool ARBTextureRectangle; bool FrameBufferObject; bool FrameBufferBlit; bool FrameBufferMultisample; @@ -89,10 +89,10 @@ struct CGlExtensions // ATI Extensions. bool ATIVertexArrayObject; - bool ATIMapObjectBuffer; + bool ATIMapObjectBuffer; bool ATITextureEnvCombine3; - bool ATIEnvMapBumpMap; - bool ATIFragmentShader; + bool ATIEnvMapBumpMap; + bool ATIFragmentShader; bool ATIXTextureEnvRoute; bool ATIVertexAttribArrayObject; // ARB Extensions @@ -157,7 +157,7 @@ public: NVTextureRectangle = false; EXTTextureRectangle = false; EXTTextureFilterAnisotropic = false; - EXTTextureFilterAnisotropicMaximum = 1.f; + EXTTextureFilterAnisotropicMaximum = 0.f; ARBTextureRectangle = false; ARBTextureNonPowerOfTwo = false; ARBMultisample = false; @@ -781,3 +781,4 @@ extern NEL_PFNGLSAMPLECOVERAGEARBPROC nglSampleCoverageARB; #endif // USE_OPENGLES #endif // NL_OPENGL_EXTENSION_H + diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_extension_def.h b/code/nel/src/3d/driver/opengl/driver_opengl_extension_def.h index d8862ff14..a11d0cd1c 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_extension_def.h +++ b/code/nel/src/3d/driver/opengl/driver_opengl_extension_def.h @@ -63,6 +63,27 @@ typedef void (APIENTRY * NEL_PFNGLGETTEXGENFVOESPROC) (GLenum coord, GLenum pnam typedef void (APIENTRY * NEL_PFNGLGETTEXGENIVOESPROC) (GLenum coord, GLenum pname, GLint *params); typedef void (APIENTRY * NEL_PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pname, GLfixed *params); +#define GL_MULTISAMPLE_ARB GL_MULTISAMPLE +#define GL_TEXTURE_CUBE_MAP_ARB GL_TEXTURE_CUBE_MAP_OES +#define GL_NONE 0 +#define GL_MAX_TEXTURE_UNITS_ARB GL_MAX_TEXTURE_UNITS +#define GL_REFLECTION_MAP_ARB GL_REFLECTION_MAP_OES +#define GL_RGB_SCALE_EXT GL_RGB_SCALE +#define GL_REFLECTION_MAP_ARB GL_REFLECTION_MAP_OES +#define GL_PREVIOUS_EXT GL_PREVIOUS +#define GL_PRIMARY_COLOR_EXT GL_PRIMARY_COLOR +#define GL_CONSTANT_EXT GL_CONSTANT +#define GL_ADD_SIGNED_EXT GL_ADD_SIGNED +#define GL_INTERPOLATE_EXT GL_INTERPOLATE +#define GL_BUMP_ENVMAP_ATI GL_INTERPOLATE + +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES + #else // *************************************************************************** diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_inputs.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_inputs.cpp index 81fea5333..4064c8819 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_inputs.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_inputs.cpp @@ -17,7 +17,7 @@ #include "stdopengl.h" #include "driver_opengl.h" -#ifdef NL_OS_UNIX +#if defined(NL_OS_UNIX) && !defined(NL_OS_MAC) # include # ifdef HAVE_XRENDER # include @@ -25,7 +25,7 @@ # ifdef HAVE_XCURSOR # include # endif // HAVE_XCURSOR -#endif // NL_OS_UNIX +#endif // defined(NL_OS_UNIX) && !defined(NL_OS_MAC) #include "nel/misc/mouse_device.h" #include "nel/misc/di_event_emitter.h" diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp index ff73eb480..6d9dbb247 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp @@ -87,10 +87,9 @@ static inline void convTexAddr(ITexture *tex, CMaterial::TTexAddressingMode mode nlassert(mode < CMaterial::TexAddrCount); static const GLenum glTex2dAddrModesNV[] = { -#ifdef USE_OPENGLES - 0, GL_TEXTURE_2D -#else - GL_NONE, GL_TEXTURE_2D, GL_PASS_THROUGH_NV, GL_CULL_FRAGMENT_NV, + GL_NONE, GL_TEXTURE_2D, +#ifndef USE_OPENGLES + GL_PASS_THROUGH_NV, GL_CULL_FRAGMENT_NV, GL_OFFSET_TEXTURE_2D_NV, GL_OFFSET_TEXTURE_2D_SCALE_NV, GL_DEPENDENT_AR_TEXTURE_2D_NV, GL_DEPENDENT_GB_TEXTURE_2D_NV, GL_DOT_PRODUCT_NV, GL_DOT_PRODUCT_TEXTURE_2D_NV, GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV, @@ -101,10 +100,9 @@ static inline void convTexAddr(ITexture *tex, CMaterial::TTexAddressingMode mode static const GLenum glTexCubeAddrModesNV[] = { -#ifdef USE_OPENGLES - 0, GL_TEXTURE_CUBE_MAP_OES -#else - GL_NONE, GL_TEXTURE_CUBE_MAP_ARB, GL_PASS_THROUGH_NV, GL_CULL_FRAGMENT_NV, + GL_NONE, GL_TEXTURE_CUBE_MAP_ARB, +#ifndef USE_OPENGLES + GL_PASS_THROUGH_NV, GL_CULL_FRAGMENT_NV, GL_OFFSET_TEXTURE_2D_NV, GL_OFFSET_TEXTURE_2D_SCALE_NV, GL_DEPENDENT_AR_TEXTURE_2D_NV, GL_DEPENDENT_GB_TEXTURE_2D_NV, GL_DOT_PRODUCT_NV, GL_DOT_PRODUCT_TEXTURE_2D_NV, GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV, @@ -147,11 +145,7 @@ void CDriverGL::setTextureEnvFunction(uint stage, CMaterial& mat) { // Cubic or normal ? if (text->isTextureCube ()) -#ifdef USE_OPENGLES - _DriverGLStates.setTexGenMode (stage, GL_REFLECTION_MAP_OES); -#else _DriverGLStates.setTexGenMode (stage, GL_REFLECTION_MAP_ARB); -#endif else #ifdef USE_OPENGLES _DriverGLStates.setTexGenMode (stage, GL_TEXTURE_CUBE_MAP_OES); @@ -974,11 +968,7 @@ void CDriverGL::setupLightMapPass(uint pass) if (mat._LightMapsMulx2) { // Multiply x 2 -#ifdef USE_OPENGLES - glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE, 2); -#else glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_EXT, 2); -#endif } } } @@ -1087,11 +1077,7 @@ void CDriverGL::endLightMapMultiPass() for (uint32 i = 0; i < (_NLightMapPerPass+1); ++i) { _DriverGLStates.activeTextureARB(i); -#ifdef USE_OPENGLES - glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE, 1); -#else glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_EXT, 1); -#endif } } } @@ -1165,12 +1151,7 @@ void CDriverGL::setupSpecularBegin() // todo hulud remove // _DriverGLStates.setTextureMode(CDriverGLStates::TextureCubeMap); - -#ifdef USE_OPENGLES - _DriverGLStates.setTexGenMode (1, GL_REFLECTION_MAP_OES); -#else _DriverGLStates.setTexGenMode (1, GL_REFLECTION_MAP_ARB); -#endif // setup the good matrix for stage 1. glMatrixMode(GL_TEXTURE); diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_states.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_states.cpp index fa4e626a8..60a0609dc 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_states.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_states.cpp @@ -94,6 +94,7 @@ void CDriverGLStates::forceDefaults(uint nbStages) _CurLighting= false; _CurZWrite= true; _CurStencilTest=false; + _CurMultisample= false; // setup GLStates. glDisable(GL_FOG); @@ -102,6 +103,7 @@ void CDriverGLStates::forceDefaults(uint nbStages) glDisable(GL_ALPHA_TEST); glDisable(GL_LIGHTING); glDepthMask(GL_TRUE); + glDisable(GL_MULTISAMPLE_ARB); // Func. _CurBlendSrc= GL_SRC_ALPHA; @@ -163,11 +165,9 @@ void CDriverGLStates::forceDefaults(uint nbStages) if(_TextureCubeMapSupported) { + glDisable(GL_TEXTURE_CUBE_MAP_ARB); #ifdef USE_OPENGLES - glDisable(GL_TEXTURE_CUBE_MAP_OES); glDisable(GL_TEXTURE_GEN_STR_OES); -#else - glDisable(GL_TEXTURE_CUBE_MAP_ARB); #endif } @@ -379,6 +379,26 @@ void CDriverGLStates::enableStencilTest(bool enable) } } +// *************************************************************************** +void CDriverGLStates::enableMultisample(bool enable) +{ + H_AUTO_OGL(CDriverGLStates_enableMultisample); + + // If different from current setup, update. +#ifndef NL3D_GLSTATE_DISABLE_CACHE + if( enable != _CurMultisample ) +#endif + { + // new state. + _CurMultisample= enable; + + // Setup GLState. + if(_CurMultisample) + glEnable(GL_MULTISAMPLE_ARB); + else + glDisable(GL_MULTISAMPLE_ARB); + } +} // *************************************************************************** void CDriverGLStates::blendFunc(GLenum src, GLenum dst) @@ -665,7 +685,7 @@ void CDriverGLStates::setTexGenMode (uint stage, GLint mode) else { #ifdef USE_OPENGLES -// nglTexGeniOES(GL_TEXTURE_GEN_STR_OES, GL_TEXTURE_GEN_MODE_OES, mode); + nglTexGeniOES(GL_TEXTURE_GEN_STR_OES, GL_TEXTURE_GEN_MODE_OES, mode); #else glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, mode); glTexGeni( GL_T, GL_TEXTURE_GEN_MODE, mode); @@ -681,8 +701,8 @@ void CDriverGLStates::setTexGenMode (uint stage, GLint mode) #ifdef USE_OPENGLES // if(mode==GL_OBJECT_LINEAR || mode==GL_EYE_LINEAR) // { - nglTexGeniOES(GL_TEXTURE_GEN_STR_OES, GL_TEXTURE_GEN_MODE_OES, mode); - glEnable(GL_TEXTURE_GEN_STR_OES); +// nglTexGeniOES(GL_TEXTURE_GEN_STR_OES, GL_TEXTURE_GEN_MODE_OES, mode); +// glEnable(GL_TEXTURE_GEN_STR_OES); // } // else // { @@ -721,11 +741,7 @@ void CDriverGLStates::resetTextureMode() if (_TextureCubeMapSupported) { -#ifdef USE_OPENGLES - glDisable(GL_TEXTURE_CUBE_MAP_OES); -#else glDisable(GL_TEXTURE_CUBE_MAP_ARB); -#endif } #ifndef USE_OPENGLES @@ -768,11 +784,7 @@ void CDriverGLStates::setTextureMode(TTextureMode texMode) { if(_TextureCubeMapSupported) { -#ifdef USE_OPENGLES - glDisable(GL_TEXTURE_CUBE_MAP_OES); -#else glDisable(GL_TEXTURE_CUBE_MAP_ARB); -#endif } else { @@ -802,11 +814,7 @@ void CDriverGLStates::setTextureMode(TTextureMode texMode) { if(_TextureCubeMapSupported) { -#ifdef USE_OPENGLES - glEnable(GL_TEXTURE_CUBE_MAP_OES); -#else glEnable(GL_TEXTURE_CUBE_MAP_ARB); -#endif } else { @@ -851,11 +859,11 @@ void CDriverGLStates::forceActiveTextureARB(uint stage) _CurrentActiveTextureARB= stage; } - // *************************************************************************** void CDriverGLStates::enableVertexArray(bool enable) { - H_AUTO_OGL(CDriverGLStates_enableVertexArray) + H_AUTO_OGL(CDriverGLStates_enableVertexArray); + if(_VertexArrayEnabled != enable) { if(enable) @@ -1017,7 +1025,7 @@ void CDriverGLStates::enableVertexAttribArrayARB(uint glIndex,bool enable) // *************************************************************************** void CDriverGLStates::enableVertexAttribArrayForEXTVertexShader(uint glIndex, bool enable, uint *variants) { - H_AUTO_OGL(CDriverGLStates_enableVertexAttribArrayForEXTVertexShader) + H_AUTO_OGL(CDriverGLStates_enableVertexAttribArrayForEXTVertexShader); if(_VertexAttribArrayEnabled[glIndex] != enable) { diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_states.h b/code/nel/src/3d/driver/opengl/driver_opengl_states.h index fda404e03..be5c1918f 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_states.h +++ b/code/nel/src/3d/driver/opengl/driver_opengl_states.h @@ -44,6 +44,7 @@ namespace NLDRIVERGL { - GL_TEXTURE_GEN_S, GL_TEXTURE_GEN_T, GL_TEXTURE_GEN_R - GL_COLOR_MATERIAL - GL_FOG + - GL_MULTISAMPLE_ARB - glActiveTextureARB() - glClientActiveTextureARB() - glEnableClientState() glDisableClientState() with: @@ -99,6 +100,9 @@ public: /// enable/disable stencil test void enableStencilTest(bool enable); bool isStencilTestEnabled() const { return _CurStencilTest; } + /// enable/disable multisample + void enableMultisample(bool enable); + bool isMultisampleEnabled() const { return _CurMultisample; } // @} /// glBlendFunc. @@ -197,6 +201,7 @@ private: bool _CurLighting; bool _CurZWrite; bool _CurStencilTest; + bool _CurMultisample; GLenum _CurBlendSrc; GLenum _CurBlendDst; diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp index f0aab8938..77954a8e3 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp @@ -781,11 +781,7 @@ void CDriverGL::bindTextureWithMode(ITexture &tex) { _DriverGLStates.setTextureMode(CDriverGLStates::TextureCubeMap); // Bind this texture -#ifdef USE_OPENGLES - glBindTexture(GL_TEXTURE_CUBE_MAP_OES, gltext->ID); -#else glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, gltext->ID); -#endif } } else @@ -820,19 +816,16 @@ void CDriverGL::setupTextureBasicParameters(ITexture &tex) { if (_Extensions.ARBTextureCubeMap) { -#ifdef USE_OPENGLES - glTexParameteri(GL_TEXTURE_CUBE_MAP_OES,GL_TEXTURE_WRAP_S, translateWrapToGl(ITexture::Clamp, _Extensions)); - glTexParameteri(GL_TEXTURE_CUBE_MAP_OES,GL_TEXTURE_WRAP_T, translateWrapToGl(ITexture::Clamp, _Extensions)); -// glTexParameteri(GL_TEXTURE_CUBE_MAP_OES,GL_TEXTURE_WRAP_R, translateWrapToGl(ITexture::Clamp, _Extensions)); - glTexParameteri(GL_TEXTURE_CUBE_MAP_OES,GL_TEXTURE_MAG_FILTER, translateMagFilterToGl(gltext)); - glTexParameteri(GL_TEXTURE_CUBE_MAP_OES,GL_TEXTURE_MIN_FILTER, translateMinFilterToGl(gltext)); -#else glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_WRAP_S, translateWrapToGl(ITexture::Clamp, _Extensions)); glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_WRAP_T, translateWrapToGl(ITexture::Clamp, _Extensions)); +#ifndef USE_OPENGLES glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_WRAP_R, translateWrapToGl(ITexture::Clamp, _Extensions)); +#endif glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_MAG_FILTER, translateMagFilterToGl(gltext)); glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_MIN_FILTER, translateMinFilterToGl(gltext)); -#endif + + if (_AnisotropicFilter > 1.f && gltext->MinFilter > ITexture::NearestMipMapLinear) + glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MAX_ANISOTROPY_EXT, _AnisotropicFilter); } } else @@ -841,6 +834,9 @@ void CDriverGL::setupTextureBasicParameters(ITexture &tex) glTexParameteri(gltext->TextureMode,GL_TEXTURE_WRAP_T, translateWrapToGl(gltext->WrapT, _Extensions)); glTexParameteri(gltext->TextureMode,GL_TEXTURE_MAG_FILTER, translateMagFilterToGl(gltext)); glTexParameteri(gltext->TextureMode,GL_TEXTURE_MIN_FILTER, translateMinFilterToGl(gltext)); + + if (_AnisotropicFilter > 1.f && gltext->MinFilter > ITexture::NearestMipMapLinear) + glTexParameteri(gltext->TextureMode, GL_TEXTURE_MAX_ANISOTROPY_EXT, _AnisotropicFilter); } // tex.clearFilterOrWrapModeTouched(); @@ -1516,31 +1512,19 @@ bool CDriverGL::activateTexture(uint stage, ITexture *tex) _CurrentTextureInfoGL[stage]= gltext; // setup this texture -#ifdef USE_OPENGLES - glBindTexture(GL_TEXTURE_CUBE_MAP_OES, gltext->ID); -#else glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, gltext->ID); -#endif // Change parameters of texture, if necessary. //============================================ if(gltext->MagFilter!= tex->getMagFilter()) { gltext->MagFilter= tex->getMagFilter(); -#ifdef USE_OPENGLES - glTexParameteri(GL_TEXTURE_CUBE_MAP_OES,GL_TEXTURE_MAG_FILTER, translateMagFilterToGl(gltext)); -#else glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_MAG_FILTER, translateMagFilterToGl(gltext)); -#endif } if(gltext->MinFilter!= tex->getMinFilter()) { gltext->MinFilter= tex->getMinFilter(); -#ifdef USE_OPENGLES - glTexParameteri(GL_TEXTURE_CUBE_MAP_OES,GL_TEXTURE_MIN_FILTER, translateMinFilterToGl(gltext)); -#else glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_MIN_FILTER, translateMinFilterToGl(gltext)); -#endif } } } @@ -1617,34 +1601,16 @@ bool CDriverGL::activateTexture(uint stage, ITexture *tex) // This maps the CMaterial::TTexOperator -static const GLenum OperatorLUT[9]= { GL_REPLACE, GL_MODULATE, GL_ADD, -#ifdef USE_OPENGLES - GL_ADD_SIGNED, GL_INTERPOLATE, GL_INTERPOLATE, GL_INTERPOLATE, GL_INTERPOLATE, GL_INTERPOLATE -#else - GL_ADD_SIGNED_EXT, GL_INTERPOLATE_EXT, GL_INTERPOLATE_EXT, GL_INTERPOLATE_EXT, GL_INTERPOLATE_EXT, GL_BUMP_ENVMAP_ATI -#endif -}; +static const GLenum OperatorLUT[9]= { GL_REPLACE, GL_MODULATE, GL_ADD, GL_ADD_SIGNED_EXT, GL_INTERPOLATE_EXT, GL_INTERPOLATE_EXT, GL_INTERPOLATE_EXT, GL_INTERPOLATE_EXT, GL_BUMP_ENVMAP_ATI }; // This maps the CMaterial::TTexSource -static const GLenum SourceLUT[4]= { GL_TEXTURE, -#ifdef USE_OPENGLES - GL_PREVIOUS, GL_PRIMARY_COLOR, GL_CONSTANT -#else - GL_PREVIOUS_EXT, GL_PRIMARY_COLOR_EXT, GL_CONSTANT_EXT -#endif -}; +static const GLenum SourceLUT[4]= { GL_TEXTURE, GL_PREVIOUS_EXT, GL_PRIMARY_COLOR_EXT, GL_CONSTANT_EXT }; // This maps the CMaterial::TTexOperand static const GLenum OperandLUT[4]= { GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA }; // This maps the CMaterial::TTexOperator, used for openGL Arg2 setup. -static const GLenum InterpolateSrcLUT[8]= { GL_TEXTURE, GL_TEXTURE, GL_TEXTURE, GL_TEXTURE, GL_TEXTURE, -#ifdef USE_OPENGLES - GL_PREVIOUS, GL_PRIMARY_COLOR, GL_CONSTANT -#else - GL_PREVIOUS_EXT, GL_PRIMARY_COLOR_EXT, GL_CONSTANT_EXT -#endif -}; +static const GLenum InterpolateSrcLUT[8]= { GL_TEXTURE, GL_TEXTURE, GL_TEXTURE, GL_TEXTURE, GL_TEXTURE, GL_PREVIOUS_EXT, GL_PRIMARY_COLOR_EXT, GL_CONSTANT_EXT }; #ifndef USE_OPENGLES @@ -2224,6 +2190,25 @@ void CDriverGL::forceDXTCCompression(bool dxtcComp) _ForceDXTCCompression= dxtcComp; } +// *************************************************************************** +void CDriverGL::setAnisotropicFilter(sint filtering) +{ + H_AUTO_OGL(CDriverGL_setAnisotropicFiltering); + + if (!_Extensions.EXTTextureFilterAnisotropic) return; + + if (filtering < 0 || filtering > _Extensions.EXTTextureFilterAnisotropicMaximum) + { + // set maximum value for anisotropic filter + _AnisotropicFilter = _Extensions.EXTTextureFilterAnisotropicMaximum; + } + else + { + // set specified value for anisotropic filter + _AnisotropicFilter = filtering; + } +} + // *************************************************************************** void CDriverGL::forceTextureResize(uint divisor) { diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.cpp index 06ebafab0..60109cfb6 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.cpp @@ -1542,7 +1542,7 @@ void CVertexBufferHardARB::unlock() #ifdef NL_DEBUG _Unmapping = true; #endif - GLboolean unmapOk = false; + GLboolean unmapOk = GL_FALSE; #ifdef USE_OPENGLES if (_Driver->_Extensions.OESMapBuffer) @@ -1671,3 +1671,4 @@ void CVertexBufferHardARB::invalidate() #endif } // NL3D + diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp index dc2a4243a..5392bcbdd 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp @@ -205,8 +205,8 @@ bool CDriverGL::activeNVVertexProgram (CVertexProgram *program) return false; } - // *************************************************************************** +#ifndef USE_OPENGLES static inline GLenum convSwizzleToGLFormat(CVPSwizzle::EComp comp, bool negate) { @@ -216,16 +216,11 @@ inline GLenum convSwizzleToGLFormat(CVPSwizzle::EComp comp, bool negate) { switch(comp) { -#ifdef USE_OPENGLES - case CVPSwizzle::X: return GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES; - case CVPSwizzle::Y: return GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES; - case CVPSwizzle::Z: return GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES; -#else case CVPSwizzle::X: return GL_X_EXT; case CVPSwizzle::Y: return GL_Y_EXT; case CVPSwizzle::Z: return GL_Z_EXT; case CVPSwizzle::W: return GL_W_EXT; -#endif + default: nlstop; return 0; @@ -236,16 +231,11 @@ inline GLenum convSwizzleToGLFormat(CVPSwizzle::EComp comp, bool negate) { switch(comp) { -#ifdef USE_OPENGLES - case CVPSwizzle::X: return GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES; - case CVPSwizzle::Y: return GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES; - case CVPSwizzle::Z: return GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES; -#else case CVPSwizzle::X: return GL_NEGATIVE_X_EXT; case CVPSwizzle::Y: return GL_NEGATIVE_Y_EXT; case CVPSwizzle::Z: return GL_NEGATIVE_Z_EXT; case CVPSwizzle::W: return GL_NEGATIVE_W_EXT; -#endif + default: nlstop; return 0; @@ -253,6 +243,7 @@ inline GLenum convSwizzleToGLFormat(CVPSwizzle::EComp comp, bool negate) } } } +#endif // *************************************************************************** /** Convert an output register to a EXTVertexShader register diff --git a/code/nel/src/3d/driver/opengl/nel-driverogl.pc b/code/nel/src/3d/driver/opengl/nel-driverogl.pc index 867ad515e..03a2b1294 100644 --- a/code/nel/src/3d/driver/opengl/nel-driverogl.pc +++ b/code/nel/src/3d/driver/opengl/nel-driverogl.pc @@ -6,7 +6,7 @@ includedir=${prefix}/include Name: nel-driverogl Version: 0.5.0 Description: NeL 0.5.0 -Reqiures: +Requires: Libs: -L${libdir} Libs.private: -ldl -lpthread -lxml2 -lGL -lXxf86vm -lXmu Cflags: -I${includedir} -DXF86VIDMODE diff --git a/code/nel/src/3d/driver/opengl/nel-driverogl.pc.in b/code/nel/src/3d/driver/opengl/nel-driverogl.pc.in index 282e580f1..6f43c5f14 100644 --- a/code/nel/src/3d/driver/opengl/nel-driverogl.pc.in +++ b/code/nel/src/3d/driver/opengl/nel-driverogl.pc.in @@ -6,7 +6,7 @@ includedir=@includedir@ Name: nel-driverogl Version: @VERSION@ Description: NeL @VERSION@ -Reqiures: +Requires: Libs: -L${libdir} Libs.private: @LIBS@ @OPENGL_LIBS@ @XF86VIDMODE_LIBS@ -lXmu Cflags: -I${includedir} @OPENGL_CFLAGS@ @XF86VIDMODE_CFLAGS@ diff --git a/code/nel/src/3d/driver/opengles/CMakeLists.txt b/code/nel/src/3d/driver/opengles/CMakeLists.txt index bd330c6ec..74f0ddff3 100644 --- a/code/nel/src/3d/driver/opengles/CMakeLists.txt +++ b/code/nel/src/3d/driver/opengles/CMakeLists.txt @@ -77,7 +77,7 @@ IF(WITH_PCH) ENDIF(WITH_PCH) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC_DRIVERS) OR NOT WITH_STATIC_DRIVERS) - INSTALL(TARGETS ${NLDRV_OGLES_LIB} LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d) + INSTALL(TARGETS ${NLDRV_OGLES_LIB} LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_DRIVER_PREFIX} COMPONENT drivers3d) IF(WITH_MAXPLUGIN) INSTALL(TARGETS ${NLDRV_OGLES_LIB} RUNTIME DESTINATION maxplugin COMPONENT drivers3d) ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/src/3d/driver_user.cpp b/code/nel/src/3d/driver_user.cpp index df66f99d0..b45ebbd37 100644 --- a/code/nel/src/3d/driver_user.cpp +++ b/code/nel/src/3d/driver_user.cpp @@ -1469,12 +1469,21 @@ UDriver::TPolygonMode CDriverUser::getPolygonMode () return umode; } + void CDriverUser::forceDXTCCompression(bool dxtcComp) { NL3D_HAUTO_UI_DRIVER; _Driver->forceDXTCCompression(dxtcComp); } + +void CDriverUser::setAnisotropicFilter(sint filter) +{ + NL3D_HAUTO_UI_DRIVER; + + _Driver->setAnisotropicFilter(filter); +} + void CDriverUser::forceTextureResize(uint divisor) { NL3D_HAUTO_UI_DRIVER; diff --git a/code/nel/src/3d/fasthls_modifier.cpp b/code/nel/src/3d/fasthls_modifier.cpp index 3203587c0..5195ddb5a 100644 --- a/code/nel/src/3d/fasthls_modifier.cpp +++ b/code/nel/src/3d/fasthls_modifier.cpp @@ -109,7 +109,7 @@ CRGBA CFastHLSModifier::convert(uint H, uint L, uint S) return col; } -#if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) +#if defined(NL_COMP_VC) && NL_COMP_VC_VERSION >= 71 # pragma warning( push ) # pragma warning( disable : 4799 ) #endif @@ -262,7 +262,7 @@ uint16 CFastHLSModifier::applyHLSMod(uint16 colorIn, uint8 dHue, uint dLum, uin #pragma managed(pop) #endif -#if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) +#if defined(NL_COMP_VC) && NL_COMP_VC_VERSION >= 71 # pragma warning( pop ) #endif diff --git a/code/nel/src/3d/nel-3d.pc b/code/nel/src/3d/nel-3d.pc index 638961276..9420c67bf 100644 --- a/code/nel/src/3d/nel-3d.pc +++ b/code/nel/src/3d/nel-3d.pc @@ -6,7 +6,7 @@ includedir=${prefix}/include Name: nel-3d Version: 0.5.0 Description: NeL 0.5.0 -Reqiures: +Requires: Libs: -L${libdir} Libs.private: -ldl -lpthread -lxml2 -lfreetype -lz -lc Cflags: -I${includedir} -I/usr/include/freetype2 diff --git a/code/nel/src/3d/nel-3d.pc.in b/code/nel/src/3d/nel-3d.pc.in index ade3e2d08..a3c06762a 100644 --- a/code/nel/src/3d/nel-3d.pc.in +++ b/code/nel/src/3d/nel-3d.pc.in @@ -6,7 +6,7 @@ includedir=@includedir@ Name: nel-3d Version: @NL_VERSION@ Description: NeL @NL_VERSION@ -Reqiures: +Requires: Libs: -L${libdir} Libs.private: @LIBS@ @FREETYPE_LIBS@ -lc Cflags: -I${includedir} @FREETYPE_CFLAGS@ diff --git a/code/nel/src/3d/tangent_space_build.cpp b/code/nel/src/3d/tangent_space_build.cpp index 17e106615..8a1b1100a 100644 --- a/code/nel/src/3d/tangent_space_build.cpp +++ b/code/nel/src/3d/tangent_space_build.cpp @@ -214,9 +214,9 @@ bool BuildTangentSpace(CMesh::CMeshBuild &outMeshBuild, const CMesh::CMeshBuild if (!canShare) continue; // Get indices of vertices of current tri - const uint indices[] = { f.Corner[0].Vertex, - f.Corner[1].Vertex, - f.Corner[2].Vertex }; + const uint indices[] = { (uint)f.Corner[0].Vertex, + (uint)f.Corner[1].Vertex, + (uint)f.Corner[2].Vertex }; NLMISC::CTriangle tri; // Build it BuildTriFromMB(outMeshBuild, indices, tri); diff --git a/code/nel/src/3d/zone.cpp b/code/nel/src/3d/zone.cpp index b075e477e..4acca80f5 100644 --- a/code/nel/src/3d/zone.cpp +++ b/code/nel/src/3d/zone.cpp @@ -127,7 +127,7 @@ void CZone::build(const CZoneInfo &zoneInfo, uint32 numVertices) // Compute the bbox and the bias/scale. //===================================== CAABBox bb; - if(patchs.size()) + if(!patchs.empty()) bb.setCenter(patchs[0].Patch.Vertices[0]); bb.setHalfSize(CVector::Null); for(j=0;j<(sint)patchs.size();j++) diff --git a/code/nel/src/3d/zone_manager.cpp b/code/nel/src/3d/zone_manager.cpp index 6c0a727f2..efa36fa66 100644 --- a/code/nel/src/3d/zone_manager.cpp +++ b/code/nel/src/3d/zone_manager.cpp @@ -237,7 +237,7 @@ void CZoneLoadingTask::run(void) { // Lookup the zone string zonePathLookup = CPath::lookup (_ZoneName, false, false, true); - if (zonePathLookup == "") + if (zonePathLookup.empty()) zonePathLookup = _ZoneName; CZone *ZoneTmp = new CZone; diff --git a/code/nel/src/cegui/CMakeLists.txt b/code/nel/src/cegui/CMakeLists.txt index 48c06eb4b..b815eb139 100644 --- a/code/nel/src/cegui/CMakeLists.txt +++ b/code/nel/src/cegui/CMakeLists.txt @@ -12,5 +12,5 @@ NL_ADD_LIB_SUFFIX(nelceguirenderer) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DNEL_CEGUIRENDERER_EXPORTS) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) - INSTALL(TARGETS nelceguirenderer RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) + INSTALL(TARGETS nelceguirenderer RUNTIME DESTINATION ${NL_BIN_PREFIX} LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) diff --git a/code/nel/src/georges/CMakeLists.txt b/code/nel/src/georges/CMakeLists.txt index 640f33204..1d56a31bf 100644 --- a/code/nel/src/georges/CMakeLists.txt +++ b/code/nel/src/georges/CMakeLists.txt @@ -23,5 +23,5 @@ ENDIF(WITH_PCH) NL_GEN_PC(nel-georges.pc) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) - INSTALL(TARGETS nelgeorges LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) + INSTALL(TARGETS nelgeorges LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) diff --git a/code/nel/src/georges/nel-georges.pc.in b/code/nel/src/georges/nel-georges.pc.in index 4aa509aa0..5a8703714 100644 --- a/code/nel/src/georges/nel-georges.pc.in +++ b/code/nel/src/georges/nel-georges.pc.in @@ -6,7 +6,7 @@ includedir=@includedir@ Name: nel-georges Version: @NL_VERSION@ Description: NeL @NL_VERSION@ -Reqiures: +Requires: Libs: -L${libdir} Libs.private: @LIBS@ -lc Cflags: -I${includedir} diff --git a/code/nel/src/georges/type.cpp b/code/nel/src/georges/type.cpp index 344ba50f9..5b18c65c5 100644 --- a/code/nel/src/georges/type.cpp +++ b/code/nel/src/georges/type.cpp @@ -25,7 +25,6 @@ #include "nel/georges/form.h" #include "nel/georges/form_elm.h" #include "nel/georges/form_loader.h" - #include "nel/georges/type.h" using namespace NLMISC; diff --git a/code/nel/src/ligo/CMakeLists.txt b/code/nel/src/ligo/CMakeLists.txt index 41b0eaaa1..4c1bfbc30 100644 --- a/code/nel/src/ligo/CMakeLists.txt +++ b/code/nel/src/ligo/CMakeLists.txt @@ -21,5 +21,5 @@ ENDIF(WITH_PCH) NL_GEN_PC(nel-ligo.pc) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) - INSTALL(TARGETS nelligo LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) + INSTALL(TARGETS nelligo LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) diff --git a/code/nel/src/ligo/nel-ligo.pc.in b/code/nel/src/ligo/nel-ligo.pc.in index d4a535bac..dfe27ceac 100644 --- a/code/nel/src/ligo/nel-ligo.pc.in +++ b/code/nel/src/ligo/nel-ligo.pc.in @@ -6,7 +6,7 @@ includedir=@includedir@ Name: nel-ligo Version: @NL_VERSION@ Description: NeL @NL_VERSION@ -Reqiures: +Requires: Libs: -L${libdir} Libs.private: @LIBS@ -lc Cflags: -I${includedir} diff --git a/code/nel/src/logic/CMakeLists.txt b/code/nel/src/logic/CMakeLists.txt index 5ee2b682d..ea0ca605f 100644 --- a/code/nel/src/logic/CMakeLists.txt +++ b/code/nel/src/logic/CMakeLists.txt @@ -15,5 +15,5 @@ NL_ADD_LIB_SUFFIX(nellogic) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) - INSTALL(TARGETS nellogic LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) + INSTALL(TARGETS nellogic LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) diff --git a/code/nel/src/misc/CMakeLists.txt b/code/nel/src/misc/CMakeLists.txt index ff6057b6f..dc5b87e2c 100644 --- a/code/nel/src/misc/CMakeLists.txt +++ b/code/nel/src/misc/CMakeLists.txt @@ -55,5 +55,5 @@ ENDIF(WITH_PCH) NL_GEN_PC(nel-misc.pc) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) - INSTALL(TARGETS nelmisc LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) + INSTALL(TARGETS nelmisc LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) diff --git a/code/nel/src/misc/aabbox.cpp b/code/nel/src/misc/aabbox.cpp index 6e1a9e428..3636552d1 100644 --- a/code/nel/src/misc/aabbox.cpp +++ b/code/nel/src/misc/aabbox.cpp @@ -21,6 +21,10 @@ #include "nel/misc/bsphere.h" #include "nel/misc/matrix.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/algo.cpp b/code/nel/src/misc/algo.cpp index 71fd14347..6a3ef62dd 100644 --- a/code/nel/src/misc/algo.cpp +++ b/code/nel/src/misc/algo.cpp @@ -21,6 +21,9 @@ using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/app_context.cpp b/code/nel/src/misc/app_context.cpp index 1213a6559..a0b35b35a 100644 --- a/code/nel/src/misc/app_context.cpp +++ b/code/nel/src/misc/app_context.cpp @@ -19,6 +19,10 @@ #include "nel/misc/dynloadlib.h" #include "nel/misc/command.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/async_file_manager.cpp b/code/nel/src/misc/async_file_manager.cpp index b9be77f45..366237722 100644 --- a/code/nel/src/misc/async_file_manager.cpp +++ b/code/nel/src/misc/async_file_manager.cpp @@ -23,6 +23,10 @@ using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/big_file.cpp b/code/nel/src/misc/big_file.cpp index e2d64d052..f5ee067f4 100644 --- a/code/nel/src/misc/big_file.cpp +++ b/code/nel/src/misc/big_file.cpp @@ -22,6 +22,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/bit_mem_stream.cpp b/code/nel/src/misc/bit_mem_stream.cpp index c8ae37163..ed282786e 100644 --- a/code/nel/src/misc/bit_mem_stream.cpp +++ b/code/nel/src/misc/bit_mem_stream.cpp @@ -25,6 +25,9 @@ using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/bit_set.cpp b/code/nel/src/misc/bit_set.cpp index c19b8d35d..79eda0c13 100644 --- a/code/nel/src/misc/bit_set.cpp +++ b/code/nel/src/misc/bit_set.cpp @@ -20,6 +20,9 @@ using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/bitmap.cpp b/code/nel/src/misc/bitmap.cpp index aa426d47a..cfe8cab89 100644 --- a/code/nel/src/misc/bitmap.cpp +++ b/code/nel/src/misc/bitmap.cpp @@ -26,6 +26,9 @@ using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/bitmap_jpeg.cpp b/code/nel/src/misc/bitmap_jpeg.cpp index cae1f9700..799d659d6 100644 --- a/code/nel/src/misc/bitmap_jpeg.cpp +++ b/code/nel/src/misc/bitmap_jpeg.cpp @@ -32,6 +32,9 @@ extern "C" using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/bitmap_png.cpp b/code/nel/src/misc/bitmap_png.cpp index 768619e76..cea0b7d0c 100644 --- a/code/nel/src/misc/bitmap_png.cpp +++ b/code/nel/src/misc/bitmap_png.cpp @@ -27,6 +27,9 @@ using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/block_memory.cpp b/code/nel/src/misc/block_memory.cpp index d6abdffe6..d7c8e445c 100644 --- a/code/nel/src/misc/block_memory.cpp +++ b/code/nel/src/misc/block_memory.cpp @@ -21,6 +21,9 @@ // remove stupid VC6 warnings void foo_block_memory_cpp() {} +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/bsphere.cpp b/code/nel/src/misc/bsphere.cpp index 8e3494514..1fcf359e7 100644 --- a/code/nel/src/misc/bsphere.cpp +++ b/code/nel/src/misc/bsphere.cpp @@ -21,6 +21,9 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/buf_fifo.cpp b/code/nel/src/misc/buf_fifo.cpp index 2f39bd098..6c377f078 100644 --- a/code/nel/src/misc/buf_fifo.cpp +++ b/code/nel/src/misc/buf_fifo.cpp @@ -26,6 +26,10 @@ using namespace std; // if 0, don't stat the time of different function #define STAT_FIFO 1 +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { #ifdef BUFFIFO_TRACK_ALL_BUFFERS diff --git a/code/nel/src/misc/class_id.cpp b/code/nel/src/misc/class_id.cpp index e705c26a8..72d9cc43b 100644 --- a/code/nel/src/misc/class_id.cpp +++ b/code/nel/src/misc/class_id.cpp @@ -20,6 +20,9 @@ +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/class_registry.cpp b/code/nel/src/misc/class_registry.cpp index 74e3e24b9..91c603c90 100644 --- a/code/nel/src/misc/class_registry.cpp +++ b/code/nel/src/misc/class_registry.cpp @@ -17,9 +17,14 @@ #include "stdmisc.h" #include "nel/misc/class_registry.h" +#include "nel/misc/debug.h" using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/cmd_args.cpp b/code/nel/src/misc/cmd_args.cpp index c42473027..2ef32a6c9 100644 --- a/code/nel/src/misc/cmd_args.cpp +++ b/code/nel/src/misc/cmd_args.cpp @@ -24,6 +24,10 @@ #include "nel/misc/cmd_args.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/command.cpp b/code/nel/src/misc/command.cpp index 1fff9627b..30e3defe2 100644 --- a/code/nel/src/misc/command.cpp +++ b/code/nel/src/misc/command.cpp @@ -22,6 +22,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { //ICommand::TCategorySet* ICommand::_Categories; diff --git a/code/nel/src/misc/cpu_time_stat.cpp b/code/nel/src/misc/cpu_time_stat.cpp index a1f9bc23f..861ab8e56 100644 --- a/code/nel/src/misc/cpu_time_stat.cpp +++ b/code/nel/src/misc/cpu_time_stat.cpp @@ -15,9 +15,10 @@ // along with this program. If not, see . #include "stdmisc.h" -#include "nel/misc/cpu_time_stat.h" +#include "nel/misc/cpu_time_stat.h" #include "nel/misc/common.h" +#include "nel/misc/debug.h" #ifdef NL_OS_UNIX #include @@ -27,6 +28,10 @@ using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/debug.cpp b/code/nel/src/misc/debug.cpp index f2dd31290..b37f16d57 100644 --- a/code/nel/src/misc/debug.cpp +++ b/code/nel/src/misc/debug.cpp @@ -53,6 +53,8 @@ # include #endif +#define NL_NO_DEBUG_FILES 1 + using namespace std; // If you don't want to add default displayer, put 0 instead of 1. In this case, you diff --git a/code/nel/src/misc/di_event_emitter.cpp b/code/nel/src/misc/di_event_emitter.cpp index c0894e381..8f41f6453 100644 --- a/code/nel/src/misc/di_event_emitter.cpp +++ b/code/nel/src/misc/di_event_emitter.cpp @@ -28,7 +28,9 @@ #ifdef NL_OS_WINDOWS - +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/di_game_device.cpp b/code/nel/src/misc/di_game_device.cpp index 22a9d57fd..6574b5cde 100644 --- a/code/nel/src/misc/di_game_device.cpp +++ b/code/nel/src/misc/di_game_device.cpp @@ -21,6 +21,10 @@ #ifdef NL_OS_WINDOWS +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/di_keyboard_device.cpp b/code/nel/src/misc/di_keyboard_device.cpp index dffc1f4da..0802019a4 100644 --- a/code/nel/src/misc/di_keyboard_device.cpp +++ b/code/nel/src/misc/di_keyboard_device.cpp @@ -27,6 +27,10 @@ #include "Mmsystem.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/di_mouse_device.cpp b/code/nel/src/misc/di_mouse_device.cpp index cce2650dc..2dfcf95f0 100644 --- a/code/nel/src/misc/di_mouse_device.cpp +++ b/code/nel/src/misc/di_mouse_device.cpp @@ -23,6 +23,10 @@ #ifdef NL_OS_WINDOWS +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/diff_tool.cpp b/code/nel/src/misc/diff_tool.cpp index 9422e2a79..15a91cdb8 100644 --- a/code/nel/src/misc/diff_tool.cpp +++ b/code/nel/src/misc/diff_tool.cpp @@ -22,6 +22,9 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace STRING_MANAGER { diff --git a/code/nel/src/misc/dummy_window.cpp b/code/nel/src/misc/dummy_window.cpp index 90c36d55b..a0d807ac5 100644 --- a/code/nel/src/misc/dummy_window.cpp +++ b/code/nel/src/misc/dummy_window.cpp @@ -21,6 +21,10 @@ #ifdef NL_OS_WINDOWS +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/dynloadlib.cpp b/code/nel/src/misc/dynloadlib.cpp index 7153643fc..6dcb7e4cf 100644 --- a/code/nel/src/misc/dynloadlib.cpp +++ b/code/nel/src/misc/dynloadlib.cpp @@ -21,6 +21,10 @@ using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/eid_translator.cpp b/code/nel/src/misc/eid_translator.cpp index 710acb440..acf4046e5 100644 --- a/code/nel/src/misc/eid_translator.cpp +++ b/code/nel/src/misc/eid_translator.cpp @@ -31,6 +31,10 @@ using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { // diff --git a/code/nel/src/misc/entity_id.cpp b/code/nel/src/misc/entity_id.cpp index b90a25ea3..b62bf1f1c 100644 --- a/code/nel/src/misc/entity_id.cpp +++ b/code/nel/src/misc/entity_id.cpp @@ -20,6 +20,10 @@ using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { const uint64 CEntityId::MaxEntityId = ((uint64)1 << (CEntityId::ID_SIZE + 1)) - (uint64)1; diff --git a/code/nel/src/misc/eval_num_expr.cpp b/code/nel/src/misc/eval_num_expr.cpp index cf543c260..c47309498 100644 --- a/code/nel/src/misc/eval_num_expr.cpp +++ b/code/nel/src/misc/eval_num_expr.cpp @@ -17,6 +17,11 @@ #include "stdmisc.h" #include "nel/misc/eval_num_expr.h" +#include "nel/misc/debug.h" + +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { @@ -1309,7 +1314,7 @@ const int CEvalNumExpr::_OperatorPrecedence[]= 9, // LogicalAnd 10, // LogicalOr 11, // LogicalXor - 0xffffffff, // OperatorCount + -1, // OperatorCount 20, // NotOperator }; diff --git a/code/nel/src/misc/event_emitter.cpp b/code/nel/src/misc/event_emitter.cpp index 946efd75c..0cf3aad72 100644 --- a/code/nel/src/misc/event_emitter.cpp +++ b/code/nel/src/misc/event_emitter.cpp @@ -19,6 +19,10 @@ // remove stupid VC6 warnings void foo_event_emitter_cpp() {} +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/event_emitter_multi.cpp b/code/nel/src/misc/event_emitter_multi.cpp index f119601f5..52bc235cd 100644 --- a/code/nel/src/misc/event_emitter_multi.cpp +++ b/code/nel/src/misc/event_emitter_multi.cpp @@ -18,6 +18,10 @@ #include "nel/misc/event_emitter_multi.h" #include "nel/misc/system_utils.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/event_listener.cpp b/code/nel/src/misc/event_listener.cpp index 1b8b29017..14bb5d73d 100644 --- a/code/nel/src/misc/event_listener.cpp +++ b/code/nel/src/misc/event_listener.cpp @@ -20,6 +20,9 @@ #include "nel/misc/event_server.h" #include "nel/misc/events.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/event_server.cpp b/code/nel/src/misc/event_server.cpp index 21ed8c576..eceb783fe 100644 --- a/code/nel/src/misc/event_server.cpp +++ b/code/nel/src/misc/event_server.cpp @@ -21,6 +21,9 @@ #include "nel/misc/event_emitter.h" #include "nel/misc/events.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/events.cpp b/code/nel/src/misc/events.cpp index 1d88be177..daa651ed7 100644 --- a/code/nel/src/misc/events.cpp +++ b/code/nel/src/misc/events.cpp @@ -19,6 +19,9 @@ #include "nel/misc/events.h" #include "nel/misc/string_conversion.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/fast_floor.cpp b/code/nel/src/misc/fast_floor.cpp index 614ad3474..29411492b 100644 --- a/code/nel/src/misc/fast_floor.cpp +++ b/code/nel/src/misc/fast_floor.cpp @@ -18,6 +18,10 @@ #include "nel/misc/fast_floor.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { int OptFastFloorCWStack[OptFastFloorCWStackSize]; diff --git a/code/nel/src/misc/fast_id_map.cpp b/code/nel/src/misc/fast_id_map.cpp index 3d434066c..5ba919b09 100644 --- a/code/nel/src/misc/fast_id_map.cpp +++ b/code/nel/src/misc/fast_id_map.cpp @@ -35,6 +35,10 @@ // Project includes +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { void dummytoavoidthecompilerwarningfastidmap() { } diff --git a/code/nel/src/misc/fast_mem.cpp b/code/nel/src/misc/fast_mem.cpp index 6d7ca97ff..c957195b3 100644 --- a/code/nel/src/misc/fast_mem.cpp +++ b/code/nel/src/misc/fast_mem.cpp @@ -19,6 +19,9 @@ #include "nel/misc/fast_mem.h" #include "nel/misc/system_info.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/file.cpp b/code/nel/src/misc/file.cpp index 4c8501a17..842d9ea51 100644 --- a/code/nel/src/misc/file.cpp +++ b/code/nel/src/misc/file.cpp @@ -15,9 +15,7 @@ // along with this program. If not, see . #include "stdmisc.h" -#ifndef NL_OS_WINDOWS -#include -#endif + #include "nel/misc/file.h" #include "nel/misc/debug.h" #include "nel/misc/big_file.h" @@ -26,10 +24,18 @@ #include "nel/misc/sstring.h" #include "nel/misc/xml_pack.h" +#ifndef NL_OS_WINDOWS +#include +#endif + using namespace std; #define NLMISC_DONE_FILE_OPENED 40 +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/game_device.cpp b/code/nel/src/misc/game_device.cpp index ee0924a1a..2ba49367f 100644 --- a/code/nel/src/misc/game_device.cpp +++ b/code/nel/src/misc/game_device.cpp @@ -17,6 +17,10 @@ #include "stdmisc.h" #include "nel/misc/game_device.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/game_device_events.cpp b/code/nel/src/misc/game_device_events.cpp index 59cc115d5..bf64a1c4b 100644 --- a/code/nel/src/misc/game_device_events.cpp +++ b/code/nel/src/misc/game_device_events.cpp @@ -18,6 +18,10 @@ #include "nel/misc/game_device_events.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/geom_ext.cpp b/code/nel/src/misc/geom_ext.cpp index 0b1735099..32dba1d60 100644 --- a/code/nel/src/misc/geom_ext.cpp +++ b/code/nel/src/misc/geom_ext.cpp @@ -24,6 +24,10 @@ void dummyToAvoidStupidCompilerWarning_misc_geom_ext_cpp() { } +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/grid_traversal.cpp b/code/nel/src/misc/grid_traversal.cpp index 19e59e7c2..a88267331 100644 --- a/code/nel/src/misc/grid_traversal.cpp +++ b/code/nel/src/misc/grid_traversal.cpp @@ -19,6 +19,10 @@ #include "nel/misc/grid_traversal.h" #include "nel/misc/vector_2f.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/gtk_displayer.cpp b/code/nel/src/misc/gtk_displayer.cpp index d348bab79..f558a4909 100644 --- a/code/nel/src/misc/gtk_displayer.cpp +++ b/code/nel/src/misc/gtk_displayer.cpp @@ -15,6 +15,7 @@ // along with this program. If not, see . #include "stdmisc.h" +#include "nel/misc/gtk_displayer.h" #ifdef NL_USE_GTK @@ -35,10 +36,12 @@ #include "nel/misc/command.h" #include "nel/misc/thread.h" -#include "nel/misc/gtk_displayer.h" - using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { // diff --git a/code/nel/src/misc/hierarchical_timer.cpp b/code/nel/src/misc/hierarchical_timer.cpp index 9d3c40c44..62dc0786a 100644 --- a/code/nel/src/misc/hierarchical_timer.cpp +++ b/code/nel/src/misc/hierarchical_timer.cpp @@ -26,6 +26,10 @@ #include "nel/misc/time_nl.h" #endif +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/i18n.cpp b/code/nel/src/misc/i18n.cpp index 92da17250..cf1803c76 100644 --- a/code/nel/src/misc/i18n.cpp +++ b/code/nel/src/misc/i18n.cpp @@ -22,6 +22,10 @@ using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { CI18N::StrMapContainer CI18N::_StrMap; @@ -914,9 +918,9 @@ void CI18N::_readTextFile(const string &filename, void CI18N::readTextBuffer(uint8 *buffer, uint size, ucstring &result, bool forceUtf8) { - static uint8 utf16Header[] = {char(0xff), char(0xfe)}; - static uint8 utf16RevHeader[] = {char(0xfe), char(0xff)}; - static uint8 utf8Header[] = {char(0xef), char(0xbb), char(0xbf)}; + static uint8 utf16Header[] = { 0xffu, 0xfeu }; + static uint8 utf16RevHeader[] = { 0xfeu, 0xffu }; + static uint8 utf8Header[] = { 0xefu, 0xbbu, 0xbfu }; if (forceUtf8) { diff --git a/code/nel/src/misc/i_xml.cpp b/code/nel/src/misc/i_xml.cpp index 6cd675ace..d8925ddef 100644 --- a/code/nel/src/misc/i_xml.cpp +++ b/code/nel/src/misc/i_xml.cpp @@ -28,6 +28,10 @@ using namespace std; #define NLMISC_READ_BUFFER_SIZE 1024 +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/input_device.cpp b/code/nel/src/misc/input_device.cpp index 03e8f8c39..3825935a6 100644 --- a/code/nel/src/misc/input_device.cpp +++ b/code/nel/src/misc/input_device.cpp @@ -20,6 +20,10 @@ // remove stupid VC6 warnings void foo_input_device_cpp() {} +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/input_device_server.cpp b/code/nel/src/misc/input_device_server.cpp index 2b713d836..253b68e71 100644 --- a/code/nel/src/misc/input_device_server.cpp +++ b/code/nel/src/misc/input_device_server.cpp @@ -15,10 +15,14 @@ // along with this program. If not, see . #include "stdmisc.h" + #include "nel/misc/input_device_server.h" #include "nel/misc/input_device.h" +#include "nel/misc/debug.h" - +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/inter_window_msg_queue.cpp b/code/nel/src/misc/inter_window_msg_queue.cpp index 2526f1449..77e72e654 100644 --- a/code/nel/src/misc/inter_window_msg_queue.cpp +++ b/code/nel/src/misc/inter_window_msg_queue.cpp @@ -16,12 +16,16 @@ #include "stdmisc.h" -#ifdef NL_OS_WINDOWS #include "nel/misc/inter_window_msg_queue.h" -// + +#ifdef NL_OS_WINDOWS #include "nel/misc/mem_stream.h" #include "nel/misc/shared_memory.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/keyboard_device.cpp b/code/nel/src/misc/keyboard_device.cpp index 3fc0e07a1..4c7f353bc 100644 --- a/code/nel/src/misc/keyboard_device.cpp +++ b/code/nel/src/misc/keyboard_device.cpp @@ -18,6 +18,9 @@ //#include "nel/3d/u_keyboard_device.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/misc/line.cpp b/code/nel/src/misc/line.cpp index b8148dfb5..aba33734c 100644 --- a/code/nel/src/misc/line.cpp +++ b/code/nel/src/misc/line.cpp @@ -18,6 +18,10 @@ #include "nel/misc/line.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/matrix.cpp b/code/nel/src/misc/matrix.cpp index 6fac71aa2..dd884f4d5 100644 --- a/code/nel/src/misc/matrix.cpp +++ b/code/nel/src/misc/matrix.cpp @@ -23,6 +23,9 @@ using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/md5.cpp b/code/nel/src/misc/md5.cpp index 363bc09f4..eaf9df6cc 100644 --- a/code/nel/src/misc/md5.cpp +++ b/code/nel/src/misc/md5.cpp @@ -52,6 +52,10 @@ documentation and/or software. using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { // **************************************************************************** diff --git a/code/nel/src/misc/mem_displayer.cpp b/code/nel/src/misc/mem_displayer.cpp index 1dc156913..52d399350 100644 --- a/code/nel/src/misc/mem_displayer.cpp +++ b/code/nel/src/misc/mem_displayer.cpp @@ -37,6 +37,10 @@ using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/mem_stream.cpp b/code/nel/src/misc/mem_stream.cpp index 7396dbbab..49e19f523 100644 --- a/code/nel/src/misc/mem_stream.cpp +++ b/code/nel/src/misc/mem_stream.cpp @@ -18,6 +18,10 @@ #include "nel/misc/mem_stream.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/mouse_smoother.cpp b/code/nel/src/misc/mouse_smoother.cpp index e8389119d..a92cbca6e 100644 --- a/code/nel/src/misc/mouse_smoother.cpp +++ b/code/nel/src/misc/mouse_smoother.cpp @@ -17,6 +17,10 @@ #include "stdmisc.h" #include "nel/misc/mouse_smoother.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/mutex.cpp b/code/nel/src/misc/mutex.cpp index fb337fab6..f8a75d2ea 100644 --- a/code/nel/src/misc/mutex.cpp +++ b/code/nel/src/misc/mutex.cpp @@ -22,6 +22,7 @@ #include "nel/misc/mutex.h" #include "nel/misc/time_nl.h" +#include "nel/misc/debug.h" using namespace std; @@ -47,6 +48,9 @@ using namespace std; #define NOMINMAX #include +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/nel-misc.pc b/code/nel/src/misc/nel-misc.pc index db7c97b22..4d28291ed 100644 --- a/code/nel/src/misc/nel-misc.pc +++ b/code/nel/src/misc/nel-misc.pc @@ -6,7 +6,7 @@ includedir=${prefix}/include Name: nel-misc Version: 0.5.0 Description: NeL 0.5.0 -Reqiures: +Requires: Libs: -L${libdir} Libs.private: -ldl -lpthread -lxml2 -lc -lpthread -lrt -ldl Cflags: -I${includedir} -lc -lpthread -lrt -ldl diff --git a/code/nel/src/misc/nel-misc.pc.in b/code/nel/src/misc/nel-misc.pc.in index c4d447c42..abea860a1 100644 --- a/code/nel/src/misc/nel-misc.pc.in +++ b/code/nel/src/misc/nel-misc.pc.in @@ -6,7 +6,7 @@ includedir=@includedir@ Name: nel-misc Version: @NL_VERSION@ Description: NeL @NL_VERSION@ -Reqiures: +Requires: Libs: -L${libdir} Libs.private: @LIBS@ -lc -lpthread -lrt -ldl Cflags: -I${includedir} -lc -lpthread -lrt -ldl diff --git a/code/nel/src/misc/noise_value.cpp b/code/nel/src/misc/noise_value.cpp index 5b6507be3..28fe24001 100644 --- a/code/nel/src/misc/noise_value.cpp +++ b/code/nel/src/misc/noise_value.cpp @@ -20,6 +20,9 @@ #include "nel/misc/fast_floor.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/o_xml.cpp b/code/nel/src/misc/o_xml.cpp index 1bd5d3d7b..005ef8000 100644 --- a/code/nel/src/misc/o_xml.cpp +++ b/code/nel/src/misc/o_xml.cpp @@ -25,6 +25,10 @@ using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/object_vector.cpp b/code/nel/src/misc/object_vector.cpp index c547dfc8d..7a863342b 100644 --- a/code/nel/src/misc/object_vector.cpp +++ b/code/nel/src/misc/object_vector.cpp @@ -23,6 +23,9 @@ void dummyToAvoidStupidCompilerWarning_misc_object_vector_cpp() { } +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/p_thread.cpp b/code/nel/src/misc/p_thread.cpp index ab5530342..e4deab4ca 100644 --- a/code/nel/src/misc/p_thread.cpp +++ b/code/nel/src/misc/p_thread.cpp @@ -24,6 +24,10 @@ #include #include +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { /* Key for thread specific storage holding IThread pointer. */ diff --git a/code/nel/src/misc/path.cpp b/code/nel/src/misc/path.cpp index bcef9bdeb..c59aabf0c 100644 --- a/code/nel/src/misc/path.cpp +++ b/code/nel/src/misc/path.cpp @@ -17,8 +17,8 @@ #include "stdmisc.h" -#include "nel/misc/big_file.h" #include "nel/misc/path.h" +#include "nel/misc/big_file.h" #include "nel/misc/hierarchical_timer.h" #include "nel/misc/progress_callback.h" #include "nel/misc/file.h" @@ -48,6 +48,10 @@ using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { // diff --git a/code/nel/src/misc/plane.cpp b/code/nel/src/misc/plane.cpp index 505a5cb62..7da917459 100644 --- a/code/nel/src/misc/plane.cpp +++ b/code/nel/src/misc/plane.cpp @@ -19,6 +19,9 @@ #include "nel/misc/plane.h" #include "nel/misc/uv.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/polygon.cpp b/code/nel/src/misc/polygon.cpp index 2942fb66b..b541d2eba 100644 --- a/code/nel/src/misc/polygon.cpp +++ b/code/nel/src/misc/polygon.cpp @@ -24,6 +24,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/progress_callback.cpp b/code/nel/src/misc/progress_callback.cpp index 965f25ec1..c4d4841ea 100644 --- a/code/nel/src/misc/progress_callback.cpp +++ b/code/nel/src/misc/progress_callback.cpp @@ -15,8 +15,13 @@ // along with this program. If not, see . #include "stdmisc.h" + #include "nel/misc/progress_callback.h" +#include "nel/misc/debug.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/quad.cpp b/code/nel/src/misc/quad.cpp index 6486bb5c1..8fced3318 100644 --- a/code/nel/src/misc/quad.cpp +++ b/code/nel/src/misc/quad.cpp @@ -24,6 +24,10 @@ void dummyToAvoidStupidCompilerWarning_misc_quad_cpp() { } +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/quat.cpp b/code/nel/src/misc/quat.cpp index 950870842..c1b441df9 100644 --- a/code/nel/src/misc/quat.cpp +++ b/code/nel/src/misc/quat.cpp @@ -18,6 +18,9 @@ #include "nel/misc/quat.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/reader_writer.cpp b/code/nel/src/misc/reader_writer.cpp index 22019aaa3..57c5c517d 100644 --- a/code/nel/src/misc/reader_writer.cpp +++ b/code/nel/src/misc/reader_writer.cpp @@ -18,6 +18,9 @@ #include "nel/misc/reader_writer.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/rect.cpp b/code/nel/src/misc/rect.cpp index 40acd9456..d4347b7e9 100644 --- a/code/nel/src/misc/rect.cpp +++ b/code/nel/src/misc/rect.cpp @@ -19,6 +19,9 @@ #include "nel/misc/rect.h" #include "nel/misc/vector_2f.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/report.cpp b/code/nel/src/misc/report.cpp index 1c7888a2c..64871e6a3 100644 --- a/code/nel/src/misc/report.cpp +++ b/code/nel/src/misc/report.cpp @@ -29,8 +29,14 @@ # include #endif // NL_OS_WINDOWS +#define NL_NO_DEBUG_FILES 1 + using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/rgba.cpp b/code/nel/src/misc/rgba.cpp index 1d7a88f6b..8075d78b2 100644 --- a/code/nel/src/misc/rgba.cpp +++ b/code/nel/src/misc/rgba.cpp @@ -21,6 +21,9 @@ #include "nel/misc/system_info.h" #include "nel/misc/common.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/sha1.cpp b/code/nel/src/misc/sha1.cpp index 64c94ee6f..19e8a440a 100644 --- a/code/nel/src/misc/sha1.cpp +++ b/code/nel/src/misc/sha1.cpp @@ -31,6 +31,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + // // Types // diff --git a/code/nel/src/misc/shared_memory.cpp b/code/nel/src/misc/shared_memory.cpp index 544ba882a..2a7f85a8b 100644 --- a/code/nel/src/misc/shared_memory.cpp +++ b/code/nel/src/misc/shared_memory.cpp @@ -15,7 +15,9 @@ // along with this program. If not, see . #include "stdmisc.h" + #include "nel/misc/shared_memory.h" +#include "nel/misc/debug.h" #ifdef NL_OS_WINDOWS # define NOMINMAX @@ -28,6 +30,9 @@ using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/sheet_id.cpp b/code/nel/src/misc/sheet_id.cpp index 0ff90b1f8..7bc9c7c61 100644 --- a/code/nel/src/misc/sheet_id.cpp +++ b/code/nel/src/misc/sheet_id.cpp @@ -29,6 +29,10 @@ using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { CSheetId::CChar CSheetId::_AllStrings; @@ -157,7 +161,7 @@ bool CSheetId::buildSheetId(const std::string& sheetName) { _FileExtensions.push_back(sheetType); _DevSheetIdToName.push_back(std::vector()); - typeId = _FileExtensions.size() - 1; + typeId = (uint32)_FileExtensions.size() - 1; _DevTypeNameToId[sheetType] = typeId; std::string unknownNewType = std::string("unknown." + sheetType); _DevSheetIdToName[typeId].push_back(unknownNewType); diff --git a/code/nel/src/misc/smart_ptr.cpp b/code/nel/src/misc/smart_ptr.cpp index a85edfbe9..e5c31fcd7 100644 --- a/code/nel/src/misc/smart_ptr.cpp +++ b/code/nel/src/misc/smart_ptr.cpp @@ -18,6 +18,9 @@ #include "nel/misc/smart_ptr.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/stl_block_allocator.cpp b/code/nel/src/misc/stl_block_allocator.cpp index 3b519f736..f57d0c238 100644 --- a/code/nel/src/misc/stl_block_allocator.cpp +++ b/code/nel/src/misc/stl_block_allocator.cpp @@ -21,6 +21,9 @@ // remove stupid VC6 warnings void foo_stl_block_allocator_cpp() {} +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/stl_block_list.cpp b/code/nel/src/misc/stl_block_list.cpp index a4474d65f..628b79371 100644 --- a/code/nel/src/misc/stl_block_list.cpp +++ b/code/nel/src/misc/stl_block_list.cpp @@ -21,6 +21,10 @@ // remove stupid VC6 warnings void foo_stl_block_list_cpp() {} +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/stop_watch.cpp b/code/nel/src/misc/stop_watch.cpp index 420f29914..59b62150e 100644 --- a/code/nel/src/misc/stop_watch.cpp +++ b/code/nel/src/misc/stop_watch.cpp @@ -20,6 +20,10 @@ using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/stream.cpp b/code/nel/src/misc/stream.cpp index e592e4d4a..c652d6fe9 100644 --- a/code/nel/src/misc/stream.cpp +++ b/code/nel/src/misc/stream.cpp @@ -21,6 +21,9 @@ using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/string_common.cpp b/code/nel/src/misc/string_common.cpp index f06258893..dd8d1fe96 100644 --- a/code/nel/src/misc/string_common.cpp +++ b/code/nel/src/misc/string_common.cpp @@ -20,6 +20,10 @@ using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/string_id_array.cpp b/code/nel/src/misc/string_id_array.cpp index 5dfc5d318..b9489e3f9 100644 --- a/code/nel/src/misc/string_id_array.cpp +++ b/code/nel/src/misc/string_id_array.cpp @@ -24,6 +24,10 @@ void dummyToAvoidStupidCompilerWarning_misc_string_id_array_cpp() { } +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/string_mapper.cpp b/code/nel/src/misc/string_mapper.cpp index 9b896f206..cf8a38e49 100644 --- a/code/nel/src/misc/string_mapper.cpp +++ b/code/nel/src/misc/string_mapper.cpp @@ -20,6 +20,10 @@ using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/system_info.cpp b/code/nel/src/misc/system_info.cpp index a6c1c4bf3..7ef96ec58 100644 --- a/code/nel/src/misc/system_info.cpp +++ b/code/nel/src/misc/system_info.cpp @@ -16,6 +16,8 @@ #include "stdmisc.h" +#include "nel/misc/system_info.h" + #ifdef NL_OS_WINDOWS # define NOMINMAX # include @@ -42,6 +44,10 @@ using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { #ifdef NL_OS_UNIX diff --git a/code/nel/src/misc/system_utils.cpp b/code/nel/src/misc/system_utils.cpp index c62f0b46d..c60364741 100644 --- a/code/nel/src/misc/system_utils.cpp +++ b/code/nel/src/misc/system_utils.cpp @@ -28,6 +28,10 @@ #endif #endif +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + using namespace std; // Key in registry diff --git a/code/nel/src/misc/task_manager.cpp b/code/nel/src/misc/task_manager.cpp index 13af3e4ac..4cdb16bd0 100644 --- a/code/nel/src/misc/task_manager.cpp +++ b/code/nel/src/misc/task_manager.cpp @@ -23,6 +23,10 @@ using namespace std; #define NLMISC_DONE_TASK_SIZE 20 +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { /* diff --git a/code/nel/src/misc/tds.cpp b/code/nel/src/misc/tds.cpp index bfc3b6af0..13105f98d 100644 --- a/code/nel/src/misc/tds.cpp +++ b/code/nel/src/misc/tds.cpp @@ -17,12 +17,17 @@ #include "stdmisc.h" #include "nel/misc/tds.h" +#include "nel/misc/debug.h" #ifdef NL_OS_WINDOWS # define NOMINMAX # include #endif // NL_OS_WINDOWS +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/time_nl.cpp b/code/nel/src/misc/time_nl.cpp index dd43fd2f7..0ba60c8e2 100644 --- a/code/nel/src/misc/time_nl.cpp +++ b/code/nel/src/misc/time_nl.cpp @@ -16,6 +16,10 @@ #include "stdmisc.h" +#include "nel/misc/time_nl.h" +#include "nel/misc/sstring.h" +#include "nel/misc/thread.h" + #ifdef NL_OS_WINDOWS # define NOMINMAX # include @@ -29,10 +33,9 @@ #include #endif -#include "nel/misc/time_nl.h" -#include "nel/misc/sstring.h" - -#include +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { @@ -280,11 +283,17 @@ void CTime::probeTimerInfo(CTime::CTimerInfo &result) else result.RequiresSingleCore = false; if (result.HighPrecisionResolution == 14318180) + { nldebug("Detected known HPET era timer frequency"); + } if (result.HighPrecisionResolution == 3579545) + { nldebug("Detected known AHCI era timer frequency"); + } if (result.HighPrecisionResolution == 1193182) + { nldebug("Detected known i8253/i8254 era timer frequency"); + } } } diff --git a/code/nel/src/misc/triangle.cpp b/code/nel/src/misc/triangle.cpp index 3fcde2ec9..234eb0506 100644 --- a/code/nel/src/misc/triangle.cpp +++ b/code/nel/src/misc/triangle.cpp @@ -20,6 +20,9 @@ #include "nel/misc/plane.h" #include "nel/misc/matrix.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/unicode.cpp b/code/nel/src/misc/unicode.cpp index ac58580ee..00bf6a226 100644 --- a/code/nel/src/misc/unicode.cpp +++ b/code/nel/src/misc/unicode.cpp @@ -17,6 +17,10 @@ #include "stdmisc.h" #include "nel/misc/ucstring.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/uv.cpp b/code/nel/src/misc/uv.cpp index f25643300..9926efcc7 100644 --- a/code/nel/src/misc/uv.cpp +++ b/code/nel/src/misc/uv.cpp @@ -24,6 +24,10 @@ void dummyToAvoidStupidCompilerWarning_misc_uv_cpp() { } +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/variable.cpp b/code/nel/src/misc/variable.cpp index 48c775c9c..16953f990 100644 --- a/code/nel/src/misc/variable.cpp +++ b/code/nel/src/misc/variable.cpp @@ -21,6 +21,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/vector.cpp b/code/nel/src/misc/vector.cpp index 7230a75c6..dc64925b7 100644 --- a/code/nel/src/misc/vector.cpp +++ b/code/nel/src/misc/vector.cpp @@ -20,6 +20,9 @@ using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/vector_2d.cpp b/code/nel/src/misc/vector_2d.cpp index 5ab0ffdec..939e41239 100644 --- a/code/nel/src/misc/vector_2d.cpp +++ b/code/nel/src/misc/vector_2d.cpp @@ -24,6 +24,10 @@ void dummyToAvoidStupidCompilerWarning_misc_vector_2d_cpp() { } +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/vector_2f.cpp b/code/nel/src/misc/vector_2f.cpp index 0e9621601..08bd0d096 100644 --- a/code/nel/src/misc/vector_2f.cpp +++ b/code/nel/src/misc/vector_2f.cpp @@ -18,6 +18,9 @@ #include "nel/misc/vector_2f.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/vector_h.cpp b/code/nel/src/misc/vector_h.cpp index 528f5f4cc..67eb41f6b 100644 --- a/code/nel/src/misc/vector_h.cpp +++ b/code/nel/src/misc/vector_h.cpp @@ -24,6 +24,10 @@ void dummyToAvoidStupidCompilerWarning_misc_vector_h_cpp() { } +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/vectord.cpp b/code/nel/src/misc/vectord.cpp index 1273f190a..aa14a3828 100644 --- a/code/nel/src/misc/vectord.cpp +++ b/code/nel/src/misc/vectord.cpp @@ -18,6 +18,9 @@ #include "nel/misc/vectord.h" +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/win32_util.cpp b/code/nel/src/misc/win32_util.cpp index 17601797b..63315e1b2 100644 --- a/code/nel/src/misc/win32_util.cpp +++ b/code/nel/src/misc/win32_util.cpp @@ -22,6 +22,10 @@ #include +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/win_displayer.cpp b/code/nel/src/misc/win_displayer.cpp index d016b4106..f5c0d9545 100644 --- a/code/nel/src/misc/win_displayer.cpp +++ b/code/nel/src/misc/win_displayer.cpp @@ -15,6 +15,7 @@ // along with this program. If not, see . #include "stdmisc.h" +#include "nel/misc/win_displayer.h" #ifdef NL_OS_WINDOWS @@ -33,10 +34,12 @@ #include "nel/misc/thread.h" #include "nel/misc/ucstring.h" -#include "nel/misc/win_displayer.h" - using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { static CHARFORMAT2 CharFormat; diff --git a/code/nel/src/misc/win_event_emitter.cpp b/code/nel/src/misc/win_event_emitter.cpp index cf3ff2197..b330d7e57 100644 --- a/code/nel/src/misc/win_event_emitter.cpp +++ b/code/nel/src/misc/win_event_emitter.cpp @@ -32,6 +32,9 @@ */ #include +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/win_thread.cpp b/code/nel/src/misc/win_thread.cpp index eec462d3c..d90d081ff 100644 --- a/code/nel/src/misc/win_thread.cpp +++ b/code/nel/src/misc/win_thread.cpp @@ -15,16 +15,20 @@ // along with this program. If not, see . #include "stdmisc.h" +#include "nel/misc/win_thread.h" #ifdef NL_OS_WINDOWS -#include "nel/misc/win_thread.h" #include "nel/misc/path.h" #define NOMINMAX #include #include +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { CWinThread MainThread ((void*)GetCurrentThread (), GetCurrentThreadId()); diff --git a/code/nel/src/misc/window_displayer.cpp b/code/nel/src/misc/window_displayer.cpp index f54c82505..5c9227933 100644 --- a/code/nel/src/misc/window_displayer.cpp +++ b/code/nel/src/misc/window_displayer.cpp @@ -24,6 +24,10 @@ using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { class CUpdateThread : public IRunnable diff --git a/code/nel/src/misc/words_dictionary.cpp b/code/nel/src/misc/words_dictionary.cpp index f35c41abe..e2113e62d 100644 --- a/code/nel/src/misc/words_dictionary.cpp +++ b/code/nel/src/misc/words_dictionary.cpp @@ -25,6 +25,10 @@ using namespace std; const string DefaultColTitle = "name"; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + namespace NLMISC { NL_INSTANCE_COUNTER_IMPL(CWordsDictionary); diff --git a/code/nel/src/misc/xml_pack.cpp b/code/nel/src/misc/xml_pack.cpp index feab06775..4494be062 100644 --- a/code/nel/src/misc/xml_pack.cpp +++ b/code/nel/src/misc/xml_pack.cpp @@ -20,6 +20,9 @@ using namespace std; +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/net/CMakeLists.txt b/code/nel/src/net/CMakeLists.txt index f30232e8d..487516e74 100644 --- a/code/nel/src/net/CMakeLists.txt +++ b/code/nel/src/net/CMakeLists.txt @@ -26,5 +26,5 @@ ENDIF(WITH_PCH) NL_GEN_PC(nel-net.pc) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) - INSTALL(TARGETS nelnet LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) + INSTALL(TARGETS nelnet LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) diff --git a/code/nel/src/net/login_server.cpp b/code/nel/src/net/login_server.cpp index 736f0f7ef..5bd6dfd34 100644 --- a/code/nel/src/net/login_server.cpp +++ b/code/nel/src/net/login_server.cpp @@ -53,7 +53,7 @@ static string ListenAddr; static bool AcceptInvalidCookie = false; -static string DefaultUserPriv = ""; +static string DefaultUserPriv; static TDisconnectClientCallback DisconnectClientCallback = NULL; diff --git a/code/nel/src/net/message_recorder.cpp b/code/nel/src/net/message_recorder.cpp index 4da49cb3e..ec52ad1da 100644 --- a/code/nel/src/net/message_recorder.cpp +++ b/code/nel/src/net/message_recorder.cpp @@ -80,7 +80,7 @@ CMessageRecorder::CMessageRecorder() : _RecordAll(true) */ CMessageRecorder::~CMessageRecorder() { - if ( _Filename != "" ) + if ( !_Filename.empty() ) { nldebug( "MR:%s: End of recording", _Filename.c_str() ); } diff --git a/code/nel/src/net/nel-net.pc.in b/code/nel/src/net/nel-net.pc.in index 0fb2a0462..cbbf7ab50 100644 --- a/code/nel/src/net/nel-net.pc.in +++ b/code/nel/src/net/nel-net.pc.in @@ -6,7 +6,7 @@ includedir=@includedir@ Name: nel-net Version: @NL_VERSION@ Description: NeL @NL_VERSION@ -Reqiures: +Requires: Libs: -L${libdir} Libs.private: @LIBS@ -lc -lpthread -lrt -ldl Cflags: -I${includedir} -lc -lpthread -lrt -ldl diff --git a/code/nel/src/net/varpath.cpp b/code/nel/src/net/varpath.cpp index 8bee387cd..729f52074 100644 --- a/code/nel/src/net/varpath.cpp +++ b/code/nel/src/net/varpath.cpp @@ -89,7 +89,7 @@ void CVarPath::decode () string val = getToken (); - if (val == "") + if (val.empty()) return; if (val == "[" ) @@ -105,7 +105,7 @@ void CVarPath::decode () osbnb++; // end of token - if (val == "") + if (val.empty()) { nlwarning ("VP: Bad VarPath '%s', suppose it s an empty varpath", RawVarPath.c_str()); Destination.clear (); @@ -143,7 +143,7 @@ void CVarPath::decode () Destination.push_back (make_pair(RawVarPath, string(""))); return; } - else if (val != "." && val != "" && val != "=") + else if (val != "." && !val.empty() && val != "=") { nlwarning ("VP: Malformated VarPath '%s' before position %d", RawVarPath.c_str (), TokenPos); return; diff --git a/code/nel/src/pacs/CMakeLists.txt b/code/nel/src/pacs/CMakeLists.txt index 492df88be..1fde3e6df 100644 --- a/code/nel/src/pacs/CMakeLists.txt +++ b/code/nel/src/pacs/CMakeLists.txt @@ -21,5 +21,5 @@ ENDIF(WITH_PCH) NL_GEN_PC(nel-pacs.pc) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) - INSTALL(TARGETS nelpacs LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) + INSTALL(TARGETS nelpacs LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) diff --git a/code/nel/src/pacs/build_indoor.cpp b/code/nel/src/pacs/build_indoor.cpp index 51dbdf4c0..b4bad19a6 100644 --- a/code/nel/src/pacs/build_indoor.cpp +++ b/code/nel/src/pacs/build_indoor.cpp @@ -15,11 +15,11 @@ // along with this program. If not, see . #include "stdpacs.h" -#include "build_indoor.h" +#include "nel/pacs/build_indoor.h" -#include "collision_mesh_build.h" -#include "local_retriever.h" -#include "exterior_mesh.h" +#include "nel/pacs/collision_mesh_build.h" +#include "nel/pacs/local_retriever.h" +#include "nel/pacs/exterior_mesh.h" using namespace std; using namespace NLMISC; diff --git a/code/nel/src/pacs/chain.cpp b/code/nel/src/pacs/chain.cpp index 1543d68ab..f908cc875 100644 --- a/code/nel/src/pacs/chain.cpp +++ b/code/nel/src/pacs/chain.cpp @@ -16,7 +16,7 @@ #include "stdpacs.h" -#include "chain.h" +#include "nel/pacs/chain.h" using namespace std; using namespace NLMISC; diff --git a/code/nel/src/pacs/chain_quad.cpp b/code/nel/src/pacs/chain_quad.cpp index 29468fa1f..321761953 100644 --- a/code/nel/src/pacs/chain_quad.cpp +++ b/code/nel/src/pacs/chain_quad.cpp @@ -16,7 +16,7 @@ #include "stdpacs.h" -#include "chain_quad.h" +#include "nel/pacs/chain_quad.h" using namespace std; using namespace NLMISC; diff --git a/code/nel/src/pacs/collision_callback.cpp b/code/nel/src/pacs/collision_callback.cpp index 2d5fc2485..016cda262 100644 --- a/code/nel/src/pacs/collision_callback.cpp +++ b/code/nel/src/pacs/collision_callback.cpp @@ -16,7 +16,7 @@ #include "stdpacs.h" -#include "collision_callback.h" +#include "nel/pacs/collision_callback.h" namespace NLPACS diff --git a/code/nel/src/pacs/collision_desc.cpp b/code/nel/src/pacs/collision_desc.cpp index e501dd716..c38049623 100644 --- a/code/nel/src/pacs/collision_desc.cpp +++ b/code/nel/src/pacs/collision_desc.cpp @@ -16,7 +16,7 @@ #include "stdpacs.h" -#include "collision_desc.h" +#include "nel/pacs/collision_desc.h" namespace NLPACS diff --git a/code/nel/src/pacs/collision_ot.cpp b/code/nel/src/pacs/collision_ot.cpp index 95f15359c..74f93f498 100644 --- a/code/nel/src/pacs/collision_ot.cpp +++ b/code/nel/src/pacs/collision_ot.cpp @@ -16,8 +16,8 @@ #include "stdpacs.h" -#include "collision_ot.h" -#include "move_primitive.h" +#include "nel/pacs/collision_ot.h" +#include "nel/pacs/move_primitive.h" namespace NLPACS diff --git a/code/nel/src/pacs/collision_surface_temp.cpp b/code/nel/src/pacs/collision_surface_temp.cpp index 92f869c2c..4033cc33f 100644 --- a/code/nel/src/pacs/collision_surface_temp.cpp +++ b/code/nel/src/pacs/collision_surface_temp.cpp @@ -16,7 +16,7 @@ #include "stdpacs.h" -#include "collision_surface_temp.h" +#include "nel/pacs/collision_surface_temp.h" namespace NLPACS diff --git a/code/nel/src/pacs/edge_collide.cpp b/code/nel/src/pacs/edge_collide.cpp index f785e97db..700935947 100644 --- a/code/nel/src/pacs/edge_collide.cpp +++ b/code/nel/src/pacs/edge_collide.cpp @@ -16,7 +16,7 @@ #include "stdpacs.h" -#include "edge_collide.h" +#include "nel/pacs/edge_collide.h" using namespace NLMISC; using namespace std; diff --git a/code/nel/src/pacs/edge_quad.cpp b/code/nel/src/pacs/edge_quad.cpp index 9bd60b54b..1515af075 100644 --- a/code/nel/src/pacs/edge_quad.cpp +++ b/code/nel/src/pacs/edge_quad.cpp @@ -16,8 +16,8 @@ #include "stdpacs.h" -#include "edge_quad.h" -#include "global_retriever.h" +#include "nel/pacs/edge_quad.h" +#include "nel/pacs/global_retriever.h" using namespace std; using namespace NLMISC; diff --git a/code/nel/src/pacs/exterior_mesh.cpp b/code/nel/src/pacs/exterior_mesh.cpp index a53873e77..d7c72c96f 100644 --- a/code/nel/src/pacs/exterior_mesh.cpp +++ b/code/nel/src/pacs/exterior_mesh.cpp @@ -16,9 +16,9 @@ #include "stdpacs.h" -#include "exterior_mesh.h" -#include "local_retriever.h" -#include "collision_desc.h" +#include "nel/pacs/exterior_mesh.h" +#include "nel/pacs/local_retriever.h" +#include "nel/pacs/collision_desc.h" using namespace std; diff --git a/code/nel/src/pacs/global_retriever.cpp b/code/nel/src/pacs/global_retriever.cpp index b21b199ec..115fac0e6 100644 --- a/code/nel/src/pacs/global_retriever.cpp +++ b/code/nel/src/pacs/global_retriever.cpp @@ -16,8 +16,8 @@ #include "stdpacs.h" -#include "global_retriever.h" -#include "retriever_bank.h" +#include "nel/pacs/global_retriever.h" +#include "nel/pacs/retriever_bank.h" #include "nel/misc/async_file_manager.h" #include "nel/misc/common.h" diff --git a/code/nel/src/pacs/local_retriever.cpp b/code/nel/src/pacs/local_retriever.cpp index af087219f..7158cee0a 100644 --- a/code/nel/src/pacs/local_retriever.cpp +++ b/code/nel/src/pacs/local_retriever.cpp @@ -18,9 +18,9 @@ #include "nel/misc/plane.h" -#include "local_retriever.h" -#include "collision_desc.h" -#include "retriever_instance.h" +#include "nel/pacs/local_retriever.h" +#include "nel/pacs/collision_desc.h" +#include "nel/pacs/retriever_instance.h" #include "nel/misc/hierarchical_timer.h" diff --git a/code/nel/src/pacs/move_cell.cpp b/code/nel/src/pacs/move_cell.cpp index 2dcb1d987..436808754 100644 --- a/code/nel/src/pacs/move_cell.cpp +++ b/code/nel/src/pacs/move_cell.cpp @@ -16,9 +16,9 @@ #include "stdpacs.h" -#include "move_cell.h" -#include "move_element.h" -#include "move_primitive.h" +#include "nel/pacs/move_cell.h" +#include "nel/pacs/move_element.h" +#include "nel/pacs/move_primitive.h" namespace NLPACS { diff --git a/code/nel/src/pacs/move_container.cpp b/code/nel/src/pacs/move_container.cpp index 6e456a9e1..93e05794a 100644 --- a/code/nel/src/pacs/move_container.cpp +++ b/code/nel/src/pacs/move_container.cpp @@ -16,9 +16,9 @@ #include "stdpacs.h" -#include "move_primitive.h" -#include "move_element.h" -#include "primitive_block.h" +#include "nel/pacs/move_primitive.h" +#include "nel/pacs/move_element.h" +#include "nel/pacs/primitive_block.h" #include "nel/misc/hierarchical_timer.h" diff --git a/code/nel/src/pacs/move_element.cpp b/code/nel/src/pacs/move_element.cpp index e21162ab8..b64285769 100644 --- a/code/nel/src/pacs/move_element.cpp +++ b/code/nel/src/pacs/move_element.cpp @@ -16,8 +16,8 @@ #include "stdpacs.h" -#include "move_element.h" -#include "move_element_inline.h" +#include "nel/pacs/move_element.h" +#include "nel/pacs/move_element_inline.h" // leave not static else this workaround don't work diff --git a/code/nel/src/pacs/move_primitive.cpp b/code/nel/src/pacs/move_primitive.cpp index 661ffa1a4..08da7ac38 100644 --- a/code/nel/src/pacs/move_primitive.cpp +++ b/code/nel/src/pacs/move_primitive.cpp @@ -16,9 +16,9 @@ #include "stdpacs.h" -#include "move_primitive.h" -#include "collision_desc.h" -#include "move_element.h" +#include "nel/pacs/move_primitive.h" +#include "nel/pacs/collision_desc.h" +#include "nel/pacs/move_element.h" #include "nel/misc/hierarchical_timer.h" using namespace NLMISC; diff --git a/code/nel/src/pacs/nel-pacs.pc.in b/code/nel/src/pacs/nel-pacs.pc.in index 133b51d53..e1729f105 100644 --- a/code/nel/src/pacs/nel-pacs.pc.in +++ b/code/nel/src/pacs/nel-pacs.pc.in @@ -6,7 +6,7 @@ includedir=@includedir@ Name: nel-pacs Version: @NL_VERSION@ Description: NeL @NL_VERSION@ -Reqiures: +Requires: Libs: -L${libdir} Libs.private: @LIBS@ -lc -lpthread -lrt -ldl Cflags: -I${includedir} -lc -lpthread -lrt -ldl diff --git a/code/nel/src/pacs/primitive_block_pacs.cpp b/code/nel/src/pacs/primitive_block_pacs.cpp index 8cbf47c39..0681d2eea 100644 --- a/code/nel/src/pacs/primitive_block_pacs.cpp +++ b/code/nel/src/pacs/primitive_block_pacs.cpp @@ -16,7 +16,7 @@ #include "stdpacs.h" #include "nel/misc/i_xml.h" -#include "primitive_block.h" +#include "nel/pacs/primitive_block.h" namespace NLPACS diff --git a/code/nel/src/pacs/primitive_world_image.cpp b/code/nel/src/pacs/primitive_world_image.cpp index 050b8dd9f..e8d0378e6 100644 --- a/code/nel/src/pacs/primitive_world_image.cpp +++ b/code/nel/src/pacs/primitive_world_image.cpp @@ -18,9 +18,9 @@ #include "nel/misc/hierarchical_timer.h" -#include "primitive_world_image.h" -#include "move_primitive.h" -#include "move_element.h" +#include "nel/pacs/primitive_world_image.h" +#include "nel/pacs/move_primitive.h" +#include "nel/pacs/move_element.h" using namespace NLMISC; diff --git a/code/nel/src/pacs/retrievable_surface.cpp b/code/nel/src/pacs/retrievable_surface.cpp index 65ce01e55..308034083 100644 --- a/code/nel/src/pacs/retrievable_surface.cpp +++ b/code/nel/src/pacs/retrievable_surface.cpp @@ -16,7 +16,7 @@ #include "stdpacs.h" -#include "retrievable_surface.h" +#include "nel/pacs/retrievable_surface.h" using namespace std; using namespace NLMISC; diff --git a/code/nel/src/pacs/retriever_bank.cpp b/code/nel/src/pacs/retriever_bank.cpp index ab98323ad..03691aca2 100644 --- a/code/nel/src/pacs/retriever_bank.cpp +++ b/code/nel/src/pacs/retriever_bank.cpp @@ -20,7 +20,7 @@ #include "nel/misc/path.h" #include "nel/misc/progress_callback.h" -#include "retriever_bank.h" +#include "nel/pacs/retriever_bank.h" using namespace std; using namespace NLMISC; diff --git a/code/nel/src/pacs/retriever_instance.cpp b/code/nel/src/pacs/retriever_instance.cpp index 04b902ef9..d5d96510c 100644 --- a/code/nel/src/pacs/retriever_instance.cpp +++ b/code/nel/src/pacs/retriever_instance.cpp @@ -16,8 +16,8 @@ #include "stdpacs.h" -#include "retriever_instance.h" -#include "global_retriever.h" +#include "nel/pacs/retriever_instance.h" +#include "nel/pacs/global_retriever.h" using namespace std; using namespace NLMISC; diff --git a/code/nel/src/pacs/surface_quad.cpp b/code/nel/src/pacs/surface_quad.cpp index a7d22e1c2..dade8462c 100644 --- a/code/nel/src/pacs/surface_quad.cpp +++ b/code/nel/src/pacs/surface_quad.cpp @@ -15,7 +15,7 @@ // along with this program. If not, see . #include "stdpacs.h" -#include "surface_quad.h" +#include "nel/pacs/surface_quad.h" #include "nel/misc/file.h" diff --git a/code/nel/src/pacs/vector_2s.cpp b/code/nel/src/pacs/vector_2s.cpp index f63ba0c72..57e635f5d 100644 --- a/code/nel/src/pacs/vector_2s.cpp +++ b/code/nel/src/pacs/vector_2s.cpp @@ -16,7 +16,7 @@ #include "stdpacs.h" -#include "vector_2s.h" +#include "nel/pacs/vector_2s.h" namespace NLPACS { diff --git a/code/nel/src/sound/CMakeLists.txt b/code/nel/src/sound/CMakeLists.txt index 1122551cc..2cf570f69 100644 --- a/code/nel/src/sound/CMakeLists.txt +++ b/code/nel/src/sound/CMakeLists.txt @@ -1,4 +1,3 @@ - FILE(GLOB SRC *.cpp *.h) FILE(GLOB HEADERS ../../include/nel/sound/*.h) @@ -114,7 +113,7 @@ ENDIF(WITH_PCH) NL_GEN_PC(nel-sound.pc) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) - INSTALL(TARGETS nelsound LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) + INSTALL(TARGETS nelsound LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) ADD_SUBDIRECTORY(driver) diff --git a/code/nel/src/sound/audio_mixer_user.cpp b/code/nel/src/sound/audio_mixer_user.cpp index da3c7d177..3a75433f4 100644 --- a/code/nel/src/sound/audio_mixer_user.cpp +++ b/code/nel/src/sound/audio_mixer_user.cpp @@ -35,7 +35,6 @@ #include "nel/sound/driver/buffer.h" #include "nel/sound/driver/effect.h" -#include "nel/sound/background_sound_manager.h" #include "nel/sound/background_sound_manager.h" #include "nel/sound/music_sound_manager.h" #include "nel/sound/background_source.h" diff --git a/code/nel/src/sound/background_source.cpp b/code/nel/src/sound/background_source.cpp index b6177999d..d8cb4a7a4 100644 --- a/code/nel/src/sound/background_source.cpp +++ b/code/nel/src/sound/background_source.cpp @@ -16,7 +16,6 @@ #include "stdsound.h" #include "nel/sound/background_sound_manager.h" - #include "nel/sound/background_source.h" using namespace std; diff --git a/code/nel/src/sound/driver/CMakeLists.txt b/code/nel/src/sound/driver/CMakeLists.txt index 68ad208bb..64e73cb1d 100644 --- a/code/nel/src/sound/driver/CMakeLists.txt +++ b/code/nel/src/sound/driver/CMakeLists.txt @@ -17,7 +17,7 @@ IF(WITH_PCH) ENDIF(WITH_PCH) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) - INSTALL(TARGETS nelsnd_lowlevel LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) + INSTALL(TARGETS nelsnd_lowlevel LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) IF(WITH_DRIVER_OPENAL) diff --git a/code/nel/src/sound/driver/dsound/CMakeLists.txt b/code/nel/src/sound/driver/dsound/CMakeLists.txt index 284b9eeae..74d431084 100644 --- a/code/nel/src/sound/driver/dsound/CMakeLists.txt +++ b/code/nel/src/sound/driver/dsound/CMakeLists.txt @@ -14,7 +14,7 @@ IF(WITH_PCH) ENDIF(WITH_PCH) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC_DRIVERS) OR NOT WITH_STATIC_DRIVERS) - INSTALL(TARGETS nel_drv_dsound_win RUNTIME DESTINATION bin LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib COMPONENT driverssound) + INSTALL(TARGETS nel_drv_dsound_win RUNTIME DESTINATION ${NL_DRIVER_PREFIX} LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT driverssound) IF(WITH_MAXPLUGIN) INSTALL(TARGETS nel_drv_dsound_win RUNTIME DESTINATION maxplugin COMPONENT driverssound) ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/src/sound/driver/dsound/buffer_dsound.h b/code/nel/src/sound/driver/dsound/buffer_dsound.h index 0a1b100c5..fed09c413 100644 --- a/code/nel/src/sound/driver/dsound/buffer_dsound.h +++ b/code/nel/src/sound/driver/dsound/buffer_dsound.h @@ -17,7 +17,7 @@ #ifndef NL_BUFFER_DSOUND_H #define NL_BUFFER_DSOUND_H -#include +#include "nel/sound/driver/buffer.h" namespace NLSOUND { diff --git a/code/nel/src/sound/driver/dsound/listener_dsound.h b/code/nel/src/sound/driver/dsound/listener_dsound.h index 33e97a66b..fe8872cc2 100644 --- a/code/nel/src/sound/driver/dsound/listener_dsound.h +++ b/code/nel/src/sound/driver/dsound/listener_dsound.h @@ -17,7 +17,7 @@ #ifndef NL_LISTENER_DSOUND_H #define NL_LISTENER_DSOUND_H -#include +#include "nel/sound/driver/listener.h" namespace NLSOUND { diff --git a/code/nel/src/sound/driver/dsound/sound_driver_dsound.h b/code/nel/src/sound/driver/dsound/sound_driver_dsound.h index b094776f0..14872c1e1 100644 --- a/code/nel/src/sound/driver/dsound/sound_driver_dsound.h +++ b/code/nel/src/sound/driver/dsound/sound_driver_dsound.h @@ -17,7 +17,7 @@ #ifndef NL_SOUND_DRIVER_DSOUND_H #define NL_SOUND_DRIVER_DSOUND_H -#include +#include "nel/sound/driver/sound_driver.h" #include "source_dsound.h" #include "buffer_dsound.h" diff --git a/code/nel/src/sound/driver/dsound/source_dsound.cpp b/code/nel/src/sound/driver/dsound/source_dsound.cpp index 2ef01f8c4..c3bff3289 100644 --- a/code/nel/src/sound/driver/dsound/source_dsound.cpp +++ b/code/nel/src/sound/driver/dsound/source_dsound.cpp @@ -616,7 +616,6 @@ void CSourceDSound::fadeOut(const TLockedBufferInfo &lbi) ptr = lbi.Ptr2; count = lbi.Size2/2; - while (fade && count) { alpha = (fade<<16) / _XFadeSize; diff --git a/code/nel/src/sound/driver/dsound/source_dsound.h b/code/nel/src/sound/driver/dsound/source_dsound.h index 86130c800..81174c1a0 100644 --- a/code/nel/src/sound/driver/dsound/source_dsound.h +++ b/code/nel/src/sound/driver/dsound/source_dsound.h @@ -17,9 +17,9 @@ #ifndef NL_SOURCE_DSOUND_H #define NL_SOURCE_DSOUND_H -#include -#include -#include +#include "nel/sound/driver/source.h" +#include "nel/sound/driver/sound_driver.h" +#include "nel/sound/driver/buffer.h" namespace NLSOUND { diff --git a/code/nel/src/sound/driver/fmod/CMakeLists.txt b/code/nel/src/sound/driver/fmod/CMakeLists.txt index 982c24bca..d8ee31ba7 100644 --- a/code/nel/src/sound/driver/fmod/CMakeLists.txt +++ b/code/nel/src/sound/driver/fmod/CMakeLists.txt @@ -14,7 +14,7 @@ IF(WITH_PCH) ENDIF(WITH_PCH) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC_DRIVERS) OR NOT WITH_STATIC_DRIVERS) - INSTALL(TARGETS nel_drv_fmod_win RUNTIME DESTINATION bin LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib COMPONENT driverssound) + INSTALL(TARGETS nel_drv_fmod_win RUNTIME DESTINATION ${NL_DRIVER_PREFIX} LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT driverssound) IF(WITH_MAXPLUGIN) INSTALL(TARGETS nel_drv_fmod_win RUNTIME DESTINATION maxplugin COMPONENT driverssound) ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/src/sound/driver/fmod/buffer_fmod.h b/code/nel/src/sound/driver/fmod/buffer_fmod.h index 1678fb426..64d8cf592 100644 --- a/code/nel/src/sound/driver/fmod/buffer_fmod.h +++ b/code/nel/src/sound/driver/fmod/buffer_fmod.h @@ -18,7 +18,7 @@ #define NL_BUFFER_FMOD_H -#include +#include "nel/sound/driver/buffer.h" namespace NLSOUND { diff --git a/code/nel/src/sound/driver/fmod/music_channel_fmod.h b/code/nel/src/sound/driver/fmod/music_channel_fmod.h index abaa9c510..28ffef6ce 100644 --- a/code/nel/src/sound/driver/fmod/music_channel_fmod.h +++ b/code/nel/src/sound/driver/fmod/music_channel_fmod.h @@ -17,7 +17,7 @@ #ifndef NL_MUSIC_CHANNEL_FMOD_H #define NL_MUSIC_CHANNEL_FMOD_H -#include +#include "nel/sound/driver/music_channel.h" struct FSOUND_STREAM; diff --git a/code/nel/src/sound/driver/fmod/sound_driver_fmod.h b/code/nel/src/sound/driver/fmod/sound_driver_fmod.h index bcf75ece6..8beabe562 100644 --- a/code/nel/src/sound/driver/fmod/sound_driver_fmod.h +++ b/code/nel/src/sound/driver/fmod/sound_driver_fmod.h @@ -17,7 +17,7 @@ #ifndef NL_SOUND_DRIVER_FMOD_H #define NL_SOUND_DRIVER_FMOD_H -#include +#include "nel/sound/driver/sound_driver.h" namespace NLSOUND { class IListener; diff --git a/code/nel/src/sound/driver/fmod/source_fmod.h b/code/nel/src/sound/driver/fmod/source_fmod.h index 34e3168d0..a8ef4fb57 100644 --- a/code/nel/src/sound/driver/fmod/source_fmod.h +++ b/code/nel/src/sound/driver/fmod/source_fmod.h @@ -17,9 +17,9 @@ #ifndef NL_SOURCE_FMOD_H #define NL_SOURCE_FMOD_H -#include -#include -#include +#include "nel/sound/driver/source.h" +#include "nel/sound/driver/sound_driver.h" +#include "nel/sound/driver/buffer.h" namespace NLSOUND { class CBufferFMod; diff --git a/code/nel/src/sound/driver/fmod/stdfmod.h b/code/nel/src/sound/driver/fmod/stdfmod.h index 9afe2bef1..afb1af3f1 100644 --- a/code/nel/src/sound/driver/fmod/stdfmod.h +++ b/code/nel/src/sound/driver/fmod/stdfmod.h @@ -24,22 +24,22 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "nel/misc/common.h" +#include "nel/misc/time_nl.h" +#include "nel/misc/singleton.h" +#include "nel/misc/fast_mem.h" +#include "nel/misc/debug.h" +#include "nel/misc/vector.h" +#include "nel/misc/path.h" +#include "nel/misc/file.h" +#include "nel/misc/matrix.h" +#include "nel/misc/big_file.h" +#include "nel/misc/hierarchical_timer.h" +#include "nel/misc/dynloadlib.h" -#include -#include -#include -#include +#include "nel/sound/driver/sound_driver.h" +#include "nel/sound/driver/buffer.h" +#include "nel/sound/driver/source.h" +#include "nel/sound/driver/listener.h" /* end of file */ diff --git a/code/nel/src/sound/driver/openal/CMakeLists.txt b/code/nel/src/sound/driver/openal/CMakeLists.txt index 5e3fcb90b..adf2b584f 100644 --- a/code/nel/src/sound/driver/openal/CMakeLists.txt +++ b/code/nel/src/sound/driver/openal/CMakeLists.txt @@ -45,7 +45,7 @@ IF(WITH_PCH) ENDIF(WITH_PCH) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC_DRIVERS) OR NOT WITH_STATIC_DRIVERS) - INSTALL(TARGETS ${NLDRV_AL_LIB} RUNTIME DESTINATION ${NL_DRIVER_PREFIX} LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib COMPONENT driverssound) + INSTALL(TARGETS ${NLDRV_AL_LIB} RUNTIME DESTINATION ${NL_DRIVER_PREFIX} LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT driverssound) IF(WITH_MAXPLUGIN) INSTALL(TARGETS ${NLDRV_AL_LIB} RUNTIME DESTINATION maxplugin COMPONENT driverssound) ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/src/sound/driver/openal/buffer_al.cpp b/code/nel/src/sound/driver/openal/buffer_al.cpp index 7714abc67..b63e39fa2 100644 --- a/code/nel/src/sound/driver/openal/buffer_al.cpp +++ b/code/nel/src/sound/driver/openal/buffer_al.cpp @@ -117,10 +117,10 @@ bool CBufferAL::unlock(uint size) _DataPtr = NULL; _Capacity = 0; } - + // Error handling if (alGetError() == AL_NO_ERROR) - _IsLoaded = true; + _IsLoaded = true; // ->lock() set it to false return _IsLoaded; } @@ -159,10 +159,9 @@ bool CBufferAL::fill(const uint8 *src, uint size) // Fill buffer (OpenAL one) alBufferData(_BufferName, _SampleFormat, src, size, _Frequency); - + // Error handling - if (alGetError() == AL_NO_ERROR) - _IsLoaded = true; + _IsLoaded = (alGetError() == AL_NO_ERROR); return _IsLoaded; } diff --git a/code/nel/src/sound/driver/openal/buffer_al.h b/code/nel/src/sound/driver/openal/buffer_al.h index 4564f5be3..b2abf2036 100644 --- a/code/nel/src/sound/driver/openal/buffer_al.h +++ b/code/nel/src/sound/driver/openal/buffer_al.h @@ -17,7 +17,7 @@ #ifndef NL_BUFFER_AL_H #define NL_BUFFER_AL_H -#include +#include "nel/sound/driver/buffer.h" namespace NLSOUND { diff --git a/code/nel/src/sound/driver/openal/sound_driver_al.cpp b/code/nel/src/sound/driver/openal/sound_driver_al.cpp index 65af8002c..40ea39d0b 100644 --- a/code/nel/src/sound/driver/openal/sound_driver_al.cpp +++ b/code/nel/src/sound/driver/openal/sound_driver_al.cpp @@ -246,7 +246,6 @@ static const ALchar *getDeviceInternal(const std::string &device) if (AlEnumerateAllExt) { const ALchar* deviceNames = alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER); - // const ALchar* defaultDevice = NULL; if(!strlen(deviceNames)) { nldebug("AL: No audio devices"); @@ -291,6 +290,7 @@ void CSoundDriverAL::initDevice(const std::string &device, ISoundDriver::TSoundO // OpenAL initialization const ALchar *dev = getDeviceInternal(device); + if (!dev) dev = alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER); nldebug("AL: Opening device: '%s'", dev == NULL ? "NULL" : dev); _AlDevice = alcOpenDevice(dev); if (!_AlDevice) throw ESoundDriver("AL: Failed to open device"); diff --git a/code/nel/src/sound/driver/openal/sound_driver_al.h b/code/nel/src/sound/driver/openal/sound_driver_al.h index 49150f31e..a58d5418e 100644 --- a/code/nel/src/sound/driver/openal/sound_driver_al.h +++ b/code/nel/src/sound/driver/openal/sound_driver_al.h @@ -17,7 +17,7 @@ #ifndef NL_SOUND_DRIVER_AL_H #define NL_SOUND_DRIVER_AL_H -#include +#include "nel/sound/driver/sound_driver.h" namespace NLSOUND { class CBufferAL; @@ -126,7 +126,7 @@ public: virtual void startBench(); virtual void endBench(); - virtual void displayBench(NLMISC::CLog * /* log */); + virtual void displayBench(NLMISC::CLog *log); /// Change the rolloff factor and apply to all sources @@ -136,7 +136,7 @@ public: virtual void commit3DChanges(); /// Write information about the driver to the output stream. - virtual void writeProfile(std::string& /* out */); + virtual void writeProfile(std::string& out); /// Remove a buffer void removeBuffer(CBufferAL *buffer); diff --git a/code/nel/src/sound/driver/openal/source_al.cpp b/code/nel/src/sound/driver/openal/source_al.cpp index 4d5bcfa47..1f8d2219f 100644 --- a/code/nel/src/sound/driver/openal/source_al.cpp +++ b/code/nel/src/sound/driver/openal/source_al.cpp @@ -162,6 +162,13 @@ void CSourceAL::submitStreamingBuffer(IBuffer *buffer) CBufferAL *bufferAL = static_cast(buffer); ALuint bufferName = bufferAL->bufferName(); nlassert(bufferName); + + if (!bufferAL->isBufferLoaded()) + { + nlwarning("AL: MUSICBUG: Streaming buffer was not loaded, skipping buffer. This should not happen."); + return; + } + alSourceQueueBuffers(_Source, 1, &bufferName); alTestError(); _QueuedBuffers.push(bufferAL); @@ -242,11 +249,31 @@ bool CSourceAL::play() else if (_IsStreaming) { _IsPaused = false; + /* NEW */ + // called by user as well as by code to resume after buffer underrun + if (!_IsPlaying) // set start time if not playing yet + _StartTime = CTime::getLocalTime(); + _IsPlaying = true; // this play always virtually succeed but may not actually be playing + if (_QueuedBuffers.size()) // ensure buffers have actually queued + { + alSourcePlay(_Source); + if (alGetError() != AL_NO_ERROR) + { + nlwarning("AL: MUSICBUG: Unknown error while trying to play streaming source."); + } + } + else + { + nlwarning("AL: MUSICBUG: Trying to play stream with no buffers queued."); + } + return true; + /* OLD alSourcePlay(_Source); _IsPlaying = (alGetError() == AL_NO_ERROR); if (_IsPlaying) _StartTime = CTime::getLocalTime(); // TODO: Played time should freeze when buffering fails, and be calculated based on the number of buffers played plus passed time. This is necessary for synchronizing animation with sound. return _IsPlaying; + */ // Streaming mode //nlwarning("AL: Cannot play null buffer; streaming not implemented" ); //nlstop; @@ -375,7 +402,7 @@ bool CSourceAL::isPaused() const uint32 CSourceAL::getTime() { if (!_StartTime) return 0; - return (uint32)(CTime::getLocalTime() - _StartTime); + return (uint32)(CTime::getLocalTime() - _StartTime); } /// Set the position vector. diff --git a/code/nel/src/sound/driver/openal/source_al.h b/code/nel/src/sound/driver/openal/source_al.h index d3c08bf41..22cb3d67d 100644 --- a/code/nel/src/sound/driver/openal/source_al.h +++ b/code/nel/src/sound/driver/openal/source_al.h @@ -17,7 +17,7 @@ #ifndef NL_SOURCE_AL_H #define NL_SOURCE_AL_H -#include +#include "nel/sound/driver/source.h" namespace NLSOUND { class IBuffer; diff --git a/code/nel/src/sound/driver/xaudio2/CMakeLists.txt b/code/nel/src/sound/driver/xaudio2/CMakeLists.txt index c0d49bd5e..9113bd022 100644 --- a/code/nel/src/sound/driver/xaudio2/CMakeLists.txt +++ b/code/nel/src/sound/driver/xaudio2/CMakeLists.txt @@ -41,7 +41,7 @@ IF(WITH_PCH) ENDIF(WITH_PCH) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC_DRIVERS) OR NOT WITH_STATIC_DRIVERS) - INSTALL(TARGETS nel_drv_xaudio2_win RUNTIME DESTINATION bin LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib COMPONENT driverssound) + INSTALL(TARGETS nel_drv_xaudio2_win RUNTIME DESTINATION ${NL_DRIVER_PREFIX} LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT driverssound) IF(WITH_MAXPLUGIN) INSTALL(TARGETS nel_drv_xaudio2_win RUNTIME DESTINATION maxplugin COMPONENT driverssound) ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/src/sound/driver/xaudio2/adpcm_xaudio2.h b/code/nel/src/sound/driver/xaudio2/adpcm_xaudio2.h index 19a1b0486..6655c57a8 100644 --- a/code/nel/src/sound/driver/xaudio2/adpcm_xaudio2.h +++ b/code/nel/src/sound/driver/xaudio2/adpcm_xaudio2.h @@ -17,7 +17,7 @@ #ifndef NLSOUND_ADPCM_XAUDIO2_H #define NLSOUND_ADPCM_XAUDIO2_H -#include +#include "nel/sound/driver/buffer.h" namespace NLSOUND { class CBufferXAudio2; diff --git a/code/nel/src/sound/driver/xaudio2/buffer_xaudio2.h b/code/nel/src/sound/driver/xaudio2/buffer_xaudio2.h index 54f802978..0094494ed 100644 --- a/code/nel/src/sound/driver/xaudio2/buffer_xaudio2.h +++ b/code/nel/src/sound/driver/xaudio2/buffer_xaudio2.h @@ -17,7 +17,7 @@ #ifndef NLSOUND_BUFFER_XAUDIO2_H #define NLSOUND_BUFFER_XAUDIO2_H -#include +#include "nel/sound/driver/buffer.h" namespace NLSOUND { class CSoundDriverXAudio2; diff --git a/code/nel/src/sound/driver/xaudio2/listener_xaudio2.h b/code/nel/src/sound/driver/xaudio2/listener_xaudio2.h index 146611de9..10a39ffe5 100644 --- a/code/nel/src/sound/driver/xaudio2/listener_xaudio2.h +++ b/code/nel/src/sound/driver/xaudio2/listener_xaudio2.h @@ -17,8 +17,8 @@ #ifndef NLSOUND_LISTENER_XAUDIO2_H #define NLSOUND_LISTENER_XAUDIO2_H -#include -#include +#include "nel/sound/driver/listener.h" +#include "nel/sound/driver/sound_driver.h" namespace NLSOUND { class CSoundDriverXAudio2; diff --git a/code/nel/src/sound/driver/xaudio2/source_xaudio2.h b/code/nel/src/sound/driver/xaudio2/source_xaudio2.h index f5050c12f..a2d542349 100644 --- a/code/nel/src/sound/driver/xaudio2/source_xaudio2.h +++ b/code/nel/src/sound/driver/xaudio2/source_xaudio2.h @@ -17,9 +17,9 @@ #ifndef NLSOUND_SOURCE_XAUDIO2_H #define NLSOUND_SOURCE_XAUDIO2_H -#include -#include -#include +#include "nel/sound/driver/source.h" +#include "nel/sound/driver/sound_driver.h" +#include "nel/sound/driver/buffer.h" namespace NLSOUND { class CSoundDriverXAudio2; diff --git a/code/nel/src/sound/nel-sound.pc.in b/code/nel/src/sound/nel-sound.pc.in index 9994e967e..44ff6e1f0 100644 --- a/code/nel/src/sound/nel-sound.pc.in +++ b/code/nel/src/sound/nel-sound.pc.in @@ -6,7 +6,7 @@ includedir=@includedir@ Name: nel-sound Version: @NL_VERSION@ Description: NeL @NL_VERSION@ -Reqiures: +Requires: Libs: -L${libdir} Libs.private: @LIBS@ -lc -lpthread -lrt -ldl Cflags: -I${includedir} -lc -lpthread -lrt -ldl diff --git a/code/nel/tools/3d/CMakeLists.txt b/code/nel/tools/3d/CMakeLists.txt index 2d8c4a03a..58360aec0 100644 --- a/code/nel/tools/3d/CMakeLists.txt +++ b/code/nel/tools/3d/CMakeLists.txt @@ -51,6 +51,7 @@ IF(WITH_QT) ENDIF(WITH_QT) IF(SQUISH_FOUND) + ADD_SUBDIRECTORY(s3tc_compressor_lib) ADD_SUBDIRECTORY(panoply_maker) ADD_SUBDIRECTORY(tga_2_dds) ADD_SUBDIRECTORY(hls_bank_maker) diff --git a/code/nel/tools/3d/anim_builder/CMakeLists.txt b/code/nel/tools/3d/anim_builder/CMakeLists.txt index fada1485f..61188b461 100644 --- a/code/nel/tools/3d/anim_builder/CMakeLists.txt +++ b/code/nel/tools/3d/anim_builder/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(anim_builder nelmisc nel3d) NL_DEFAULT_PROPS(anim_builder "NeL, Tools, 3D: anim_builder") NL_ADD_RUNTIME_FLAGS(anim_builder) -INSTALL(TARGETS anim_builder RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS anim_builder RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/animation_set_builder/CMakeLists.txt b/code/nel/tools/3d/animation_set_builder/CMakeLists.txt index 8ebf1fff7..da81b1de3 100644 --- a/code/nel/tools/3d/animation_set_builder/CMakeLists.txt +++ b/code/nel/tools/3d/animation_set_builder/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(animation_set_builder nel3d nelmisc) NL_DEFAULT_PROPS(animation_set_builder "NeL, Tools, 3D: anim_set_builder") NL_ADD_RUNTIME_FLAGS(animation_set_builder) -INSTALL(TARGETS animation_set_builder RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS animation_set_builder RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/build_clod_bank/CMakeLists.txt b/code/nel/tools/3d/build_clod_bank/CMakeLists.txt index 3b7704f24..2bd4846d7 100644 --- a/code/nel/tools/3d/build_clod_bank/CMakeLists.txt +++ b/code/nel/tools/3d/build_clod_bank/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(build_clod_bank nel3d nelmisc) NL_DEFAULT_PROPS(build_clod_bank "NeL, Tools, 3D: build_clod_bank") NL_ADD_RUNTIME_FLAGS(build_clod_bank) -INSTALL(TARGETS build_clod_bank RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS build_clod_bank RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/build_clodtex/CMakeLists.txt b/code/nel/tools/3d/build_clodtex/CMakeLists.txt index a6cefc40c..558962421 100644 --- a/code/nel/tools/3d/build_clodtex/CMakeLists.txt +++ b/code/nel/tools/3d/build_clodtex/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(build_clodtex nel3d nelmisc) NL_DEFAULT_PROPS(build_clodtex "NeL, Tools, 3D: build_clodtex") NL_ADD_RUNTIME_FLAGS(build_clodtex) -INSTALL(TARGETS build_clodtex RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS build_clodtex RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/build_coarse_mesh/CMakeLists.txt b/code/nel/tools/3d/build_coarse_mesh/CMakeLists.txt index 2247b01df..93eba1bfc 100644 --- a/code/nel/tools/3d/build_coarse_mesh/CMakeLists.txt +++ b/code/nel/tools/3d/build_coarse_mesh/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(build_coarse_mesh nel3d nelmisc) NL_DEFAULT_PROPS(build_coarse_mesh "NeL, Tools, 3D: build_coarse_mesh") NL_ADD_RUNTIME_FLAGS(build_coarse_mesh) -INSTALL(TARGETS build_coarse_mesh RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS build_coarse_mesh RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/build_far_bank/CMakeLists.txt b/code/nel/tools/3d/build_far_bank/CMakeLists.txt index adc3afb08..7a858d560 100644 --- a/code/nel/tools/3d/build_far_bank/CMakeLists.txt +++ b/code/nel/tools/3d/build_far_bank/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(build_far_bank nel3d nelmisc) NL_DEFAULT_PROPS(build_far_bank "NeL, Tools, 3D: build_far_bank") NL_ADD_RUNTIME_FLAGS(build_far_bank) -INSTALL(TARGETS build_far_bank RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS build_far_bank RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/build_interface/CMakeLists.txt b/code/nel/tools/3d/build_interface/CMakeLists.txt index ce3aae1f1..243bc326d 100644 --- a/code/nel/tools/3d/build_interface/CMakeLists.txt +++ b/code/nel/tools/3d/build_interface/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(build_interface nelmisc) NL_DEFAULT_PROPS(build_interface "NeL, Tools, 3D: build_interface") NL_ADD_RUNTIME_FLAGS(build_interface) -INSTALL(TARGETS build_interface RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS build_interface RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/build_shadow_skin/CMakeLists.txt b/code/nel/tools/3d/build_shadow_skin/CMakeLists.txt index 60cc83980..78bbd712d 100644 --- a/code/nel/tools/3d/build_shadow_skin/CMakeLists.txt +++ b/code/nel/tools/3d/build_shadow_skin/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(build_shadow_skin nelmisc nel3d) NL_DEFAULT_PROPS(build_shadow_skin "NeL, Tools, 3D: build_shadow_skin") NL_ADD_RUNTIME_FLAGS(build_shadow_skin) -INSTALL(TARGETS build_shadow_skin RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS build_shadow_skin RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/build_smallbank/CMakeLists.txt b/code/nel/tools/3d/build_smallbank/CMakeLists.txt index 7cfccdaf9..260f6b9aa 100644 --- a/code/nel/tools/3d/build_smallbank/CMakeLists.txt +++ b/code/nel/tools/3d/build_smallbank/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(build_smallbank nel3d nelmisc) NL_DEFAULT_PROPS(build_smallbank "NeL, Tools, 3D: build_smallbank") NL_ADD_RUNTIME_FLAGS(build_smallbank) -INSTALL(TARGETS build_smallbank RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS build_smallbank RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/cluster_viewer/CMakeLists.txt b/code/nel/tools/3d/cluster_viewer/CMakeLists.txt index 98d0c800e..a0db8cd68 100644 --- a/code/nel/tools/3d/cluster_viewer/CMakeLists.txt +++ b/code/nel/tools/3d/cluster_viewer/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(cluster_viewer nel3d nelmisc) NL_DEFAULT_PROPS(cluster_viewer "NeL, Tools, 3D: Cluster Viewer") NL_ADD_RUNTIME_FLAGS(cluster_viewer) -INSTALL(TARGETS cluster_viewer RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS cluster_viewer RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/file_info/CMakeLists.txt b/code/nel/tools/3d/file_info/CMakeLists.txt index ce935c4e4..43cb359fd 100644 --- a/code/nel/tools/3d/file_info/CMakeLists.txt +++ b/code/nel/tools/3d/file_info/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(file_info nel3d nelmisc) NL_DEFAULT_PROPS(file_info "NeL, Tools, 3D: file_info") NL_ADD_RUNTIME_FLAGS(file_info) -INSTALL(TARGETS file_info RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS file_info RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/get_neighbors/CMakeLists.txt b/code/nel/tools/3d/get_neighbors/CMakeLists.txt index 9ed4f6e2c..d8de69ff5 100644 --- a/code/nel/tools/3d/get_neighbors/CMakeLists.txt +++ b/code/nel/tools/3d/get_neighbors/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(get_neighbors nelmisc) NL_DEFAULT_PROPS(get_neighbors "NeL, Tools, 3D: get_neighbors") NL_ADD_RUNTIME_FLAGS(get_neighbors) -INSTALL(TARGETS get_neighbors RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS get_neighbors RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/hls_bank_maker/CMakeLists.txt b/code/nel/tools/3d/hls_bank_maker/CMakeLists.txt index 4b4717087..d2482c276 100644 --- a/code/nel/tools/3d/hls_bank_maker/CMakeLists.txt +++ b/code/nel/tools/3d/hls_bank_maker/CMakeLists.txt @@ -1,11 +1,9 @@ -FILE(GLOB SRC *.cpp *.h ../panoply_maker/hls_bank_texture_info.cpp ../panoply_maker/hls_bank_texture_info.h ../s3tc_compressor_lib/*.cpp ../s3tc_compressor_lib/*.h) +FILE(GLOB SRC *.cpp *.h ../panoply_maker/hls_bank_texture_info.cpp ../panoply_maker/hls_bank_texture_info.h) ADD_EXECUTABLE(hls_bank_maker ${SRC}) -INCLUDE_DIRECTORIES(${SQUISH_INCLUDE_DIR}) - -TARGET_LINK_LIBRARIES(hls_bank_maker ${SQUISH_LIBRARIES} nelmisc nel3d) +TARGET_LINK_LIBRARIES(hls_bank_maker s3tc_compressor nelmisc nel3d) NL_DEFAULT_PROPS(hls_bank_maker "NeL, Tools, 3D: hls_bank_maker") NL_ADD_RUNTIME_FLAGS(hls_bank_maker) -INSTALL(TARGETS hls_bank_maker RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS hls_bank_maker RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/ig_add/CMakeLists.txt b/code/nel/tools/3d/ig_add/CMakeLists.txt index 60f5305c0..2ae993d51 100644 --- a/code/nel/tools/3d/ig_add/CMakeLists.txt +++ b/code/nel/tools/3d/ig_add/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(ig_add nel3d nelmisc) NL_DEFAULT_PROPS(ig_add "NeL, Tools, 3D: ig_add") NL_ADD_RUNTIME_FLAGS(ig_add) -INSTALL(TARGETS ig_add RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS ig_add RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/ig_elevation/CMakeLists.txt b/code/nel/tools/3d/ig_elevation/CMakeLists.txt index e453ed1ce..eb59adf22 100644 --- a/code/nel/tools/3d/ig_elevation/CMakeLists.txt +++ b/code/nel/tools/3d/ig_elevation/CMakeLists.txt @@ -10,4 +10,4 @@ NL_ADD_RUNTIME_FLAGS(ig_elevation) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -INSTALL(TARGETS ig_elevation RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS ig_elevation RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/ig_info/CMakeLists.txt b/code/nel/tools/3d/ig_info/CMakeLists.txt index bf39e3e16..59f32f9ca 100644 --- a/code/nel/tools/3d/ig_info/CMakeLists.txt +++ b/code/nel/tools/3d/ig_info/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(ig_info nel3d nelmisc) NL_DEFAULT_PROPS(ig_info "NeL, Tools, 3D: ig_info") NL_ADD_RUNTIME_FLAGS(ig_info) -INSTALL(TARGETS ig_info RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS ig_info RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/ig_lighter/CMakeLists.txt b/code/nel/tools/3d/ig_lighter/CMakeLists.txt index 6636329c3..54f703566 100644 --- a/code/nel/tools/3d/ig_lighter/CMakeLists.txt +++ b/code/nel/tools/3d/ig_lighter/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(ig_lighter nelmisc nel3d nelpacs) NL_DEFAULT_PROPS(ig_lighter "NeL, Tools, 3D: ig_lighter") NL_ADD_RUNTIME_FLAGS(ig_lighter) -INSTALL(TARGETS ig_lighter RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS ig_lighter RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/ig_lighter/ig_lighter.cpp b/code/nel/tools/3d/ig_lighter/ig_lighter.cpp index 3041d3b49..a243ad7bc 100644 --- a/code/nel/tools/3d/ig_lighter/ig_lighter.cpp +++ b/code/nel/tools/3d/ig_lighter/ig_lighter.cpp @@ -27,9 +27,9 @@ #include "nel/3d/shape.h" #include "nel/3d/transform_shape.h" #include "nel/3d/register_3d.h" -#include "../../../src/pacs/global_retriever.h" -#include "../../../src/pacs/local_retriever.h" -#include "../../../src/pacs/retriever_bank.h" +#include "nel/pacs/global_retriever.h" +#include "nel/pacs/local_retriever.h" +#include "nel/pacs/retriever_bank.h" #include "../ig_lighter_lib/ig_lighter_lib.h" diff --git a/code/nel/tools/3d/ig_lighter_lib/ig_lighter_lib.cpp b/code/nel/tools/3d/ig_lighter_lib/ig_lighter_lib.cpp index c933947ed..4365eab9b 100644 --- a/code/nel/tools/3d/ig_lighter_lib/ig_lighter_lib.cpp +++ b/code/nel/tools/3d/ig_lighter_lib/ig_lighter_lib.cpp @@ -16,8 +16,8 @@ #include "ig_lighter_lib.h" #include "nel/misc/path.h" -#include "nel/../../src/pacs/retriever_bank.h" -#include "nel/../../src/pacs/global_retriever.h" +#include "nel/pacs/retriever_bank.h" +#include "nel/pacs/global_retriever.h" #include "nel/3d/scene_group.h" diff --git a/code/nel/tools/3d/lightmap_optimizer/CMakeLists.txt b/code/nel/tools/3d/lightmap_optimizer/CMakeLists.txt index 0427ba6e4..36e5b2aa4 100644 --- a/code/nel/tools/3d/lightmap_optimizer/CMakeLists.txt +++ b/code/nel/tools/3d/lightmap_optimizer/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(lightmap_optimizer nel3d nelmisc) NL_DEFAULT_PROPS(lightmap_optimizer "NeL, Tools, 3D: lightmap_optimizer") NL_ADD_RUNTIME_FLAGS(lightmap_optimizer) -INSTALL(TARGETS lightmap_optimizer RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS lightmap_optimizer RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/ligo/plugin_max/CMakeLists.txt b/code/nel/tools/3d/ligo/plugin_max/CMakeLists.txt index af00c788a..ddf009188 100644 --- a/code/nel/tools/3d/ligo/plugin_max/CMakeLists.txt +++ b/code/nel/tools/3d/ligo/plugin_max/CMakeLists.txt @@ -22,7 +22,7 @@ NL_ADD_LIB_SUFFIX(ligoscape_utility) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -INSTALL(TARGETS ligoscape_utility RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) +INSTALL(TARGETS ligoscape_utility RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) INSTALL(FILES ligoscript.txt DESTINATION maxplugin/docs) INSTALL(DIRECTORY scripts/ DESTINATION maxplugin/scripts/ diff --git a/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.def b/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.def index 18beb72e0..c3f1a6b7c 100644 --- a/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.def +++ b/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.def @@ -1,4 +1,4 @@ -LIBRARY nelligoscapeutility.dlx +;LIBRARY nelligoscapeutility.dlx EXPORTS LibDescription @1 LibNumberClasses @2 diff --git a/code/nel/tools/3d/ligo/plugin_max/script.cpp b/code/nel/tools/3d/ligo/plugin_max/script.cpp index 7763a0126..41740bcbe 100644 --- a/code/nel/tools/3d/ligo/plugin_max/script.cpp +++ b/code/nel/tools/3d/ligo/plugin_max/script.cpp @@ -18,6 +18,14 @@ #include +#ifdef _STLPORT_VERSION +namespace std +{ + float fabsf(float f); + double fabsl(double f); +} +#endif + // Various MAX and MXS includes #include #if MAX_VERSION_MAJOR >= 14 diff --git a/code/nel/tools/3d/object_viewer/CMakeLists.txt b/code/nel/tools/3d/object_viewer/CMakeLists.txt index e22e4dc51..f99f49c68 100644 --- a/code/nel/tools/3d/object_viewer/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer/CMakeLists.txt @@ -21,8 +21,8 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(object_viewer_dll ${CMAKE_CURRENT_SOURCE_DIR}/std_afx.h ${CMAKE_CURRENT_SOURCE_DIR}/std_afx.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS object_viewer_dll LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d) -INSTALL(FILES object_viewer.cfg DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS object_viewer_dll LIBRARY DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT tools3d) +INSTALL(FILES object_viewer.cfg DESTINATION ${NL_ETC_PREFIX} COMPONENT tools3d) IF(WITH_MAXPLUGIN) INSTALL(TARGETS object_viewer_dll RUNTIME DESTINATION maxplugin COMPONENT tools3d) INSTALL(FILES object_viewer.cfg DESTINATION maxplugin COMPONENT tools3d) diff --git a/code/nel/tools/3d/object_viewer/object_viewer.cpp b/code/nel/tools/3d/object_viewer/object_viewer.cpp index 71aba41df..19490309b 100644 --- a/code/nel/tools/3d/object_viewer/object_viewer.cpp +++ b/code/nel/tools/3d/object_viewer/object_viewer.cpp @@ -54,7 +54,7 @@ #include "nel/3d/ps_util.h" -#include "nel/../../src/pacs/global_retriever.h" +#include "nel/pacs/global_retriever.h" diff --git a/code/nel/tools/3d/object_viewer_exe/CMakeLists.txt b/code/nel/tools/3d/object_viewer_exe/CMakeLists.txt index 605030308..d6adb9694 100644 --- a/code/nel/tools/3d/object_viewer_exe/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_exe/CMakeLists.txt @@ -19,7 +19,7 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(object_viewer ${CMAKE_CURRENT_SOURCE_DIR}/std_afx.h ${CMAKE_CURRENT_SOURCE_DIR}/std_afx.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS object_viewer RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS object_viewer RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) IF(WITH_MAXPLUGIN) INSTALL(TARGETS object_viewer RUNTIME DESTINATION maxplugin COMPONENT tools3d) ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/tools/3d/object_viewer_qt/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/CMakeLists.txt index 9e54a1857..ff1128b9f 100644 --- a/code/nel/tools/3d/object_viewer_qt/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/CMakeLists.txt @@ -5,8 +5,26 @@ # #----------------------------------------------------------------------------- -# This tells the application(s) where to fidn the installed data. -ADD_DEFINITIONS(-DDATA_DIR="\\"${NL_SHARE_PREFIX}/object_viewer_qt/\\"") +# This tells the application(s) where to find the installed data. +IF(WIN32) + SET(OVQT_PLUGIN_SPECS_DIR "plugins") + SET(OVQT_PLUGIN_DIR "plugins") + SET(OVQT_DATA_DIR ".") +ELSEIF(APPLE) + # TODO: under Mac OS X, don't install but copy files in application package + SET(OVQT_PLUGIN_SPECS_DIR "plugins") + SET(OVQT_PLUGIN_DIR "plugins") + SET(OVQT_DATA_DIR ".") +ELSE(WIN32) + SET(OVQT_PLUGIN_SPECS_DIR ${NL_SHARE_PREFIX}/object_viewer_qt/plugins) + SET(OVQT_PLUGIN_DIR ${NL_LIB_PREFIX}/object_viewer_qt) + SET(OVQT_DATA_DIR ${NL_SHARE_PREFIX}/object_viewer_qt/data) + + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/ovqt_config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/ovqt_config.h) + INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) + + ADD_DEFINITIONS(-DHAVE_OVQT_CONFIG_H) +ENDIF(WIN32) IF(UNIX AND WITH_STATIC) MESSAGE(FATAL_ERROR "OVQT does not work with static NeL builds on Unix atm.") @@ -15,7 +33,7 @@ ENDIF() ADD_SUBDIRECTORY(src) INSTALL(DIRECTORY data/ - DESTINATION share/object_viewer_qt/data + DESTINATION ${OVQT_DATA_DIR} COMPONENT data PATTERN "CVS" EXCLUDE PATTERN ".svn" EXCLUDE diff --git a/code/nel/tools/3d/object_viewer_qt/ovqt_config.h.cmake b/code/nel/tools/3d/object_viewer_qt/ovqt_config.h.cmake new file mode 100644 index 000000000..5b3a49654 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/ovqt_config.h.cmake @@ -0,0 +1,7 @@ +#ifndef OVQT_CONFIG_H +#define OVQT_CONFIG_H + +#define DATA_DIR "${NL_SHARE_ABSOLUTE_PREFIX}/object_viewer_qt" +#define PLUGINS_DIR "${NL_LIB_ABSOLUTE_PREFIX}/object_viewer_qt" + +#endif diff --git a/code/nel/tools/3d/object_viewer_qt/src/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/CMakeLists.txt index 7dc1445bb..d77b0e6a1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/CMakeLists.txt @@ -21,12 +21,12 @@ SET(OBJECT_VIEWER_TS translations/object_viewer_qt_en.ts SET(QT_USE_QTGUI TRUE) SET(QT_USE_QTOPENGL TRUE) - -IF(WIN32) - SET(OBJECT_VIEWER_RC object_viewer_qt.rc) + +IF(WIN32) + SET(OBJECT_VIEWER_RC object_viewer_qt.rc) ENDIF(WIN32) -QT4_ADD_TRANSLATION(OBJECT_VIEWER_QM ${OBJECT_VIEWER_TS}) +QT4_ADD_TRANSLATION(OBJECT_VIEWER_QM ${OBJECT_VIEWER_TS}) QT4_ADD_RESOURCES( OBJECT_VIEWER_RC_SRCS ${OBJECT_VIEWER_RCS}) QT4_WRAP_CPP( OBJECT_VIEWER_MOC_SRCS ${OBJECT_VIEWER_HDR} ) @@ -50,4 +50,4 @@ NL_ADD_RUNTIME_FLAGS(object_viewer_qt) ADD_SUBDIRECTORY(plugins) -INSTALL(TARGETS object_viewer_qt RUNTIME DESTINATION bin COMPONENT runtime BUNDLE DESTINATION /Applications) +INSTALL(TARGETS object_viewer_qt RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT runtime BUNDLE DESTINATION /Applications) diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp index 6c5b8a36c..9b9da508b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp @@ -54,7 +54,7 @@ void PluginManager::addObject(QObject *obj) nlwarning("trying to add duplicate object"); return; } - nlinfo(QString("addObject: " + obj->objectName()).toStdString().c_str()); + nlinfo("addObject: %s", obj->objectName().toUtf8().constData()); m_allObjects.append(obj); @@ -71,10 +71,10 @@ void PluginManager::removeObject(QObject *obj) if (!m_allObjects.contains(obj)) { - nlinfo(QString("object not in list: " + obj->objectName()).toStdString().c_str()); + nlinfo("object not in list: %s", obj->objectName().toUtf8().constData()); return; } - nlinfo(QString("removeObject: " + obj->objectName()).toStdString().c_str()); + nlinfo("removeObject: %s", obj->objectName().toUtf8().constData()); Q_EMIT aboutToRemoveObject(obj); QWriteLocker lock(&m_lock); diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp index 30e35f8c1..89f8046bb 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp @@ -31,6 +31,14 @@ #include #include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifdef HAVE_OVQT_CONFIG_H +#include "ovqt_config.h" +#endif + namespace ExtensionSystem { const char *const PLUGIN_SPEC_NAME = "name"; @@ -71,6 +79,7 @@ PluginSpec::PluginSpec() # error "Unknown compilation mode, can't build suffix" # endif #elif defined (NL_OS_UNIX) + m_prefix = "lib"; m_suffix = ".so"; #else # error "You must define the lib suffix for your platform" @@ -139,12 +148,47 @@ QList PluginSpec::dependencySpecs() const bool PluginSpec::setFileName(const QString &fileName) { - m_fileName = fileName + m_suffix; + m_fileName = m_prefix + fileName + m_suffix; m_filePath = m_location + "/" + m_fileName; - nlinfo(m_filePath.toStdString().c_str()); - QFile file(m_filePath); - if (!file.exists()) + QFile file; + file.setFileName(m_filePath); + + bool exists = file.exists(); + +#ifdef NL_OS_UNIX + +#ifdef PLUGINS_DIR + if (!exists) + { + // if plugin can't be found in the same directory as spec file, + // looks for it in PLUGINS_DIR + m_filePath = QString("%1/%2").arg(PLUGINS_DIR).arg(m_fileName); + + file.setFileName(m_filePath); + + exists = file.exists(); + } +#endif + +#ifdef NL_LIB_PREFIX + if (!exists) + { + // if plugin can't be found in the same directory as spec file or PLUGINS_DIR, + // looks for it in NL_LIB_PREFIX + m_filePath = QString("%1/%2").arg(NL_LIB_PREFIX).arg(m_fileName); + + file.setFileName(m_filePath); + + exists = file.exists(); + } +#endif + +#endif + + nlinfo(m_filePath.toUtf8().constData()); + + if (!exists) return reportError(QCoreApplication::translate("PluginSpec", "File does not exist: %1").arg(file.fileName())); if (!file.open(QIODevice::ReadOnly)) return reportError(QCoreApplication::translate("PluginSpec", "Could not open file for read: %1").arg(file.fileName())); @@ -390,4 +434,4 @@ bool PluginSpec::reportError(const QString &err) return false; } -} // namespace ExtensionSystem \ No newline at end of file +} // namespace ExtensionSystem diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.h b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.h index c28980d69..0ce74d004 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.h +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.h @@ -84,6 +84,7 @@ private: QString m_description; QString m_nameSpecFile; + QString m_prefix; QString m_suffix; int m_state; bool m_enabled, m_enabledStartup; diff --git a/code/nel/tools/3d/object_viewer_qt/src/main.cpp b/code/nel/tools/3d/object_viewer_qt/src/main.cpp index 7e9e05a77..d7569bda8 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/main.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/main.cpp @@ -41,6 +41,10 @@ #include #include +#ifdef HAVE_OVQT_CONFIG_H +#include "ovqt_config.h" +#endif + static const char *appNameC = "ObjectViewerQt"; // nel_qt log file name @@ -145,16 +149,16 @@ sint main(int argc, char **argv) #if defined(NL_OS_MAC) QDir::setCurrent(qApp->applicationDirPath() + QString("/../Resources")); - NLMISC::CLibrary::addLibPath((qApp->applicationDirPath() + QString("/../PlugIns/nel")).toStdString()); + NLMISC::CLibrary::addLibPath((qApp->applicationDirPath() + QString("/../PlugIns/nel")).toUtf8().constData()); #endif ExtensionSystem::PluginManager pluginManager; pluginManager.setSettings(settings); QStringList pluginPaths; -#if !defined(NL_OS_MAC) - pluginPaths << settings->value("PluginPath", "./plugins").toString(); -#else +#if defined(NL_OS_MAC) pluginPaths << settings->value("PluginPath", qApp->applicationDirPath() + QString("/../PlugIns/ovqt")).toString(); +#else + pluginPaths << settings->value("PluginPath", QString("%1/plugins").arg(DATA_DIR)).toString(); #endif pluginManager.setPluginPaths(pluginPaths); @@ -198,4 +202,4 @@ sint main(int argc, char **argv) int result = app.exec(); return result; -} \ No newline at end of file +} diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/CMakeLists.txt index 08adfb89c..2991da073 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/CMakeLists.txt @@ -44,4 +44,6 @@ NL_ADD_LIB_SUFFIX(ovqt_plugin_bnp_manager) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) -INSTALL(TARGETS ovqt_plugin_bnp_manager LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d) +INSTALL(TARGETS ovqt_plugin_bnp_manager LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} ARCHIVE DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_bnp_manager.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_filelist_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_filelist_dialog.cpp index 42106e864..ebeb07bd8 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_filelist_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_filelist_dialog.cpp @@ -79,7 +79,7 @@ bool BnpFileListDialog::loadTable(const QString filePath) int row = 0; // read the header from the bnp file - if (!myBNPFileHandle.readHeader( filePath.toStdString()) ) + if (!myBNPFileHandle.readHeader( filePath.toUtf8().constData()) ) { return false; } @@ -125,7 +125,7 @@ void BnpFileListDialog::getSelections(TSelectionList& SelectionList) { QVariant data = model->data(index); QString filename = data.toString(); - SelectionList.push_back( filename.toStdString() ); + SelectionList.push_back( filename.toUtf8().constData() ); } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_manager_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_manager_window.cpp index edeb30bc4..04b4fd628 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_manager_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_manager_window.cpp @@ -94,7 +94,7 @@ void BNPManagerWindow::createDialogs() { // create dialog to list the contents of the specified // bnp data file directory - m_BnpDirTreeDialog = new CBnpDirTreeDialog(tr(m_DataPath.toStdString().c_str()),this); + m_BnpDirTreeDialog = new CBnpDirTreeDialog(tr(m_DataPath.toUtf8().constData()),this); addDockWidget(Qt::LeftDockWidgetArea, m_BnpDirTreeDialog); m_BnpDirTreeDialog->setVisible(true); restoreDockWidget(m_BnpDirTreeDialog); @@ -187,7 +187,7 @@ void BNPManagerWindow::newFile() m_openedBNPFile = filePath; m_BnpFileListDialog->setWindowTitle (filePath); - myBNPFileHandle.createFile ( filePath.toStdString() ); + myBNPFileHandle.createFile ( filePath.toUtf8().constData() ); } // *************************************************************************** @@ -196,7 +196,7 @@ void BNPManagerWindow::open() QString fileName; // file dialog to select with file should be opened fileName = QFileDialog::getOpenFileName(this, - tr("Open BNP file"), tr(m_DataPath.toStdString().c_str()), tr("BNP Files (*.bnp)")); + tr("Open BNP file"), tr(m_DataPath.toUtf8().constData()), tr("BNP Files (*.bnp)")); // Check if filename is empty if (fileName.isNull()) @@ -234,7 +234,7 @@ void BNPManagerWindow::addFiles() QStringList::iterator it_list = FileList.begin(); while (it_list != FileList.end() ) { - string fileName = CFile::getFilename (it_list->toStdString() ); + string fileName = CFile::getFilename (it_list->toUtf8().constData() ); if ( std::find(currentFiles.begin(), currentFiles.end(), fileName ) != currentFiles.end() ) { // Ask the user if he wants to override the existing file @@ -246,7 +246,7 @@ void BNPManagerWindow::addFiles() } else { - addFiles.push_back( it_list->toStdString() ); + addFiles.push_back( it_list->toUtf8().constData() ); // log it nlinfo("Add file %s", fileName.c_str() ); } @@ -277,7 +277,7 @@ void BNPManagerWindow::addFiles( QStringList FileList ) QStringList::iterator it_list = FileList.begin(); while (it_list != FileList.end() ) { - string fileName = CFile::getFilename (it_list->toStdString() ); + string fileName = CFile::getFilename (it_list->toUtf8().constData() ); if ( std::find(currentFiles.begin(), currentFiles.end(), fileName ) != currentFiles.end() ) { // Ask the user if he wants to override the existing file @@ -289,7 +289,7 @@ void BNPManagerWindow::addFiles( QStringList FileList ) } else { - addFiles.push_back( it_list->toStdString() ); + addFiles.push_back( it_list->toUtf8().constData() ); // log it nlinfo("Add file %s", fileName.c_str() ); } @@ -346,7 +346,7 @@ void BNPManagerWindow::unpackFiles() } QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"), - tr(m_DataPath.toStdString().c_str()), + tr(m_DataPath.toUtf8().constData()), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); @@ -354,7 +354,7 @@ void BNPManagerWindow::unpackFiles() if ( dir.isEmpty() ) return; - if (myBNPFileHandle.unpack(dir.toStdString(),selectedrows)) + if (myBNPFileHandle.unpack(dir.toUtf8().constData(),selectedrows)) { QMessageBox::information(this, tr("BNP Manager"), tr("All files has been exported successfully."), @@ -426,7 +426,7 @@ void BNPManagerWindow::dropEvent(QDropEvent *event) filePath = it->toLocalFile(); if ( filePath.endsWith(".bnp") ) { - nlwarning("Could not add a bnp file!", filePath.toStdString().c_str() ); + nlwarning("Could not add bnp file %s!", filePath.toUtf8().constData() ); } else { diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/CMakeLists.txt index 77f3562e6..17172c488 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/CMakeLists.txt @@ -55,4 +55,19 @@ NL_ADD_LIB_SUFFIX(ovqt_plugin_core) ADD_DEFINITIONS(-DCORE_LIBRARY ${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) -INSTALL(TARGETS ovqt_plugin_core LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d) +IF(WIN32) + IF(WITH_INSTALL_LIBRARIES) + INSTALL(TARGETS ovqt_plugin_core LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + ELSE(WITH_INSTALL_LIBRARIES) + INSTALL(TARGETS ovqt_plugin_core LIBRARY DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + ENDIF(WITH_INSTALL_LIBRARIES) +ELSE(WIN32) + IF(WITH_INSTALL_LIBRARIES) + INSTALL(TARGETS ovqt_plugin_core LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + ELSE(WITH_INSTALL_LIBRARIES) + INSTALL(TARGETS ovqt_plugin_core LIBRARY DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + ENDIF(WITH_INSTALL_LIBRARIES) +ENDIF(WIN32) + +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_core.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/context_manager.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/context_manager.cpp index d82cdb63b..8355b5cb8 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/context_manager.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/context_manager.cpp @@ -1,167 +1,167 @@ -// Object Viewer Qt - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// Copyright (C) 2011 Dzmitry Kamiahin -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -// Project includes -#include "context_manager.h" -#include "icontext.h" -#include "main_window.h" - -// NeL includes -#include - -// Qt includes -#include -#include - -namespace Core -{ - -struct ContextManagerPrivate -{ - explicit ContextManagerPrivate(Core::MainWindow *mainWindow, QTabWidget *tabWidget); - Core::MainWindow *m_mainWindow; - QTabWidget *m_tabWidget; - QVector m_contexts; - int m_oldCurrent; -}; - -ContextManagerPrivate::ContextManagerPrivate(Core::MainWindow *mainWindow, QTabWidget *tabWidget) - : m_mainWindow(mainWindow), - m_tabWidget(tabWidget), - m_oldCurrent(-1) -{ -} - -ContextManager::ContextManager(Core::MainWindow *mainWindow, QTabWidget *tabWidget) - : d(new ContextManagerPrivate(mainWindow, tabWidget)) -{ - QObject::connect(d->m_mainWindow->pluginManager(), SIGNAL(objectAdded(QObject *)), - this, SLOT(objectAdded(QObject *))); - QObject::connect(d->m_mainWindow->pluginManager(), SIGNAL(aboutToRemoveObject(QObject *)), - this, SLOT(aboutToRemoveObject(QObject *))); - - QObject::connect(d->m_tabWidget, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int))); -} - -ContextManager::~ContextManager() -{ - delete d; -} - -Core::IContext *ContextManager::currentContext() const -{ - int currentIndex = d->m_tabWidget->currentIndex(); - if (currentIndex < 0) - return 0; - return d->m_contexts.at(currentIndex); -} - -Core::IContext *ContextManager::context(const QString &id) const -{ - const int index = indexOf(id); - if (index >= 0) - return d->m_contexts.at(index); - return 0; -} - +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +// Project includes +#include "context_manager.h" +#include "icontext.h" +#include "main_window.h" + +// NeL includes +#include + +// Qt includes +#include +#include + +namespace Core +{ + +struct ContextManagerPrivate +{ + explicit ContextManagerPrivate(Core::MainWindow *mainWindow, QTabWidget *tabWidget); + Core::MainWindow *m_mainWindow; + QTabWidget *m_tabWidget; + QVector m_contexts; + int m_oldCurrent; +}; + +ContextManagerPrivate::ContextManagerPrivate(Core::MainWindow *mainWindow, QTabWidget *tabWidget) + : m_mainWindow(mainWindow), + m_tabWidget(tabWidget), + m_oldCurrent(-1) +{ +} + +ContextManager::ContextManager(Core::MainWindow *mainWindow, QTabWidget *tabWidget) + : d(new ContextManagerPrivate(mainWindow, tabWidget)) +{ + QObject::connect(d->m_mainWindow->pluginManager(), SIGNAL(objectAdded(QObject *)), + this, SLOT(objectAdded(QObject *))); + QObject::connect(d->m_mainWindow->pluginManager(), SIGNAL(aboutToRemoveObject(QObject *)), + this, SLOT(aboutToRemoveObject(QObject *))); + + QObject::connect(d->m_tabWidget, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int))); +} + +ContextManager::~ContextManager() +{ + delete d; +} + +Core::IContext *ContextManager::currentContext() const +{ + int currentIndex = d->m_tabWidget->currentIndex(); + if (currentIndex < 0) + return 0; + return d->m_contexts.at(currentIndex); +} + +Core::IContext *ContextManager::context(const QString &id) const +{ + const int index = indexOf(id); + if (index >= 0) + return d->m_contexts.at(index); + return 0; +} + void ContextManager::registerUndoStack(QUndoStack *stack) { nlassert(stack); d->m_mainWindow->undoGroup()->addStack(stack); } -void ContextManager::unregisterUndoStack(QUndoStack *stack) -{ +void ContextManager::unregisterUndoStack(QUndoStack *stack) +{ nlassert(stack); d->m_mainWindow->undoGroup()->removeStack(stack); -} - -void ContextManager::activateContext(const QString &id) -{ - const int index = indexOf(id); - if (index >= 0) - d->m_tabWidget->setCurrentIndex(index); -} - -void ContextManager::updateCurrentContext() -{ - d->m_mainWindow->updateContext(currentContext()); -} - -void ContextManager::objectAdded(QObject *obj) -{ - IContext *context = qobject_cast(obj); - if (context) - addContextObject(context); -} - -void ContextManager::aboutToRemoveObject(QObject *obj) -{ - IContext *context = qobject_cast(obj); - if (context) - removeContextObject(context); -} - -void ContextManager::addContextObject(IContext *context) -{ - d->m_contexts.push_back(context); - d->m_mainWindow->addContextObject(context); - - QWidget *tabWidget = new QWidget(d->m_tabWidget); - d->m_tabWidget->addTab(tabWidget, context->icon(), context->trName()); - QGridLayout *gridLayout = new QGridLayout(tabWidget); - gridLayout->setObjectName(QString::fromUtf8("gridLayout_") + context->id()); - gridLayout->setContentsMargins(0, 0, 0, 0); - gridLayout->addWidget(context->widget(), 0, 0, 1, 1); -} - -void ContextManager::removeContextObject(IContext *context) -{ - d->m_mainWindow->removeContextObject(context); - - const int index = indexOf(context->id()); - QWidget *widget = d->m_tabWidget->widget(index); - d->m_tabWidget->removeTab(index); - d->m_contexts.remove(index); - delete widget; -} - -void ContextManager::currentTabChanged(int index) -{ - if (index >= 0) - { - IContext *context = d->m_contexts.at(index); - IContext *oldContext = 0; - if (d->m_oldCurrent >= 0) - oldContext = d->m_contexts.at(d->m_oldCurrent); - d->m_oldCurrent = index; - Q_EMIT currentContextChanged(context, oldContext); - } -} - -int ContextManager::indexOf(const QString &id) const -{ - for (int i = 0; i < d->m_contexts.count(); ++i) - { - if (d->m_contexts.at(i)->id() == id) - return i; - } - nlwarning(QString("Warning, no such context: %1").arg(id).toStdString().c_str()); - return -1; -} - +} + +void ContextManager::activateContext(const QString &id) +{ + const int index = indexOf(id); + if (index >= 0) + d->m_tabWidget->setCurrentIndex(index); +} + +void ContextManager::updateCurrentContext() +{ + d->m_mainWindow->updateContext(currentContext()); +} + +void ContextManager::objectAdded(QObject *obj) +{ + IContext *context = qobject_cast(obj); + if (context) + addContextObject(context); +} + +void ContextManager::aboutToRemoveObject(QObject *obj) +{ + IContext *context = qobject_cast(obj); + if (context) + removeContextObject(context); +} + +void ContextManager::addContextObject(IContext *context) +{ + d->m_contexts.push_back(context); + d->m_mainWindow->addContextObject(context); + + QWidget *tabWidget = new QWidget(d->m_tabWidget); + d->m_tabWidget->addTab(tabWidget, context->icon(), context->trName()); + QGridLayout *gridLayout = new QGridLayout(tabWidget); + gridLayout->setObjectName(QString::fromUtf8("gridLayout_") + context->id()); + gridLayout->setContentsMargins(0, 0, 0, 0); + gridLayout->addWidget(context->widget(), 0, 0, 1, 1); +} + +void ContextManager::removeContextObject(IContext *context) +{ + d->m_mainWindow->removeContextObject(context); + + const int index = indexOf(context->id()); + QWidget *widget = d->m_tabWidget->widget(index); + d->m_tabWidget->removeTab(index); + d->m_contexts.remove(index); + delete widget; +} + +void ContextManager::currentTabChanged(int index) +{ + if (index >= 0) + { + IContext *context = d->m_contexts.at(index); + IContext *oldContext = 0; + if (d->m_oldCurrent >= 0) + oldContext = d->m_contexts.at(d->m_oldCurrent); + d->m_oldCurrent = index; + Q_EMIT currentContextChanged(context, oldContext); + } +} + +int ContextManager::indexOf(const QString &id) const +{ + for (int i = 0; i < d->m_contexts.count(); ++i) + { + if (d->m_contexts.at(i)->id() == id) + return i; + } + nlwarning(QString("Warning, no such context: %1").arg(id).toUtf8().constData()); + return -1; +} + } /* namespace Core */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.cpp index 9031fcb9f..bfbb06d66 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.cpp @@ -31,6 +31,10 @@ #include #include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + namespace Core { @@ -83,15 +87,22 @@ void GeneralSettingsPage::applyGeneralSettings() QApplication::setPalette(m_originalPalette); settings->endGroup(); + QString levelDesignPrefix; +#if defined(_DEBUG) && defined(NL_OS_WINDOWS) + levelDesignPrefix = "l:"; +#else + levelDesignPrefix = QString("%1/data_leveldesign").arg(RYZOM_SHARE_PREFIX); +#endif + // Add primitives path and ligo config file to CPath settings->beginGroup(Core::Constants::DATA_PATH_SECTION); - QString primitivePath = settings->value(Core::Constants::PRIMITIVES_PATH, "l:/primitives").toString(); - QString ligoConfigFile = settings->value(Core::Constants::LIGOCONFIG_FILE, "l:/leveldesign/world_editor_files/world_editor_classes.xml").toString(); - QString leveldesignPath = settings->value(Core::Constants::LEVELDESIGN_PATH, "l:/leveldesign").toString(); - NLMISC::CPath::addSearchPath(primitivePath.toStdString(), true, false); + QString primitivePath = settings->value(Core::Constants::PRIMITIVES_PATH, QString("%1/primitives").arg(levelDesignPrefix)).toString(); + QString ligoConfigFile = settings->value(Core::Constants::LIGOCONFIG_FILE, QString("%1/leveldesign/world_editor_files/world_editor_classes.xml").arg(levelDesignPrefix)).toString(); + QString leveldesignPath = settings->value(Core::Constants::LEVELDESIGN_PATH, QString("%1/leveldesign").arg(levelDesignPrefix)).toString(); + NLMISC::CPath::addSearchPath(primitivePath.toUtf8().constData(), true, false); NLMISC::CPath::display(); - NLMISC::CPath::addSearchFile(ligoConfigFile.toStdString()); - NLMISC::CPath::addSearchPath(leveldesignPath.toStdString(), true, false); + NLMISC::CPath::addSearchFile(ligoConfigFile.toUtf8().constData()); + NLMISC::CPath::addSearchPath(leveldesignPath.toUtf8().constData(), true, false); settings->endGroup(); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/menu_manager.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/menu_manager.cpp index 68a8e3080..3e6272f0a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/menu_manager.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/menu_manager.cpp @@ -62,7 +62,7 @@ QMenu *MenuManager::menu(const QString &id) const { QMenu *result = 0; if (!d->m_menuMap.contains(id)) - nlwarning("QMenu %s not found", id.toStdString().c_str()); + nlwarning("QMenu %s not found", id.toUtf8().constData()); else result = d->m_menuMap.value(id); return result; @@ -72,7 +72,7 @@ QAction *MenuManager::action(const QString &id) const { QAction *result = 0; if (!d->m_actionMap.contains(id)) - nlwarning("QAction %s not found", id.toStdString().c_str()); + nlwarning("QAction %s not found", id.toUtf8().constData()); else result = d->m_actionMap.value(id); return result; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp index 1a2ac3eef..e76d6c796 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp @@ -116,11 +116,11 @@ void SearchPathsSettingsPage::applySearchPaths() settings->endGroup(); for (int i = 1; i < remapExt.size(); i += 2) - NLMISC::CPath::remapExtension(remapExt.at(i - 1).toStdString(), remapExt.at(i).toStdString(), true); + NLMISC::CPath::remapExtension(remapExt.at(i - 1).toUtf8().constData(), remapExt.at(i).toUtf8().constData(), true); Q_FOREACH(QString path, paths) { - NLMISC::CPath::addSearchPath(path.toStdString(), m_recurse, false); + NLMISC::CPath::addSearchPath(path.toUtf8().constData(), m_recurse, false); } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/CMakeLists.txt index 790af3ef6..f7bb49daf 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/CMakeLists.txt @@ -40,4 +40,6 @@ NL_ADD_LIB_SUFFIX(ovqt_plugin_disp_sheet_id) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) -INSTALL(TARGETS ovqt_plugin_disp_sheet_id LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d) \ No newline at end of file +INSTALL(TARGETS ovqt_plugin_disp_sheet_id LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} ARCHIVE DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_disp_sheet_id.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/CMakeLists.txt index f34309a74..4b24a0363 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/CMakeLists.txt @@ -38,4 +38,6 @@ NL_ADD_LIB_SUFFIX(ovqt_plugin_example) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) -INSTALL(TARGETS ovqt_plugin_example LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d) +INSTALL(TARGETS ovqt_plugin_example LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} ARCHIVE DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_example.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.cpp index 4872923db..d512521f7 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.cpp @@ -60,7 +60,7 @@ QNLWidget::~QNLWidget() void QNLWidget::init() { // create the driver - m_driver = NL3D::UDriver::createDriver(NULL, false, NULL); + m_driver = NL3D::UDriver::createDriver(0, false); nlassert(m_driver); // initialize the nel 3d viewport diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/CMakeLists.txt index 5aba06740..b4536510f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/CMakeLists.txt @@ -46,4 +46,9 @@ NL_ADD_LIB_SUFFIX(ovqt_plugin_georges_editor) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) -INSTALL(TARGETS ovqt_plugin_georges_editor LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d) +INSTALL(TARGETS ovqt_plugin_georges_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} ARCHIVE DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_georges_editor.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) + +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(ovqt_plugin_georges_editor ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) +ENDIF(WITH_PCH) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/expandable_headerview.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/expandable_headerview.cpp index 731fa8d16..cbe4bc0d7 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/expandable_headerview.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/expandable_headerview.cpp @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdpch.h" // Project includes #include "expandable_headerview.h" diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formdelegate.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formdelegate.cpp index ab306bf05..f2a2ba6c3 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formdelegate.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formdelegate.cpp @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdpch.h" #include "formdelegate.h" // NeL includes @@ -97,7 +98,7 @@ namespace GeorgesQt //QString min = QString(type->getMin().c_str()); //QString max = QString(type->getMax().c_str()); //QString inc = QString(type->getIncrement().c_str()); - //nldebug(QString("min %1 max %2 inc %3").arg(min).arg(max).arg(inc).toStdString().c_str()); + //nldebug(QString("min %1 max %2 inc %3").arg(min).arg(max).arg(inc).toUtf8().constData()); // TODO: use saved min/max values editor->setMinimum(-99999); @@ -112,7 +113,7 @@ namespace GeorgesQt //QString min = QString(type->getMin().c_str()); //QString max = QString(type->getMax().c_str()); //QString inc = QString(type->getIncrement().c_str()); - //nldebug(QString("min %1 max %2 inc %3").arg(min).arg(max).arg(inc).toStdString().c_str()); + //nldebug(QString("min %1 max %2 inc %3").arg(min).arg(max).arg(inc).toUtf8().constData()); // TODO: use saved min/max values editor->setMinimum(-99999); @@ -203,7 +204,7 @@ namespace GeorgesQt else { nldebug(QString("setModelData from %1 to %2") - .arg(oldValue).arg(value).toStdString().c_str()); + .arg(oldValue).arg(value).toUtf8().constData()); model->setData(index, value, Qt::EditRole); } } @@ -224,7 +225,7 @@ namespace GeorgesQt else { nldebug(QString("setModelData from %1 to %2") - .arg(oldValue).arg(value).toStdString().c_str()); + .arg(oldValue).arg(value).toUtf8().constData()); model->setData(index, value, Qt::EditRole); } break; @@ -241,7 +242,7 @@ namespace GeorgesQt else { nldebug(QString("setModelData from %1 to %2") - .arg(oldValue).arg(value).toStdString().c_str()); + .arg(oldValue).arg(value).toUtf8().constData()); model->setData(index, value, Qt::EditRole); } break; @@ -262,7 +263,7 @@ namespace GeorgesQt else { nldebug(QString("setModelData from %1 to %2") - .arg(oldValue).arg(value).toStdString().c_str()); + .arg(oldValue).arg(value).toUtf8().constData()); model->setData(index, value, Qt::EditRole); } break; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formitem.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formitem.cpp index 9281bad2e..426009ca3 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formitem.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formitem.cpp @@ -117,7 +117,7 @@ namespace GeorgesQt bool parentVDfnArray; NLGEORGES::CForm *form = static_cast(m_form); NLGEORGES::CFormElm *elm = static_cast(&form->getRootNode()); - nlverify ( elm->getNodeByName (_FormName.c_str(), &parentDfn, indexDfn, + nlverify ( elm->getNodeByName (_FormName.c_str(), &parentDfn, indexDfn, &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) ); if(array && node) @@ -141,7 +141,7 @@ namespace GeorgesQt bool parentVDfnArray; NLGEORGES::CForm *form = static_cast(m_form); NLGEORGES::CFormElm *elm = static_cast(&form->getRootNode()); - nlverify ( elm->getNodeByName (parent->formName ().c_str (), &parentDfn, indexDfn, + nlverify ( elm->getNodeByName (parent->formName ().c_str (), &parentDfn, indexDfn, &nodeDfn, &nodeType, &parentNode, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) ); if(array && parentNode) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges.cpp index b340869ad..ce577bfab 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges.cpp @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdpch.h" #include "georges.h" #include "nel/misc/o_xml.h" diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.cpp index 264026b1f..0a467aac5 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.cpp @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdpch.h" // Project includes #include "georges_dirtree_dialog.h" diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.cpp index f42d6bc6b..a0240eef8 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.cpp @@ -15,6 +15,7 @@ // along with this program. If not, see . // Project includes +#include "stdpch.h" #include "georges_editor_form.h" #include "georges_editor_constants.h" #include "georges_dirtree_dialog.h" @@ -254,7 +255,7 @@ namespace GeorgesQt } else { - nlwarning("Failed to load form: %s", info.fileName().toStdString().c_str()); + nlwarning("Failed to load form: %s", info.fileName().toUtf8().constData()); m_dockedWidgets.last()->close(); } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.cpp index ec20e6b35..075ac41b2 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.cpp @@ -15,6 +15,7 @@ // along with this program. If not, see . // Project includes +#include "stdpch.h" #include "georges_editor_plugin.h" #include "georges_editor_form.h" @@ -22,7 +23,7 @@ #include "../core/core_constants.h" // NeL includes -#include "nel/misc/debug.h" +#include // Qt includes #include diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.cpp index 762d79ff4..56a5856ae 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.cpp @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdpch.h" #include "georges_filesystem_model.h" #include diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/stdpch.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/stdpch.cpp new file mode 100644 index 000000000..85c10995f --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/stdpch.cpp @@ -0,0 +1,17 @@ +// Object Viewer Qt - Georges Editor Plugin - MMORPG Framework +// Copyright (C) 2011 Adrian Jaekel +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "stdpch.h" diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/stdpch.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/stdpch.h new file mode 100644 index 000000000..e5279839b --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/stdpch.h @@ -0,0 +1,39 @@ +// Object Viewer Qt - Georges Editor Plugin - MMORPG Framework +// Copyright (C) 2011 Adrian Jaekel +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef NL_STDPCH_H +#define NL_STDPCH_H + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/CMakeLists.txt index c7450586e..dc7a8a541 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/CMakeLists.txt @@ -45,4 +45,6 @@ NL_ADD_LIB_SUFFIX(ovqt_plugin_landscape_editor) ADD_DEFINITIONS(-DLANDSCAPE_EDITOR_LIBRARY ${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) -INSTALL(TARGETS ovqt_plugin_landscape_editor LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d) +INSTALL(TARGETS ovqt_plugin_landscape_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} ARCHIVE DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) +#INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_landscape_editor.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/CMakeLists.txt index 31569ae6b..1e0511a1c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/CMakeLists.txt @@ -36,4 +36,6 @@ NL_ADD_LIB_SUFFIX(ovqt_plugin_log) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) -INSTALL(TARGETS ovqt_plugin_log LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d) +INSTALL(TARGETS ovqt_plugin_log LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} ARCHIVE DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_log.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt index ac262ad56..03f1a6a2f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt @@ -46,4 +46,6 @@ NL_ADD_LIB_SUFFIX(ovqt_plugin_mission_compiler) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) -INSTALL(TARGETS ovqt_plugin_mission_compiler LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d) +INSTALL(TARGETS ovqt_plugin_mission_compiler LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} ARCHIVE DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_mission_compiler.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp index 9a3f4fe61..e01f5f617 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp @@ -239,11 +239,11 @@ void MissionCompilerMainWindow::compileMission(bool publish) try { CMissionCompiler mc; - mc.compileMissions(primDoc.RootNode, filename.toStdString()); + mc.compileMissions(primDoc.RootNode, filename.toUtf8().constData()); m_compileLog.append("Found "+QString::number(mc.getMissionsCount())+" valid missions\n"); updateCompileLog(); - mc.installCompiledMission(m_ligoConfig, filename.toStdString()); + mc.installCompiledMission(m_ligoConfig, filename.toUtf8().constData()); nbMission += mc.getMissionsCount(); // publish files to selected servers @@ -296,7 +296,7 @@ void MissionCompilerMainWindow::compileMission(bool publish) { m_compileLog.append(" "+QString(NLMISC::CFile::getFilename(mc.getFileToPublish(j)).c_str())+"\n"); } - mc.publishFiles(primPath.toStdString(), textPath.toStdString(), localPath.toStdString()); + mc.publishFiles(primPath.toUtf8().constData(), textPath.toUtf8().constData(), localPath.toUtf8().constData()); } column++; @@ -381,7 +381,7 @@ bool MissionCompilerMainWindow::parsePrimForMissions(NLLIGO::IPrimitive const *p { std::string value; // if the node is a mission parse it - if (prim->getPropertyByName("class",value) && !NLMISC::stricmp(value.c_str(),"mission") ) + if (prim->getPropertyByName("class",value) && !NLMISC::nlstricmp(value.c_str(),"mission") ) { std::string name; prim->getPropertyByName("name",name); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/CMakeLists.txt index 7f084fbb1..0ebc8a0b1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/CMakeLists.txt @@ -1,166 +1,201 @@ -INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} - ${LIBXML2_INCLUDE_DIR} - ${QT_INCLUDES}) - -FILE(GLOB SRC *.cpp *.h) - -SET(OVQT_EXT_SYS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin.h - ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_manager.h - ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_spec.h) - -SET(OBJECT_VIEWER_PLUGIN_HDR object_viewer_plugin.h - main_window.h - graphics_viewport.h - animation_dialog.h - animation_set_dialog.h - setup_fog_dialog.h - slot_manager_dialog.h - particle_control_dialog.h - particle_workspace_dialog.h - particle_tree_model.h - particle_system_page.h - particle_workspace_page.h - edit_range_widget.h - emitter_page.h - attrib_widget.h - located_bindable_page.h - located_page.h - particle_force_page.h - particle_light_page.h - particle_zone_page.h - particle_sound_page.h - basic_edit_widget.h - direction_widget.h - color_edit_widget.h - particle_property_dialog.h - ps_mover_page.h - value_blender_dialog.h - value_gradient_dialog.h - value_from_emitter_dialog.h - curve_dialog.h - bin_op_dialog.h - hoverpoints.h - mesh_widget.h - morph_mesh_dialog.h - constraint_mesh_widget.h - tail_particle_widget.h - auto_lod_dialog.h - particle_texture_widget.h - particle_texture_anim_widget.h - multi_tex_dialog.h - spinner_dialog.h - follow_path_dialog.h - water_pool_dialog.h - skeleton_scale_dialog.h - skeleton_tree_model.h - particle_link_skeleton_dialog.h - vegetable_dialog.h - global_wind_dialog.h - day_night_dialog.h - sun_color_dialog.h - vegetable_noise_value_widget.h - vegetable_density_page.h - vegetable_landscape_page.h - vegetable_scale_page.h - vegetable_appearance_page.h - vegetable_rotate_page.h - tune_mrm_dialog.h - tune_timer_dialog.h - camera_control.h - graphics_settings_page.h - sound_settings_page.h - vegetable_settings_page.h - scheme_bank_dialog.h) - -SET(OBJECT_VIEWER_PLUGIN_UIS animation_form.ui - animation_set_form.ui - setup_fog_form.ui - slot_form.ui - particle_control_form.ui - particle_workspace_form.ui - edit_range_float_form.ui - edit_range_uint_form.ui - particle_system_form.ui - workspace_form.ui - attrib_form.ui - emitter_form.ui - located_bindable_form.ui - located_form.ui - particle_force_form.ui - particle_light_form.ui - particle_zone_form.ui - particle_sound_form.ui - basic_edit_form.ui - direction_form.ui - color_edit_form.ui - ps_mover_form.ui - curve_form.ui - mesh_form.ui - morph_mesh_form.ui - constraint_mesh_form.ui - tail_form.ui - auto_lod_form.ui - particle_texture_form.ui - particle_texture_anim_form.ui - multi_tex_form.ui - skeleton_scale_form.ui - particle_link_skeleton_form.ui - water_pool_form.ui - vegetable_dialog_form.ui - vegetable_noise_value_form.ui - global_wind_form.ui - sun_color_form.ui - day_night_form.ui - vegetable_density_form.ui - vegetable_apperance_form.ui - vegetable_landscape_form.ui - vegetable_rotate_form.ui - vegetable_scale_form.ui - tune_mrm_form.ui - tune_timer_form.ui - graphics_settings_page.ui - sound_settings_page.ui - vegetable_settings_page.ui - scheme_bank_form.ui - value_gradient_form.ui) - -SET(OBJECT_VIEWER_PLUGIN_RCS object_viewer.qrc) - -SET(QT_USE_QTGUI TRUE) -SET(QT_USE_QTOPENGL TRUE) - -QT4_ADD_RESOURCES(OBJECT_VIEWER_PLUGIN_RC_SRCS ${OBJECT_VIEWER_PLUGIN_RCS}) -QT4_WRAP_CPP(OBJECT_VIEWER_PLUGIN_MOC_SRC ${OBJECT_VIEWER_PLUGIN_HDR}) -QT4_WRAP_UI(OBJECT_VIEWER_PLUGIN_UI_HDRS ${OBJECT_VIEWER_PLUGIN_UIS}) - -SOURCE_GROUP(QtResources FILES ${OBJECT_VIEWER_PLUGIN_UIS}) -SOURCE_GROUP(QtGeneratedUiHdr FILES ${OBJECT_VIEWER_PLUGIN_UI_HDRS}) -SOURCE_GROUP(QtGeneratedMocSrc FILES ${OBJECT_VIEWER_PLUGIN_MOC_SRC}) -SOURCE_GROUP("Object Viewer Plugin" FILES ${SRC}) -SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) - -ADD_LIBRARY(ovqt_plugin_object_viewer MODULE ${SRC} ${OBJECT_VIEWER_PLUGIN_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OBJECT_VIEWER_PLUGIN_UI_HDRS} ${OBJECT_VIEWER_PLUGIN_RC_SRCS}) - -TARGET_LINK_LIBRARIES(ovqt_plugin_object_viewer - ovqt_plugin_core - nelmisc - nel3d - nelsound - nelligo - nelgeorges - ${QT_LIBRARIES} - ${QT_QTOPENGL_LIBRARY}) - -NL_DEFAULT_PROPS(ovqt_plugin_object_viewer "NeL, Tools, 3D: Object Viewer Qt Plugin: Object Viewer") - +INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${LIBXML2_INCLUDE_DIR} + ${QT_INCLUDES} + ${CMAKE_CURRENT_SOURCE_DIR}/scene/ + ${CMAKE_CURRENT_SOURCE_DIR}/particle_system/ + ${CMAKE_CURRENT_SOURCE_DIR}/vegetable/ + ${CMAKE_CURRENT_SOURCE_DIR}/widgets/ +) + +FILE(GLOB SRC *.cpp *.h) + +FILE(GLOB OVQT_SCENE_SRC scene/*.cpp scene/*.h) +FILE(GLOB OVQT_PS_SRC particle_system/*.h particle_system/*.cpp) +FILE(GLOB OVQT_VEGETABLE_SRC vegetable/*.h vegetable/*.cpp) +FILE(GLOB OVQT_WIDGETS_SRC widgets/*.h widgets/*.cpp) + +SET(OVQT_EXT_SYS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin.h + ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_manager.h + ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_spec.h) + +SET(OBJECT_VIEWER_PLUGIN_QT_HDR object_viewer_plugin.h + main_window.h + graphics_viewport.h + graphics_settings_page.h + sound_settings_page.h + vegetable_settings_page.h + + scene/animation_dialog.h + scene/animation_set_dialog.h + scene/setup_fog_dialog.h + scene/slot_manager_dialog.h + scene/water_pool_dialog.h + scene/skeleton_scale_dialog.h + scene/skeleton_tree_model.h + scene/global_wind_dialog.h + scene/day_night_dialog.h + scene/sun_color_dialog.h + scene/tune_mrm_dialog.h + scene/tune_timer_dialog.h + scene/camera_control.h + + particle_system/particle_control_dialog.h + particle_system/particle_workspace_dialog.h + particle_system/particle_tree_model.h + particle_system/particle_system_page.h + particle_system/particle_workspace_page.h + particle_system/emitter_page.h + particle_system/attrib_widget.h + particle_system/located_bindable_page.h + particle_system/located_page.h + particle_system/particle_force_page.h + particle_system/particle_light_page.h + particle_system/particle_zone_page.h + particle_system/particle_sound_page.h + particle_system/basic_edit_widget.h + particle_system/direction_widget.h + particle_system/scheme_bank_dialog.h + particle_system/particle_property_dialog.h + particle_system/ps_mover_page.h + particle_system/value_blender_dialog.h + particle_system/value_gradient_dialog.h + particle_system/value_from_emitter_dialog.h + particle_system/curve_dialog.h + particle_system/bin_op_dialog.h + particle_system/mesh_widget.h + particle_system/morph_mesh_dialog.h + particle_system/constraint_mesh_widget.h + particle_system/tail_particle_widget.h + particle_system/auto_lod_dialog.h + particle_system/particle_texture_widget.h + particle_system/particle_texture_anim_widget.h + particle_system/multi_tex_dialog.h + particle_system/spinner_dialog.h + particle_system/follow_path_dialog.h + particle_system/particle_link_skeleton_dialog.h + + vegetable/vegetable_dialog.h + vegetable/vegetable_noise_value_widget.h + vegetable/vegetable_density_page.h + vegetable/vegetable_landscape_page.h + vegetable/vegetable_scale_page.h + vegetable/vegetable_appearance_page.h + vegetable/vegetable_rotate_page.h + + widgets/edit_range_widget.h + widgets/color_edit_widget.h + widgets/hoverpoints.h +) + +SET(OBJECT_VIEWER_PLUGIN_UIS scene/animation_form.ui + scene/animation_set_form.ui + scene/setup_fog_form.ui + scene/slot_form.ui + scene/skeleton_scale_form.ui + scene/water_pool_form.ui + scene/global_wind_form.ui + scene/sun_color_form.ui + scene/day_night_form.ui + scene/tune_mrm_form.ui + scene/tune_timer_form.ui + + particle_system/particle_control_form.ui + particle_system/particle_workspace_form.ui + particle_system/particle_system_form.ui + particle_system/workspace_form.ui + particle_system/attrib_form.ui + particle_system/emitter_form.ui + particle_system/located_bindable_form.ui + particle_system/located_form.ui + particle_system/particle_force_form.ui + particle_system/particle_light_form.ui + particle_system/particle_zone_form.ui + particle_system/particle_sound_form.ui + particle_system/basic_edit_form.ui + particle_system/direction_form.ui + particle_system/ps_mover_form.ui + particle_system/curve_form.ui + particle_system/mesh_form.ui + particle_system/morph_mesh_form.ui + particle_system/constraint_mesh_form.ui + particle_system/tail_form.ui + particle_system/auto_lod_form.ui + particle_system/particle_texture_form.ui + particle_system/particle_texture_anim_form.ui + particle_system/multi_tex_form.ui + particle_system/particle_link_skeleton_form.ui + particle_system/scheme_bank_form.ui + particle_system/value_gradient_form.ui + + vegetable/vegetable_dialog_form.ui + vegetable/vegetable_noise_value_form.ui + vegetable/vegetable_density_form.ui + vegetable/vegetable_apperance_form.ui + vegetable/vegetable_landscape_form.ui + vegetable/vegetable_rotate_form.ui + vegetable/vegetable_scale_form.ui + + widgets/color_edit_form.ui + widgets/edit_range_float_form.ui + widgets/edit_range_uint_form.ui + + graphics_settings_page.ui + sound_settings_page.ui + vegetable_settings_page.ui +) + +SET(OBJECT_VIEWER_PLUGIN_RCS object_viewer.qrc) + +SET(QT_USE_QTGUI TRUE) +SET(QT_USE_QTOPENGL TRUE) + +QT4_ADD_RESOURCES(OBJECT_VIEWER_PLUGIN_RC_SRCS ${OBJECT_VIEWER_PLUGIN_RCS}) +QT4_WRAP_CPP(OBJECT_VIEWER_PLUGIN_MOC_SRC ${OBJECT_VIEWER_PLUGIN_QT_HDR}) +QT4_WRAP_UI(OBJECT_VIEWER_PLUGIN_UI_HDRS ${OBJECT_VIEWER_PLUGIN_UIS}) + +SOURCE_GROUP(QtResources FILES ${OBJECT_VIEWER_PLUGIN_UIS}) +SOURCE_GROUP(QtGeneratedUiHdr FILES ${OBJECT_VIEWER_PLUGIN_UI_HDRS}) +SOURCE_GROUP(QtGeneratedMocSrc FILES ${OBJECT_VIEWER_PLUGIN_MOC_SRC}) + +SOURCE_GROUP("ovqt Extension System" FILES ${OVQT_EXT_SYS_SRC}) +SOURCE_GROUP("ovqt Plugin Src" FILES ${SRC}) +SOURCE_GROUP("ovqt Plugin Scene Src" FILES ${OVQT_SCENE_SRC}) +SOURCE_GROUP("ovqt Plugin PS Src" FILES ${OVQT_PS_SRC}) +SOURCE_GROUP("ovqt Plugin Vegetable Src" FILES ${OVQT_VEGETABLE_SRC}) +SOURCE_GROUP("ovqt Plugin Widgets Src" FILES ${OVQT_WIDGETS_SRC}) + +ADD_LIBRARY(ovqt_plugin_object_viewer MODULE ${SRC} + ${OVQT_SCENE_SRC} + ${OVQT_PS_SRC} + ${OVQT_VEGETABLE_SRC} + ${OVQT_WIDGETS_SRC} + ${OBJECT_VIEWER_PLUGIN_MOC_SRC} + ${OVQT_EXT_SYS_SRC} + ${OBJECT_VIEWER_PLUGIN_UI_HDRS} + ${OBJECT_VIEWER_PLUGIN_RC_SRCS}) + +TARGET_LINK_LIBRARIES(ovqt_plugin_object_viewer + ovqt_plugin_core + nelmisc + nel3d + nelsound + nelligo + nelgeorges + ${QT_LIBRARIES} + ${QT_QTOPENGL_LIBRARY}) + +NL_DEFAULT_PROPS(ovqt_plugin_object_viewer "NeL, Tools, 3D: Object Viewer Qt Plugin: Object Viewer") + +NL_ADD_RUNTIME_FLAGS(ovqt_plugin_object_viewer) +NL_ADD_LIB_SUFFIX(ovqt_plugin_object_viewer) + +ADD_DEFINITIONS(-DQT_NO_KEYWORDS ${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) + IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(ovqt_plugin_object_viewer ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) -ENDIF(WITH_PCH) - -NL_ADD_RUNTIME_FLAGS(ovqt_plugin_object_viewer) -NL_ADD_LIB_SUFFIX(ovqt_plugin_object_viewer) - -ADD_DEFINITIONS(-DQT_NO_KEYWORDS ${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) - -INSTALL(TARGETS ovqt_plugin_object_viewer LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d) +ENDIF(WITH_PCH) + +INSTALL(TARGETS ovqt_plugin_object_viewer LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} ARCHIVE DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_object_viewer.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.cpp index edbc31275..bccf7a6b1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.cpp @@ -449,9 +449,9 @@ bool CMainWindow::loadFile(const QString &fileName, const QString &skelName) QFileInfo fileInfo(fileName); bool loaded; if (fileInfo.suffix() == "ig") - loaded = Modules::objView().loadInstanceGroup(fileName.toStdString()); + loaded = Modules::objView().loadInstanceGroup(fileName.toUtf8().constData()); else - loaded = Modules::objView().loadMesh(fileName.toStdString(), skelName.toStdString()); + loaded = Modules::objView().loadMesh(fileName.toUtf8().constData(), skelName.toUtf8().constData()); if (!loaded) { diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer.cpp index 4b0509018..48c679455 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer.cpp @@ -468,7 +468,7 @@ void CObjectViewer::loadConfig() #endif _CameraFocal = settings->value("CameraFocal", 75).toInt(); - _FontName = settings->value(Constants::FONT, "andbasr.ttf").toString().toStdString(); + _FontName = settings->value(Constants::FONT, "andbasr.ttf").toString().toUtf8().constData(); _BloomEffect = settings->value(Constants::ENABLE_BLOOM, false).toBool(); _BloomDensity = settings->value(Constants::BLOOM_DENSITY, 0).toInt(); _BloomSquare = settings->value(Constants::ENABLE_SQUARE_BLOOM, false).toBool(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/attrib_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/attrib_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/attrib_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/attrib_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/attrib_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/attrib_widget.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/attrib_widget.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/attrib_widget.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/attrib_widget.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/attrib_widget.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/attrib_widget.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/attrib_widget.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/auto_lod_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/auto_lod_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/auto_lod_dialog.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/auto_lod_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/auto_lod_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/auto_lod_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/auto_lod_dialog.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/auto_lod_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/auto_lod_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/auto_lod_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/auto_lod_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/auto_lod_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/basic_edit_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/basic_edit_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/basic_edit_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/basic_edit_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/basic_edit_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/basic_edit_widget.cpp similarity index 99% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/basic_edit_widget.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/basic_edit_widget.cpp index b3816a034..771568550 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/basic_edit_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/basic_edit_widget.cpp @@ -202,15 +202,15 @@ void CBasicEditWidget::updateGraphics() } bool CBasicEditWidget::eventFilter(QObject *object, QEvent *event) -{ - if( event->type() == QEvent::Paint ) - { +{ + if( event->type() == QEvent::Paint ) + { QPainter painter(_ui.graphicsWidget); painter.setRenderHint(QPainter::Antialiasing, true); painter.setBrush(QBrush(Qt::white)); painter.setPen(QPen(Qt::black, 2, Qt::SolidLine)); - painter.drawRoundedRect(QRect(3, 3, _ui.graphicsWidget->width() - 6, _ui.graphicsWidget->height() - 6), 3.0, 3.0); - } + painter.drawRoundedRect(QRect(3, 3, _ui.graphicsWidget->width() - 6, _ui.graphicsWidget->height() - 6), 3.0, 3.0); + } return QWidget::eventFilter(object, event); } -} /* namespace NLQT */ \ No newline at end of file +} /* namespace NLQT */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/basic_edit_widget.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/basic_edit_widget.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/basic_edit_widget.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/basic_edit_widget.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/bin_op_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/bin_op_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/bin_op_dialog.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/bin_op_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/bin_op_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/bin_op_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/bin_op_dialog.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/bin_op_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/constraint_mesh_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/constraint_mesh_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/constraint_mesh_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/constraint_mesh_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/constraint_mesh_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/constraint_mesh_widget.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/constraint_mesh_widget.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/constraint_mesh_widget.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/constraint_mesh_widget.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/constraint_mesh_widget.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/constraint_mesh_widget.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/constraint_mesh_widget.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/curve_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/curve_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/curve_dialog.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/curve_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/curve_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/curve_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/curve_dialog.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/curve_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/curve_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/curve_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/curve_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/curve_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/direction_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/direction_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/direction_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/direction_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/direction_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/direction_widget.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/direction_widget.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/direction_widget.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/direction_widget.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/direction_widget.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/direction_widget.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/direction_widget.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/dup_ps.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/dup_ps.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/dup_ps.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/dup_ps.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/dup_ps.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/dup_ps.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/dup_ps.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/dup_ps.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/emitter_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/emitter_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/emitter_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/emitter_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/emitter_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/emitter_page.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/emitter_page.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/emitter_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/emitter_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/emitter_page.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/emitter_page.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/emitter_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/follow_path_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/follow_path_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/follow_path_dialog.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/follow_path_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/follow_path_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/follow_path_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/follow_path_dialog.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/follow_path_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/located_bindable_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/located_bindable_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/located_bindable_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/located_bindable_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/located_bindable_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/located_bindable_page.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/located_bindable_page.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/located_bindable_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/located_bindable_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/located_bindable_page.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/located_bindable_page.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/located_bindable_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/located_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/located_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/located_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/located_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/located_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/located_page.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/located_page.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/located_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/located_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/located_page.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/located_page.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/located_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/mesh_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/mesh_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/mesh_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/mesh_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/mesh_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/mesh_widget.cpp similarity index 99% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/mesh_widget.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/mesh_widget.cpp index debb0f157..e92ca7e20 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/mesh_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/mesh_widget.cpp @@ -86,10 +86,10 @@ void CMeshWidget::browseShape() setCursor(Qt::WaitCursor); if (!fileName.isEmpty()) { - NLMISC::CPath::addSearchPath(NLMISC::CFile::getPath(fileName.toStdString())); + NLMISC::CPath::addSearchPath(NLMISC::CFile::getPath(fileName.toUtf8().constData())); try { - std::string shapeName = NLMISC::CFile::getFilename(fileName.toStdString()); + std::string shapeName = NLMISC::CFile::getFilename(fileName.toUtf8().constData()); _ShapeParticle->setShape(shapeName); _ui.meshLineEdit->setText(shapeName.c_str()); touchPSState(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/mesh_widget.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/mesh_widget.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/mesh_widget.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/mesh_widget.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/morph_mesh_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/morph_mesh_dialog.cpp similarity index 96% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/morph_mesh_dialog.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/morph_mesh_dialog.cpp index de88d14c8..20e19b539 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/morph_mesh_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/morph_mesh_dialog.cpp @@ -110,7 +110,7 @@ void CMorphMeshDialog::add() shapeNames.resize(_CM->getNumShapes() + 1); _CM->getShapesNames(&shapeNames[0]); uint index = (uint)shapeNames.size() - 1; - shapeNames[index] = fileName.toStdString(); + shapeNames[index] = fileName.toUtf8().constData(); _CM->setShapes(&shapeNames[0], (uint)shapeNames.size()); std::vector numVerts; _CM->getShapeNumVerts(numVerts); @@ -152,7 +152,7 @@ void CMorphMeshDialog::insert() std::vector shapeNames; shapeNames.resize(_CM->getNumShapes()); _CM->getShapesNames(&shapeNames[0]); - shapeNames.insert(shapeNames.begin() + row, fileName.toStdString()); + shapeNames.insert(shapeNames.begin() + row, fileName.toUtf8().constData()); _CM->setShapes(&shapeNames[0], (uint)shapeNames.size()); touchPSState(); updateMeshList(); @@ -172,7 +172,7 @@ void CMorphMeshDialog::change() if (!fileName.isEmpty()) { sint row = _ui.listWidget->currentRow(); - _CM->setShape(row, fileName.toStdString()); + _CM->setShape(row, fileName.toUtf8().constData()); updateMeshList(); touchPSState(); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/morph_mesh_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/morph_mesh_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/morph_mesh_dialog.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/morph_mesh_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/morph_mesh_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/morph_mesh_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/morph_mesh_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/morph_mesh_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/multi_tex_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/multi_tex_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/multi_tex_dialog.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/multi_tex_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/multi_tex_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/multi_tex_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/multi_tex_dialog.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/multi_tex_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/multi_tex_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/multi_tex_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/multi_tex_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/multi_tex_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_control_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_control_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_control_dialog.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_control_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_control_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_control_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_control_dialog.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_control_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_control_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_control_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_control_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_control_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_editor.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_editor.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_editor.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_editor.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_editor.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_editor.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_editor.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_editor.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_force_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_force_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_force_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_force_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_force_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_force_page.cpp similarity index 97% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_force_page.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_force_page.cpp index e7e19abc9..2f9135e3d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_force_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_force_page.cpp @@ -185,11 +185,11 @@ void CForcePage::setDir(const NLMISC::CVector &value) void CForcePage::setGlobalName(const QString &globalName) { nlassert(_LBTarget); - dynamic_cast(_LBTarget)->enableGlobalVectorValue(globalName.toStdString()); + dynamic_cast(_LBTarget)->enableGlobalVectorValue(globalName.toUtf8().constData()); if (!globalName.isEmpty()) { // take a non NULL value for the direction - NL3D::CParticleSystem::setGlobalVectorValue(globalName.toStdString(), NLMISC::CVector::I); + NL3D::CParticleSystem::setGlobalVectorValue(globalName.toUtf8().constData(), NLMISC::CVector::I); } updateModifiedFlag(); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_force_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_force_page.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_force_page.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_force_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_light_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_light_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_light_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_light_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_light_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_light_page.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_light_page.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_light_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_light_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_light_page.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_light_page.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_light_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_link_skeleton_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_link_skeleton_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_link_skeleton_dialog.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_link_skeleton_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_link_skeleton_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_link_skeleton_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_link_skeleton_dialog.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_link_skeleton_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_link_skeleton_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_link_skeleton_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_link_skeleton_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_link_skeleton_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_node.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_node.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_node.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_node.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_node.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_node.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_node.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_node.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_property_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_property_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_property_dialog.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_property_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_property_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_property_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_property_dialog.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_property_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_sound_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_sound_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_sound_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_sound_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_sound_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_sound_page.cpp similarity index 96% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_sound_page.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_sound_page.cpp index ce7034e56..ee9e77466 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_sound_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_sound_page.cpp @@ -122,7 +122,7 @@ void CSoundPage::browse() void CSoundPage::play() { - Modules::sound().play(_ui.soundNameLineEdit->text().toStdString()); + Modules::sound().play(_ui.soundNameLineEdit->text().toUtf8().constData()); } void CSoundPage::setSpawn(bool state) @@ -162,7 +162,7 @@ void CSoundPage::setKeepPitch(bool state) void CSoundPage::setSoundName(const QString &text) { - _Sound->setSoundName(NLMISC::CSheetId(text.toStdString())); + _Sound->setSoundName(NLMISC::CSheetId(text.toUtf8().constData())); } void CSoundPage::setEmissionPercent(float value) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_sound_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_sound_page.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_sound_page.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_sound_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_system_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_system_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_system_page.cpp similarity index 99% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system_page.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_system_page.cpp index 072297437..7cdf0895b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_system_page.cpp @@ -50,7 +50,7 @@ static void chooseGlobalUserParam(uint userParam, NL3D::CParticleSystem *ps, QWi QString(ps->getGlobalValueName(userParam).c_str()), &ok); if (ok) - ps->bindGlobalValueToUserParam(text.toStdString(), userParam); + ps->bindGlobalValueToUserParam(text.toUtf8().constData(), userParam); } CParticleSystemPage::CParticleSystemPage(QWidget *parent) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_system_page.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system_page.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_system_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_texture_anim_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_texture_anim_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_texture_anim_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_texture_anim_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_texture_anim_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_texture_anim_widget.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_texture_anim_widget.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_texture_anim_widget.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_texture_anim_widget.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_texture_anim_widget.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_texture_anim_widget.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_texture_anim_widget.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_texture_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_texture_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_texture_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_texture_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_texture_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_texture_widget.cpp similarity index 96% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_texture_widget.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_texture_widget.cpp index f09e752da..82e171f19 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_texture_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_texture_widget.cpp @@ -76,10 +76,10 @@ void CParticleTextureWidget::chooseTexture() if (!fileName.isEmpty()) { // Add search path for the texture - NLMISC::CPath::addSearchPath(NLMISC::CFile::getPath(fileName.toStdString())); + NLMISC::CPath::addSearchPath(NLMISC::CFile::getPath(fileName.toUtf8().constData())); try { - texName = NLMISC::CFile::getFilename(fileName.toStdString()); + texName = NLMISC::CFile::getFilename(fileName.toUtf8().constData()); NL3D::CTextureFile *tf = new NL3D::CTextureFile(texName); _Wrapper->setAndUpdateModifiedFlag(tf); _Texture = tf; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_texture_widget.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_texture_widget.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_texture_widget.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_texture_widget.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_tree_model.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_tree_model.cpp similarity index 99% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_tree_model.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_tree_model.cpp index 2daebd6e4..1d9574b6d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_tree_model.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_tree_model.cpp @@ -319,7 +319,7 @@ bool CParticleTreeModel::setData(const QModelIndex &index, const QVariant &value QList listData; listData << value; item->replace(listData); - std::string name = value.toString().toStdString(); + std::string name = value.toString().toUtf8().constData(); if (item->itemType() == ItemType::Located) item->getLoc()->setName(name); else diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_tree_model.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_tree_model.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_tree_model.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_tree_model.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_workspace_dialog.cpp similarity index 98% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_dialog.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_workspace_dialog.cpp index 74182120c..4c92a5fc4 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_workspace_dialog.cpp @@ -348,7 +348,7 @@ void CParticleWorkspaceDialog::saveAsPS() tr("ps files (*.ps)")); // after check if (!fileName.isEmpty()) - node->savePSAs(fileName.toStdString()); + node->savePSAs(fileName.toUtf8().constData()); } } @@ -546,7 +546,7 @@ void CParticleWorkspaceDialog::bindNewLocatedBindable(int id) std::string name = toCreate->getName(); if (_PSElementIdentifiers.count(name)) { - name += (QString("%1").arg(++_PSElementIdentifiers[name])).toStdString(); + name += NLMISC::toString("%u", ++_PSElementIdentifiers[name]); toCreate->setName(name); } else @@ -770,12 +770,13 @@ NL3D::CPSLocated *CParticleWorkspaceDialog::createLocated(NL3D::CParticleSystem { // build new name std::string name; - if (_PSElementIdentifiers.count(std::string("located"))) - name = (QString("located %1").arg(++_PSElementIdentifiers[std::string("located")])).toStdString(); - + if (_PSElementIdentifiers.count("located")) + { + name = NLMISC::toString("located %u", ++_PSElementIdentifiers["located"]); + } else { - name = std::string("located 0"); + name = "located 0"; _PSElementIdentifiers["located"] = 0; } NL3D::CPSLocated *loc = new NL3D::CPSLocated; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_workspace_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_dialog.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_workspace_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_workspace_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_workspace_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_workspace_page.cpp similarity index 94% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_page.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_workspace_page.cpp index 3f2dd1657..62ffb6d3b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_workspace_page.cpp @@ -63,7 +63,7 @@ void CWorkspacePage::newWP() tr("pws files (*.pws)")); if (!fileName.isEmpty()) { - Modules::psEdit().createNewWorkspace(fileName.toStdString()); + Modules::psEdit().createNewWorkspace(fileName.toUtf8().constData()); _treeModel->setupModelFromWorkSpace(); _ui.saveToolButton->setEnabled(true); _ui.saveAsToolButton->setEnabled(true); @@ -83,7 +83,7 @@ void CWorkspacePage::loadWP() setCursor(Qt::WaitCursor); if (!fileName.isEmpty()) { - Modules::psEdit().loadWorkspace(fileName.toStdString()); + Modules::psEdit().loadWorkspace(fileName.toUtf8().constData()); _treeModel->setupModelFromWorkSpace(); _ui.unloadToolButton->setEnabled(true); _ui.saveToolButton->setEnabled(true); @@ -109,7 +109,7 @@ void CWorkspacePage::saveAsWP() tr("pws files (*.pws)")); if (!fileName.isEmpty()) { - Modules::psEdit().getParticleWorkspace()->setFileName(fileName.toStdString()); + Modules::psEdit().getParticleWorkspace()->setFileName(fileName.toUtf8().constData()); Modules::psEdit().saveWorkspaceStructure(); Modules::psEdit().saveWorkspaceContent(); _treeModel->setupModelFromWorkSpace(); @@ -125,7 +125,7 @@ void CWorkspacePage::insertPS() if (!fileName.isEmpty()) { // TODO: create method particle editor insertNewPS and multiple add - CWorkspaceNode *node = Modules::psEdit().getParticleWorkspace()->addNode(NLMISC::CFile::getFilename(fileName.toStdString())); + CWorkspaceNode *node = Modules::psEdit().getParticleWorkspace()->addNode(NLMISC::CFile::getFilename(fileName.toUtf8().constData())); if (node != 0) { try @@ -158,14 +158,14 @@ void CWorkspacePage::createPS() { // TODO: create method particle editor createNewPS - if (Modules::psEdit().getParticleWorkspace()->containsFile(NLMISC::CFile::getFilename(fileName.toStdString()))) + if (Modules::psEdit().getParticleWorkspace()->containsFile(NLMISC::CFile::getFilename(fileName.toUtf8().constData()))) { QMessageBox::critical(this, tr("NeL particle system editor"), tr("Failed to create new particle system"), QMessageBox::Ok); return; } - CWorkspaceNode *node = Modules::psEdit().getParticleWorkspace()->addNode(NLMISC::CFile::getFilename(fileName.toStdString())); + CWorkspaceNode *node = Modules::psEdit().getParticleWorkspace()->addNode(NLMISC::CFile::getFilename(fileName.toUtf8().constData())); // should always succeed because we tested if file already exists nlassert(node); node->createEmptyPS(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_workspace_page.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_page.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_workspace_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_zone_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_zone_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_zone_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_zone_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_zone_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_zone_page.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_zone_page.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_zone_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_zone_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_zone_page.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_zone_page.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_zone_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/ps_initial_pos.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/ps_initial_pos.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/ps_initial_pos.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/ps_initial_pos.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/ps_initial_pos.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/ps_initial_pos.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/ps_initial_pos.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/ps_initial_pos.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/ps_mover_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/ps_mover_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/ps_mover_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/ps_mover_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/ps_mover_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/ps_mover_page.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/ps_mover_page.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/ps_mover_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/ps_mover_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/ps_mover_page.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/ps_mover_page.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/ps_mover_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/ps_wrapper.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/ps_wrapper.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/ps_wrapper.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/ps_wrapper.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scheme_bank_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/scheme_bank_dialog.cpp similarity index 95% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scheme_bank_dialog.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/scheme_bank_dialog.cpp index bca0f4879..af8a4829f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scheme_bank_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/scheme_bank_dialog.cpp @@ -61,7 +61,7 @@ void CSchemeBankDialog::createScheme() if (ok && !text.isEmpty()) { NL3D::CPSAttribMakerBase *attribMakerBase = _attribWidget->getCurrentSchemePtr()->clone(); - Modules::psEdit().getSchemeManager()->insertScheme(text.toStdString(), attribMakerBase); + Modules::psEdit().getSchemeManager()->insertScheme(text.toUtf8().constData(), attribMakerBase); CSchemeItem *item = new CSchemeItem(text, _ui.listWidget); item->setUserData(attribMakerBase); @@ -108,7 +108,7 @@ void CSchemeBankDialog::saveBank() try { NLMISC::COFile iF; - iF.open(fileName.toStdString()); + iF.open(fileName.toUtf8().constData()); NLQT::CSchemeManager *schemeManager = Modules::psEdit().getSchemeManager(); iF.serial(*schemeManager); } @@ -132,7 +132,7 @@ void CSchemeBankDialog::loadBank() try { NLMISC::CIFile iF; - iF.open(fileName.toStdString()); + iF.open(fileName.toUtf8().constData()); iF.serial(sm); Modules::psEdit().getSchemeManager()->swap(sm); } @@ -152,7 +152,7 @@ void CSchemeBankDialog::changeNameScheme(QListWidgetItem *item) NL3D::CPSAttribMakerBase *attrib = schemeItem->getUserData(); nlassert(attrib); - Modules::psEdit().getSchemeManager()->rename(attrib, item->text().toStdString()); + Modules::psEdit().getSchemeManager()->rename(attrib, item->text().toUtf8().constData()); } void CSchemeBankDialog::enableButtons() diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scheme_bank_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/scheme_bank_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scheme_bank_dialog.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/scheme_bank_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scheme_bank_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/scheme_bank_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scheme_bank_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/scheme_bank_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scheme_manager.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/scheme_manager.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scheme_manager.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/scheme_manager.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scheme_manager.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/scheme_manager.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scheme_manager.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/scheme_manager.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/spinner_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/spinner_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/spinner_dialog.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/spinner_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/spinner_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/spinner_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/spinner_dialog.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/spinner_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/tail_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/tail_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/tail_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/tail_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/tail_particle_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/tail_particle_widget.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/tail_particle_widget.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/tail_particle_widget.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/tail_particle_widget.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/tail_particle_widget.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/tail_particle_widget.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/tail_particle_widget.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_blender_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/value_blender_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_blender_dialog.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/value_blender_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_blender_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/value_blender_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_blender_dialog.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/value_blender_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_from_emitter_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/value_from_emitter_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_from_emitter_dialog.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/value_from_emitter_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_from_emitter_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/value_from_emitter_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_from_emitter_dialog.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/value_from_emitter_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_gradient_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/value_gradient_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_gradient_dialog.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/value_gradient_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_gradient_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/value_gradient_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_gradient_dialog.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/value_gradient_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_gradient_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/value_gradient_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_gradient_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/value_gradient_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/workspace_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/workspace_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/workspace_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/workspace_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/animation_dialog.cpp similarity index 98% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_dialog.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/animation_dialog.cpp index 0ff05e5dd..01f4c434b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/animation_dialog.cpp @@ -90,7 +90,7 @@ void CAnimationDialog::setCurrentShape(const QString &name) { if (name.isEmpty()) return; - CEntity &entity = Modules::objView().getEntity(name.toStdString()); + CEntity &entity = Modules::objView().getEntity(name.toUtf8().constData()); _ui.inPlaceCheckBox->setChecked(entity.getInPlace()); _ui.incPosCheckBox->setChecked(entity.getIncPos()); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/animation_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_dialog.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/animation_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/animation_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/animation_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_set_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/animation_set_dialog.cpp similarity index 95% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_set_dialog.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/animation_set_dialog.cpp index fa779d63a..f2d5e6567 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_set_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/animation_set_dialog.cpp @@ -57,7 +57,7 @@ void CAnimationSetDialog::setCurrentShape(const QString &name) if (name.isEmpty()) return; - Modules::objView().setCurrentObject(name.toStdString()); + Modules::objView().setCurrentObject(name.toUtf8().constData()); updateListAnim(); @@ -161,8 +161,7 @@ void CAnimationSetDialog::loadAnim() QStringList::Iterator it = list.begin(); while(it != list.end()) { - std::string animName = it->toStdString(); - entity.loadAnimation(animName); + entity.loadAnimation(it->toUtf8().constData()); ++it; } updateListAnim(); @@ -187,8 +186,7 @@ void CAnimationSetDialog::loadSwt() QStringList::Iterator it = list.begin(); while(it != list.end()) { - std::string swtName = it->toStdString(); - entity.loadSWT(swtName); + entity.loadSWT(it->toUtf8().constData()); ++it; } updateListAnim(); @@ -212,8 +210,7 @@ void CAnimationSetDialog::addAnim() Q_FOREACH(QTreeWidgetItem *item, list) { - std::string animName = item->text(0).toStdString(); - entity.addAnimToPlayList(animName); + entity.addAnimToPlayList(item->text(0).toUtf8().constData()); ui.animPlaylistWidget->addItem(item->text(0)); } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_set_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/animation_set_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_set_dialog.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/animation_set_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_set_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/animation_set_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_set_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/animation_set_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/camera_control.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/camera_control.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/camera_control.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/camera_control.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/camera_control.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/camera_control.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/camera_control.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/camera_control.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/day_night_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/day_night_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/day_night_dialog.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/day_night_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/day_night_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/day_night_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/day_night_dialog.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/day_night_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/day_night_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/day_night_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/day_night_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/day_night_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/entity.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/entity.cpp similarity index 97% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/entity.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/entity.cpp index 1aaacbf6e..f5a1b5094 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/entity.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/entity.cpp @@ -117,7 +117,7 @@ CEntity::~CEntity(void) } } -void CEntity::loadAnimation(std::string &fileName) +void CEntity::loadAnimation(const std::string &fileName) { uint id = _AnimationSet->addAnimation(fileName.c_str(),CFile::getFilenameWithoutExtension(fileName).c_str()); _AnimationList.push_back(_AnimationSet->getAnimationName(id)); @@ -128,13 +128,13 @@ void CEntity::loadAnimation(std::string &fileName) _PlayList->registerTransform(_Instance); } -void CEntity::loadSWT(std::string &fileName) +void CEntity::loadSWT(const std::string &fileName) { uint id = _AnimationSet->addSkeletonWeight(fileName.c_str(),CFile::getFilenameWithoutExtension(fileName).c_str()); _SWTList.push_back(_AnimationSet->getSkeletonWeightName(id)); } -void CEntity::addAnimToPlayList(std::string &name) +void CEntity::addAnimToPlayList(const std::string &name) { _PlayListAnimation.push_back(name); @@ -176,7 +176,7 @@ void CEntity::reset() _PlayList->resetAllChannels(); } -float CEntity::getPlayListLength() +float CEntity::getPlayListLength() const { // Accumul all the time float time = 0; @@ -185,7 +185,7 @@ float CEntity::getPlayListLength() return time; } -float CEntity::getAnimLength(std::string name) +float CEntity::getAnimLength(const std::string &name) const { uint id = _AnimationSet->getAnimationIdByName(name.c_str()); NL3D::UAnimation *anim = _AnimationSet->getAnimation(id); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/entity.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/entity.h similarity index 93% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/entity.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/entity.h index ea1d53e25..47dad0386 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/entity.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/entity.h @@ -109,14 +109,14 @@ public: /// Loads a file animations /// @param fileName - name animation file - void loadAnimation(std::string &fileName); + void loadAnimation(const std::string &fileName); /// Loads a file skeleton weight - void loadSWT(std::string &fileName); + void loadSWT(const std::string &fileName); /// Adds an animation to a playlist /// @param name - name loaded animations - void addAnimToPlayList(std::string &name); + void addAnimToPlayList(const std::string &name); /// Removes the animation from a playlist /// @param row - number of animations in the playlist @@ -135,10 +135,10 @@ public: /// Get the total time of animation playlist /// @return total time of animation - float getPlayListLength(); + float getPlayListLength() const; /// get time length single animation - float getAnimLength(std::string name); + float getAnimLength(const std::string &name) const; /// Get slot infomation void setSlotInfo(uint num, CSlotInfo &slotInfo) @@ -159,7 +159,7 @@ public: } /// Get in place mode - bool getInPlace() + bool getInPlace() const { return _inPlace; } @@ -171,35 +171,35 @@ public: } /// Get inc position - bool getIncPos() + bool getIncPos() const { return _incPos; } /// Get information about the current status of playing a playlist /// @return struct containing current information playback - SAnimationStatus getStatus() + SAnimationStatus getStatus() const { return _AnimationStatus; } /// Get name entity /// @return name entity - std::string getName() + std::string getName() const { return _Name; } /// Get file name shape /// @return file name shape - std::string getFileNameShape() + std::string getFileNameShape() const { return _FileNameShape; } /// Get file name skeleton /// @return file name skeleton - std::string getFileNameSkeleton() + std::string getFileNameSkeleton() const { return _FileNameSkeleton; } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/global_wind_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/global_wind_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/global_wind_dialog.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/global_wind_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/global_wind_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/global_wind_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/global_wind_dialog.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/global_wind_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/global_wind_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/global_wind_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/global_wind_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/global_wind_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/setup_fog_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/setup_fog_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/setup_fog_dialog.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/setup_fog_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/setup_fog_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/setup_fog_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/setup_fog_dialog.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/setup_fog_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/setup_fog_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/setup_fog_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/setup_fog_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/setup_fog_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/skeleton_scale_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/skeleton_scale_dialog.cpp similarity index 98% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/skeleton_scale_dialog.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/skeleton_scale_dialog.cpp index a4221279e..8145c0bcc 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/skeleton_scale_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/skeleton_scale_dialog.cpp @@ -93,8 +93,8 @@ void CSkeletonScaleDialog::setCurrentShape(const QString &name) if (name.isEmpty()) return; - _Skeleton = Modules::objView().getEntity(name.toStdString()).getSkeleton(); - _SkeletonFileName = Modules::objView().getEntity(name.toStdString()).getFileNameSkeleton(); + _Skeleton = Modules::objView().getEntity(name.toUtf8().constData()).getSkeleton(); + _SkeletonFileName = Modules::objView().getEntity(name.toUtf8().constData()).getFileNameSkeleton(); // Setup Bone mirror _Bones.clear(); @@ -290,7 +290,7 @@ void CSkeletonScaleDialog::clickSaveAsSkel() { NLMISC::COFile f; - if( f.open(fileName.toStdString()) ) + if( f.open(fileName.toUtf8().constData()) ) { if(saveCurrentInStream(f)) { @@ -300,7 +300,7 @@ void CSkeletonScaleDialog::clickSaveAsSkel() } // bkup the valid fileName (new file edited) - _SkeletonFileName = fileName.toStdString(); + _SkeletonFileName = fileName.toUtf8().constData(); } else { @@ -324,7 +324,7 @@ void CSkeletonScaleDialog::clickLoadScale() if (!fileName.isEmpty()) { NLMISC::CIFile f; - if( f.open(fileName.toStdString()) ) + if( f.open(fileName.toUtf8().constData()) ) loadSkelScaleFromStream(f); else QMessageBox::critical(this, tr("Skeleton scale editor"), tr("Failed to open file for read!"), QMessageBox::Ok); @@ -345,7 +345,7 @@ void CSkeletonScaleDialog::clickSaveScale() if (!fileName.isEmpty()) { NLMISC::COFile f; - if( f.open(fileName.toStdString()) ) + if( f.open(fileName.toUtf8().constData()) ) saveSkelScaleInStream(f); else QMessageBox::critical(this, tr("Skeleton scale editor"), tr("Failed to open file for write!"), QMessageBox::Ok); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/skeleton_scale_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/skeleton_scale_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/skeleton_scale_dialog.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/skeleton_scale_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/skeleton_scale_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/skeleton_scale_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/skeleton_scale_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/skeleton_scale_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/skeleton_tree_model.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/skeleton_tree_model.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/skeleton_tree_model.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/skeleton_tree_model.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/skeleton_tree_model.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/skeleton_tree_model.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/skeleton_tree_model.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/skeleton_tree_model.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/slot_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/slot_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/slot_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/slot_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/slot_manager_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/slot_manager_dialog.cpp similarity index 97% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/slot_manager_dialog.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/slot_manager_dialog.cpp index d5fc6f42b..f846bdf4a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/slot_manager_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/slot_manager_dialog.cpp @@ -111,8 +111,8 @@ void CSlotGroupBox::updateUi() void CSlotGroupBox::saveSlotInfo() { CSlotInfo slotInfo; - slotInfo.Animation = _animName.toStdString(); - slotInfo.Skeleton = _skelName.toStdString(); + slotInfo.Animation = _animName.toUtf8().constData(); + slotInfo.Skeleton = _skelName.toUtf8().constData(); slotInfo.EndBlend = _ui.endBlendSpinBox->value(); slotInfo.EndTime = float(_ui.endFrameSpinBox->value()) / Modules::mainWin().getFrameRate(); slotInfo.Offset = float(_ui.offsetSpinBox->value()) / Modules::mainWin().getFrameRate(); @@ -182,7 +182,7 @@ void CSlotGroupBox::selectAnim() _animName = item; QString title = tr("Slot %1 : ").arg(_numSlot) + _animName + " : " + _skelName; this->setTitle(title); - _ui.endFrameSpinBox->setValue(int(entity.getAnimLength(_animName.toStdString()) * Modules::mainWin().getFrameRate())); + _ui.endFrameSpinBox->setValue(int(entity.getAnimLength(_animName.toUtf8().constData()) * Modules::mainWin().getFrameRate())); saveSlotInfo(); } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/slot_manager_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/slot_manager_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/slot_manager_dialog.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/slot_manager_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sun_color_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/sun_color_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sun_color_dialog.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/sun_color_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sun_color_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/sun_color_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sun_color_dialog.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/sun_color_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sun_color_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/sun_color_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sun_color_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/sun_color_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/tune_mrm_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/tune_mrm_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/tune_mrm_dialog.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/tune_mrm_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/tune_mrm_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/tune_mrm_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/tune_mrm_dialog.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/tune_mrm_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/tune_mrm_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/tune_mrm_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/tune_mrm_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/tune_mrm_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/tune_timer_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/tune_timer_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/tune_timer_dialog.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/tune_timer_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/tune_timer_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/tune_timer_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/tune_timer_dialog.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/tune_timer_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/tune_timer_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/tune_timer_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/tune_timer_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/tune_timer_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/water_pool_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/water_pool_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/water_pool_dialog.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/water_pool_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/water_pool_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/water_pool_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/water_pool_dialog.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/water_pool_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/water_pool_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/water_pool_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/water_pool_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/water_pool_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_system.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_system.cpp index 5ca313b0f..afa315e0f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_system.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_system.cpp @@ -86,12 +86,12 @@ void CSoundSystem::init() QSettings *settings = Core::ICore::instance()->settings(); settings->beginGroup(Constants::OBJECT_VIEWER_SECTION); - _PackedSheetPath = settings->value(Constants::SOUND_PACKED_SHEET_PATH, "").toString().toStdString(); - _SamplePath = settings->value(Constants::SOUND_SAMPLE_PATH, "").toString().toStdString(); + _PackedSheetPath = settings->value(Constants::SOUND_PACKED_SHEET_PATH, "").toString().toUtf8().constData(); + _SamplePath = settings->value(Constants::SOUND_SAMPLE_PATH, "").toString().toUtf8().constData(); _AudioMixer->setSamplePath(_SamplePath); _AudioMixer->setPackedSheetOption(_PackedSheetPath, true); std::vector devices; - _AudioMixer->initDriver(settings->value(Constants::SOUND_DRIVER, "Auto").toString().toStdString()); + _AudioMixer->initDriver(settings->value(Constants::SOUND_DRIVER, "Auto").toString().toUtf8().constData()); _AudioMixer->getDevices(devices); NLSOUND::UAudioMixer::CInitInfo audioInfo; audioInfo.AutoLoadSample = settings->value(Constants::SOUND_AUTO_LOAD_SAMPLE, true).toBool(); @@ -101,7 +101,7 @@ void CSoundSystem::init() audioInfo.ForceSoftware = settings->value(Constants::SOUND_FORCE_SOFTWARE, false).toBool(); audioInfo.MaxTrack = settings->value(Constants::SOUND_MAX_TRACK, 48).toInt(); audioInfo.UseADPCM = settings->value(Constants::SOUND_USE_ADCPM, false).toBool(); - _AudioMixer->initDevice(settings->value(Constants::SOUND_DEVICE, "").toString().toStdString(), audioInfo, NULL); + _AudioMixer->initDevice(settings->value(Constants::SOUND_DEVICE, "").toString().toUtf8().constData(), audioInfo, NULL); _AudioMixer->setLowWaterMark(1); settings->endGroup(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/stdpch.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/stdpch.h index d9dcf4d58..fbb367fc8 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/stdpch.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/stdpch.h @@ -20,7 +20,8 @@ #ifndef NL_STDPCH_H #define NL_STDPCH_H -#include +#include +#include #include #include @@ -28,6 +29,97 @@ #include #include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include #endif diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_appearance_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_appearance_page.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_appearance_page.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_appearance_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_appearance_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_appearance_page.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_appearance_page.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_appearance_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_apperance_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_apperance_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_apperance_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_apperance_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_density_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_density_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_density_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_density_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_density_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_density_page.cpp similarity index 98% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_density_page.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_density_page.cpp index 04d42828f..ba70b4c9f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_density_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_density_page.cpp @@ -145,13 +145,13 @@ void CVegetableDensityPage::browseShapeVeget() if (!fileName.isEmpty()) { // Add search path for the .veget - NLMISC::CPath::addSearchPath (NLMISC::CFile::getPath(fileName.toStdString())); + NLMISC::CPath::addSearchPath (NLMISC::CFile::getPath(fileName.toUtf8().constData())); try { // update shapeName and view - _Vegetable->ShapeName = NLMISC::CFile::getFilename(fileName.toStdString()); - _ui.meshLineEdit->setText(QString(NLMISC::CFile::getFilename(fileName.toStdString()).c_str())); + _Vegetable->ShapeName = NLMISC::CFile::getFilename(fileName.toUtf8().constData()); + _ui.meshLineEdit->setText(QString::fromUtf8(_Vegetable->ShapeName.c_str())); // update the name in the list-box Q_EMIT vegetNameChanged(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_density_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_density_page.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_density_page.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_density_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_dialog.cpp similarity index 96% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_dialog.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_dialog.cpp index ed7271e66..2fc621411 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_dialog.cpp @@ -68,7 +68,7 @@ void CVegetableDialog::loadVegetset() { NL3D::CTileVegetableDesc vegetSet; // if succes to load the vegetSet - if(Modules::veget().loadVegetableSet(vegetSet, fileName.toStdString())) + if(Modules::veget().loadVegetableSet(vegetSet, fileName.toUtf8().constData())) { // Delete all vegetables. Modules::veget().clearVegetables(); @@ -94,7 +94,7 @@ void CVegetableDialog::appendVegetset() { NL3D::CTileVegetableDesc vegetSet; // if succes to load the vegetSet - if(Modules::veget().loadVegetableSet(vegetSet, fileName.toStdString())) + if(Modules::veget().loadVegetableSet(vegetSet, fileName.toUtf8().constData())) { // Do not Delete any vegetables. // build them from list. @@ -124,7 +124,7 @@ void CVegetableDialog::saveVegetset() { NLMISC::COFile f; - if( f.open(fileName.toStdString()) ) + if( f.open(fileName.toUtf8().constData()) ) { try { @@ -226,7 +226,7 @@ void CVegetableDialog::loadVegetdesc() { NLMISC::CIFile f; - if( f.open(fileName.toStdString()) ) + if( f.open(fileName.toUtf8().constData()) ) { NL3D::CVegetable veget; try @@ -272,7 +272,7 @@ void CVegetableDialog::saveVegetdesc() { NLMISC::COFile f; - if( f.open(fileName.toStdString()) ) + if( f.open(fileName.toUtf8().constData()) ) { try { diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_dialog.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_dialog_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_dialog_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_dialog_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_dialog_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_editor.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_editor.cpp similarity index 98% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_editor.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_editor.cpp index b6a3b89dc..73b639647 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_editor.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_editor.cpp @@ -596,15 +596,15 @@ void CVegetableEditor::loadLandscapeSetup() QSettings *settings = Core::ICore::instance()->settings(); settings->beginGroup(Constants::OBJECT_VIEWER_SECTION); - _VegetableLandscapeTileBank = settings->value(Constants::VEGET_TILE_BANK, "").toString().toStdString(); - _VegetableLandscapeTileFarBank = settings->value(Constants::VEGET_TILE_FAR_BANK, "").toString().toStdString(); - _CoarseMeshTexture = settings->value(Constants::COARSE_MESH_TEXTURE, "").toString().toStdString(); - _VegetableTexture = settings->value(Constants::VEGET_TEXTURE, "").toString().toStdString(); + _VegetableLandscapeTileBank = settings->value(Constants::VEGET_TILE_BANK, "").toString().toUtf8().constData(); + _VegetableLandscapeTileFarBank = settings->value(Constants::VEGET_TILE_FAR_BANK, "").toString().toUtf8().constData(); + _CoarseMeshTexture = settings->value(Constants::COARSE_MESH_TEXTURE, "").toString().toUtf8().constData(); + _VegetableTexture = settings->value(Constants::VEGET_TEXTURE, "").toString().toUtf8().constData(); QStringList list = settings->value(Constants::VEGET_LANDSCAPE_ZONES).toStringList(); _VegetableLandscapeZoneNames.clear(); for (int i = 0; i < list.size(); ++i) - _VegetableLandscapeZoneNames.push_back(list[i].toStdString()); + _VegetableLandscapeZoneNames.push_back(list[i].toUtf8().constData()); settings->endGroup(); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_editor.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_editor.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_editor.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_editor.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_landscape_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_landscape_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_landscape_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_landscape_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_landscape_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_landscape_page.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_landscape_page.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_landscape_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_landscape_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_landscape_page.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_landscape_page.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_landscape_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_node.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_node.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_node.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_node.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_node.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_node.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_node.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_node.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_noise_value_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_noise_value_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_noise_value_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_noise_value_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_noise_value_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_noise_value_widget.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_noise_value_widget.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_noise_value_widget.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_noise_value_widget.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_noise_value_widget.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_noise_value_widget.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_noise_value_widget.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_rotate_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_rotate_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_rotate_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_rotate_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_rotate_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_rotate_page.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_rotate_page.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_rotate_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_rotate_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_rotate_page.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_rotate_page.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_rotate_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_scale_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_scale_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_scale_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_scale_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_scale_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_scale_page.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_scale_page.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_scale_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_scale_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_scale_page.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_scale_page.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_scale_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/color_edit_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/color_edit_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/color_edit_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/color_edit_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/color_edit_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/color_edit_widget.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/color_edit_widget.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/color_edit_widget.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/color_edit_widget.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/color_edit_widget.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/color_edit_widget.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/color_edit_widget.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/edit_range_float_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/edit_range_float_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/edit_range_float_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/edit_range_float_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/edit_range_uint_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/edit_range_uint_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/edit_range_uint_form.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/edit_range_uint_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/edit_range_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/edit_range_widget.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/edit_range_widget.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/edit_range_widget.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/edit_range_widget.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/edit_range_widget.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/edit_range_widget.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/edit_range_widget.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/hoverpoints.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/hoverpoints.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/hoverpoints.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/hoverpoints.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/hoverpoints.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/hoverpoints.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/hoverpoints.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/hoverpoints.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/CMakeLists.txt index 2d4ddaa9d..52965a3d4 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/CMakeLists.txt @@ -29,4 +29,6 @@ NL_ADD_LIB_SUFFIX(ovqt_plugin_sheet_builder) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) -INSTALL(TARGETS ovqt_plugin_sheet_builder LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d) +INSTALL(TARGETS ovqt_plugin_sheet_builder LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} ARCHIVE DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_sheet_builder.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/sheetbuilderdialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/sheetbuilderdialog.cpp index 69e5da30e..c999daa17 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/sheetbuilderdialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/sheetbuilderdialog.cpp @@ -119,7 +119,7 @@ void SheetBuilderDialog::buildSheet() bool clean = chckClean->isChecked(); - string outputFileName(outputFile.toStdString()); + string outputFileName(outputFile.toUtf8()); if (outputFileName.empty()) { @@ -129,11 +129,11 @@ void SheetBuilderDialog::buildSheet() list inputDirs; Q_FOREACH (QString str, paths) - inputDirs.push_back(str.toStdString()); + inputDirs.push_back(str.toUtf8().constData()); Q_FOREACH (QString str, extensions) { - ExtensionsAllowed.insert(str.toStdString()); + ExtensionsAllowed.insert(str.toUtf8().constData()); } // get the current associations (read the sheet_id and fill the working structures) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/CMakeLists.txt index 505340487..a7de55dfb 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/CMakeLists.txt @@ -48,4 +48,6 @@ NL_ADD_LIB_SUFFIX(ovqt_plugin_translation_manager) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) -INSTALL(TARGETS ovqt_plugin_translation_manager LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d) +INSTALL(TARGETS ovqt_plugin_translation_manager LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} ARCHIVE DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_translation_manager.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/editor_phrase.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/editor_phrase.cpp index 805e2361d..01ec90fe1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/editor_phrase.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/editor_phrase.cpp @@ -40,7 +40,7 @@ namespace TranslationManager void CEditorPhrase::open(QString filename) { std::vector phrases; - if(readPhraseFile(filename.toStdString(), phrases, false)) + if(readPhraseFile(filename.toUtf8().constData(), phrases, false)) { text_edit = new CTextEdit(this); text_edit->setUndoStack(current_stack); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/editor_worksheet.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/editor_worksheet.cpp index f9b216da6..9df0655ac 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/editor_worksheet.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/editor_worksheet.cpp @@ -37,7 +37,7 @@ namespace TranslationManager void CEditorWorksheet::open(QString filename) { STRING_MANAGER::TWorksheet wk_file; - if(loadExcelSheet(filename.toStdString(), wk_file, true) == true) + if(loadExcelSheet(filename.toUtf8().constData(), wk_file, true) == true) { bool hasHashValue = false; table_editor = new QTableWidget(); @@ -149,7 +149,7 @@ void CEditorWorksheet::save() void CEditorWorksheet::saveAs(QString filename) { STRING_MANAGER::TWorksheet new_file, wk_file; - loadExcelSheet(current_file.toStdString(), wk_file, true); + loadExcelSheet(current_file.toUtf8().constData(), wk_file, true); // set columns new_file.resize(new_file.size() + 1); for(unsigned int i = 0; i < wk_file.ColCount; i++) @@ -185,7 +185,7 @@ void CEditorWorksheet::saveAs(QString filename) makeHashCode(wk_file, true); } ucstring s = prepareExcelSheet(new_file); - NLMISC::CI18N::writeTextFile(filename.toStdString(), s, false); + NLMISC::CI18N::writeTextFile(filename.toUtf8().constData(), s, false); current_file = filename; setCurrentFile(filename); } @@ -299,29 +299,29 @@ void CEditorWorksheet::extractWords(QString filename, QString columnId, IWordLis // **** Load the excel sheet // load STRING_MANAGER::TWorksheet workSheet; - if(!loadExcelSheet(filename.toStdString(), workSheet, true)) + if(!loadExcelSheet(filename.toUtf8().constData(), workSheet, true)) { - nlwarning("Error reading '%s'. Aborted", filename.toStdString().c_str()); + nlwarning("Error reading '%s'. Aborted", filename.toUtf8().constData()); return; } // get the key column index uint keyColIndex = 0; - if(!workSheet.findCol(columnId.toStdString(), keyColIndex)) + if(!workSheet.findCol(ucstring(columnId.toUtf8().constData()), keyColIndex)) { - nlwarning("Error: Don't find the column '%s'. '%s' Aborted", columnId.toStdString().c_str(), filename.toStdString().c_str()); + nlwarning("Error: Don't find the column '%s'. '%s' Aborted", columnId.toUtf8().constData(), filename.toUtf8().constData()); return; } // get the name column index uint nameColIndex; if(!workSheet.findCol(ucstring("name"), nameColIndex)) { - nlwarning("Error: Don't find the column 'name'. '%s' Aborted", filename.toStdString().c_str()); + nlwarning("Error: Don't find the column 'name'. '%s' Aborted", filename.toUtf8().constData()); return; } // **** List all words with the builder given std::vector allWords; - if(!wordListBuilder.buildWordList(allWords, filename.toStdString())) + if(!wordListBuilder.buildWordList(allWords, filename.toUtf8().constData())) { return; } @@ -380,7 +380,7 @@ bool CEditorWorksheet::compareWorksheetFile(QString filename) { STRING_MANAGER::TWorksheet wk_file; int colIndex = 0; - if(loadExcelSheet(filename.toStdString(), wk_file, true) == true) + if(loadExcelSheet(filename.toUtf8().constData(), wk_file, true) == true) { if(wk_file.getData(0, 0) == ucstring("*HASH_VALUE")) { @@ -392,11 +392,12 @@ bool CEditorWorksheet::compareWorksheetFile(QString filename) } for(int i = 0; i < table_editor->columnCount(); i++) { - QString item = table_editor->horizontalHeaderItem(i)->text(); + ucstring item; + item.fromUtf8(table_editor->horizontalHeaderItem(i)->text().toUtf8().constData()); ucstring itemC = wk_file.getData(0, i+ colIndex); - if(item.toStdString() != itemC.toString()) + if(item != itemC) { - nlwarning(item.toStdString().c_str()); + nlwarning(item.toString().c_str()); nlwarning(itemC.toString().c_str()); return false; } @@ -412,7 +413,7 @@ bool CEditorWorksheet::compareWorksheetFile(QString filename) void CEditorWorksheet::mergeWorksheetFile(QString filename) { STRING_MANAGER::TWorksheet wk_file; - if(loadExcelSheet(filename.toStdString(), wk_file, true) == true) + if(loadExcelSheet(filename.toUtf8().constData(), wk_file, true) == true) { bool hasHashValue = false; int colIndex = 0; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_main_window.cpp index 306c30ea9..9fcb9626a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_main_window.cpp @@ -300,8 +300,8 @@ void CMainWindow::initializeSettings(bool georges = false) { if(georges == true && initialize_settings["georges"] == false) { - NLMISC::CPath::addSearchPath(level_design_path.toStdString() + "/DFN", true, false); - NLMISC::CPath::addSearchPath(level_design_path.toStdString() + "/Game_elem/Creature", true, false); + NLMISC::CPath::addSearchPath(std::string(level_design_path.toUtf8().constData()) + "/DFN", true, false); + NLMISC::CPath::addSearchPath(std::string(level_design_path.toUtf8().constData()) + "/Game_elem/Creature", true, false); initialize_settings["georges"] = true; } @@ -357,34 +357,34 @@ void CMainWindow::extractWords(QString typeq) { column_name = "item ID"; builderS.SheetExt = "sitem"; - builderS.SheetPath = level_design_path.append("/game_element/sitem").toStdString(); + builderS.SheetPath = level_design_path.append("/game_element/sitem").toUtf8().constData(); isSheet = true; } else if(typeq.toAscii() == Constants::WK_CREATURE) { column_name = "creature ID"; builderS.SheetExt = "creature"; - builderS.SheetPath = level_design_path.append("/Game_elem/Creature/fauna").toStdString(); + builderS.SheetPath = level_design_path.append("/Game_elem/Creature/fauna").toUtf8().constData(); isSheet = true; } else if(typeq.toAscii() == Constants::WK_SBRICK) { column_name = "sbrick ID"; builderS.SheetExt = "sbrick"; - builderS.SheetPath = level_design_path.append("/game_element/sbrick").toStdString(); + builderS.SheetPath = level_design_path.append("/game_element/sbrick").toUtf8().constData(); isSheet = true; } else if(typeq.toAscii() == Constants::WK_SPHRASE) { column_name = "sphrase ID"; builderS.SheetExt = "sphrase"; - builderS.SheetPath = level_design_path.append("/game_element/sphrase").toStdString(); + builderS.SheetPath = level_design_path.append("/game_element/sphrase").toUtf8().constData(); isSheet = true; } else if(typeq.toAscii() == Constants::WK_PLACE) { column_name = "placeId"; - builderP.PrimPath = primitives_path.toStdString(); + builderP.PrimPath = primitives_path.toUtf8().constData(); builderP.PrimFilter.push_back("region_*.primitive"); builderP.PrimFilter.push_back("indoors_*.primitive"); isSheet = false; @@ -428,7 +428,7 @@ void CMainWindow::extractBotNames() QApplication::setOverrideCursor(Qt::WaitCursor); initializeSettings(true); - editor_window->extractBotNames(convertQStringList(filters), level_design_path.toStdString(), ligoConfig); + editor_window->extractBotNames(convertQStringList(filters), level_design_path.toUtf8().constData(), ligoConfig); QApplication::restoreOverrideCursor(); } } @@ -627,7 +627,7 @@ std::list CMainWindow::convertQStringList(QStringList listq) Q_FOREACH(QString text, listq) { - stdlist.push_back(text.toStdString()); + stdlist.push_back(text.toUtf8().constData()); } return stdlist; } @@ -635,7 +635,7 @@ std::list CMainWindow::convertQStringList(QStringList listq) bool CMainWindow::isWorksheetEditor(QString filename) { STRING_MANAGER::TWorksheet wk_file; - if(loadExcelSheet(filename.toStdString(), wk_file, true) == true) + if(loadExcelSheet(filename.toUtf8().constData(), wk_file, true) == true) { if(wk_file.ColCount > 1) return true; @@ -646,7 +646,7 @@ bool CMainWindow::isWorksheetEditor(QString filename) bool CMainWindow::isPhraseEditor(QString filename) { vector phrases; - return readPhraseFile(filename.toStdString(), phrases, false); + return readPhraseFile(filename.toUtf8().constData(), phrases, false); } } /* namespace TranslationManager */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/CMakeLists.txt index 2ddbe868e..e9023c4b9 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/CMakeLists.txt @@ -42,4 +42,6 @@ NL_ADD_LIB_SUFFIX(ovqt_plugin_zone_painter) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) -INSTALL(TARGETS ovqt_plugin_zone_painter LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d) +INSTALL(TARGETS ovqt_plugin_zone_painter LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} ARCHIVE DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_zone_painter.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) + diff --git a/code/nel/tools/3d/object_viewer_widget/CMakeLists.txt b/code/nel/tools/3d/object_viewer_widget/CMakeLists.txt index 4967e8206..20e5b69e8 100644 --- a/code/nel/tools/3d/object_viewer_widget/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_widget/CMakeLists.txt @@ -6,7 +6,7 @@ #----------------------------------------------------------------------------- # This tells the application(s) where to find the installed data. -#ADD_DEFINITIONS(-DDATA_DIR="\\"${NL_SHARE_PREFIX}/georges_editor_qt/\\"") +#ADD_DEFINITIONS(-DDATA_DIR="\\"${NL_SHARE_ABSOLUTE_PREFIX}/georges_editor_qt/\\"") ADD_SUBDIRECTORY(src) diff --git a/code/nel/tools/3d/object_viewer_widget/src/CMakeLists.txt b/code/nel/tools/3d/object_viewer_widget/src/CMakeLists.txt index 160aca337..0943f61fa 100644 --- a/code/nel/tools/3d/object_viewer_widget/src/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_widget/src/CMakeLists.txt @@ -39,4 +39,4 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(object_viewer_widget_qt ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) ENDIF(WITH_PCH) -#INSTALL(TARGETS object_viewer_widget_qt RUNTIME DESTINATION bin COMPONENT runtime BUNDLE DESTINATION /Applications) +#INSTALL(TARGETS object_viewer_widget_qt RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT runtime BUNDLE DESTINATION /Applications) diff --git a/code/nel/tools/3d/panoply_maker/CMakeLists.txt b/code/nel/tools/3d/panoply_maker/CMakeLists.txt index 4a39ab154..8fd25fef6 100644 --- a/code/nel/tools/3d/panoply_maker/CMakeLists.txt +++ b/code/nel/tools/3d/panoply_maker/CMakeLists.txt @@ -1,11 +1,9 @@ -FILE(GLOB SRC *.cpp *.h ../s3tc_compressor_lib/*.h ../s3tc_compressor_lib/*.cpp) +FILE(GLOB SRC *.cpp *.h) ADD_EXECUTABLE(panoply_maker ${SRC}) -INCLUDE_DIRECTORIES(${SQUISH_INCLUDE_DIR}) - -TARGET_LINK_LIBRARIES(panoply_maker ${SQUISH_LIBRARIES} nelmisc nel3d) +TARGET_LINK_LIBRARIES(panoply_maker s3tc_compressor nelmisc nel3d) NL_DEFAULT_PROPS(panoply_maker "NeL, Tools, 3D: panoply_maker") NL_ADD_RUNTIME_FLAGS(panoply_maker) -INSTALL(TARGETS panoply_maker RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS panoply_maker RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/CMakeLists.txt index 7233f2f76..3a596badc 100644 --- a/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/CMakeLists.txt @@ -22,4 +22,4 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_3dsmax_shared ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.h ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS nel_3dsmax_shared RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) +INSTALL(TARGETS nel_3dsmax_shared RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) diff --git a/code/nel/tools/3d/plugin_max/nel_export/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_export/CMakeLists.txt index 32bac9067..93ae28370 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_export/CMakeLists.txt @@ -31,4 +31,4 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_export ${CMAKE_CURRENT_SOURCE_DIR}/std_afx.h ${CMAKE_CURRENT_SOURCE_DIR}/std_afx.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS nel_export RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) +INSTALL(TARGETS nel_export RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export_collision.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export_collision.cpp index 4aea7d654..8ff853031 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export_collision.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export_collision.cpp @@ -19,8 +19,8 @@ #include "nel/misc/file.h" #include "nel/misc/o_xml.h" -#include "nel/../../src/pacs/collision_mesh_build.h" -#include "nel/../../src/pacs/primitive_block.h" +#include "nel/pacs/collision_mesh_build.h" +#include "nel/pacs/primitive_block.h" #include "../nel_mesh_lib/export_nel.h" #include "../nel_mesh_lib/export_appdata.h" diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export_view.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export_view.cpp index ae0b15263..81efc7d4c 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export_view.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export_view.cpp @@ -25,8 +25,8 @@ #include "nel/3d/water_pool_manager.h" #include "nel/3d/instance_lighter.h" -#include "nel/../../src/pacs/retriever_bank.h" -#include "nel/../../src/pacs/global_retriever.h" +#include "nel/pacs/retriever_bank.h" +#include "nel/pacs/global_retriever.h" #include "../../object_viewer/object_viewer_interface.h" diff --git a/code/nel/tools/3d/plugin_max/nel_export/std_afx.h b/code/nel/tools/3d/plugin_max/nel_export/std_afx.h index c9ce76d89..9b4b18357 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/std_afx.h +++ b/code/nel/tools/3d/plugin_max/nel_export/std_afx.h @@ -14,6 +14,19 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#ifndef STDAFX_H +#define STDAFX_H + +#include + +#ifdef _STLPORT_VERSION +namespace std +{ + float fabsf(float f); + double fabsl(double f); +} +#endif + #include #include #include @@ -36,7 +49,7 @@ # include # include # include -# include +# include #else # include # include @@ -58,3 +71,5 @@ #endif #include "nel/misc/bsphere.h" + +#endif diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_mesh_lib/CMakeLists.txt index 555edd263..a6161338d 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/CMakeLists.txt @@ -12,4 +12,4 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_mesh_lib ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.h ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS nel_mesh_lib RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) +INSTALL(TARGETS nel_mesh_lib RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/StdAfx.h b/code/nel/tools/3d/plugin_max/nel_mesh_lib/StdAfx.h index dfbd11915..cb2cec48f 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/StdAfx.h +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/StdAfx.h @@ -49,6 +49,7 @@ #include #include +#include #include "../nel_patch_lib/rpo.h" #include "nel/misc/time_nl.h" diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_collision.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_collision.cpp index 16c3ae727..ecc9e8127 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_collision.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_collision.cpp @@ -14,9 +14,6 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#include -#include - #include "stdafx.h" #include "export_nel.h" #include "export_appdata.h" @@ -25,11 +22,11 @@ #include "../nel_export/nel_export.h" #include "../nel_export/nel_export_scene.h" -#include "nel/../../src/pacs/collision_mesh_build.h" -#include "nel/../../src/pacs/retriever_bank.h" -#include "nel/../../src/pacs/global_retriever.h" -#include "nel/../../src/pacs/build_indoor.h" -#include "nel/../../src/pacs/primitive_block.h" +#include "nel/pacs/collision_mesh_build.h" +#include "nel/pacs/retriever_bank.h" +#include "nel/pacs/global_retriever.h" +#include "nel/pacs/build_indoor.h" +#include "nel/pacs/primitive_block.h" #include "nel/3d/quad_grid.h" diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp index 8dbaeb56b..44f51fc75 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp @@ -27,6 +27,14 @@ using namespace NLMISC; using namespace NL3D; +#ifdef _STLPORT_VERSION +namespace std +{ + float fabsf(float f) { return ::fabsf(f); } + double fabsl(double f) { return ::fabsl(f); } +} +#endif + // *************************************************************************** // -------------------------------------------------- diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_nel.h b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_nel.h index d9383fea2..11e762099 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_nel.h +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_nel.h @@ -27,7 +27,7 @@ #include "nel/3d/bone.h" #include "nel/3d/animation_time.h" #include "nel/3d/animation_time.h" -#include "nel/../../src/pacs/collision_mesh_build.h" +#include "nel/pacs/collision_mesh_build.h" #define UVGEN_MISSING (-1) #define UVGEN_REFLEXION (-2) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_converter/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_patch_converter/CMakeLists.txt index d414375ba..c173232b3 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_converter/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_patch_converter/CMakeLists.txt @@ -18,4 +18,4 @@ NL_DEFAULT_PROPS(nel_patch_converter "MAX Plugin: NeL Patch Converter") NL_ADD_RUNTIME_FLAGS(nel_patch_converter) NL_ADD_LIB_SUFFIX(nel_patch_converter) -INSTALL(TARGETS nel_patch_converter RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) +INSTALL(TARGETS nel_patch_converter RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.def b/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.def index a6cecd424..c3a249d4a 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.def +++ b/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.def @@ -1,4 +1,4 @@ -LIBRARY nelconvertpatch.dlm +;LIBRARY nelconvertpatch.dlm EXPORTS LibDescription @1 LibNumberClasses @2 diff --git a/code/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp b/code/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp index 6ee1c43f1..c2e80e06b 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp @@ -19,7 +19,19 @@ #pragma conform(forScope, push) #pragma conform(forScope, off) +#ifndef _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE +#endif + +#include + +#ifdef _STLPORT_VERSION +namespace std +{ + float fabsf(float f); + double fabsl(double f); +} +#endif #include diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_patch_edit/CMakeLists.txt index ff2c11245..82cc06611 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/CMakeLists.txt @@ -22,4 +22,4 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_patch_edit ${CMAKE_CURRENT_SOURCE_DIR}/stdafx.h ${CMAKE_CURRENT_SOURCE_DIR}/stdafx.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS nel_patch_edit RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) +INSTALL(TARGETS nel_patch_edit RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/nel_patch_edit.def b/code/nel/tools/3d/plugin_max/nel_patch_edit/nel_patch_edit.def index 607869257..c01fdf4e9 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/nel_patch_edit.def +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/nel_patch_edit.def @@ -1,4 +1,4 @@ -LIBRARY neleditpatch +;LIBRARY neleditpatch EXPORTS LibDescription @1 LibNumberClasses @2 diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np.cpp index 0c4d5c935..7b1c9c644 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np.cpp @@ -96,12 +96,12 @@ //#define VMAP_DEBUG 1 // Forward references -BOOL CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); void ResetVert (PatchMesh *patch); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/CMakeLists.txt index c63db300f..08b8f49ab 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/CMakeLists.txt @@ -18,4 +18,4 @@ NL_DEFAULT_PROPS(nel_patch_edit_adv "MAX Plugin: NeL Patch Edit (Adv)") NL_ADD_RUNTIME_FLAGS(nel_patch_edit_adv) NL_ADD_LIB_SUFFIX(nel_patch_edit_adv) -INSTALL(TARGETS nel_patch_edit_adv RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) +INSTALL(TARGETS nel_patch_edit_adv RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP.cpp index 0c4d5c935..7b1c9c644 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP.cpp @@ -96,12 +96,12 @@ //#define VMAP_DEBUG 1 // Forward references -BOOL CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); void ResetVert (PatchMesh *patch); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_EPM_Selection.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_EPM_Selection.cpp index e465e1345..3814a2df9 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_EPM_Selection.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_EPM_Selection.cpp @@ -9,9 +9,9 @@ #define PROMPT_TIME 2000 -BOOL CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); extern void ChangePatchType(PatchMesh *patch, int index, int type); extern BOOL filterVerts; // ------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_EPM_Surface.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_EPM_Surface.cpp index 2c475b0c7..4f72420b1 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_EPM_Surface.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_EPM_Surface.cpp @@ -15,7 +15,7 @@ extern int sbmParams[4]; extern DWORD sbsParams[3]; // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK SelectByMatDlgProc( +INT_PTR CALLBACK SelectByMatDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { static int *param; @@ -84,7 +84,7 @@ void SetSmoothButtonState(HWND hWnd, DWORD bits, DWORD invalid, DWORD unused = 0 // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK SelectBySmoothDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK SelectBySmoothDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { static DWORD *param; switch (msg) @@ -137,9 +137,9 @@ BOOL CALLBACK SelectBySmoothDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - EditPatchMod *ep =(EditPatchMod *)GetWindowLong(hDlg, GWL_USERDATA); + EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); if (!ep && message != WM_INITDIALOG) return FALSE; @@ -150,7 +150,7 @@ BOOL CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP ep =(EditPatchMod *)lParam; ep->hTilePanel = hDlg; - SetWindowLong(hDlg, GWL_USERDATA, (LONG)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); ep->tileNum = SetupIntSpinner(hDlg, IDC_TILE_MAT_SPIN, IDC_TILE_MAT, 0, 65535, 0); ep->tileRot = SetupIntSpinner(hDlg, IDC_TILE_ROT_SPIN, IDC_TILE_ROT, 0, 3, 0); ep->SetTileDlgEnables(); @@ -249,9 +249,9 @@ BOOL CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - EditPatchMod *ep =(EditPatchMod *)GetWindowLong(hDlg, GWL_USERDATA); + EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); if (!ep && message != WM_INITDIALOG) return FALSE; @@ -262,7 +262,7 @@ BOOL CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP ep =(EditPatchMod *)lParam; ep->hEdgePanel = hDlg; - SetWindowLong(hDlg, GWL_USERDATA, (LONG)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); ep->SetEdgeDlgEnables(); return TRUE; } @@ -324,9 +324,9 @@ BOOL CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - EditPatchMod *ep =(EditPatchMod *)GetWindowLong(hDlg, GWL_USERDATA); + EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); if (!ep && message != WM_INITDIALOG) return FALSE; @@ -339,7 +339,7 @@ BOOL CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP for (int i = IDC_SMOOTH_GRP1; i < IDC_SMOOTH_GRP1 + 32; i++) SendMessage(GetDlgItem(hDlg, i), CC_COMMAND, CC_CMD_SET_TYPE, CBT_CHECK); - SetWindowLong(hDlg, GWL_USERDATA, (LONG)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); ep->matSpin = SetupIntSpinner(hDlg, IDC_MAT_IDSPIN, IDC_MAT_ID, 1, MAX_MATID, 0); ep->tessUSpin = SetupIntSpinner(hDlg, IDC_TESS_U_SPIN, IDC_TESS_U2, 1, 4, RPO_DEFAULT_TESSEL); ep->tessVSpin = SetupIntSpinner(hDlg, IDC_TESS_V_SPIN, IDC_TESS_V2, 1, 4, RPO_DEFAULT_TESSEL); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_EPM_Tess.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_EPM_Tess.cpp index 3da46fee5..5a1a54cb4 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_EPM_Tess.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_EPM_Tess.cpp @@ -10,7 +10,7 @@ #define PROMPT_TIME 2000 extern AdvParams sParams; -BOOL CALLBACK AdvParametersDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK AdvParametersDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); // ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -210,9 +210,9 @@ void EditPatchMod::SetTessUI(HWND hDlg, TessApprox *tess) // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - EditPatchMod *ep =(EditPatchMod *)GetWindowLong(hDlg, GWL_USERDATA); + EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); if (!ep && message != WM_INITDIALOG) return FALSE; @@ -223,7 +223,7 @@ BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM ep =(EditPatchMod *)lParam; ep->hSurfPanel = hDlg; - SetWindowLong(hDlg, GWL_USERDATA, (LONG)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); if (!ep->settingViewportTess && ep->settingDisp && ep->GetProdTess().type == TESS_SET) ep->settingDisp = FALSE; TessApprox t; @@ -599,7 +599,7 @@ static ISpinnerControl* psMaxTrisSpin = NULL; // this max matches the MI max. #define MAX_SUBDIV 7 static BOOL initing = FALSE; // this is a hack but CenterWindow causes bad commands -BOOL CALLBACK +INT_PTR CALLBACK AdvParametersDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_EditPatchMod.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_EditPatchMod.cpp index 343699663..55825158b 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_EditPatchMod.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_EditPatchMod.cpp @@ -264,7 +264,7 @@ void EditPatchMod::NewSetByOperator(TSTR &newName, Tab < int> &sets, int op) // Named selection set copy/paste methods follow... -static BOOL CALLBACK PickSetNameDlgProc( +static INT_PTR CALLBACK PickSetNameDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { static TSTR *name; @@ -328,7 +328,7 @@ BOOL EditPatchMod::GetUniqueSetName(TSTR &name) -static BOOL CALLBACK PickSetDlgProc( +static INT_PTR CALLBACK PickSetDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_Main.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_Main.cpp index 32c0eb120..a6592893b 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_Main.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_Main.cpp @@ -9,12 +9,12 @@ #define PROMPT_TIME 2000 -BOOL CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); extern void CancelEditPatchModes(IObjParam *ip); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_Rollup.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_Rollup.cpp index e550f1774..22b06376b 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_Rollup.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_Rollup.cpp @@ -33,10 +33,10 @@ extern void CancelEditPatchModes(IObjParam *ip); extern void LoadImages(); -BOOL CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { static char string[64]; - EditPatchMod *ep =(EditPatchMod *)GetWindowLong(hDlg, GWL_USERDATA); + EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); ICustToolbar *iToolbar; if (!ep && message != WM_INITDIALOG) return FALSE; @@ -104,7 +104,7 @@ BOOL CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM ep =(EditPatchMod *)lParam; ep->hSelectPanel = hDlg; - SetWindowLong(hDlg, GWL_USERDATA, (LONG)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); // Set up the editing level selector LoadImages(); iToolbar = GetICustToolbar(GetDlgItem(hDlg, IDC_SELTYPE)); @@ -349,9 +349,9 @@ void EditPatchMod::SetOpsDlgEnables() // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - EditPatchMod *ep =(EditPatchMod *)GetWindowLong(hDlg, GWL_USERDATA); + EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); if (!ep && message != WM_INITDIALOG) return FALSE; @@ -367,7 +367,7 @@ BOOL CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa ep->hOpsPanel = hDlg; for (int i = IDC_SMOOTH_GRP1; i < IDC_SMOOTH_GRP1 + 32; i++) SendMessage(GetDlgItem(hDlg, i), CC_COMMAND, CC_CMD_SET_TYPE, CBT_CHECK); - SetWindowLong(hDlg, GWL_USERDATA, (LONG)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); ICustButton *but = GetICustButton(GetDlgItem(hDlg, IDC_ATTACH)); but->SetHighlightColor(GREEN_WASH); but->SetType(CBT_CHECK); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_editpops.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_editpops.cpp index 65344b052..abbd4e34d 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_editpops.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_editpops.cpp @@ -50,7 +50,7 @@ EPTempData::EPTempData(EditPatchMod *m,EditPatchData *pd) mod = m; } -void EPTempData::Invalidate(DWORD part,BOOL patchValid) +void EPTempData::Invalidate(PartID part,BOOL patchValid) { if ( !patchValid ) { diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_mods.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_mods.cpp index 3723a8a75..4020110e3 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_mods.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_mods.cpp @@ -225,11 +225,11 @@ __declspec( dllexport ) ULONG CanAutoDefer() BOOL CALLBACK DefaultSOTProc( HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam) { - IObjParam *ip = (IObjParam*)GetWindowLong(hWnd,GWL_USERDATA); + IObjParam *ip = (IObjParam*)GetWindowLongPtr(hWnd,GWLP_USERDATA); switch (msg) { case WM_INITDIALOG: - SetWindowLong(hWnd,GWL_USERDATA,lParam); + SetWindowLongPtr(hWnd,GWLP_USERDATA,lParam); break; case WM_LBUTTONDOWN: diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/mods.def b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/mods.def index f3b941802..d3759424e 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/mods.def +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/mods.def @@ -1,4 +1,4 @@ -LIBRARY neleditpatchadv +;LIBRARY neleditpatchadv EXPORTS LibDescription @1 LibNumberClasses @2 diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/stdafx.h b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/stdafx.h index 14e542a3f..9045b4b53 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/stdafx.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/stdafx.h @@ -1,4 +1,6 @@ #pragma warning (disable : 4786) + +#include #include #include #include diff --git a/code/nel/tools/3d/plugin_max/nel_patch_lib/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_patch_lib/CMakeLists.txt index faaac3f5d..63f0a5bcc 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_lib/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_patch_lib/CMakeLists.txt @@ -8,4 +8,4 @@ NL_DEFAULT_PROPS(nel_patch_lib "MAX Plugin: NeL Patch Library") NL_ADD_RUNTIME_FLAGS(nel_patch_lib) NL_ADD_LIB_SUFFIX(nel_patch_lib) -INSTALL(TARGETS nel_patch_lib RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) +INSTALL(TARGETS nel_patch_lib RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_lib/stdafx.h b/code/nel/tools/3d/plugin_max/nel_patch_lib/stdafx.h index 85d489147..db03395e8 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_lib/stdafx.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_lib/stdafx.h @@ -17,7 +17,9 @@ #pragma conform(forScope, push) #pragma conform(forScope, off) +#ifndef _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE +#endif #pragma warning (disable : 4786) #include diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_patch_paint/CMakeLists.txt index 54f2c1724..628cb3120 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/CMakeLists.txt @@ -24,5 +24,5 @@ NL_ADD_LIB_SUFFIX(nel_patch_paint) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -INSTALL(TARGETS nel_patch_paint RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) +INSTALL(TARGETS nel_patch_paint RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) INSTALL(FILES keys.cfg DESTINATION maxplugin/plugins ) \ No newline at end of file diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.def b/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.def index 59c2e5d46..ddb039e28 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.def +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.def @@ -1,4 +1,4 @@ -LIBRARY nelpaintpatch.dlm +;LIBRARY nelpaintpatch.dlm EXPORTS LibDescription @1 LibNumberClasses @2 diff --git a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/CMakeLists.txt index 2f910ac9a..9c4f6deb2 100644 --- a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/CMakeLists.txt @@ -19,4 +19,4 @@ NL_DEFAULT_PROPS(nel_vertex_tree_paint "MAX Plugin: NeL Vertex Tree Painter") NL_ADD_RUNTIME_FLAGS(nel_vertex_tree_paint) NL_ADD_LIB_SUFFIX(nel_vertex_tree_paint) -INSTALL(TARGETS nel_vertex_tree_paint RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) +INSTALL(TARGETS nel_vertex_tree_paint RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) diff --git a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.def b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.def index 1c3524d1c..dcd6d1e33 100644 --- a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.def +++ b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.def @@ -1,4 +1,4 @@ -LIBRARY nel_vertex_tree_paint +;LIBRARY nel_vertex_tree_paint EXPORTS LibDescription @1 LibNumberClasses @2 diff --git a/code/nel/tools/3d/plugin_max/tile_utility/CMakeLists.txt b/code/nel/tools/3d/plugin_max/tile_utility/CMakeLists.txt index 772efe8b9..7f0122cda 100644 --- a/code/nel/tools/3d/plugin_max/tile_utility/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/tile_utility/CMakeLists.txt @@ -18,4 +18,4 @@ NL_DEFAULT_PROPS(tile_utility "MAX Plugin: Tile Utility") NL_ADD_RUNTIME_FLAGS(tile_utility) NL_ADD_LIB_SUFFIX(tile_utility) -INSTALL(TARGETS tile_utility RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) +INSTALL(TARGETS tile_utility RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) diff --git a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.def b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.def index 6a8b07e45..8fe710a8f 100644 --- a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.def +++ b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.def @@ -1,4 +1,4 @@ -LIBRARY neltileutility.dlu +;LIBRARY neltileutility.dlu EXPORTS LibDescription @1 LibNumberClasses @2 diff --git a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.h b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.h index ade41e486..5d5e4e298 100644 --- a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.h +++ b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.h @@ -20,7 +20,9 @@ #pragma conform(forScope, push) #pragma conform(forScope, off) +#ifndef _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE +#endif #include #include diff --git a/code/nel/tools/3d/s3tc_compressor_lib/CMakeLists.txt b/code/nel/tools/3d/s3tc_compressor_lib/CMakeLists.txt new file mode 100644 index 000000000..4062f6905 --- /dev/null +++ b/code/nel/tools/3d/s3tc_compressor_lib/CMakeLists.txt @@ -0,0 +1,16 @@ +FILE(GLOB SRC *.cpp) +FILE(GLOB HEADER *.h) + +INCLUDE_DIRECTORIES(${SQUISH_INCLUDE_DIR}) + +NL_TARGET_LIB(s3tc_compressor ${SRC} ${HEADER}) + +TARGET_LINK_LIBRARIES(s3tc_compressor ${SQUISH_LIBRARIES} nelmisc nel3d) +NL_DEFAULT_PROPS(s3tc_compressor "NeL, Tools, 3D: S3TC Compressor Library") +NL_ADD_RUNTIME_FLAGS(s3tc_compressor) + +ADD_DEFINITIONS(${SQUISH_DEFINITIONS}) + +IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) + INSTALL(TARGETS s3tc_compressor LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT tools3d) +ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) diff --git a/code/nel/tools/3d/s3tc_compressor_lib/s3tc_compressor.cpp b/code/nel/tools/3d/s3tc_compressor_lib/s3tc_compressor.cpp index f714dcd6d..0d2ea6a7e 100644 --- a/code/nel/tools/3d/s3tc_compressor_lib/s3tc_compressor.cpp +++ b/code/nel/tools/3d/s3tc_compressor_lib/s3tc_compressor.cpp @@ -60,9 +60,16 @@ static void compressMipMap(uint8 *pixSrc, sint width, sint height, vector +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +using namespace NLMISC; +using namespace NL3D; +using namespace std; + +struct CVertex +{ + CVector vertex; + CVector normal; + CUV uv; +}; + +bool operator == (const CVertex &v1, const CVertex &v2) +{ + return (v1.vertex == v2.vertex) && (v1.normal == v2.normal) && (v1.uv == v2.uv); +} + +bool operator < (const CVertex &v1, const CVertex &v2) +{ + return (v1.vertex < v2.vertex); +} + +const CIndexBuffer *getRdrPassPrimitiveBlock(const CMeshMRMGeom *mesh, uint lodId, uint renderPass) +{ + return &(mesh->getRdrPassPrimitiveBlock(lodId, renderPass)); +} + +// *************************************************************************** + +const CIndexBuffer *getRdrPassPrimitiveBlock(const CMeshMRMSkinnedGeom *mesh, uint lodId, uint renderPass) +{ + static CIndexBuffer block; + mesh->getRdrPassPrimitiveBlock(lodId, renderPass, block); + return █ +} + +// *************************************************************************** + +bool ProcessMeshMRMSkinned(const std::string &filename, IShape *shapeMesh); +bool ProcessMeshMRM(const std::string &filename, IShape *shapeMesh); +bool ProcessMesh(const std::string &filename, IShape *shapeMesh); + +int main(int argc, char* argv[]) +{ + if (argc < 2) + { + cout << "Syntax : shape2obj " << endl; + + return 1; + } + + if (!NLMISC::INelContext::isContextInitialised()) new NLMISC::CApplicationContext(); + + registerSerial3d(); + CScene::registerBasics(); + + IShape *shapeMesh = NULL; + + CIFile ifile; + + // Sream a shape + CShapeStream streamShape; + + string filename = argv[1]; + + if (!ifile.open(filename)) return 1; + + try + { + // Stream it + streamShape.serial(ifile); + + // Add the shape + shapeMesh = streamShape.getShapePointer(); + } + catch (Exception& e) + { + cout << "Error : " << e.what() << endl; + + return 1; + } + + if (ProcessMeshMRMSkinned(filename, shapeMesh)) return 0; + if (ProcessMeshMRM(filename, shapeMesh)) return 0; + if (ProcessMesh(filename, shapeMesh)) return 0; + + return 0; +} + +bool ProcessMeshMRMSkinned(const std::string &filename, IShape *shapeMesh) +{ + CMeshMRMSkinned *mesh = dynamic_cast(shapeMesh); + + if (!mesh) return false; + + COFile ofile; + + CMeshMRMSkinnedGeom* meshIn = (CMeshMRMSkinnedGeom*)&mesh->getMeshGeom(); + + std::vector skinWeights; + meshIn->getSkinWeights(skinWeights); + CVertexBuffer vertexBuffer; + meshIn->getVertexBuffer(vertexBuffer); + + CVertexBufferRead vba; + vertexBuffer.lock (vba); + uint i, j; + + // **** Select the Lod. + uint numLods= meshIn->getNbLod(); + + // get the max tris displayed + float numMeshFacesMin= (float)meshIn->getLevelDetail().MinFaceUsed; + float numMeshFacesMax= (float)meshIn->getLevelDetail().MaxFaceUsed; + // find the lod + sint lodId = numLods-1; + + // **** First, for the best lod indicate what vertex is used or not. Also index geomorphs to know what real vertex is used + vector vertexUsed; + // -1 means "not used" + vertexUsed.resize(skinWeights.size(), -1); + // Parse all triangles. + for(i=0;igetNbRdrPass(lodId); ++i) + { + const CIndexBuffer *pb = getRdrPassPrimitiveBlock(meshIn, lodId, i); + CIndexBufferRead iba; + pb->lock (iba); + if (iba.getFormat() == CIndexBuffer::Indices32) + { + const uint32 *triPtr= (const uint32 *) iba.getPtr(); + for(j=0;jgetNumIndexes(); ++j) + { + uint idx= *triPtr; + // Flag the vertex with its own index => used. + vertexUsed[idx]= idx; + triPtr++; + } + } + else + { + const uint16 *triPtr= (const uint16 *) iba.getPtr(); + for(j=0;jgetNumIndexes(); ++j) + { + uint idx= *triPtr; + // Flag the vertex with its own index => used. + vertexUsed[idx]= idx; + triPtr++; + } + } + } + // Special for Geomorphs: must take The End target vertex. + const std::vector &geomorphs= meshIn->getGeomorphs(lodId); + for(i=0;i shadowVertices; + vector vertexToVSkin; + vertexToVSkin.resize(vertexUsed.size()); + shadowVertices.reserve(vertexUsed.size()); + // use a map to remove duplicates (because of UV/normal discontinuities before!!) + map shadowVertexMap; + uint numMerged= 0; + // Skip Geomorphs. + for(i=geomorphs.size();imaxW) + { + matId= sw.MatrixId[j]; + maxW= sw.Weights[j]; + } + } +// shadowVert.MatrixId= matId; +*/ + // If dont find the shadowVertex in the map. + map::iterator it= shadowVertexMap.find(shadowVert); + if(it==shadowVertexMap.end()) + { + // Append + uint index= shadowVertices.size(); + vertexToVSkin[i]= index; + shadowVertices.push_back(shadowVert); + shadowVertexMap.insert(make_pair(shadowVert, index)); + } + else + { + // Ok, map. + vertexToVSkin[i]= it->second; + numMerged++; + } + + } + } + + ofstream ofs(string(filename + ".obj").c_str()); + + for(size_t y = 0; y < shadowVertices.size(); ++y) + { + CVector v = shadowVertices[y].vertex; + CVector vn = shadowVertices[y].normal; + CUV vt = shadowVertices[y].uv; + + ofs << "v " << v.x << " " << v.y << " " << v.z << endl; + ofs << "vn " << vn.x << " " << vn.y << " " << vn.z << endl; + ofs << "vt " << vt.U << " " << vt.V << endl; + } + + // **** Get All Faces + // Final List Of Triangles that match the bone. + vector shadowTriangles; + shadowTriangles.reserve(1000); + // Parse all input tri of the mesh. + for(i=0; igetNbRdrPass(lodId); ++i) + { + ofs << "g pass" << i << endl; + + const CIndexBuffer *pb = getRdrPassPrimitiveBlock(meshIn, lodId, i); + CIndexBufferRead iba; + pb->lock (iba); + if (iba.getFormat() == CIndexBuffer::Indices32) + { + const uint32 *triPtr= (const uint32 *) iba.getPtr(); + + for(j=0; jgetNumIndexes(); ++j) + { + uint idx= *triPtr; + // Get the real Vertex (ie not the geomporhed one). + idx= vertexUsed[idx]; + // Get the ShadowVertex associated + idx= vertexToVSkin[idx]; + + shadowTriangles.push_back(idx); + triPtr++; + } + } + else + { + const uint16 *triPtr= (const uint16 *) iba.getPtr(); + for(j=0; jgetNumIndexes(); ++j) + { + uint idx= *triPtr; + // Get the real Vertex (ie not the geomporhed one). + idx= vertexUsed[idx]; + // Get the ShadowVertex associated + idx= vertexToVSkin[idx]; + + shadowTriangles.push_back(idx); + triPtr++; + } + } + + for(size_t pass = 0; pass(shapeMesh); + + if (!mesh) return false; + + COFile ofile; + + CMeshMRMGeom* meshIn = (CMeshMRMGeom*)&mesh->getMeshGeom(); + + std::vector skinWeights = meshIn->getSkinWeights(); + CVertexBuffer vertexBuffer = meshIn->getVertexBuffer(); + + CVertexBufferRead vba; + vertexBuffer.lock (vba); + uint i, j; + + // **** Select the Lod. + uint numLods= meshIn->getNbLod(); + + // get the max tris displayed + float numMeshFacesMin= (float)meshIn->getLevelDetail().MinFaceUsed; + float numMeshFacesMax= (float)meshIn->getLevelDetail().MaxFaceUsed; + // find the lod + sint lodId = numLods-1; + + // **** First, for the best lod indicate what vertex is used or not. Also index geomorphs to know what real vertex is used + vector vertexUsed; + // -1 means "not used" + vertexUsed.resize(skinWeights.size(), -1); + // Parse all triangles. + for(i=0;igetNbRdrPass(lodId); ++i) + { + const CIndexBuffer *pb = getRdrPassPrimitiveBlock(meshIn, lodId, i); + CIndexBufferRead iba; + pb->lock (iba); + if (iba.getFormat() == CIndexBuffer::Indices32) + { + const uint32 *triPtr= (const uint32 *) iba.getPtr(); + for(j=0;jgetNumIndexes(); ++j) + { + uint idx= *triPtr; + // Flag the vertex with its own index => used. + vertexUsed[idx]= idx; + triPtr++; + } + } + else + { + const uint16 *triPtr= (const uint16 *) iba.getPtr(); + for(j=0;jgetNumIndexes(); ++j) + { + uint idx= *triPtr; + // Flag the vertex with its own index => used. + vertexUsed[idx]= idx; + triPtr++; + } + } + } + // Special for Geomorphs: must take The End target vertex. + const std::vector &geomorphs= meshIn->getGeomorphs(lodId); + for(i=0;i shadowVertices; + vector vertexToVSkin; + vertexToVSkin.resize(vertexUsed.size()); + shadowVertices.reserve(vertexUsed.size()); + // use a map to remove duplicates (because of UV/normal discontinuities before!!) + map shadowVertexMap; + uint numMerged= 0; + // Skip Geomorphs. + for(i=geomorphs.size();imaxW) + { + matId= sw.MatrixId[j]; + maxW= sw.Weights[j]; + } + } +// shadowVert.MatrixId= matId; +*/ + // If dont find the shadowVertex in the map. + map::iterator it= shadowVertexMap.find(shadowVert); + if(it==shadowVertexMap.end()) + { + // Append + uint index= shadowVertices.size(); + vertexToVSkin[i]= index; + shadowVertices.push_back(shadowVert); + shadowVertexMap.insert(make_pair(shadowVert, index)); + } + else + { + // Ok, map. + vertexToVSkin[i]= it->second; + numMerged++; + } + + } + } + + ofstream ofs(string(filename + ".obj").c_str()); + + for(size_t y = 0; y < shadowVertices.size(); ++y) + { + CVector v = shadowVertices[y].vertex; + CVector vn = shadowVertices[y].normal; + CUV vt = shadowVertices[y].uv; + + ofs << "v " << v.x << " " << v.y << " " << v.z << endl; + ofs << "vn " << vn.x << " " << vn.y << " " << vn.z << endl; + ofs << "vt " << vt.U << " " << vt.V << endl; + } + + // **** Get All Faces + // Final List Of Triangles that match the bone. + vector shadowTriangles; + shadowTriangles.reserve(1000); + // Parse all input tri of the mesh. + for(i=0; igetNbRdrPass(lodId); ++i) + { + ofs << "g pass" << i << endl; + + const CIndexBuffer *pb = getRdrPassPrimitiveBlock(meshIn, lodId, i); + CIndexBufferRead iba; + pb->lock (iba); + if (iba.getFormat() == CIndexBuffer::Indices32) + { + const uint32 *triPtr= (const uint32 *) iba.getPtr(); + + for(j=0; jgetNumIndexes(); ++j) + { + uint idx= *triPtr; + // Get the real Vertex (ie not the geomporhed one). + idx= vertexUsed[idx]; + // Get the ShadowVertex associated + idx= vertexToVSkin[idx]; + + shadowTriangles.push_back(idx); + triPtr++; + } + } + else + { + const uint16 *triPtr= (const uint16 *) iba.getPtr(); + for(j=0; jgetNumIndexes(); ++j) + { + uint idx= *triPtr; + // Get the real Vertex (ie not the geomporhed one). + idx= vertexUsed[idx]; + // Get the ShadowVertex associated + idx= vertexToVSkin[idx]; + + shadowTriangles.push_back(idx); + triPtr++; + } + } + + for(size_t pass = 0; pass(shapeMesh); + + if (!mesh) return false; + + COFile ofile; + + CMeshGeom* meshIn = (CMeshGeom*)&mesh->getMeshGeom(); + + CVertexBuffer vertexBuffer = meshIn->getVertexBuffer(); + +// CVertexBufferRead vba; +// vertexBuffer.lock (vba); + + uint i = vertexBuffer.getNumVertices(); + + std::vector vertices; + meshIn->retrieveVertices(vertices); + + std::vector indices; + meshIn->retrieveTriangles(indices); + + + // **** For all vertices used (not geomorphs), compute vertex Skins. + vector shadowVertices; + vector vertexToVSkin; + vertexToVSkin.resize(indices.size()); + shadowVertices.reserve(indices.size()); + // use a map to remove duplicates (because of UV/normal discontinuities before!!) + map shadowVertexMap; + uint numMerged= 0; + // Skip Geomorphs. + for(i=0;imaxW) + { + matId= sw.MatrixId[j]; + maxW= sw.Weights[j]; + } + } + + // If dont find the shadowVertex in the map. + map::iterator it= shadowVertexMap.find(shadowVert); + if(it==shadowVertexMap.end()) + { + // Append + uint index= shadowVertices.size(); + vertexToVSkin[i]= index; + shadowVertices.push_back(shadowVert); + shadowVertexMap.insert(make_pair(shadowVert, index)); + } + else + { + // Ok, map. + vertexToVSkin[i]= it->second; + numMerged++; + } + } + + ofstream ofs(string(filename + ".obj").c_str()); + + for(size_t y = 0; y < shadowVertices.size(); ++y) + { + CVector v = shadowVertices[y].vertex; + CVector vn = shadowVertices[y].normal; + CUV vt = shadowVertices[y].uv; + + ofs << "v " << v.x << " " << v.y << " " << v.z << endl; + ofs << "vn " << vn.x << " " << vn.y << " " << vn.z << endl; + ofs << "vt " << vt.U << " " << vt.V << endl; + } + + // **** Get All Faces + // Final List Of Triangles that match the bone. + vector shadowTriangles; + shadowTriangles.reserve(1000); + // Parse all input tri of the mesh. + for(i=0; igetNbRdrPass(lodId); ++i) + { + ofs << "g pass" << i << endl; + + const CIndexBuffer *pb = getRdrPassPrimitiveBlock(meshIn, lodId, i); + CIndexBufferRead iba; + pb->lock (iba); + if (iba.getFormat() == CIndexBuffer::Indices32) + { + const uint32 *triPtr= (const uint32 *) iba.getPtr(); + + for(j=0; jgetNumIndexes(); ++j) + { + uint idx= *triPtr; + // Get the real Vertex (ie not the geomporhed one). + idx= vertexUsed[idx]; + // Get the ShadowVertex associated + idx= vertexToVSkin[idx]; + + shadowTriangles.push_back(idx); + triPtr++; + } + } + else + { + const uint16 *triPtr= (const uint16 *) iba.getPtr(); + for(j=0; jgetNumIndexes(); ++j) + { + uint idx= *triPtr; + // Get the real Vertex (ie not the geomporhed one). + idx= vertexUsed[idx]; + // Get the ShadowVertex associated + idx= vertexToVSkin[idx]; + + shadowTriangles.push_back(idx); + triPtr++; + } + } + + for(size_t pass = 0; passclearTile128 (index, bitmap, tileBankBrowser); } @@ -622,6 +630,8 @@ void TileList::clearTile256 (int index, CTile::TBitmap bitmap) case CTile::alpha: nlassert(0); break; + default: + break; } tileBankBrowser.getTileSet (_tileSet)->clearTile256 (index, bitmap, tileBankBrowser); } @@ -642,6 +652,8 @@ void TileList::clearTransition (int index, CTile::TBitmap bitmap) theListTransition[index].alphaLoaded=0; theListTransition[index].alphaBits.resize(0); break; + default: + break; } tileBankBrowser.getTileSet (_tileSet)->clearTransition ((CTileSet::TTransition)index, bitmap, tileBankBrowser); } @@ -660,6 +672,8 @@ void TileList::clearDisplacement (int index, CTile::TBitmap bitmap) case CTile::alpha: nlassert(0); break; + default: + break; } tileBankBrowser.getTileSet (_tileSet)->clearDisplacement ((CTileSet::TDisplacement)index, tileBankBrowser); @@ -717,7 +731,8 @@ void TileList::Reload(int first, int last, TileType n) //recharge en memoire une theList[n][i].Load (index, NULL); break; } - + default: + break; } } } diff --git a/code/nel/tools/3d/tile_edit_qt/pic/PIC_System.c b/code/nel/tools/3d/tile_edit_qt/pic/PIC_System.c index 4e97fed78..498e5d302 100644 --- a/code/nel/tools/3d/tile_edit_qt/pic/PIC_System.c +++ b/code/nel/tools/3d/tile_edit_qt/pic/PIC_System.c @@ -8,8 +8,8 @@ #define PIC_ERRSIZE 256 -static unsigned long PIC_Sys_MEM_Allocated; -static unsigned long PIC_Sys_MEM_NbAllocs; +static size_t PIC_Sys_MEM_Allocated; +static size_t PIC_Sys_MEM_NbAllocs; #if defined(__APPLE__) #define _msize malloc_size @@ -31,7 +31,7 @@ void *Pic_malloc(unsigned long size) return(mem); } /* ----- */ -void *Pic_calloc(unsigned long count, unsigned long size) +void *Pic_calloc(size_t count, size_t size) { void *mem; mem=calloc(count,size); @@ -45,24 +45,24 @@ void *Pic_calloc(unsigned long count, unsigned long size) /* ----- */ void Pic_free(void *memblock) { - unsigned long size; + size_t size; size=_msize(memblock); PIC_Sys_MEM_Allocated-=size; PIC_Sys_MEM_NbAllocs--; free(memblock); } /* ----- */ -unsigned long Pic__msize(void *memblock) +size_t Pic__msize(void *memblock) { return(_msize(memblock)); } /* ----- */ -unsigned long PIC_GetMemNbAllocs(void) +size_t PIC_GetMemNbAllocs(void) { return(PIC_Sys_MEM_NbAllocs); } /* ----- */ -unsigned long PIC_GetMemAllocated(void) +size_t PIC_GetMemAllocated(void) { return(PIC_Sys_MEM_Allocated); } @@ -74,7 +74,7 @@ static unsigned char PIC_ErrorString[PIC_ERRSIZE]; static unsigned char PIC_Sys_FnctActive=0; static void (*PIC_Sys_Fnct)(void); -void Pic_SetError(unsigned char *msg, ...) +void Pic_SetError(const char *msg, ...) { unsigned char curerr[PIC_ERRSIZE],olderr[PIC_ERRSIZE]; va_list args; diff --git a/code/nel/tools/3d/tile_edit_qt/pic/Pic_BMP.c b/code/nel/tools/3d/tile_edit_qt/pic/Pic_BMP.c index 332ee1b0d..1119766da 100644 --- a/code/nel/tools/3d/tile_edit_qt/pic/Pic_BMP.c +++ b/code/nel/tools/3d/tile_edit_qt/pic/Pic_BMP.c @@ -31,7 +31,7 @@ typedef struct BMP_HEADER /* ---------------------------------------------------------------------------------------------------------------------------------- */ -unsigned long Pic_BMP_Write( unsigned char *FileName, +unsigned long Pic_BMP_Write( const char *FileName, unsigned char *pPal,unsigned char *pDatas, unsigned long w, unsigned long h, unsigned long d) @@ -117,7 +117,7 @@ unsigned long Pic_BMP_Write( unsigned char *FileName, /* ---------------------------------------------------------------------------------------------------------------------------------- */ -unsigned long Pic_BMP_Read( unsigned char *FileName, +unsigned long Pic_BMP_Read( const char *FileName, unsigned char **ppPal, unsigned char **ppDatas, unsigned long *pWidth, unsigned long *pHeight, unsigned long *pDepth) diff --git a/code/nel/tools/3d/tile_edit_qt/pic/Pic_JPG.c b/code/nel/tools/3d/tile_edit_qt/pic/Pic_JPG.c index f13f93b13..dc22afadf 100644 --- a/code/nel/tools/3d/tile_edit_qt/pic/Pic_JPG.c +++ b/code/nel/tools/3d/tile_edit_qt/pic/Pic_JPG.c @@ -31,7 +31,7 @@ void my_error_exit(j_common_ptr cinfo) /* ---------------------------------------------------------------------------------------------------------------------------------- */ -unsigned long Pic_JPG_Read(unsigned char *FileName, unsigned char **ppPal, unsigned char **ppDatas, unsigned long *w, unsigned long *h) +unsigned long Pic_JPG_Read(const char *FileName, unsigned char **ppPal, unsigned char **ppDatas, unsigned long *w, unsigned long *h) { struct jpeg_decompress_struct cinfo; struct my_error_mgr jerr; @@ -114,7 +114,7 @@ unsigned long Pic_JPG_Read(unsigned char *FileName, unsigned char **ppPal, unsig /* ---------------------------------------------------------------------------------------------------------------------------------- */ -unsigned long Pic_JPG_Write(unsigned char *FileName, unsigned long Qual, unsigned char *pDatas, unsigned long w, unsigned long h) +unsigned long Pic_JPG_Write(const char *FileName, unsigned long Qual, unsigned char *pDatas, unsigned long w, unsigned long h) { struct jpeg_compress_struct cinfo; struct my_error_mgr jerr; diff --git a/code/nel/tools/3d/tile_edit_qt/pic/Pic_Manage.c b/code/nel/tools/3d/tile_edit_qt/pic/Pic_Manage.c index 6efaf0f03..ccc8cdc12 100644 --- a/code/nel/tools/3d/tile_edit_qt/pic/Pic_Manage.c +++ b/code/nel/tools/3d/tile_edit_qt/pic/Pic_Manage.c @@ -504,7 +504,7 @@ static char* ConvPic(PIC_PICTURE *pic, unsigned long type, char* pErr) /* ---------------------------------------- */ -unsigned long PIC_Save(unsigned long id, char* FileName, unsigned long type, unsigned long qual) +unsigned long PIC_Save(unsigned long id, const char* FileName, unsigned long type, unsigned long qual) { PIC_PICTURE *pic; unsigned char err; diff --git a/code/nel/tools/3d/tile_edit_qt/pic/Pic_TGA.c b/code/nel/tools/3d/tile_edit_qt/pic/Pic_TGA.c index 5f598d4eb..4c458dc83 100644 --- a/code/nel/tools/3d/tile_edit_qt/pic/Pic_TGA.c +++ b/code/nel/tools/3d/tile_edit_qt/pic/Pic_TGA.c @@ -27,7 +27,7 @@ typedef struct TGA_HEADER /* ---------------------------------------------------------------------------------------------------------------------------------- */ -unsigned long Pic_TGA_Read( unsigned char *FileName, +unsigned long Pic_TGA_Read( const char *FileName, unsigned char **ppPal, unsigned char **ppDatas, unsigned long *pWidth, unsigned long *pHeight, unsigned long *pDepth) @@ -140,7 +140,7 @@ unsigned long Pic_TGA_Read( unsigned char *FileName, /* ---------------------------------------------------------------------------------------------------------------------------------- */ -unsigned long Pic_TGA_Write( unsigned char *FileName, +unsigned long Pic_TGA_Write( const char *FileName, unsigned char *pPal,unsigned char *pDatas, unsigned long w, unsigned long h, unsigned long d) { diff --git a/code/nel/tools/3d/tile_edit_qt/pic/pic.h b/code/nel/tools/3d/tile_edit_qt/pic/pic.h index 761073552..cec5a0ff0 100644 --- a/code/nel/tools/3d/tile_edit_qt/pic/pic.h +++ b/code/nel/tools/3d/tile_edit_qt/pic/pic.h @@ -22,7 +22,7 @@ extern unsigned long PIC_Load(char* FileName, unsigned char Quantize); extern unsigned long PIC_Create(unsigned char* pPal, unsigned char* pDatas, unsigned long w, unsigned long h, unsigned long d); -extern unsigned long PIC_Save(unsigned long id, char* FileName, unsigned long type, unsigned long qual); +extern unsigned long PIC_Save(unsigned long id, const char* FileName, unsigned long type, unsigned long qual); extern unsigned long PIC_GetInfos( unsigned long id, unsigned char* *ppPal, unsigned char* *ppDatas, diff --git a/code/nel/tools/3d/tile_edit_qt/pic/pic_private.h b/code/nel/tools/3d/tile_edit_qt/pic/pic_private.h index 2ecd984b7..96b7a0e94 100644 --- a/code/nel/tools/3d/tile_edit_qt/pic/pic_private.h +++ b/code/nel/tools/3d/tile_edit_qt/pic/pic_private.h @@ -1,71 +1,71 @@ -#ifndef _PIC_PRIVATE_H_ -#define _PIC_PRIVATE_H_ -#ifdef __cplusplus -extern "C" { -#endif - -/* ---------------------------------------------------------------------------------------------------------------------------------- */ - -typedef struct PIC_PICTURE -{ - unsigned long ID; - unsigned long Width; - unsigned long Height; - unsigned long Depth; - unsigned char *pDatas; - unsigned char *pPal; - struct PIC_PICTURE *Next; -} PIC_PICTURE; - -/* ---------------------------------------------------------------------------------------------------------------------------------- */ - - -/* - * JPG - */ - - -extern unsigned long Pic_JPG_Read( unsigned char *FileName, - unsigned char **ppPal, unsigned char **ppDatas, - unsigned long *w, unsigned long *h); - -extern unsigned long Pic_JPG_Write( unsigned char *FileName, - unsigned long Qual, - unsigned char *pDatas, - unsigned long w, unsigned long h); -/* - * TGA - */ -extern unsigned long Pic_TGA_Read( unsigned char *FileName, - unsigned char **ppPal, unsigned char **ppDatas, - unsigned long *pWidth, unsigned long *pHeight, - unsigned long *pDepth); -extern unsigned long Pic_TGA_Write( unsigned char *FileName, - unsigned char *pPal,unsigned char *pDatas, - unsigned long w, unsigned long h, unsigned long d); -/* - * BMP - */ -extern unsigned long Pic_BMP_Read( unsigned char *FileName, - unsigned char **ppPal, unsigned char **ppDatas, - unsigned long *pWidth, unsigned long *pHeight, - unsigned long *pDepth); - -extern unsigned long Pic_BMP_Write( unsigned char *FileName, - unsigned char *pPal,unsigned char *pDatas, - unsigned long w, unsigned long h, unsigned long d); -/* - * System - */ -extern void* Pic_malloc(unsigned long size); -extern void* Pic_calloc(unsigned long count, unsigned long size); -extern void Pic_free(void *memblock); -extern unsigned long Pic__msize(void *memblock); -extern void Pic_SetError(unsigned char *msg, ...); - -/* ---------------------------------------------------------------------------------------------------------------------------------- */ - -#ifdef __cplusplus -} -#endif +#ifndef _PIC_PRIVATE_H_ +#define _PIC_PRIVATE_H_ +#ifdef __cplusplus +extern "C" { +#endif + +/* ---------------------------------------------------------------------------------------------------------------------------------- */ + +typedef struct PIC_PICTURE +{ + unsigned long ID; + unsigned long Width; + unsigned long Height; + unsigned long Depth; + unsigned char *pDatas; + unsigned char *pPal; + struct PIC_PICTURE *Next; +} PIC_PICTURE; + +/* ---------------------------------------------------------------------------------------------------------------------------------- */ + + +/* + * JPG + */ + + +extern unsigned long Pic_JPG_Read( const char *FileName, + unsigned char **ppPal, unsigned char **ppDatas, + unsigned long *w, unsigned long *h); + +extern unsigned long Pic_JPG_Write( const char *FileName, + unsigned long Qual, + unsigned char *pDatas, + unsigned long w, unsigned long h); +/* + * TGA + */ +extern unsigned long Pic_TGA_Read( const char *FileName, + unsigned char **ppPal, unsigned char **ppDatas, + unsigned long *pWidth, unsigned long *pHeight, + unsigned long *pDepth); +extern unsigned long Pic_TGA_Write( const char *FileName, + unsigned char *pPal,unsigned char *pDatas, + unsigned long w, unsigned long h, unsigned long d); +/* + * BMP + */ +extern unsigned long Pic_BMP_Read( const char *FileName, + unsigned char **ppPal, unsigned char **ppDatas, + unsigned long *pWidth, unsigned long *pHeight, + unsigned long *pDepth); + +extern unsigned long Pic_BMP_Write( const char *FileName, + unsigned char *pPal,unsigned char *pDatas, + unsigned long w, unsigned long h, unsigned long d); +/* + * System + */ +extern void* Pic_malloc(size_t size); +extern void* Pic_calloc(size_t count, size_t size); +extern void Pic_free(void *memblock); +extern size_t Pic__msize(void *memblock); +extern void Pic_SetError(const char *msg, ...); + +/* ---------------------------------------------------------------------------------------------------------------------------------- */ + +#ifdef __cplusplus +} +#endif #endif diff --git a/code/nel/tools/3d/tile_edit_qt/tile_browser_dlg.cpp b/code/nel/tools/3d/tile_edit_qt/tile_browser_dlg.cpp index 8c9dc7598..037ac65e8 100644 --- a/code/nel/tools/3d/tile_edit_qt/tile_browser_dlg.cpp +++ b/code/nel/tools/3d/tile_edit_qt/tile_browser_dlg.cpp @@ -235,7 +235,7 @@ void CTile_browser_dlg::on_actionAddTile_triggered(bool checked) { tileId = browserModel.addTile128 (); fileName = QDir::toNativeSeparators(fileNames.at(i)); - if ( ! browserModel.setTile128 ( tileId, fileName.toStdString(), (CTile::TBitmap) tileTextureButtonGroup->checkedId()) ) + if ( ! browserModel.setTile128 ( tileId, fileName.toUtf8().constData(), (CTile::TBitmap) tileTextureButtonGroup->checkedId()) ) { browserModel.removeTile128 (tileId); break; @@ -247,7 +247,7 @@ void CTile_browser_dlg::on_actionAddTile_triggered(bool checked) { tileId = browserModel.addTile256 (); fileName = QDir::toNativeSeparators(fileNames.at(i)); - if ( ! browserModel.setTile256 ( tileId, fileName.toStdString(), (CTile::TBitmap) tileTextureButtonGroup->checkedId()) ) + if ( ! browserModel.setTile256 ( tileId, fileName.toUtf8().constData(), (CTile::TBitmap) tileTextureButtonGroup->checkedId()) ) { browserModel.removeTile256 (tileId); break; @@ -307,7 +307,7 @@ void CTile_browser_dlg::on_actionReplaceImage_triggered(bool checked) { int tileId = (ui.tileBrowserListView->selectionModel()->selectedRows().at(i).data(Qt::UserRole + 1)).toInt(); - if ( ! browserModel.setTile128 ( tileId, fileName.toStdString(), (CTile::TBitmap) tileTextureButtonGroup->checkedId()) ) + if ( ! browserModel.setTile128 ( tileId, fileName.toUtf8().constData(), (CTile::TBitmap) tileTextureButtonGroup->checkedId()) ) break; } break; @@ -315,7 +315,7 @@ void CTile_browser_dlg::on_actionReplaceImage_triggered(bool checked) for (int i=0; iselectionModel()->selectedRows().count(); i++) { int tileId = (ui.tileBrowserListView->selectionModel()->selectedRows().at(i).data(Qt::UserRole + 1)).toInt(); - if ( ! browserModel.setTile256 (tileId, fileName.toStdString(), (CTile::TBitmap) tileTextureButtonGroup->checkedId()) ) + if ( ! browserModel.setTile256 (tileId, fileName.toUtf8().constData(), (CTile::TBitmap) tileTextureButtonGroup->checkedId()) ) break; } break; @@ -325,7 +325,7 @@ void CTile_browser_dlg::on_actionReplaceImage_triggered(bool checked) int tileId = (ui.tileBrowserListView->selectionModel()->selectedRows().at(i).data(Qt::UserRole + 1)).toInt(); if ( tileTextureButtonGroup->checkedId() != Alpha ) { - if ( ! browserModel.setTileTransition (tileId, fileName.toStdString(), (CTile::TBitmap) tileTextureButtonGroup->checkedId()) ) + if ( ! browserModel.setTileTransition (tileId, fileName.toUtf8().constData(), (CTile::TBitmap) tileTextureButtonGroup->checkedId()) ) break; } else @@ -334,7 +334,7 @@ void CTile_browser_dlg::on_actionReplaceImage_triggered(bool checked) int rot = CTile_rotation_dlg::getRotation(this, &rotationOk); if (rotationOk) { - if ( ! browserModel.setTileTransitionAlpha (tileId, fileName.toStdString(), rot) ) + if ( ! browserModel.setTileTransitionAlpha (tileId, fileName.toUtf8().constData(), rot) ) break; } } @@ -344,7 +344,7 @@ void CTile_browser_dlg::on_actionReplaceImage_triggered(bool checked) for (int i=0; iselectionModel()->selectedRows().count(); i++) { int tileId = (ui.tileBrowserListView->selectionModel()->selectedRows().at(i).data(Qt::UserRole + 1)).toInt(); - if ( ! browserModel.setDisplacement (tileId, fileName.toStdString(), (CTile::TBitmap) tileTextureButtonGroup->checkedId()) ) + if ( ! browserModel.setDisplacement (tileId, fileName.toUtf8().constData(), (CTile::TBitmap) tileTextureButtonGroup->checkedId()) ) break; } break; @@ -444,13 +444,13 @@ void CTile_browser_dlg::on_batchLoadPushButton_clicked() QString batchNumber = transitionNumber.rightJustified(2, '0'); QString nextBaseName = baseName + batchNumber; QString nextFileName = QDir::toNativeSeparators(fi.absolutePath()) + QDir::separator() + nextBaseName + QString(".") + fi.suffix(); - FILE *pFile=fopen (nextFileName.toStdString().c_str(), "rb"); + FILE *pFile=fopen (nextFileName.toUtf8().constData(), "rb"); // Close the file and add the tile if opened if (pFile) { fclose (pFile); - ok=browserModel.setTileTransitionAlpha (i, nextFileName.toStdString().c_str(), (4-rot)%4); + ok=browserModel.setTileTransitionAlpha (i, nextFileName.toUtf8().constData(), (4-rot)%4); // End break; @@ -545,7 +545,7 @@ void CTile_browser_dlg::on_exportBorderPushButton_clicked() try { COFile file; - if (file.open (fileName.toStdString().c_str())) + if (file.open (fileName.toUtf8().constData())) { // Export bitmap.writeTGA (file, 32); @@ -594,7 +594,7 @@ void CTile_browser_dlg::on_importBorderPushButton_clicked() try { CIFile file; - if (file.open (fileName.toStdString().c_str())) + if (file.open (fileName.toUtf8().constData())) { // Export bitmap.load (file); diff --git a/code/nel/tools/3d/tile_edit_qt/tile_edit_dlg.cpp b/code/nel/tools/3d/tile_edit_qt/tile_edit_dlg.cpp index 1fdcb1aea..595067cd2 100644 --- a/code/nel/tools/3d/tile_edit_qt/tile_edit_dlg.cpp +++ b/code/nel/tools/3d/tile_edit_qt/tile_edit_dlg.cpp @@ -103,7 +103,7 @@ void CTile_edit_dlg::on_addLandPushButton_clicked() } else { - tileBank.addLand( text.toStdString() ); + tileBank.addLand( text.toUtf8().constData() ); ui.landListWidget->addItem(text); ui.landListWidget->setCurrentRow(ui.landListWidget->count() - 1); @@ -138,7 +138,7 @@ void CTile_edit_dlg::on_editLandPushButton_clicked() for (int i=0; iaddTileSet( rString.toStdString().c_str() ); + tileBank.getLand(nindex)->addTileSet( rString.toUtf8().constData() ); } } } @@ -176,7 +176,7 @@ void CTile_edit_dlg::on_addTileSetPushButton_clicked() } else { - tileBank.addTileSet( text.toStdString() ); + tileBank.addTileSet( text.toUtf8().constData() ); ui.tileSetListWidget->addItem(text); ui.tileSetListWidget->setCurrentRow(ui.tileSetListWidget->count() - 1); @@ -239,7 +239,7 @@ void CTile_edit_dlg::on_chooseVegetPushButton_clicked() if (!fileName.isEmpty()) { QFileInfo fi(fileName); - tileBank.getTileSet (nindex)->setTileVegetableDescFileName (fi.fileName().toStdString()); + tileBank.getTileSet (nindex)->setTileVegetableDescFileName (fi.fileName().toUtf8().constData()); ui.chooseVegetPushButton->setText(fi.fileName()); } } @@ -347,7 +347,7 @@ void CTile_edit_dlg::on_loadPushButton_clicked() if (!fileName.isEmpty()) { CIFile stream; - if ( stream.open( fileName.toStdString().c_str() ) ) + if ( stream.open( fileName.toUtf8().constData() ) ) { ui.landListWidget->clear(); ui.tileSetListWidget->clear(); @@ -383,7 +383,7 @@ void CTile_edit_dlg::on_loadPushButton_clicked() void CTile_edit_dlg::on_savePushButton_clicked() { - string fullPath = this->mainFile.absoluteFilePath().toStdString(); + string fullPath = this->mainFile.absoluteFilePath().toUtf8().constData(); if ( !fullPath.empty() ) { COFile stream; @@ -411,7 +411,7 @@ void CTile_edit_dlg::on_saveAsPushButton_clicked() ui.savePushButton->setEnabled(true); - string fullPath = this->mainFile.absoluteFilePath().toStdString(); + string fullPath = this->mainFile.absoluteFilePath().toUtf8().constData(); if ( !fullPath.empty() ) { COFile stream; @@ -445,7 +445,7 @@ void CTile_edit_dlg::on_exportPushButton_clicked() copy.cleanUnusedData (); QFileInfo fileInfo(fileName); - string fullPath = fileInfo.absoluteFilePath().toStdString(); + string fullPath = fileInfo.absoluteFilePath().toUtf8().constData(); if ( !fullPath.empty() ) { COFile stream; @@ -524,7 +524,7 @@ void CTile_edit_dlg::on_absolutePathPushButton_clicked() if (bitmapPath!="") { // Check the path - if ( CheckPath( bitmapPath, path.toStdString().c_str() ) == false ) + if ( CheckPath( bitmapPath, path.toUtf8() ) == false ) { // Bad path goodPath=false; @@ -552,7 +552,7 @@ void CTile_edit_dlg::on_absolutePathPushButton_clicked() if (strcmp (bitmapPath, "")!=0) { // Check the path - if (CheckPath( bitmapPath, path.toStdString().c_str() )==false) + if (CheckPath( bitmapPath, path.toUtf8() )==false) { // Bad path goodPath=false; @@ -593,7 +593,7 @@ void CTile_edit_dlg::on_absolutePathPushButton_clicked() if (bitmapPath!="") { // Remove the absolute path - bool res=RemovePath (bitmapPath, path.toStdString().c_str()); + bool res=RemovePath (bitmapPath, path.toUtf8()); nlassert (res); // Set the bitmap @@ -613,7 +613,7 @@ void CTile_edit_dlg::on_absolutePathPushButton_clicked() if (bitmapPath!="") { // Remove the absolute path - bool res=RemovePath (bitmapPath, path.toStdString().c_str()); + bool res=RemovePath (bitmapPath, path.toUtf8()); nlassert (res); // Set the bitmap @@ -633,7 +633,7 @@ void CTile_edit_dlg::on_absolutePathPushButton_clicked() if (goodPath) { // Change the abs path of the bank - tileBank.setAbsPath (path.toStdString()); + tileBank.setAbsPath (path.toUtf8().constData()); // Change the bouton text ui.absolutePathPushButton->setText(path); diff --git a/code/nel/tools/3d/zone_check_bind/CMakeLists.txt b/code/nel/tools/3d/zone_check_bind/CMakeLists.txt index b0b059341..212f7e18b 100644 --- a/code/nel/tools/3d/zone_check_bind/CMakeLists.txt +++ b/code/nel/tools/3d/zone_check_bind/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(zone_check_bind nel3d nelmisc) NL_DEFAULT_PROPS(zone_check_bind "NeL, Tools, 3D: zone_check_bind") NL_ADD_RUNTIME_FLAGS(zone_check_bind) -INSTALL(TARGETS zone_check_bind RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS zone_check_bind RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/zone_dependencies/CMakeLists.txt b/code/nel/tools/3d/zone_dependencies/CMakeLists.txt index f841a30c0..9efb49f0e 100644 --- a/code/nel/tools/3d/zone_dependencies/CMakeLists.txt +++ b/code/nel/tools/3d/zone_dependencies/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(zone_dependencies nel3d nelgeorges nelmisc) NL_DEFAULT_PROPS(zone_dependencies "NeL, Tools, 3D: zone_dependencies") NL_ADD_RUNTIME_FLAGS(zone_dependencies) -INSTALL(TARGETS zone_dependencies RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS zone_dependencies RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/zone_dump/CMakeLists.txt b/code/nel/tools/3d/zone_dump/CMakeLists.txt index e9f162fb3..8bc10b811 100644 --- a/code/nel/tools/3d/zone_dump/CMakeLists.txt +++ b/code/nel/tools/3d/zone_dump/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(zone_dump nel3d nelmisc) NL_DEFAULT_PROPS(zone_dump "NeL, Tools, 3D: zone_dump") NL_ADD_RUNTIME_FLAGS(zone_dump) -INSTALL(TARGETS zone_dump RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS zone_dump RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/zone_ig_lighter/CMakeLists.txt b/code/nel/tools/3d/zone_ig_lighter/CMakeLists.txt index 096469b5e..30f84cea8 100644 --- a/code/nel/tools/3d/zone_ig_lighter/CMakeLists.txt +++ b/code/nel/tools/3d/zone_ig_lighter/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(zone_ig_lighter nelmisc nel3d) NL_DEFAULT_PROPS(zone_ig_lighter "NeL, Tools, 3D: zone_ig_lighter") NL_ADD_RUNTIME_FLAGS(zone_ig_lighter) -INSTALL(TARGETS zone_ig_lighter RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS zone_ig_lighter RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/zone_lighter/CMakeLists.txt b/code/nel/tools/3d/zone_lighter/CMakeLists.txt index 816b8a841..e0c15f9e8 100644 --- a/code/nel/tools/3d/zone_lighter/CMakeLists.txt +++ b/code/nel/tools/3d/zone_lighter/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(zone_lighter nel3d nelgeorges nelmisc) NL_DEFAULT_PROPS(zone_lighter "NeL, Tools, 3D: zone_lighter") NL_ADD_RUNTIME_FLAGS(zone_lighter) -INSTALL(TARGETS zone_lighter RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS zone_lighter RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/zone_welder/CMakeLists.txt b/code/nel/tools/3d/zone_welder/CMakeLists.txt index 2e8acb118..396d22f58 100644 --- a/code/nel/tools/3d/zone_welder/CMakeLists.txt +++ b/code/nel/tools/3d/zone_welder/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(zone_welder nel3d nelmisc) NL_DEFAULT_PROPS(zone_welder "NeL, Tools, 3D: zone_welder") NL_ADD_RUNTIME_FLAGS(zone_welder) -INSTALL(TARGETS zone_welder RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS zone_welder RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/zviewer/CMakeLists.txt b/code/nel/tools/3d/zviewer/CMakeLists.txt index 04d72ff27..a7a5150b7 100644 --- a/code/nel/tools/3d/zviewer/CMakeLists.txt +++ b/code/nel/tools/3d/zviewer/CMakeLists.txt @@ -12,6 +12,6 @@ TARGET_LINK_LIBRARIES(zviewer nelmisc nel3d) NL_DEFAULT_PROPS(zviewer "NeL, Tools, 3D: Zone Viewer") NL_ADD_RUNTIME_FLAGS(zviewer) -INSTALL(TARGETS zviewer RUNTIME DESTINATION bin COMPONENT tools3d) -INSTALL(FILES zviewer.cfg DESTINATION etc/nel COMPONENT tools3d) -INSTALL(FILES readme.txt DESTINATION share/nel/zviewer COMPONENT tools3d) +INSTALL(TARGETS zviewer RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) +INSTALL(FILES zviewer.cfg DESTINATION ${NL_ETC_PREFIX} COMPONENT tools3d) +INSTALL(FILES readme.txt DESTINATION ${NL_SHARE_PREFIX}/zviewer COMPONENT tools3d) diff --git a/code/nel/tools/georges/georges2csv/CMakeLists.txt b/code/nel/tools/georges/georges2csv/CMakeLists.txt index e64d85772..b52de14ea 100644 --- a/code/nel/tools/georges/georges2csv/CMakeLists.txt +++ b/code/nel/tools/georges/georges2csv/CMakeLists.txt @@ -10,4 +10,4 @@ NL_ADD_RUNTIME_FLAGS(georges2csv) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -INSTALL(TARGETS georges2csv RUNTIME DESTINATION bin COMPONENT toolsgeorges) +INSTALL(TARGETS georges2csv RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT toolsgeorges) diff --git a/code/nel/tools/logic/logic_editor_dll/CMakeLists.txt b/code/nel/tools/logic/logic_editor_dll/CMakeLists.txt index c2e0661d1..e538799a0 100644 --- a/code/nel/tools/logic/logic_editor_dll/CMakeLists.txt +++ b/code/nel/tools/logic/logic_editor_dll/CMakeLists.txt @@ -15,4 +15,4 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(logic_editor_dll ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.h ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS logic_editor_dll LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT toolsmisc) +INSTALL(TARGETS logic_editor_dll LIBRARY DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT toolsmisc) diff --git a/code/nel/tools/logic/logic_editor_exe/CMakeLists.txt b/code/nel/tools/logic/logic_editor_exe/CMakeLists.txt index 764a0901e..7a210a71a 100644 --- a/code/nel/tools/logic/logic_editor_exe/CMakeLists.txt +++ b/code/nel/tools/logic/logic_editor_exe/CMakeLists.txt @@ -10,4 +10,4 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(logic_editor ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.h ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS logic_editor RUNTIME DESTINATION bin COMPONENT toolsmisc) +INSTALL(TARGETS logic_editor RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT toolsmisc) diff --git a/code/nel/tools/memory/memlog/CMakeLists.txt b/code/nel/tools/memory/memlog/CMakeLists.txt index 9b471519b..f479a1579 100644 --- a/code/nel/tools/memory/memlog/CMakeLists.txt +++ b/code/nel/tools/memory/memlog/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(memlog nelmisc) NL_DEFAULT_PROPS(memlog "NeL, Tools, Memory: memlog") NL_ADD_RUNTIME_FLAGS(memlog) -INSTALL(TARGETS memlog RUNTIME DESTINATION bin COMPONENT toolsmisc) +INSTALL(TARGETS memlog RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT toolsmisc) diff --git a/code/nel/tools/misc/bnp_make/CMakeLists.txt b/code/nel/tools/misc/bnp_make/CMakeLists.txt index d0e4c4aa0..d27252fb6 100644 --- a/code/nel/tools/misc/bnp_make/CMakeLists.txt +++ b/code/nel/tools/misc/bnp_make/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(bnp_make nelmisc) NL_DEFAULT_PROPS(bnp_make "NeL, Tools, Misc: bnp_make") NL_ADD_RUNTIME_FLAGS(bnp_make) -INSTALL(TARGETS bnp_make RUNTIME DESTINATION bin COMPONENT toolsmisc) +INSTALL(TARGETS bnp_make RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT toolsmisc) diff --git a/code/nel/tools/misc/branch_patcher/CMakeLists.txt b/code/nel/tools/misc/branch_patcher/CMakeLists.txt index 13cd96605..010e7defd 100644 --- a/code/nel/tools/misc/branch_patcher/CMakeLists.txt +++ b/code/nel/tools/misc/branch_patcher/CMakeLists.txt @@ -8,4 +8,4 @@ NL_ADD_RUNTIME_FLAGS(branch_patcher) ADD_DEFINITIONS(${MFC_DEFINITIONS}) -INSTALL(TARGETS branch_patcher RUNTIME DESTINATION bin COMPONENT toolsmisc) +INSTALL(TARGETS branch_patcher RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT toolsmisc) diff --git a/code/nel/tools/misc/data_mirror/CMakeLists.txt b/code/nel/tools/misc/data_mirror/CMakeLists.txt index 3b87782b5..9727576ba 100644 --- a/code/nel/tools/misc/data_mirror/CMakeLists.txt +++ b/code/nel/tools/misc/data_mirror/CMakeLists.txt @@ -8,4 +8,4 @@ NL_ADD_RUNTIME_FLAGS(data_mirror) ADD_DEFINITIONS(${MFC_DEFINITIONS}) -INSTALL(TARGETS data_mirror RUNTIME DESTINATION bin COMPONENT toolsmisc) +INSTALL(TARGETS data_mirror RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT toolsmisc) diff --git a/code/nel/tools/misc/data_mirror/StdAfx.h b/code/nel/tools/misc/data_mirror/StdAfx.h index a065be4ed..90fe14511 100644 --- a/code/nel/tools/misc/data_mirror/StdAfx.h +++ b/code/nel/tools/misc/data_mirror/StdAfx.h @@ -10,6 +10,9 @@ #pragma once #endif // _MSC_VER > 1000 +#include "nel/misc/types_nl.h" +#include "nel/misc/file.h" + #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers #include // MFC core and standard components diff --git a/code/nel/tools/misc/disp_sheet_id/CMakeLists.txt b/code/nel/tools/misc/disp_sheet_id/CMakeLists.txt index 13b8cb09a..0ab03d736 100644 --- a/code/nel/tools/misc/disp_sheet_id/CMakeLists.txt +++ b/code/nel/tools/misc/disp_sheet_id/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(disp_sheet_id nelmisc) NL_DEFAULT_PROPS(disp_sheet_id "NeL, Tools, Misc: disp_sheet_id") NL_ADD_RUNTIME_FLAGS(disp_sheet_id) -INSTALL(TARGETS disp_sheet_id RUNTIME DESTINATION bin COMPONENT toolsmisc) +INSTALL(TARGETS disp_sheet_id RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT toolsmisc) diff --git a/code/nel/tools/misc/exec_timeout/CMakeLists.txt b/code/nel/tools/misc/exec_timeout/CMakeLists.txt index daadd75d5..18654e169 100644 --- a/code/nel/tools/misc/exec_timeout/CMakeLists.txt +++ b/code/nel/tools/misc/exec_timeout/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(exec_timeout nelmisc) NL_DEFAULT_PROPS(exec_timeout "NeL, Tools, Misc: exec_timeout") NL_ADD_RUNTIME_FLAGS(exec_timeout) -INSTALL(TARGETS exec_timeout RUNTIME DESTINATION bin COMPONENT toolsmisc) +INSTALL(TARGETS exec_timeout RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT toolsmisc) diff --git a/code/nel/tools/misc/extract_filename/CMakeLists.txt b/code/nel/tools/misc/extract_filename/CMakeLists.txt index c46e9f1fc..7f20cc6d6 100644 --- a/code/nel/tools/misc/extract_filename/CMakeLists.txt +++ b/code/nel/tools/misc/extract_filename/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(extract_filename nelmisc) NL_DEFAULT_PROPS(extract_filename "NeL, Tools, Misc: extract_filename") NL_ADD_RUNTIME_FLAGS(extract_filename) -INSTALL(TARGETS extract_filename RUNTIME DESTINATION bin COMPONENT toolsmisc) +INSTALL(TARGETS extract_filename RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT toolsmisc) diff --git a/code/nel/tools/misc/extract_filename/extract_filename.cpp b/code/nel/tools/misc/extract_filename/extract_filename.cpp index 33a8a7249..7708f9031 100644 --- a/code/nel/tools/misc/extract_filename/extract_filename.cpp +++ b/code/nel/tools/misc/extract_filename/extract_filename.cpp @@ -23,7 +23,7 @@ using namespace NLMISC; #ifdef NL_DEBUG #define INFO nlinfo #else // NL_DEBUG -# if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) +# if defined(NL_COMP_VC) && NL_COMP_VC_VERSION >= 71 # define INFO __noop # else # define INFO 0&& diff --git a/code/nel/tools/misc/lock/CMakeLists.txt b/code/nel/tools/misc/lock/CMakeLists.txt index 23771299a..52afeee24 100644 --- a/code/nel/tools/misc/lock/CMakeLists.txt +++ b/code/nel/tools/misc/lock/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(lock nelmisc) NL_DEFAULT_PROPS(lock "NeL, Tools, Misc: lock") NL_ADD_RUNTIME_FLAGS(lock) -INSTALL(TARGETS lock RUNTIME DESTINATION bin COMPONENT toolsmisc) +INSTALL(TARGETS lock RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT toolsmisc) diff --git a/code/nel/tools/misc/log_analyser/CMakeLists.txt b/code/nel/tools/misc/log_analyser/CMakeLists.txt index fbc124b91..e852de2bc 100644 --- a/code/nel/tools/misc/log_analyser/CMakeLists.txt +++ b/code/nel/tools/misc/log_analyser/CMakeLists.txt @@ -8,4 +8,4 @@ NL_ADD_RUNTIME_FLAGS(log_analyser) ADD_DEFINITIONS(${MFC_DEFINITIONS}) -INSTALL(TARGETS log_analyser RUNTIME DESTINATION bin COMPONENT toolsmisc) +INSTALL(TARGETS log_analyser RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT toolsmisc) diff --git a/code/nel/tools/misc/log_analyser_plug_ins/extract_warnings/CMakeLists.txt b/code/nel/tools/misc/log_analyser_plug_ins/extract_warnings/CMakeLists.txt index 5524f1012..9fc570623 100644 --- a/code/nel/tools/misc/log_analyser_plug_ins/extract_warnings/CMakeLists.txt +++ b/code/nel/tools/misc/log_analyser_plug_ins/extract_warnings/CMakeLists.txt @@ -8,4 +8,4 @@ NL_ADD_RUNTIME_FLAGS(extract_warnings) NL_ADD_LIB_SUFFIX(extract_warnings) -INSTALL(TARGETS extract_warnings RUNTIME DESTINATION bin LIBRARY DESTINATION lib/log_analyser COMPONENT toolsmisc) +INSTALL(TARGETS extract_warnings RUNTIME DESTINATION ${NL_BIN_PREFIX} LIBRARY DESTINATION lib/log_analyser COMPONENT toolsmisc) diff --git a/code/nel/tools/misc/make_sheet_id/CMakeLists.txt b/code/nel/tools/misc/make_sheet_id/CMakeLists.txt index 2b5da139e..553f7fddb 100644 --- a/code/nel/tools/misc/make_sheet_id/CMakeLists.txt +++ b/code/nel/tools/misc/make_sheet_id/CMakeLists.txt @@ -8,5 +8,5 @@ TARGET_LINK_LIBRARIES(make_sheet_id nelmisc) NL_DEFAULT_PROPS(make_sheet_id "NeL, Tools, Misc: make_sheet_id") NL_ADD_RUNTIME_FLAGS(make_sheet_id) -INSTALL(TARGETS make_sheet_id RUNTIME DESTINATION bin COMPONENT toolsmisc) -INSTALL(FILES make_sheet_id.cfg DESTINATION etc/nel COMPONENT toolsmisc) +INSTALL(TARGETS make_sheet_id RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT toolsmisc) +INSTALL(FILES make_sheet_id.cfg DESTINATION ${NL_ETC_PREFIX} COMPONENT toolsmisc) diff --git a/code/nel/tools/misc/message_box/CMakeLists.txt b/code/nel/tools/misc/message_box/CMakeLists.txt index 8aec80959..764071d9d 100644 --- a/code/nel/tools/misc/message_box/CMakeLists.txt +++ b/code/nel/tools/misc/message_box/CMakeLists.txt @@ -6,4 +6,4 @@ ADD_EXECUTABLE(message_box WIN32 ${SRC}) NL_DEFAULT_PROPS(message_box "NeL, Tools, Misc: message_box") NL_ADD_RUNTIME_FLAGS(message_box) -INSTALL(TARGETS message_box RUNTIME DESTINATION bin COMPONENT toolsmisc) +INSTALL(TARGETS message_box RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT toolsmisc) diff --git a/code/nel/tools/misc/message_box_qt/CMakeLists.txt b/code/nel/tools/misc/message_box_qt/CMakeLists.txt index f71143341..408bf867e 100644 --- a/code/nel/tools/misc/message_box_qt/CMakeLists.txt +++ b/code/nel/tools/misc/message_box_qt/CMakeLists.txt @@ -14,5 +14,5 @@ NL_ADD_RUNTIME_FLAGS(message_box_qt) ADD_DEFINITIONS(${QT_DEFINITIONS}) -INSTALL(TARGETS message_box_qt RUNTIME DESTINATION bin COMPONENT toolsmisc) +INSTALL(TARGETS message_box_qt RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT toolsmisc) diff --git a/code/nel/tools/misc/multi_cd_setup_fix/CMakeLists.txt b/code/nel/tools/misc/multi_cd_setup_fix/CMakeLists.txt index 550547cce..3a5f7da4e 100644 --- a/code/nel/tools/misc/multi_cd_setup_fix/CMakeLists.txt +++ b/code/nel/tools/misc/multi_cd_setup_fix/CMakeLists.txt @@ -6,4 +6,4 @@ ADD_EXECUTABLE(multi_cd_setup_fix WIN32 ${SRC} multi_cd_setup_fix.rc) NL_DEFAULT_PROPS(multi_cd_setup_fix "NeL, Tools, Misc: multi_cd_setup_fix") NL_ADD_RUNTIME_FLAGS(multi_cd_setup_fix) -INSTALL(TARGETS multi_cd_setup_fix RUNTIME DESTINATION bin COMPONENT toolsmisc) +INSTALL(TARGETS multi_cd_setup_fix RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT toolsmisc) diff --git a/code/nel/tools/misc/probe_timers/CMakeLists.txt b/code/nel/tools/misc/probe_timers/CMakeLists.txt index df0f34926..cb17490df 100644 --- a/code/nel/tools/misc/probe_timers/CMakeLists.txt +++ b/code/nel/tools/misc/probe_timers/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(nl_probe_timers nelmisc) NL_DEFAULT_PROPS(nl_probe_timers "NeL, Tools, Misc: Probe Timers") NL_ADD_RUNTIME_FLAGS(nl_probe_timers) -INSTALL(TARGETS nl_probe_timers RUNTIME DESTINATION bin COMPONENT toolsmisc) +INSTALL(TARGETS nl_probe_timers RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT toolsmisc) diff --git a/code/nel/tools/misc/words_dic/CMakeLists.txt b/code/nel/tools/misc/words_dic/CMakeLists.txt index 1769422e5..c3f3975f2 100644 --- a/code/nel/tools/misc/words_dic/CMakeLists.txt +++ b/code/nel/tools/misc/words_dic/CMakeLists.txt @@ -12,4 +12,4 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(words_dic ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.h ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS words_dic RUNTIME DESTINATION bin COMPONENT toolsmisc) +INSTALL(TARGETS words_dic RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT toolsmisc) diff --git a/code/nel/tools/misc/words_dic_qt/CMakeLists.txt b/code/nel/tools/misc/words_dic_qt/CMakeLists.txt index dcfb2a9f6..2f755dfc1 100644 --- a/code/nel/tools/misc/words_dic_qt/CMakeLists.txt +++ b/code/nel/tools/misc/words_dic_qt/CMakeLists.txt @@ -27,6 +27,6 @@ NL_ADD_RUNTIME_FLAGS(words_dic_qt) ADD_DEFINITIONS(${QT_DEFINITIONS}) -INSTALL(TARGETS words_dic_qt RUNTIME DESTINATION bin COMPONENT toolsmisc) -INSTALL(FILES words_dic.cfg DESTINATION etc/nel COMPONENT toolsmisc) +INSTALL(TARGETS words_dic_qt RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT toolsmisc) +INSTALL(FILES words_dic.cfg DESTINATION ${NL_ETC_PREFIX} COMPONENT toolsmisc) diff --git a/code/nel/tools/misc/words_dic_qt/words_dicDlg.cpp b/code/nel/tools/misc/words_dic_qt/words_dicDlg.cpp index acbebd611..683755ae6 100644 --- a/code/nel/tools/misc/words_dic_qt/words_dicDlg.cpp +++ b/code/nel/tools/misc/words_dic_qt/words_dicDlg.cpp @@ -151,7 +151,7 @@ void CWords_dicDlg::on_findButton_clicked() { QString inputStr = ui.lookUpEdit->text(); bool showAll = ui.showAllCheckBox->isChecked(); - lookUp( inputStr.toStdString(), showAll ); + lookUp( inputStr.toUtf8().constData(), showAll ); } void CWords_dicDlg::on_lookUpEdit_textChanged() @@ -191,7 +191,7 @@ void CWords_dicDlg::on_fileListButton_clicked() void CWords_dicDlg::on_resultsListWidget_itemSelectionChanged() { QListWidgetItem *i = ui.resultsListWidget->currentItem(); - copyIntoClipboard( i->text().toStdString() ); + copyIntoClipboard( i->text().toUtf8().constData() ); } diff --git a/code/nel/tools/misc/xml_packer/CMakeLists.txt b/code/nel/tools/misc/xml_packer/CMakeLists.txt index 70d5a3270..c9dcd4c6b 100644 --- a/code/nel/tools/misc/xml_packer/CMakeLists.txt +++ b/code/nel/tools/misc/xml_packer/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(xml_packer nelmisc) NL_DEFAULT_PROPS(xml_packer "NeL, Tools, Misc: xml_packer") NL_ADD_RUNTIME_FLAGS(xml_packer) -INSTALL(TARGETS xml_packer RUNTIME DESTINATION bin COMPONENT toolsmisc) +INSTALL(TARGETS xml_packer RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT toolsmisc) diff --git a/code/nel/tools/nel_unit_test/CMakeLists.txt b/code/nel/tools/nel_unit_test/CMakeLists.txt index 5b2f2d0d4..8c53ff1c6 100644 --- a/code/nel/tools/nel_unit_test/CMakeLists.txt +++ b/code/nel/tools/nel_unit_test/CMakeLists.txt @@ -10,4 +10,4 @@ NL_ADD_RUNTIME_FLAGS(nel_unit_test) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DNEL_UNIT_BASE="${PROJECT_SOURCE_DIR}/tools/nel_unit_test/") -INSTALL(TARGETS nel_unit_test RUNTIME DESTINATION bin) +INSTALL(TARGETS nel_unit_test RUNTIME DESTINATION ${NL_BIN_PREFIX}) diff --git a/code/nel/tools/pacs/build_ig_boxes/CMakeLists.txt b/code/nel/tools/pacs/build_ig_boxes/CMakeLists.txt index 6700863af..fb2feedbe 100644 --- a/code/nel/tools/pacs/build_ig_boxes/CMakeLists.txt +++ b/code/nel/tools/pacs/build_ig_boxes/CMakeLists.txt @@ -8,5 +8,5 @@ TARGET_LINK_LIBRARIES(build_ig_boxes nelmisc nelpacs nel3d) NL_DEFAULT_PROPS(build_ig_boxes "NeL, Tools, PACS: build_ig_boxes") NL_ADD_RUNTIME_FLAGS(build_ig_boxes) -INSTALL(TARGETS build_ig_boxes RUNTIME DESTINATION bin COMPONENT toolspacs) -INSTALL(FILES build_ig_boxes.cfg DESTINATION etc/nel COMPONENT toolspacs) +INSTALL(TARGETS build_ig_boxes RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT toolspacs) +INSTALL(FILES build_ig_boxes.cfg DESTINATION ${NL_ETC_PREFIX} COMPONENT toolspacs) diff --git a/code/nel/tools/pacs/build_indoor_rbank/CMakeLists.txt b/code/nel/tools/pacs/build_indoor_rbank/CMakeLists.txt index ff23551c0..85f1984bf 100644 --- a/code/nel/tools/pacs/build_indoor_rbank/CMakeLists.txt +++ b/code/nel/tools/pacs/build_indoor_rbank/CMakeLists.txt @@ -8,5 +8,5 @@ TARGET_LINK_LIBRARIES(build_indoor_rbank nelmisc nelpacs) NL_DEFAULT_PROPS(build_indoor_rbank "NeL, Tools, PACS: build_indoor_rbank") NL_ADD_RUNTIME_FLAGS(build_indoor_rbank) -INSTALL(TARGETS build_indoor_rbank RUNTIME DESTINATION bin COMPONENT toolspacs) -INSTALL(FILES build_indoor_rbank.cfg DESTINATION etc/nel COMPONENT toolspacs) +INSTALL(TARGETS build_indoor_rbank RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT toolspacs) +INSTALL(FILES build_indoor_rbank.cfg DESTINATION ${NL_ETC_PREFIX} COMPONENT toolspacs) diff --git a/code/nel/tools/pacs/build_indoor_rbank/build_surfaces.cpp b/code/nel/tools/pacs/build_indoor_rbank/build_surfaces.cpp index f6bb4681d..f553eaf47 100644 --- a/code/nel/tools/pacs/build_indoor_rbank/build_surfaces.cpp +++ b/code/nel/tools/pacs/build_indoor_rbank/build_surfaces.cpp @@ -17,11 +17,11 @@ #include #include -#include "nel/../../src/pacs/collision_mesh_build.h" -#include "nel/../../src/pacs/local_retriever.h" -#include "nel/../../src/pacs/exterior_mesh.h" -#include "nel/../../src/pacs/surface_quad.h" -#include "nel/../../src/pacs/chain.h" +#include "nel/pacs/collision_mesh_build.h" +#include "nel/pacs/local_retriever.h" +#include "nel/pacs/exterior_mesh.h" +#include "nel/pacs/surface_quad.h" +#include "nel/pacs/chain.h" #include "build_surfaces.h" diff --git a/code/nel/tools/pacs/build_indoor_rbank/build_surfaces.h b/code/nel/tools/pacs/build_indoor_rbank/build_surfaces.h index a3e86dd09..fdfbb2c21 100644 --- a/code/nel/tools/pacs/build_indoor_rbank/build_surfaces.h +++ b/code/nel/tools/pacs/build_indoor_rbank/build_surfaces.h @@ -23,7 +23,7 @@ #include "nel/misc/vector.h" #include "nel/misc/file.h" -#include "nel/../../src/pacs/collision_mesh_build.h" +#include "nel/pacs/collision_mesh_build.h" // External class declaration namespace NLPACS diff --git a/code/nel/tools/pacs/build_indoor_rbank/main.cpp b/code/nel/tools/pacs/build_indoor_rbank/main.cpp index a749572f7..2e797d61d 100644 --- a/code/nel/tools/pacs/build_indoor_rbank/main.cpp +++ b/code/nel/tools/pacs/build_indoor_rbank/main.cpp @@ -23,11 +23,11 @@ #include "nel/misc/time_nl.h" #include "nel/misc/file.h" -#include "nel/../../src/pacs/collision_mesh_build.h" -#include "nel/../../src/pacs/local_retriever.h" -#include "nel/../../src/pacs/retriever_instance.h" -#include "nel/../../src/pacs/global_retriever.h" -#include "nel/../../src/pacs/retriever_bank.h" +#include "nel/pacs/collision_mesh_build.h" +#include "nel/pacs/local_retriever.h" +#include "nel/pacs/retriever_instance.h" +#include "nel/pacs/global_retriever.h" +#include "nel/pacs/retriever_bank.h" #include "nel/pacs/u_global_position.h" diff --git a/code/nel/tools/pacs/build_indoor_rbank/mouline.cpp b/code/nel/tools/pacs/build_indoor_rbank/mouline.cpp index 8322daa33..57592a431 100644 --- a/code/nel/tools/pacs/build_indoor_rbank/mouline.cpp +++ b/code/nel/tools/pacs/build_indoor_rbank/mouline.cpp @@ -17,9 +17,9 @@ #include #include -#include "nel/../../src/pacs/collision_mesh_build.h" -#include "nel/../../src/pacs/local_retriever.h" -#include "nel/../../src/pacs/exterior_mesh.h" +#include "nel/pacs/collision_mesh_build.h" +#include "nel/pacs/local_retriever.h" +#include "nel/pacs/exterior_mesh.h" #include "mouline.h" #include "build_surfaces.h" diff --git a/code/nel/tools/pacs/build_rbank/CMakeLists.txt b/code/nel/tools/pacs/build_rbank/CMakeLists.txt index f16cfb407..b35cb808c 100644 --- a/code/nel/tools/pacs/build_rbank/CMakeLists.txt +++ b/code/nel/tools/pacs/build_rbank/CMakeLists.txt @@ -12,5 +12,5 @@ NL_ADD_RUNTIME_FLAGS(build_rbank) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -INSTALL(TARGETS build_rbank RUNTIME DESTINATION bin COMPONENT toolspacs) -INSTALL(FILES build_rbank.cfg DESTINATION etc/nel COMPONENT toolspacs) +INSTALL(TARGETS build_rbank RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT toolspacs) +INSTALL(FILES build_rbank.cfg DESTINATION ${NL_ETC_PREFIX} COMPONENT toolspacs) diff --git a/code/nel/tools/pacs/build_rbank/build_rbank.cpp b/code/nel/tools/pacs/build_rbank/build_rbank.cpp index 7003e93d6..2285873c0 100644 --- a/code/nel/tools/pacs/build_rbank/build_rbank.cpp +++ b/code/nel/tools/pacs/build_rbank/build_rbank.cpp @@ -35,13 +35,13 @@ #include "surface_splitter.h" -#include "nel/../../src/pacs/global_retriever.h" -#include "nel/../../src/pacs/retriever_bank.h" -#include "nel/../../src/pacs/surface_quad.h" -#include "nel/../../src/pacs/local_retriever.h" -#include "nel/../../src/pacs/retriever_instance.h" -#include "nel/../../src/pacs/chain.h" -#include "nel/../../src/pacs/collision_mesh_build.h" +#include "nel/pacs/global_retriever.h" +#include "nel/pacs/retriever_bank.h" +#include "nel/pacs/surface_quad.h" +#include "nel/pacs/local_retriever.h" +#include "nel/pacs/retriever_instance.h" +#include "nel/pacs/chain.h" +#include "nel/pacs/collision_mesh_build.h" #include #include diff --git a/code/nel/tools/pacs/build_rbank/build_surf.cpp b/code/nel/tools/pacs/build_rbank/build_surf.cpp index 7500d1083..9546e19f1 100644 --- a/code/nel/tools/pacs/build_rbank/build_surf.cpp +++ b/code/nel/tools/pacs/build_rbank/build_surf.cpp @@ -31,7 +31,7 @@ #include "nel/3d/mesh.h" #include "nel/3d/quad_grid.h" -#include "nel/../../src/pacs/vector_2s.h" +#include "nel/pacs/vector_2s.h" #include "build_surf.h" diff --git a/code/nel/tools/pacs/build_rbank/build_surf.h b/code/nel/tools/pacs/build_rbank/build_surf.h index 2e0588546..ad0342b1e 100644 --- a/code/nel/tools/pacs/build_rbank/build_surf.h +++ b/code/nel/tools/pacs/build_rbank/build_surf.h @@ -35,8 +35,8 @@ #include "nel/misc/geom_ext.h" #include "nel/misc/polygon.h" -#include "nel/../../src/pacs/surface_quad.h" -#include "nel/../../src/pacs/retrievable_surface.h" +#include "nel/pacs/surface_quad.h" +#include "nel/pacs/retrievable_surface.h" #include "prim_checker.h" diff --git a/code/nel/tools/pacs/build_rbank/main.cpp b/code/nel/tools/pacs/build_rbank/main.cpp index ef805e8e0..8421ed807 100644 --- a/code/nel/tools/pacs/build_rbank/main.cpp +++ b/code/nel/tools/pacs/build_rbank/main.cpp @@ -29,11 +29,11 @@ #include "build_rbank.h" #include "prim_checker.h" -#include "nel/../../src/pacs/global_retriever.h" -#include "nel/../../src/pacs/retriever_bank.h" -#include "nel/../../src/pacs/surface_quad.h" -#include "nel/../../src/pacs/local_retriever.h" -#include "nel/../../src/pacs/retriever_instance.h" +#include "nel/pacs/global_retriever.h" +#include "nel/pacs/retriever_bank.h" +#include "nel/pacs/surface_quad.h" +#include "nel/pacs/local_retriever.h" +#include "nel/pacs/retriever_instance.h" #include #include diff --git a/code/nel/tools/pacs/build_rbank/surface_splitter.h b/code/nel/tools/pacs/build_rbank/surface_splitter.h index 0aea88968..3cf035e9d 100644 --- a/code/nel/tools/pacs/build_rbank/surface_splitter.h +++ b/code/nel/tools/pacs/build_rbank/surface_splitter.h @@ -19,8 +19,8 @@ #include "nel/misc/types_nl.h" -#include "../../../src/pacs/local_retriever.h" -#include "../../../src/pacs/quad_grid.h" +#include "nel/pacs/local_retriever.h" +#include "nel/pacs/quad_grid.h" #include diff --git a/code/nel/tools/sound/build_samplebank/CMakeLists.txt b/code/nel/tools/sound/build_samplebank/CMakeLists.txt index e53b54e11..ab427373c 100644 --- a/code/nel/tools/sound/build_samplebank/CMakeLists.txt +++ b/code/nel/tools/sound/build_samplebank/CMakeLists.txt @@ -10,4 +10,4 @@ TARGET_LINK_LIBRARIES(build_samplebank nelmisc nelsound) NL_DEFAULT_PROPS(build_samplebank "NeL, Tools, Sound: build_samplebank") NL_ADD_RUNTIME_FLAGS(build_samplebank) -INSTALL(TARGETS build_samplebank RUNTIME DESTINATION bin COMPONENT toolssound) +INSTALL(TARGETS build_samplebank RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT toolssound) diff --git a/code/nel/tools/sound/build_sound/CMakeLists.txt b/code/nel/tools/sound/build_sound/CMakeLists.txt index 5549e4284..7813e4e8f 100644 --- a/code/nel/tools/sound/build_sound/CMakeLists.txt +++ b/code/nel/tools/sound/build_sound/CMakeLists.txt @@ -10,4 +10,4 @@ TARGET_LINK_LIBRARIES(build_sound nelmisc nelsound) NL_DEFAULT_PROPS(build_sound "NeL, Tools, Sound: build_sound") NL_ADD_RUNTIME_FLAGS(build_sound) -INSTALL(TARGETS build_sound RUNTIME DESTINATION bin COMPONENT toolssound) +INSTALL(TARGETS build_sound RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT toolssound) diff --git a/code/nel/tools/sound/build_soundbank/CMakeLists.txt b/code/nel/tools/sound/build_soundbank/CMakeLists.txt index 27148ed26..4431a47b8 100644 --- a/code/nel/tools/sound/build_soundbank/CMakeLists.txt +++ b/code/nel/tools/sound/build_soundbank/CMakeLists.txt @@ -10,4 +10,4 @@ TARGET_LINK_LIBRARIES(build_soundbank nelmisc nelsound) NL_DEFAULT_PROPS(build_soundbank "NeL, Tools, Sound: build_soundbank") NL_ADD_RUNTIME_FLAGS(build_soundbank) -INSTALL(TARGETS build_soundbank RUNTIME DESTINATION bin COMPONENT toolssound) +INSTALL(TARGETS build_soundbank RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT toolssound) diff --git a/code/nel/tools/sound/source_sounds_builder/SoundPage.cpp b/code/nel/tools/sound/source_sounds_builder/SoundPage.cpp index 2664bc033..0ad410098 100644 --- a/code/nel/tools/sound/source_sounds_builder/SoundPage.cpp +++ b/code/nel/tools/sound/source_sounds_builder/SoundPage.cpp @@ -413,7 +413,7 @@ void CSoundPage::apply() nlassert( _Tree ); - if ( m_Filename != "" ) + if ( !m_Filename.empty() ) { CString s = ((CSource_sounds_builderDlg*)GetOwner())->SoundName( _HItem ) + " (" + m_Filename + ")"; _Tree->SetItemText( _HItem, s ); diff --git a/code/nel/tools/sound/source_sounds_builder/source_sounds_builderDlg.cpp b/code/nel/tools/sound/source_sounds_builder/source_sounds_builderDlg.cpp index e5643fba4..2ba1b70a5 100644 --- a/code/nel/tools/sound/source_sounds_builder/source_sounds_builderDlg.cpp +++ b/code/nel/tools/sound/source_sounds_builder/source_sounds_builderDlg.cpp @@ -364,7 +364,7 @@ CString CSource_sounds_builderDlg::SoundName( HTREEITEM hitem ) { CString s = m_Tree.GetItemText( hitem ); sint last; - if ( s != "" ) + if ( !s.empty() ) { if ( s[s.GetLength()-1] == '*' ) { @@ -425,13 +425,13 @@ void CSource_sounds_builderDlg::OnSave() } nameset.insert( (*ips)->getName() ); } - if ( duplicates != "" ) + if ( !duplicates.empty() ) { CString s; s.Format( "Warning: the following names are duplicates. The first occurence of each one was not written in the output file. Correct the names and save again:\n\n%s", duplicates.c_str() ); AfxMessageBox( s, MB_ICONWARNING ); } - if ( blanksounds != "" ) + if ( !blanksounds.empty() ) { CString s; s.Format( "Warning: the following sounds have no wave file specified:\n\n%s", blanksounds.c_str() ); @@ -569,7 +569,7 @@ void CSource_sounds_builderDlg::OnImport() if ( hitem == NULL ) { string sname = string(name); - if ( sname != "" ) // prevent from taking blank names + if ( !sname.empty() ) // prevent from taking blank names { AddSound( sname.c_str() ); } diff --git a/code/nelns/admin_executor_service/CMakeLists.txt b/code/nelns/admin_executor_service/CMakeLists.txt index 25749af66..620c1a78a 100644 --- a/code/nelns/admin_executor_service/CMakeLists.txt +++ b/code/nelns/admin_executor_service/CMakeLists.txt @@ -14,4 +14,4 @@ NL_ADD_RUNTIME_FLAGS(admin_executor_service) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS admin_executor_service RUNTIME DESTINATION sbin COMPONENT aes) -INSTALL(FILES admin_executor_service.cfg common.cfg DESTINATION etc/nel/nelns COMPONENT aes) +INSTALL(FILES admin_executor_service.cfg common.cfg DESTINATION ${NL_ETC_PREFIX}/nelns COMPONENT aes) diff --git a/code/nelns/admin_service/CMakeLists.txt b/code/nelns/admin_service/CMakeLists.txt index 88d5aaeb9..a7eee50a1 100644 --- a/code/nelns/admin_service/CMakeLists.txt +++ b/code/nelns/admin_service/CMakeLists.txt @@ -17,4 +17,4 @@ NL_ADD_RUNTIME_FLAGS(admin_service) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS admin_service RUNTIME DESTINATION sbin COMPONENT as) -INSTALL(FILES admin_service.cfg common.cfg DESTINATION etc/nel/nelns COMPONENT as) +INSTALL(FILES admin_service.cfg common.cfg DESTINATION ${NL_ETC_PREFIX}/nelns COMPONENT as) diff --git a/code/nelns/admin_service/admin_service.cpp b/code/nelns/admin_service/admin_service.cpp index 8f437adbb..6d75b6aac 100644 --- a/code/nelns/admin_service/admin_service.cpp +++ b/code/nelns/admin_service/admin_service.cpp @@ -31,9 +31,12 @@ #include #include -#if defined (NL_OS_WINDOWS) -#include +#ifdef NL_OS_WINDOWS +#include +#include +typedef unsigned long ulong; #endif + #include #include diff --git a/code/nelns/login_service/CMakeLists.txt b/code/nelns/login_service/CMakeLists.txt index 5ae88df7c..1ee7260fe 100644 --- a/code/nelns/login_service/CMakeLists.txt +++ b/code/nelns/login_service/CMakeLists.txt @@ -17,4 +17,4 @@ NL_ADD_RUNTIME_FLAGS(login_service) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS login_service RUNTIME DESTINATION sbin COMPONENT ls) -INSTALL(FILES login_service.cfg common.cfg DESTINATION etc/nel/nelns COMPONENT ls) +INSTALL(FILES login_service.cfg common.cfg DESTINATION ${NL_ETC_PREFIX}/nelns COMPONENT ls) diff --git a/code/nelns/login_service/connection_client.cpp b/code/nelns/login_service/connection_client.cpp index 74269550b..37976cb24 100644 --- a/code/nelns/login_service/connection_client.cpp +++ b/code/nelns/login_service/connection_client.cpp @@ -152,7 +152,7 @@ retry: CLoginCookie c; c.set((uint32)(uintptr_t)from, rand(), uid); - reason = sqlQuery("update user set state='Authorized', Cookie='"+c.setToString()+"' where UId="+uid); + reason = sqlQuery("update user set state='Authorized', Cookie='"+c.setToString()+"' where UId=" + NLMISC::toString(uid)); if(!reason.empty()) break; reason = sqlQuery("select * from shard where Online>0 and ClientApplication='"+application+"'", nbrow, row, result); diff --git a/code/nelns/login_service/login_service.h b/code/nelns/login_service/login_service.h index d8f43219e..7c8c5a427 100644 --- a/code/nelns/login_service/login_service.h +++ b/code/nelns/login_service/login_service.h @@ -20,7 +20,9 @@ // we have to include windows.h because mysql.h uses it but not include it #ifdef NL_OS_WINDOWS # define NOMINMAX +# include # include +typedef unsigned long ulong; #endif #include diff --git a/code/nelns/login_service/mysql_helper.h b/code/nelns/login_service/mysql_helper.h index ab57b8ffa..fee1d1bf6 100644 --- a/code/nelns/login_service/mysql_helper.h +++ b/code/nelns/login_service/mysql_helper.h @@ -25,7 +25,9 @@ // we have to include windows.h because mysql.h uses it but not include it #ifdef NL_OS_WINDOWS # define NOMINMAX +# include # include +typedef unsigned long ulong; #endif #include diff --git a/code/nelns/login_system/nel_launcher_qt/CMakeLists.txt b/code/nelns/login_system/nel_launcher_qt/CMakeLists.txt index 3bd503eef..7e128f1b7 100644 --- a/code/nelns/login_system/nel_launcher_qt/CMakeLists.txt +++ b/code/nelns/login_system/nel_launcher_qt/CMakeLists.txt @@ -37,5 +37,5 @@ INSTALL(TARGETS nel_launcher_qt RUNTIME DESTINATION bin COMPONENT launcher) IF(WIN32) INSTALL(FILES nel_launcher.cfg DESTINATION bin COMPONENT launcher) ELSE(WIN32) - INSTALL(FILES nel_launcher.cfg DESTINATION etc/nel/nelns COMPONENT launcher) + INSTALL(FILES nel_launcher.cfg DESTINATION ${NL_ETC_PREFIX}/nelns COMPONENT launcher) ENDIF(WIN32) diff --git a/code/nelns/login_system/nel_launcher_qt/nel_launcher_dlg.cpp b/code/nelns/login_system/nel_launcher_qt/nel_launcher_dlg.cpp index 28e8114c9..0e9efc2e7 100644 --- a/code/nelns/login_system/nel_launcher_qt/nel_launcher_dlg.cpp +++ b/code/nelns/login_system/nel_launcher_qt/nel_launcher_dlg.cpp @@ -72,8 +72,8 @@ void CNelLauncherDlg::clickedSignUp() void CNelLauncherDlg::clickedLogin() { - std::string username = leUsername->text().toStdString(); - std::string password = lePassword->text().toStdString(); + std::string username = leUsername->text().toUtf8(); + std::string password = lePassword->text().toUtf8(); nlinfo("received login attempt for %s with %s", username.c_str(), password.c_str()); diff --git a/code/nelns/login_system/nel_launcher_windows_ext2/CMakeLists.txt b/code/nelns/login_system/nel_launcher_windows_ext2/CMakeLists.txt index 79093faef..f139252b8 100644 --- a/code/nelns/login_system/nel_launcher_windows_ext2/CMakeLists.txt +++ b/code/nelns/login_system/nel_launcher_windows_ext2/CMakeLists.txt @@ -20,4 +20,4 @@ IF(WITH_PCH) ENDIF(WITH_PCH) INSTALL(TARGETS nel_launcher_ext2 RUNTIME DESTINATION bin COMPONENT launcher) -INSTALL(FILES nel_launcher.cfg DESTINATION etc/nel COMPONENT launcher) +INSTALL(FILES nel_launcher.cfg DESTINATION ${NL_ETC_PREFIX} COMPONENT launcher) diff --git a/code/nelns/naming_service/CMakeLists.txt b/code/nelns/naming_service/CMakeLists.txt index 4073d1193..9616ca957 100644 --- a/code/nelns/naming_service/CMakeLists.txt +++ b/code/nelns/naming_service/CMakeLists.txt @@ -15,4 +15,4 @@ NL_ADD_RUNTIME_FLAGS(naming_service) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS naming_service RUNTIME DESTINATION sbin COMPONENT ns) -INSTALL(FILES naming_service.cfg common.cfg DESTINATION etc/nel/nelns COMPONENT ns) +INSTALL(FILES naming_service.cfg common.cfg DESTINATION ${NL_ETC_PREFIX}/nelns COMPONENT ns) diff --git a/code/nelns/welcome_service/CMakeLists.txt b/code/nelns/welcome_service/CMakeLists.txt index e25c08a0c..c6819d97d 100644 --- a/code/nelns/welcome_service/CMakeLists.txt +++ b/code/nelns/welcome_service/CMakeLists.txt @@ -15,4 +15,4 @@ NL_ADD_RUNTIME_FLAGS(welcome_service) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS welcome_service RUNTIME DESTINATION sbin COMPONENT ws) -INSTALL(FILES welcome_service.cfg common.cfg DESTINATION etc/nel/nelns COMPONENT ws) +INSTALL(FILES welcome_service.cfg common.cfg DESTINATION ${NL_ETC_PREFIX}/nelns COMPONENT ws) diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/help.xml b/code/ryzom/client/data/gamedev/interfaces_v3/help.xml index 4d74b184c..39cfb1af4 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/help.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/help.xml @@ -864,7 +864,7 @@ + value="http://app.ryzom.com/ticket_system/index.php?mode=load" /> - - + + createSkeleton(_SkeletonName); if( _Skeleton == NULL ) @@ -340,12 +340,12 @@ void CAnimatedSceneObject::resetInitialPos( void ) // Destructor CAnimatedSceneObject::~CAnimatedSceneObject() { - if( _Instance != NULL && _MeshName != "" ) + if( _Instance != NULL && !_MeshName.empty() ) { Scene->deleteInstance( _Instance ); } - if( _Skeleton != NULL && _SkeletonName != "" ) + if( _Skeleton != NULL && !_SkeletonName.empty() ) { Scene->deleteSkeleton( _Skeleton ); } diff --git a/code/ryzom/client/src/app_bundle_utils.cpp b/code/ryzom/client/src/app_bundle_utils.cpp index b6321ad20..b42b00b98 100644 --- a/code/ryzom/client/src/app_bundle_utils.cpp +++ b/code/ryzom/client/src/app_bundle_utils.cpp @@ -21,7 +21,7 @@ #include #endif -std::string getAppBundlePath() +std::string getAppBundlePath() { static std::string cachedPathToBundle; diff --git a/code/ryzom/client/src/attached_fx.cpp b/code/ryzom/client/src/attached_fx.cpp index 0934d9a15..0f520f689 100644 --- a/code/ryzom/client/src/attached_fx.cpp +++ b/code/ryzom/client/src/attached_fx.cpp @@ -197,7 +197,7 @@ void CAttachedFX::create(CCharacterCL &parent, if (targeterInfo.StickMode.UserBoneName != 0) { CEntityCL *targeter = EntitiesMngr.entity(TargeterInfo.Slot); - if (targeter && targeter->skeleton()) + if (parent.skeleton() && targeter && targeter->skeleton()) { TargeterUserBoneID = parent.skeleton()->getBoneIdByName(NLMISC::CStringMapper::unmap(TargeterInfo.StickMode.UserBoneName)); } diff --git a/code/ryzom/client/src/attached_fx.h b/code/ryzom/client/src/attached_fx.h index faf38aeae..6f8f791cd 100644 --- a/code/ryzom/client/src/attached_fx.h +++ b/code/ryzom/client/src/attached_fx.h @@ -65,14 +65,14 @@ public: class CBuildInfo { public: - const CAnimationFX *Sheet; - const CFXStickMode *StickMode; // NULL to use default stick mode of the sheet - NLMISC::CVector StickOffset; - const NLMISC::CMatrix *StaticMatrix; // Useful if stick mode is "StaticMatrix" - uint MaxNumAnimCount; // Number of frame on which the fx can overlap when it is being shutdown - float TimeOut; - double StartTime; - float DelayBeforeStart; + const CAnimationFX* Sheet; + const CFXStickMode* StickMode; // NULL to use default stick mode of the sheet + NLMISC::CVector StickOffset; + const NLMISC::CMatrix* StaticMatrix; // Useful if stick mode is "StaticMatrix" + uint MaxNumAnimCount; // Number of frame on which the fx can overlap when it is being shutdown + float TimeOut; + double StartTime; + float DelayBeforeStart; public: CBuildInfo() { diff --git a/code/ryzom/client/src/character_cl.cpp b/code/ryzom/client/src/character_cl.cpp index 435698226..2f947e198 100644 --- a/code/ryzom/client/src/character_cl.cpp +++ b/code/ryzom/client/src/character_cl.cpp @@ -4522,7 +4522,7 @@ void CCharacterCL::applyBehaviourFlyingHPs(const CBehaviourContext &bc, const MB { if(behaviour.DeltaHP != 0) { - CRGBA deltaHPColor; + CRGBA deltaHPColor(0, 0, 0); // if it's a hit if( behaviour.DeltaHP < 0 ) { diff --git a/code/ryzom/client/src/client.cpp b/code/ryzom/client/src/client.cpp index 85b852e35..368afe0ee 100644 --- a/code/ryzom/client/src/client.cpp +++ b/code/ryzom/client/src/client.cpp @@ -104,8 +104,8 @@ static CTcpSock CrashCounterSock; void quitCrashReport () { - if (NLMISC::CFile::fileExists(getLogDirectory() + "ryzom_started")) - CFile::deleteFile (getLogDirectory() + "ryzom_started"); + //if (NLMISC::CFile::fileExists(getLogDirectory() + "ryzom_started")) + //CFile::deleteFile (getLogDirectory() + "ryzom_started"); // must disconnect now, else could crash at dtor time because nldebug -> access a new INelContext() contReset(CrashCounterSock); } @@ -148,7 +148,7 @@ INT_PTR CALLBACK MyDialogProc( HWND SlashScreen = NULL; HINSTANCE HInstance; - +/* static bool connect() { string server = "crashcounter.nevrax.com"; @@ -354,7 +354,7 @@ void initCrashReport () #ifdef TEST_CRASH_COUNTER MessageBox (NULL, res.c_str(), res.c_str(), MB_OK); #endif // TEST_CRASH_COUNTER -} +}*/ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE /* hPrevInstance */, LPSTR cmdline, int /* nCmdShow */) #else @@ -430,12 +430,12 @@ int main(int argc, char **argv) // exit (0); //} - initCrashReport (); + //initCrashReport (); #endif // FINAL_VERSION // Set default email value for reporting error #ifdef TEST_CRASH_COUNTER - initCrashReport (); + //initCrashReport (); setReportEmailFunction ((void*)sendEmail); setDefaultEmailParams ("smtp.nevrax.com", "", "hulud@nevrax.com"); @@ -637,7 +637,7 @@ int main(int argc, char **argv) //ICommand::execute("iFileAccessLogClear",*NLMISC::InfoLog); #endif - CFile::createEmptyFile(getLogDirectory() + "during_release"); + //CFile::createEmptyFile(getLogDirectory() + "during_release"); #ifdef TEST_CRASH_COUNTER if (string(cmdline) == "/release") diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index 61cfbf9ad..916e907b7 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -380,6 +380,7 @@ CClientConfig::CClientConfig() ScreenAspectRatio = 0.f; // Default commmon Screen Aspect Ratio (no relation with the resolution) - 0.f = auto FoV = 75.f; // Default value for the FoV. ForceDXTC = false; // Default is no DXTC Compression. + AnisotropicFilter = 0; // Default is disabled (-1 = maximum value, 0 = disabled, 1+ = enabled) DivideTextureSizeBy2= false; // Divide texture by 2 DisableVtxProgram = false; // Disable Hardware Vertex Program. DisableVtxAGP = false; // Disable Hardware Vertex AGP. @@ -979,6 +980,8 @@ void CClientConfig::setValues() READ_FLOAT_FV(FoV) // ForceDXTC READ_BOOL_FV(ForceDXTC) + // AnisotropicFilter + READ_INT_FV(AnisotropicFilter) // DivideTextureSizeBy2 READ_BOOL_FV(DivideTextureSizeBy2) // DisableVtxProgram diff --git a/code/ryzom/client/src/client_cfg.h b/code/ryzom/client/src/client_cfg.h index 2c448bac0..ebb972f05 100644 --- a/code/ryzom/client/src/client_cfg.h +++ b/code/ryzom/client/src/client_cfg.h @@ -230,6 +230,8 @@ struct CClientConfig float FoV; /// Force the DXTC Compression. bool ForceDXTC; + /// Set the anisotropic filter + sint AnisotropicFilter; /// Divide texture size by 2 bool DivideTextureSizeBy2; /// Disable Hardware Vertex Program. diff --git a/code/ryzom/client/src/client_sheets/CMakeLists.txt b/code/ryzom/client/src/client_sheets/CMakeLists.txt index 4f21ecf9d..57bf75af5 100644 --- a/code/ryzom/client/src/client_sheets/CMakeLists.txt +++ b/code/ryzom/client/src/client_sheets/CMakeLists.txt @@ -14,5 +14,5 @@ IF(WITH_PCH) ENDIF(WITH_PCH) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) - INSTALL(TARGETS ryzom_clientsheets LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) + INSTALL(TARGETS ryzom_clientsheets LIBRARY DESTINATION ${RYZOM_LIB_PREFIX} ARCHIVE DESTINATION ${RYZOM_LIB_PREFIX} COMPONENT libraries) ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) diff --git a/code/ryzom/client/src/client_sheets/attack_id_sheet.h b/code/ryzom/client/src/client_sheets/attack_id_sheet.h index 2eaaabed8..1dfe1b790 100644 --- a/code/ryzom/client/src/client_sheets/attack_id_sheet.h +++ b/code/ryzom/client/src/client_sheets/attack_id_sheet.h @@ -14,8 +14,6 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . - - #ifndef CL_ATTACK_ID_H #define CL_ATTACK_ID_H diff --git a/code/ryzom/client/src/client_sheets/body_to_bone_sheet.cpp b/code/ryzom/client/src/client_sheets/body_to_bone_sheet.cpp index ea08a9747..fb065e6df 100644 --- a/code/ryzom/client/src/client_sheets/body_to_bone_sheet.cpp +++ b/code/ryzom/client/src/client_sheets/body_to_bone_sheet.cpp @@ -19,6 +19,7 @@ #include "stdpch.h" // #include "body_to_bone_sheet.h" +#include "client_sheets.h" // #include "nel/georges/u_form_elm.h" diff --git a/code/ryzom/client/src/client_sheets/body_to_bone_sheet.h b/code/ryzom/client/src/client_sheets/body_to_bone_sheet.h index f71356c5b..10e59ba72 100644 --- a/code/ryzom/client/src/client_sheets/body_to_bone_sheet.h +++ b/code/ryzom/client/src/client_sheets/body_to_bone_sheet.h @@ -21,6 +21,8 @@ #include "game_share/body.h" +#include + namespace NLGEORGES { class UFormElm; diff --git a/code/ryzom/client/src/client_sheets/faction_sheet.h b/code/ryzom/client/src/client_sheets/faction_sheet.h index babdb78e9..1b1a3f3e5 100644 --- a/code/ryzom/client/src/client_sheets/faction_sheet.h +++ b/code/ryzom/client/src/client_sheets/faction_sheet.h @@ -14,11 +14,10 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . - - #ifndef RY_FACTION_SHEET_H #define RY_FACTION_SHEET_H +#include "entity_sheet.h" /** Sheet of a faction * NB : it doesn't derives from CEntitySheet, because its instances are aggragated in a CContinentSheet diff --git a/code/ryzom/client/src/client_sheets/item_fx_sheet.cpp b/code/ryzom/client/src/client_sheets/item_fx_sheet.cpp index ce1912897..c58bc601f 100644 --- a/code/ryzom/client/src/client_sheets/item_fx_sheet.cpp +++ b/code/ryzom/client/src/client_sheets/item_fx_sheet.cpp @@ -14,10 +14,10 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . - - #include "stdpch.h" #include "item_fx_sheet.h" +#include "client_sheets.h" + #include "nel/georges/u_form_elm.h" // ******************************************************************************************* diff --git a/code/ryzom/client/src/client_sheets/outpost_building_sheet.h b/code/ryzom/client/src/client_sheets/outpost_building_sheet.h index f1bccc371..e753f3352 100644 --- a/code/ryzom/client/src/client_sheets/outpost_building_sheet.h +++ b/code/ryzom/client/src/client_sheets/outpost_building_sheet.h @@ -18,7 +18,7 @@ #define RY_OUTPOST_BUILDING_H #include "entity_sheet.h" - +#include "client_sheets.h" /** * Outpost building definition for client side management (buy building upgrades ...) diff --git a/code/ryzom/client/src/client_sheets/stdpch.h b/code/ryzom/client/src/client_sheets/stdpch.h index 6656b4553..3421b031d 100644 --- a/code/ryzom/client/src/client_sheets/stdpch.h +++ b/code/ryzom/client/src/client_sheets/stdpch.h @@ -14,7 +14,8 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#include +#ifndef CL_STDPCH_H +#define CL_STDPCH_H #include #include @@ -33,15 +34,21 @@ #include #include +#include #include #include - #include #include #include #include #include #include +#include +#include + +#include +#include +#include +#include -#include "client_sheets.h" -#include "entity_sheet.h" +#endif diff --git a/code/ryzom/client/src/client_sheets/text_emot_list_sheet.h b/code/ryzom/client/src/client_sheets/text_emot_list_sheet.h index ccfdb8f9e..8533e14f5 100644 --- a/code/ryzom/client/src/client_sheets/text_emot_list_sheet.h +++ b/code/ryzom/client/src/client_sheets/text_emot_list_sheet.h @@ -14,8 +14,6 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . - - #ifndef CL_TEXT_EMOT_LIST_SHEET_H #define CL_TEXT_EMOT_LIST_SHEET_H diff --git a/code/ryzom/client/src/commands.cpp b/code/ryzom/client/src/commands.cpp index 1990003b0..81b9689a4 100644 --- a/code/ryzom/client/src/commands.cpp +++ b/code/ryzom/client/src/commands.cpp @@ -5770,7 +5770,7 @@ NLMISC_COMMAND(em, "emote command", "") -NLMISC_COMMAND(guildmotd, "Set the guild message of the day","") +NLMISC_COMMAND(guildmotd, "Set or see the guild message of the day","") { CBitMemStream out; if (!GenericMsgHeaderMngr.pushNameToStream("COMMAND:GUILDMOTD", out)) diff --git a/code/ryzom/client/src/connection.cpp b/code/ryzom/client/src/connection.cpp index fbeb2e8ef..02572d5e6 100644 --- a/code/ryzom/client/src/connection.cpp +++ b/code/ryzom/client/src/connection.cpp @@ -400,7 +400,6 @@ bool connection (const string &cookie, const string &fsaddr) nlinfo ("PROFILE: %d seconds for connection", (uint32)(ryzomGetLocalTime ()-connStart)/1000); // Init web box - nlinfo("ok"); // TMP TMP if (ClientCfg.Local) diff --git a/code/ryzom/client/src/entity_animation_manager.cpp b/code/ryzom/client/src/entity_animation_manager.cpp index d96ce431e..db1eccb01 100644 --- a/code/ryzom/client/src/entity_animation_manager.cpp +++ b/code/ryzom/client/src/entity_animation_manager.cpp @@ -179,7 +179,8 @@ void CEntityAnimationManager::load(NLMISC::IProgressCallback &/* progress */, bo release(); // Log in the animation file. - setDebugOutput(getLogDirectory() + "animation.dbg"); + //setDebugOutput(getLogDirectory() + "animation.dbg"); + setDebugOutput(""); // no log // Create the animation set for all entities. _AnimationSet = Driver->createAnimationSet(); diff --git a/code/ryzom/client/src/far_tp.cpp b/code/ryzom/client/src/far_tp.cpp index 5b4870ad1..4f5b389a8 100644 --- a/code/ryzom/client/src/far_tp.cpp +++ b/code/ryzom/client/src/far_tp.cpp @@ -160,6 +160,7 @@ const std::string& CLoginStateMachine::toString(CLoginStateMachine::TEvent event #define SM_END_EVENT_TABLE \ } \ +/* #define SM_EVENT(eventId, stateId) \ if (ev == eventId) \ { \ @@ -178,6 +179,14 @@ const std::string& CLoginStateMachine::toString(CLoginStateMachine::TEvent event _CurrentState = stateId; \ break; \ } \ +*/ + +#define SM_EVENT(eventId, stateId) \ + if (ev == eventId) \ + { \ + _CurrentState = stateId; \ + break; \ + } \ extern std::string LoginLogin, LoginPassword; extern bool noUserChar; @@ -898,7 +907,7 @@ retryJoinEdit: // Save this error (regular log file is deleted at every startup) // res = res + "\n\n"; - try +/* try { COFile outputF; if ( outputF.open( getLogDirectory() + "error_join.log", true, true ) ) @@ -913,7 +922,7 @@ retryJoinEdit: } catch (const Exception &) {} - +*/ // If the session is not a permanent session and has vanished, pop the position if ( requestRetToMainland ) { diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index bb2540824..f8ea4aa04 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -686,7 +686,7 @@ void prelogInit() #ifdef NL_OS_WINDOWS _control87 (_EM_INVALID|_EM_DENORMAL/*|_EM_ZERODIVIDE|_EM_OVERFLOW*/|_EM_UNDERFLOW|_EM_INEXACT, _MCW_EM); #endif // NL_OS_WINDOWS - + CTime::CTimerInfo timerInfo; NLMISC::CTime::probeTimerInfo(timerInfo); if (timerInfo.RequiresSingleCore) // TODO: Also have a FV configuration value to force single core. @@ -787,7 +787,6 @@ void prelogInit() CPath::remapExtension ("png", "tga", true); FPU_CHECKER_ONCE - uint i; addPreDataPaths(ProgressBar); FPU_CHECKER_ONCE @@ -1045,7 +1044,7 @@ void prelogInit() // Set the monitor color properties CMonitorColorProperties monitorColor; - for (i=0; i<3; i++) + for (uint i=0; i<3; i++) { monitorColor.Contrast[i] = ClientCfg.Contrast; monitorColor.Luminosity[i] = ClientCfg.Luminosity; @@ -1068,6 +1067,9 @@ void prelogInit() // Init the DXTCCompression. Driver->forceDXTCCompression(ClientCfg.ForceDXTC); + // Set the anisotropic filter + Driver->setAnisotropicFilter(ClientCfg.AnisotropicFilter); + // Divide the texture size. if (ClientCfg.DivideTextureSizeBy2) Driver->forceTextureResize(2); diff --git a/code/ryzom/client/src/interface_v3/action_handler_help.cpp b/code/ryzom/client/src/interface_v3/action_handler_help.cpp index 4717cc8aa..10a814401 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_help.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_help.cpp @@ -1827,7 +1827,7 @@ void getSkillModVsType(CDBCtrlSheet *item, const CItemSheet*pIS, ucstring &itemT void getArmorBonus(CDBCtrlSheet *item, ucstring &itemText, const CItemSheet*pIS) { ucstring armor_bonus(""); - sint32 level; + sint32 level = 0; if (pIS->Armor.ArmorType == ARMORTYPE::HEAVY) level = item->getQuality(); @@ -3613,7 +3613,7 @@ public: uint8 index; fromString(Params, index); --index; // Param is 1-based so subtract 1 - if (index < 0 || index >= MAX_INVENTORY_ANIMAL) + if (index >= MAX_INVENTORY_ANIMAL) { return; } diff --git a/code/ryzom/client/src/interface_v3/action_handler_phrase.cpp b/code/ryzom/client/src/interface_v3/action_handler_phrase.cpp index 46dbb8c2c..cb317102c 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_phrase.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_phrase.cpp @@ -777,7 +777,7 @@ void CHandlerMemorizePhraseOrMacro::execute (CCtrlBase *pCaller, const string &P sint32 dstPhraseId= pCSDst->getSPhraseId(); sint32 dstMacroId= pCSDst->getMacroId(); - if ((src == "") && (CHandlerPhraseMemoryCopy::haveLastPhraseElement)) + if (src.empty() && (CHandlerPhraseMemoryCopy::haveLastPhraseElement)) { // get the slot ids from save srcIsMacro= CHandlerPhraseMemoryCopy::isMacro; @@ -1611,7 +1611,7 @@ public: virtual void execute(CCtrlBase * /* pCaller */, const string &Params) { CInterfaceManager *pIM= CInterfaceManager::getInstance(); - CCDBNodeLeaf *node= pIM->getDbProp("UI:PHRASE:SELECT_MEMORY_", false); + CCDBNodeLeaf *node= pIM->getDbProp("UI:PHRASE:SELECT_MEMORY", false); if(node) { sint32 val; @@ -1620,7 +1620,6 @@ public: } } }; - REGISTER_ACTION_HANDLER(CHandlerPhraseSelectShortcutBar, "select_shortcut_bar"); diff --git a/code/ryzom/client/src/interface_v3/animal_position_state.cpp b/code/ryzom/client/src/interface_v3/animal_position_state.cpp index d702a6226..074c1a556 100644 --- a/code/ryzom/client/src/interface_v3/animal_position_state.cpp +++ b/code/ryzom/client/src/interface_v3/animal_position_state.cpp @@ -255,7 +255,7 @@ void CAnimalPositionState::serial(NLMISC::IStream &f) // *************************************************************************** CEntityCL *CNamedEntityPositionState::getEntity() { - if (!dbOk()) return false; + if (!dbOk()) return NULL; return EntitiesMngr.getEntityByName(_Name->getValue32()); } diff --git a/code/ryzom/client/src/interface_v3/brick_learned_callback.h b/code/ryzom/client/src/interface_v3/brick_learned_callback.h index a0c9a4c48..8d8566443 100644 --- a/code/ryzom/client/src/interface_v3/brick_learned_callback.h +++ b/code/ryzom/client/src/interface_v3/brick_learned_callback.h @@ -30,6 +30,7 @@ class IBrickLearnedCallback { public: + virtual ~IBrickLearnedCallback() { } virtual void onBrickLearned() =0; }; diff --git a/code/ryzom/client/src/interface_v3/chat_displayer.h b/code/ryzom/client/src/interface_v3/chat_displayer.h index f98ed79f8..875859b78 100644 --- a/code/ryzom/client/src/interface_v3/chat_displayer.h +++ b/code/ryzom/client/src/interface_v3/chat_displayer.h @@ -25,6 +25,11 @@ #include "nel/misc/mutex.h" +// to fix a conflict with syslog.h being included by libwww +#ifdef LOG_WARNING +#undef LOG_WARNING +#endif + /** * class used to display console text commands in the chat window * \author Nicolas Brigand diff --git a/code/ryzom/client/src/interface_v3/chat_window.cpp b/code/ryzom/client/src/interface_v3/chat_window.cpp index 844b25299..50f8aaad9 100644 --- a/code/ryzom/client/src/interface_v3/chat_window.cpp +++ b/code/ryzom/client/src/interface_v3/chat_window.cpp @@ -925,27 +925,31 @@ void CChatGroupWindow::saveFreeTeller(NLMISC::IStream &f) { f.serialVersion(2); - // Save the free teller only if it is present in the friend list to avoid the only-growing situation - // because free tellers are never deleted in game if we save/load all the free tellers, we just create more - // and more container. + sint32 nNbFreeTellerSaved = 0; + f.serial(nNbFreeTellerSaved); - uint32 i, nNbFreeTellerSaved = 0; - for (i = 0; i < _FreeTellers.size(); ++i) - if (PeopleInterraction.FriendList.getIndexFromName(_FreeTellers[i]->getUCTitle()) != -1) - nNbFreeTellerSaved++; + // Don't save the free tellers + //// Save the free teller only if it is present in the friend list to avoid the only-growing situation + //// because free tellers are never deleted in game if we save/load all the free tellers, we just create more + //// and more container. - f.serial(nNbFreeTellerSaved); + //uint32 i, nNbFreeTellerSaved = 0; + //for (i = 0; i < _FreeTellers.size(); ++i) + // if (PeopleInterraction.FriendList.getIndexFromName(_FreeTellers[i]->getUCTitle()) != -1) + // nNbFreeTellerSaved++; - for (i = 0; i < _FreeTellers.size(); ++i) - { - CGroupContainer *pGC = _FreeTellers[i]; + //f.serial(nNbFreeTellerSaved); - if (PeopleInterraction.FriendList.getIndexFromName(pGC->getUCTitle()) != -1) - { - ucstring sTitle = pGC->getUCTitle(); - f.serial(sTitle); - } - } + //for (i = 0; i < _FreeTellers.size(); ++i) + //{ + // CGroupContainer *pGC = _FreeTellers[i]; + + // if (PeopleInterraction.FriendList.getIndexFromName(pGC->getUCTitle()) != -1) + // { + // ucstring sTitle = pGC->getUCTitle(); + // f.serial(sTitle); + // } + //} } //================================================================================= @@ -974,11 +978,12 @@ void CChatGroupWindow::loadFreeTeller(NLMISC::IStream &f) ucstring sTitle; f.serial(sTitle); - CGroupContainer *pGC = createFreeTeller(sTitle, ""); + // Don't actually create the free teller + //CGroupContainer *pGC = createFreeTeller(sTitle, ""); - // With version 1 all tells are active because windows information have "title based" ids and no "sID based". - if ((ver == 1) && (pGC != NULL)) - pGC->setActive(false); + //// With version 1 all tells are active because windows information have "title based" ids and no "sID based". + //if ((ver == 1) && (pGC != NULL)) + // pGC->setActive(false); } } diff --git a/code/ryzom/client/src/interface_v3/chat_window.h b/code/ryzom/client/src/interface_v3/chat_window.h index baf146f0a..ea68140b8 100644 --- a/code/ryzom/client/src/interface_v3/chat_window.h +++ b/code/ryzom/client/src/interface_v3/chat_window.h @@ -153,7 +153,7 @@ protected: // ctor CChatWindow(); // dtor - ~CChatWindow(); + virtual ~CChatWindow(); protected: IChatWindowListener *_Listener; NLMISC::CRefPtr _Chat; diff --git a/code/ryzom/client/src/interface_v3/ctrl_button.cpp b/code/ryzom/client/src/interface_v3/ctrl_button.cpp index a6fa08146..89f102e0b 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_button.cpp +++ b/code/ryzom/client/src/interface_v3/ctrl_button.cpp @@ -50,24 +50,21 @@ bool CCtrlButton::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup) if (prop) { string TxName = (const char *) prop; - TxName = strlwr(TxName); - _TextureIdNormal.setTexture(TxName.c_str()); + setTexture(toLower(TxName)); } prop = (char*) xmlGetProp( cur, (xmlChar*)"tx_pushed" ); if (prop) { string TxName = (const char *) prop; - TxName = strlwr(TxName); - _TextureIdPushed.setTexture(TxName.c_str()); + setTexturePushed(toLower(TxName)); } prop = (char*) xmlGetProp( cur, (xmlChar*)"tx_over" ); if (prop) { string TxName = (const char *) prop; - TxName = strlwr(TxName); - _TextureIdOver.setTexture(TxName.c_str()); + setTextureOver(toLower(TxName)); } // *** Misc. @@ -261,25 +258,19 @@ void CCtrlButton::updateCoords() // ---------------------------------------------------------------------------- void CCtrlButton::setTexture(const std::string&name) { -// CInterfaceManager *pIM = CInterfaceManager::getInstance(); -// CViewRenderer &rVR = pIM->getViewRenderer(); - _TextureIdNormal.setTexture(name.c_str()); + _TextureIdNormal.setTexture(name.c_str (), 0, 0, -1, -1, false); } // ---------------------------------------------------------------------------- void CCtrlButton::setTexturePushed(const std::string&name) { -// CInterfaceManager *pIM = CInterfaceManager::getInstance(); -// CViewRenderer &rVR = pIM->getViewRenderer(); - _TextureIdPushed.setTexture(name.c_str()); + _TextureIdPushed.setTexture(name.c_str (), 0, 0, -1, -1, false); } // ---------------------------------------------------------------------------- void CCtrlButton::setTextureOver(const std::string&name) { -// CInterfaceManager *pIM = CInterfaceManager::getInstance(); -// CViewRenderer &rVR = pIM->getViewRenderer(); - _TextureIdOver.setTexture(name.c_str()); + _TextureIdOver.setTexture(name.c_str (), 0, 0, -1, -1, false); } // ---------------------------------------------------------------------------- diff --git a/code/ryzom/client/src/interface_v3/dbgroup_combo_box.cpp b/code/ryzom/client/src/interface_v3/dbgroup_combo_box.cpp index 099016a40..94b816285 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_combo_box.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_combo_box.cpp @@ -34,6 +34,12 @@ NLMISC_REGISTER_OBJECT(CViewBase, CDBGroupComboBox, std::string, "combo_box"); extern bool loginFinished; +// Compare strings +static inline bool lt_text(const std::pair &s1, const std::pair &s2) +{ + return toLower(s1.second) < toLower(s2.second); +} + // *************************************************************************** CDBGroupComboBox::CDBGroupComboBox(const TCtorParam ¶m) : CInterfaceGroup(param) @@ -173,7 +179,7 @@ void CDBGroupComboBox::checkCoords () } else { - _ViewText->setText(_Texts[_CacheSelection]); + _ViewText->setText(_Texts[_CacheSelection].second); } } } @@ -205,7 +211,7 @@ void CDBGroupComboBox::resetTexts() void CDBGroupComboBox::addText(const ucstring &text) { dirt(); - _Texts.push_back(text); + _Texts.push_back(make_pair(_Texts.size(), text)); _Textures.push_back(std::string()); } @@ -214,7 +220,7 @@ void CDBGroupComboBox::setText(uint i, const ucstring &text) { dirt(); if(i<_Texts.size()) - _Texts[i]= text; + _Texts[i].second= text; } // *************************************************************************** @@ -223,14 +229,14 @@ void CDBGroupComboBox::insertText(uint i, const ucstring &text) dirt(); if(i<_Texts.size()) { - addText(_Texts[_Texts.size()-1]); + addText(_Texts[_Texts.size()-1].second); for(uint t=i; t<_Texts.size()-1; t++) { _Texts[t+1] = _Texts[t]; _Textures[t+1] = _Textures[t]; } - _Texts[i]= text; + _Texts[i] = make_pair(i, text); _Textures[i] = std::string(); } else if(i==_Texts.size()) @@ -246,13 +252,13 @@ void CDBGroupComboBox::setTexture(uint i, const ucstring &texture) } // *************************************************************************** -void CDBGroupComboBox::removeText(uint i) +void CDBGroupComboBox::removeText(uint nPos) { dirt(); - if(i<_Texts.size()) + if(nPos<_Texts.size()) { - _Texts.erase( _Texts.begin()+i ); - _Textures.erase( _Textures.begin()+i ); + _Texts.erase( _Texts.begin()+nPos ); + _Textures.erase( _Textures.begin()+nPos ); } } @@ -261,11 +267,37 @@ const ucstring &CDBGroupComboBox::getText(uint i) const { static ucstring null; if(i<_Texts.size()) - return _Texts[i]; + return _Texts[i].second; + else + return null; +} + +// *************************************************************************** +const uint &CDBGroupComboBox::getTextId(uint i) const +{ + static uint null = 0; + if(i<_Texts.size()) + return _Texts[i].first; else return null; } +// *************************************************************************** +uint CDBGroupComboBox::getTextPos(uint nId) const +{ + for(uint i=0; i<_Texts.size(); i++) + { + if(nId == _Texts[i].first) {return i;} + } + return 0; +} + +// *************************************************************************** +void CDBGroupComboBox::sortText() +{ + sort(_Texts.begin(), _Texts.end(), lt_text); +} + // *************************************************************************** const ucstring &CDBGroupComboBox::getTexture(uint i) const { @@ -355,7 +387,7 @@ void CDBGroupComboBox::setViewText(const ucstring & text) // *************************************************************************** ucstring CDBGroupComboBox::getViewText() const { - return _ViewText->getText(); + return _ViewText->getText(); } // *************************************************************************** diff --git a/code/ryzom/client/src/interface_v3/dbgroup_combo_box.h b/code/ryzom/client/src/interface_v3/dbgroup_combo_box.h index fe92d19ad..4d74508ad 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_combo_box.h +++ b/code/ryzom/client/src/interface_v3/dbgroup_combo_box.h @@ -66,9 +66,12 @@ public: void setText(uint i, const ucstring &text); void insertText(uint i, const ucstring &text); const ucstring &getText(uint i) const; + const uint &getTextId(uint i) const; + uint getTextPos(uint nId) const; const ucstring &getTexture(uint i) const; - void removeText(uint i); + void removeText(uint nPos); uint getNumTexts() const {return (uint)_Texts.size();} + void sortText(); // selection void setSelection(sint32 val); @@ -125,32 +128,32 @@ public: protected: friend class CHandlerComboBoxSelectStart; - bool _LinkedToDB; // if not linked to db, then _NotLinkedToDBSelection is used instead - bool _Setuped; - bool _DirtySelection; - sint32 _CacheSelection; + bool _LinkedToDB; // if not linked to db, then _NotLinkedToDBSelection is used instead + bool _Setuped; + bool _DirtySelection; + sint32 _CacheSelection; // sint32 - CInterfaceProperty _Selection; - sint32 _NotLinkedToDBSelection; - std::vector _Texts; - std::vector _Textures; + CInterfaceProperty _Selection; + sint32 _NotLinkedToDBSelection; + std::vector > _Texts; + std::vector _Textures; // Action Handler called on combo click - std::string _AHOnSelectStart; + std::string _AHOnSelectStart; // Action handler called when the content is changed - std::string _AHOnChange; - std::string _AHOnChangeParams; - bool _CallingOnChangeActionHandler; // avoid infinite loop here + std::string _AHOnChange; + std::string _AHOnChangeParams; + bool _CallingOnChangeActionHandler; // avoid infinite loop here // Children - CViewText *_ViewText; - CCtrlBaseButton *_SelectButton; + CViewText *_ViewText; + CCtrlBaseButton *_SelectButton; - bool _IsExternViewText; - ucstring _ExternViewText; + bool _IsExternViewText; + ucstring _ExternViewText; private: diff --git a/code/ryzom/client/src/interface_v3/group_html.cpp b/code/ryzom/client/src/interface_v3/group_html.cpp index 5b8a03d56..65983c861 100644 --- a/code/ryzom/client/src/interface_v3/group_html.cpp +++ b/code/ryzom/client/src/interface_v3/group_html.cpp @@ -148,7 +148,7 @@ void CGroupHTML::addImageDownload(const string &url, CViewBase *img) nlwarning("add to download '%s' dest '%s' img %p", url.c_str(), dest.c_str(), img); #endif - // erase the tmp file if exists + // erase the tmp file if exists if (NLMISC::CFile::fileExists(tmpdest)) NLMISC::CFile::deleteFile(tmpdest); @@ -3221,7 +3221,7 @@ void CGroupHTML::handle () else { /* Add our own request terminate handler. Nb: pass as param a UID, not the ptr */ - HTNet_addAfter(requestTerminater, NULL, (void*)_GroupHtmlUID, HT_ALL, HT_FILTER_LAST); + HTNet_addAfter(requestTerminater, NULL, (void*)(size_t)_GroupHtmlUID, HT_ALL, HT_FILTER_LAST); /* Set the timeout for long we are going to wait for a response */ HTHost_setEventTimeout(60000); @@ -3367,7 +3367,7 @@ void CGroupHTML::handle () else { /* Add our own request terminate handler. Nb: pass as param a UID, not the ptr */ - HTNet_addAfter(requestTerminater, NULL, (void*)_GroupHtmlUID, HT_ALL, HT_FILTER_LAST); + HTNet_addAfter(requestTerminater, NULL, (void*)(size_t)_GroupHtmlUID, HT_ALL, HT_FILTER_LAST); /* Start the first request */ diff --git a/code/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp b/code/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp index 63e76ecc4..c20615600 100644 --- a/code/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp +++ b/code/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp @@ -138,6 +138,14 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity) ucstring entityName = entity->getDisplayName(); ucstring entityTitle = entity->getTitle(); + // For some NPC's the name is empty and only a title is given, + // in that case, treat the title as the name. + if (entityName.empty()) + { + entityName = entityTitle; + entityTitle.clear(); + } + ucstring entityTag1 = entity->getTag(1); ucstring entityTag2 = entity->getTag(2); ucstring entityTag3 = entity->getTag(3); @@ -174,7 +182,7 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity) bars[i]= false; name= !entityName.empty() && pIM->getDbProp(dbEntry+"NPCNAME")->getValueBool(); symbol= false; - title= (entityName.empty() && pIM->getDbProp(dbEntry+"NPCNAME")->getValueBool()) || pIM->getDbProp(dbEntry+"NPCTITLE")->getValueBool(); + title= !entityTitle.empty() && pIM->getDbProp(dbEntry+"NPCTITLE")->getValueBool(); guildName= false; templateName = "in_scene_user_info"; rpTags = (!entityTag1.empty() || !entityTag2.empty() || !entityTag3.empty() || !entityTag4.empty() ) && pIM->getDbProp(dbEntry+"RPTAGS")->getValueBool(); @@ -251,8 +259,8 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity) if (strnicmp(sFame.c_str(),"tribe_",6)==0) { tribeName = true; - // always display title for tribe - title = true; + //// always display title for tribe + //title = true; theTribeName = STRING_MANAGER::CStringManagerClient::getFactionLocalizedName(sFame); // tribeName stuff disable any guild name guildName= false; @@ -511,13 +519,13 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity) { info->delView(logoOver); } - //leftGroup->setW( leftGroup->getW() + 42 ); + leftGroup->setW( leftGroup->getW() + 42 ); } else { info->delView(logo); info->delView(logoOver); - //leftGroup->setX(0); + leftGroup->setX(0); } leftGroup->invalidateCoords(); } @@ -887,6 +895,8 @@ void CGroupInSceneUserInfo::updateDynamicData () _Name->setColor(entityColor); _Name->setModulateGlobalColor(false); ucstring entityName = _Entity->getDisplayName(); + if (entityName.empty()) + entityName = _Entity->getTitle(); if (pPlayer != NULL) if (pPlayer->isAFK()) entityName += CI18N::get("uiAFK"); diff --git a/code/ryzom/client/src/interface_v3/group_map.cpp b/code/ryzom/client/src/interface_v3/group_map.cpp index b1c8387d7..4347a3380 100644 --- a/code/ryzom/client/src/interface_v3/group_map.cpp +++ b/code/ryzom/client/src/interface_v3/group_map.cpp @@ -26,6 +26,7 @@ #include "../user_entity.h" #include "ctrl_button.h" #include "group_editbox.h" +#include "dbgroup_combo_box.h" #include "../string_manager_client.h" #include "group_container.h" #include "action_handler.h" @@ -79,7 +80,8 @@ static CGroupMap *LastClickedMap = NULL; static CCtrlButton *LastSelectedLandMark = NULL; static bool UseUserPositionForLandMark = false; static const char *WIN_LANDMARK_NAME="ui:interface:enter_landmark_name"; - +// Loaded position of user landmark types +static std::vector LoadedPosition; //////////// // GLOBAL // @@ -110,6 +112,10 @@ static void popupLandMarkNameDialog() CGroupEditBox *eb = dynamic_cast(gc->getGroup("eb")); if (!eb) return; + // Load ComboBox for Landmarks & sort entries + CDBGroupComboBox *cb = dynamic_cast(gc->getGroup("landmarktypes")); + cb->sortText(); + if (LastSelectedLandMark) { CGroupMap *map = dynamic_cast(LastSelectedLandMark->getParent()); @@ -117,12 +123,12 @@ static void popupLandMarkNameDialog() const CUserLandMark userLM = map->getUserLandMark(LastSelectedLandMark); - im->getDbProp( "UI:TEMP:LANDMARKTYPE" )->setValue8(userLM.Type); + im->getDbProp( "UI:TEMP:LANDMARKTYPE" )->setValue8(cb->getTextPos(userLM.Type)); eb->setInputString(userLM.Title); } else { - im->getDbProp( "UI:TEMP:LANDMARKTYPE" )->setValue8(CUserLandMark::Misc); + im->getDbProp( "UI:TEMP:LANDMARKTYPE" )->setValue8(cb->getTextPos(CUserLandMark::Misc)); eb->setInputString(ucstring()); } @@ -132,6 +138,7 @@ static void popupLandMarkNameDialog() static void closeLandMarkNameDialog() { + LoadedPosition.clear(); CInterfaceManager *im = CInterfaceManager::getInstance(); CGroupContainer *gc = dynamic_cast(im->getElementFromId(WIN_LANDMARK_NAME)); if (!gc) return; @@ -3202,10 +3209,14 @@ class CAHValidateUserLandMarkName : public IActionHandler CGroupEditBox *eb = dynamic_cast(ig->getGroup("eb")); if (!eb) return; ig->setActive(false); + CGroupContainer *gc = dynamic_cast(im->getElementFromId(WIN_LANDMARK_NAME)); + if (!gc) return; + // Retrieve ComboBox to get the position(ordered landmark type) of the selected item + CDBGroupComboBox *cb = dynamic_cast(gc->getGroup("landmarktypes")); CUserLandMark::EUserLandMarkType landMarkType = CUserLandMark::Misc; - sint8 nLandMarkType = im->getDbProp( "UI:TEMP:LANDMARKTYPE" )->getValue8(); + sint8 nLandMarkType = cb->getTextId(im->getDbProp( "UI:TEMP:LANDMARKTYPE" )->getValue8()); if (nLandMarkType>=0 && nLandMarkType<=CUserLandMark::UserLandMarkTypeCount) { landMarkType = (CUserLandMark::EUserLandMarkType)nLandMarkType; diff --git a/code/ryzom/client/src/interface_v3/group_menu.cpp b/code/ryzom/client/src/interface_v3/group_menu.cpp index 758225205..36dfaeebe 100644 --- a/code/ryzom/client/src/interface_v3/group_menu.cpp +++ b/code/ryzom/client/src/interface_v3/group_menu.cpp @@ -102,7 +102,7 @@ void CViewTextMenu::setAlpha (sint32 a) { OldShadowColor.A = OldColor.A = (uint8)a; OldShadowColorOver.A = OldColorOver.A = (uint8)a; - OldShadowColorGrayed.A = OldShadowColorGrayed.A = (uint8)a; + OldShadowColorGrayed.A = OldColorGrayed.A = (uint8)a; } // ------------------------------------------------------------------------------------------------ diff --git a/code/ryzom/client/src/interface_v3/guild_manager.cpp b/code/ryzom/client/src/interface_v3/guild_manager.cpp index d1f8a2c9f..dce9558f9 100644 --- a/code/ryzom/client/src/interface_v3/guild_manager.cpp +++ b/code/ryzom/client/src/interface_v3/guild_manager.cpp @@ -362,44 +362,47 @@ void CGuildManager::update() if (node && node->getValueBool()) { // See if we need to show any online/offline messages - static vector CachedGuildMembers; + static map CachedGuildMembers; ucstring onlineMessage = CI18N::get("uiPlayerOnline"); ucstring offlineMessage = CI18N::get("uiPlayerOffline"); for (uint i = 0; i < _GuildMembers.size(); ++i) { - for (uint j = 0; j < CachedGuildMembers.size(); ++j) + map::const_iterator it = CachedGuildMembers.find(_GuildMembers[i].Name); + if ( it != CachedGuildMembers.end() ) { - // Status change is from offline to online/abroad online or vice versa. - TCharConnectionState prevState = CachedGuildMembers[j].Online; - TCharConnectionState curState = _GuildMembers[i].Online; - bool showMsg = (prevState != curState) && - (CachedGuildMembers[j].Name == _GuildMembers[i].Name) && - (prevState == ccs_offline || curState == ccs_offline); - - if (showMsg) + if ( (*it).second.Online == _GuildMembers[i].Online) { - ucstring msg = (_GuildMembers[i].Online != ccs_offline) ? onlineMessage : offlineMessage; - strFindReplace(msg, "%s", _GuildMembers[i].Name); - string cat = getStringCategory(msg, msg); - map::const_iterator it; - NLMISC::CRGBA col = CRGBA::Yellow; - it = ClientCfg.SystemInfoParams.find(toLower(cat)); - if (it != ClientCfg.SystemInfoParams.end()) - { - col = it->second.Color; - } - bool dummy; - PeopleInterraction.ChatInput.Guild.displayMessage(msg, col, 2, &dummy); - break; + // Online status not changed for this member + continue; } + + if ( (*it).second.Online != ccs_offline && _GuildMembers[i].Online != ccs_offline) + { + // Not from offline, or to offline, so don't show anything + continue; + } + + ucstring msg = (_GuildMembers[i].Online != ccs_offline) ? onlineMessage : offlineMessage; + strFindReplace(msg, "%s", _GuildMembers[i].Name); + string cat = getStringCategory(msg, msg); + map::const_iterator it; + NLMISC::CRGBA col = CRGBA::Yellow; + it = ClientCfg.SystemInfoParams.find(toLower(cat)); + if (it != ClientCfg.SystemInfoParams.end()) + { + col = it->second.Color; + } + bool dummy; + PeopleInterraction.ChatInput.Guild.displayMessage(msg, col, 2, &dummy); + break; } } CachedGuildMembers.clear(); for (uint i = 0; i < _GuildMembers.size(); ++i) { - CachedGuildMembers.push_back(_GuildMembers[i]); + CachedGuildMembers.insert(make_pair(_GuildMembers[i].Name, _GuildMembers[i])); } } diff --git a/code/ryzom/client/src/interface_v3/interface_anim.h b/code/ryzom/client/src/interface_v3/interface_anim.h index abce8f41e..8401f88e4 100644 --- a/code/ryzom/client/src/interface_v3/interface_anim.h +++ b/code/ryzom/client/src/interface_v3/interface_anim.h @@ -37,7 +37,7 @@ class CInterfaceTrack public: CInterfaceTrack(); - ~CInterfaceTrack(); + virtual ~CInterfaceTrack(); virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup); @@ -90,7 +90,7 @@ class CInterfaceAnim public: CInterfaceAnim(); - ~CInterfaceAnim(); + virtual ~CInterfaceAnim(); virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup); diff --git a/code/ryzom/client/src/interface_v3/interface_expr.cpp b/code/ryzom/client/src/interface_v3/interface_expr.cpp index 3f395e0b4..91a6cb7f3 100644 --- a/code/ryzom/client/src/interface_v3/interface_expr.cpp +++ b/code/ryzom/client/src/interface_v3/interface_expr.cpp @@ -78,11 +78,11 @@ CInterfaceExprNode *CInterfaceExpr::buildExprTree(const std::string &expr) { std::string tempStr; formatLuaCall(expr, tempStr); - if (!buildExprTree(tempStr.c_str(), node)) return false; + if (buildExprTree(tempStr.c_str(), node) == NULL) return NULL; } else { - if (!buildExprTree(expr.c_str(), node)) return false; + if (buildExprTree(expr.c_str(), node) == NULL) return NULL; } return node; diff --git a/code/ryzom/client/src/interface_v3/interface_manager.cpp b/code/ryzom/client/src/interface_v3/interface_manager.cpp index a9a901283..52c185b58 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/code/ryzom/client/src/interface_v3/interface_manager.cpp @@ -1563,7 +1563,7 @@ bool CInterfaceManager::loadConfig (const string &filename) CIFile f; string sFileName; sFileName = NLMISC::CPath::lookup (filename, false); - if (sFileName == "" || !f.open(sFileName)) + if (sFileName.empty() || !f.open(sFileName)) return false; diff --git a/code/ryzom/client/src/interface_v3/interface_manager.h b/code/ryzom/client/src/interface_v3/interface_manager.h index 0de08d491..85ee99b67 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.h +++ b/code/ryzom/client/src/interface_v3/interface_manager.h @@ -222,6 +222,7 @@ public: class IStringProcess { public: + virtual ~IStringProcess() { } virtual bool cbIDStringReceived(ucstring &inOut) = 0; // called when string or id is received (return true if valid the change) }; diff --git a/code/ryzom/client/src/interface_v3/item_consumable_effect.cpp b/code/ryzom/client/src/interface_v3/item_consumable_effect.cpp index 52a3f64b7..6e50666b1 100644 --- a/code/ryzom/client/src/interface_v3/item_consumable_effect.cpp +++ b/code/ryzom/client/src/interface_v3/item_consumable_effect.cpp @@ -43,7 +43,7 @@ void CItemConsumableEffectHelper::getItemConsumableEffectText(const CItemSheet * { CSString eff = pIS->Consumable.Properties[i]; - if (eff == "") + if (eff.empty()) continue; // Get name id of effect diff --git a/code/ryzom/client/src/interface_v3/lua_ihm.cpp b/code/ryzom/client/src/interface_v3/lua_ihm.cpp index c0500eeb7..9e5160a4e 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm.cpp @@ -1228,7 +1228,7 @@ void CLuaIHM::createLuaEnumTable(CLuaState &ls, const std::string &str) p = s.splitTo('.', true); while (p.size() > 0) { - if (path == "") + if (path.empty()) path = p; else path += "." + p; diff --git a/code/ryzom/client/src/interface_v3/view_bitmap.cpp b/code/ryzom/client/src/interface_v3/view_bitmap.cpp index 3960cb674..b71cbb464 100644 --- a/code/ryzom/client/src/interface_v3/view_bitmap.cpp +++ b/code/ryzom/client/src/interface_v3/view_bitmap.cpp @@ -221,9 +221,6 @@ void CViewBitmap::updateCoords() // ---------------------------------------------------------------------------- void CViewBitmap::setTexture(const std::string & TxName) { -// CInterfaceManager *pIM = CInterfaceManager::getInstance(); -// CViewRenderer &rVR = pIM->getViewRenderer(); - _TextureId.setTexture (TxName.c_str (), _TxtOffsetX, _TxtOffsetY, _TxtWidth, _TxtHeight, false); } diff --git a/code/ryzom/client/src/interface_v3/view_radar.cpp b/code/ryzom/client/src/interface_v3/view_radar.cpp index 6c5f4eaf4..5f3cb77d1 100644 --- a/code/ryzom/client/src/interface_v3/view_radar.cpp +++ b/code/ryzom/client/src/interface_v3/view_radar.cpp @@ -39,6 +39,25 @@ NLMISC_REGISTER_OBJECT(CViewBase, CViewRadar, std::string, "radar"); // ---------------------------------------------------------------------------- +CViewRadar::CViewRadar(const TCtorParam ¶m) + : CViewBase(param) +{ + CInterfaceManager *pIM = CInterfaceManager::getInstance(); + CCDBNodeLeaf *pUIMI = pIM->getDbProp( "UI:SAVE:INSCENE:FRIEND:MISSION_ICON" ); + if (pUIMI) + { + ICDBNode::CTextId textId; + pUIMI->addObserver( &_MissionIconsObs, textId); + } + + CCDBNodeLeaf *pUIMMI = pIM->getDbProp( "UI:SAVE:INSCENE:FRIEND:MINI_MISSION_ICON" ); + if (pUIMMI) + { + ICDBNode::CTextId textId; + pUIMMI->addObserver( &_MiniMissionSpotsObs, textId); + } +} + bool CViewRadar::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup) { CXMLAutoPtr prop; @@ -109,8 +128,9 @@ void CViewRadar::draw () CEntityCL *user = EntitiesMngr.entity(0); if (user == NULL) return; + CVectorD xyzRef = user->pos(); - CVector dir = user->front(); + const CVector dir = user->front(); float angle = (float)(atan2(dir.y, dir.x) - (Pi / 2.0)); CMatrix mat; @@ -124,9 +144,6 @@ void CViewRadar::draw () float maxSqrRadius= (float)sqr(_WorldSize/2); - const bool displayMissionSpots = pIM->getDbProp("UI:SAVE:INSCENE:FRIEND:MISSION_ICON")->getValueBool(); - const bool displayMiniMissionSpots = pIM->getDbProp("UI:SAVE:INSCENE:FRIEND:MINI_MISSION_ICON")->getValueBool(); - for (sint32 i = 1; i < 256; ++i) { CEntityCL *entity = EntitiesMngr.entity(i); @@ -160,8 +177,8 @@ void CViewRadar::draw () // Select the icon to display and draw it uint spotId = CNPCIconCache::getInstance().getNPCIcon(entity).getSpotId(); CRadarSpotDesc spotDesc = _SpotDescriptions[spotId]; - - if (!displayMissionSpots) + + if (!_MissionIconsObs._displayMissionSpots) spotDesc = _SpotDescriptions[0]; if (spotDesc.isMissionSpot) @@ -171,7 +188,7 @@ void CViewRadar::draw () spotId = 4; // to make it over other spots // Draw it (and make sure mission icons are drawn over regular dot; caution: don't exceed the render layer range) - if (spotDesc.isMissionSpot && displayMiniMissionSpots) + if (spotDesc.isMissionSpot && _MiniMissionSpotsObs._displayMiniMissionSpots) rVR.drawRotFlipBitmap (_RenderLayer+spotId, _XReal+x-(spotDesc.MTxW/2)+(_WReal/2), _YReal+y-(spotDesc.MTxH/2)+(_HReal/2), spotDesc.MTxW, spotDesc.MTxH, 0, false, spotDesc.MiniTextureId, col ); else @@ -185,3 +202,13 @@ void CViewRadar::updateCoords() { CViewBase::updateCoords(); } + +void CViewRadar::CDBMissionIconqObs::update(ICDBNode *node) +{ + _displayMissionSpots = ((CCDBNodeLeaf*)node)->getValueBool(); +} + +void CViewRadar::CDBMiniMissionSpotsObs::update(ICDBNode *node) +{ + _displayMiniMissionSpots = ((CCDBNodeLeaf*)node)->getValueBool(); +} diff --git a/code/ryzom/client/src/interface_v3/view_radar.h b/code/ryzom/client/src/interface_v3/view_radar.h index b2eb31685..0f9fc1a5f 100644 --- a/code/ryzom/client/src/interface_v3/view_radar.h +++ b/code/ryzom/client/src/interface_v3/view_radar.h @@ -45,9 +45,7 @@ public: }; /// Constructor - CViewRadar(const TCtorParam ¶m) : CViewBase(param) - { - } + CViewRadar(const TCtorParam ¶m); bool parse(xmlNodePtr cur,CInterfaceGroup * parentGroup); @@ -79,7 +77,24 @@ protected: sint32 MTxH; }; +private: CRadarSpotDesc _SpotDescriptions[NbRadarSpotIds]; + + class CDBMissionIconqObs : public ICDBNode::IPropertyObserver + { + public: + virtual void update(ICDBNode *node); + bool _displayMissionSpots; + }; + CDBMissionIconqObs _MissionIconsObs; + + class CDBMiniMissionSpotsObs : public ICDBNode::IPropertyObserver + { + public: + virtual void update(ICDBNode *node); + bool _displayMiniMissionSpots; + }; + CDBMiniMissionSpotsObs _MiniMissionSpotsObs; }; #endif // RY_VIEW_RADAR_H diff --git a/code/ryzom/client/src/interface_v3/view_renderer.cpp b/code/ryzom/client/src/interface_v3/view_renderer.cpp index 3655697b6..8be60402a 100644 --- a/code/ryzom/client/src/interface_v3/view_renderer.cpp +++ b/code/ryzom/client/src/interface_v3/view_renderer.cpp @@ -707,7 +707,7 @@ void CViewRenderer::loadTextures (const std::string &textureFileName, const std: SGlobalTexture gt; // Load texture file string filename = CPath::lookup (textureFileName, false); - if (filename == "") return; + if (filename.empty()) return; CIFile ifTmp; if (ifTmp.open(filename)) CBitmap::loadSize (ifTmp, gt.Width, gt.Height); @@ -724,7 +724,7 @@ void CViewRenderer::loadTextures (const std::string &textureFileName, const std: // Load uv file CIFile iFile; filename = CPath::lookup (uvFileName, false); - if (filename == "") return; + if (filename.empty()) return; if (!iFile.open(filename)) return; _GlobalTextures.push_back (gt); @@ -866,7 +866,7 @@ sint32 CViewRenderer::createTexture (const std::string &sGlobalTextureName, SGlobalTexture gtTmp; gtTmp.FromGlobaleTexture = false; string filename = CPath::lookup (sLwrGTName, false); - if (filename == "") return -1; + if (filename.empty()) return -1; CIFile ifTmp; if (ifTmp.open(filename)) { diff --git a/code/ryzom/client/src/libwww.cpp b/code/ryzom/client/src/libwww.cpp index 33e29fab7..4aa31d180 100644 --- a/code/ryzom/client/src/libwww.cpp +++ b/code/ryzom/client/src/libwww.cpp @@ -31,6 +31,10 @@ extern "C" #include "interface_v3/libwww_nel_stream.h" +#ifdef HAVE_REVISION_H +#include "revision.h" +#endif + using namespace NLMISC; /// the cookie value for session identification (nel cookie) @@ -552,8 +556,35 @@ void initLibWWW() /* Initiate libwww */ +#if defined(HAVE_X86_64) + #define RYZOM_ARCH "x64" +#elif defined(HAVE_X86) + #define RYZOM_ARCH "x86" +#elif defined(HAVE_ARM) + #define RYZOM_ARCH "arm" +#else + #define RYZOM_ARCH "unknow" +#endif + +#if defined(NL_OS_WINDOWS) + #define RYZOM_SYSTEM "windows" +#elif defined(NL_OS_MAC) + #define RYZOM_SYSTEM "mac" +#elif defined(NL_OS_UNIX) + #define RYZOM_SYSTEM "unix" +#else + #define RYZOM_SYSTEM "unkown" +#endif + char buffer[256]; + +#ifdef REVISION + sprintf(buffer, "%s.%s-%s-%s", RYZOM_VERSION, REVISION, RYZOM_SYSTEM, RYZOM_ARCH); +#else + sprintf(buffer, "%s-%s-%s", RYZOM_VERSION, RYZOM_SYSTEM, RYZOM_ARCH); +#endif + HTLib_setAppName("Ryzom"); - HTLib_setAppVersion(RYZOM_VERSION); + HTLib_setAppVersion(buffer); /* Set up TCP as transport */ VerifyLibWWW("HTTransport_add", HTTransport_add("buffered_tcp", HT_TP_SINGLE, HTReader_new, HTBufferWriter_new)); diff --git a/code/ryzom/client/src/login_patch.cpp b/code/ryzom/client/src/login_patch.cpp index c14488de0..bf3910dcf 100644 --- a/code/ryzom/client/src/login_patch.cpp +++ b/code/ryzom/client/src/login_patch.cpp @@ -254,7 +254,7 @@ void CPatchManager::init(const std::vector& patchURIs, const std::s } srand(NLMISC::CTime::getSecondsSince1970()); - UsedServer = (sint)((float)(rand() / (RAND_MAX+1)) * (sint)PatchServers.size()); + UsedServer = (sint)(((double)rand() / ((double)RAND_MAX+1.0)) * (double)PatchServers.size()); ServerPath = CPath::standardizePath (sServerPath); ServerVersion = sServerVersion; diff --git a/code/ryzom/client/src/net_manager.cpp b/code/ryzom/client/src/net_manager.cpp index 397414deb..0e7d31c79 100644 --- a/code/ryzom/client/src/net_manager.cpp +++ b/code/ryzom/client/src/net_manager.cpp @@ -963,7 +963,6 @@ void impulseFarTell(NLMISC::CBitMemStream &impulse) ChatMngr.processFarTellString(impulse, InterfaceChatDisplayer); } - void impulseTell2(NLMISC::CBitMemStream &impulse) { ChatMngr.processTellString2(impulse, InterfaceChatDisplayer); diff --git a/code/ryzom/client/src/pacs_client.cpp b/code/ryzom/client/src/pacs_client.cpp index 04fd5cae9..5924cc935 100644 --- a/code/ryzom/client/src/pacs_client.cpp +++ b/code/ryzom/client/src/pacs_client.cpp @@ -139,7 +139,7 @@ UInstanceGroup *getCluster(const UGlobalPosition &gp) return 0; const string &strPos = GR->getIdentifier(gp); - if(strPos == "") + if(strPos.empty()) return 0; // try to find the ig in the loaded ig map std::map::const_iterator igIt = IGLoaded.find(strlwr(strPos)); diff --git a/code/ryzom/client/src/r2/dmc/dmc.h b/code/ryzom/client/src/r2/dmc/dmc.h index 1d6f9c121..9dca0e5fc 100644 --- a/code/ryzom/client/src/r2/dmc/dmc.h +++ b/code/ryzom/client/src/r2/dmc/dmc.h @@ -65,7 +65,7 @@ namespace R2 void loadFeatures(); - ~CDynamicMapClient(); + virtual ~CDynamicMapClient(); void loadDefaultPalette(); diff --git a/code/ryzom/client/src/r2/editor.cpp b/code/ryzom/client/src/r2/editor.cpp index e8db1b390..24d8f06c0 100644 --- a/code/ryzom/client/src/r2/editor.cpp +++ b/code/ryzom/client/src/r2/editor.cpp @@ -6603,7 +6603,7 @@ NLMISC::CVectorD getVectorD(const CObject *obj) CObject *buildVector(const NLMISC::CVectorD &vector, const std::string &instanceId /*= ""*/) { CObject *table; - if (instanceId == "") + if (instanceId.empty()) { table = getEditor().getDMC().newComponent("Position"); table->set("x", vector.x); diff --git a/code/ryzom/client/src/session_browser.cpp b/code/ryzom/client/src/session_browser.cpp index e6932c4a2..4cae87fee 100644 --- a/code/ryzom/client/src/session_browser.cpp +++ b/code/ryzom/client/src/session_browser.cpp @@ -165,7 +165,7 @@ void CSessionBrowser::run() } disconnected: - // unconnected, waiting for message to send + // disconnected, waiting for message to send while (adaptor->_SendQueue.empty()) { nlSleep(100); diff --git a/code/ryzom/client/src/seven_zip/CMakeLists.txt b/code/ryzom/client/src/seven_zip/CMakeLists.txt index 85212084e..cc152757b 100644 --- a/code/ryzom/client/src/seven_zip/CMakeLists.txt +++ b/code/ryzom/client/src/seven_zip/CMakeLists.txt @@ -1,16 +1,9 @@ -FILE(GLOB SRC *.cpp *.h) +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) FILE(GLOB LIB_SRC *.cpp *.h) LIST(REMOVE_ITEM LIB_SRC ${CMAKE_CURRENT_SOURCE_DIR}/7zMain.cpp) -ADD_EXECUTABLE(7zDec ${SRC}) - -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) -#TARGET_LINK_LIBRARIES(7zDec ${PLATFORM_LINKFLAGS}) -NL_DEFAULT_PROPS(7zDec "Ryzom, Tools, Misc: Seven Zip Decoder") -NL_ADD_RUNTIME_FLAGS(7zDec) - NL_TARGET_LIB(ryzom_sevenzip ${LIB_SRC}) # TARGET_LINK_LIBRARIES(ryzom_sevenzip ${PLATFORM_LINKFLAGS}) NL_DEFAULT_PROPS(ryzom_sevenzip "Ryzom, Library: Seven Zip") @@ -20,6 +13,15 @@ NL_ADD_LIB_SUFFIX(ryzom_sevenzip) ADD_DEFINITIONS(-D_SZ_ONE_DIRECTORY) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) - INSTALL(TARGETS ryzom_sevenzip LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) - INSTALL(TARGETS 7zDec RUNTIME DESTINATION bin COMPONENT client) + INSTALL(TARGETS ryzom_sevenzip LIBRARY DESTINATION ${RYZOM_LIB_PREFIX} ARCHIVE DESTINATION ${RYZOM_LIB_PREFIX} COMPONENT libraries) ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) + +IF(WITH_RYZOM_TOOLS) + ADD_EXECUTABLE(7zDec ${CMAKE_CURRENT_SOURCE_DIR}/7zMain.cpp) + + TARGET_LINK_LIBRARIES(7zDec ryzom_sevenzip) + NL_DEFAULT_PROPS(7zDec "Ryzom, Tools, Misc: Seven Zip Decoder") + NL_ADD_RUNTIME_FLAGS(7zDec) + + INSTALL(TARGETS 7zDec RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) +ENDIF(WITH_RYZOM_TOOLS) diff --git a/code/ryzom/client/src/sheet_manager.cpp b/code/ryzom/client/src/sheet_manager.cpp index d467112b9..cdb9b4ff1 100644 --- a/code/ryzom/client/src/sheet_manager.cpp +++ b/code/ryzom/client/src/sheet_manager.cpp @@ -55,8 +55,8 @@ using namespace NLGEORGES; // Sheet manager. CSheetManager SheetMngr; UFormLoader *CSheetManager::FormLoader = NULL; -COFile fItemAssoc; -bool ItemAssocFileOpen = false; +//COFile fItemAssoc; +//bool ItemAssocFileOpen = false; // there can be several instance of CSheetManager (for reload operations) -> ctruct the loader here rather than in CSheetManager ctor class CFormLoaderInit @@ -598,17 +598,17 @@ void CSheetManager::release() void CSheetManager::load(NLMISC::IProgressCallback &callBack, bool updatePackedSheet, bool needComputeVS, bool dumpVSIndex) { // Open The Item Association File - if(!fItemAssoc.open(getLogDirectory() + "item_association.dbg", false, true)) - nlwarning("CSheetManager::load: Cannot Open the 'item_association.txt'."); - else - ItemAssocFileOpen = true; +// if(!fItemAssoc.open(getLogDirectory() + "item_association.dbg", false, true)) +// nlwarning("CSheetManager::load: Cannot Open the 'item_association.txt'."); +// else +// ItemAssocFileOpen = true; // Initialize the Sheet DB. loadAllSheet(callBack, updatePackedSheet, needComputeVS, dumpVSIndex); // Close the Item Association File. - fItemAssoc.close(); - ItemAssocFileOpen = false; +// fItemAssoc.close(); +// ItemAssocFileOpen = false; // Optimize memory taken by all strings of all sheets ClientSheetsStrings.memoryCompress(); diff --git a/code/ryzom/client/src/user_entity.cpp b/code/ryzom/client/src/user_entity.cpp index 254b02cb5..51a5a9882 100644 --- a/code/ryzom/client/src/user_entity.cpp +++ b/code/ryzom/client/src/user_entity.cpp @@ -518,7 +518,7 @@ void CUserEntity::updateVisualPropertyName(const NLMISC::TGameCycle &gameCycle, html->browse("home"); } } -*/ +*/ }// updateVisualPropertyName // //----------------------------------------------- @@ -3555,8 +3555,8 @@ void CUserEntity::CSpeedFactor::update(ICDBNode *node) // virtual if(_Value > 2.0f) { //nlwarning("HACK: you try to change the speed factor to %f", _Value); - nlstop; - _Value = 2.0f; + //nlstop; + //_Value = 2.0f; } }// CSpeedFactor::update // diff --git a/code/ryzom/client/unix/CMakeLists.txt b/code/ryzom/client/unix/CMakeLists.txt index fef098783..54f2ed881 100644 --- a/code/ryzom/client/unix/CMakeLists.txt +++ b/code/ryzom/client/unix/CMakeLists.txt @@ -1,11 +1,11 @@ -CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/ryzom.desktop.in" "${CMAKE_CURRENT_BINARY_DIR}/ryzom.desktop") +CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/ryzom_client.desktop.in" "${CMAKE_CURRENT_BINARY_DIR}/ryzom_client.desktop") -INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/ryzom.desktop" DESTINATION share/applications) -INSTALL(FILES ryzom.png DESTINATION share/pixmaps) -INSTALL(FILES ryzom.xpm DESTINATION share/pixmaps) -INSTALL(FILES ryzom_16x16.png DESTINATION share/icons/hicolor/16x16/apps RENAME ryzom.png) -INSTALL(FILES ryzom_22x22.png DESTINATION share/icons/hicolor/22x22/apps RENAME ryzom.png) -INSTALL(FILES ryzom_24x24.png DESTINATION share/icons/hicolor/24x24/apps RENAME ryzom.png) -INSTALL(FILES ryzom_32x32.png DESTINATION share/icons/hicolor/32x32/apps RENAME ryzom.png) -INSTALL(FILES ryzom_48x48.png DESTINATION share/icons/hicolor/48x48/apps RENAME ryzom.png) -INSTALL(FILES ryzom_128x128.png DESTINATION share/icons/hicolor/128x128/apps RENAME ryzom.png) +INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/ryzom_client.desktop" DESTINATION share/applications) +INSTALL(FILES ryzom_client.png DESTINATION share/pixmaps) +INSTALL(FILES ryzom_client.xpm DESTINATION share/pixmaps) +INSTALL(FILES ryzom_16x16.png DESTINATION share/icons/hicolor/16x16/apps RENAME ryzom_client.png) +INSTALL(FILES ryzom_22x22.png DESTINATION share/icons/hicolor/22x22/apps RENAME ryzom_client.png) +INSTALL(FILES ryzom_24x24.png DESTINATION share/icons/hicolor/24x24/apps RENAME ryzom_client.png) +INSTALL(FILES ryzom_32x32.png DESTINATION share/icons/hicolor/32x32/apps RENAME ryzom_client.png) +INSTALL(FILES ryzom_48x48.png DESTINATION share/icons/hicolor/48x48/apps RENAME ryzom_client.png) +INSTALL(FILES ryzom_128x128.png DESTINATION share/icons/hicolor/128x128/apps RENAME ryzom_client.png) diff --git a/code/ryzom/client/unix/ryzom.xpm b/code/ryzom/client/unix/ryzom.xpm deleted file mode 100644 index 5e6ef89df..000000000 --- a/code/ryzom/client/unix/ryzom.xpm +++ /dev/null @@ -1,1313 +0,0 @@ -/* XPM */ -static char * ryzom_48x48_xpm[] = { -"48 48 1262 2", -" c None", -". c #AAB2A8", -"+ c #A6ABAF", -"@ c #79868A", -"# c #6A7B81", -"$ c #A6ABAA", -"% c #ADB0AF", -"& c #AAAFA9", -"* c #C8D2CE", -"= c #838679", -"- c #5F6159", -"; c #656766", -"> c #636365", -", c #504E50", -"' c #646464", -") c #7E8180", -"! c #9B988B", -"~ c #6D695B", -"{ c #636564", -"] c #535843", -"^ c #686A54", -"/ c #7E7D70", -"( c #717262", -"_ c #556056", -": c #47493B", -"< c #423E30", -"[ c #413629", -"} c #323229", -"| c #424039", -"1 c #5E5D56", -"2 c #656560", -"3 c #A8AAA7", -"4 c #989795", -"5 c #76726D", -"6 c #888074", -"7 c #807256", -"8 c #675B47", -"9 c #4B442E", -"0 c #808076", -"a c #8C8A7D", -"b c #817962", -"c c #4F4F36", -"d c #4A5535", -"e c #515E3E", -"f c #434736", -"g c #4C483F", -"h c #6E634E", -"i c #434233", -"j c #4A4943", -"k c #585347", -"l c #797367", -"m c #938B85", -"n c #908781", -"o c #746860", -"p c #605349", -"q c #897C6E", -"r c #958C81", -"s c #746953", -"t c #6C5E46", -"u c #665B43", -"v c #756852", -"w c #84847B", -"x c #AEB2AD", -"y c #737661", -"z c #49492E", -"A c #3A361F", -"B c #33371D", -"C c #34381F", -"D c #3D4028", -"E c #475131", -"F c #524F45", -"G c #7C7F76", -"H c #7D725E", -"I c #7E6847", -"J c #51534E", -"K c #4F5B5F", -"L c #3A3833", -"M c #332B18", -"N c #37331D", -"O c #51432D", -"P c #393326", -"Q c #423728", -"R c #55482E", -"S c #53482F", -"T c #565436", -"U c #727660", -"V c #888B7F", -"W c #88897C", -"X c #6E714C", -"Y c #6B724A", -"Z c #555B3A", -"` c #4B3D1D", -" . c #363119", -".. c #4B572D", -"+. c #536838", -"@. c #4C5740", -"#. c #4A3B24", -"$. c #795F3F", -"%. c #604D32", -"&. c #2E2D18", -"*. c #413C2D", -"=. c #808276", -"-. c #535C54", -";. c #474D43", -">. c #3C3E37", -",. c #353A30", -"'. c #807246", -"). c #4B5329", -"!. c #606F31", -"~. c #525730", -"{. c #73735E", -"]. c #8E9080", -"^. c #87887D", -"/. c #B7B6B6", -"(. c #858281", -"_. c #515941", -":. c #707C5F", -"<. c #656754", -"[. c #626A4B", -"}. c #645E3E", -"|. c #3C4023", -"1. c #44512E", -"2. c #38462C", -"3. c #21230E", -"4. c #29270D", -"5. c #382E14", -"6. c #39341B", -"7. c #524C33", -"8. c #53524A", -"9. c #645F55", -"0. c #48452C", -"a. c #464521", -"b. c #5D522D", -"c. c #716F3B", -"d. c #5C642A", -"e. c #51602B", -"f. c #37481B", -"g. c #33381E", -"h. c #5C5B3B", -"i. c #514D2F", -"j. c #4D462D", -"k. c #3F3A30", -"l. c #35352B", -"m. c #4C4C43", -"n. c #5B5B4A", -"o. c #91978B", -"p. c #9CA19B", -"q. c #B0B7AB", -"r. c #898D77", -"s. c #51593C", -"t. c #2F3B22", -"u. c #919162", -"v. c #464529", -"w. c #5F6031", -"x. c #545925", -"y. c #464E1F", -"z. c #373E23", -"A. c #585235", -"B. c #664F2F", -"C. c #3E3A23", -"D. c #595D35", -"E. c #666D38", -"F. c #75743D", -"G. c #636931", -"H. c #6E6B39", -"I. c #3D371C", -"J. c #222711", -"K. c #161A0E", -"L. c #353A24", -"M. c #6B7054", -"N. c #7D7F67", -"O. c #978C75", -"P. c #696450", -"Q. c #78786D", -"R. c #89887D", -"S. c #929591", -"T. c #52534E", -"U. c #5D5F5D", -"V. c #4B4E48", -"W. c #45493C", -"X. c #3F4533", -"Y. c #181C0D", -"Z. c #53512E", -"`. c #7D9042", -" + c #74903B", -".+ c #475525", -"++ c #4A5428", -"@+ c #534528", -"#+ c #513B1E", -"$+ c #554825", -"%+ c #494E26", -"&+ c #6E833A", -"*+ c #576B2A", -"=+ c #353E1D", -"-+ c #383D20", -";+ c #6F5B35", -">+ c #303017", -",+ c #2E2C17", -"'+ c #454426", -")+ c #737A49", -"!+ c #6D6F4B", -"~+ c #5A6140", -"{+ c #727260", -"]+ c #AFA799", -"^+ c #DDDFDA", -"/+ c #ECEDEC", -"(+ c #8F8F8D", -"_+ c #3C3E34", -":+ c #323623", -"<+ c #212415", -"[+ c #212712", -"}+ c #1C220F", -"|+ c #252310", -"1+ c #231E0C", -"2+ c #2F3317", -"3+ c #5C632E", -"4+ c #5E6C33", -"5+ c #465A22", -"6+ c #3D4022", -"7+ c #453921", -"8+ c #433E1D", -"9+ c #615C31", -"0+ c #3F471F", -"a+ c #545831", -"b+ c #586136", -"c+ c #29281A", -"d+ c #322F1B", -"e+ c #6B5836", -"f+ c #706134", -"g+ c #7F6B41", -"h+ c #83693F", -"i+ c #8F7846", -"j+ c #5C5B2B", -"k+ c #76804B", -"l+ c #6F7D47", -"m+ c #8C9178", -"n+ c #999188", -"o+ c #B0AAA8", -"p+ c #C7C6C6", -"q+ c #A29FA0", -"r+ c #9C9D95", -"s+ c #686E53", -"t+ c #414924", -"u+ c #373E1E", -"v+ c #303721", -"w+ c #343928", -"x+ c #212314", -"y+ c #363220", -"z+ c #2D3215", -"A+ c #333515", -"B+ c #5C4F2D", -"C+ c #5F5232", -"D+ c #2D2715", -"E+ c #31381A", -"F+ c #55592F", -"G+ c #4C552A", -"H+ c #677B43", -"I+ c #799250", -"J+ c #74864A", -"K+ c #656F46", -"L+ c #635637", -"M+ c #79683A", -"N+ c #968251", -"O+ c #665B33", -"P+ c #7D7840", -"Q+ c #616A32", -"R+ c #4C4F29", -"S+ c #4C562E", -"T+ c #556539", -"U+ c #595F44", -"V+ c #4D4D44", -"W+ c #6A6561", -"X+ c #95908F", -"Y+ c #74706F", -"Z+ c #797573", -"`+ c #595B4C", -" @ c #4E5532", -".@ c #5D603D", -"+@ c #797059", -"@@ c #655136", -"#@ c #5B5342", -"$@ c #504E3F", -"%@ c #3D461C", -"&@ c #21270E", -"*@ c #24280D", -"=@ c #141005", -"-@ c #191909", -";@ c #3D3A1C", -">@ c #454425", -",@ c #425024", -"'@ c #323C1B", -")@ c #506232", -"!@ c #7F9A5B", -"~@ c #75804F", -"{@ c #727F46", -"]@ c #635E36", -"^@ c #837443", -"/@ c #70562B", -"(@ c #505129", -"_@ c #454923", -":@ c #2E3019", -"<@ c #353920", -"[@ c #353B26", -"}@ c #404236", -"|@ c #98978C", -"1@ c #D6D4D2", -"2@ c #AFADA7", -"3@ c #8F8784", -"4@ c #7C7875", -"5@ c #A2A39D", -"6@ c #7E7D77", -"7@ c #868B7F", -"8@ c #A1A296", -"9@ c #5C5142", -"0@ c #553720", -"a@ c #543F33", -"b@ c #5F4A3A", -"c@ c #372A15", -"d@ c #657D32", -"e@ c #373D1B", -"f@ c #2C2B12", -"g@ c #343311", -"h@ c #3E3214", -"i@ c #392811", -"j@ c #3D3518", -"k@ c #393F1B", -"l@ c #2D3416", -"m@ c #5C713C", -"n@ c #678048", -"o@ c #47512F", -"p@ c #677346", -"q@ c #515132", -"r@ c #6B613A", -"s@ c #5D582D", -"t@ c #444224", -"u@ c #474B28", -"v@ c #5E5E37", -"w@ c #666B44", -"x@ c #999C81", -"y@ c #CDCBC5", -"z@ c #E5E1DE", -"A@ c #BEB9BA", -"B@ c #A9A3A0", -"C@ c #756D65", -"D@ c #877F79", -"E@ c #B2AFAA", -"F@ c #BEBEBA", -"G@ c #9FA19C", -"H@ c #443C2E", -"I@ c #302413", -"J@ c #301F0E", -"K@ c #27201A", -"L@ c #331D11", -"M@ c #432D13", -"N@ c #2D280F", -"O@ c #424F20", -"P@ c #1A1C0B", -"Q@ c #2F2E16", -"R@ c #54471F", -"S@ c #4F2E13", -"T@ c #1E0804", -"U@ c #542F14", -"V@ c #6F6534", -"W@ c #596332", -"X@ c #6F7444", -"Y@ c #645C32", -"Z@ c #526031", -"`@ c #434C2B", -" # c #4E5730", -".# c #48462A", -"+# c #5A5231", -"@# c #5C532E", -"## c #685A37", -"$# c #72673F", -"%# c #7F7C54", -"&# c #CAC8BA", -"*# c #DEDBD6", -"=# c #DBD7D3", -"-# c #D9D5D4", -";# c #C7C1C0", -"># c #857E7D", -",# c #59544B", -"'# c #544C44", -")# c #655F61", -"!# c #736D69", -"~# c #837E7E", -"{# c #595B4D", -"]# c #4D462F", -"^# c #7D7862", -"/# c #8D9594", -"(# c #4F3F2C", -"_# c #635237", -":# c #251E06", -"<# c #435120", -"[# c #262913", -"}# c #212012", -"|# c #3F3F27", -"1# c #6A5631", -"2# c #3D140C", -"3# c #1A0907", -"4# c #31180C", -"5# c #988561", -"6# c #7A804B", -"7# c #887C5D", -"8# c #596137", -"9# c #525633", -"0# c #242513", -"a# c #201A0F", -"b# c #453821", -"c# c #78613B", -"d# c #78603D", -"e# c #AB8E5D", -"f# c #A0865F", -"g# c #AB9575", -"h# c #C7BCB1", -"i# c #A49994", -"j# c #9E9492", -"k# c #A59E9D", -"l# c #A7A3A4", -"m# c #8A8280", -"n# c #7E7C72", -"o# c #403727", -"p# c #1C2119", -"q# c #55534F", -"r# c #555147", -"s# c #8C8F88", -"t# c #8E948D", -"u# c #788278", -"v# c #8C989C", -"w# c #444137", -"x# c #423E2D", -"y# c #3F3D1B", -"z# c #473C25", -"A# c #737367", -"B# c #818772", -"C# c #838365", -"D# c #431F14", -"E# c #3E251F", -"F# c #6B523E", -"G# c #8A7F5E", -"H# c #736544", -"I# c #6B5E3C", -"J# c #5D5134", -"K# c #494326", -"L# c #2C2715", -"M# c #3F371F", -"N# c #6D5835", -"O# c #79693D", -"P# c #A39B77", -"Q# c #D2CDB6", -"R# c #E4DCCD", -"S# c #E5DACF", -"T# c #C0B5AF", -"U# c #988E8B", -"V# c #9C9490", -"W# c #B6B3AF", -"X# c #AEAFAE", -"Y# c #A7A9A8", -"Z# c #55524A", -"`# c #514B37", -" $ c #434527", -".$ c #4A4D31", -"+$ c #595E45", -"@$ c #7E7A75", -"#$ c #4C4A47", -"$$ c #393023", -"%$ c #2B251E", -"&$ c #2F2C1E", -"*$ c #4B4C3C", -"=$ c #3D3E32", -"-$ c #4B4320", -";$ c #979789", -">$ c #C6CFCB", -",$ c #AFB1AB", -"'$ c #67695A", -")$ c #605136", -"!$ c #8F7E67", -"~$ c #867D62", -"{$ c #6D6D4E", -"]$ c #625434", -"^$ c #554B26", -"/$ c #464020", -"($ c #494825", -"_$ c #494926", -":$ c #75683D", -"<$ c #998149", -"[$ c #A3854F", -"}$ c #A89C86", -"|$ c #D8D5D1", -"1$ c #D9D7D5", -"2$ c #E7E6E4", -"3$ c #CDCAC9", -"4$ c #918986", -"5$ c #B5B5B0", -"6$ c #B2B6B2", -"7$ c #A8B0AB", -"8$ c #B8C2C2", -"9$ c #8B908E", -"0$ c #585B48", -"a$ c #64663A", -"b$ c #65643A", -"c$ c #565336", -"d$ c #4B3D2B", -"e$ c #443B31", -"f$ c #616057", -"g$ c #5F6251", -"h$ c #495134", -"i$ c #798175", -"j$ c #555648", -"k$ c #665D3F", -"l$ c #80857A", -"m$ c #646263", -"n$ c #48443F", -"o$ c #393528", -"p$ c #4C4836", -"q$ c #5D5739", -"r$ c #595733", -"s$ c #534A2C", -"t$ c #3C4420", -"u$ c #2C3318", -"v$ c #3E4623", -"w$ c #5C6E37", -"x$ c #7E8A52", -"y$ c #8B8964", -"z$ c #94976D", -"A$ c #797B56", -"B$ c #7C7855", -"C$ c #58573F", -"D$ c #353329", -"E$ c #413937", -"F$ c #544A47", -"G$ c #A1A09C", -"H$ c #817F79", -"I$ c #A6AEAB", -"J$ c #8C9091", -"K$ c #524F4D", -"L$ c #2D261F", -"M$ c #535645", -"N$ c #81886E", -"O$ c #938E77", -"P$ c #B0ADAA", -"Q$ c #807368", -"R$ c #A3A9A0", -"S$ c #818D86", -"T$ c #68726D", -"U$ c #727B6D", -"V$ c #444031", -"W$ c #363123", -"X$ c #545138", -"Y$ c #3C3F28", -"Z$ c #3A3B32", -"`$ c #2E3424", -" % c #383B31", -".% c #353E26", -"+% c #5E5A3A", -"@% c #403B21", -"#% c #3A4620", -"$% c #374320", -"%% c #414B2B", -"&% c #657349", -"*% c #8E9874", -"=% c #B8BBA1", -"-% c #B6BAAA", -";% c #A19D91", -">% c #9D9888", -",% c #A1AD86", -"'% c #565E41", -")% c #4A4A37", -"!% c #625C4E", -"~% c #585043", -"{% c #3D362B", -"]% c #2F2317", -"^% c #2D2619", -"/% c #3A3624", -"(% c #514C3C", -"_% c #85877D", -":% c #C2C4BF", -"<% c #AEAEAA", -"[% c #8F8D88", -"}% c #787870", -"|% c #767F77", -"1% c #757C7A", -"2% c #6C7274", -"3% c #43413B", -"4% c #2B2514", -"5% c #2D2814", -"6% c #26220F", -"7% c #3A331E", -"8% c #212413", -"9% c #273019", -"0% c #505644", -"a% c #6A6E66", -"b% c #5B644A", -"c% c #464B2A", -"d% c #404E28", -"e% c #313920", -"f% c #4C5A33", -"g% c #899377", -"h% c #737C60", -"i% c #CCCDC4", -"j% c #E9EAE5", -"k% c #DEDDDA", -"l% c #6B6159", -"m% c #665E4B", -"n% c #4B4736", -"o% c #2D3221", -"p% c #474029", -"q% c #59574B", -"r% c #726F62", -"s% c #7C7962", -"t% c #716A4E", -"u% c #958C6E", -"v% c #A39E8D", -"w% c #B8B8A9", -"x% c #CBCDC8", -"y% c #D1D8D7", -"z% c #D0DAD8", -"A% c #A1AAA6", -"B% c #7E8380", -"C% c #35382D", -"D% c #3F3D35", -"E% c #3A362B", -"F% c #2A261E", -"G% c #1F1A13", -"H% c #3B4223", -"I% c #2C2D13", -"J% c #2F2B15", -"K% c #2E2410", -"L% c #323424", -"M% c #313219", -"N% c #4F574C", -"O% c #616E64", -"P% c #4D4F40", -"Q% c #353624", -"R% c #2C341D", -"S% c #4E5D33", -"T% c #56663A", -"U% c #434A2B", -"V% c #4F5936", -"W% c #767668", -"X% c #9F9B9C", -"Y% c #878182", -"Z% c #504941", -"`% c #5E5940", -" & c #515137", -".& c #4E4B36", -"+& c #666148", -"@& c #564E34", -"#& c #4A452C", -"$& c #504829", -"%& c #66593B", -"&& c #68634F", -"*& c #9D9C92", -"=& c #DBDFDD", -"-& c #D7E0DF", -";& c #C4D4D5", -">& c #B6C8CC", -",& c #929FA3", -"'& c #555348", -")& c #423925", -"!& c #585143", -"~& c #444036", -"{& c #404524", -"]& c #35401D", -"^& c #2C3012", -"/& c #303214", -"(& c #423C1C", -"_& c #303210", -":& c #46471F", -"<& c #505E50", -"[& c #495747", -"}& c #484A3B", -"|& c #4C4832", -"1& c #363A24", -"2& c #4E522E", -"3& c #51552F", -"4& c #4E532E", -"5& c #586639", -"6& c #535D36", -"7& c #5B6249", -"8& c #38362A", -"9& c #33321F", -"0& c #52572C", -"a& c #51542A", -"b& c #4E4C2A", -"c& c #3A411E", -"d& c #2E3219", -"e& c #312B15", -"f& c #4C4220", -"g& c #51421F", -"h& c #554C27", -"i& c #747463", -"j& c #CCD6D6", -"k& c #B8CACD", -"l& c #9DB1B7", -"m& c #83959B", -"n& c #5A6368", -"o& c #403E38", -"p& c #422E18", -"q& c #503F1C", -"r& c #3C3B1B", -"s& c #343917", -"t& c #37421E", -"u& c #374820", -"v& c #2F3518", -"w& c #24230B", -"x& c #465122", -"y& c #32330A", -"z& c #414310", -"A& c #434A1B", -"B& c #3E4816", -"C& c #504D29", -"D& c #5B5A40", -"E& c #898778", -"F& c #615D3C", -"G& c #504E2A", -"H& c #586434", -"I& c #647E40", -"J& c #4E5E32", -"K& c #586D36", -"L& c #2F351C", -"M& c #373D20", -"N& c #474B23", -"O& c #6A6339", -"P& c #524B26", -"Q& c #3E3C1F", -"R& c #4E4C2B", -"S& c #4A4426", -"T& c #403B1D", -"U& c #443A1C", -"V& c #3B371B", -"W& c #5D553B", -"X& c #61635F", -"Y& c #78868B", -"Z& c #545C62", -"`& c #40444A", -" * c #252524", -".* c #27261F", -"+* c #4A4320", -"@* c #485022", -"#* c #2D3515", -"$* c #2C3415", -"%* c #3F4E26", -"&* c #273416", -"** c #262C11", -"=* c #1C1C0C", -"-* c #3D461E", -";* c #3D3815", -">* c #3B2406", -",* c #332508", -"'* c #3D390E", -")* c #504E1D", -"!* c #6C6138", -"~* c #A7A392", -"{* c #908674", -"]* c #715D3A", -"^* c #645633", -"/* c #2F2A15", -"(* c #4F5A31", -"_* c #47512E", -":* c #505933", -"<* c #40432B", -"[* c #59553D", -"}* c #554933", -"|* c #686136", -"1* c #717A3D", -"2* c #554C2F", -"3* c #604A29", -"4* c #625530", -"5* c #61572D", -"6* c #513F1D", -"7* c #443919", -"8* c #3C2E19", -"9* c #1F1812", -"0* c #1F1B17", -"a* c #23241D", -"b* c #1F2119", -"c* c #17180F", -"d* c #2F3319", -"e* c #3F421E", -"f* c #292813", -"g* c #343B19", -"h* c #35431D", -"i* c #1E290F", -"j* c #111309", -"k* c #465226", -"l* c #4A5024", -"m* c #231B09", -"n* c #492C0B", -"o* c #544113", -"p* c #605F28", -"q* c #6B7F38", -"r* c #6E7B45", -"s* c #696959", -"t* c #867E72", -"u* c #655432", -"v* c #574929", -"w* c #59663A", -"x* c #444B2D", -"y* c #444E29", -"z* c #25241F", -"A* c #41565B", -"B* c #41676B", -"C* c #5E7236", -"D* c #4D5134", -"E* c #544934", -"F* c #5B4627", -"G* c #5C4321", -"H* c #644A25", -"I* c #604A24", -"J* c #614C27", -"K* c #4F3E22", -"L* c #4A3118", -"M* c #50391F", -"N* c #292115", -"O* c #161007", -"P* c #2E2212", -"Q* c #46361C", -"R* c #533616", -"S* c #31220C", -"T* c #30250C", -"U* c #232811", -"V* c #141708", -"W* c #141407", -"X* c #536B32", -"Y* c #566434", -"Z* c #403B19", -"`* c #50471A", -" = c #3D4214", -".= c #3F4B1A", -"+= c #374519", -"@= c #3C451E", -"#= c #5B6742", -"$= c #909487", -"%= c #6B6954", -"&= c #363C22", -"*= c #3E4527", -"== c #2A2C18", -"-= c #262314", -";= c #2A2A26", -">= c #3C4E51", -",= c #3D585D", -"'= c #444D40", -")= c #39372B", -"!= c #413C24", -"~= c #534A2A", -"{= c #68532E", -"]= c #644E29", -"^= c #583A1B", -"/= c #5C492B", -"(= c #3F2F1C", -"_= c #4A321A", -":= c #4C3A1C", -"<= c #402F18", -"[= c #21140A", -"}= c #4E3D23", -"|= c #2D160B", -"1= c #422C15", -"2= c #4F411F", -"3= c #50451E", -"4= c #262A15", -"5= c #272C12", -"6= c #171606", -"7= c #425423", -"8= c #323927", -"9= c #282A17", -"0= c #483A1B", -"a= c #3A4115", -"b= c #25350C", -"c= c #212E0D", -"d= c #424F29", -"e= c #5E7137", -"f= c #8B947C", -"g= c #717868", -"h= c #3B432B", -"i= c #3B4030", -"j= c #2E2F20", -"k= c #38352A", -"l= c #485150", -"m= c #7A694F", -"n= c #7D5E39", -"o= c #624929", -"p= c #352919", -"q= c #4B3921", -"r= c #604E30", -"s= c #2F291B", -"t= c #423924", -"u= c #605736", -"v= c #605A31", -"w= c #656330", -"x= c #474C25", -"y= c #54562C", -"z= c #43361C", -"A= c #4B3A21", -"B= c #4D3417", -"C= c #5B4727", -"D= c #475228", -"E= c #222A12", -"F= c #343118", -"G= c #292811", -"H= c #282813", -"I= c #262513", -"J= c #1F2114", -"K= c #1A1F0B", -"L= c #352F12", -"M= c #3B3A12", -"N= c #303710", -"O= c #38381B", -"P= c #3B471E", -"Q= c #394420", -"R= c #3B3F2D", -"S= c #595C50", -"T= c #73756E", -"U= c #7E8079", -"V= c #7D7467", -"W= c #746244", -"X= c #736636", -"Y= c #6C6F3B", -"Z= c #646738", -"`= c #57542E", -" - c #5B5930", -".- c #625A31", -"+- c #5E5D31", -"@- c #44492A", -"#- c #4E5230", -"$- c #4C5431", -"%- c #404328", -"&- c #4A4725", -"*- c #525026", -"=- c #484C2A", -"-- c #47562B", -";- c #494E24", -">- c #3B4A28", -",- c #28341B", -"'- c #13150C", -")- c #1F2414", -"!- c #2C2C17", -"~- c #32311D", -"{- c #36362A", -"]- c #342E16", -"^- c #484C29", -"/- c #4D4827", -"(- c #4B3D22", -"_- c #393012", -":- c #3A3517", -"<- c #3A4721", -"[- c #283013", -"}- c #292F13", -"|- c #1A1E1D", -"1- c #242E32", -"2- c #505C62", -"3- c #5E534B", -"4- c #6A5A37", -"5- c #707D44", -"6- c #576931", -"7- c #49502E", -"8- c #596338", -"9- c #525F38", -"0- c #4F5833", -"a- c #4F482C", -"b- c #4C5632", -"c- c #525C33", -"d- c #454D2C", -"e- c #50562F", -"f- c #556536", -"g- c #637A3B", -"h- c #415229", -"i- c #3F5428", -"j- c #2A381B", -"k- c #242E1A", -"l- c #191E16", -"m- c #181D13", -"n- c #1F2116", -"o- c #343D22", -"p- c #313B28", -"q- c #392D15", -"r- c #38391C", -"s- c #645B45", -"t- c #8D8E7D", -"u- c #868C71", -"v- c #5D6640", -"w- c #282C17", -"x- c #282B16", -"y- c #262616", -"z- c #363426", -"A- c #30332E", -"B- c #43433A", -"C- c #55503A", -"D- c #545734", -"E- c #516038", -"F- c #42532A", -"G- c #43512E", -"H- c #3F482B", -"I- c #393C22", -"J- c #474428", -"K- c #4B452B", -"L- c #4E4A2C", -"M- c #505F35", -"N- c #48512E", -"O- c #525F35", -"P- c #46572C", -"Q- c #303D1D", -"R- c #2B371E", -"S- c #39482C", -"T- c #242D1E", -"U- c #1D2417", -"V- c #191E15", -"W- c #1B1B14", -"X- c #242718", -"Y- c #293219", -"Z- c #3B463C", -"`- c #454427", -" ; c #3F4A2B", -".; c #4F4F3E", -"+; c #8E9897", -"@; c #97A19A", -"#; c #808C77", -"$; c #5A6934", -"%; c #3A401E", -"&; c #383926", -"*; c #585747", -"=; c #485144", -"-; c #484932", -";; c #555A3E", -">; c #4B4F36", -",; c #303528", -"'; c #25271F", -"); c #26261D", -"!; c #3B3322", -"~; c #52472D", -"{; c #615E3B", -"]; c #515E34", -"^; c #475730", -"/; c #40492B", -"(; c #4C5C33", -"_; c #374425", -":; c #2E3820", -"<; c #212918", -"[; c #4A5149", -"}; c #4A5349", -"|; c #252D1F", -"1; c #1C211B", -"2; c #242219", -"3; c #2A2E1C", -"4; c #2D3622", -"5; c #464B40", -"6; c #4B5149", -"7; c #95A1A1", -"8; c #9FABA8", -"9; c #6C7966", -"0; c #556342", -"a; c #575F4A", -"b; c #6C7368", -"c; c #6F7D7D", -"d; c #586159", -"e; c #777B72", -"f; c #747267", -"g; c #524E41", -"h; c #443E31", -"i; c #463D2D", -"j; c #625644", -"k; c #685740", -"l; c #6E5F3A", -"m; c #454629", -"n; c #2C3120", -"o; c #373828", -"p; c #3A3F2A", -"q; c #3F4B30", -"r; c #24271B", -"s; c #1F1F16", -"t; c #414441", -"u; c #8E9E9F", -"v; c #3A4241", -"w; c #414849", -"x; c #2B2A21", -"y; c #48483D", -"z; c #3D4738", -"A; c #6D7872", -"B; c #A3B2B5", -"C; c #A8B6B7", -"D; c #808C85", -"E; c #555B53", -"F; c #393B2C", -"G; c #4D493E", -"H; c #878984", -"I; c #7F7B71", -"J; c #6D6252", -"K; c #574B32", -"L; c #635A3A", -"M; c #7A7452", -"N; c #6D6446", -"O; c #474431", -"P; c #404331", -"Q; c #484D39", -"R; c #4A4A39", -"S; c #33342D", -"T; c #787D77", -"U; c #5D5F59", -"V; c #2F2D23", -"W; c #36382F", -"X; c #8A9BA0", -"Y; c #637279", -"Z; c #262B2A", -"`; c #2B2C25", -" > c #404439", -".> c #403320", -"+> c #3A3C30", -"@> c #4E5648", -"#> c #646B69", -"$> c #6F7779", -"%> c #666B6D", -"&> c #434642", -"*> c #4B4C43", -"=> c #686A5F", -"-> c #666C5A", -";> c #64695C", -">> c #505240", -",> c #50553B", -"'> c #494F37", -")> c #464B30", -"!> c #52513A", -"~> c #797B67", -"{> c #848E75", -"]> c #7D8A6E", -"^> c #60675A", -"/> c #4B5147", -"(> c #767B78", -"_> c #7C807F", -":> c #37362A", -"<> c #2E3024", -"[> c #383C34", -"}> c #6D7C7F", -"|> c #63757D", -"1> c #4B5659", -"2> c #33362E", -"3> c #47534C", -"4> c #383E31", -"5> c #353A29", -"6> c #626C6A", -"7> c #4D5452", -"8> c #2A2E23", -"9> c #353B2A", -"0> c #49523F", -"a> c #4E5745", -"b> c #565A4E", -"c> c #5B6052", -"d> c #424934", -"e> c #434931", -"f> c #4C5339", -"g> c #616555", -"h> c #747E69", -"i> c #7D8679", -"j> c #95A299", -"k> c #929C99", -"l> c #79817F", -"m> c #6E776F", -"n> c #7B827D", -"o> c #858F93", -"p> c #3A3E3E", -"q> c #3E3B2E", -"r> c #596059", -"s> c #6C7B7A", -"t> c #5B6D75", -"u> c #404A4D", -"v> c #313730", -"w> c #5D6669", -"x> c #4B534F", -"y> c #32362E", -"z> c #3B4231", -"A> c #3C4437", -"B> c #545F51", -"C> c #43473D", -"D> c #3D3C2C", -"E> c #4E4F3B", -"F> c #5E5E4B", -"G> c #84887B", -"H> c #8E928C", -"I> c #99A19E", -"J> c #9AA5A5", -"K> c #A2AFB1", -"L> c #9BA7AA", -"M> c #ACBCBF", -"N> c #97A3A7", -"O> c #676F72", -"P> c #3F4538", -"Q> c #576057", -"R> c #364132", -"S> c #607172", -"T> c #54676F", -"U> c #505854", -"V> c #4A524E", -"W> c #576062", -"X> c #6E797C", -"Y> c #707D7C", -"Z> c #748080", -"`> c #737E7D", -" , c #747C79", -"., c #6E7065", -"+, c #78776B", -"@, c #767467", -"#, c #767970", -"$, c #919B96", -"%, c #859090", -"&, c #747A7C", -"*, c #909CA0", -"=, c #96A5A9", -"-, c #9BABB0", -";, c #7E8B91", -">, c #4B5153", -",, c #373B37", -"', c #21251D", -"), c #282C23", -"!, c #5D6B6F", -"~, c #546465", -"{, c #566566", -"], c #71858B", -"^, c #82979E", -"/, c #86999F", -"(, c #8D9FA5", -"_, c #8D9B9C", -":, c #828E8E", -"<, c #737B76", -"[, c #727D74", -"}, c #808D8D", -"|, c #7E898B", -"1, c #838D8E", -"2, c #7E8B8F", -"3, c #84949B", -"4, c #7B8B91", -"5, c #6C7A81", -"6, c #515B5F", -"7, c #363C3A", -"8, c #2A302F", -"9, c #36474F", -"0, c #5C6C72", -"a, c #5B6971", -"b, c #596871", -"c, c #6F838C", -"d, c #7B9099", -"e, c #778A91", -"f, c #7B8D93", -"g, c #738487", -"h, c #6E7C7D", -"i, c #78878C", -"j, c #829399", -"k, c #7D9097", -"l, c #73868C", -"m, c #6C7D83", -"n, c #63747B", -"o, c #55646B", -"p, c #4F5B62", -"q, c #515E67", -"r, c #5F737D", -"s, c #637882", -"t, c #677C85", -"u, c #647780", -"v, c #64767D", -"w, c #62747C", -"x, c #62757E", -"y, c #60737D", -"z, c #5A6B74", -"A, c #55666F", -" ", -" ", -" ", -" ", -" . + @ # $ % & * = ", -" - ; > , ' ) ! ~ { ] ^ / ( _ : < [ ", -" } | 1 2 3 4 5 6 7 8 9 0 a b c d e f g ", -" h i j k l m n o p q r s t u v w x y z A B C D E ", -" F G H I J K L M N O P Q R S T U V W X Y Z ` ...+.@. ", -" #.$.%.&.*.=.-.;.>.,.'.).!.~.{.].^./.(._.:.<.[.}.|.1.2. ", -" 3.4.5.6.7.8.9.0.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t. ", -" v.w.x.y.z.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y. ", -" Z.`. +.+++@+#+$+%+&+*+=+-+;+>+,+'+)+!+~+{+]+^+/+(+_+:+<+[+}+|+1+ ", -" 2+3+4+5+6+7+8+9+0+a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+ ", -" z+A+B+C+D+E+F+G+H+I+J+K+L+M+N+O+P+Q+R+S+T+U+V+W+X+Y+Z+`+ @.@+@@@#@$@ ", -" %@&@*@=@-@;@>@,@'@)@!@~@{@]@^@/@(@_@:@<@[@}@|@1@2@3@4@5@6@7@8@9@0@a@b@c@ ", -" d@e@f@g@h@i@j@k@,@l@m@n@o@p@q@r@s@t@u@v@w@x@y@z@A@B@C@D@E@F@G@H@I@J@K@L@M@N@ ", -" O@P@Q@R@S@T@U@V@W@X@Y@Z@`@ #.#+#@###$#%#&#*#=#-#;#>#,#'#)#!#~#{#]#^#/#(#_#:# ", -" <#[#}#|#1#2#3#4#5#6#7#8#9#0#a#b#c#d#e#f#g#h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#x#y# ", -" z#A#B#C#D#E#F#G#H#I#J#K#L#M#N#O#P#Q#R#S#T#U#V#W#X#Y#Z#`# $.$+$@$#$$$%$&$*$=$ ", -" -$;$>$,$'$)$!$~${$]$^$/$($_$:$<$[$}$|$1$2$3$4$5$6$7$8$9$0$a$b$c$d$e$f$g$h$i$j$ ", -" k$l$m$n$o$p$q$r$s$t$u$v$w$x$y$z$A$B$C$D$E$F$G$H$I$J$K$L$M$N$O$P$Q$R$S$T$U$V$W$ ", -" X$Y$Z$`$ %.%+%@%#%$%%%&%*%=%-%;%>%,%'%)%D$!%~%{%]%^%/%(%_%:%<%[%}%|%1%2%3%4%5%6% ", -" 7%8%9%0%a%b%c%d%e%f%g%h%i%j%k%l%m%n%o%p%q%r%s%t%u%v%w%x%y%z%A%B%C%D%E%F%G%H%I%J% ", -" K%L%M%N%O%P%Q%R%S%T%U%V%W%X%Y%Z%`% &.&+&@&#&$&%&&&*&=&-&;&>&,&V.'&)&!&~&{&]&^&/& ", -" (&_&:&<&[&}&|&1&2&3&4&5&6&7&8&9&0&a&b&c&d&e&f&g&h&i&j&k&l&m&n&o&p&q&r&s&t&u&v&w& ", -" x&y&z&A&B&C&D&E&F&G&H&I&J&K&L&M&N&O&P&Q&R&S&T&U&V&W&X&Y&Z&`& *.*+*@*#*$*%*&***=* ", -" -*;*>*,*'*)*!*~*{*]*^*/*(*_*:*<*[*}*|*1*2*3*4*5*6*7*8*9*0*a*b*c*d*e*f*g*h*i*j* ", -" k*l*m*n*o*p*q*r*s*t*u*v*w*x*y*z*A*B*C*D*E*F*G*H*I*J*K*L*M*N*O*P*Q*R*S*T*U*V*W* ", -" X*Y*Z*`* =.=+=@=#=$=%=&=*===-=;=>=,='=)=!=~={=]=^=/=(=_=:=<=[=}=|=1=2=3=4=5=6= ", -" 7=8=9=0=a=b=c=d=e=f=g=h=i=j=k=l=m=n=o=p=q=r=s=t=u=v=w=x=y=z=A=B=C=D=E=F=G=H=I= ", -" J=K=L=M=N=O=P=Q=R=S=T=U=V=W=X=Y=Z=`= -.-+-@-#-$-%-&-*-=---;->-,-'-)-!-~-{- ", -" ]-^-/-(-_-:-<-[-}-|-1-2-3-4-5-6-7-8-9-0-a-b-c-d-e-f-g-h-i-j-k-l-m-n-o-p- ", -" q-r-s-t-u-v-w-x-y-z-A-B-C-D-E-F-G-H-I-J-K-L-M-N-O-P-Q-R-S-T-U-V-W-X-Y-Z- ", -" `- ;.;+;@;#;$;%;&;*;=;-;;;>;,;';);!;~;{;];^;/;(;_;:;<;[;};|;1;2;3;4; ", -" 5;6;7;8;9;0;a;b;c;d;e;f;g;h;i;j;k;l;m;n;o;p;q;r;s;t;u;v;w;x;3; ", -" y;z;A;B;C;D;E;F;G;H;I;J;K;L;M;N;O;P;Q;R;S;T;U;V;2;W;X;Y;Z;`; > ", -" .>+>@>#>$>%>&>*>=>->;>>>,>'>)>!>~>{>]>^>/>(>_>:><>[>}>|>1>2> ", -" 4>5>6>7>8>9>0>a>b>c>d>e>f>g>h>i>j>k>l>m>n>o>p>q>r>s>t>u> ", -" v>w>x>y>z>A>B>C>D>E>F>G>H>I>J>K>L>M>N>O>P>Q>R>S>T> ", -" U>V>W>X>Y>Z>`> ,.,+,@,#,$,%,&,*,=,-,;,>,,,',), ", -" !,~,{,],^,/,(,_,:,<,[,},|,1,2,3,4,5,6,7,8, ", -" 0,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p, ", -" q,r,s,t,u,v,w,x,y,z,A, ", -" ", -" ", -" ", -" "}; diff --git a/code/ryzom/client/unix/ryzom.desktop.in b/code/ryzom/client/unix/ryzom_client.desktop.in similarity index 87% rename from code/ryzom/client/unix/ryzom.desktop.in rename to code/ryzom/client/unix/ryzom_client.desktop.in index 6c967a61c..6520c1039 100644 --- a/code/ryzom/client/unix/ryzom.desktop.in +++ b/code/ryzom/client/unix/ryzom_client.desktop.in @@ -8,9 +8,9 @@ Comment=Ryzom client Comment[fr_FR]=Client Ryzom TryExec=${RYZOM_GAMES_PREFIX}/ryzom_client Exec=${RYZOM_GAMES_PREFIX}/ryzom_client -Icon=ryzom +Icon=ryzom_client Terminal=false Hidden=false Categories=Game;RolePlaying; -StartupWMClass=ryzom +StartupWMClass=ryzom_client X-AppInstall-Package=ryzom-client diff --git a/code/ryzom/client/unix/ryzom.png b/code/ryzom/client/unix/ryzom_client.png similarity index 100% rename from code/ryzom/client/unix/ryzom.png rename to code/ryzom/client/unix/ryzom_client.png diff --git a/code/ryzom/client/unix/ryzom_client.xpm b/code/ryzom/client/unix/ryzom_client.xpm new file mode 100644 index 000000000..fe7c972f2 --- /dev/null +++ b/code/ryzom/client/unix/ryzom_client.xpm @@ -0,0 +1,696 @@ +/* XPM */ +static char * ryzom_32x32_xpm[] = { +"32 32 661 2", +" c None", +". c #A8B58C", +"+ c #B7C0AA", +"@ c #CACCCA", +"# c #AEADA8", +"$ c #949FA4", +"% c #A5ADB2", +"& c #D7E4E8", +"* c #D8E8ED", +"= c #A8ABA6", +"- c #978E81", +"; c #9D9C8E", +"> c #BEC4BE", +", c #777D61", +"' c #737766", +") c #747674", +"! c #717175", +"~ c #6E6E71", +"{ c #8A9293", +"] c #888477", +"^ c #63605B", +"/ c #83856E", +"( c #888C7E", +"_ c #666D60", +": c #4A483C", +"< c #433729", +"[ c #B1B1AC", +"} c #ABABA9", +"| c #C1B195", +"1 c #8A816C", +"2 c #48453A", +"3 c #3D3A32", +"4 c #6B6A61", +"5 c #8A8B8A", +"6 c #989592", +"7 c #948F87", +"8 c #7E7861", +"9 c #59513F", +"0 c #65604F", +"a c #918F86", +"b c #5F5E45", +"c c #4B5735", +"d c #3F462F", +"e c #443F31", +"f c #5B5E48", +"g c #98998C", +"h c #8C7B59", +"i c #B1AA95", +"j c #49483C", +"k c #7F7B6F", +"l c #6E6049", +"m c #696C6D", +"n c #483C2F", +"o c #403623", +"p c #5B4C3B", +"q c #514237", +"r c #66553A", +"s c #645B3E", +"t c #878B79", +"u c #93948B", +"v c #605C3B", +"w c #4D5032", +"x c #373117", +"y c #48512C", +"z c #52633A", +"A c #7D8278", +"B c #BAB3A5", +"C c #7C7E6B", +"D c #2B2818", +"E c #664E32", +"F c #37341B", +"G c #636156", +"H c #737769", +"I c #454935", +"J c #3F4430", +"K c #666637", +"L c #5E712F", +"M c #535435", +"N c #7D7E6A", +"O c #717267", +"P c #6E6B6A", +"Q c #545B46", +"R c #6D715E", +"S c #767960", +"T c #575736", +"U c #42512E", +"V c #303828", +"W c #8D9696", +"X c #9C9577", +"Y c #58513D", +"Z c #3E3C22", +"` c #4D4B1E", +" . c #323916", +".. c #565137", +"+. c #4A3D26", +"@. c #3E3E24", +"#. c #746E37", +"$. c #5F5B2F", +"%. c #232A10", +"&. c #1F2513", +"*. c #5B5B3C", +"=. c #807B63", +"-. c #625C4B", +";. c #6B675B", +">. c #90968D", +",. c #7B7E7B", +"'. c #7C8380", +"). c #4B503E", +"!. c #1D2212", +"~. c #3F4233", +"{. c #737A76", +"]. c #4D4F31", +"^. c #494524", +"/. c #7D9442", +"(. c #4F6429", +"_. c #57512D", +":. c #4F3C1F", +"<. c #423F1D", +"[. c #5F6A35", +"}. c #3D481F", +"|. c #404024", +"1. c #5F512B", +"2. c #3F381E", +"3. c #6E6C3F", +"4. c #717448", +"5. c #646C48", +"6. c #B4ADA3", +"7. c #E5E6E4", +"8. c #BEBEBE", +"9. c #444737", +"0. c #2D311B", +"a. c #222911", +"b. c #1D220E", +"c. c #231E09", +"d. c #59574D", +"e. c #879657", +"f. c #3C3922", +"g. c #4C5324", +"h. c #4E4D27", +"i. c #3F3420", +"j. c #3C401F", +"k. c #4E552A", +"l. c #5C703B", +"m. c #778649", +"n. c #43442C", +"o. c #736039", +"p. c #897648", +"q. c #847644", +"r. c #635F2D", +"s. c #525B31", +"t. c #647444", +"u. c #504E43", +"v. c #7F7774", +"w. c #8B8788", +"x. c #969591", +"y. c #4B542F", +"z. c #5C6041", +"A. c #5D513D", +"B. c #474638", +"C. c #4B442E", +"D. c #8E8B82", +"E. c #859F4A", +"F. c #373F1C", +"G. c #24260C", +"H. c #161407", +"I. c #2C2D14", +"J. c #3C4420", +"K. c #38401D", +"L. c #657B43", +"M. c #70804E", +"N. c #595C35", +"O. c #706B3A", +"P. c #66562B", +"Q. c #3C4120", +"R. c #383B20", +"S. c #444B2E", +"T. c #75766C", +"U. c #DEDBD8", +"V. c #A49E98", +"W. c #7A726F", +"X. c #ADAFAA", +"Y. c #9CA098", +"Z. c #767164", +"`. c #402815", +" + c #46362F", +".+ c #47341D", +"++ c #484A2B", +"@+ c #858F81", +"#+ c #828566", +"$+ c #576B2A", +"%+ c #252210", +"&+ c #3F3B17", +"*+ c #4A2B12", +"=+ c #442812", +"-+ c #58582B", +";+ c #555F32", +">+ c #5C6433", +",+ c #48532E", +"'+ c #636D42", +")+ c #574E30", +"!+ c #524C2B", +"~+ c #69623A", +"{+ c #888661", +"]+ c #CECDBF", +"^+ c #E3DFDC", +"/+ c #C9C3C3", +"(+ c #898481", +"_+ c #5D574D", +":+ c #797271", +"<+ c #8D8987", +"[+ c #484638", +"}+ c #534830", +"|+ c #4A4C48", +"1+ c #5E4327", +"2+ c #252108", +"3+ c #636C59", +"4+ c #666B44", +"5+ c #424030", +"6+ c #675F3D", +"7+ c #32100A", +"8+ c #2F180F", +"9+ c #887F5A", +"0+ c #817950", +"a+ c #615F39", +"b+ c #2C2D18", +"c+ c #2A2113", +"d+ c #695534", +"e+ c #947E52", +"f+ c #B8A37E", +"g+ c #C3B29E", +"h+ c #ACA09D", +"i+ c #A09795", +"j+ c #BCBABA", +"k+ c #857F7C", +"l+ c #544D3D", +"m+ c #30362B", +"n+ c #59564A", +"o+ c #A2A8A6", +"p+ c #62645A", +"q+ c #535453", +"r+ c #474534", +"s+ c #3D3C1F", +"t+ c #8F9692", +"u+ c #575033", +"v+ c #776D51", +"w+ c #ACB2AA", +"x+ c #8A9080", +"y+ c #5A432F", +"z+ c #8B7B65", +"A+ c #746D50", +"B+ c #5F502C", +"C+ c #484224", +"D+ c #414122", +"E+ c #75673B", +"F+ c #9E8149", +"G+ c #BDB7A9", +"H+ c #E5E4E1", +"I+ c #EAE7E2", +"J+ c #9C9491", +"K+ c #ADABA6", +"L+ c #A0A3A0", +"M+ c #A8AFAE", +"N+ c #5C5F51", +"O+ c #5E5D32", +"P+ c #525431", +"Q+ c #43382B", +"R+ c #453E34", +"S+ c #41412F", +"T+ c #5D6454", +"U+ c #464941", +"V+ c #6D7372", +"W+ c #76705A", +"X+ c #60624D", +"Y+ c #494644", +"Z+ c #39382E", +"`+ c #444630", +" @ c #584F2D", +".@ c #444823", +"+@ c #30381B", +"@@ c #49562C", +"#@ c #7E8D54", +"$@ c #939472", +"%@ c #7F7F60", +"&@ c #7C8259", +"*@ c #373727", +"=@ c #3F3834", +"-@ c #85817E", +";@ c #6D6D66", +">@ c #666765", +",@ c #352E27", +"'@ c #49493C", +")@ c #969985", +"!@ c #A39D98", +"~@ c #928E81", +"{@ c #8C9892", +"]@ c #7E8B8A", +"^@ c #444130", +"/@ c #343021", +"(@ c #444736", +"_@ c #737F5D", +":@ c #605543", +"<@ c #2D2D19", +"[@ c #28301C", +"}@ c #5E6257", +"|@ c #596044", +"1@ c #3F4523", +"2@ c #384123", +"3@ c #65724F", +"4@ c #889176", +"5@ c #E6E6DF", +"6@ c #C2C0BD", +"7@ c #827B6D", +"8@ c #656551", +"9@ c #3C3B28", +"0@ c #524F43", +"a@ c #6A644D", +"b@ c #655A42", +"c@ c #7C735E", +"d@ c #9F9F8D", +"e@ c #B2B5B0", +"f@ c #C9D0CD", +"g@ c #8F9490", +"h@ c #3F4037", +"i@ c #4F504A", +"j@ c #292420", +"k@ c #2F2F19", +"l@ c #2C2710", +"m@ c #464730", +"n@ c #8C9194", +"o@ c #5D4C2A", +"p@ c #252514", +"q@ c #3F412A", +"r@ c #5B6D68", +"s@ c #4D4C3D", +"t@ c #282F1A", +"u@ c #526038", +"v@ c #49512D", +"w@ c #444B2D", +"x@ c #7F7B76", +"y@ c #5B5453", +"z@ c #535137", +"A@ c #525535", +"B@ c #565136", +"C@ c #48432A", +"D@ c #483F23", +"E@ c #635636", +"F@ c #777664", +"G@ c #D5DBDA", +"H@ c #BECFD0", +"I@ c #A8BCC1", +"J@ c #525553", +"K@ c #4E4432", +"L@ c #4B402D", +"M@ c #403F26", +"N@ c #3B4A23", +"O@ c #323517", +"P@ c #454936", +"Q@ c #828859", +"R@ c #30330E", +"S@ c #424513", +"T@ c #444F29", +"U@ c #434629", +"V@ c #746D5B", +"W@ c #585532", +"X@ c #4F552C", +"Y@ c #677E43", +"Z@ c #5A6E3D", +"`@ c #30361E", +" # c #424521", +".# c #5F5831", +"+# c #3C3D1D", +"@# c #414024", +"## c #3D391A", +"$# c #413719", +"%# c #5E593E", +"&# c #929D9E", +"*# c #77868D", +"=# c #454C50", +"-# c #2F2F2B", +";# c #4A3D1A", +"># c #3C451C", +",# c #313B19", +"'# c #30401D", +")# c #23270F", +"!# c #30301E", +"~# c #6E7E49", +"{# c #363617", +"]# c #261605", +"^# c #43360D", +"/# c #5C5D29", +"(# c #8F8D6B", +"_# c #7F7563", +":# c #65512D", +"<# c #433E23", +"[# c #546137", +"}# c #485332", +"|# c #454D45", +"1# c #60644A", +"2# c #666C36", +"3# c #57462C", +"4# c #634E2A", +"5# c #5D4A25", +"6# c #4A3819", +"7# c #312513", +"8# c #2B1F15", +"9# c #1F2119", +"0# c #16170F", +"a# c #37391C", +"b# c #373216", +"c# c #313718", +"d# c #1F2B11", +"e# c #111208", +"f# c #3C422F", +"g# c #6C7B4A", +"h# c #566631", +"i# c #493915", +"j# c #4A4314", +"k# c #47501C", +"l# c #4A5A23", +"m# c #7B806A", +"n# c #757260", +"o# c #3B3E23", +"p# c #3C4124", +"q# c #252314", +"r# c #3A413E", +"s# c #405B52", +"t# c #3E4331", +"u# c #4C462A", +"v# c #5E4C29", +"w# c #654E26", +"x# c #634C2A", +"y# c #583E1E", +"z# c #2C1D0E", +"A# c #3E2C17", +"B# c #42230F", +"C# c #443216", +"D# c #423817", +"E# c #1C200E", +"F# c #161605", +"G# c #808473", +"H# c #535B35", +"I# c #394328", +"J# c #232212", +"K# c #423E17", +"L# c #26370C", +"M# c #30371A", +"N# c #5A6B38", +"O# c #6E7364", +"P# c #5C6251", +"Q# c #3D3E2D", +"R# c #4A473C", +"S# c #71664C", +"T# c #775E33", +"U# c #463921", +"V# c #574326", +"W# c #514528", +"X# c #524C2D", +"Y# c #606139", +"Z# c #4C502A", +"`# c #4B4923", +" $ c #3F351E", +".$ c #4F3F1E", +"+$ c #53532B", +"@$ c #202A13", +"#$ c #2A2C16", +"$$ c #2B2813", +"%$ c #343525", +"&$ c #655642", +"*$ c #32311A", +"=$ c #3B3B1C", +"-$ c #3F3214", +";$ c #3F3B19", +">$ c #333D1B", +",$ c #2B3215", +"'$ c #272B27", +")$ c #636E75", +"!$ c #766856", +"~$ c #6D6B3A", +"{$ c #5D6D38", +"]$ c #565E35", +"^$ c #56663A", +"/$ c #504F2F", +"($ c #495331", +"_$ c #404528", +":$ c #50542E", +"<$ c #607239", +"[$ c #4B5D2F", +"}$ c #364A22", +"|$ c #26301C", +"1$ c #171C12", +"2$ c #222417", +"3$ c #353D24", +"4$ c #666C6B", +"5$ c #3A3216", +"6$ c #4B4B2D", +"7$ c #8D9384", +"8$ c #8A9379", +"9$ c #353C21", +"0$ c #363820", +"a$ c #3A3728", +"b$ c #434233", +"c$ c #515034", +"d$ c #4C5734", +"e$ c #3C4929", +"f$ c #353B26", +"g$ c #3B3A24", +"h$ c #575032", +"i$ c #555C35", +"j$ c #495531", +"k$ c #4F6034", +"l$ c #2F391F", +"m$ c #2D3A20", +"n$ c #353E30", +"o$ c #1C2417", +"p$ c #1D1D14", +"q$ c #2D311D", +"r$ c #333E2F", +"s$ c #7E8388", +"t$ c #63624A", +"u$ c #585842", +"v$ c #34372B", +"w$ c #889191", +"x$ c #919E91", +"y$ c #4D5C34", +"z$ c #565C4A", +"A$ c #647171", +"B$ c #595F52", +"C$ c #6E6E5F", +"D$ c #403E34", +"E$ c #363125", +"F$ c #594C38", +"G$ c #655938", +"H$ c #3E4527", +"I$ c #343825", +"J$ c #404D2B", +"K$ c #2D3521", +"L$ c #1A1B12", +"M$ c #7D8988", +"N$ c #333936", +"O$ c #2B2D29", +"P$ c #262C1B", +"Q$ c #646660", +"R$ c #738167", +"S$ c #4B5138", +"T$ c #3D3E34", +"U$ c #4F5A4C", +"V$ c #94A0A3", +"W$ c #A3B0B1", +"X$ c #454840", +"Y$ c #3F3D2E", +"Z$ c #6D6F64", +"`$ c #666150", +" % c #554F33", +".% c #666242", +"+% c #5D553C", +"@% c #4C503C", +"#% c #545B41", +"$% c #3B3D32", +"%% c #8B928E", +"&% c #25261B", +"*% c #6D7877", +"=% c #4F5D63", +"-% c #343731", +";% c #555D58", +">% c #909CA3", +",% c #566259", +"'% c #4E4B3E", +")% c #3F4232", +"!% c #616A68", +"~% c #252620", +"{% c #383D30", +"]% c #6A7366", +"^% c #707569", +"/% c #4F5443", +"(% c #485038", +"_% c #505641", +":% c #6F7861", +"<% c #95A094", +"[% c #8B958F", +"}% c #676F67", +"|% c #7E8582", +"1% c #474B4A", +"2% c #414137", +"3% c #5F6B6A", +"4% c #52626A", +"5% c #454B49", +"6% c #7B858C", +"7% c #868D91", +"8% c #5A615E", +"9% c #393E3A", +"0% c #5A6363", +"a% c #484C44", +"b% c #424A3E", +"c% c #535C53", +"d% c #474738", +"e% c #5C5945", +"f% c #7F8173", +"g% c #939A95", +"h% c #929C9C", +"i% c #9EABAD", +"j% c #A5B4B7", +"k% c #89959A", +"l% c #3E443E", +"m% c #3C463B", +"n% c #485450", +"o% c #53626A", +"p% c #899197", +"q% c #5C6B6C", +"r% c #515F5E", +"s% c #65767B", +"t% c #899DA4", +"u% c #88999F", +"v% c #8E9A9B", +"w% c #828B88", +"x% c #696F66", +"y% c #7F8A8A", +"z% c #7E8788", +"A% c #849196", +"B% c #899AA0", +"C% c #646F75", +"D% c #3C413F", +"E% c #252925", +"F% c #647074", +"G% c #7B828B", +"H% c #36464E", +"I% c #505F67", +"J% c #606F76", +"K% c #55646E", +"L% c #687B85", +"M% c #748890", +"N% c #75878D", +"O% c #6F7F82", +"P% c #75858A", +"Q% c #798D95", +"R% c #6C7E85", +"S% c #5E6F77", +"T% c #4D5A62", +"U% c #626B72", +"V% c #A2A6A6", +"W% c #8E949C", +"X% c #666F78", +"Y% c #48555E", +"Z% c #4B5C65", +"`% c #50606A", +" & c #5B6E7A", +".& c #5D707B", +"+& c #5D6F79", +"@& c #5C6D77", +"#& c #5D6D78", +"$& c #5B6974", +"%& c #626D75", +"&& c #6D777E", +"*& c #838A92", +"=& c #878E95", +"-& c #686F78", +";& c #54606A", +">& c #4F5C68", +",& c #51606C", +"'& c #515E6A", +")& c #59636E", +"!& c #6E757E", +" ", +" ", +" . + @ # $ % & * = - ; > ", +" , ' ) ! ~ { ] ^ / ( _ : < [ } ", +" | 1 2 3 4 5 6 7 8 9 0 a b c d e f g ", +" h i j k l m n o p q r s t u v w x y z A ", +" B C D E F G H I J K L M N O P Q R S T U V W ", +" X Y Z ` ...+.@.K #.$.%.&.*.=.-.;.>.,.'.).!.~.{. ", +" ].^./.(._.:.<.[.}.|.1.2.3.4.5.6.7.8.9.0.a.b.c.d. ", +" e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.A.B.C.D. ", +" E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.`. +.+++@+ ", +" #+$+%+&+*+=+-+;+>+,+'+)+!+~+{+]+^+/+(+_+:+<+[+}+|+1+2+3+ ", +" 4+I.5+6+7+8+9+0+a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+ ", +" u+v+w+x+y+z+A+B+C+D+E+F+G+H+I+J+K+L+M+N+O+P+Q+R+S+T+U+V+ ", +" W+X+Y+Z+`+ @.@+@@@#@$@%@&@*@=@-@;@>@,@'@)@!@~@{@]@^@/@(@ ", +" _@:@<@[@}@|@1@2@3@4@5@6@7@8@9@0@a@b@c@d@e@f@g@h@i@j@k@l@m@n@ ", +" o@p@q@r@s@t@u@v@w@x@y@z@A@B@C@D@E@F@G@H@I@J@K@L@M@N@O@P@ ", +" Q@R@S@T@U@V@W@X@Y@Z@`@ #.#+#@###$#%#&#*#=#-#;#>#,#'#)#!# ", +" ~#{#]#^#/#(#_#:#<#[#}#|#1#2#3#4#5#6#7#8#9#0#a#b#c#d#e# f# ", +" g#h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#x#.+y#z#A#B#C#D#E#F#G# ", +" H#I#J#K#L#M#N#O#P#Q#R#S#T#U#V#W#X#Y#Z#`# $.$+$@$#$$$%$ ", +" &$*$=$-$;$>$,$'$)$!$~${$]$^$/$($_$:$<$[$}$|$1$2$3$4$ ", +" 5$6$7$8$9$0$a$b$c$d$e$f$g$h$i$j$k$l$m$n$o$p$q$r$s$ ", +" t$u$v$w$x$y$z$A$B$C$D$E$F$G$H$I$J$K$L$M$N$O$P$Q$ ", +" R$S$T$U$V$W$X$Y$Z$`$ %.%+%@%#%$%%%3 &%*%=%-%;% ", +" >%,%'%)%!%~%{%]%^%/%(%_%:%<%[%}%|%1%2%3%4%5% ", +" 6%7%8%9%0%a%b%c%d%e%f%g%h%i%j%k%l%m%n%o% ", +" p%q%r%s%t%u%v%w%x%y%z%A%B%C%D%E%F%G% ", +" H%I%J%K%L%M%N%O%P%Q%R%S%T%U%V%W% ", +" X%Y%Z%`% &.&+&@&#&$&%&&&*&=& ", +" -&;&>&,&$&'&)&!& ", +" "}; diff --git a/code/ryzom/common/CMakeLists.txt b/code/ryzom/common/CMakeLists.txt index dbf1c937d..1d3c3f844 100644 --- a/code/ryzom/common/CMakeLists.txt +++ b/code/ryzom/common/CMakeLists.txt @@ -8,3 +8,7 @@ ADD_SUBDIRECTORY(src) #INSTALL(TARGETS data_common ARCHIVE DESTINATION ${RYZOM_SHARE_PREFIX}/data) #INSTALL(FILES "${CMAKE_BINARY_DIR}/share/data_common.bnp" DESTINATION "${RYZOM_SHARE_PREFIX}/data") + +IF(WITH_RYZOM_TOOLS) + INSTALL(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data_leveldesign" DESTINATION "${RYZOM_SHARE_PREFIX}") +ENDIF(WITH_RYZOM_TOOLS) diff --git a/code/ryzom/common/src/game_share/CMakeLists.txt b/code/ryzom/common/src/game_share/CMakeLists.txt index 61292431c..2648416ec 100644 --- a/code/ryzom/common/src/game_share/CMakeLists.txt +++ b/code/ryzom/common/src/game_share/CMakeLists.txt @@ -42,5 +42,5 @@ IF(WITH_PCH) ENDIF(WITH_PCH) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) - INSTALL(TARGETS ryzom_gameshare LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) + INSTALL(TARGETS ryzom_gameshare LIBRARY DESTINATION ${RYZOM_LIB_PREFIX} ARCHIVE DESTINATION ${RYZOM_LIB_PREFIX} COMPONENT libraries) ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) diff --git a/code/ryzom/common/src/game_share/ai_wrapper.h b/code/ryzom/common/src/game_share/ai_wrapper.h index a3a98c61a..c0bac40a2 100644 --- a/code/ryzom/common/src/game_share/ai_wrapper.h +++ b/code/ryzom/common/src/game_share/ai_wrapper.h @@ -47,6 +47,10 @@ namespace R2 class IAiWrapper { public: + virtual ~IAiWrapper() + { + } + virtual void init(NLLIGO::CLigoConfig * ligoConfig) { } diff --git a/code/ryzom/common/src/game_share/dms.h b/code/ryzom/common/src/game_share/dms.h index 149c626c8..b53b8626d 100644 --- a/code/ryzom/common/src/game_share/dms.h +++ b/code/ryzom/common/src/game_share/dms.h @@ -148,7 +148,7 @@ namespace R2 public: CDynamicMapService( NLMISC::CConfigFile& confFile, NLNET::IModuleSocket * gateway); - ~CDynamicMapService(); + virtual ~CDynamicMapService(); static CDynamicMapService* getInstance(); diff --git a/code/ryzom/common/src/game_share/dyn_chat.cpp b/code/ryzom/common/src/game_share/dyn_chat.cpp index b9eba4cff..aae0015d7 100644 --- a/code/ryzom/common/src/game_share/dyn_chat.cpp +++ b/code/ryzom/common/src/game_share/dyn_chat.cpp @@ -138,11 +138,12 @@ CDynChatSession *CDynChatClient::getSession(TChanID chan) const CDynChatChan::CDynChatChan() : HistoricSize(0), HideBubble(false), + UniversalChannel(false), _FirstSession(NULL), _ID(CEntityId::Unknown), _DontBroadcastPlayerInputs(false), _ForwardPlayerIntputToOwnerService(false), - _UnifyChannel(false) + _UnifyChannel(false) { } @@ -151,6 +152,7 @@ CDynChatChan::CDynChatChan() CDynChatChan::CDynChatChan(TChanID id, bool noBroadcast, bool forwardInput, bool unified) : HistoricSize(0), HideBubble(false), + UniversalChannel(false), _FirstSession(NULL), _ID(id), _DontBroadcastPlayerInputs(noBroadcast), diff --git a/code/ryzom/common/src/game_share/dyn_chat.h b/code/ryzom/common/src/game_share/dyn_chat.h index a5575a68f..081bf7434 100644 --- a/code/ryzom/common/src/game_share/dyn_chat.h +++ b/code/ryzom/common/src/game_share/dyn_chat.h @@ -131,6 +131,7 @@ public: bool Localized; // for EGS only ucstring Title; // gives the title of the channel when it is not translated (e.g Localized == false) bool HideBubble; // hide the display of bubble + bool UniversalChannel; // treat like universe channel public: CDynChatChan(); // CDynChatChan(TChanID id = NLMISC::CEntityId::Unknown, NLNET::TServiceId ownerServiceId, bool noBroadcast, bool forwadInput); diff --git a/code/ryzom/common/src/game_share/generic_xml_msg_mngr.h b/code/ryzom/common/src/game_share/generic_xml_msg_mngr.h index feb8baed7..a6a6a7167 100644 --- a/code/ryzom/common/src/game_share/generic_xml_msg_mngr.h +++ b/code/ryzom/common/src/game_share/generic_xml_msg_mngr.h @@ -470,7 +470,7 @@ protected: /// display nodes void xmlDisplay() { - std::string ntype = (Name == "" ? "client_messages_description" : NbBits == 0 ? "leaf" : "branch"); + std::string ntype = (Name.empty() ? "client_messages_description" : NbBits == 0 ? "leaf" : "branch"); nlinfo("<%s name=\"%s\" description=\"%s\">", ntype.c_str(), Name.c_str(), Description.c_str()); diff --git a/code/ryzom/common/src/game_share/object.cpp b/code/ryzom/common/src/game_share/object.cpp index 1537a9995..a034ddb2e 100644 --- a/code/ryzom/common/src/game_share/object.cpp +++ b/code/ryzom/common/src/game_share/object.cpp @@ -483,7 +483,7 @@ bool CObject::getShortestName(std::string &instanceId, std::string &attrName, si nlassert(index != -1); instanceId = parent->getAttr("InstanceId")->toString(); attrName = parent->getKey(index); - if (attrName == "") + if (attrName.empty()) { position = index; } @@ -501,7 +501,7 @@ bool CObject::getShortestName(std::string &instanceId, std::string &attrName, si nlassert(index2 != -1); sint32 index = parent->findIndex(this); nlassert(index != -1); - if (parent2->getKey(index2) == "") + if (parent2->getKey(index2).empty()) { nlassert(0); // TMP : want to see if may possibly happen return false; @@ -602,7 +602,7 @@ bool CObjectString::set(const std::string& key, const std::string & value) bool CObjectString::setObject(const std::string& key, CObject* value) { //H_AUTO(R2_CObjectString_setObject) - BOMB_IF( key != "" || ! (value->isString() || value->isNumber()) , "Try to set the a sub value of an object that does not allowed it", return false); + BOMB_IF( !key.empty() || ! (value->isString() || value->isNumber()) , "Try to set the a sub value of an object that does not allowed it", return false); bool canSet = set(key, value->toString()); if (canSet) { @@ -1092,7 +1092,7 @@ void CObjectTable::doSerialize(std::string& out, CSerializeContext& context) co if ( _Value[i].second->isString("Name") && _Value[i].second->isString("LocationId") && _Value[i].second->toString("Name") == "Permanent" - && _Value[i].second->toString("LocationId") == "") + && _Value[i].second->toString("LocationId").empty()) { isDefault = true; } @@ -1248,7 +1248,7 @@ bool CObjectTable::setObject(const std::string& key, CObject* value) //H_AUTO(R2_CObjectTable_setObject) CHECK_TABLE_INTEGRITY value->setGhost(this->getGhost()); - if (key == "") + if (key.empty()) { clear(); diff --git a/code/ryzom/common/src/game_share/scenario.cpp b/code/ryzom/common/src/game_share/scenario.cpp index 5320f0918..6911df31a 100644 --- a/code/ryzom/common/src/game_share/scenario.cpp +++ b/code/ryzom/common/src/game_share/scenario.cpp @@ -989,7 +989,7 @@ bool CScenarioValidator::setScenarioToSave(const std::string& filename, CObject* return true; } -std::string CScenarioValidator::AutoSaveSignature = ""; +std::string CScenarioValidator::AutoSaveSignature; bool CScenarioValidator::applySave(const std::string& signature) { @@ -1252,7 +1252,7 @@ bool CUserComponentValidator::setUserComponentToSave(const std::string& filename return true; } -std::string CUserComponentValidator::AutoSaveSignature = ""; +std::string CUserComponentValidator::AutoSaveSignature; bool CUserComponentValidator::applySave(const std::string& signature) { diff --git a/code/ryzom/common/src/game_share/scenario_entry_points.cpp b/code/ryzom/common/src/game_share/scenario_entry_points.cpp index 886a5ac6b..f68b1d6f8 100644 --- a/code/ryzom/common/src/game_share/scenario_entry_points.cpp +++ b/code/ryzom/common/src/game_share/scenario_entry_points.cpp @@ -406,7 +406,7 @@ void CScenarioEntryPoints::loadFromXMLFile() nlinfo("Different packages for island '%s' in file %s", island, _EntryPointsFilename.c_str()); } } - if(package == "") + if(package.empty()) nlinfo("no 'package' tag in %s island", island); else completeIsland.Package = CSString(package); diff --git a/code/ryzom/common/src/game_share/server_animation_module.cpp b/code/ryzom/common/src/game_share/server_animation_module.cpp index 3758dbf53..51d7ce19e 100644 --- a/code/ryzom/common/src/game_share/server_animation_module.cpp +++ b/code/ryzom/common/src/game_share/server_animation_module.cpp @@ -2017,7 +2017,7 @@ bool CServerAnimationModule::doMakeAnimationSession(CAnimationSession* animSessi //first <=> actId CPrimitives *primDoc = &primDocs[first]; - std::string streamFileName = ""; + std::string streamFileName; if (first==0) { streamFileName= toString("r2.%04d.base.primitive", aiInstance); diff --git a/code/ryzom/common/src/game_share/string_manager_sender.cpp b/code/ryzom/common/src/game_share/string_manager_sender.cpp index d4fa0b397..83336ecf3 100644 --- a/code/ryzom/common/src/game_share/string_manager_sender.cpp +++ b/code/ryzom/common/src/game_share/string_manager_sender.cpp @@ -117,6 +117,7 @@ namespace STRING_MANAGER case damage_type: case power_type: case classification_type: + case clan: // enum f.serial(const_cast(Enum)); break; @@ -332,6 +333,7 @@ namespace STRING_MANAGER NL_STRING_CONVERSION_TABLE_ENTRY( event_faction ) NL_STRING_CONVERSION_TABLE_ENTRY( classification_type ) NL_STRING_CONVERSION_TABLE_ENTRY( outpost ) + NL_STRING_CONVERSION_TABLE_ENTRY( clan ) NL_END_STRING_CONVERSION_TABLE(TParamType, ParamTypeConversion, NB_PARAM_TYPES) //----------------------------------------------- diff --git a/code/ryzom/common/src/game_share/string_manager_sender.h b/code/ryzom/common/src/game_share/string_manager_sender.h index 1e2b25d2d..2520c0e77 100644 --- a/code/ryzom/common/src/game_share/string_manager_sender.h +++ b/code/ryzom/common/src/game_share/string_manager_sender.h @@ -66,6 +66,7 @@ namespace STRING_MANAGER event_faction, classification_type, outpost, + clan, invalid_value, NB_PARAM_TYPES = invalid_value diff --git a/code/ryzom/common/src/game_share/time_weather_season/time_and_season.h b/code/ryzom/common/src/game_share/time_weather_season/time_and_season.h index be8a77aea..bf08129e8 100644 --- a/code/ryzom/common/src/game_share/time_weather_season/time_and_season.h +++ b/code/ryzom/common/src/game_share/time_weather_season/time_and_season.h @@ -31,7 +31,7 @@ const uint RYZOM_WEEK_IN_DAY = 6; const uint RYZOM_YEAR_IN_DAY = RYZOM_MONTH_IN_DAY*RYZOM_YEAR_IN_MONTH; const uint RYZOM_CYCLE_IN_MONTH = 12; -const uint RYZOM_START_YEAR = 2570-1; +const uint RYZOM_START_YEAR = 2570-2; const uint RYZOM_START_SPRING = 61; const uint RYZOM_START_DAY = 1111111; const uint RYZOM_START_HOUR = 9; diff --git a/code/ryzom/common/src/game_share/welcome_service_itf.h b/code/ryzom/common/src/game_share/welcome_service_itf.h index fded04c26..410204cd8 100644 --- a/code/ryzom/common/src/game_share/welcome_service_itf.h +++ b/code/ryzom/common/src/game_share/welcome_service_itf.h @@ -6,9 +6,6 @@ #ifndef WELCOME_SERVICE_ITF #define WELCOME_SERVICE_ITF #include "nel/misc/types_nl.h" -#ifdef NL_COMP_VC8 - #include -#endif #include "nel/misc/hierarchical_timer.h" #include "nel/misc/string_conversion.h" #include "nel/net/message.h" @@ -18,7 +15,9 @@ #include "nel/net/module_gateway.h" #include "nel/net/login_cookie.h" - + +#include + namespace WS { diff --git a/code/ryzom/server/backup_service.cfg b/code/ryzom/server/backup_service.cfg index 2f95dea97..16d870748 100644 --- a/code/ryzom/server/backup_service.cfg +++ b/code/ryzom/server/backup_service.cfg @@ -8,7 +8,7 @@ AESAliasName = "bms_master"; -Paths = { +Paths += { ".", "../common/data_leveldesign", }; @@ -25,7 +25,7 @@ WriteFilesDirectory = "data_shard"; WebPort = 49970; - // ---- service custom variables (used by CVariable class) +// ---- service custom variables (used by CVariable class) // BS - Root directory where data are backuped to IncrementalBackupDirectory = "../incremental_backup"; diff --git a/code/ryzom/server/backup_service_default.cfg b/code/ryzom/server/backup_service_default.cfg index 6e8263dca..3e73c8928 100644 --- a/code/ryzom/server/backup_service_default.cfg +++ b/code/ryzom/server/backup_service_default.cfg @@ -1,22 +1,23 @@ #include "common.cfg" - -// ---- service NeL variables (used by ConfigFile class) - + +// ---- service NeL variables (used by ConfigFile class) + DontUseNS = 1; -// ---- service NeL variables (used by CVariable class) +// ---- service NeL variables (used by CVariable class) ListeningPort = 49990; - -// ---- service custom variables (used by ConfigFile class) - + +// ---- service custom variables (used by ConfigFile class) + // Listening port for the Web server to connect in - + WebPort = 49898; - + BSReadState = 1; - - // ---- service custom variables (used by CVariable class) + + +// ---- service custom variables (used by CVariable class) // Port for the Layer 3 interface of the backup service L3ListeningPort = 49950; @@ -25,7 +26,7 @@ L3ListeningPort = 49950; SaveTemplatePath = "$shard/characters/account_$userid_$charid$ext"; // character saves possible extension list -SaveExtList = "_pdr.bin _pdr.xml .bin"; +SaveExtList = "_pdr.bin _pdr.xml .bin"; //BSFilePrefix = "R:/code/ryzom/r2_shard/"; //BSFileSubst = "r2_shard/"; diff --git a/code/ryzom/server/common.cfg b/code/ryzom/server/common.cfg index 2c209c152..4dac4468d 100644 --- a/code/ryzom/server/common.cfg +++ b/code/ryzom/server/common.cfg @@ -4,7 +4,7 @@ ShardId = 302; // Used by CVariable in WS -PlayerLimit = 5000; +PlayerLimit = 5000; // Used to connect to AES (this file) and to set up AES service (admin_executor_service.cfg) AESPort="46702"; @@ -96,4 +96,5 @@ WriteFilesDirectory = "data_shard"; // ---- service custom variables (used by ConfigFile class) - // ---- service custom variables (used by CVariable class) + +// ---- service custom variables (used by CVariable class) diff --git a/code/ryzom/server/data_shard/client_commands_privileges.txt b/code/ryzom/server/data_shard/client_commands_privileges.txt index 5ce9fe6fa..b9f28f95f 100644 --- a/code/ryzom/server/data_shard/client_commands_privileges.txt +++ b/code/ryzom/server/data_shard/client_commands_privileges.txt @@ -100,6 +100,7 @@ summon :DEV:SGM:GM:VG:SG:EM: // Summon a player in front of the CSR: - <_Date type="UINT32" value="0"/> + <_Name type="STRING" value=""/> <_EventFaction1Name type="STRING" value=""/> <_EventFaction2Name type="STRING" value=""/> diff --git a/code/ryzom/server/data_shard/mirror_sheets/fe_temp.dataset b/code/ryzom/server/data_shard/mirror_sheets/fe_temp.dataset index 442a9a2cf..4caf2d0b2 100644 --- a/code/ryzom/server/data_shard/mirror_sheets/fe_temp.dataset +++ b/code/ryzom/server/data_shard/mirror_sheets/fe_temp.dataset @@ -292,7 +292,7 @@ - + diff --git a/code/ryzom/server/entities_game_service_default.cfg b/code/ryzom/server/entities_game_service_default.cfg index 82cb40d1d..3016a6f99 100644 --- a/code/ryzom/server/entities_game_service_default.cfg +++ b/code/ryzom/server/entities_game_service_default.cfg @@ -22,22 +22,22 @@ StartCommands += "lgs_gw.transportAdd L3Client masterL3c", // open the transport "lgs_gw.transportCmd masterL3c(connect addr="+MasterLGSHost+":"+L3MasterLGSPort+")", -}; - +}; + #ifndef DONT_USE_LGS_SLAVE - + StartCommands += { // add a layer 3 server transport for slave logger service "lgs_gw.transportAdd L3Client slaveL3c", // open the transport "lgs_gw.transportCmd slaveL3c(connect addr="+SlaveLGSHost+":"+L3SlaveLGSPort+")", -}; - +}; + #endif - + StartCommands += -{ +{ // Create a shard unifier client module "moduleManager.createModule ShardUnifierClient suc", // Create a client commands forwader module diff --git a/code/ryzom/server/gpm_service_default.cfg b/code/ryzom/server/gpm_service_default.cfg index ddca7f76d..a6835c65c 100644 --- a/code/ryzom/server/gpm_service_default.cfg +++ b/code/ryzom/server/gpm_service_default.cfg @@ -1,5 +1,5 @@ #include "common.cfg" - + CheckPlayerSpeed = 0; SecuritySpeedFactor = 1.5; diff --git a/code/ryzom/server/input_output_service_default.cfg b/code/ryzom/server/input_output_service_default.cfg index ba819ad8f..54aaaafe8 100644 --- a/code/ryzom/server/input_output_service_default.cfg +++ b/code/ryzom/server/input_output_service_default.cfg @@ -1,6 +1,6 @@ #include "common.cfg" - -// ---- service NeL variables (used by ConfigFile class) + +// ---- service NeL variables (used by ConfigFile class) StartCommands += { @@ -23,22 +23,22 @@ StartCommands += "lgs_gw.transportAdd L3Client masterL3c", // open the transport "lgs_gw.transportCmd masterL3c(connect addr="+MasterLGSHost+":"+L3MasterLGSPort+")", -}; - +}; + #ifndef DONT_USE_LGS_SLAVE - + StartCommands += -{ +{ // add a layer 3 server transport for slave logger service "lgs_gw.transportAdd L3Client slaveL3c", // open the transport "lgs_gw.transportCmd slaveL3c(connect addr="+SlaveLGSHost+":"+L3SlaveLGSPort+")", -}; - +}; + #endif - + StartCommands += -{ +{ // Create a chat unifier client "moduleManager.createModule ChatUnifierClient cuc", @@ -52,33 +52,34 @@ StartCommands += }; #endif - -// ---- service NeL variables (used by CVariable class) - -// ---- service custom variables (used by ConfigFile class) - + +// ---- service NeL variables (used by CVariable class) + +// ---- service custom variables (used by ConfigFile class) + // a list of system command that can be run with "sysCmd" service command. SystemCmd = {}; - + // IOS don't use work directory by default ReadTranslationWork = 0; TranslationWorkPath = "translation/work"; - + // Global shard bot name translation file. You sould overide this // in input_output_service.cfg to specialize the file // depending on the shard main language. BotNameTranslationFile = "bot_names.txt"; - + // Global shard event faction translation file. You sould override this // in input_output_service.cfg to specialize the file // depending on the shard main language. EventFactionTranslationFile = "event_factions.txt"; - - // ---- service custom variables (used by CVariable class) + + +// ---- service custom variables (used by CVariable class) // Activate/deactivate debugging of missing paremeter replacement DebugReplacementParameter = 1; - + // Default verbose debug flags: //----------------------------- diff --git a/code/ryzom/server/mail_forum_service_default.cfg b/code/ryzom/server/mail_forum_service_default.cfg index a76b710be..cd986d964 100644 --- a/code/ryzom/server/mail_forum_service_default.cfg +++ b/code/ryzom/server/mail_forum_service_default.cfg @@ -1,14 +1,15 @@ #include "common.cfg" - -// ---- service NeL variables (used by ConfigFile class) - + +// ---- service NeL variables (used by ConfigFile class) + DontUseNS = 1; - -// ---- service NeL variables (used by CVariable class) - -// ---- service custom variables (used by ConfigFile class) - - // ---- service custom variables (used by CVariable class) + +// ---- service NeL variables (used by CVariable class) + +// ---- service custom variables (used by ConfigFile class) + + +// ---- service custom variables (used by CVariable class) WebRootDirectory = "save_shard/www"; diff --git a/code/ryzom/server/mirror_service_default.cfg b/code/ryzom/server/mirror_service_default.cfg index 38f2f169a..159ee90d4 100644 --- a/code/ryzom/server/mirror_service_default.cfg +++ b/code/ryzom/server/mirror_service_default.cfg @@ -1,6 +1,6 @@ #include "common.cfg" -// ---- service custom variables (used by ConfigFile class) - +// ---- service custom variables (used by ConfigFile class) + // Linux only DestroyGhostSegments = 1; diff --git a/code/ryzom/server/session_browser_server.cfg b/code/ryzom/server/session_browser_server.cfg index 63fa70daf..c784e581e 100644 --- a/code/ryzom/server/session_browser_server.cfg +++ b/code/ryzom/server/session_browser_server.cfg @@ -46,4 +46,5 @@ HomeMainlandNames = // The max number of ring points (aka ring access) for each ecosystem MaxRingPoints = "A1:D7:F7:J8:L6:R13"; - // ---- service custom variables (used by CVariable class) + +// ---- service custom variables (used by CVariable class) diff --git a/code/ryzom/server/shard_unifier_service_default.cfg b/code/ryzom/server/shard_unifier_service_default.cfg index a9a1923e8..7e35b61f9 100644 --- a/code/ryzom/server/shard_unifier_service_default.cfg +++ b/code/ryzom/server/shard_unifier_service_default.cfg @@ -1,7 +1,7 @@ #include "common.cfg" DontUseNS = 1; - + StartCommands += { // Create a gateway for global interconnection diff --git a/code/ryzom/server/sheet_pack_cfg/input_output_service.cfg b/code/ryzom/server/sheet_pack_cfg/input_output_service.cfg index f1059d234..8772cf07f 100644 --- a/code/ryzom/server/sheet_pack_cfg/input_output_service.cfg +++ b/code/ryzom/server/sheet_pack_cfg/input_output_service.cfg @@ -126,7 +126,7 @@ SystemCmd = {}; ReadTranslationWork = 0; TranslationWorkPath = "translation/work"; -//Paths = { "data_leveldesign/leveldesign/Game_elem" }; +//Paths += { "data_leveldesign/leveldesign/Game_elem" }; // Global shard bot name translation file. You sould overide this // in input_output_service.cfg to specialize the file diff --git a/code/ryzom/server/src/admin_modules/CMakeLists.txt b/code/ryzom/server/src/admin_modules/CMakeLists.txt index 7eb6af309..ea8d8a5ff 100644 --- a/code/ryzom/server/src/admin_modules/CMakeLists.txt +++ b/code/ryzom/server/src/admin_modules/CMakeLists.txt @@ -11,4 +11,4 @@ NL_ADD_LIB_SUFFIX(ryzom_adminmodules) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -INSTALL(TARGETS ryzom_adminmodules LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) +INSTALL(TARGETS ryzom_adminmodules LIBRARY DESTINATION ${RYZOM_LIB_PREFIX} ARCHIVE DESTINATION ${RYZOM_LIB_PREFIX} COMPONENT libraries) diff --git a/code/ryzom/server/src/ai_data_service/pacs_scan.cpp b/code/ryzom/server/src/ai_data_service/pacs_scan.cpp index c65636565..6a15900d0 100644 --- a/code/ryzom/server/src/ai_data_service/pacs_scan.cpp +++ b/code/ryzom/server/src/ai_data_service/pacs_scan.cpp @@ -39,7 +39,7 @@ #include "nel/pacs/u_retriever_bank.h" #include "nel/pacs/u_primitive_block.h" -#include "nel/../../src/pacs/global_retriever.h" +#include "nel/pacs/global_retriever.h" // Nel Ligo diff --git a/code/ryzom/server/src/ai_service/npc_description_msg.cpp b/code/ryzom/server/src/ai_service/npc_description_msg.cpp index a5a90ad29..62ba4d9f8 100644 --- a/code/ryzom/server/src/ai_service/npc_description_msg.cpp +++ b/code/ryzom/server/src/ai_service/npc_description_msg.cpp @@ -128,7 +128,7 @@ static bool LookupShopType(std::string name,std::vector &shopList) uint i; for ( i=0; i < cvShopType.size(); ++i ) { - if ( cvShopType.asString(i) != "" ) + if ( !cvShopType.asString(i).empty() ) { // make sure the string doesn't turn up more than once in input data for (uint j=0;jhavePriv(":DEV:")) + { + // Dev should be able to get all banners + return true; + } + + if ( ! player->havePriv(BannerPriv)) + { + // Player has no banner privs + return false; + } + + if (sheetName.find("_gu") != string::npos) + { + if (player->havePriv(":G:")) + { + return true; + } + } + else if (sheetName.find("_sgu") != string::npos) + { + if (player->havePriv(":SG:")) + { + return true; + } + // VG uses SG banner for now + if (player->havePriv(":VG:")) + { + return true; + } + } + else if (sheetName.find("_vgu") != string::npos) + { + if (player->havePriv(":VG:")) + { + return true; + } + } + else if (sheetName.find("_gm") != string::npos) + { + if (player->havePriv(":GM:")) + { + return true; + } + } + else if (sheetName.find("_sgm") != string::npos) + { + if (player->havePriv(":SGM:")) + { + return true; + } + } + + return false; +} + CAdminCommand * findAdminCommand(const string & name) { H_AUTO(findAdminCommand); @@ -1126,6 +1199,8 @@ ENTITY_VARIABLE(Position, "Position of a player (in meter) ,[, vector res; sint32 x = 0, y = 0, z = 0; + sint32 cell = 0; + if (get) { x = e->getState().X() / 1000; @@ -1229,6 +1304,10 @@ ENTITY_VARIABLE(Position, "Position of a player (in meter) ,[, x = entityBase->getState().X + sint32 (cos (entityBase->getState ().Heading) * 2000); y = entityBase->getState().Y + sint32 (sin (entityBase->getState ().Heading) * 2000); z = entityBase->getState().Z; + + TDataSetRow dsr = entityBase->getEntityRowId(); + CMirrorPropValueRO mirrorCell( TheDataset, dsr, DSPropertyCELL ); + cell = mirrorCell; } } } @@ -1258,11 +1337,11 @@ ENTITY_VARIABLE(Position, "Position of a player (in meter) ,[, // season included uint8 season; NLMISC::fromString(res[3], season); - c->teleportCharacter(x,y,z,true, false, 0.f, 0xFF, 0, season); + c->teleportCharacter(x,y,z,true, false, 0.f, 0xFF, cell, season); } else { - c->teleportCharacter(x,y,z,true); + c->teleportCharacter(x,y,z,true, false, 0.f, 0xFF, cell); } if ( cont ) @@ -1374,18 +1453,12 @@ NLMISC_COMMAND (createItemInBag, "Create an item and put it in the player bag", } // banners are the only items in game which use privilege - if( sheetName.find("banner") != string::npos ) + // banners are the only items in game which use privilege + bool ok = checkBannerPriv(sheetName, eid); + if ( ! ok) { - CPlayer * player = PlayerManager.getPlayer( PlayerManager.getPlayerId(eid) ); -// if (player != NULL && !player->havePriv(":DEV:") ) - if (player != NULL && player->havePriv(BannerPriv) ) - { - if( sheetName.find("_gu") != string::npos && !player->havePriv(":G:") ) return false; - if( sheetName.find("_sgu") != string::npos && !player->havePriv(":SG:") ) return false; - if( sheetName.find("_vgu") != string::npos && !player->havePriv(":VG:") ) return false; - if( sheetName.find("_gm") != string::npos && !player->havePriv(":GM:") ) return false; - if( sheetName.find("_sgm") != string::npos && !player->havePriv(":SGM:") ) return false; - } + log.displayNL("Invalid banner priviledge"); + return false; } const CStaticItem *form = CSheets::getForm (sheet); @@ -1465,17 +1538,11 @@ NLMISC_COMMAND (createItemInTmpInv, "Create an item and put it in the player tem } // banners are the only items in game which use privilege - if( sheetName.find("banner") != string::npos ) + bool ok = checkBannerPriv(sheetName, eid); + if ( ! ok) { - CPlayer * player = PlayerManager.getPlayer( PlayerManager.getPlayerId(eid) ); - if (player != NULL && player->havePriv(BannerPriv) ) - { - if( sheetName.find("_gu") != string::npos && !player->havePriv(":G:") ) return false; - if( sheetName.find("_sgu") != string::npos && !player->havePriv(":SG:") ) return false; - if( sheetName.find("_vgu") != string::npos && !player->havePriv(":VG:") ) return false; - if( sheetName.find("_gm") != string::npos && !player->havePriv(":GM:") ) return false; - if( sheetName.find("_sgm") != string::npos && !player->havePriv(":SGM:") ) return false; - } + log.displayNL("Invalid banner priviledge"); + return false; } const CStaticItem *form = CSheets::getForm (sheet); @@ -1538,17 +1605,11 @@ NLMISC_COMMAND (createItemInInv, "Create items and put them in the given invento } // banners are the only items in game which use privilege - if( sheetName.find("banner") != string::npos ) + bool ok = checkBannerPriv(sheetName, eid); + if ( ! ok) { - CPlayer * player = PlayerManager.getPlayer( PlayerManager.getPlayerId(eid) ); - if (player != NULL && player->havePriv(BannerPriv) ) - { - if( sheetName.find("_gu") != string::npos && !player->havePriv(":G:") ) return false; - if( sheetName.find("_sgu") != string::npos && !player->havePriv(":SG:") ) return false; - if( sheetName.find("_vgu") != string::npos && !player->havePriv(":VG:") ) return false; - if( sheetName.find("_gm") != string::npos && !player->havePriv(":GM:") ) return false; - if( sheetName.find("_sgm") != string::npos && !player->havePriv(":SGM:") ) return false; - } + log.displayNL("Invalid banner priviledge"); + return false; } const CStaticItem *form = CSheets::getForm (sheet); @@ -2960,7 +3021,7 @@ void audit(const CAdminCommand *cmd, const string &rawCommand, const CEntityId & string host = varHost->asString(); string page = varPage->asString(); - if (host == "" || page == "") + if (host.empty() || page.empty()) return; char params[1024]; @@ -3780,7 +3841,7 @@ NLMISC_COMMAND( monitorMissions, "monitor a player missions", "getMissionsBegin() == c->getMissionsEnd() ) + if ( c->getMissionsBegin() != c->getMissionsEnd() ) { CCharacter::sendDynamicSystemMessage( c->getEntityRowId() , "CSR_HAS_MISSION" ); return true; @@ -4014,8 +4075,6 @@ NLMISC_COMMAND (unmuteUniverse, "unmute the univers chat", "getGuildId(); CGuildManager::getInstance()->setGMGuild( guildId ); @@ -4450,8 +4509,8 @@ NLMISC_COMMAND (connectUserChannel, "Connect to user channels", " getUserDynChannel(name); + string name = toLower(args[1]); + TChanID channel = inst->getUserDynChannel(name); if (args.size() < 3) pass = toLower(name); @@ -4499,6 +4558,38 @@ NLMISC_COMMAND (connectUserChannel, "Connect to user channels", " ") +{ + if ((args.size() < 2) || (args.size() > 3)) + return false; + GET_CHARACTER + + CPVPManager2 *inst = CPVPManager2::getInstance(); + + string action; + string lang = args[1]; + if (lang != "en" && lang != "fr" && lang != "de" && lang != "ru" && lang != "es") + return false; + + TChanID channel = inst->getFactionDynChannel(lang); + + if (channel != DYN_CHAT_INVALID_CHAN) + { + if (!c->getLangChannel().empty()) { + TChanID current_channel = inst->getFactionDynChannel(c->getLangChannel()); + inst->removeFactionChannelForCharacter(current_channel, c); + } + inst->addFactionChannelToCharacter(channel, c, true); + c->setLangChannel(lang); + return true; + } + + SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal); + params[0].Literal = lang; + CCharacter::sendDynamicSystemMessage( eid, "EGS_CHANNEL_INVALID_NAME", params ); + return false; +} + NLMISC_COMMAND (updateTarget, "Update current target", "") { GET_CHARACTER @@ -4592,7 +4683,7 @@ CInventoryPtr getInv(CCharacter *c, const string &inv) return inventoryPtr; } -NLMISC_COMMAND (webExecCommand, "Execute a web command", " [] [] []") +NLMISC_COMMAND (webExecCommand, "Execute a web command", " [] [] []") { if (args.size() < 5) @@ -4601,9 +4692,15 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", " = 6 && args[5] == "1") + bool new_separator = false; + // New check using HMagic + if (args.size() >= 6 && (args[5] == "1" || args[5] == "3")) new_check = true; + // New separator "|" + if (args.size() >= 6 && (args[5] == "2" || args[5] == "3")) + new_separator = true; + bool next_step = false; if (args.size() >= 7 && args[6] == "1") next_step = true; @@ -4680,7 +4777,10 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", " command_args; - NLMISC::splitString(command, "!", command_args); + if (new_separator) + NLMISC::splitString(command, "|", command_args); + else + NLMISC::splitString(command, "!", command_args); if (command_args.empty()) return false; @@ -5317,8 +5417,10 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", " setHairColor(value); + if (target) + target->setHairColor(value); + else + return false; } //************************************************* @@ -5468,12 +5570,35 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", " getEntityRowId(); - ucstring name = ucstring(c->getName().toString()+"$"+command_args[1]+"$"); + c->setNewTitle(command_args[1]); + string fullname = c->getName().toString()+"$"+command_args[1]+"#"+c->getTagPvPA()+"#"+c->getTagPvPB()+"#"+c->getTagA()+"#"+c->getTagB()+"$"; + ucstring name; + name.fromUtf8(fullname); + NLNET::CMessage msgout("CHARACTER_NAME"); + msgout.serial(row); + msgout.serial(name); + sendMessageViaMirror("IOS", msgout); + } + + //************************************************* + //***************** set_tag + //************************************************* + + else if (command_args[0] == "set_tag") { + if (command_args.size () != 3) return false; + TDataSetRow row = c->getEntityRowId(); + if (command_args[1] == "pvpA") c->setTagPvPA(command_args[2]); + if (command_args[1] == "pvpB") c->setTagPvPB(command_args[2]); + if (command_args[1] == "A") c->setTagA(command_args[2]); + if (command_args[1] == "B") c->setTagB(command_args[2]); + string fullname = c->getName().toString()+"$"+c->getNewTitle()+"#"+c->getTagPvPA()+"#"+c->getTagPvPB()+"#"+c->getTagA()+"#"+c->getTagB()+"$"; + ucstring name; + name.fromUtf8(fullname); NLNET::CMessage msgout("CHARACTER_NAME"); msgout.serial(row); msgout.serial(name); @@ -5500,6 +5625,7 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", " res; sint32 x = 0, y = 0, z = 0; float h = 0; + sint32 cell; if ( value.find(',') != string::npos ) // Position x,y,z,a { explode (value, string(","), res); @@ -5591,6 +5717,10 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", " getState().Y + sint32 (sin (entityBase->getState ().Heading) * 2000); z = entityBase->getState().Z; h = entityBase->getState().Heading; + + TDataSetRow dsr = entityBase->getEntityRowId(); + CMirrorPropValueRO mirrorCell( TheDataset, dsr, DSPropertyCELL ); + cell = mirrorCell; } } } @@ -5620,7 +5750,7 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", " applyRespawnEffects(); } - c->teleportCharacter(x,y,z,allowPetTp,true,h); + c->teleportCharacter(x,y,z,allowPetTp,true,h,0xFF,cell); if ( cont ) { @@ -5903,6 +6033,7 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", " sendUrl(web_app_url+"&player_eid="+c->getId().toString()+"&event=failed&desc=no_enough_faction_points", getSalt()); + return true; } } else if (action=="set") @@ -5941,6 +6072,7 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", " sendUrl(web_app_url+"&player_eid="+c->getId().toString()+"&event=failed&desc=no_enough_pvp_points", getSalt()); + return true; } } else if (action=="set") @@ -5957,6 +6089,51 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", " [1=Read/Write,0=ReadOnly(default)]") { - if (args.size() != 2) return false; + if (args.size() < 2 || args.size() > 3) return false; GET_CHARACTER TChanID chanID = DynChatEGS.getChanIDFromName(args[1]); if (chanID == DYN_CHAT_INVALID_CHAN) @@ -8415,7 +8592,7 @@ NLMISC_COMMAND(eventSetBotFacing, "Set the direction in which a bot faces", " args2; - if (args.size() == 3 && args[3] != "0") + if (args.size() == 3 && args[2] != "0") { // Do the whole group args2.push_back(args[0]); diff --git a/code/ryzom/server/src/entities_game_service/building_manager/building_physical.cpp b/code/ryzom/server/src/entities_game_service/building_manager/building_physical.cpp index 9e93b7ed9..30374ec3d 100644 --- a/code/ryzom/server/src/entities_game_service/building_manager/building_physical.cpp +++ b/code/ryzom/server/src/entities_game_service/building_manager/building_physical.cpp @@ -89,7 +89,15 @@ bool IBuildingPhysical::addUser(CCharacter * user, uint16 roomIdx, uint16 ownerI return false; } + + if (user->currentHp() <= 0 ) + { + nlwarning("user %s is dead",user->getId().toString().c_str()); + return false; + } + CCharacter *owner; + if (ownerIdx < _Players.size()) { owner = PlayerManager.getChar(_Players[ownerIdx] ); diff --git a/code/ryzom/server/src/entities_game_service/building_manager/room_instance.cpp b/code/ryzom/server/src/entities_game_service/building_manager/room_instance.cpp index 6cebd81fe..518b30a23 100644 --- a/code/ryzom/server/src/entities_game_service/building_manager/room_instance.cpp +++ b/code/ryzom/server/src/entities_game_service/building_manager/room_instance.cpp @@ -91,6 +91,8 @@ void CRoomInstanceGuild::removeUser( CCharacter* user ) return; } + user->sendUrl("app_ryzhome action=quit_guild_room&room_name="+guildBuilding->getName(), ""); + --_RefCount; if ( _RefCount == 0 ) { @@ -104,9 +106,14 @@ void CRoomInstanceGuild::addUser( CCharacter* user, CCharacter* owner ) { BOMB_IF( !user, " null character!", return ); + CBuildingPhysicalGuild * guildBuilding = dynamic_cast( _Building ); + BOMB_IF( !guildBuilding, " building type does not match with room type", return ); + // open guild inventory window PlayerManager.sendImpulseToClient(user->getId(), "GUILD:OPEN_INVENTORY"); + user->sendUrl("app_ryzhome action=open_guild_room&owner="+ owner->getName().toString()+"&room_name="+guildBuilding->getName(), ""); + ++_RefCount; } @@ -141,21 +148,8 @@ void CRoomInstancePlayer::removeUser( CCharacter* user ) return; } - TVectorParamCheck titleParams; - TVectorParamCheck textParams; - uint32 userId = PlayerManager.getPlayerId( user->getId() ); - std::string name = "CLOSE_URL"; - //send command to close webig - ucstring phrase = ucstring("CLOSE_URL(){[WEB : app_ryzhome action=quit_room]}"); - NLNET::CMessage msgout("SET_PHRASE"); - msgout.serial(name); - msgout.serial(phrase); - sendMessageViaMirror("IOS", msgout); - - uint32 titleId = STRING_MANAGER::sendStringToUser(userId, "web_transactions", titleParams); - uint32 textId = STRING_MANAGER::sendStringToUser(userId, "CLOSE_URL", textParams); - PlayerManager.sendImpulseToClient(user->getId(), "USER:POPUP", titleId, textId); - + user->sendUrl("app_ryzhome action=quit_player_room&room_name="+playerBuilding->getName(), ""); + --_RefCount; if ( _RefCount == 0 ) { @@ -170,6 +164,9 @@ void CRoomInstancePlayer::addUser( CCharacter* user, CCharacter* owner ) { BOMB_IF( !user, " null character!", return ); + CBuildingPhysicalPlayer * playerBuilding = dynamic_cast( _Building ); + BOMB_IF( !playerBuilding, " building type does not match with room type", return ); + // open room inventory window PlayerManager.sendImpulseToClient(user->getId(), "ITEM:OPEN_ROOM_INVENTORY"); if (owner) @@ -182,23 +179,7 @@ void CRoomInstancePlayer::addUser( CCharacter* user, CCharacter* owner ) // Very rare case owner = user; } - // solve bot names for title and text - TVectorParamCheck titleParams; - TVectorParamCheck textParams; - // send the popup message - uint32 userId = PlayerManager.getPlayerId( user->getId() ); - - std::string name = "RYZHOME_URL"; - ucstring phrase = "RYZHOME_URL(){[WEB : app_ryzhome user=" + owner->getName().toString() + "]}"; - NLNET::CMessage msgout("SET_PHRASE"); - msgout.serial(name); - msgout.serial(phrase); - sendMessageViaMirror("IOS", msgout); - - uint32 titleId = STRING_MANAGER::sendStringToUser(userId, "web_transactions", titleParams); - uint32 textId = STRING_MANAGER::sendStringToUser(userId, "RYZHOME_URL", textParams); - PlayerManager.sendImpulseToClient(user->getId(), "USER:POPUP", titleId, textId); - + user->sendUrl("app_ryzhome action=open_player_room&owner="+ owner->getName().toString()+"&room_name="+playerBuilding->getName(), ""); ++_RefCount; } diff --git a/code/ryzom/server/src/entities_game_service/client_messages.cpp b/code/ryzom/server/src/entities_game_service/client_messages.cpp index 9c40edc4a..58dc114e2 100644 --- a/code/ryzom/server/src/entities_game_service/client_messages.cpp +++ b/code/ryzom/server/src/entities_game_service/client_messages.cpp @@ -2078,7 +2078,7 @@ void cbClientSit( NLNET::CMessage& msgin, const std::string &serviceName, NLNET: } -// client send a command to chang guild motd +// client send a command to change guild motd void cbClientGuildMotd( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId ) { H_AUTO(cbClientGuildMotd); @@ -2737,7 +2737,7 @@ void cbClientSetCharacterTitle( NLNET::CMessage& msgin, const std::string & serv } // kxu: TODO: check validity of title chosen by player - c->setTitle( (CHARACTER_TITLE::ECharacterTitle) title ); + c->setNewTitle(CHARACTER_TITLE::toString((CHARACTER_TITLE::ECharacterTitle)title)); c->registerName(); } diff --git a/code/ryzom/server/src/entities_game_service/creature_manager/creature_manager.cpp b/code/ryzom/server/src/entities_game_service/creature_manager/creature_manager.cpp index 3def0fde0..7c0dc7780 100644 --- a/code/ryzom/server/src/entities_game_service/creature_manager/creature_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/creature_manager/creature_manager.cpp @@ -117,7 +117,7 @@ void CGenNpcDescMsgImp::callback (const std::string &serviceName, NLNET::TServic //if the creature has a user model and if the user model's script contains parse errors, change //the creature's name to - if (_UserModelId != "" && CDynamicSheetManager::getInstance()->scriptErrors(_PrimAlias, _UserModelId) == true) + if (!_UserModelId.empty() && CDynamicSheetManager::getInstance()->scriptErrors(_PrimAlias, _UserModelId) == true) { TDataSetRow row = creature->getEntityRowId(); ucstring name; diff --git a/code/ryzom/server/src/entities_game_service/dyn_chat_egs.cpp b/code/ryzom/server/src/entities_game_service/dyn_chat_egs.cpp index a665c6eb5..90d41820f 100644 --- a/code/ryzom/server/src/entities_game_service/dyn_chat_egs.cpp +++ b/code/ryzom/server/src/entities_game_service/dyn_chat_egs.cpp @@ -50,14 +50,14 @@ void CDynChatEGS::init() { { "DYN_CHAT:ADD_SERVICE_CHAN", CDynChatEGS::cbServiceAddChan }, { "DYN_CHAT:SET_HIDE_BUBBLE", CDynChatEGS::cbServiceSetHideBubble }, + { "DYN_CHAT:SET_UNIVERSAL_CHANNEL", CDynChatEGS::cbServiceSetUniversalChannel}, { "DYN_CHAT:SET_CHAN_HISTORY", CDynChatEGS::cbServiceSetChanHistory }, { "DYN_CHAT:REMOVE_SERVICE_CHAN", CDynChatEGS::cbServiceRemoveChan }, { "DYN_CHAT:ADD_CLIENT", CDynChatEGS::cbServiceAddClient }, { "DYN_CHAT:ADD_SESSION", CDynChatEGS::cbServiceAddSession }, { "DYN_CHAT:ADD_SESSION_ENTITY", CDynChatEGS::cbServiceAddSessionEntity }, { "DYN_CHAT:REMOVE_SESSION", CDynChatEGS::cbServiceRemoveSession }, - { "DYN_CHAT:REMOVE_SESSION_ENTITY", CDynChatEGS::cbServiceRemoveSessionEntity } - + { "DYN_CHAT:REMOVE_SESSION_ENTITY", CDynChatEGS::cbServiceRemoveSessionEntity} }; CUnifiedNetwork::getInstance()->addCallbackArray( _cbArray, sizeof(_cbArray) / sizeof(_cbArray[0]) ); @@ -315,7 +315,16 @@ bool CDynChatEGS::setHideBubble(TChanID chanID, bool hideBubble) return true; } - +//============================================================================================================ +bool CDynChatEGS::setUniversalChannel(TChanID chanID, bool universalChannel) +{ + CDynChatChan *chan = _DynChat.getChan(chanID); + if (!chan) return false; + if (universalChannel == chan->UniversalChannel) return true; // already good value + chan->UniversalChannel = universalChannel; + iosSetUniversalChannel(chanID, universalChannel); + return true; +} //============================================================================================================ void CDynChatEGS::cbServiceAddChan(NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId) @@ -344,6 +353,16 @@ void CDynChatEGS::cbServiceSetHideBubble(NLNET::CMessage& msgin, const std::stri DynChatEGS.setHideBubble(chan, hideBubble); } //============================================================================================================ +void CDynChatEGS::cbServiceSetUniversalChannel(NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId) +{ + TChanID chan; + bool universalChannel; + + msgin.serial(chan); + msgin.serial(universalChannel); + DynChatEGS.setUniversalChannel(chan, universalChannel); +} +//============================================================================================================ void CDynChatEGS::cbServiceAddClient(NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId) { TDataSetRow dsr; @@ -484,6 +503,15 @@ void CDynChatEGS::iosSetHideBubble(TChanID chan, bool hideBubble) sendMessageViaMirror( "IOS", msg); } +//============================================================================================================ +void CDynChatEGS::iosSetUniversalChannel(TChanID chan, bool universalChannel) +{ + CMessage msg("DYN_CHAT:SET_UNIVERSAL_CHANNEL"); + msg.serial(chan); + msg.serial(universalChannel); + sendMessageViaMirror( "IOS", msg); +} + //============================================================================================================ void CDynChatEGS::iosRemoveSession(TChanID chan, const TDataSetRow &client) { diff --git a/code/ryzom/server/src/entities_game_service/dyn_chat_egs.h b/code/ryzom/server/src/entities_game_service/dyn_chat_egs.h index b24dd84ff..fb1ad9313 100644 --- a/code/ryzom/server/src/entities_game_service/dyn_chat_egs.h +++ b/code/ryzom/server/src/entities_game_service/dyn_chat_egs.h @@ -68,8 +68,14 @@ public: * \return true if success */ bool setHideBubble(TChanID chan, bool hideBubble); + + /** Change sessions in channel 'chan' so that chat is treated like universe channel + * \return true if success + */ + bool setUniversalChannel(TChanID chan, bool universalChannel); + /** Stop session in channel 'chan' for the client 'client'. - * \return true if success + * \return true if success */ bool removeSession(TChanID chan, const TDataSetRow &client); // Set 'write right' flag for a session. @@ -92,6 +98,8 @@ public: static void cbServiceAddChan(NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId); /// Message from a service that need to hide bubbble of player/npc speaking in that channel static void cbServiceSetHideBubble(NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId); + /// Message from a service that need to set channel to be like universe channel + static void cbServiceSetUniversalChannel(NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId); /// Message from a service: remove a channel. static void cbServiceRemoveChan(NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId); /// Message from a service : set the channel history @@ -116,7 +124,8 @@ private: private: // ios msg void iosAddChan(TChanID chan, bool noBroadcast, bool forwardPlayerInputs, bool unify); - void iosSetHideBubble(TChanID chan, bool hiddeBubble); + void iosSetHideBubble(TChanID chan, bool hideBubble); + void iosSetUniversalChannel(TChanID chan, bool universalChannel); void iosRemoveChan(TChanID chan); void iosAddSession(TChanID chan, const TDataSetRow &client, bool readOnly); void iosRemoveSession(TChanID chan, const TDataSetRow &client); diff --git a/code/ryzom/server/src/entities_game_service/entities_game_service.cpp b/code/ryzom/server/src/entities_game_service/entities_game_service.cpp index f431372cd..ef0f9404e 100644 --- a/code/ryzom/server/src/entities_game_service/entities_game_service.cpp +++ b/code/ryzom/server/src/entities_game_service/entities_game_service.cpp @@ -4321,41 +4321,7 @@ NLMISC_COMMAND(setAllSkillsToValue,"set all skills to value","getSkills(); - skills._Skills[ i ].Base = min( value, (sint32)SkillsTree->SkillsTree[ i ].MaxSkillValue ); - skills._Skills[ i ].Current = skills._Skills[ i ].Base; - skills._Skills[ i ].MaxLvlReached = skills._Skills[ i ].Base; - - // update all parent skill with new max children - SKILLS::ESkills skillUpdated = (SKILLS::ESkills)i; - while( SkillsTree->SkillsTree[ skillUpdated ].ParentSkill != SKILLS::unknown ) - { - if( skills._Skills[ i ].Base > skills._Skills[ SkillsTree->SkillsTree[ skillUpdated ].ParentSkill ].MaxLvlReached ) - { - skills._Skills[ SkillsTree->SkillsTree[ skillUpdated ].ParentSkill ].MaxLvlReached = skills._Skills[ i ].Base; - skills._Skills[ SkillsTree->SkillsTree[ skillUpdated ].ParentSkill ].Base = min( skills._Skills[ skillUpdated ].Base, (sint32)SkillsTree->SkillsTree[ SkillsTree->SkillsTree[ skillUpdated ].ParentSkill ].MaxSkillValue ); - skillUpdated = SkillsTree->SkillsTree[ skillUpdated ].ParentSkill; - } - else - { - break; - } - } - -// e->_PropertyDatabase.x_setProp( string("CHARACTER_INFO:SKILLS:") + NLMISC::toStringEnum( i ) + string(":SKILL"), skills._Skills[ i ].Base ); - CBankAccessor_PLR::getCHARACTER_INFO().getSKILLS().getArray(i).setSKILL(e->_PropertyDatabase, checkedCast(skills._Skills[ i ].Base) ); -// e->_PropertyDatabase.x_setProp( string("CHARACTER_INFO:SKILLS:") + NLMISC::toStringEnum( i ) + string(":BaseSKILL"), skills._Skills[ i ].Base ); - CBankAccessor_PLR::getCHARACTER_INFO().getSKILLS().getArray(i).setBaseSKILL(e->_PropertyDatabase, checkedCast(skills._Skills[ i ].Base) ); - } + e->setSkillsToValue(value); } else { diff --git a/code/ryzom/server/src/entities_game_service/guild_manager/guild.cpp b/code/ryzom/server/src/entities_game_service/guild_manager/guild.cpp index 4e9b81911..b7277bc11 100644 --- a/code/ryzom/server/src/entities_game_service/guild_manager/guild.cpp +++ b/code/ryzom/server/src/entities_game_service/guild_manager/guild.cpp @@ -237,6 +237,16 @@ void CGuild::setMOTD( const std::string& motd, const NLMISC::CEntityId& eId) nlwarning("%s invalid member id %s",eId.toString().c_str()); return; } + + if ( motd == "?" ) + { + // Show the old MOTD + SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal); + params[0].Literal= _MessageOfTheDay; + CCharacter::sendDynamicMessageToChatGroup(user->getEntityRowId(), "GMOTD", CChatGroup::guild, params); + return; + } + EGSPD::CGuildGrade::TGuildGrade memberGrade = member->getGrade(); if( memberGrade >= EGSPD::CGuildGrade::Member) { @@ -255,9 +265,10 @@ void CGuild::setMOTD( const std::string& motd, const NLMISC::CEntityId& eId) if(!_MessageOfTheDay.empty()) { + // Show new MOTD to all members SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal); params[0].Literal= _MessageOfTheDay; - CCharacter::sendDynamicMessageToChatGroup(user->getEntityRowId(), "GMOTD", CChatGroup::guild, params); + sendMessageToGuildChat("GMOTD", params); } } else @@ -1408,6 +1419,25 @@ void CGuild::sendMessageToGuildMembers( const std::string & msg, const TVectorP IGuildUnifier::getInstance()->sendMessageToGuildMembers(this, msg, params); } +//---------------------------------------------------------------------------- +void CGuild::sendMessageToGuildChat( const std::string & msg, const TVectorParamCheck & params )const +{ + for ( std::map< EGSPD::TCharacterId, EGSPD::CGuildMemberPD*>::const_iterator it = getMembersBegin(); it != getMembersEnd(); ++it ) + { + CGuildMember * member = EGS_PD_CAST( (*it).second ); + EGS_PD_AST( member ); + + // continue if the player is offline + CGuildMemberModule * module = NULL; + if ( member->getReferencingModule(module) ) + { + CGuildCharProxy proxy; + module->getProxy(proxy); + proxy.sendDynamicMessageToChatGroup(msg, CChatGroup::guild, params); + } + } +} + //---------------------------------------------------------------------------- void CGuild::setMemberClientDB( CGuildMember* member ) { diff --git a/code/ryzom/server/src/entities_game_service/guild_manager/guild.h b/code/ryzom/server/src/entities_game_service/guild_manager/guild.h index e03556a0f..151c3ccce 100644 --- a/code/ryzom/server/src/entities_game_service/guild_manager/guild.h +++ b/code/ryzom/server/src/entities_game_service/guild_manager/guild.h @@ -165,6 +165,8 @@ public: void addMemberToGuildChat(CGuildMember *member); /// send a message to all members void sendMessageToGuildMembers( const std::string & msg, const TVectorParamCheck & params = TVectorParamCheck() )const; + /// send a message to all members in guild chat + void sendMessageToGuildChat( const std::string & msg, const TVectorParamCheck & params = TVectorParamCheck() )const; /// set information relative to a member in the guild client database void setMemberClientDB( CGuildMember* member ); /// return the best online user diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_kill.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_kill.cpp index d31f4e795..9124c1fc3 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_kill.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_kill.cpp @@ -215,9 +215,7 @@ class CMissionStepKillFauna : public IMissionStepTemplate ret.clear(); ret.resize( _SubSteps.size() ); for ( uint i = 0; i < _SubSteps.size(); i++ ) - { ret[i] = _SubSteps[i].Quantity; - } } virtual void getTextParams( uint & nbSubSteps,const std::string* & textPtr,TVectorParamCheck& retParams, const std::vector& subStepStates) diff --git a/code/ryzom/server/src/entities_game_service/outpost_manager/outpost_commands.cpp b/code/ryzom/server/src/entities_game_service/outpost_manager/outpost_commands.cpp index d0973a82c..0270eb9e6 100644 --- a/code/ryzom/server/src/entities_game_service/outpost_manager/outpost_commands.cpp +++ b/code/ryzom/server/src/entities_game_service/outpost_manager/outpost_commands.cpp @@ -121,7 +121,7 @@ NLMISC_COMMAND(outpostSimulateTimer0End, "", " [ if (args.size()>1) { NLMISC::fromString(args[1], endTime); - if (args[1][0]=='+') + if (args[1].find('+')==0) endTime += CTime::getSecondsSince1970(); } if (endTime==0) endTime = 1; @@ -144,7 +144,7 @@ NLMISC_COMMAND(outpostSimulateTimer1End, "", " [ if (args.size()>1) { NLMISC::fromString(args[1], endTime); - if (args[1][0]=='+') + if (args[1].find('+')==0) endTime += CTime::getSecondsSince1970(); } if (endTime==0) endTime = 1; @@ -167,7 +167,7 @@ NLMISC_COMMAND(outpostSimulateTimer2End, "", " [ if (args.size()>1) { NLMISC::fromString(args[1], endTime); - if (args[1][0]=='+') + if (args[1].find('+')==0) endTime += CTime::getSecondsSince1970(); } if (endTime==0) endTime = 1; diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/faber_action.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/faber_action.cpp index 9101ac850..50a069b5e 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/faber_action.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/faber_action.cpp @@ -281,7 +281,7 @@ public: } else { - c->wearRightHandItem(); + c->wearRightHandItem(phrase->getMps().size()/10); // report Xp Gain unless used tool is worned PROGRESSIONPVE::CCharacterProgressionPVE::getInstance()->actionReport( report, true, false ); diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/faber_phrase.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/faber_phrase.cpp index f74b81196..577544e13 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/faber_phrase.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/faber_phrase.cpp @@ -54,7 +54,7 @@ CFaberPhrase::CFaberPhrase() _CraftedItemStaticForm = 0; _RootFaberBricks = false; _RootFaberPlan = 0; - + // recommended skill level for using crafted item _Recommended = 0; @@ -67,13 +67,13 @@ CFaberPhrase::CFaberPhrase() _MBORange = 0.0f; _MBOProtection = 0.0f; _MBOSapLoad = 0.0f; - + // energy buff on item _MBOHitPoint = 0; _MBOSap = 0; _MBOStamina = 0; _MBOFocus = 0; - + _IsStatic = true; _PhraseType = BRICK_TYPE::FABER; } @@ -85,7 +85,7 @@ CFaberPhrase::CFaberPhrase() bool CFaberPhrase::build( const TDataSetRow & actorRowId, const std::vector< const CStaticBrick* >& bricks, bool buildToExecute ) { H_AUTO(CFaberPhrase_build); - + // we are sure there is at least one brick and that there are non NULL; nlassert( !bricks.empty() ); @@ -112,7 +112,7 @@ bool CFaberPhrase::build( const TDataSetRow & actorRowId, const std::vector< con return false; } } - else*/ if( ( brick.Family >= BRICK_FAMILIES::BeginFaberOption && brick.Family <= BRICK_FAMILIES::EndFaberOption ) + else*/ if( ( brick.Family >= BRICK_FAMILIES::BeginFaberOption && brick.Family <= BRICK_FAMILIES::EndFaberOption ) || ( brick.Family >= BRICK_FAMILIES::BeginFaberCredit && brick.Family <= BRICK_FAMILIES::EndFaberCredit ) ) { for ( uint j = 0 ; j < brick.Params.size() ; ++j) @@ -120,7 +120,7 @@ bool CFaberPhrase::build( const TDataSetRow & actorRowId, const std::vector< con const TBrickParam::IId* param = brick.Params[j]; switch(param->id()) - { + { case TBrickParam::FOCUS: INFOLOG("FOCUS: %i",((CSBrickParamCraftFocus *)param)->Focus); _FocusCost += ((CSBrickParamCraftFocus *)param)->Focus; @@ -217,10 +217,10 @@ bool CFaberPhrase::evaluate() bool CFaberPhrase::validate() { H_AUTO(CFaberPhrase_validate); - + if ( !CraftSystemEnabled ) return false; - + CCharacter * c = (CCharacter *) CEntityBaseManager::getEntityBasePtr( _ActorRowId ); if( c == 0 ) { @@ -234,7 +234,7 @@ bool CFaberPhrase::validate() return false; } - // check right hand item is a crafting tool + // check right hand item is a crafting tool CGameItemPtr rightHandItem = c->getRightHandItem(); if (rightHandItem == NULL || rightHandItem->getStaticForm() == NULL || rightHandItem->getStaticForm()->Family != ITEMFAMILY::CRAFTING_TOOL) { @@ -249,8 +249,16 @@ bool CFaberPhrase::validate() return false; } + + // check quality of right hand item (need be >= Recommended (level of item)) + if (rightHandItem->recommended()+49 < _Recommended) + { + PHRASE_UTILITIES::sendDynamicSystemMessage(_ActorRowId, "CRAFT_NEED_RECOMMENDED_CRAFTING_TOOL"); + return false; + } + // entities cant craft if in combat - /* commented as test of right hand item is now made... + /* commented as test of right hand item is now made... TDataSetRow entityRowId = CPhraseManager::getInstance().getEntityEngagedMeleeBy( _ActorRowId ); if (TheDataset.isAccessible(entityRowId)) { @@ -258,7 +266,7 @@ bool CFaberPhrase::validate() return false; } */ - + const sint32 focus = c->getScores()._PhysicalScores[ SCORES::focus ].Current; if ( focus < _FocusCost ) { @@ -318,7 +326,7 @@ bool CFaberPhrase::update() void CFaberPhrase::execute() { H_AUTO(CFaberPhrase_execute); - + CCharacter* player = PlayerManager.getChar(_ActorRowId); if (!player) return; @@ -336,13 +344,13 @@ void CFaberPhrase::execute() _FaberTime = (NLMISC::TGameCycle)(plan->CraftingDuration * 10); } nldebug("CFaberPhrase::execute> _FaberTime = %d",_FaberTime); - + const NLMISC::TGameCycle time = CTickEventHandler::getGameCycle(); - + _ExecutionEndDate = time + _FaberTime ; player->setCurrentAction(CLIENT_ACTION_TYPE::Faber,_ExecutionEndDate); - player->staticActionInProgress(true); + player->staticActionInProgress(true); // set behaviour PHRASE_UTILITIES::sendUpdateBehaviour( _ActorRowId, MBEHAV::FABER ); @@ -366,7 +374,7 @@ bool CFaberPhrase::launch() void CFaberPhrase::apply() { H_AUTO(CFaberPhrase_apply); - + CCharacter * c = dynamic_cast< CCharacter * > ( CEntityBaseManager::getEntityBasePtr( _ActorRowId ) ); if( c == 0 ) { @@ -410,7 +418,7 @@ void CFaberPhrase::apply() } nbMp = (sint32)_MpsFormula.size(); - + uint32 nbMpForumulaNeedeInPlan = 0; neededMp = (uint32)_RootFaberPlan->Faber->NeededMpsFormula.size(); for( uint mp = 0; mp < neededMp; ++mp ) @@ -418,7 +426,7 @@ void CFaberPhrase::apply() //for each type of Mp needed nbMpForumulaNeedeInPlan += _RootFaberPlan->Faber->NeededMpsFormula[ mp ].Quantity; } - + if( nbMpForumulaNeedeInPlan != _MpsFormula.size() ) { nlwarning(" Craft plan %s need %d Raw Material Formula and client send %d Raw Material Formula", c->getCraftPlan().toString().c_str(), _RootFaberPlan->Faber->NeededMpsFormula.size(), _MpsFormula.size() ); @@ -453,7 +461,7 @@ void CFaberPhrase::apply() stop(); return; } - + neededMp = (uint32)_RootFaberPlan->Faber->NeededMps.size(); EGSPD::CPeople::TPeople civRestriction = _RootFaberPlan->CivRestriction; uint32 usedMp=0; @@ -469,7 +477,7 @@ void CFaberPhrase::apply() { // for each Mp of one type (we have Quantity by type) uint32 NumMpParameters = (uint32)usedMps[u_mp]->Mp->MpFaberParameters.size(); - + // for each Faber parameters in Mp for( uint j = 0; j < NumMpParameters; ++j ) { @@ -571,7 +579,7 @@ void CFaberPhrase::apply() CGameItemPtr CFaberPhrase::systemCraftItem( const NLMISC::CSheetId& sheet, const std::vector< NLMISC::CSheetId >& Mp, const std::vector< NLMISC::CSheetId >& MpFormula ) { H_AUTO(CFaberPhrase_systemCraftItem); - + std::vector< const CStaticBrick* > bricks; _RootFaberPlan = CSheets::getSBrickForm( sheet ); const CStaticBrick * rootFaberBricks = CSheets::getSBrickForm( CSheetId("bcpa01.sbrick") ); @@ -586,7 +594,7 @@ CGameItemPtr CFaberPhrase::systemCraftItem( const NLMISC::CSheetId& sheet, const } CGameItemPtr craftedItem = 0; - + if( _RootFaberPlan && _RootFaberPlan->Faber ) { _CraftedItemStaticForm = CSheets::getForm( _RootFaberPlan->Faber->CraftedItem ); @@ -597,7 +605,7 @@ CGameItemPtr CFaberPhrase::systemCraftItem( const NLMISC::CSheetId& sheet, const bricks.push_back( rootFaberBricks ); bricks.push_back( _RootFaberPlan ); - + for( vector< NLMISC::CSheetId >::const_iterator it = Mp.begin(); it != Mp.end(); ++it ) { const CStaticItem * mp = CSheets::getForm( (*it) ); @@ -626,7 +634,7 @@ CGameItemPtr CFaberPhrase::systemCraftItem( const NLMISC::CSheetId& sheet, const } _MpsFormula.push_back( mp ); } - + // Check quantity of gived Mps formula if( _RootFaberPlan->Faber->NeededMpsFormula.size() > _MpsFormula.size() ) { @@ -658,7 +666,7 @@ CGameItemPtr CFaberPhrase::systemCraftItem( const NLMISC::CSheetId& sheet, const void CFaberPhrase::end() { H_AUTO(CFaberPhrase_end); - + CCharacter* player = PlayerManager.getChar(_ActorRowId); if (!player) return; @@ -679,7 +687,7 @@ void CFaberPhrase::end() void CFaberPhrase::stop() { H_AUTO(CFaberPhrase_stop); - + CCharacter* player = PlayerManager.getChar(_ActorRowId); if (!player) return; @@ -697,11 +705,11 @@ void CFaberPhrase::stop() } // stop // -NLMISC_COMMAND(simuCraft, "Simulation de craft pour verifier les probabilités de reusir un item","") +NLMISC_COMMAND(simuCraft, "Craft simulation to verify probabilities to succesfully craft an item","") { if (args.size() != 3) return false; - + uint32 nbSimu, skillLevel, itemQuality; NLMISC::fromString(args[0], nbSimu); NLMISC::fromString(args[1], skillLevel); @@ -733,7 +741,7 @@ NLMISC_COMMAND(simuCraft, "Simulation de craft pour verifier les probabilit if(sf == 1.0f) { ++nbFullSuccess; - XpGain += CStaticSuccessTable::getXPGain(SUCCESS_TABLE_TYPE::Craft, deltaLvlXp); + XpGain += CStaticSuccessTable::getXPGain(SUCCESS_TABLE_TYPE::Craft, deltaLvlXp); } else if( sf > 0.0f) { @@ -747,7 +755,7 @@ NLMISC_COMMAND(simuCraft, "Simulation de craft pour verifier les probabilit nlinfo("FaberSimu: Results after %d roll: Sucess: %d (%.2f%%), partial sucess: %d (%.2f%%), Miss: %d (%.2f%%), Xp Gain %d", nbSimu, nbFullSuccess, 100.0f*nbFullSuccess/nbSimu, - nbPartialSuccess, 100.0f*nbPartialSuccess/nbSimu, + nbPartialSuccess, 100.0f*nbPartialSuccess/nbSimu, nbMiss, 100.0f*nbMiss/nbSimu, uint32(1000.f*XpGain / (nbSimu-nbMiss/2) ) ); diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/fg_extraction_phrase.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/fg_extraction_phrase.cpp index f9d2efe0c..6032adcfc 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/fg_extraction_phrase.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/fg_extraction_phrase.cpp @@ -107,7 +107,7 @@ CFgExtractionPhrase::CFgExtractionPhrase() bool CFgExtractionPhrase::build( const TDataSetRow & actorRowId, const std::vector< const CStaticBrick* >& bricks, bool buildToExecute ) { H_AUTO(CFgExtractionPhrase_build); - + _ActorRowId = actorRowId; // Check grammar @@ -120,7 +120,7 @@ bool CFgExtractionPhrase::build( const TDataSetRow & actorRowId, const std::vect for (std::vector::const_iterator ib=bricks.begin(); ib!=bricks.end(); ++ib ) { const CStaticBrick& brick = *(*ib); - + // Compute Sabrina credit and cost) if ( brick.SabrinaValue > 0 ) sabrinaCost += brick.SabrinaValue; @@ -156,7 +156,7 @@ bool CFgExtractionPhrase::build( const TDataSetRow & actorRowId, const std::vect break; case TBrickParam::FG_SRC_PRD: INFOLOG("FG_SRC_PRD: %g",((CSBrickParamForagePeriod *)param)->Period); - if ( ((CSBrickParamForagePeriod *)param)->Period != 0 ) + if ( ((CSBrickParamForagePeriod *)param)->Period != 0 ) _RequestedProps[CHarvestSource::S] = 1.0f / (((CSBrickParamForagePeriod *)param)->Period * 10.0f); // period converted from second to tick else _RequestedProps[CHarvestSource::S] = 1.0f; @@ -231,7 +231,7 @@ bool CFgExtractionPhrase::build( const TDataSetRow & actorRowId, const std::vect //nlerror( "TODO: Families" ); //if ( brick.Family >= BRICK_FAMILIES::BeginForage - + //insertProgressingSkill( brick.Skill, brick.SheetId ); } @@ -432,7 +432,7 @@ bool CFgExtractionPhrase::evaluate() bool CFgExtractionPhrase::validate() { H_AUTO(CFgExtractionPhrase_validate); - + if ( ! HarvestSystemEnabled ) return false; @@ -544,6 +544,15 @@ bool CFgExtractionPhrase::validate() return false; // has disappeared } + // test if tool have enough quality + sint depositQ = (sint)harvestSource->forageSite()->deposit()->maxQuality(); + + if ((depositQ > 0) && (item->recommended()+49 < depositQ)) + { + PHRASE_UTILITIES::sendDynamicSystemMessage(_ActorRowId, "FORAGE_TOOL_QUALITY_TOO_LOW"); + return false; + } + // Check the distance from the player to the source (ignoring Z because for tunnel case, player couldn't target the source) const CEntityState& state = player->getState(); CVector2f playerPos( (float)state.X / 1000.0f, (float)state.Y / 1000.0f ); @@ -589,7 +598,7 @@ bool CFgExtractionPhrase::validate() bool CFgExtractionPhrase::update() { H_AUTO(CFgExtractionPhrase_update); - + CCharacter* player = PlayerManager.getChar( _ActorRowId ); if ( ! player ) return false; @@ -600,7 +609,7 @@ bool CFgExtractionPhrase::update() if( idle() ) { idle(false); - + // check if actor can use action CBypassCheckFlags bypassCheckFlags = CBypassCheckFlags::NoFlags; if (player->canEntityUseAction(bypassCheckFlags,false) == false) @@ -633,7 +642,7 @@ bool CFgExtractionPhrase::update() void CFgExtractionPhrase::execute() { H_AUTO(CFgExtractionPhrase_execute); - + // Get character CCharacter* player = PlayerManager.getChar( _ActorRowId ); if (!player) @@ -676,7 +685,7 @@ void CFgExtractionPhrase::execute() void CFgExtractionPhrase::end() { H_AUTO(CFgExtractionPhrase_end); - + CCharacter* player = PlayerManager.getChar(_ActorRowId); if (!player) return; @@ -694,7 +703,7 @@ void CFgExtractionPhrase::end() void CFgExtractionPhrase::stop() { H_AUTO(CFgExtractionPhrase_stop); - + CCharacter* player = PlayerManager.getChar(_ActorRowId); if (!player) return; @@ -742,7 +751,7 @@ bool CFgExtractionPhrase::launch() void CFgExtractionPhrase::apply() { H_AUTO(CFgExtractionPhrase_apply); - + CCharacter* player = PlayerManager.getChar( _ActorRowId ); if (!player) return; @@ -778,7 +787,7 @@ void CFgExtractionPhrase::apply() void CFgExtractionPhrase::applyExtraction( CCharacter *player, float successFactor ) { H_AUTO(CFgExtractionPhrase_applyExtraction); - + nlassert( _Source ); if ( ! player->forageProgress() ) return; @@ -801,7 +810,7 @@ void CFgExtractionPhrase::applyExtraction( CCharacter *player, float successFact player->forageProgress()->fillFromExtraction( _Props.Extraction.ObtainedProps[CHarvestSource::A], _Props.Extraction.ObtainedProps[CHarvestSource::Q], player ); else return; - + // Report result of action if ( propDrop != CHarvestSource::NoDrop ) { @@ -864,7 +873,7 @@ struct CNonNullGameItemPtrPred : std::unary_function void CFgExtractionPhrase::doKamiOffering( CCharacter *player ) { H_AUTO(CFgExtractionPhrase_doKamiOffering); - + // Count the number of non empty slots // const vector &theBag = player->getInventory()[INVENTORIES::bag]()->getChildren(); CInventoryPtr theBag = player->getInventory(INVENTORIES::bag); @@ -912,7 +921,7 @@ void CFgExtractionPhrase::doKamiOffering( CCharacter *player ) (*ib)->getSheetId().toString().c_str()); */ // EGSPD::forageKamiItemOffering(player->getId(), _Source->depositForK()->name(), _Source->depositForK()->kamiAnger(), _Props.Care.KamiAngerDec[CHarvestSource::KamiAngerDec], item->getSheetId().toString()); - + // TODO: quantity, filter, etc. // player->destroyItem( INVENTORIES::bag, ib-theBag.begin(), 1/*(*ib).quantity()*/, false ); theBag->deleteItem(i); diff --git a/code/ryzom/server/src/entities_game_service/player_manager/character.cpp b/code/ryzom/server/src/entities_game_service/player_manager/character.cpp index b493d041b..6aabe5e8b 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/character.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/character.cpp @@ -501,7 +501,7 @@ CCharacter::CCharacter(): CEntityBase(false), _TeamId= CTEAM::InvalidTeamId; ///init LeagueId - _LeagueId = TChanID::Unknown; + _LeagueId = DYN_CHAT_INVALID_CHAN; // init combat flags _CombatEventFlagTicks.resize(32); @@ -675,6 +675,9 @@ CCharacter::CCharacter(): CEntityBase(false), _FriendVisibility = VisibleToAll; + _LangChannel = "en"; + _NewTitle = "Refugee"; + initDatabase(); } // CCharacter // @@ -699,6 +702,7 @@ void CCharacter::clear() _ForbidAuraUseStartDate=0; _ForbidAuraUseEndDate=0; _Title= CHARACTER_TITLE::Refugee; + _NewTitle = "Refugee"; SET_STRUCT_MEMBER(_VisualPropertyA,PropertySubData.HatModel,0); SET_STRUCT_MEMBER(_VisualPropertyA,PropertySubData.HatColor,0); @@ -3851,9 +3855,9 @@ void CCharacter::sendBetaTesterStatus() sendReservedTitleStatus( CHARACTER_TITLE::FBT, p->isBetaTester() ); - if (!p->isBetaTester() && _Title == CHARACTER_TITLE::FBT) + if (!p->isBetaTester() && _NewTitle == "FBT") { - _Title = CHARACTER_TITLE::Refugee; + _NewTitle = "Refugee"; registerName(); } } @@ -3869,9 +3873,9 @@ void CCharacter::sendWindermeerStatus() sendReservedTitleStatus( CHARACTER_TITLE::WIND, p->isWindermeerCommunity() ); - if ( !p->isWindermeerCommunity() && _Title == CHARACTER_TITLE::WIND) + if ( !p->isWindermeerCommunity() && _NewTitle == "WIND") { - _Title = CHARACTER_TITLE::Refugee; + _NewTitle = "Refugee"; registerName(); } } @@ -6963,11 +6967,11 @@ double CCharacter::addXpToSkillInternal( double XpGain, const std::string& ContS CBankAccessor_PLR::getCHARACTER_INFO().getRING_XP_CATALYSER().setCount(_PropertyDatabase, checkedCast(ringCatalyserCount) ); } } - } - if (!p->isTrialPlayer()) - { - xpBonus = XpGain; + if (!p->isTrialPlayer()) + { + xpBonus = XpGain; + } } XpGain += xpBonus + ringXpBonus; @@ -7081,7 +7085,7 @@ double CCharacter::addXpToSkillInternal( double XpGain, const std::string& ContS SM_STATIC_PARAMS_3(paramsP, STRING_MANAGER::skill, STRING_MANAGER::integer, STRING_MANAGER::integer); paramsP[0].Enum = skillEnum; paramsP[1].Int = max((sint32)1, sint32(100*XpGain) ); - paramsP[2].Int = max((sint32)1, sint32(100*(XpGain - (xpBonus+ringXpBonus))) ); + paramsP[2].Int = max((sint32)1, sint32(100*(XpGain - xpBonus - ringXpBonus))); PHRASE_UTILITIES::sendDynamicSystemMessage(_EntityRowId, "XP_CATALYSER_PROGRESS_NORMAL_GAIN", paramsP); if( xpBonus > 0 ) @@ -7329,11 +7333,18 @@ double CCharacter::addXpToSkillInternal( double XpGain, const std::string& ContS return XpGainRemainder; } - //----------------------------------------------- // CCharacter::setSkillTreeToMaxValue Set skill tree of character to max value of each skill //----------------------------------------------- void CCharacter::setSkillsToMaxValue() +{ + setSkillsToValue(-1); +} + +//----------------------------------------------- +// CCharacter::setSkillTreeToMaxValue Set skill tree of character to max value of each skill +//----------------------------------------------- +void CCharacter::setSkillsToValue(const sint32& value) { // get pointer on static skills tree definition CSheetId sheet("skills.skill_tree"); @@ -7342,16 +7353,31 @@ void CCharacter::setSkillsToMaxValue() for( uint i = 0; i < SKILLS::NUM_SKILLS; ++i ) { - _Skills._Skills[ i ].Base = SkillsTree->SkillsTree[ i ].MaxSkillValue; + _Skills._Skills[ i ].Base = (value < 0) ? SkillsTree->SkillsTree[ i ].MaxSkillValue : min( value, (sint32)SkillsTree->SkillsTree[ i ].MaxSkillValue ); _Skills._Skills[ i ].Current = SkillsTree->SkillsTree[ i ].MaxSkillValue + _Skills._Skills[ i ].Modifier; -// _PropertyDatabase.setProp( _DataIndexReminder->CHARACTER_INFO.SKILLS.Skill[i], _Skills._Skills[ i ].Current ); - CBankAccessor_PLR::getCHARACTER_INFO().getSKILLS().getArray(i).setSKILL(_PropertyDatabase, checkedCast(_Skills._Skills[ i ].Current) ); -// _PropertyDatabase.setProp( _DataIndexReminder->CHARACTER_INFO.SKILLS.BaseSkill[i], _Skills._Skills[ i ].Base ); + _Skills._Skills[ i ].MaxLvlReached = _Skills._Skills[ i ].Current; + CBankAccessor_PLR::getCHARACTER_INFO().getSKILLS().getArray(i).setBaseSKILL(_PropertyDatabase, checkedCast(_Skills._Skills[ i ].Base) ); + CBankAccessor_PLR::getCHARACTER_INFO().getSKILLS().getArray(i).setSKILL(_PropertyDatabase, checkedCast(_Skills._Skills[ i ].Current) ); + + // update all parent skill with new max children + SKILLS::ESkills skillUpdated = (SKILLS::ESkills)i; + while( SkillsTree->SkillsTree[ skillUpdated ].ParentSkill != SKILLS::unknown ) + { + if( _Skills._Skills[ i ].Base > _Skills._Skills[ SkillsTree->SkillsTree[ skillUpdated ].ParentSkill ].MaxLvlReached ) + { + _Skills._Skills[ SkillsTree->SkillsTree[ skillUpdated ].ParentSkill ].MaxLvlReached = _Skills._Skills[ i ].Base; + _Skills._Skills[ SkillsTree->SkillsTree[ skillUpdated ].ParentSkill ].Base = min( _Skills._Skills[ skillUpdated ].Base, (sint32)SkillsTree->SkillsTree[ SkillsTree->SkillsTree[ skillUpdated ].ParentSkill ].MaxSkillValue ); + skillUpdated = SkillsTree->SkillsTree[ skillUpdated ].ParentSkill; + } + else + { + break; + } + } } } - //----------------------------------------------- // CCharacter::sendDynamicSystemMessage //----------------------------------------------- @@ -7475,7 +7501,6 @@ void CCharacter::sendUserChar( uint32 userId, uint8 scenarioSeason, const R2::TU } } - //----------------------------------------------- // Return the home mainland session id for a character TSessionId CCharacter::getHomeMainlandSessionId() const @@ -7949,6 +7974,7 @@ void CCharacter::setStartStatistics( const CCreateCharMsg& createCharMsg ) _Race = (EGSPD::CPeople::TPeople) createCharMsg.People; _Gender = createCharMsg.Sex; _Title = CHARACTER_TITLE::Refugee; + _NewTitle = "Refugee"; // fame information // Players start out as Neutral in their declared clans @@ -9787,7 +9813,7 @@ bool CCharacter::queryItemPrice( const CGameItemPtr item, uint32& price ) quality = theItem->quality(); if ( theItem->maxDurability() ) wornFactor = float(theItem->durability()) / float(theItem->maxDurability()); - price = (uint32) ( CShopTypeManager::computeBasePrice( theItem, quality ) * wornFactor ); + price = (uint32) ( CShopTypeManager::computeBasePrice( theItem, quality ) * wornFactor * 0.02 ); return true; } @@ -10214,6 +10240,35 @@ void CCharacter::initPvpPointDb() CBankAccessor_PLR::getUSER().getRRPS_LEVELS(0).setVALUE(_PropertyDatabase, _PvpPoint ); } +//----------------------------------------------------------------------------- +void CCharacter::setLangChannel(const string &lang) { + _LangChannel = lang; +} + +//----------------------------------------------------------------------------- +void CCharacter::setNewTitle(const string &title) { + _NewTitle = title; +} + +//----------------------------------------------------------------------------- +void CCharacter::setTagPvPA(const string &tag) { + _TagPvPA = tag; +} + +//----------------------------------------------------------------------------- +void CCharacter::setTagPvPB(const string &tag) { + _TagPvPB = tag; +} + +//----------------------------------------------------------------------------- +void CCharacter::setTagA(const string &tag) { + _TagA = tag; +} + +//----------------------------------------------------------------------------- +void CCharacter::setTagB(const string &tag) { + _TagB = tag; +} //----------------------------------------------------------------------------- void CCharacter::setOrganization(uint32 org) @@ -12427,10 +12482,15 @@ bool CCharacter::autoFillExchangeView() { invItem = playerBagInvPointer->getItem(inventoryIndex); if (invItem == NULL) - continue; + continue; - itemsSeenCount++; + if (invItem->getLockedByOwner()) + continue; + + if (invItem->getRefInventory() != NULL) + continue; + itemsSeenCount++; // Changed to support comparisons on sheetID masks if (invItem->getSheetId() == validateSteps[stepCounter].Sheet) { @@ -12895,7 +12955,7 @@ void CCharacter::registerName(const ucstring &newName) CMessage msgName("CHARACTER_NAME_LANG"); msgName.serial(_EntityRowId); - string sTitle = CHARACTER_TITLE::toString(_Title); + string sTitle = getFullTitle(); ucstring RegisteredName; if (newName.empty()) RegisteredName = getName() + string("$") + sTitle + string("$"); @@ -13600,9 +13660,13 @@ void CCharacter::sendUrl(const string &url, const string &salt) string control; if (!salt.empty()) { - string checksum = salt+url; control = "&hmac="+getHMacSHA1((uint8*)&url[0], (uint32)url.size(), (uint8*)&salt[0], (uint32)salt.size()).toString(); } + else + { + string defaultSalt = toString(getLastConnectedDate()); + control = "&hmac="+getHMacSHA1((uint8*)&url[0], (uint32)url.size(), (uint8*)&defaultSalt[0], (uint32)defaultSalt.size()).toString(); + } nlinfo(url.c_str()); TVectorParamCheck titleParams; @@ -16161,15 +16225,30 @@ void CCharacter::applyGooDamage( float gooDistance ) if (hpLost < 1) hpLost = 1; if( hpLost > _PhysScores._PhysicalScores[ SCORES::hit_points ].Current ) { - _PhysScores._PhysicalScores[ SCORES::hit_points ].Current = 0; - // send message to player for inform is dead by goo - sendDynamicSystemMessage(_EntityRowId, "KILLED_BY_GOO"); + _PhysScores._PhysicalScores[ SCORES::hit_points ].Current = 0; + + // send message to player for inform is dead by goo or other + if (_CurrentContinent == CONTINENT::FYROS) + sendDynamicSystemMessage(_EntityRowId, "KILLED_BY_FIRE"); + else if (_CurrentContinent == CONTINENT::TRYKER) + sendDynamicSystemMessage(_EntityRowId, "KILLED_BY_STEAM"); + else if (_CurrentContinent == CONTINENT::MATIS) + sendDynamicSystemMessage(_EntityRowId, "KILLED_BY_POISON"); + else + sendDynamicSystemMessage(_EntityRowId, "KILLED_BY_GOO"); } else { _PhysScores._PhysicalScores[ SCORES::hit_points ].Current = _PhysScores._PhysicalScores[ SCORES::hit_points ].Current - hpLost; // send message to player for inform is suffer goo damage - sendDynamicSystemMessage(_EntityRowId, "SUFFER_GOO_DAMAGE"); + if (_CurrentContinent == CONTINENT::FYROS) + sendDynamicSystemMessage(_EntityRowId, "SUFFER_FIRE_DAMAGE"); + else if (_CurrentContinent == CONTINENT::TRYKER) + sendDynamicSystemMessage(_EntityRowId, "SUFFER_STEAM_DAMAGE"); + else if (_CurrentContinent == CONTINENT::MATIS) + sendDynamicSystemMessage(_EntityRowId, "SUFFER_POISON_DAMAGE"); + else + sendDynamicSystemMessage(_EntityRowId, "SUFFER_GOO_DAMAGE"); } } } @@ -19057,7 +19136,7 @@ void CCharacter::setStartupInstance(uint32 instanceId) void CCharacter::setTitle( CHARACTER_TITLE::ECharacterTitle title ) { - _Title = title; + setNewTitle(CHARACTER_TITLE::toString(title)); } @@ -20736,4 +20815,4 @@ bool CCharacter::initPetInventory(uint8 index) return true; } return false; -} \ No newline at end of file +} diff --git a/code/ryzom/server/src/entities_game_service/player_manager/character.h b/code/ryzom/server/src/entities_game_service/player_manager/character.h index f2ba0944b..8a3c127da 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/character.h +++ b/code/ryzom/server/src/entities_game_service/player_manager/character.h @@ -890,6 +890,9 @@ public: // Set skill tree of character to max value of each skill void setSkillsToMaxValue(); + // Set skill tree of character to specified value + void setSkillsToValue(const sint32& value); + // for respawn management, need to modify _TimeDeath in cbTpAcknownledge callback NLMISC::TGameTime& getTimeOfDeath(); void setTimeOfDeath( NLMISC::TGameTime t); @@ -2392,6 +2395,27 @@ public: uint32 getLastConnectedTime() const; uint32 getLastConnectedDate() const; uint32 getPlayedTime() const; + + const std::string& getLangChannel() const; + void setLangChannel(const std::string &lang); + + const std::string& getNewTitle() const; + void setNewTitle(const std::string &title); + + std::string getFullTitle() const; + + std::string getTagA() const; + void setTagA(const std::string &tag); + + std::string getTagB() const; + void setTagB(const std::string &tag); + + std::string getTagPvPA() const; + void setTagPvPA(const std::string &tag); + + std::string getTagPvPB() const; + void setTagPvPB(const std::string &tag); + uint32 getOrganization() const; uint32 getOrganizationStatus() const; const std::list& getLastLogStats() const; @@ -3032,6 +3056,14 @@ private: uint32 _OrganizationStatus; uint32 _OrganizationPoints; + std::string _LangChannel; + + std::string _NewTitle; + std::string _TagPvPA; + std::string _TagPvPB; + std::string _TagA; + std::string _TagB; + /// SDB path where player wins HoF points in PvP (if not empty) std::string _SDBPvPPath; diff --git a/code/ryzom/server/src/entities_game_service/player_manager/character_inlines.h b/code/ryzom/server/src/entities_game_service/player_manager/character_inlines.h index 7e2cd4248..615ddaeb8 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/character_inlines.h +++ b/code/ryzom/server/src/entities_game_service/player_manager/character_inlines.h @@ -894,6 +894,67 @@ inline uint32 CCharacter::getPlayedTime() const return _PlayedTime; } +//------------------------------------------------------------------------------ +inline const std::string& CCharacter::getLangChannel() const + +{ + return _LangChannel; +} + +//------------------------------------------------------------------------------ +inline const std::string& CCharacter::getNewTitle() const + +{ + return _NewTitle; +} + +//------------------------------------------------------------------------------ +inline std::string CCharacter::getTagA() const + +{ + if (_TagA.empty()) + return "_"; + return _TagA; +} + +//------------------------------------------------------------------------------ +inline std::string CCharacter::getTagB() const + +{ + if (_TagB.empty()) + return "_"; + return _TagB; +} + + +//------------------------------------------------------------------------------ +inline std::string CCharacter::getTagPvPA() const + +{ + if (_TagPvPA.empty()) + return "_"; + return _TagPvPA; +} + +//------------------------------------------------------------------------------ +inline std::string CCharacter::getTagPvPB() const + +{ + if (_TagPvPB.empty()) + return "_"; + return _TagPvPB; +} + + +//------------------------------------------------------------------------------ +inline std::string CCharacter::getFullTitle() const +{ + if (!_TagA.empty() || !_TagB.empty() || !_TagPvPA.empty() || !_TagPvPB.empty()) + return _NewTitle+"#"+getTagPvPA()+"#"+getTagPvPB()+"#"+getTagA()+"#"+getTagB(); + else + return _NewTitle; +} + //------------------------------------------------------------------------------ inline uint32 CCharacter::getOrganization() const diff --git a/code/ryzom/server/src/entities_game_service/player_manager/persistent_player_data.cpp b/code/ryzom/server/src/entities_game_service/player_manager/persistent_player_data.cpp index 703261a56..e777f3067 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/persistent_player_data.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/persistent_player_data.cpp @@ -321,8 +321,8 @@ static void prepareCharacterPositionForStore ( COfflineEntityState & state, cons H_AUTO(CCharacterStore);\ CFameManager::getInstance().savePlayerFame(_Id, const_cast(*_Fames));\ /* Update the current playing session duration */ \ - if (_LastLogStats.size() > 0) _LastLogStats.begin()->Duration = CTime::getSecondsSince1970() - _LastLogStats.begin()->LoginTime; \ - else nlwarning("Cannot update play session duration, _LastLogStats is empty, new character?"); \ + if (!_LastLogStats.empty()) _LastLogStats.begin()->Duration = CTime::getSecondsSince1970() - _LastLogStats.begin()->LoginTime;\ + else nlwarning("Cannot update play session duration, _LastLogStats is empty, new character?");\ \ /* Unless the top of the position stack is locked, */ \ /* update the stored position stack with the current position */ \ @@ -415,6 +415,7 @@ static void prepareCharacterPositionForStore ( COfflineEntityState & state, cons PVP_CLAN::TPVPClan k=PVP_CLAN::fromString(key); if ((k>=PVP_CLAN::BeginClans) && (k<=PVP_CLAN::EndClans)) _FactionPoint[k-PVP_CLAN::BeginClans]=val)\ \ PROP(uint32,_PvpPoint)\ + PROP2(_LangChannel,string,_LangChannel,_LangChannel=val)\ PROP(uint32,_Organization)\ PROP(uint32,_OrganizationStatus)\ PROP(uint32,_OrganizationPoints)\ @@ -438,6 +439,11 @@ static void prepareCharacterPositionForStore ( COfflineEntityState & state, cons PROP_GAME_CYCLE_COMP(_ForbidAuraUseStartDate)\ PROP_GAME_CYCLE_COMP(_ForbidAuraUseEndDate)\ PROP2(_Title, string, CHARACTER_TITLE::toString(getTitle()), setTitle(CHARACTER_TITLE::toCharacterTitle(val)))\ + PROP2(_NewTitle, string, _NewTitle, _NewTitle=val)\ + PROP2(_TagPvPA, string, _TagPvPA, _TagPvPA=val)\ + PROP2(_TagPvPB, string, _TagPvPB, _TagPvPB=val)\ + PROP2(_TagA, string, _TagA, _TagA=val)\ + PROP2(_TagB, string, _TagB, _TagB=val)\ \ /* Visual Properties */\ PROP2(HairType, uint8, _VisualPropertyA().PropertySubData.HatModel, SET_STRUCT_MEMBER(_VisualPropertyA,PropertySubData.HatModel,val))\ diff --git a/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_manager_2.cpp b/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_manager_2.cpp index 3d09bc9fd..6beb7b1b2 100644 --- a/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_manager_2.cpp +++ b/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_manager_2.cpp @@ -210,6 +210,21 @@ std::vector CPVPManager2::getCharacterChannels(CCharacter * user) std::vector result; result.clear(); + // Add lang channel, should be first. + if (!user->getLangChannel().empty()) { + TMAPExtraFactionChannel::iterator it = _ExtraFactionChannel.find(user->getLangChannel()); + if (it != _ExtraFactionChannel.end()) + { + result.push_back((*it).second); + } + } else { + TMAPExtraFactionChannel::iterator it = _ExtraFactionChannel.find("en"); + if (it != _ExtraFactionChannel.end()) + { + result.push_back((*it).second); + } + } + PVP_CLAN::TPVPClan faction = user->getAllegiance().first; if( faction != PVP_CLAN::Neutral ) { @@ -230,6 +245,7 @@ std::vector CPVPManager2::getCharacterChannels(CCharacter * user) } } + /* bool matis = CFameInterface::getInstance().getFameIndexed(user->getId(), 0) >= PVPFameRequired*6000; bool fyros = CFameInterface::getInstance().getFameIndexed(user->getId(), 1) >= PVPFameRequired*6000; bool tryker = CFameInterface::getInstance().getFameIndexed(user->getId(), 2) >= PVPFameRequired*6000; @@ -279,7 +295,7 @@ std::vector CPVPManager2::getCharacterChannels(CCharacter * user) result.push_back((*it).second); } } -// } +*/ return result; } @@ -1088,10 +1104,19 @@ bool CPVPManager2::addFactionWar( PVP_CLAN::TPVPClan clan1, PVP_CLAN::TPVPClan c void CPVPManager2::onIOSMirrorUp() { // create extra factions channels + /* createExtraFactionChannel("hominists"); createExtraFactionChannel("urasies"); createExtraFactionChannel("marauders"); createExtraFactionChannel("agnos"); + */ + + // Community Channels + createExtraFactionChannel("en", true); + createExtraFactionChannel("fr", true); + createExtraFactionChannel("de", true); + createExtraFactionChannel("ru", true); + createExtraFactionChannel("es", true); for (uint i = PVP_CLAN::BeginClans; i <= PVP_CLAN::EndClans; i++) { @@ -1136,7 +1161,7 @@ void CPVPManager2::createFactionChannel(PVP_CLAN::TPVPClan clan) } } -void CPVPManager2::createExtraFactionChannel(const std::string & channelName) +void CPVPManager2::createExtraFactionChannel(const std::string & channelName, bool universalChannel) { TMAPExtraFactionChannel::iterator it = _ExtraFactionChannel.find(channelName); @@ -1146,6 +1171,7 @@ void CPVPManager2::createExtraFactionChannel(const std::string & channelName) TChanID factionChannelId = DynChatEGS.addLocalizedChan(name); // set historic size of the newly created channel DynChatEGS.setHistoricSize( factionChannelId, FactionChannelHistoricSize ); + DynChatEGS.setUniversalChannel( factionChannelId, universalChannel ); _ExtraFactionChannel.insert( make_pair(channelName, factionChannelId) ); } diff --git a/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_manager_2.h b/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_manager_2.h index 1207b1a11..9d24f1fe6 100644 --- a/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_manager_2.h +++ b/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_manager_2.h @@ -150,7 +150,7 @@ public: // create a faction channel if not already exist void createFactionChannel(PVP_CLAN::TPVPClan clan); // create an extra faction channel if not already exist (for marauders, agnos, urasiens and hominits) - void createExtraFactionChannel(const std::string & channelName); + void createExtraFactionChannel(const std::string & channelName, bool universalChannel = false); // create an user channel if not already exist TChanID createUserChannel(const std::string & channelName, const std::string & pass); // remove a user channel diff --git a/code/ryzom/server/src/entities_game_service/shop_type/shop_type_manager.cpp b/code/ryzom/server/src/entities_game_service/shop_type/shop_type_manager.cpp index 504462410..6b1aa0d9d 100644 --- a/code/ryzom/server/src/entities_game_service/shop_type/shop_type_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/shop_type/shop_type_manager.cpp @@ -242,7 +242,7 @@ void CShopTypeManager::initShopBase() CConfigFile::CVar& cvShopType = ShopConfigFile.getVar("ShopCategory"); for (uint i = 0; i < cvShopType.size(); ++i ) { - if ( cvShopType.asString(i) != "" ) + if ( !cvShopType.asString(i).empty() ) { _CategoryName.push_back( cvShopType.asString( i ) ); } @@ -252,7 +252,7 @@ void CShopTypeManager::initShopBase() CConfigFile::CVar& cvShopAlias = ShopConfigFile.getVar("ShopNameAliases"); for ( uint i = 0; i < cvShopAlias.size(); ++i ) { - if ( cvShopAlias.asString(i) != "" ) + if ( !cvShopAlias.asString(i).empty() ) { CVectorSString args; explode(cvShopAlias.asString(i), string(":"), reinterpret_cast &>(args)); diff --git a/code/ryzom/server/src/entities_game_service/zone_manager.cpp b/code/ryzom/server/src/entities_game_service/zone_manager.cpp index feb2e618c..dd9e817b1 100644 --- a/code/ryzom/server/src/entities_game_service/zone_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/zone_manager.cpp @@ -1508,7 +1508,7 @@ bool CZoneManager::getPlace( sint32 x, sint32 y, float& gooDistance, const CPlac } for (uint k = 0; k < _Continents[i].getRegions()[j]->getPlaces().size(); k++ ) { - if( _Continents[i].getRegions()[j]->getPlaces()[k]->isGooPath() == false ) + if(!_Continents[i].getRegions()[j]->getPlaces()[k]->isGooActive()) { if ( _Continents[i].getRegions()[j]->getPlaces()[k]->contains( vect ) ) { diff --git a/code/ryzom/server/src/frontend_service/entity_container.h b/code/ryzom/server/src/frontend_service/entity_container.h index d07cdbc76..75ae8250d 100644 --- a/code/ryzom/server/src/frontend_service/entity_container.h +++ b/code/ryzom/server/src/frontend_service/entity_container.h @@ -25,6 +25,7 @@ #include "game_share/tick_event_handler.h" #include "game_share/ryzom_mirror_properties.h" #include "client_id_lookup.h" +#include "fe_types.h" #include #include diff --git a/code/ryzom/server/src/frontend_service/frontend_service.h b/code/ryzom/server/src/frontend_service/frontend_service.h index 301e34506..12fa4df5c 100644 --- a/code/ryzom/server/src/frontend_service/frontend_service.h +++ b/code/ryzom/server/src/frontend_service/frontend_service.h @@ -33,6 +33,7 @@ #include "fe_receive_sub.h" #include "fe_send_sub.h" +#include "fe_types.h" #include "history.h" #include "prio_sub.h" #include "client_id_lookup.h" diff --git a/code/ryzom/server/src/frontend_service/id_impulsions.h b/code/ryzom/server/src/frontend_service/id_impulsions.h index 449a1da2c..e4cd1b407 100644 --- a/code/ryzom/server/src/frontend_service/id_impulsions.h +++ b/code/ryzom/server/src/frontend_service/id_impulsions.h @@ -19,6 +19,7 @@ #ifndef ID_IMPULSIONS_H #define ID_IMPULSIONS_H +#include "fe_types.h" // misc #include "nel/misc/types_nl.h" diff --git a/code/ryzom/server/src/frontend_service/stdpch.h b/code/ryzom/server/src/frontend_service/stdpch.h index dd904c1bc..7702d9717 100644 --- a/code/ryzom/server/src/frontend_service/stdpch.h +++ b/code/ryzom/server/src/frontend_service/stdpch.h @@ -67,7 +67,6 @@ #include "game_share/entity_types.h" -#include "fe_types.h" #ifndef NL_RELEASE #ifndef TRACE_SHARD_MESSAGES diff --git a/code/ryzom/server/src/gameplay_module_lib/CMakeLists.txt b/code/ryzom/server/src/gameplay_module_lib/CMakeLists.txt index 48b9ed299..727392235 100644 --- a/code/ryzom/server/src/gameplay_module_lib/CMakeLists.txt +++ b/code/ryzom/server/src/gameplay_module_lib/CMakeLists.txt @@ -11,4 +11,4 @@ NL_ADD_LIB_SUFFIX(ryzom_gameplaymodule) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -INSTALL(TARGETS ryzom_gameplaymodule LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) +INSTALL(TARGETS ryzom_gameplaymodule LIBRARY DESTINATION ${RYZOM_LIB_PREFIX} ARCHIVE DESTINATION ${RYZOM_LIB_PREFIX} COMPONENT libraries) diff --git a/code/ryzom/server/src/input_output_service/chat_manager.cpp b/code/ryzom/server/src/input_output_service/chat_manager.cpp index f86ec26e6..27d1c55e8 100644 --- a/code/ryzom/server/src/input_output_service/chat_manager.cpp +++ b/code/ryzom/server/src/input_output_service/chat_manager.cpp @@ -132,7 +132,7 @@ void CChatManager::onServiceDown(const std::string &serviceShortName) */ void CChatManager::resetChatLog() { - std::string logPath = (LogChatDirectory.get() == "" ? Bsi.getLocalPath() : LogChatDirectory.get()); + std::string logPath = (LogChatDirectory.get().empty() ? Bsi.getLocalPath() : LogChatDirectory.get()); _Displayer.setParam(CPath::standardizePath(logPath) + "chat.log"); } diff --git a/code/ryzom/server/src/monitor_service/mirrors.h b/code/ryzom/server/src/monitor_service/mirrors.h index 407292238..30031dcc1 100644 --- a/code/ryzom/server/src/monitor_service/mirrors.h +++ b/code/ryzom/server/src/monitor_service/mirrors.h @@ -47,7 +47,7 @@ public: // TODO: check if good static bool exists( const TDataSetRow& entityIndex ); static const NLMISC::CEntityId& getEntityId( const TDataSetRow& entityIndex ); - static const uint16 getTeamId(const TDataSetRow& entityIndex); + static uint16 getTeamId(const TDataSetRow& entityIndex); static CAICoord x( const TDataSetRow& entityIndex ); static CAICoord y( const TDataSetRow& entityIndex ); diff --git a/code/ryzom/server/src/pd_lib/CMakeLists.txt b/code/ryzom/server/src/pd_lib/CMakeLists.txt index 46974a9ae..f4568064f 100644 --- a/code/ryzom/server/src/pd_lib/CMakeLists.txt +++ b/code/ryzom/server/src/pd_lib/CMakeLists.txt @@ -16,4 +16,4 @@ NL_ADD_LIB_SUFFIX(ryzom_pd) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -INSTALL(TARGETS ryzom_pd LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) +INSTALL(TARGETS ryzom_pd LIBRARY DESTINATION ${RYZOM_LIB_PREFIX} ARCHIVE DESTINATION ${RYZOM_LIB_PREFIX} COMPONENT libraries) diff --git a/code/ryzom/server/src/pd_support_service/hourly_commands.cpp b/code/ryzom/server/src/pd_support_service/hourly_commands.cpp index 835bb8cb7..6f77396ae 100644 --- a/code/ryzom/server/src/pd_support_service/hourly_commands.cpp +++ b/code/ryzom/server/src/pd_support_service/hourly_commands.cpp @@ -46,7 +46,7 @@ public: } return; } - + // get the start time time_t startTime; time( &startTime ); @@ -73,7 +73,7 @@ public: // execute hourly tasks NLMISC::CConfigFile::CVar *commandsVar = NLNET::IService::getInstance()->ConfigFile.getVarPtr("HourlyCommands"); WARN_IF(commandsVar == NULL,"'HourlyCommands' not found in cfg file"); - + // if we have hourly commands... if (commandsVar!=NULL) { @@ -104,7 +104,7 @@ public: FILE* fileHandle= fopen(HourlyActivityLogFileName,"ab"); nlassert(fileHandle!=NULL); fprintf(fileHandle,"%02u/%02u/%u CHourlyTaskScheduler: Started: %02u:%02u, Finished: %02u:%02u, Executed %u commands Started %u Jobs\n", - ptm->tm_mday, ptm->tm_mon+1, ptm->tm_year+1900, startTime/3600%24, startTime/60%60, endTime/3600%24, endTime/60%60, commandsVar==NULL?0:commandsVar->size(), jobsRemaining ); + ptm->tm_mday, ptm->tm_mon+1, ptm->tm_year+1900, (uint)startTime/3600%24, (uint)startTime/60%60, (uint)endTime/3600%24, (uint)endTime/60%60, commandsVar==NULL?0:commandsVar->size(), jobsRemaining ); nlinfo("JobManager state: %s",CJobManager::getInstance()->getStatus().c_str()); fclose(fileHandle); } diff --git a/code/ryzom/server/src/server_share/CMakeLists.txt b/code/ryzom/server/src/server_share/CMakeLists.txt index d043c55ca..c208f3ecc 100644 --- a/code/ryzom/server/src/server_share/CMakeLists.txt +++ b/code/ryzom/server/src/server_share/CMakeLists.txt @@ -31,4 +31,4 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(ryzom_servershare ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS ryzom_servershare LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) +INSTALL(TARGETS ryzom_servershare LIBRARY DESTINATION ${RYZOM_LIB_PREFIX} ARCHIVE DESTINATION ${RYZOM_LIB_PREFIX} COMPONENT libraries) diff --git a/code/ryzom/server/src/server_share/char_name_mapper_itf.h b/code/ryzom/server/src/server_share/char_name_mapper_itf.h index b9d51c02f..e4abc7332 100644 --- a/code/ryzom/server/src/server_share/char_name_mapper_itf.h +++ b/code/ryzom/server/src/server_share/char_name_mapper_itf.h @@ -21,9 +21,7 @@ #ifndef CHAR_NAME_MAPPER_ITF #define CHAR_NAME_MAPPER_ITF #include "nel/misc/types_nl.h" -#ifdef NL_COMP_VC8 - #include -#endif +#include #include "nel/misc/hierarchical_timer.h" #include "nel/misc/string_conversion.h" #include "nel/net/message.h" diff --git a/code/ryzom/server/src/server_share/chat_unifier_itf.h b/code/ryzom/server/src/server_share/chat_unifier_itf.h index 2f5a62816..37f7b45b2 100644 --- a/code/ryzom/server/src/server_share/chat_unifier_itf.h +++ b/code/ryzom/server/src/server_share/chat_unifier_itf.h @@ -21,9 +21,7 @@ #ifndef CHAT_UNIFIER_ITF #define CHAT_UNIFIER_ITF #include "nel/misc/types_nl.h" -#ifdef NL_COMP_VC8 - #include -#endif +#include #include "nel/misc/hierarchical_timer.h" #include "nel/misc/string_conversion.h" #include "nel/net/message.h" diff --git a/code/ryzom/server/src/server_share/command_executor_itf.h b/code/ryzom/server/src/server_share/command_executor_itf.h index baa9a45ed..3c2feb606 100644 --- a/code/ryzom/server/src/server_share/command_executor_itf.h +++ b/code/ryzom/server/src/server_share/command_executor_itf.h @@ -21,9 +21,7 @@ #ifndef COMMAND_EXECUTOR_ITF #define COMMAND_EXECUTOR_ITF #include "nel/misc/types_nl.h" -#ifdef NL_COMP_VC8 - #include -#endif +#include #include "nel/misc/hierarchical_timer.h" #include "nel/misc/string_conversion.h" #include "nel/net/message.h" diff --git a/code/ryzom/server/src/server_share/entity_locator_itf.h b/code/ryzom/server/src/server_share/entity_locator_itf.h index c4d1ac8c9..a33e94e44 100644 --- a/code/ryzom/server/src/server_share/entity_locator_itf.h +++ b/code/ryzom/server/src/server_share/entity_locator_itf.h @@ -21,9 +21,7 @@ #ifndef ENTITY_LOCATOR_ITF #define ENTITY_LOCATOR_ITF #include "nel/misc/types_nl.h" -#ifdef NL_COMP_VC8 - #include -#endif +#include #include "nel/misc/hierarchical_timer.h" #include "nel/misc/string_conversion.h" #include "nel/net/message.h" diff --git a/code/ryzom/server/src/server_share/logger_service_itf.h b/code/ryzom/server/src/server_share/logger_service_itf.h index 01723f118..c6bda3f5c 100644 --- a/code/ryzom/server/src/server_share/logger_service_itf.h +++ b/code/ryzom/server/src/server_share/logger_service_itf.h @@ -21,9 +21,7 @@ #ifndef LOGGER_SERVICE_ITF #define LOGGER_SERVICE_ITF #include "nel/misc/types_nl.h" -#ifdef NL_COMP_VC8 - #include -#endif +#include #include "nel/misc/hierarchical_timer.h" #include "nel/misc/string_conversion.h" #include "nel/net/message.h" diff --git a/code/ryzom/tools/assoc_mem/CMakeLists.txt b/code/ryzom/tools/assoc_mem/CMakeLists.txt index 5c6fc82a3..97a73c491 100644 --- a/code/ryzom/tools/assoc_mem/CMakeLists.txt +++ b/code/ryzom/tools/assoc_mem/CMakeLists.txt @@ -9,4 +9,4 @@ ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) NL_DEFAULT_PROPS(assoc_mem "Ryzom, Tools, Misc: assoc_mem") NL_ADD_RUNTIME_FLAGS(assoc_mem) -INSTALL(TARGETS assoc_mem RUNTIME DESTINATION bin COMPONENT tools) +INSTALL(TARGETS assoc_mem RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) diff --git a/code/ryzom/tools/assoc_mem/field.h b/code/ryzom/tools/assoc_mem/field.h index 25e201aa1..8ab8e52b4 100644 --- a/code/ryzom/tools/assoc_mem/field.h +++ b/code/ryzom/tools/assoc_mem/field.h @@ -32,7 +32,7 @@ class CField { public: CField(); CField(std::string); - ~CField(); + virtual ~CField(); virtual const std::vector &getPossibleValues() const; virtual void addPossibleValue(IValue *); virtual ICondNode *createNode(int, int, std::vector &) = 0; diff --git a/code/ryzom/tools/assoc_mem/node.h b/code/ryzom/tools/assoc_mem/node.h index e740c6fad..50efc7f4f 100644 --- a/code/ryzom/tools/assoc_mem/node.h +++ b/code/ryzom/tools/assoc_mem/node.h @@ -23,7 +23,7 @@ class INode { public: INode(); - ~INode(); + virtual ~INode(); virtual bool propagRecord(CRecord *) = 0; }; diff --git a/code/ryzom/tools/assoc_mem/record.h b/code/ryzom/tools/assoc_mem/record.h index 259ee6567..9310890cd 100644 --- a/code/ryzom/tools/assoc_mem/record.h +++ b/code/ryzom/tools/assoc_mem/record.h @@ -27,7 +27,7 @@ class CRecord { public: CRecord(); CRecord(std::vector &); - ~CRecord(); + virtual ~CRecord(); const std::vector &getValues(); void addValue(IValue *); void addValue(std::string &); diff --git a/code/ryzom/tools/assoc_mem/value.h b/code/ryzom/tools/assoc_mem/value.h index 321d47a14..96f0fed46 100644 --- a/code/ryzom/tools/assoc_mem/value.h +++ b/code/ryzom/tools/assoc_mem/value.h @@ -21,6 +21,8 @@ class IValue { public: + virtual ~IValue() { } + virtual void getValue(IValue &) = 0; virtual void setValue(IValue &) = 0; diff --git a/code/ryzom/tools/client/client_patcher/CMakeLists.txt b/code/ryzom/tools/client/client_patcher/CMakeLists.txt index 4a8b47bdf..e5b845e43 100644 --- a/code/ryzom/tools/client/client_patcher/CMakeLists.txt +++ b/code/ryzom/tools/client/client_patcher/CMakeLists.txt @@ -36,4 +36,4 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(ryzom_client_patcher ${CMAKE_SOURCE_DIR}/ryzom/client/src/stdpch.h ${CMAKE_SOURCE_DIR}/ryzom/client/src/stdpch.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS ryzom_client_patcher RUNTIME DESTINATION games COMPONENT client BUNDLE DESTINATION /Applications) +INSTALL(TARGETS ryzom_client_patcher RUNTIME DESTINATION ${RYZOM_GAMES_PREFIX} COMPONENT client BUNDLE DESTINATION /Applications) diff --git a/code/ryzom/tools/leveldesign/alias_synchronizer/CMakeLists.txt b/code/ryzom/tools/leveldesign/alias_synchronizer/CMakeLists.txt index 6967308dd..2596c1f17 100644 --- a/code/ryzom/tools/leveldesign/alias_synchronizer/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/alias_synchronizer/CMakeLists.txt @@ -6,7 +6,7 @@ INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(alias_synchronizer ${LIBXML2_LIBRARIES} nelmisc nelligo) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -NL_DEFAULT_PROPS(alias_synchronizer "Ryzom, Tools, Misc: Alias Synchronizer") +NL_DEFAULT_PROPS(alias_synchronizer "Ryzom, Tools, Misc: Alias Synchronizer") NL_ADD_RUNTIME_FLAGS(alias_synchronizer) -INSTALL(TARGETS alias_synchronizer RUNTIME DESTINATION bin COMPONENT tools) +INSTALL(TARGETS alias_synchronizer RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) diff --git a/code/ryzom/tools/leveldesign/csv_transform/CMakeLists.txt b/code/ryzom/tools/leveldesign/csv_transform/CMakeLists.txt index f9b4ea109..efb10b91c 100644 --- a/code/ryzom/tools/leveldesign/csv_transform/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/csv_transform/CMakeLists.txt @@ -8,4 +8,4 @@ TARGET_LINK_LIBRARIES(csv_transform nelmisc) NL_DEFAULT_PROPS(csv_transform "Ryzom, Tools, Misc: CSV Transform") NL_ADD_RUNTIME_FLAGS(csv_transform) -INSTALL(TARGETS csv_transform RUNTIME DESTINATION bin COMPONENT tools) +INSTALL(TARGETS csv_transform RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) diff --git a/code/ryzom/tools/leveldesign/export/CMakeLists.txt b/code/ryzom/tools/leveldesign/export/CMakeLists.txt index d8125d882..7d93dd7f9 100644 --- a/code/ryzom/tools/leveldesign/export/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/export/CMakeLists.txt @@ -12,5 +12,6 @@ NL_ADD_LIB_SUFFIX(ryzom_export) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -INSTALL(TARGETS ryzom_export LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) - +IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) + INSTALL(TARGETS ryzom_export LIBRARY DESTINATION ${RYZOM_LIB_PREFIX} ARCHIVE DESTINATION ${RYZOM_LIB_PREFIX} COMPONENT libraries) +ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) diff --git a/code/ryzom/tools/leveldesign/export/export.cpp b/code/ryzom/tools/leveldesign/export/export.cpp index 0380aad4d..b15e48a59 100644 --- a/code/ryzom/tools/leveldesign/export/export.cpp +++ b/code/ryzom/tools/leveldesign/export/export.cpp @@ -1793,7 +1793,6 @@ bool CExport::generateIGFromFlora (const std::string &SrcFile, std::vector -90000.0f) _FloraInsts.push_back (vi); - } // End of Generate for a point // Generate for a path @@ -2024,7 +2023,7 @@ void CExport::writeFloraIG (const string &LandFile, bool bTestForWriting) // Make the .IG - string ZoneName = ""; + string ZoneName; ZoneName += NLMISC::toString(-j) + "_"; ZoneName += 'a' + (i/26); ZoneName += 'a' + (i%26); diff --git a/code/ryzom/tools/leveldesign/georges_dll/CMakeLists.txt b/code/ryzom/tools/leveldesign/georges_dll/CMakeLists.txt index 92263a73c..0192615ca 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/georges_dll/CMakeLists.txt @@ -16,4 +16,4 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(georges_dll ${CMAKE_CURRENT_SOURCE_DIR}/stdafx.h ${CMAKE_CURRENT_SOURCE_DIR}/stdafx.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS georges_dll LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT libraries) +INSTALL(TARGETS georges_dll LIBRARY DESTINATION ${RYZOM_LIB_PREFIX} RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} ARCHIVE DESTINATION ${RYZOM_LIB_PREFIX} COMPONENT libraries) diff --git a/code/ryzom/tools/leveldesign/georges_dll/edit_list_ctrl.cpp b/code/ryzom/tools/leveldesign/georges_dll/edit_list_ctrl.cpp index 8e565dd5e..aac663c1f 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/edit_list_ctrl.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/edit_list_ctrl.cpp @@ -52,7 +52,7 @@ bool CEditListCtrl::create (DWORD wStyle, RECT &rect, CWnd *parent, uint dialog_ subRect.top = 0; subRect.right = rect.right-rect.left; subRect.bottom = rect.bottom-rect.top; -#if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) +#if defined(NL_COMP_VC) && NL_COMP_VC_VERSION >= 80 if (ListCtrl.CreateEx ( WS_EX_CLIENTEDGE, /*WC_LISTVIEW, "",*/ WS_CHILD|LVS_REPORT, subRect, this, 0)) #else if (ListCtrl.CreateEx ( WS_EX_CLIENTEDGE, WC_LISTVIEW, "", WS_CHILD|LVS_REPORT, subRect, this, 0)) diff --git a/code/ryzom/tools/leveldesign/georges_dll/file_tree_view.cpp b/code/ryzom/tools/leveldesign/georges_dll/file_tree_view.cpp index 9eb467b97..90b742860 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/file_tree_view.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/file_tree_view.cpp @@ -54,7 +54,7 @@ bool CFileTreeCtrl::create( const RECT& rect, CWnd* pParentWnd, UINT nID ) if (CWnd::Create (className, "empty", WS_CHILD, rect, pParentWnd, nID )) -#if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) +#if defined(NL_COMP_VC) && NL_COMP_VC_VERSION >= 80 if (_TreeCtrl.CreateEx (WS_EX_CLIENTEDGE, /*_T("SysTreeView32"), "",*/ TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS|TVS_EDITLABELS|WS_CHILD|WS_TABSTOP, rect, this, 0)) #else if (_TreeCtrl.CreateEx (WS_EX_CLIENTEDGE, _T("SysTreeView32"), "", TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS|TVS_EDITLABELS|WS_CHILD|WS_TABSTOP, rect, this, 0)) diff --git a/code/ryzom/tools/leveldesign/georges_dll/header_dialog.cpp b/code/ryzom/tools/leveldesign/georges_dll/header_dialog.cpp index a69d481f4..6ecfe13fc 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/header_dialog.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/header_dialog.cpp @@ -263,7 +263,7 @@ void CHeaderDialog::getFromDocument (const NLGEORGES::CFileHeader &header) if (end) { // Build a string - int length = std::min (31, end-start); + int length = std::min (31, (int)(end-start)); memcpy (name, start, length); name[length] = 0; diff --git a/code/ryzom/tools/leveldesign/georges_dll/imagelist_ex.cpp b/code/ryzom/tools/leveldesign/georges_dll/imagelist_ex.cpp index 513abe109..195a44381 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/imagelist_ex.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/imagelist_ex.cpp @@ -27,8 +27,8 @@ using namespace NLMISC; #pragma warning (disable : 4786) -BOOL CALLBACK EnumResLangProc(HINSTANCE hModule, LPCTSTR lpszType, LPCTSTR lpszName, WORD wIDLanguage, - LONG lParam) +BOOL CALLBACK EnumResLangProc(HMODULE hModule, LPCSTR lpszType, LPCSTR lpszName, WORD wIDLanguage, + LONG_PTR lParam) { set *iconNames = (set*)lParam; diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/CMakeLists.txt b/code/ryzom/tools/leveldesign/georges_editor_qt/CMakeLists.txt index 985b00cf9..96dc03d06 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/CMakeLists.txt @@ -6,12 +6,24 @@ #----------------------------------------------------------------------------- # This tells the application(s) where to find the installed data. -ADD_DEFINITIONS(-DDATA_DIR="\\"${NL_SHARE_PREFIX}/georges_editor_qt/\\"") +IF(WIN32) + SET(GEQT_DATA_DIR ".") +ELSEIF(APPLE) + # TODO: under Mac OS X, don't install but copy files in application package + SET(GEQT_DATA_DIR ".") +ELSE(WIN32) + SET(GEQT_DATA_DIR ${RYZOM_SHARE_PREFIX}/georges_editor_qt/data) + + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/geqt_config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/geqt_config.h) + INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) + + ADD_DEFINITIONS(-DHAVE_GEQT_CONFIG_H) +ENDIF(WIN32) ADD_SUBDIRECTORY(src) INSTALL(DIRECTORY data/ - DESTINATION share/georges_editor_qt/data + DESTINATION ${GEQT_DATA_DIR} COMPONENT data PATTERN "CVS" EXCLUDE PATTERN ".svn" EXCLUDE diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/geqt_config.h.cmake b/code/ryzom/tools/leveldesign/georges_editor_qt/geqt_config.h.cmake new file mode 100644 index 000000000..6f31bc7d0 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/geqt_config.h.cmake @@ -0,0 +1,6 @@ +#ifndef GEQT_CONFIG_H +#define GEQT_CONFIG_H + +#define DATA_DIR "${RYZOM_SHARE_ABSOLUTE_PREFIX}/georges_editor_qt" + +#endif diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/CMakeLists.txt b/code/ryzom/tools/leveldesign/georges_editor_qt/src/CMakeLists.txt index 869d9d1c4..81327442a 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/CMakeLists.txt @@ -71,4 +71,4 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(georges_editor_qt ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS georges_editor_qt RUNTIME DESTINATION bin COMPONENT runtime BUNDLE DESTINATION /Applications) +INSTALL(TARGETS georges_editor_qt RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT runtime BUNDLE DESTINATION /Applications) diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/configuration.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/configuration.cpp index 5868220cd..6af950eae 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/configuration.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/configuration.cpp @@ -98,7 +98,7 @@ namespace NLQT { void CConfiguration::addLeveldesignPath() { std::vector list; - list.push_back(Modules::config().getValue("LeveldesignPath", QString("").toStdString())); + list.push_back(Modules::config().getValue("LeveldesignPath", std::string())); addSearchPaths(&list); } diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/formdelegate.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/formdelegate.cpp index a1e3e1d13..bb91f8b62 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/formdelegate.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/formdelegate.cpp @@ -96,7 +96,7 @@ namespace NLQT //QString min = QString(type->getMin().c_str()); //QString max = QString(type->getMax().c_str()); //QString inc = QString(type->getIncrement().c_str()); - //nldebug(QString("min %1 max %2 inc %3").arg(min).arg(max).arg(inc).toStdString().c_str()); + //nldebug(QString("min %1 max %2 inc %3").arg(min).arg(max).arg(inc).toUtf8().constData()); // TODO: use saved min/max values editor->setMinimum(-99999); @@ -203,7 +203,7 @@ namespace NLQT else { nldebug(QString("setModelData from %1 to %2") - .arg(oldValue).arg(value).toStdString().c_str()); + .arg(oldValue).arg(value).toUtf8().constData()); model->setData(index, value, Qt::EditRole); } } @@ -224,7 +224,7 @@ namespace NLQT else { nldebug(QString("setModelData from %1 to %2") - .arg(oldValue).arg(value).toStdString().c_str()); + .arg(oldValue).arg(value).toUtf8().constData()); model->setData(index, value, Qt::EditRole); } break; @@ -241,7 +241,7 @@ namespace NLQT else { nldebug(QString("setModelData from %1 to %2") - .arg(oldValue).arg(value).toStdString().c_str()); + .arg(oldValue).arg(value).toUtf8().constData()); model->setData(index, value, Qt::EditRole); } break; @@ -262,7 +262,7 @@ namespace NLQT else { nldebug(QString("setModelData from %1 to %2") - .arg(oldValue).arg(value).toStdString().c_str()); + .arg(oldValue).arg(value).toUtf8().constData()); model->setData(index, value, Qt::EditRole); } break; diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/formitem.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/formitem.cpp index 5dc0fe498..6636e944e 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/formitem.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/formitem.cpp @@ -120,10 +120,8 @@ namespace NLQT { if (elmt->isAtom()) { - ((NLGEORGES::CFormElmAtom*)elmt)->setValue(value.toString().toStdString().c_str()); - nldebug(QString("array element string %1 %2") - .arg(itemData[0].toString()).arg(value.toString()) - .toStdString().c_str()); + ((NLGEORGES::CFormElmAtom*)elmt)->setValue(value.toString().toUtf8().constData()); + nldebug("array element string %s %s", itemData[0].toString().toUtf8().constData(), value.toString().toUtf8().constData()); } } } @@ -131,18 +129,14 @@ namespace NLQT else { if(parentItem->formElm->setValueByName( - value.toString().toStdString().c_str(), - itemData[0].toString().toStdString().c_str())) + value.toString().toUtf8().constData(), + itemData[0].toString().toUtf8().constData())) { - nldebug(QString("string %1 %2") - .arg(itemData[0].toString()).arg(value.toString()) - .toStdString().c_str()); + nldebug("string %s %s", itemData[0].toString().toUtf8().constData(), value.toString().toUtf8().constData()); } else { - nldebug(QString("FAILED string %1 %2") - .arg(itemData[0].toString()).arg(value.toString()) - .toStdString().c_str()); + nldebug("FAILED string %s %s", itemData[0].toString().toUtf8().constData(), value.toString().toUtf8().constData()); } } break; diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_dialog.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_dialog.cpp index cae202aa8..088170a6d 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_dialog.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_dialog.cpp @@ -93,29 +93,29 @@ namespace NLQT CForm* CGeorgesTreeViewDialog::getFormByName(const QString formName) { - if(NLMISC::CPath::exists(formName.toStdString())) + if(NLMISC::CPath::exists(formName.toUtf8().constData())) { - return (CForm*)_georges->loadForm(formName.toStdString()); + return (CForm*)_georges->loadForm(formName.toUtf8().constData()); } else { CForm *form = 0; // Load the DFN - std::string extStr = NLMISC::CFile::getExtension( formName.toStdString() ); - QString dfnName = QString("%1.dfn").arg(extStr.c_str()); + std::string extStr = NLMISC::CFile::getExtension( formName.toUtf8().constData() ); + std::string dfnName = extStr + ".dfn"; UFormDfn *formdfn; - if (NLMISC::CPath::exists(dfnName.toStdString())) + if (NLMISC::CPath::exists(dfnName)) { - formdfn = _georges->loadFormDfn (dfnName.toStdString()); + formdfn = _georges->loadFormDfn (dfnName); if (!formdfn) { - nlwarning("Failed to load dfn: %s", dfnName.toStdString().c_str()); + nlwarning("Failed to load dfn: %s", dfnName.c_str()); return 0; } } else { - nlwarning("Cannot find dfn: %s", dfnName.toStdString().c_str()); + nlwarning("Cannot find dfn: %s", dfnName.c_str()); return 0; } @@ -175,7 +175,7 @@ namespace NLQT nlinfo("typ's %d",deps["typ"].count()); nlinfo("dfn's %d",deps["dfn"].count()); - //nlwarning(strList.join(";").toStdString().c_str()); + //nlwarning(strList.join(";").toUtf8().constData()); if (root) { loadedForm = _form->getFilename().c_str(); @@ -222,7 +222,7 @@ namespace NLQT { COFile file; - std::string s = CPath::lookup(loadedForm.toStdString(), false); + std::string s = CPath::lookup(loadedForm.toUtf8().constData(), false); if (file.open (s)) { try @@ -313,7 +313,7 @@ namespace NLQT CFormItem *item = m->getItem(in2); QString value = item->data(1).toString(); - QString path = CPath::lookup(value.toStdString(),false).c_str(); + QString path = CPath::lookup(value.toUtf8().constData(),false).c_str(); if(value.contains(".tga") || value.contains(".png")) { @@ -341,7 +341,7 @@ namespace NLQT { Modules::objViewInt()->resetScene(); //Modules::config().configRemapExtensions(); - Modules::objViewInt()->loadMesh(path.toStdString(),""); + Modules::objViewInt()->loadMesh(path.toUtf8().constData(),""); } return; } diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_model.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_model.cpp index 21c1e25ef..89cba843c 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_model.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_model.cpp @@ -126,6 +126,8 @@ namespace NLQT } // end default } // end switch valueFrom } // end case nodeForm + default: + break; } // end switch nodeFrom return QVariant(); } @@ -138,13 +140,13 @@ namespace NLQT CFormItem *item = getItem(in); QString value = item->data(1).toString(); - //QString path = NLMISC::CPath::lookup(value.toStdString(),false).c_str(); + //QString path = NLMISC::CPath::lookup(value.toUtf8().constData(),false).c_str(); if (value.contains(".shape")) { if (Modules::objViewInt()) { - QIcon *icon = Modules::objViewInt()->saveOneImage(value.toStdString()); + QIcon *icon = Modules::objViewInt()->saveOneImage(value.toUtf8().constData()); if (icon) { if(icon->isNull()) @@ -160,7 +162,7 @@ namespace NLQT } else if(value.contains(".tga") || value.contains(".png")) { - QString path = NLMISC::CPath::lookup(value.toStdString(),false).c_str(); + QString path = NLMISC::CPath::lookup(value.toUtf8().constData(),false).c_str(); if(path.isEmpty()) { path = ":/images/pqrticles.png"; @@ -183,7 +185,7 @@ namespace NLQT { if (Modules::objViewInt()) { - QIcon *icon = Modules::objViewInt()->saveOneImage(value.toStdString()); + QIcon *icon = Modules::objViewInt()->saveOneImage(value.toUtf8().constData()); if (icon) { if(icon->isNull()) @@ -199,7 +201,7 @@ namespace NLQT } else if(value.contains(".tga") || value.contains(".png")) { - QString path = NLMISC::CPath::lookup(value.toStdString(),false).c_str(); + QString path = NLMISC::CPath::lookup(value.toUtf8().constData(),false).c_str(); if(path.isEmpty()) { path = ":/images/pqrticles.png"; @@ -378,7 +380,7 @@ namespace NLQT //uint value_uint; //sint value_sint; //double value_double; - QString elmtType = ""; + QString elmtType; UFormElm *elmt = 0; if(root->getNodeByName(&elmt, elmName.c_str(), whereN, true)) { @@ -399,13 +401,13 @@ namespace NLQT switch (type->getType()) { case UType::UnsignedInt: - value = QString("%1").arg(QString("%1").arg(value.c_str()).toDouble()).toStdString(); + value = QString("%1").arg(QString(value.c_str()).toDouble()).toUtf8().constData(); elmtType.append("_uint");break; case UType::SignedInt: - value = QString("%1").arg(QString("%1").arg(value.c_str()).toDouble()).toStdString(); + value = QString("%1").arg(QString(value.c_str()).toDouble()).toUtf8().constData(); elmtType.append("_sint");break; case UType::Double: - value = QString("%1").arg(QString("%1").arg(value.c_str()).toDouble(),0,'f',1).toStdString(); + value = QString("%1").arg(QString(value.c_str()).toDouble(),0,'f',1).toUtf8().constData(); elmtType.append("_double");break; case UType::String: elmtType.append("_string");break; @@ -540,7 +542,7 @@ namespace NLQT { QList columnData; std::string value; - QString elmtType = ""; + QString elmtType; UFormElm *elmt = 0; if(root->getArrayNode(&elmt,0) && elmt) diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_proxy_model.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_proxy_model.cpp index 68b990b30..46ee12567 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_proxy_model.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_proxy_model.cpp @@ -42,7 +42,7 @@ namespace NLQT CFormItem *item = smodel->getItem(index); //qDebug() << smodel->showParents() << (item->valueFrom() == NLGEORGES::UFormElm::NodeParentForm); - //nlinfo("%s %d %d %d %d", item->data(index.column()).toString().toStdString().c_str(), + //nlinfo("%s %d %d %d %d", item->data(index.column()).toString().toUtf8().constData(), // item->valueFrom(), // item->nodeFrom(), // smodel->showParents(), @@ -79,6 +79,8 @@ namespace NLQT } } } + default: + break; } return true; } diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/main.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/main.cpp index ef8fadec0..3b0d606d3 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/main.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/main.cpp @@ -21,6 +21,10 @@ #include "modules.h" #include "georges_splash.h" +#ifdef HAVE_GEQT_CONFIG_H +#include "geqt_config.h" +#endif + // nel_qt log file name #define NLQT_LOG_FILE "nel_qt.log" @@ -96,7 +100,7 @@ sint main(int argc, char **argv) #if defined(NL_OS_MAC) QDir::setCurrent(qApp->applicationDirPath() + QString("/../Resources")); CLibrary::addLibPath( - (qApp->applicationDirPath() + QString("/../PlugIns/nel")).toStdString()); + (qApp->applicationDirPath() + QString("/../PlugIns/nel")).toUtf8().constData()); #endif // go nel! diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/main_window.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/main_window.cpp index 1e5959973..ef40f4dbc 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/main_window.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/main_window.cpp @@ -63,7 +63,7 @@ namespace NLQT // load and set leveldesign path from config _leveldesignPath = Modules::config(). - getValue("LeveldesignPath", QString("").toStdString()).c_str(); + getValue("LeveldesignPath", std::string()).c_str(); QFileInfo info(_leveldesignPath); if (!info.isDir()) _leveldesignPath = ""; @@ -229,7 +229,7 @@ namespace NLQT setCursor(Qt::WaitCursor); //TODO: if not exists open FileDialog SaveAs... - if(!CPath::exists(_currentView->loadedForm.toStdString())) + if(!CPath::exists(_currentView->loadedForm.toUtf8().constData())) { QString fileName = QFileDialog::getSaveFileName( this, @@ -239,7 +239,7 @@ namespace NLQT QFile file(fileName); file.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text); file.close(); - CPath::addSearchFile(fileName.toStdString()); + CPath::addSearchFile(fileName.toUtf8().constData()); //QFileInfo info = QFileInfo(file); //m->setData(in2, info.fileName()); } @@ -417,7 +417,7 @@ namespace NLQT //tabList = _mainWindow->findChildren(); //nlinfo(QString("%1 %2").arg(QString::number((int)this,16)). // arg(QString::number((int)_mainWindow,16)). - // toStdString().c_str()); + // toUtf8().constData()); QTabBar *tb = 0; Q_FOREACH(QTabBar *tabBar, tabList) { @@ -427,11 +427,11 @@ namespace NLQT // arg(QString::number((int)tabBar,16)). // arg(QString::number((int)tabBar->parentWidget(),16)). // arg(QString::number((int)tabBar->parent(),16)). - // toStdString().c_str()); + // toUtf8().constData()); for (int i = 0; i < tabBar->count(); i++) { QString currentTab = tabBar->tabText(i); - //nlinfo(currentTab.toStdString().c_str()); + //nlinfo(currentTab.toUtf8().constData()); } tb = tabBar; } @@ -440,7 +440,7 @@ namespace NLQT void CMainWindow::tabChanged(int index) { - nlinfo(QString("%1").arg(index).toStdString().c_str()); + nlinfo("%d", index); if (index == -1) { setWindowTitle("Qt Georges Editor"); @@ -448,7 +448,7 @@ namespace NLQT } QTabBar *tb = getTabBar(); - //nlinfo(QString("%1").arg(index).toStdString().c_str()); + //nlinfo(QString("%1").arg(index).toUtf8().constData()); Q_FOREACH(CGeorgesTreeViewDialog* dlg, _treeViewList) { @@ -456,7 +456,7 @@ namespace NLQT { //nlinfo(QString("%1 modified %2").arg(tb->tabText(index)). // arg(dlg->modified()). - // toStdString().c_str()); + // toUtf8().constData()); _currentView = dlg; setWindowTitle("Qt Georges Editor - " + tb->tabText(index)); _saveAction->setEnabled(dlg->modified()); diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/modules.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/modules.cpp index 59f596f51..e77e72772 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/modules.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/modules.cpp @@ -68,12 +68,12 @@ bool Modules::loadPlugin() // if(!QFile::exists(pluginPath + pluginFilename)) // { // nlwarning("Cannot find %s in %s, fallback to working dir", - // pluginFilename.toStdString().c_str(), pluginPath.toStdString().c_str()); + // pluginFilename.toUtf8().constData(), pluginPath.toUtf8().constData()); // // pluginPath = ""; // // Q_FOREACH (QString path, qApp->libraryPaths()) - // nlwarning("libraryPaths %s", path.toStdString().c_str()); + // nlwarning("libraryPaths %s", path.toUtf8().constData()); // } QDir pluginsDir(pluginPath); @@ -86,20 +86,20 @@ bool Modules::loadPlugin() if (_objViewerInterface) { nlinfo("Loaded %s", - pluginsDir.absoluteFilePath(pluginFilename).toStdString().c_str()); + pluginsDir.absoluteFilePath(pluginFilename).toUtf8().constData()); return true; } else { nlwarning("Loaded %s, but cannot cast to NLQT::IObjectViewer*", - pluginFilename.toStdString().c_str()); + pluginFilename.toUtf8().constData()); } } else { nlwarning("Cannot get plugin instance for %s (searched in %s)", - pluginFilename.toStdString().c_str(), - (qApp->applicationDirPath() + pluginPath).toStdString().c_str()); + pluginFilename.toUtf8().constData(), + (qApp->applicationDirPath() + pluginPath).toUtf8().constData()); } return false; diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/new_dialog.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/new_dialog.cpp index e3cbda962..499b06d94 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/new_dialog.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/new_dialog.cpp @@ -87,9 +87,9 @@ namespace NLQT QString path = Modules::mainWin().leveldesignPath(); QStringList typelist; //nlinfo ("Searching files in directory '%s'...", dir.c_str()); - NLMISC::CPath::getPathContent(path.toStdString(),true,false,true,_files); + NLMISC::CPath::getPathContent(path.toUtf8().constData(),true,false,true,_files); - getTypes( /* path.toStdString() // incompatible parameter type */ ); + getTypes( /* path.toUtf8() // incompatible parameter type */ ); //nlinfo ("%d supported file types :",FileTypeToId.size()); for ( std::map::iterator it = FileTypeToId.begin(); it != FileTypeToId.end(); ++it ) { @@ -103,8 +103,8 @@ namespace NLQT std::string extStr = NLMISC::CFile::getExtension( _files[i] ); // filter files without existing dfn - if (!NLMISC::CPath::exists(QString("%1.dfn").arg(extStr.c_str()).toStdString()) && - !NLMISC::CPath::exists(QString("%1.typ").arg(extStr.c_str()).toStdString())) + if (!NLMISC::CPath::exists(extStr + ".dfn") && + !NLMISC::CPath::exists(extStr + ".typ")) { continue; } @@ -253,7 +253,7 @@ namespace NLQT { std::string extStr = NLMISC::CFile::getExtension( fileName ); - if (!NLMISC::CPath::exists(QString("%1.dfn").arg(extStr.c_str()).toStdString())) + if (!NLMISC::CPath::exists(extStr + ".dfn")) { return; } diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/settings_dialog.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/settings_dialog.cpp index a005fdf5d..bb4fafd2e 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/settings_dialog.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/settings_dialog.cpp @@ -146,13 +146,13 @@ namespace NLQT QMessageBox::Ok);*/ // save graphics settings to config file - Modules::config().getConfigFile().getVar("GraphicsDriver").setAsString(ui.driverGraphComboBox->currentText().toStdString()); + Modules::config().getConfigFile().getVar("GraphicsDriver").setAsString(ui.driverGraphComboBox->currentText().toUtf8().constData()); // save leveldesign path to config file QString oldLdPath = Modules::config().getValue("LeveldesignPath", std::string("")).c_str(); if (oldLdPath != ui.leveldesignPath->text()) { - std::string ldPath = ui.leveldesignPath->text().toStdString(); + std::string ldPath = ui.leveldesignPath->text().toUtf8().constData(); Modules::config().getConfigFile().getVar("LeveldesignPath").forceAsString(ldPath); Q_EMIT ldPathChanged(ldPath.c_str()); // TODO: remove old Path from CPath @@ -171,8 +171,8 @@ namespace NLQT std::vector addList; for (sint i = 0; i < ui.pathsListWidget->count(); ++i) { - std::string str = ui.pathsListWidget->item(i)->text().toStdString(); - if (str != "") + std::string str = ui.pathsListWidget->item(i)->text().toUtf8().constData(); + if (!str.empty()) { list.push_back(str); if (!sl.contains(str.c_str())) diff --git a/code/ryzom/tools/leveldesign/georges_exe/CMakeLists.txt b/code/ryzom/tools/leveldesign/georges_exe/CMakeLists.txt index 064f1985e..07ac799c9 100644 --- a/code/ryzom/tools/leveldesign/georges_exe/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/georges_exe/CMakeLists.txt @@ -9,4 +9,4 @@ TARGET_LINK_LIBRARIES(georges_exe nelmisc nelgeorges georges_dll) NL_DEFAULT_PROPS(georges_exe "Ryzom, Tools, Georges: Georges Exe") NL_ADD_RUNTIME_FLAGS(georges_exe) -INSTALL(TARGETS georges_exe RUNTIME DESTINATION bin COMPONENT tools) +INSTALL(TARGETS georges_exe RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) diff --git a/code/ryzom/tools/leveldesign/georges_plugin_sound/CMakeLists.txt b/code/ryzom/tools/leveldesign/georges_plugin_sound/CMakeLists.txt index 29f77d650..c88246a98 100644 --- a/code/ryzom/tools/leveldesign/georges_plugin_sound/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/georges_plugin_sound/CMakeLists.txt @@ -23,4 +23,4 @@ NL_ADD_LIB_SUFFIX(georges_plugin_sound) ADD_DEFINITIONS(${MFC_DEFINITIONS}) -INSTALL(TARGETS georges_plugin_sound LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT libraries) +INSTALL(TARGETS georges_plugin_sound LIBRARY DESTINATION ${RYZOM_LIB_PREFIX} RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} ARCHIVE DESTINATION ${RYZOM_LIB_PREFIX} COMPONENT libraries) diff --git a/code/ryzom/tools/leveldesign/georges_plugin_sound/sound_dialog.cpp b/code/ryzom/tools/leveldesign/georges_plugin_sound/sound_dialog.cpp index e1f6b317c..58ea1e9da 100644 --- a/code/ryzom/tools/leveldesign/georges_plugin_sound/sound_dialog.cpp +++ b/code/ryzom/tools/leveldesign/georges_plugin_sound/sound_dialog.cpp @@ -186,7 +186,7 @@ void CSoundDialog::setPlaying(bool play) // *************************************************************************** -void CSoundDialog::OnTimer(UINT id) +void CSoundDialog::OnTimer(UINT_PTR id) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); updateTime(); diff --git a/code/ryzom/tools/leveldesign/georges_plugin_sound/sound_dialog.h b/code/ryzom/tools/leveldesign/georges_plugin_sound/sound_dialog.h index 1b8c46e91..884c52423 100644 --- a/code/ryzom/tools/leveldesign/georges_plugin_sound/sound_dialog.h +++ b/code/ryzom/tools/leveldesign/georges_plugin_sound/sound_dialog.h @@ -126,7 +126,7 @@ private: // Generated message map functions //{{AFX_MSG(CSoundDialog) - afx_msg void OnTimer(UINT id); + afx_msg void OnTimer(UINT_PTR id); afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags); afx_msg void OnControlPlayback(); afx_msg void OnZoom(NMHDR* pNMHDR, LRESULT* pResult); diff --git a/code/ryzom/tools/leveldesign/icon_search/CMakeLists.txt b/code/ryzom/tools/leveldesign/icon_search/CMakeLists.txt index 8e5063f64..c1d2a47e1 100644 --- a/code/ryzom/tools/leveldesign/icon_search/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/icon_search/CMakeLists.txt @@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(icon_search nelmisc) NL_DEFAULT_PROPS(icon_search "Ryzom, Tools, Misc: Icon Search") NL_ADD_RUNTIME_FLAGS(icon_search) -INSTALL(TARGETS icon_search RUNTIME DESTINATION bin COMPONENT tools) +INSTALL(TARGETS icon_search RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) diff --git a/code/ryzom/tools/leveldesign/mission_compiler_fe/CMakeLists.txt b/code/ryzom/tools/leveldesign/mission_compiler_fe/CMakeLists.txt index 572060089..c8c1211bc 100644 --- a/code/ryzom/tools/leveldesign/mission_compiler_fe/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/mission_compiler_fe/CMakeLists.txt @@ -13,4 +13,4 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(ryzom_mission_compiler_fe ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.h ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS ryzom_mission_compiler_fe RUNTIME DESTINATION bin COMPONENT tools) +INSTALL(TARGETS ryzom_mission_compiler_fe RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) diff --git a/code/ryzom/tools/leveldesign/mission_compiler_lib/CMakeLists.txt b/code/ryzom/tools/leveldesign/mission_compiler_lib/CMakeLists.txt index c2dd48d41..23b13be97 100644 --- a/code/ryzom/tools/leveldesign/mission_compiler_lib/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/mission_compiler_lib/CMakeLists.txt @@ -14,7 +14,9 @@ NL_DEFAULT_PROPS(ryzom_mission_compiler_lib "Ryzom, Library: Mission Compiler") NL_ADD_RUNTIME_FLAGS(ryzom_mission_compiler_lib) NL_ADD_LIB_SUFFIX(ryzom_mission_compiler_lib) -INSTALL(TARGETS ryzom_mission_compiler_lib LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) +IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) + INSTALL(TARGETS ryzom_mission_compiler_lib LIBRARY DESTINATION ${RYZOM_LIB_PREFIX} ARCHIVE DESTINATION ${RYZOM_LIB_PREFIX} COMPONENT libraries) +ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) FILE(GLOB EXESRC main.cpp) @@ -24,4 +26,4 @@ TARGET_LINK_LIBRARIES(ryzom_mission_compiler ryzom_mission_compiler_lib) NL_DEFAULT_PROPS(ryzom_mission_compiler "Ryzom, Tools, Misc: Mission Compiler") NL_ADD_RUNTIME_FLAGS(ryzom_mission_compiler) -INSTALL(TARGETS ryzom_mission_compiler RUNTIME DESTINATION bin COMPONENT tools) +INSTALL(TARGETS ryzom_mission_compiler RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) diff --git a/code/ryzom/tools/leveldesign/mission_compiler_lib/step_content.cpp b/code/ryzom/tools/leveldesign/mission_compiler_lib/step_content.cpp index 0e24b05e6..adcf6c680 100644 --- a/code/ryzom/tools/leveldesign/mission_compiler_lib/step_content.cpp +++ b/code/ryzom/tools/leveldesign/mission_compiler_lib/step_content.cpp @@ -282,7 +282,7 @@ public: string genCode(CMissionData &md) { - string ret = ""; + string ret; if (!_MissionName.empty()) { ret = "spawn_mission : " + _MissionName + " : " + _GiverName; @@ -1809,7 +1809,7 @@ string CContentObjective::genCode(CMissionData &md) // --------------------------------------------------------------------------- /*std::string CContentObjective::genNbGuildMembersNeededOption(CMissionData &md) { - string ret = ""; + string ret; // If we are in a guild mission we add the 'nb_guild_members_needed' option to the script if (md.isGuildMission()) { diff --git a/code/ryzom/tools/leveldesign/mp_generator/CMakeLists.txt b/code/ryzom/tools/leveldesign/mp_generator/CMakeLists.txt index 11b529b8d..7d177bd02 100644 --- a/code/ryzom/tools/leveldesign/mp_generator/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/mp_generator/CMakeLists.txt @@ -13,4 +13,4 @@ NL_ADD_RUNTIME_FLAGS(mp_generator) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -INSTALL(TARGETS mp_generator RUNTIME DESTINATION bin COMPONENT tools) +INSTALL(TARGETS mp_generator RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) diff --git a/code/ryzom/tools/leveldesign/mp_generator/main.cpp b/code/ryzom/tools/leveldesign/mp_generator/main.cpp index bcf7fdf52..decb9b766 100644 --- a/code/ryzom/tools/leveldesign/mp_generator/main.cpp +++ b/code/ryzom/tools/leveldesign/mp_generator/main.cpp @@ -113,13 +113,13 @@ void LoadCraftParts() data.readFromFile( "rm_item_parts.csv" ); - while ( data != "" ) + while ( !data.empty() ) { ligne = data.splitTo( "\n", true ); // on recherche la ligne correspondant à notre craft part info = ligne.splitTo( ";", true ); - if ( info != "" ) + if ( !info.empty() ) { index = info.c_str()[0] - 'A'; @@ -179,13 +179,13 @@ void InitCreatureMP() data.readFromFile( "creature_models.csv" ); - while ( data != "" ) + while ( !data.empty() ) { ligneN = data.splitTo( "\n", true ); ligneM = data.splitTo( "\n", true ); // on vérifie que la ligne est valide - if ( ligneN.splitTo( ";", true ) != "" ) + if ( !ligneN.splitTo( ";", true ).empty() ) { ligneM.splitTo( ";", true ); @@ -195,7 +195,7 @@ void InitCreatureMP() ligneN.splitTo( ";", true ); ligneM.splitTo( ";", true ); - while ( ligneN != "" ) + while ( !ligneN.empty() ) { ListeCreatureMP listeCreatureMP; @@ -426,7 +426,7 @@ int GetNumeroMP( const CSString& nomMP ) result = FamilyTypContent.splitFrom( buffer ); // si oui, on retourne son numéro de MP - if ( result != "" ) + if ( !result.empty() ) res = result.splitTo( "\"" ).atoi(); else { @@ -478,7 +478,7 @@ int GetNumeroGroupe( const CSString& groupe ) result = GroupTypContent.splitFrom( buffer ); // si oui, on retourne son numéro de groupe - if ( result != "" ) + if ( !result.empty() ) res = result.splitTo( "\"" ).atoi(); else { @@ -557,14 +557,14 @@ void CreateParentSItem( int numMP, // 3d output += " \n"; - if ( icon != "" ) + if ( !icon.empty() ) { output += " \n"; } - if ( overlay != "" ) + if ( !overlay.empty() ) { output += " \n"; if(craftStats.UsedAsCraftRequirement) @@ -894,7 +894,7 @@ void CreateSheet( int numMP, const CSString& nomMP, CSString statEnergy; if ( ( variation == 2 ) && ( numMP == 695 ) ) // cas particulier pour le kitin trophy (beurk) statEnergy = "0"; - else if ( !creature || ( craftStats.Craft == "" ) ) + else if ( !creature || ( craftStats.Craft.empty() ) ) statEnergy = toString( "%d", GetStatEnergy( level ) ); else if ( variation < 2 ) statEnergy = toString( "%d", GetStatEnergy( level + 1 ) ); @@ -912,7 +912,7 @@ void CreateSheet( int numMP, const CSString& nomMP, outputFileName = toString( "m%04d%s%c%c%02d", numMP, code.c_str(), eco, 'a' + level, variation ); output = outputFileName; - GenerateItemNames( nomMP, eco, level, ( craftStats.Craft == "" ), creature, itemName ); + GenerateItemNames( nomMP, eco, level, ( craftStats.Craft.empty() ), creature, itemName ); output += "\t" + itemName; itemNames.insert( output ); } @@ -947,7 +947,7 @@ void GenerateDepositItems( int numMP, const CSString& nomMP, const MPCraftStats& code = "cxx"; // pas de craft = items de mission - if ( craftStats.Craft == "" ) + if ( craftStats.Craft.empty() ) { if ( loc != "G" ) CreateSheet( numMP, nomMP, code, 'c', 0, craftStats ); @@ -1000,7 +1000,7 @@ void GenerateCreatureItems( int numMP, CSString& nomMP, const MPCraftStats& craf CSString creatureFileName = "c"; creatureFileName += (*itMP)->codeCreature.toLower(); - if ( craftStats.Craft != "" ) + if ( !craftStats.Craft.empty() ) { quality = statQuality[creatureLevel-1]; if ( quality != 6 ) @@ -1107,7 +1107,7 @@ void NewMP( CSString& ligne ) // nouveau nom de famille nomMP = ligne.splitTo( ";", true ); - if ( nomMP == "" ) + if ( nomMP.empty() ) { // cette ligne ne contient pas d'info return; @@ -1126,37 +1126,37 @@ void NewMP( CSString& ligne ) ligne.splitTo( ";", true ); stat = ligne.splitTo( ";", true ); - if ( stat.firstWord() != "" ) + if ( !stat.firstWord().empty() ) craftStats.bestStatA = stat.atoi(); else craftStats.bestStatA = -1; stat = ligne.splitTo( ";", true ); - if ( stat.firstWord() != "" ) + if ( !stat.firstWord().empty() ) craftStats.worstStatA1 = stat.atoi(); else craftStats.worstStatA1 = -1; stat = ligne.splitTo( ";", true ); - if ( stat.firstWord() != "" ) + if ( !stat.firstWord().empty() ) craftStats.worstStatA2 = stat.atoi(); else craftStats.worstStatA2 = -1; stat = ligne.splitTo( ";", true ); - if ( stat.firstWord() != "" ) + if ( !stat.firstWord().empty() ) craftStats.bestStatB = stat.atoi(); else craftStats.bestStatB = -1; stat = ligne.splitTo( ";", true ); - if ( stat.firstWord() != "" ) + if ( !stat.firstWord().empty() ) craftStats.worstStatB1 = stat.atoi(); else craftStats.worstStatB1 = -1; stat = ligne.splitTo( ";", true ); - if ( stat.firstWord() != "" ) + if ( !stat.firstWord().empty() ) craftStats.worstStatB2 = stat.atoi(); else craftStats.worstStatB2 = -1; @@ -1168,19 +1168,19 @@ void NewMP( CSString& ligne ) specialOnly = stat.firstWord().contains( "x" ); // cas particuliers - while ( ligne != "" ) + while ( !ligne.empty() ) { if ( !ligne.contains( ";" ) ) { special = ligne; - if ( special.firstWord() != "" ) + if ( !special.firstWord().empty() ) specialNames.insert( special ); ligne = ""; } else { special = ligne.splitTo( ";", true ); - if ( special != "" ) + if ( !special.empty() ) specialNames.insert( special ); } } @@ -1357,7 +1357,7 @@ void LoadCustomizedProperties() fileName = CPath::lookup( name, false, false, true ); // on vérifie que le fichier concerné existe - if ( fileName != "" ) + if ( !fileName.empty() ) { CSString zone = prop.splitTo( ".", true ); str.readFromFile( fileName ); @@ -1455,7 +1455,7 @@ void GenerateDoc() AltDocs[c].write( "" + string(DataColStr[cc]) + "" ); AltDocs[c].write( "" ); string previousKey = "[NO PREVIOUS]"; // not a blank string, because it may be a valid value - string previousName = ""; + string previousName; for ( CRMData::CLookup::const_iterator isd=SortableData.lookup( c ).begin(); isd!=SortableData.lookup( c ).end(); ++isd ) { const TRMItem& item = SortableData.getRow( (*isd).second ); @@ -1530,7 +1530,7 @@ void LoadFamillesMP() ligne = fileData.splitTo( "\n", true ); - while ( ligne != "" ) + while ( !ligne.empty() ) { NewMP( ligne ); ligne = fileData.splitTo( "\n", true ); diff --git a/code/ryzom/tools/leveldesign/mp_generator/utils.h b/code/ryzom/tools/leveldesign/mp_generator/utils.h index 6804a5bc7..63148f61f 100644 --- a/code/ryzom/tools/leveldesign/mp_generator/utils.h +++ b/code/ryzom/tools/leveldesign/mp_generator/utils.h @@ -245,7 +245,7 @@ public: } private: - + CLookup _Indices [NC]; CItems _Items; @@ -280,7 +280,7 @@ public: { throw Exception("Could not open html: %s", filename.c_str()); } - fprintf( _File, ("\n\n" + title + "\n\n").c_str() ); + fprintf( _File, "\n\n%s\n\n", title.c_str() ); } /// @@ -289,7 +289,7 @@ public: if ( ! _Enabled ) return; - fprintf( _File, htmlCode.c_str() ); + fprintf( _File, "%s", htmlCode.c_str() ); } /// diff --git a/code/ryzom/tools/leveldesign/named_items_2_csv/CMakeLists.txt b/code/ryzom/tools/leveldesign/named_items_2_csv/CMakeLists.txt index 8cb16330b..990c1dd08 100644 --- a/code/ryzom/tools/leveldesign/named_items_2_csv/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/named_items_2_csv/CMakeLists.txt @@ -13,4 +13,4 @@ NL_ADD_RUNTIME_FLAGS(named2csv) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -INSTALL(TARGETS named2csv RUNTIME DESTINATION bin COMPONENT tools) +INSTALL(TARGETS named2csv RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) diff --git a/code/ryzom/tools/leveldesign/named_items_2_csv/named_items_2_csv.cpp b/code/ryzom/tools/leveldesign/named_items_2_csv/named_items_2_csv.cpp index ca89cae2f..6ab9e2a26 100644 --- a/code/ryzom/tools/leveldesign/named_items_2_csv/named_items_2_csv.cpp +++ b/code/ryzom/tools/leveldesign/named_items_2_csv/named_items_2_csv.cpp @@ -67,7 +67,7 @@ int verifItemsFile (const char *filename) string s(buffer); // null or comment - if (s == "" || s.find("//") == 0) + if (s.empty() || s.find("//") == 0) continue; if (s.find("_LocSlot") == string::npos) @@ -113,7 +113,7 @@ int verifCsvFile (const char *filename) void processItemLine(const string &s) { // null or comment - if (s == "" || s.find("//") == 0) + if (s.empty() || s.find("//") == 0) return; // other stuff @@ -176,7 +176,7 @@ int getFieldsFromFile(const char *filename) s = s.strtok("\n"); // skip null or comment - if (s == "" || s.find("//") == 0) + if (s.empty() || s.find("//") == 0) continue; // add the field @@ -294,7 +294,7 @@ void getItemBounds(const CVectorSString &lines, uint num, uint &a, uint &b) while (++i < lines.size() && !ok) { - if (lines[i] == "" || lines[i].find("//") != string::npos) + if (lines[i].empty() || lines[i].find("//") != string::npos) continue; // get item number @@ -404,7 +404,7 @@ void updateItemField(CVectorSString &lines, uint itemIndex, uint fieldIndex, uin } // param not found - if (!found && val != "" && val != "nul") + if (!found && !val.empty() && val != "nul") { // add it if (field.find("_CraftParameters") == string::npos) @@ -552,7 +552,7 @@ int main(int argc, char *argv[]) // load csv values importCsv(csvFile.c_str()); - if (itemsFile != "" && CFile::isExists(itemsFile.c_str())) + if (!itemsFile.empty() && CFile::isExists(itemsFile.c_str())) updateItems(itemsFile.c_str()); else nlerror("Can't find file : %s", itemsFile.c_str()); diff --git a/code/ryzom/tools/leveldesign/prim_export/CMakeLists.txt b/code/ryzom/tools/leveldesign/prim_export/CMakeLists.txt index 655209ef0..21fe7166b 100644 --- a/code/ryzom/tools/leveldesign/prim_export/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/prim_export/CMakeLists.txt @@ -11,7 +11,7 @@ TARGET_LINK_LIBRARIES(prim_export ${LIBXML2_LIBRARIES}) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -NL_DEFAULT_PROPS(prim_export "Ryzom, Tools, World: Primitive Export") +NL_DEFAULT_PROPS(prim_export "Ryzom, Tools, World: Primitive Export") NL_ADD_RUNTIME_FLAGS(prim_export) -INSTALL(TARGETS prim_export RUNTIME DESTINATION bin COMPONENT tools) +INSTALL(TARGETS prim_export RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) diff --git a/code/ryzom/tools/leveldesign/uni_conv/CMakeLists.txt b/code/ryzom/tools/leveldesign/uni_conv/CMakeLists.txt index b616f7cee..8fc43d376 100644 --- a/code/ryzom/tools/leveldesign/uni_conv/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/uni_conv/CMakeLists.txt @@ -5,8 +5,8 @@ ADD_EXECUTABLE(uni_conv ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(uni_conv ${LIBXML2_LIBRARIES} nelmisc) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - -NL_DEFAULT_PROPS(uni_conv "Ryzom, Tools, Misc: Unicode Conversion Tool") + +NL_DEFAULT_PROPS(uni_conv "Ryzom, Tools, Misc: Unicode Conversion Tool") NL_ADD_RUNTIME_FLAGS(uni_conv) -INSTALL(TARGETS uni_conv RUNTIME DESTINATION bin COMPONENT tools) +INSTALL(TARGETS uni_conv RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) diff --git a/code/ryzom/tools/leveldesign/world_editor/land_export/CMakeLists.txt b/code/ryzom/tools/leveldesign/world_editor/land_export/CMakeLists.txt index 6ac51f423..3ac1128e9 100644 --- a/code/ryzom/tools/leveldesign/world_editor/land_export/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/world_editor/land_export/CMakeLists.txt @@ -6,7 +6,7 @@ INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(land_export ${LIBXML2_LIBRARIES} nelmisc nelligo ryzom_landexport) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -NL_DEFAULT_PROPS(land_export "Ryzom, Tools, World: Land Export") +NL_DEFAULT_PROPS(land_export "Ryzom, Tools, World: Land Export") NL_ADD_RUNTIME_FLAGS(land_export) -INSTALL(TARGETS land_export RUNTIME DESTINATION bin COMPONENT tools) +INSTALL(TARGETS land_export RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) diff --git a/code/ryzom/tools/leveldesign/world_editor/land_export_lib/CMakeLists.txt b/code/ryzom/tools/leveldesign/world_editor/land_export_lib/CMakeLists.txt index ab6386118..e130751a2 100644 --- a/code/ryzom/tools/leveldesign/world_editor/land_export_lib/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/world_editor/land_export_lib/CMakeLists.txt @@ -12,5 +12,6 @@ NL_ADD_LIB_SUFFIX(ryzom_landexport) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -INSTALL(TARGETS ryzom_landexport LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) - +IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) + INSTALL(TARGETS ryzom_landexport LIBRARY DESTINATION ${RYZOM_LIB_PREFIX} ARCHIVE DESTINATION ${RYZOM_LIB_PREFIX} COMPONENT libraries) +ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) diff --git a/code/ryzom/tools/leveldesign/world_editor/land_export_lib/export.cpp b/code/ryzom/tools/leveldesign/world_editor/land_export_lib/export.cpp index 64e156909..1b0d6c078 100644 --- a/code/ryzom/tools/leveldesign/world_editor/land_export_lib/export.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/land_export_lib/export.cpp @@ -34,7 +34,7 @@ #include "nel/ligo/zone_region.h" #include "nel/ligo/zone_bank.h" -#include "nel/../../src/pacs/collision_mesh_build.h" +#include "nel/pacs/collision_mesh_build.h" #include "../../../leveldesign/export/tools.h" diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/CMakeLists.txt b/code/ryzom/tools/leveldesign/world_editor/world_editor/CMakeLists.txt index a490ca0e9..e4790eeea 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/CMakeLists.txt @@ -20,11 +20,11 @@ TARGET_LINK_LIBRARIES(world_editor ${LIBXML2_LIBRARIES}) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -NL_DEFAULT_PROPS(world_editor "Ryzom, Tools, World: World Editor") +NL_DEFAULT_PROPS(world_editor "Ryzom, Tools, World: World Editor") NL_ADD_RUNTIME_FLAGS(world_editor) IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(world_editor ${CMAKE_CURRENT_SOURCE_DIR}/stdafx.h ${CMAKE_CURRENT_SOURCE_DIR}/stdafx.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS world_editor RUNTIME DESTINATION bin COMPONENT tools) +INSTALL(TARGETS world_editor RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/dialog_properties.cpp b/code/ryzom/tools/leveldesign/world_editor/world_editor/dialog_properties.cpp index 31189622a..e39994fc4 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/dialog_properties.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/dialog_properties.cpp @@ -216,7 +216,7 @@ void CDialogProperties::removeWidgets () else if (widget.Parameter.Type == CPrimitiveClass::CParameter::StringArray) { widget.MultiLineEditBox.DestroyWindow (); - if (widget.Parameter.Folder != "" || !widget.Parameter.FileExtension.empty()) + if (!widget.Parameter.Folder.empty() || !widget.Parameter.FileExtension.empty()) { widget.CheckBox.DestroyWindow (); } diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/file_dialog_ex.cpp b/code/ryzom/tools/leveldesign/world_editor/world_editor/file_dialog_ex.cpp index 7bf850817..781e78005 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/file_dialog_ex.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/file_dialog_ex.cpp @@ -51,7 +51,7 @@ END_MESSAGE_MAP() // *************************************************************************** -int CFileDialogEx::DoModal () +INT_PTR CFileDialogEx::DoModal () { // Get the path char path[512]; diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/file_dialog_ex.h b/code/ryzom/tools/leveldesign/world_editor/world_editor/file_dialog_ex.h index f647b3add..ce367c906 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/file_dialog_ex.h +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/file_dialog_ex.h @@ -41,7 +41,7 @@ public: LPCTSTR lpszFilter = NULL, CWnd* pParentWnd = NULL); - virtual int DoModal( ); + virtual INT_PTR DoModal( ); virtual BOOL OnCommand( WPARAM wParam, LPARAM lParam ); diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/imagelist_ex.cpp b/code/ryzom/tools/leveldesign/world_editor/world_editor/imagelist_ex.cpp index 513abe109..195a44381 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/imagelist_ex.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/imagelist_ex.cpp @@ -27,8 +27,8 @@ using namespace NLMISC; #pragma warning (disable : 4786) -BOOL CALLBACK EnumResLangProc(HINSTANCE hModule, LPCTSTR lpszType, LPCTSTR lpszName, WORD wIDLanguage, - LONG lParam) +BOOL CALLBACK EnumResLangProc(HMODULE hModule, LPCSTR lpszType, LPCSTR lpszName, WORD wIDLanguage, + LONG_PTR lParam) { set *iconNames = (set*)lParam; diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/main_frm.cpp b/code/ryzom/tools/leveldesign/world_editor/world_editor/main_frm.cpp index df79db226..a70813f47 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/main_frm.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/main_frm.cpp @@ -3304,7 +3304,7 @@ void CMainFrame::OnUpdateEditSelectChildren(CCmdUI* pCmdUI) // *************************************************************************** -void CMainFrame::OnTimer(UINT nIDEvent) +void CMainFrame::OnTimer(UINT_PTR nIDEvent) { if (nIDEvent == TIMER_UPDATE_FILES) { diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/main_frm.h b/code/ryzom/tools/leveldesign/world_editor/world_editor/main_frm.h index 5c2173186..7883c2dea 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/main_frm.h +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/main_frm.h @@ -470,7 +470,7 @@ public: afx_msg void OnUpdateEditCollapse(CCmdUI* pCmdUI); afx_msg void OnEditSelectChildren(); afx_msg void OnUpdateEditSelectChildren(CCmdUI* pCmdUI); - afx_msg void OnTimer(UINT nIDEvent); + afx_msg void OnTimer(UINT_PTR nIDEvent); afx_msg void OnEditExpand (); afx_msg void OnEditCollapse (); afx_msg void OnHelpFinder(); diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor_fauna_graph_plugin/CMakeLists.txt b/code/ryzom/tools/leveldesign/world_editor/world_editor_fauna_graph_plugin/CMakeLists.txt index 04e11fd50..3d1f18473 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor_fauna_graph_plugin/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor_fauna_graph_plugin/CMakeLists.txt @@ -17,5 +17,5 @@ NL_ADD_LIB_SUFFIX(world_editor_fauna_graph_plugin) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${MFC_DEFINITIONS} -DWIN32_DLL_EXPORTS) -INSTALL(TARGETS world_editor_fauna_graph_plugin LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d) +INSTALL(TARGETS world_editor_fauna_graph_plugin LIBRARY DESTINATION ${RYZOM_LIB_PREFIX} RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} ARCHIVE DESTINATION ${RYZOM_LIB_PREFIX} COMPONENT tools3d) diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor_graph_plugin/CMakeLists.txt b/code/ryzom/tools/leveldesign/world_editor/world_editor_graph_plugin/CMakeLists.txt index 4fc58a958..8895ac93b 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor_graph_plugin/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor_graph_plugin/CMakeLists.txt @@ -18,5 +18,5 @@ NL_ADD_LIB_SUFFIX(world_editor_graph_plugin) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${MFC_DEFINITIONS} -DWIN32_DLL_EXPORTS) -INSTALL(TARGETS world_editor_graph_plugin LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d) +INSTALL(TARGETS world_editor_graph_plugin LIBRARY DESTINATION ${RYZOM_LIB_PREFIX} RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} ARCHIVE DESTINATION ${RYZOM_LIB_PREFIX} COMPONENT tools3d) diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor_plugin/CMakeLists.txt b/code/ryzom/tools/leveldesign/world_editor/world_editor_plugin/CMakeLists.txt index f12eab168..81b77c4f1 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor_plugin/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor_plugin/CMakeLists.txt @@ -21,6 +21,6 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(world_editor_plugin ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.h ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS world_editor_plugin LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d) -INSTALL(FILES WorldEditorPlugin.cfg DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS world_editor_plugin LIBRARY DESTINATION ${RYZOM_LIB_PREFIX} RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} ARCHIVE DESTINATION ${RYZOM_LIB_PREFIX} COMPONENT tools3d) +INSTALL(FILES WorldEditorPlugin.cfg DESTINATION ${RYZOM_ETC_PREFIX} COMPONENT tools3d) diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor_primitive_plugin/CMakeLists.txt b/code/ryzom/tools/leveldesign/world_editor/world_editor_primitive_plugin/CMakeLists.txt index 4175cb8f9..d33bd7032 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor_primitive_plugin/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor_primitive_plugin/CMakeLists.txt @@ -17,5 +17,5 @@ NL_ADD_LIB_SUFFIX(world_editor_primitive_plugin) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${MFC_DEFINITIONS} -DWIN32_DLL_EXPORTS) -INSTALL(TARGETS world_editor_primitive_plugin LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d) +INSTALL(TARGETS world_editor_primitive_plugin LIBRARY DESTINATION ${RYZOM_LIB_PREFIX} RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} ARCHIVE DESTINATION ${RYZOM_LIB_PREFIX} COMPONENT tools3d) diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor_shard_monitor_plugin/CMakeLists.txt b/code/ryzom/tools/leveldesign/world_editor/world_editor_shard_monitor_plugin/CMakeLists.txt index fdfa3e1ca..c821f5de9 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor_shard_monitor_plugin/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor_shard_monitor_plugin/CMakeLists.txt @@ -18,5 +18,5 @@ NL_ADD_LIB_SUFFIX(world_editor_shard_monitor_plugin) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${MFC_DEFINITIONS} -DWIN32_DLL_EXPORTS) -INSTALL(TARGETS world_editor_shard_monitor_plugin LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d) +INSTALL(TARGETS world_editor_shard_monitor_plugin LIBRARY DESTINATION ${RYZOM_LIB_PREFIX} RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} ARCHIVE DESTINATION ${RYZOM_LIB_PREFIX} COMPONENT tools3d) diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor_sound_plugin/CMakeLists.txt b/code/ryzom/tools/leveldesign/world_editor/world_editor_sound_plugin/CMakeLists.txt index 298c0cc0d..997777d56 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor_sound_plugin/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor_sound_plugin/CMakeLists.txt @@ -17,5 +17,5 @@ NL_ADD_LIB_SUFFIX(world_editor_sound_plugin) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${MFC_DEFINITIONS} -DWIN32_DLL_EXPORTS) -INSTALL(TARGETS world_editor_sound_plugin LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d) +INSTALL(TARGETS world_editor_sound_plugin LIBRARY DESTINATION ${RYZOM_LIB_PREFIX} RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} ARCHIVE DESTINATION ${RYZOM_LIB_PREFIX} COMPONENT tools3d) diff --git a/code/ryzom/tools/make_alias_file/CMakeLists.txt b/code/ryzom/tools/make_alias_file/CMakeLists.txt index 4142dfdcc..3711a6120 100644 --- a/code/ryzom/tools/make_alias_file/CMakeLists.txt +++ b/code/ryzom/tools/make_alias_file/CMakeLists.txt @@ -6,7 +6,7 @@ INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(make_alias_file ${LIBXML2_LIBRARIES} nelmisc nelgeorges) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -NL_DEFAULT_PROPS(make_alias_file "Ryzom, Tools, Misc: Make Alias File") +NL_DEFAULT_PROPS(make_alias_file "Ryzom, Tools, Misc: Make Alias File") NL_ADD_RUNTIME_FLAGS(make_alias_file) -INSTALL(TARGETS make_alias_file RUNTIME DESTINATION bin COMPONENT tools) +INSTALL(TARGETS make_alias_file RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) diff --git a/code/ryzom/tools/make_anim_by_race/CMakeLists.txt b/code/ryzom/tools/make_anim_by_race/CMakeLists.txt index 597eb0bb4..3a67971c3 100644 --- a/code/ryzom/tools/make_anim_by_race/CMakeLists.txt +++ b/code/ryzom/tools/make_anim_by_race/CMakeLists.txt @@ -6,7 +6,7 @@ INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(make_anim_by_race ${LIBXML2_LIBRARIES} nelmisc) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -NL_DEFAULT_PROPS(make_anim_by_race "Ryzom, Tools, Misc: Make Anim By Race") +NL_DEFAULT_PROPS(make_anim_by_race "Ryzom, Tools, Misc: Make Anim By Race") NL_ADD_RUNTIME_FLAGS(make_anim_by_race) -INSTALL(TARGETS make_anim_by_race RUNTIME DESTINATION bin COMPONENT tools) +INSTALL(TARGETS make_anim_by_race RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) diff --git a/code/ryzom/tools/make_anim_melee_impact/CMakeLists.txt b/code/ryzom/tools/make_anim_melee_impact/CMakeLists.txt index 089444aee..7dd34fb7d 100644 --- a/code/ryzom/tools/make_anim_melee_impact/CMakeLists.txt +++ b/code/ryzom/tools/make_anim_melee_impact/CMakeLists.txt @@ -3,7 +3,7 @@ FILE(GLOB SRC *.cpp *.h) ADD_EXECUTABLE(make_anim_melee_impact ${SRC}) TARGET_LINK_LIBRARIES(make_anim_melee_impact nelmisc) -NL_DEFAULT_PROPS(make_anim_melee_impact "Ryzom, Tools, Misc: Make Anim Melee Impact") +NL_DEFAULT_PROPS(make_anim_melee_impact "Ryzom, Tools, Misc: Make Anim Melee Impact") NL_ADD_RUNTIME_FLAGS(make_anim_melee_impact) -INSTALL(TARGETS make_anim_melee_impact RUNTIME DESTINATION bin COMPONENT tools) +INSTALL(TARGETS make_anim_melee_impact RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) diff --git a/code/ryzom/tools/occ2huff/CMakeLists.txt b/code/ryzom/tools/occ2huff/CMakeLists.txt index d73db604e..6be696d60 100644 --- a/code/ryzom/tools/occ2huff/CMakeLists.txt +++ b/code/ryzom/tools/occ2huff/CMakeLists.txt @@ -13,4 +13,4 @@ NL_ADD_RUNTIME_FLAGS(occ2huff) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -INSTALL(TARGETS occ2huff RUNTIME DESTINATION bin COMPONENT tools) +INSTALL(TARGETS occ2huff RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) diff --git a/code/ryzom/tools/patch_gen/CMakeLists.txt b/code/ryzom/tools/patch_gen/CMakeLists.txt index d7407756a..7a5117a60 100644 --- a/code/ryzom/tools/patch_gen/CMakeLists.txt +++ b/code/ryzom/tools/patch_gen/CMakeLists.txt @@ -10,10 +10,10 @@ NL_ADD_RUNTIME_FLAGS(patch_gen) ADD_EXECUTABLE(patch_gen_service WIN32 ${SERVICE_SRC}) TARGET_LINK_LIBRARIES(patch_gen_service ryzom_gameshare nelmisc nelnet nelligo nelgeorges) -NL_DEFAULT_PROPS(patch_gen_service "Ryzom, Tools: Patch Generator Service") -NL_ADD_RUNTIME_FLAGS(patch_gen_service) +NL_DEFAULT_PROPS(patch_gen_service "Ryzom, Tools: Patch Generator Service") +NL_ADD_RUNTIME_FLAGS(patch_gen_service) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -INSTALL(TARGETS patch_gen RUNTIME DESTINATION bin COMPONENT tools) -INSTALL(TARGETS patch_gen_service RUNTIME DESTINATION bin COMPONENT tools) +INSTALL(TARGETS patch_gen RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) +INSTALL(TARGETS patch_gen_service RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) diff --git a/code/ryzom/tools/pd_parser/CMakeLists.txt b/code/ryzom/tools/pd_parser/CMakeLists.txt index 1a26f5f46..676c2786a 100644 --- a/code/ryzom/tools/pd_parser/CMakeLists.txt +++ b/code/ryzom/tools/pd_parser/CMakeLists.txt @@ -6,7 +6,7 @@ INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(pd_parser ${LIBXML2_LIBRARIES} nelmisc) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -NL_DEFAULT_PROPS(pd_parser "Ryzom, Tools: PD Parser") +NL_DEFAULT_PROPS(pd_parser "Ryzom, Tools: PD Parser") NL_ADD_RUNTIME_FLAGS(pd_parser) -INSTALL(TARGETS pd_parser RUNTIME DESTINATION bin COMPONENT tools) +INSTALL(TARGETS pd_parser RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) diff --git a/code/ryzom/tools/pd_parser/parse_node.h b/code/ryzom/tools/pd_parser/parse_node.h index b1c43fa4a..ad2b6a8f2 100644 --- a/code/ryzom/tools/pd_parser/parse_node.h +++ b/code/ryzom/tools/pd_parser/parse_node.h @@ -870,7 +870,7 @@ public: std::string getIndexName(uint32 value) const { - std::string result = ""; + std::string result; uint i; for (i=0; iName; return res; @@ -1078,7 +1078,7 @@ public: std::string getDebugCallStringFmt() { uint i, idx=0; - std::string res = ""; + std::string res; for (i=0; i - - - App Hello World! - - -

APP Hello World!

- - indexlogout' : '')?> - -

Character

-
- - diff --git a/code/ryzom/tools/server/www/webig/index.php b/code/ryzom/tools/server/www/webig/index.php deleted file mode 100644 index 57ddd7b55..000000000 --- a/code/ryzom/tools/server/www/webig/index.php +++ /dev/null @@ -1,133 +0,0 @@ -login error

'; - } - echo ' - - - WebIG - Login - - Login -
- - Char name
- Password
- -
- - '; - exit; -} - -// if this was login request from app, then redirect back there -$redirect = is($_GET['redirect'], ''); -if(!empty($redirect)){ - header('Location: '.$redirect); - exit; -} - -// check user privileges -$is_admin = webig_is_admin($user['cid']>>4); - -// get more info about character - race, civlization, cult, guild, etc -$character = webig_load_character($user['cid']); - -// user is verified -?> - - - App Index - - -

Hello ""!

- - index | Hello APPlogout' : '')?> - -User info'; -echo 'USER:'.dump_array($user); -echo 'CHARACTER:'.dump_array($character); - - $__end = microtime(true); - echo "
\n---\npage created ".sprintf("%.5fsec", $__end - $__start).'
'; - -?> - - - - - - '; - $c=0; - foreach($array as $k => $v){ - if(is_array($v)){ - $v = dump_array($v); - }else{ - // make value safe for html - $v = h($v); - } - echo ' - - - - '; - $c++; - } - echo ' -
'.h($k).''.$v.'
- - - '; - - return ob_get_clean(); -} - -function display_teleport_list(){ - $places = array( - 'Ranger Camp' => array(10314,-11734), - 'Shining Lake' => array(9056, -10822), - ); -?> -

Teleport destinations

- - -
- - $xyz){ - echo ' - - - - '; - $c++; - } ?> -
'.h($txt).''.join(',', $xyz).'
-
-_pdo = new PDO('mysql:host='.$GLOBALS['DBHost'].';dbname='.$GLOBALS['DBName'].';charset=utf-8', $GLOBALS['DBUserName'], $GLOBALS['DBPassword'], array(PDO::MYSQL_ATTR_INIT_COMMAND => 'set names utf8')); - $this->_pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - } - - public function getInstance(){ - static $instance = null; - if($instance === null){ - $instance = new DB(); - } - return $instance; - } - - /** - * @param string $sql - * @param array $params (optional) - * @return PDOStatement - */ - function query($sql, $params=array()){ - if(empty($params)){ - $stmt = $this->_pdo->query($sql); - }else{ - $stmt = $this->_pdo->prepare($sql); - $stmt->execute($params); - } - return $stmt; - } -} - -/** - * Verify and log-in user - * - * @return mixed user info array or boolean FALSE when user was not verified - */ -function app_authenticate(){ - // mask possible double session_start() warning - @session_start(); - - if(isWEBIG){ - // ingame login - - // gather user from $_GET or $_POST variables - $user = webig_user(); - - // verify it against database - $user = webig_auth($user); - }else{ - // outgame login - - if(isset($_POST['login'])){ - // login request - $shardid = is($_POST['login']['shardid'], ''); - $name = is($_POST['login']['name'], ''); - $passwd = is($_POST['login']['passwd'], ''); - - // verify character and password against database and populate $_GET with user info - $user = login_auth($shardid, $name, $passwd); - $_SESSION['login']['error'] = ($user === false); - }elseif(isset($_GET['logout'])){ - // logout request - unset($_SESSION['user']); - unset($_SESSION['authkey']); - - // redirect to self without URL parameters - header('Location: '.$_SERVER['PHP_SELF']); - exit; - }else{ - // continue session - $user = is($_SESSION['user'], false); - - // verify user in session against database (e.g. user might be deleted) - $user = load_user($user['shardid'], null, $user['cid']); - } - } - - // auth failed? - if(empty($user)){ - return false; - } - - // remove values we do not need to keep in session - unset($user['password']); - unset($user['cookie']); - - // return user info array on success - $_SESSION['user'] = $user; - return $user; -} - -// get user info that WebIG sends us -function webig_user(){ - $user = array(); - - // shard id (302) - $user['shardid'] = ryzom_get_param('shardid'); - - // character name (User) - $user['name'] = ryzom_get_param('name'); - - // character id (16), user id is calculated as 'uid = cid >> 4'; - $user['cid'] = ryzom_get_param('cid'); - - // language - $user['lang'] = ryzom_get_param('lang'); - - $user['authkey'] = ryzom_get_param('authkey'); - - return $user; -} - -/** - * Verify character using info from ig browser - * - * @param array $user - * @return bool return user info array on success and FALSE on error - */ -function webig_auth($user){ - // find user by shard and character id (name might be temporarily changed in game) - $result = load_user($user['shardid'], null, $user['cid']); - if(empty($result)){ - // should not happen, but user was not found - return false; - } - - // Create auth key by using cookie from DB and user info from user - $authkey = webig_create_authkey($user, $result['cookie']); - if($user['authkey'] !== $authkey){ - // something is out of sync - either user info or cookie - return false; - } - - // return result from DB - return $result; -} - -/** - * Verify character - * - * @param int $shardid character shard id - * @param string $name character name - * @param string $passwd plain text password - * @return mixed return user info array on success or boolean false on error - */ -function login_auth($shardid, $name, $passwd){ - // get character from db - $user = load_user($shardid, $name); - if(empty($user)){ - // user was not found - return false; - } - - $passwd = crypt($passwd, substr($user['password'], 0, 2)); - if($passwd !== $user['password']){ - // password failed - return false; - } - - return $user; -} - -/** - * Fetch user info from db - * - * If name is NULL, then $cid is used - * - * @param int $shardid - * @param string $name - * @param int $cid - * @return array - */ -function load_user($shardid, $name, $cid = null){ - // `nel`.`user` has password - // `ring_open`.`ring_users` has cookie - // `ring_open`.`characters` has char_id, char_name, home_mainland_session_id(==shardid) - - $sql = 'SELECT c.`char_id` cid, c.`char_name` name, c.`home_mainland_session_id` shardid, n.`password`, u.`cookie` - FROM `ring_open`.`characters` c - JOIN `ring_open`.`ring_users` u on u.`user_id` = c.`user_id` - JOIN `nel`.`user` n on n.`uid` = c.`user_id` - WHERE c.`home_mainland_session_id` = :shardid'; - $params = array('shardid' => $shardid); - if($name !== null){ - $sql .= ' AND c.`char_name` = :name'; - $params['name'] = $name; - }elseif($cid !== null){ - $sql .= ' AND c.`char_id` = :cid'; - $params['cid'] = $cid; - }else{ - // $name or $cid both empty - return false; - } - - $result = DB::getInstance()->query($sql, $params)->fetch(PDO::FETCH_ASSOC); - return $result; -} - -/** - * Verify user info that ig browser sent us using cookie from database - * - * @param array $user user info array - * @param string $cookie User login cookie from database - * @return string md5 hash - */ -function webig_create_authkey($user, $cookie){ - return md5($user['shardid'].$user['name'].$user['cid'].'\''.$cookie.'\''); -} - -/** - * Return user privileges from DB - * - * @param int $uid user id (uid = cid >> 4) - * @return mixed array of user privileges or boolean FALSE when user was not found - */ -function webig_get_privileges($uid){ - $sql = 'select `privilege` from `nel`.`user` where `uid` = :id'; - $params = array('id' => $uid); - - $result = DB::getInstance()->query($sql, $params)->fetchColumn(0); - - if($result !== false){ - $result = explode(':', $result); - $ret = array(); - foreach($result as $k=>$v){ - if($v != ''){ - $ret[]=$v; - } - } - $result = $ret; - } - - return $result; -} - -/** - * Test user privileges - * - * @param int $uid user id - * @param array $priv array of privileges, like array('DEV', 'GM') - * @return bool - */ -function webig_has_privileges($uid, $priv){ - $userpriv = webig_get_privileges($uid); - $result = array_intersect($priv, $userpriv); - return !empty($result); -} - -/** - * Test user privileges against (DEV, SGM, GM) - * - * @param int $uid user id - * @return bool - */ -function webig_is_admin($uid){ - // entities_game_service/player_manager/player_manager.cpp defines order - // DEV > SGM > EM > GM > EG > VG > SG > G > OBSERVER > PR - return webig_has_privileges($uid, array('DEV', 'SGM', 'EM', 'GM')); -} - -/** - * Load character from shard save binary file - * - * @param int $cid - * @return mixed array with character info or boolean FALSE on error - */ -function webig_load_character($cid){ - $pdr = CharacterPdr::createDefault(); - $char = $pdr->load($cid); - if(empty($char)){ - return false; - } - - $result = array( - 'id' => (int) $cid, - 'name' => (string) $char->EntityBase->_Name['value'], - 'title' => (string) $char->_Title['value'], - 'race' => (string) $char->EntityBase->_Race['value'], - 'gender' => (int) $char->EntityBase->_Gender['value'] == '0' ? 'male' : 'female', - 'cult' => (string) $char->DeclaredCult['value'], - 'civ' => (string) $char->DeclaredCiv['value'], - 'guild' => false, - ); - - $guild_id = (int) $char->_GuildId['value']; - if($guild_id>0){ - // if char is in guild, then also get guild info - $result['guild'] = webig_load_guild($guild_id); - - // get guild rank (also from guild file) - $result['guild_membership'] = webig_load_guild_membership($guild_id, $cid); - } - unset($char); - - return $result; -} - -/** - * Load basic guild info (name, description, motd, culv, civ) - * - * @param int $guild_id - * @return mixed array with guild info or boolean FALSE on error - */ -function webig_load_guild($guild_id){ - $pdr = GuildPdr::createDefault(); - $guild = $pdr->load($guild_id); - if(empty($guild)){ - return false; - } - - $result = array( - 'id' => (int) $guild_id, - 'icon' => (string) $guild->Icon['value'], - 'name' => (string) $guild->_Name['value'], - 'description' => (string) $guild->_Description['value'], - 'motd' => (string) $guild->_MessageOfTheDay['value'], - 'cult' => (string) $guild->DeclaredCult['value'], - 'civ' => (string) $guild->DeclaredCiv['value'], - ); - unset($guild); - - return $result; -} - -/** - * Load guild member info - * - * @param int $guild_id - * @param int $char_id - * @return mixed array with guild member info or boolean FALSE if guild or character not found - */ -function webig_load_guild_membership($guild_id, $char_id){ - $pdr = GuildPdr::createDefault(); - $guild = $pdr->load($guild_id); - if(empty($guild)){ - return false; - } - - $result = false; - - // test for 'id' and type (CHAR == 0), ignore creator (should be 0x00) and dynamic - // 0x0000000013:00:00:87 - $eid = sprintf('0x%010x:00:', $char_id); - $i = 0; - while(isset($guild->Members->__Key__[$i])){ - $key = $guild->Members->__Key__[$i]; - $pos = strpos((string)$key['value'], $eid); - if($pos === 1){ - $val = $guild->Members->__Val__[$i]; - $result = array( - 'grade' => (string) $val->Members->Grade['value'], - 'joined' => (int) $val->Members->EnterTime['value'], - ); - break; - } - $i++; - } - unset($guild); - - return $result; -} - -// shortcut for 'isset() ? .. : ..' -function is(&$var, $default = null){ - return isset($var) ? $var : $default; -} - -// escape string so it's safe for HTML -function h($str){ - return htmlspecialchars($str, ENT_QUOTES, 'UTF-8'); -} - -// return $_GET[var] or $_POST[var] or $default -function ryzom_get_param($var, $default=''){ - return is($_GET[$var], is($_POST[$var], $default)); -} \ No newline at end of file diff --git a/code/ryzom/tools/server/www/webig/lib/pdr_util.php b/code/ryzom/tools/server/www/webig/lib/pdr_util.php deleted file mode 100644 index 1e28124a8..000000000 --- a/code/ryzom/tools/server/www/webig/lib/pdr_util.php +++ /dev/null @@ -1,124 +0,0 @@ -_shard_save = $shard_save; - $this->_sheetid_dir = $sheetid_dir; - - $this->_unpack_dir = $unpack; - } - - function setShardSaveDirectory($dir){ - $this->_shard_save = $dir; - } - function getShardSaveDirectory(){ - return $this->_shard_save; - } - - function setSheetIdDirectory($dir){ - $this->_sheetid_dir = $dir; - } - function getSheetIdDirectory(){ - return $this->_sheetid_dir; - } - - function setUnpackDirectory($dir){ - $this->_unpack_dir = $dir; - } - function getUnpackDirectory(){ - return $this->_unpack_dir; - } - - /** - * Extract $pdr file to $xml file - * - * @param string $pdr - * @param string $xml - * @return bool - */ - function extract($pdr, $xml){ - if(!file_exists($pdr)){ - return false; - } - - $pdr_mtime = filemtime($pdr); - if(file_exists($xml)){ - $xml_mtime = filemtime($xml); - }else{ - $xml_mtime = 0; - } - - $diff = $pdr_mtime - $xml_mtime; - if($diff > self::CACHE_MIN_TIME){ - // remove expired xml file - @unlink($xml); - - // change working directory to unpack directory to keep pdr_util log file in one place - $pwd = getcwd(); - chdir($this->_unpack_dir); - - // run pdr_util - $cmd = sprintf(' -s%s -x -o%s %s', $this->_sheetid_dir, $xml, $pdr); - exec(CMD_PDR_UTIL.' '.$cmd); - - // change working directory back what it was before - chdir($pwd); - } - - // if pdr_util failed, then there is no xml file - return file_exists($xml); - } - - /** - * @param string $fname - * @return string ShardSaveDirectory + fname - */ - function getSaveFileName($fname){ - return $this->getShardSaveDirectory().'/'.$fname; - } - - /** - * @param string $fname - * return string TempDirectory + $fname - */ - function getXmlFileName($fname){ - return $this->getUnpackDirectory().'/'.$fname; - } - -} - diff --git a/code/ryzom/tools/server/www/webig/lib/pdr_util_character.php b/code/ryzom/tools/server/www/webig/lib/pdr_util_character.php deleted file mode 100644 index 7e2d689ce..000000000 --- a/code/ryzom/tools/server/www/webig/lib/pdr_util_character.php +++ /dev/null @@ -1,46 +0,0 @@ -getSaveFileName($char_id >> 4, $char_id & 0x0F); - $xml_file = $this->getXmlFileName($char_id); - - if($this->extract($char_save, $xml_file)){ - return simplexml_load_file($xml_file); - } - - // extract failed - return false; - } - - /** - * @param int $uid user id - * @param int $slot character slot, starting from 0 - * @return string character save path + filename - */ - function getSaveFileName($uid, $slot){ - return parent::getSaveFileName(sprintf('characters/%03d/account_%d_%d_pdr.bin', $uid, $uid, $slot)); - } - - /** - * @param $char_id - * return string character xml file in unpack directory - */ - function getXmlFileName($char_id){ - return parent::getXmlFileName(sprintf('character_%d.xml', $char_id)); - } -} diff --git a/code/ryzom/tools/server/www/webig/lib/pdr_util_guild.php b/code/ryzom/tools/server/www/webig/lib/pdr_util_guild.php deleted file mode 100644 index 54249f781..000000000 --- a/code/ryzom/tools/server/www/webig/lib/pdr_util_guild.php +++ /dev/null @@ -1,47 +0,0 @@ -getSaveFileName($guild_id); - $xml_file = $this->getXmlFileName($guild_id); - - if($this->extract($guild_save, $xml_file)){ - return simplexml_load_file($xml_file); - } - - // extract failed - return false; - } - - /** - * @param int $guild_id - * @return string full path to guild binary file - */ - function getSaveFileName($guild_id){ - // chop off shard component from guild id - return parent::getSaveFileName(sprintf('guilds/guild_%05d.bin', $guild_id & 0xFFFFF)); - } - - /** - * @param $guild_id - * return string full path to extracted guild xml file - */ - function getXmlFileName($guild_id){ - return parent::getXmlFileName(sprintf('guild_%d.xml', $guild_id)); - } -} - diff --git a/code/ryzom/tools/sheet_random_generator/CMakeLists.txt b/code/ryzom/tools/sheet_random_generator/CMakeLists.txt index 9f5405d71..5b80507c0 100644 --- a/code/ryzom/tools/sheet_random_generator/CMakeLists.txt +++ b/code/ryzom/tools/sheet_random_generator/CMakeLists.txt @@ -18,4 +18,4 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(sheet_random_generator ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.h ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS sheet_random_generator RUNTIME DESTINATION bin COMPONENT tools) +INSTALL(TARGETS sheet_random_generator RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) diff --git a/code/ryzom/tools/sheets_packer/CMakeLists.txt b/code/ryzom/tools/sheets_packer/CMakeLists.txt index 48d024774..ab3129d14 100644 --- a/code/ryzom/tools/sheets_packer/CMakeLists.txt +++ b/code/ryzom/tools/sheets_packer/CMakeLists.txt @@ -25,4 +25,4 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(sheets_packer ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS sheets_packer RUNTIME DESTINATION bin COMPONENT tools) +INSTALL(TARGETS sheets_packer RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) diff --git a/code/ryzom/tools/skill_extractor/CMakeLists.txt b/code/ryzom/tools/skill_extractor/CMakeLists.txt index 76f302fb1..c34de1aa9 100644 --- a/code/ryzom/tools/skill_extractor/CMakeLists.txt +++ b/code/ryzom/tools/skill_extractor/CMakeLists.txt @@ -6,7 +6,7 @@ INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(skill_extractor ${LIBXML2_LIBRARIES} nelmisc) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -NL_DEFAULT_PROPS(skill_extractor "Ryzom, Tools, Misc: Skill Extractor") +NL_DEFAULT_PROPS(skill_extractor "Ryzom, Tools, Misc: Skill Extractor") NL_ADD_RUNTIME_FLAGS(skill_extractor) -INSTALL(TARGETS skill_extractor RUNTIME DESTINATION bin COMPONENT tools) +INSTALL(TARGETS skill_extractor RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) diff --git a/code/ryzom/tools/stats_scan/CMakeLists.txt b/code/ryzom/tools/stats_scan/CMakeLists.txt index 3d49e5fc4..fbb54e449 100644 --- a/code/ryzom/tools/stats_scan/CMakeLists.txt +++ b/code/ryzom/tools/stats_scan/CMakeLists.txt @@ -6,7 +6,7 @@ INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(stats_scan ryzom_gameshare ${LIBXML2_LIBRARIES} nelmisc nelnet nelligo nelgeorges) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -NL_DEFAULT_PROPS(stats_scan "Ryzom, Tools, Misc: Stats Scan") +NL_DEFAULT_PROPS(stats_scan "Ryzom, Tools, Misc: Stats Scan") NL_ADD_RUNTIME_FLAGS(stats_scan) -INSTALL(TARGETS stats_scan RUNTIME DESTINATION bin COMPONENT tools) +INSTALL(TARGETS stats_scan RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) diff --git a/code/ryzom/tools/translation_tools/CMakeLists.txt b/code/ryzom/tools/translation_tools/CMakeLists.txt index ddb048f65..29cdd78de 100644 --- a/code/ryzom/tools/translation_tools/CMakeLists.txt +++ b/code/ryzom/tools/translation_tools/CMakeLists.txt @@ -6,7 +6,7 @@ INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(translation_tools ${LIBXML2_LIBRARIES} nelmisc nelligo nelgeorges) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -NL_DEFAULT_PROPS(translation_tools "Ryzom, Tools, Misc: Translation Tools") +NL_DEFAULT_PROPS(translation_tools "Ryzom, Tools, Misc: Translation Tools") NL_ADD_RUNTIME_FLAGS(translation_tools) -INSTALL(TARGETS translation_tools RUNTIME DESTINATION bin COMPONENT tools) +INSTALL(TARGETS translation_tools RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) diff --git a/code/ryzom/tools/translation_tools/extract_bot_names.cpp b/code/ryzom/tools/translation_tools/extract_bot_names.cpp index e8198e63d..4c3268e1f 100644 --- a/code/ryzom/tools/translation_tools/extract_bot_names.cpp +++ b/code/ryzom/tools/translation_tools/extract_bot_names.cpp @@ -507,7 +507,7 @@ int extractBotNames(int argc, char *argv[]) map::iterator first(SimpleNames.begin()), last(SimpleNames.end()); for (; first != last; ++first) { - uint rowIdx; + uint rowIdx = 0; if (!botNames.findRow(botIdCol, first->first, rowIdx)) { // we need to add the entry @@ -524,7 +524,7 @@ int extractBotNames(int argc, char *argv[]) { // set/update the sheet name info // try to restore the existing translation - uint transRowIdx; + uint transRowIdx = 0; if (transBotNames.findRow(transIdCol, first->first, transRowIdx)) { ucstring wkBotName = botNames.getData(rowIdx, ucstring("bot name")); diff --git a/code/snowballs2/client/src/CMakeLists.txt b/code/snowballs2/client/src/CMakeLists.txt index b08ee3a43..0b402f133 100644 --- a/code/snowballs2/client/src/CMakeLists.txt +++ b/code/snowballs2/client/src/CMakeLists.txt @@ -17,4 +17,4 @@ IF(ENABLE_SOUND) TARGET_LINK_LIBRARIES(snowballs_client ${NELSOUND_LIBRARY}) ENDIF(ENABLE_SOUND) -INSTALL(TARGETS snowballs_client RUNTIME DESTINATION bin COMPONENT snowballsclient) +INSTALL(TARGETS snowballs_client RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT snowballsclient) diff --git a/code/web/api/client/config.php.default b/code/web/api/client/config.php.default index 3c8ca869d..6cdbff401 100644 --- a/code/web/api/client/config.php.default +++ b/code/web/api/client/config.php.default @@ -17,4 +17,4 @@ */ // Url where player_auth.php is located -define('RYAPI_AUTH_SCRIPT', ''); +define('RYAPI_AUTH_SCRIPT', ''); \ No newline at end of file diff --git a/code/web/api/client/time.php b/code/web/api/client/time.php new file mode 100644 index 000000000..4b81db42a --- /dev/null +++ b/code/web/api/client/time.php @@ -0,0 +1,46 @@ +. + */ + +$tick_cache_timeout = 60; + +function ryzom_time_tick() { + $fn = RYAPI_URL.'data/cache/game_cycle.ticks'; + $handle = fopen($fn, "r"); + $version = fread($handle, 1); + $raw_tick = fread($handle, 4); + fclose($handle); + $arr = unpack("V", $raw_tick); + $tick = $arr[1]; + return sprintf("%u", $tick & 0xffffffff); +} + + +/** + * Takes a computed ryzom time array and returns a SimpleXMLElement + */ +function ryzom_time_xml($rytime) { + global $tick_cache_timeout; + $out = ryzom_time_xml_without_cache($rytime); + $filename = RYAPI_URL.'data/cache/game_cycle.ticks'; + $cache = $out->addChild('cache'); + $cache->addAttribute('created', filemtime($filename)); + $cache->addAttribute('expire', (filemtime($filename)+$tick_cache_timeout)); + return $out; +} + +?> \ No newline at end of file diff --git a/code/web/api/common/actionPage.php b/code/web/api/common/actionPage.php new file mode 100644 index 000000000..735a33f32 --- /dev/null +++ b/code/web/api/common/actionPage.php @@ -0,0 +1,161 @@ +. + */ + +class ryActionClass { + public $classname; + public $instance; + public $args; + public $requires; + + function __construct($classname, $instance, $args, $requires) { + $this->classname = $classname; + $this->instance = $instance; + $this->args = $args; + $this->requires = $requires; + } + +} + +class ryActionPage { + + private static $classesArgs = array(); + private static $myClasses = array(); + private static $aliases = array(); + private static $messages; + private static $haveMessage; + protected static $id; + + public $instanceName; + public $myMethods = array(); + + function __construct() { + } + + function addMethods($child_class) { + if (is_array($child_class)) { + foreach ($child_class as $c_class) + $this->myMethods = array_merge($this->myMethods, get_class_methods($c_class)); + } else { + $this->myMethods = get_class_methods($child_class); + } + } + + static function addClass($name, $classname, $args=array(), $requires=NULL) { + self::$myClasses[$name] = new ryActionClass($classname, NULL, $args, $requires); + } + + static function addAlias($aliasname, $name) { + self::$aliases[$aliasname] = $name; + } + + static function initInstance($listener) { + $i = self::$myClasses[$listener]; + if (!$i->instance) { + // requires + if ($i->requires) { + self::initInstance($i->requires); + } + if ($i->args) + $i->instance = new $i->classname($listener, $i->args); + else + $i->instance = new $i->classname($listener); + $i->instance->addMethods($i->classname); + $i->instance->instanceName = $listener; + + } + return $i->instance; + } + + static function getInstance($listener) { + return self::initInstance($listener); + } + + static function _addMSG($type='OK', $message='') { + self::$messages[] = array($type, $message); + return ''; + } + + function addMSG($type='OK', $action='', $message='') { + self::$messages[] = array($type, $message); + $this->haveMessage = $action; + return ''; + } + + static function getMSGs() { + return self::$messages; + } + + static function call($action, $url_params) { + $action_params = explode('_', $action); + + if (count($action_params) != 2) + return self::_addMSG('ERR', 'Action call error : bad params of ['.$action.']'); + + list($listener, $call) = $action_params; + if (array_key_exists($listener,self::$aliases)) + $listener = self::$aliases[$listener]; + + if (!array_key_exists($listener, self::$myClasses)) + return self::_addMSG('ERR', 'Action call error : class ['. $listener .'] not found'); + + $i = self::initInstance($listener); + + if (in_array('action'.$call, $i->myMethods)) { + $i->haveMessage = NULL; + $ret = call_user_func(array($i, 'action'.$call), $url_params); + if (!isset($_SESSION['last_action']) or $action != $_SESSION['last_action']) + $_SESSION['last_action'] = $action; + $msg = $i->haveMessage; + if ($msg and ($msg != $action)) { + $ret = self::call($msg, $url_params); + return self::_addMSG('OK', $ret); + } + return self::_addMSG('OK', $ret); + } else + return self::_addMSG('ERR', 'Action call error : action ['. $call .'] of ['. $listener .'] not found'); + } +} + +function callAction($action) { + $c = ''; + ryActionPage::call($action, ryzom_get_params()); + $msgs = ryActionPage::getMSGs(); + + foreach ($msgs as $msg) { + if ($msg[0] == 'HEADER') + $c .= $msg[1]; + } + + foreach ($msgs as $msg) { + if ($msg[0] == 'ERR') + $c .= _s('message error', $msg[1]); + else if ($msg[0] == 'MSG') + $c .= _s('message', $msg[1]); + else if ($msg[0] == 'WARNING') + $c .= _s('message warning', $msg[1]); + else if ($msg[0] != 'HEADER') + $c .= $msg[1]; + } + return $c; +} + + + + +?> diff --git a/code/web/api/common/auth.php b/code/web/api/common/auth.php index 1d52c5d8e..3f06d28d5 100644 --- a/code/web/api/common/auth.php +++ b/code/web/api/common/auth.php @@ -1,37 +1,94 @@ . + */ + + +function ryzom_app_authenticate(&$user, $ask_login=true, $welcome_message='', $webprivs=true) { $name = ryzom_get_param('name'); - $authserver = ryzom_get_param('authserver'); - $authkey = ryzom_get_param('authkey'); + $urluser = ryzom_get_param('user'); // user serialization send by auth server + $urlusercheksum = ryzom_get_param('checksum'); // user serialization checksum + $authkey = ryzom_get_param('authkey'); // InGame authkey $lang = ryzom_get_param('lang'); - $cid = ryzom_get_param('cid', ''); - $is_ingame = false; + $cid = intval(ryzom_get_param('cid')); + $is_auth_ingame = false; // we have to set the $user['lang'] even for anonymous user or we cannot display the test in the right langage if($lang == '') { - $l = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); - if($l=='fr'||$l=='en'||$l=='de'||$l=='ru'||$l=='es') + $l = isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])?substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2):'en'; + if ($l=='fr'||$l=='en'||$l=='de'||$l=='ru'||$l=='es') $lang = $l; else $lang = 'en'; } + if ($lang!='fr'&&$lang!='en'&&$lang!='de'&&$lang!='ru'&&$lang!='es') + $lang = 'en'; + $user['message'] = ''; $user['lang'] = $lang; - $user['ig'] = false; - - if ((isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'Ryzom')) || ryzom_get_param('ig')) { + $user['groups'] = array(); + + if ((isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'Ryzom')) || ryzom_get_param('ig')) $user['ig'] = true; + else + $user['ig'] = false; + + if (isset($_SESSION['user'])) { + if (ryzom_get_param('action') == 'logout') + unset($_SESSION['user']); + else { + $_SESSION['user']['ig'] = $user['ig']; + define('RYZOM_IG', $user['ig']); + $user = $_SESSION['user']; + return true; + } + } + + if ($urluser && $urlusercheksum) { + // Check $authuser (used to test app from another server ingame) + if (hash_hmac('sha1', $urluser, RYAPI_AUTH_KEY) == $urlusercheksum) { + $ig = $user['ig']; + $user = array_merge($user, unserialize(base64_decode($urluser))); + $user['ig'] = $ig; + if (!isset($user['groups'])) + $user['groups'] = array(); + define('RYZOM_IG', $user['ig']); + $_SESSION['user'] = $user; + return true; + } + } + + if ($user['ig']) { // Ingame $shardid = ryzom_get_param('shardid'); - if (!ryzom_authenticate_ingame($shardid, $cid, $name, $authkey)) - return false; - $is_ingame = true; + $error_message = ''; + if (ryzom_authenticate_ingame($shardid, $cid, $name, $authkey) || ryzom_authenticate_with_session($name, $cid, $error_message)) { + $is_auth_ingame = true; + } } else { - // Outgame : Use session + // Outgame or bad ingame auth (external server) : Use session $error_message = ''; if (!ryzom_authenticate_with_session($name, $cid, $error_message)) { + define('RYZOM_IG', false); if ($ask_login) { - $c = ''; + + if ($error_message) + $c = '

'._t($error_message).'

'; + else + $c = ''; if (!$welcome_message) $welcome_message = 'The application '._t(APP_NAME).' require authentication. Please enter your credentials'; @@ -47,18 +104,40 @@ function ryzom_app_authenticate(&$user, $ask_login=true, $welcome_message='') { } } - if ($lang) - $_SESSION['lang'] = $lang; + $_SESSION['lang'] = $lang; + define('RYZOM_IG', $user['ig']); // get user informations - $user = ryzom_user_get_info($cid); - $user['lang'] = $_SESSION['lang']; + $ig = $user['ig']; + $user = ryzom_user_get_info($cid, $webprivs); + if (isset($user['creation_date'])) - $user['id'] = ryzom_get_user_id($cid, $user['char_name'], $user['creation_date']); - if ($is_ingame && $user['last_played_date'] != '0') - $user['ig'] = true; + $user['id'] = ryzom_get_user_id($cid, $user['char_name'], $user['creation_date'], $user); + + $user['ig'] = $ig; + $user['lang'] = $_SESSION['lang']; + if (!isset($user['groups'])) + $user['groups'] = array(); + + if ($is_auth_ingame && $user['last_played_date'] != '0') + $user['auth_ig'] = true; else - $user['ig'] = false; + $user['auth_ig'] = false; + + if (!isset($_SESSION['translater_mode']) || ryzom_get_param('translate_this') == '0') + $_SESSION['translater_mode'] = false; + + // Set/unset translation mode + if (in_array('WTRS', $user['groups']) && ryzom_get_param('translate_this') == '1') + $_SESSION['translater_mode'] = true; + + $user['translation_mode'] = $_SESSION['translater_mode']; + + ryzom_unset_url_param('translate_this'); + + if (isset($user['last_played_date'])) + $_SESSION['last_played_date'] = $user['last_played_date']; + // don't send this informations to external apps unset($user['last_played_date']); unset($user['creation_date']); return true; diff --git a/code/web/api/common/bbCode.php b/code/web/api/common/bbCode.php new file mode 100644 index 000000000..e45dfadb9 --- /dev/null +++ b/code/web/api/common/bbCode.php @@ -0,0 +1,988 @@ +. + */ + +// setup bbCode formatter + +bbCode::$ig = RYZOM_IG; + +/** + * Image proxy + */ +if(!defined('IMG_PROXY')){ + $url = 'http://'.$_SERVER['HTTP_HOST'].'/app_forum/tools/imageproxy.php'; + define('IMG_PROXY', $url); +} +if (!function_exists('proxy_image_url')) { + function proxy_image_url($href, $attrs=''){ + return IMG_PROXY.'?'.($attrs != '' ? $attrs.'&' : '').'url='.urlencode($href); + } +} + + +abstract class bbCodeParser { + + /** + * @var bool + */ + private $_ig; + + /** + * @var array + */ + private $tags_ignore; + private $tags_block_open; + private $tags_block_close; + private $tags_ignore_depth; + + /** + * @var array + */ + private $open_tags; + + /** + * @var string + */ + private $last_closed_tag; + + /** + * @var int + */ + private $current_tag; + + /** + * @var array + */ + private $state; + + /** + * @param bool $ig if true, use ingame markup + */ + function __construct($ig) { + $this->_ig = $ig; + + // ignore bbcode between these tags + $this->tags_ignore = array( + 'noparse', 'code', + 'url', 'img', 'mail', 'page', 'forum', 'topic', 'post', 'wiki', 'time', 'date' + ); + + // these create block level html code, so '\n' or ' ' or '\t' around them needs to be cleared + $this->tags_block_open = array('h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'quote', 'list', 'p'); + $this->tags_block_close = $this->tags_block_open; + if ($this->_ig) { + // ingame

is not block level when closing, so dont strip there + $key = array_search('p', $this->tags_block_close, true); + unset($this->tags_block_close[$key]); + } + + $this->state = array(); + + // reset internals + $this->reset(); + } + + /** + * Format bbcode tag + * + * @param string $tag tag name + * @param string $open open markup + * @param string $close close markup + * @param string $attr tag attributes + * @param string $text text between tags + */ + abstract function format($tag, $open, $close, $attr, $text); + + /** + * Wrapper to call Child->format(...) + * + * @param array $tag assoc array with tag info + * @return string + */ + function handle_tag($tag) { + return $this->format($tag['tag'], $tag['open'], $tag['close'], $tag['attr'], $tag['text']); + } + + /** + * Reset internals + */ + function reset() { + $this->current_tag = 0; + $this->tags_ignore_depth = 0; + + // 0'th position is used as result + $this->open_tags = array( + 0 => array('tag' => '', 'open' => '', 'close' => '', 'attr' => '', 'text' => '') + ); + + $this->last_closed_tag = false; + } + + /** + * Save working state + */ + private function _state_save() { + $this->state[] = array($this->current_tag, $this->tags_ignore_depth, $this->open_tags, $this->last_closed_tag); + $this->reset(); + } + + /** + * Restore working state + */ + private function _state_restore() { + if (!empty($this->state)) { + list($this->current_tag, $this->tags_ignore_depth, $this->open_tags, $this->last_closed_tag) = array_pop($this->state); + } + } + + /** + * Main worker. Parse $text for bbCode tags + * + * NOTE: Text must already be safe for HTML, ie. treated with htmlspecialchars() + * + * @param string $text + * @return string formatted string + */ + function bbcode($text) { + $text = str_replace("\r\n", "\n", $text); + + $split = preg_split('/(\[[a-zA-Z0-9_\/]*?(?:[= ].*?)?\])/', $text, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); + + foreach ($split as $chunk) { + if (substr($chunk, 0, 1) == '[' && substr($chunk, -1, 1) == ']') { + if (substr($chunk, 0, 2) == '[/') { + $this->close($chunk); + } else { + $this->open($chunk); + } + } else { + $this->text($chunk); + } + } + + return $this->result(); + } + + /** + * Push tag with args to stack + * Do not strip whitespace because tag might be invalid + * + * @param string $chunk full tag string, eg. [tag=attr] + */ + function open($chunk) { + list($tag, $attr) = $this->split_params($chunk); + + // test for [noparse] + if ($this->tags_ignore_depth > 0) { + $this->text($chunk); + } else { + $this->current_tag++; + // remember tag, attributes and complete string that was used in markup + $this->open_tags[$this->current_tag] = array('tag' => $tag, 'attr' => $attr, 'open' => $chunk, 'close' => '', 'text' => ''); + } + + if (in_array($tag, $this->tags_ignore)) { + $this->tags_ignore_depth++; + } + } + + /** + * Close tag and call tag handler to format output + * + * @param $chunk full tag string, eg. [/tag] + */ + function close($chunk) { + // extract tag name from [/name] + $tag = strtolower(substr($chunk, 2, -1)); + + if ($this->tags_ignore_depth > 0 && in_array($tag, $this->tags_ignore)) { + $this->tags_ignore_depth--; + } + + // stack underrun + if ($this->current_tag < 0) { + $this->text($chunk); + return; + } + + // ignore block + if ($this->tags_ignore_depth > 0) { + $this->text($chunk); + return; + } + + // tag mismatch + if ($this->open_tags[$this->current_tag]['tag'] !== $tag) { + // try to find first open tag for this + $key = false; + for ($i = $this->current_tag - 1; $i > 0; $i--) { + if (isset($this->open_tags[$i]['tag']) && $this->open_tags[$i]['tag'] === $tag) { + $key = $i; + break; + } + } + if ($key === false) { + $this->text($chunk); + return; + } + + // tag is open so we need to 'rewind' a bit + for ($i = $this->current_tag; $i > $key; $i--) { + $tmp_tag = $this->pop_stack(); + $this->text($tmp_tag['open'] . $tmp_tag['text']); + } + } + + // close tag + $open = $this->pop_stack(); + + // handle bbcode + $open['close'] = $chunk; + + $block_level = false; + if (in_array($tag, $this->tags_block_open)) { + $block_level = true; + // for block level element, trim whitespace from inside tag + // [tag]...text...[/tag] + $open['text'] = $this->trim_ws($open['text']); + } + $result = $this->handle_tag($open); + + // strip whitespace from text before tag 'text...[tag]' + if ($block_level) { + $ts = $this->rtrim_ws($this->open_tags[$this->current_tag]['text']); + $this->open_tags[$this->current_tag]['text'] = $ts; + } + + $this->text($result); + + $this->last_closed_tag = $open['tag']; + } + + function text($text) { + // strip whitespace after closing '[/tag]...text' + if (in_array($this->last_closed_tag, $this->tags_block_close)) { + $text = $this->ltrim_ws($text); + } + $this->open_tags[$this->current_tag]['text'] .= $text; + + $this->last_closed_tag = false; + } + + function result() { + // close tags that are still open + while ($this->current_tag > 0) { + $open = $this->pop_stack(); + + if ($this->tags_ignore_depth > 0) { + $this->tags_ignore_depth--; + // need to reparse text that's after ignore tag + $this->_state_save(); + $text = $open['open'] . $this->bbcode($open['text']); + $this->_state_restore(); + } else { + // tag was not closed proprely, include start tag with result + $text = $open['open'] . $open['text']; + } + + $this->text($text); + }; + + return $this->open_tags[0]['text']; + } + + /** + * Pop tag and text from stack and return them + * + * @return array [0] = tag, [1] = text + */ + function pop_stack() { + // remove from stack + $open = $this->open_tags[$this->current_tag]; + unset($this->open_tags[$this->current_tag]); + $this->current_tag--; + + return $open; + } + + /** + * Trim from end of string + * 'text...\s{0,}\n{1}\s{0,}' + * + * @param string $ts + * @return string + */ + function rtrim_ws($ts){ + // we want to get rid of all spaces/tabs, but only single \n, so rtrim($ts, " \t\n\r") would not work + $ts = rtrim($ts, " \t"); + if (substr($ts, -1, 1) === "\n") { + $ts = substr($ts, 0, -1); + $ts = rtrim($ts, " \t"); + } + return $ts; + } + + /** + * Trim from start of string + * '\s{0,}\n{1}...text' + * + * @param string $ts + * @return string + */ + function ltrim_ws($ts){ + // we want to get rid of all spaces/tabs, but only single \n, so ltrim($ts, " \t\n\r") would not work + $ts = ltrim($ts, " \t"); + if (substr($ts, 0, 1) === "\n") { + $ts = substr($ts, 1); + } + return $ts; + } + + /** + * Trim from both sides + * '\s{0,}\n{1}...text...\s{0,}\n{1}\s{0,} + * + * @param string $ts + * @return string + */ + function trim_ws($ts){ + $ts = $this->ltrim_ws($ts); + $ts = $this->rtrim_ws($ts); + return $ts; + } + + /** + * Extract tag parameters from [tag=params] or [tag key1=val1 key2=val2] + * + * @param type $tag + * @return type + */ + function split_params($chunk) { + if (substr($chunk, 0, 1) == '[') { + $b = '\['; + $e = '\]'; + } else { + $b = ''; + $e = ''; + } + // [1] [2] [3] + if (preg_match('/^' . $b . '([\*a-zA-Z0-9]*?)' . '(=| )' . '(.*?)' . $e . '$/', $chunk, $match)) { + $tagName = strtolower($match[1]); + if ($match[2] == '=') { + // = means single parameter + $tagParam = $match[3]; + } else { + // means multiple parameters + $tagParam = array(); + $args = preg_split('/[ ]/', $match[3], null, PREG_SPLIT_NO_EMPTY); + foreach ($args as $arg) { + $pairs = explode('=', $arg); + // preg_replace will remove possible quotes around value + if (isset($pairs[1])) { + $tagParam[strtolower($pairs[0])] = preg_replace('@("|\'|)(.*?)\\1@', '$2', $pairs[1]); + } else { + $tagParam[] = preg_replace('@("|\'|)(.*?)\\1@', '$2', $pairs[0]); + } + } + } + } else { + if (substr($chunk, 0, 1) == '[' && substr($chunk, -1, 1) == ']') { + $chunk = substr($chunk, 1, -1); + } + $tagName = strtolower($chunk); + $tagParam = ''; + } + return array($tagName, $tagParam); + } + +} + +class bbCode extends bbCodeParser { + static $legacy_sync = 1348956841; + static $legacy_shard = array( + 'ani' => 2363920179, + 'lea' => 2437578274, + 'ari' => 2358620001, + ); + + static $ig = false; + static $timezone = 'UTC'; + static $clock12h = false; + static $shardid = false; + static $lang = 'en'; + static $disabledTags = array(); + // + const COLOR_P = '#d0d0d0'; // normal text + // + const COLOR_BBCODE_TAG = '#444444'; + + static function bbDisabled($tag) { + return in_array(strtolower($tag), self::$disabledTags); + } + + static function getFontSize($value) { + $size = 16; + switch (strtolower($value)) { + case '1': case 'xx-small': $size = 9; break; + case '2': case 'x-small' : $size = 10; break; + case '3': case 'small' : $size = 13; break; + case '4': case 'medium' : $size = 16; break; + case '5': case 'large' : $size = 18; break; + case '6': case 'x-large' : $size = 24; break; + case '7': case 'xx-large': $size = 32; break; + //case '8': case 'smaller' : break; + //case '9': case 'larger' : break; + } + return $size; + } + + static function bb_noparse($code) { + return preg_replace(array('/\[/', '/\]/'), array('[', ']'), $code); + } + + static function bb_code($code) { + return '

' . self::bb_noparse($code) . '
'; + } + + static function bb_list($list) { + $result = ''; + $list = str_replace("\n[", '[', $list); + $result = '
    ' . preg_replace('/\s*\[\*\]\s*/is', "
  • ", $list) . '
'; + return preg_replace('#
    \s*#is', '
      ', $result); + } + + static function bb_quote($author, $text) { + if (self::$ig) { + // prevents [color] tag to take over color + $author = self::bb_color(self::COLOR_P, $author); + $text = self::bb_color(self::COLOR_P, $text); + // left/right border, top/bottom border height + $l = ''; + $r = ''; + return // 98% gives bit padding on the right + '' . + '' . // top padding - no border + '' . $l . '' . $r . '' . // top border + '' . $l . '' . $r . '' . // author top padding + '' . $l . '' . $r . '' . // author + '' . $l . '' . $r . '' . // author bottom padding + '' . $l . '' . $r . '' . // quote top padding + '' . $l . '' . $r . '' . // quote + '' . $l . '' . $r . '' . // quote bottom padding + '' . $l . '' . $r . '' . // bottom border + '' . // bottom padding - no border + '
      ' . $author . '
      ' . $text . '
      '; + } else { + return '' . + '
      ' . + '' . $author . '' . + '
      ' . $text . '
      ' . + '
      '; + } + } + + static function bb_h($nr, $color, $text) { + $tag = 'h' . $nr; + + if (self::$ig) { + if ($color != '') { + $text = '' . $text . ''; + } + return '<' . $tag . '>' . $text . ''; + } else { + if ($color != '') { + $style = ' style="color: ' . $color . ';"'; + } else { + $style = ''; + } + return '<' . $tag . $style . '>' . $text . ''; + } + } + + static function bb_url($href, $text) { + // "http://..../" remove " if present + if (substr($href, 0, 6) == '"') { + if (substr($href, -6) == '"') { + $href = substr($href, 6, -6); + } else { + $href = substr($href, 6); + } + } + + if ($href == '') + $href = $text; + if ($text == '') { + $text = $href; + $text = wordwrap($text, 65, ' ', true); + } + + $disable = self::bbDisabled('url'); + // if not disabled and in ryzom and is proper url (:///) + if (!$disable && self::$ig) { + $url = @parse_url(strtolower($href)); + $disable = true; + if (!empty($url['scheme']) && !empty($url['host'])) { + if (in_array($url['scheme'], array('http', 'https'))) { + if (in_array($url['host'], array('app.ryzom.com'))) { + if (empty($url['query']) || stripos($url['query'], 'redirect') === false) { + // http://atys.ryzom.com/ + // and does not contain redirect + // - allow url in game browser + $disable = false; + } + } + } + } // !empty + }// isRYZOM + + if ($disable) { + // empty href will give proper link color without 'underline' - perfect for 'disabled' links + if ($href == '') { + $text = '' . $text . ''; + } else { + $href = wordwrap($href, 65, ' ', true); + $text = wordwrap($text, 65, ' ', true); + $text = '' . $text . ' ' . self::bb_color(self::COLOR_BBCODE_TAG, '(' . $href . ')'); + } + return $text; + } + + // make sure http:// (or ftp:// or mailto:// etc is present), if not, add it + if (!preg_match('#://#', $href)) { + $href = 'http://' . $href; + } + + return sprintf('%s', $href, $text); + } + + static function bb_img($attr, $href) { + if (self::bbDisabled('img')) { + return self::bb_noparse('[img]' . $href . '[/img]'); + } + // $href is treated with htmlspecialchars() so any & in url is & + $href = str_replace('&', '&', $href); + + // images from current server directly + if ($attr=='src' || strstr($href, $_SERVER['HTTP_HOST']) !== false){ + return ''; + } + $url = proxy_image_url($href); + return ''; + } + + static function bb_banner($lang, $ckey) { + // $lang and $ckey should already be escaped for HTML, so urlencode() in here would double escape them + // - channel it thru image proxy. proxy does caching better and uses '304 Not Modified' status + $src = 'http://atys.ryzom.com/api/banner.php?ckey=' . $ckey . '&langid=' . $lang . '&size=500'; + return self::bb_img('', $src); + } + + static function bb_mail($user) { + $url = 'http://' . $_SERVER['HTTP_HOST'] . '/app_mail/?page=compose/to/' . urlencode($user); + return '' . $user . ''; + } + + static function bb_profile($ptype, $pname) { + // types from app_profile + $types = array('user', 'player', 'npc', 'fauna', 'entity', 'source'); + $ptype = array_search($ptype, $types, true); + // if type not found, then fall back to player + if ($ptype === false) + $ptype = 1; + + $url = 'http://' . $_SERVER['HTTP_HOST'] . '/app_profile/?ptype=' . intval($ptype) . '&pname=' . urlencode($pname); + return '' . $pname . ''; + } + + static function bb_color($color, $str) { + if ($color == '') { + return $str; + } + + if (self::$ig) { + return '' . $str . ''; + } else { + return '' . $str . ''; + } + } + + static function bb_size($size, $str) { + $size = self::getFontSize($size); + + if (self::$ig) { + return '' . $str . ''; + } else { + return '' . $str . ''; + } + } + + static function bb_pre($str) { + return '
      ' . $str . '
      '; + } + + static function bb_p($str) { + return '

      ' . $str . '

      '; + } + + // Added by ulukyn. WebIg compatibility. + static function bb_center($str) { + if (self::$ig) { + return '
      ' . $str . '
      '; + } else { + return '
      ' . $str . '
      '; + } + } + + /** Table format : (added by ulukyn) + * A1| A2|A3 + * B1| B2 |B3 + * C1|C2 |C3 + */ + static function bb_table($attr, $content) { + $width = isset($attr['width'])?$attr['width']:'100%'; + $border = isset($attr['border'])?$attr['border']:'0'; + $bgcolor = isset($attr['bgcolor'])?' bgcolor="'.$attr['bgcolor'].'" ':''; + $ret = ''; + $lines = explode("\n", $content); + foreach ($lines as $line) { + if ($line) { + $ret .= ''; + $cols = explode('|', $line); + foreach ($cols as $text) { + if (!$text) + continue; + $params = array('valign' => 'middle'); + if ($text[0] == '#') { + $paramsdef = explode(' ', $text); + $paramlist = substr(array_shift($paramsdef), 1); + $paramlist = explode(',', $paramlist); + foreach ($paramlist as $p) { + list($name, $value) = explode('=', $p); + $params[ _h(str_replace('"', '', $name))] = _h(str_replace('"', '', $value)); + } + if ($paramsdef) + $text = implode(' ', $paramsdef); + } + $param_html = ''; + foreach ($params as $name => $value) + $param_html .= $name.'="'.$value.'" '; + + if ($text && $text[0] == ' ' && $text[strlen($text)-1] == ' ') + $align = 'center'; + else if ($text && $text[0] == ' ') + $align = 'right'; + else + $align = 'left'; + + $ret .= ''; + } + $ret .= ''; + } + } + + $ret .= '
      '.$text.'
      '; + return $ret; + } + + + static function bb_page_link($page, $txt) { + if ($page == '') { + $page = $txt; + } + $tmp = explode('/', $page); + foreach ($tmp as $k => $v) { + $tmp[$k] = urlencode($v); + } + $url = 'http://' . $_SERVER['HTTP_HOST'] . '/app_forum/?page=' . join('/', $tmp); + return '' . $txt . ''; + } + + static function bb_forum_link($page, $id, $txt) { + $page = $page . '/view/' . $id; + if ($id == '') { + $page.= $txt; + } + return self::bb_page_link($page, $txt); + } + + // Added by Ulukyn + static function bb_wiki_link($page, $txt) { + $need_new_txt = false; + if ($page == '') { + $page = $txt; + $need_new_txt = true; + } + + if (substr($page, 0, 22) == 'http://atys.ryzom.com/') + $url = 'http://atys.ryzom.com/start/app_wiki.php?page=' . substr($page, 21); + else { + $tmp = explode('/', $page); + if (count($tmp) != 2) { + return 'Syntax: [wiki]/[page], ex: en/Chronicles'; + } else { + $wiki = $tmp[0]; + $page = $tmp[1]; + } + if (self::$ig) { + $url = 'http://atys.ryzom.com/start/app_wiki.php?page=/projects/pub' . $wiki . '/wiki/' . $page; + } + else + $url = 'http://atys.ryzom.com/projects/pub' . $wiki . '/wiki/' . $page; + if ($need_new_txt) + $txt = 'WIKI [' . $page . ']'; + } + return '' . $txt . ''; + } + + static function bb_biu($tag, $txt) { + $tag = strtolower($tag); + if (self::$ig) { + switch ($tag) { + // FIXME: darken/lighter or tint current color + case 'b': $txt = self::bb_color('white', $txt); + break; + case 'i': $txt = self::bb_color('#ffffd0', $txt); + break; + case 'u': $txt = '' . self::bb_color(self::COLOR_P, $txt) . ''; + break; + default : $txt = self::bb_color(self::COLOR_BBCODE_TAG, $txt); + break; // fallback + } + return $txt; + } + + switch ($tag) { + case 'b': $tag = 'strong'; + break; + case 'i': $tag = 'em'; + break; + case 'u': $tag = 'u'; + break; + default: $tag = 'span'; // fallback + } + return '<' . $tag . '>' . $txt . ''; + } + + static function bb_date($attr, $txt) { + $time = strtotime($txt); + + $shardid = isset($attr['shard']) ? $attr['shard'] : self::$shardid; + if ($time === false || $shardid === false) + return 'ERR:[' . $txt . ']'; + + if (isset(self::$legacy_shard[$shardid])) { + $tick = self::$legacy_shard[$shardid]; + if (self::$legacy_sync > $time) { + // only modify game cycle when asked time is before sync + $tick = ($time - self::$legacy_sync) * 10 + $tick; + } + } else { + $tick = ryzom_time_tick($shardid); + // tick is for NOW, adjust it to match time given + $now = time(); + $tick = ($time - $now) * 10 + $tick; + } + + $rytime = ryzom_time_array($tick, $shardid); + $txt = ryzom_time_txt($rytime, self::$lang); + + return $txt; + } + + static function bb_time($options, $txt) { + $time = strtotime($txt); + + if ($time == 0) { + return $txt; + } + + $timezone = self::$timezone; + + $show_time = ''; + $show_date = ''; + $show_timer = ''; + + if (is_array($options)) { + foreach ($options as $key => $val) { + switch ($key) { + case 'timezone': + // fix some timezones for php + switch ($val) { + case 'pst': // fall thru + case 'pdt': $val = 'US/Pacific'; + break; + } + $timezone = $val; + break; + case 'date' : + $show_date = $val == 'off' ? false : $val; + break; + case 'time' : + $show_time = $val == 'off' ? false : $val; + break; + case 'timer': + $show_timer = $val == 'off' ? false : $val; + break; + }//switch + }//foreach + } + + $ret = array(); + + $old_timezone = date_default_timezone_get(); + @date_default_timezone_set($timezone); + if ($show_date !== false) { + $date = ryzom_absolute_time($time); + //ryzom_absolute_time does not have year, so we need to add it + $current_y = date('Y', time()); + $y = date('Y', $time); + if ($y != $current_y) { + $date.= ' ' . $y; + } + $ret[] = self::bb_color($show_date, $date); + } + if ($show_time !== false) { + $fmtTime = self::$clock12h ? 'g:i:s a T' : 'H:i:s T'; + $ret[] = self::bb_color($show_time, date($fmtTime, $time)); + } + date_default_timezone_set($old_timezone); + + if ($show_timer !== false) { + if ($show_time === false && $show_date === false) { + $f = '%s'; + } else { + $f = '(%s)'; + } + $ret[] = self::bb_color($show_timer, sprintf($f, ryzom_relative_time($time))); + } + + return join(' ', $ret); + } + + /** + * This function is called by bbCodeParser class + * + * @see bbCodeParser::format + */ + public function format($tag, $open, $close, $attr, $text) { + // silly functions all have different parameters + switch ($tag) { + case 'noparse' : + $result = self::bb_noparse($text); + break; + case 'code' : + $result = self::bb_code($text); + break; + case 'quote' : + $result = self::bb_quote($attr, $text); + break; + case 'h1' : // fall thru + case 'h2' : // fall thru + case 'h3' : // fall thru + case 'h4' : // fall thru + case 'h5' : // fall thru + case 'h6' : + $nr = (int) substr($tag, -1); + $color = isset($attr['color']) ? $attr['color'] : ''; + $result = self::bb_h($nr, $color, $text); + break; + case 'color' : + $result = self::bb_color($attr, $text); + break; + case 'size' : + $result = self::bb_size($attr, $text); + break; + case 'list' : + $result = self::bb_list($text); + break; + case 'img' : + $result = self::bb_img($attr, $text); + break; + case 'banner' : + $result = self::bb_banner($attr, $text); + break; + case 'pre' : + $result = self::bb_pre($text); + break; + case 'p' : + $result = self::bb_p($text); + break; + case 'table' : + $result = self::bb_table($attr, $text); + break; + case 'center' : + $result = self::bb_center($text); + break; + case 'url' : + $result = self::bb_url($attr, $text); + break; + case 'mail' : + $result = self::bb_mail($text); + break; + case 'profile' : + $result = self::bb_profile($attr, $text); + break; + case 'page' : + $result = self::bb_page_link($attr, $text); + break; + case 'forum' : // fall thru + case 'topic' : // fall thru + case 'post' : + $result = self::bb_forum_link($tag, $attr, $text); + break; + case 'wiki' : + $result = self::bb_wiki_link($attr, $text); + break; + case 'b' : // fall thru + case 'i' : // fall thru + case 'u' : + $result = self::bb_biu($tag, $text); + break; + case 'time' : + $result = self::bb_time($attr, $text); + break; + case 'date' : + $result = self::bb_date($attr, $text); + break; + default : + $result = $open . $text . $close; + break; + } + return $result; + } + + /** + * Replaces some BBcode with HTML code + * + * NOTE: $text should be already escaped for HTML + * + * @param string $text html escaped input text + * @param array $disabledTags + */ + static function parse($text, $disabledTags = array()) { + static $parser = null; + if ($parser === null) { + $parser = new self(self::$ig); + } + $parser->reset(); + + self::$disabledTags = $disabledTags; + return $parser->bbcode($text); + } + +} diff --git a/code/web/api/common/config.php.default b/code/web/api/common/config.php.default index 3a00bb04e..35202ae29 100644 --- a/code/web/api/common/config.php.default +++ b/code/web/api/common/config.php.default @@ -17,6 +17,8 @@ * along with ryzom_api. If not, see . */ + define('RYAPI_MODE', 'client'); + // Url where the api is define('RYAPI_URL', 'http://'); if (!defined('RYAPI_PATH')) @@ -24,5 +26,6 @@ if (!defined('RYAPI_PATH')) // used by "home" link if (!defined('RYAPP_URL')) define('RYAPP_URL', 'http://'); - +if (!defined('RYAPI_AUTH_KEY')) + define('RYAPI_AUTH_KEY', ''); // key gived by AUTH_SERVER ?> diff --git a/code/web/api/common/db_defs.php b/code/web/api/common/db_defs.php new file mode 100644 index 000000000..e2d9536ab --- /dev/null +++ b/code/web/api/common/db_defs.php @@ -0,0 +1,24 @@ +. + */ + +// init database table used by webig +$db = ryDB::getInstance('webig'); +$db->setDbDefs('players', array('id' => SQL_DEF_INT, 'cid' => SQL_DEF_INT, 'name' => SQL_DEF_TEXT, 'creation_date' => SQL_DEF_DATE, 'deleted' => SQL_DEF_BOOLEAN, 'last_login' => SQL_DEF_TEXT)); +$db->setDbDefs('accounts', array('uid' => SQL_DEF_INT, 'web_privs' => SQL_DEF_TEXT)); + +?> \ No newline at end of file diff --git a/code/web/api/common/db_lib.php b/code/web/api/common/db_lib.php index c3c7e8677..8d8dc936a 100644 --- a/code/web/api/common/db_lib.php +++ b/code/web/api/common/db_lib.php @@ -43,91 +43,96 @@ class ServerDatabase } if (($this->hostname != '') && ($this->username != '') && ($this->database != '')) - { - $this->_connection = mysql_connect($this->hostname, $this->username, $this->password) - or die("ERR1"); // ace . $this->get_error()); - $this->select_db($this->database); - } + $this->_connection = new mysqli($this->hostname, $this->username, $this->password, $this->database); } function close() { - @mysql_close($this->_connection); + $this->_connection->close(); } function query($sql_statement) { - $result = mysql_query($sql_statement, $this->_connection); + $result = $this->_connection->query($sql_statement); + if (!$result) + alert('MYSQL', $this->get_error(), 2); return $result; } function select_db($dbname) { $this->database = $dbname; - mysql_select_db($this->database, $this->_connection) or die("Database selection error : " . $this->get_error()); + $this->_connection->select_db($dbname); } function num_rows($result) { - return @mysql_num_rows($result); + return $result->num_rows; } - function fetch_row($result, $result_type=MYSQL_BOTH) + function fetch_row($result, $result_type=MYSQLI_BOTH) { - return @mysql_fetch_array($result, $result_type); + if (gettype($result) == "object") + return $result->fetch_array($result_type); + return NULL; } - + function fetch_assoc($result) { - return @mysql_fetch_array($result, MYSQL_ASSOC); + if (gettype($result) == "object") + return $result->fetch_assoc(); + return NULL; } - function query_single_row($sql_statement) { $result = $this->query($sql_statement); - return @mysql_fetch_array($result); + if (gettype($result) == "object") + return $result->fetch_array(); + + return NULL; } function free_result($result) { - @mysql_free_result($result); + $result->free(); } function get_error() { - return mysql_errno($this->_connection) .": ". mysql_error($this->_connection); + return $this->_connection->errno.': '.$this->_connection->error; } function last_insert_id() { - return @mysql_insert_id(); + return $this->_connection->insert_id; + } + + function escape_string($escapestr) { + return $this->_connection->real_escape_string($escapestr); } function change_to($host,$user,$pass,$dbname) { - $this->close(); + /*$this->close(); $this->hostname = $host; $this->username = $user; $this->password = $pass; $this->database = $dbname; - $this->ServerDatabase(); + $this->ServerDatabase();*/ } } - - - class ryDB { private static $_instances = array(); private $db; private $defs = array(); private $errors = ''; - - + + private function __construct($db_name) { global $_RYZOM_API_CONFIG; - + $this->db_name = $db_name; $this->db = new ServerDatabase(RYAPI_WEBDB_HOST, RYAPI_WEBDB_LOGIN, RYAPI_WEBDB_PASS, $db_name); $this->db->query("SET NAMES utf8"); } @@ -140,20 +145,41 @@ class ryDB { return self::$_instances[$db_name]; } - function setDbDefs($table, $defs) { + function setDbDefs($table, $defs, $check=true) { + if ($check) + { + $result = $this->db->query('SHOW FIELDS FROM '.$table); + if (!$result) + die("Table $table not found in database"); + + $fields = array_keys($defs); + while ($row = $this->db->fetch_row($result)) { + if (in_array($row['Field'], $fields)) + unset($fields[array_search($row['Field'], $fields)]); + else + alert('DbLib', 'Missing field '.$row['Field']." on DbDef of table [$table] of database [$this->db_name] !", 2); + } + if ($fields) + die('Missing fields ['.implode('] [', $fields)."] in table [$table] of database [$this->db_name] !"); + } $this->defs[$table] = $defs; } - + function getDefs($table) { - if (!array_key_exists($table, $this->defs)) - die("Please add tables defs using setDbDefs('$table', \$defs)"); - return $this->defs[$table]; + if ($this->hasDbDefs($table)) + return $this->defs[$table]; + + alert('DBLIB', "Please add tables to '$this->db_name' defs using setDbDefs('$table', \$defs)", 2); + } + + function hasDbDefs($table) { + return array_key_exists($table, $this->defs); } - + function getErrors() { return $this->db->get_error(); } - + function now() { return date('Y-m-d H:i:s', time()); } @@ -169,18 +195,43 @@ class ryDB { function addDbTableProp($table, $props) { $this->props[$table] = $props; } - + + function sqlEscape($escapestr) { + return $this->db->escape_string($escapestr); + } + + function insertID() { + return $this->db->last_insert_id(); + } + + /// DIRECT QUERY - function sqlQuery($sql) { + function sqlQuery($sql, $index = false, $result_type = MYSQLI_BOTH) { $result = $this->db->query($sql); + if (!$result) + return NULL; + if($index !== false && !is_array($index)){ + $index = array($index); + } $ret = array(); - while ($row = $this->db->fetch_row($result)) { - $ret[] = $row; + while ($row = $this->db->fetch_row($result, $result_type)) { + if($index !== false) { + // if $index is ['id1', 'id2'], then this code executes as + // $ret[$row['id1']][$row['id2']] = $row + $current = &$ret; + foreach($index as $key){ + if(!isset($row[$key])) + alert('DBLIB', "Requested index field ($key) was not selected from db"); + $current = &$current[$row[$key]]; + } + $current = $row; + } else + $ret[] = $row; } return $ret; } - - + + /// QUERY /// function sqlSelect($table, $props, $values=array(), $extra='') { if ($table) { @@ -188,16 +239,16 @@ class ryDB { $params = array(); $test = array(); if (!$props) - die("Bad Select on [$table] : missing props"); - + alert('DBLIB', "Bad Select on [$table] : missing props"); + foreach($props as $name => $type) - $params[] = '`'.addslashes($name).'`'; - + $params[] = '`'.$this->sqlEscape($name).'`'; + foreach($values as $name => $value) { if ($name[0] == '=') - $test[] = '('.addslashes(substr($name, 1)).' LIKE '.var_export($value, true).')'; + $test[] = '('.$this->sqlEscape(substr($name, 1)).' LIKE '.var_export($value, true).')'; else - $test[] = '('.addslashes($name).' = '.var_export($value, true).')'; + $test[] = '('.$this->sqlEscape($name).' = '.var_export($value, true).')'; } $sql .= implode(",\n\t", $params)."\nFROM\n\t".$table."\n"; if ($test) @@ -209,39 +260,37 @@ class ryDB { return $sql.';'; } - + function querySingle($table, $values=array(), $extra='') { $sql = $this->sqlSelect($table, $this->getDefs($table), $values, $extra); - $result = $this->db->query($sql); - return $this->db->fetch_row($result); + $result = $this->sqlQuery($sql, false, MYSQLI_BOTH); + if(empty($result)) + return NULL; + return $result[0]; } - + function querySingleAssoc($table, $values=array(), $extra='') { $sql = $this->sqlSelect($table, $this->getDefs($table), $values, $extra); - $result = $this->db->query($sql); - return $this->db->fetch_row($result, MYSQL_ASSOC); + $result = $this->sqlQuery($sql, false, MYSQLI_ASSOC); + if(empty($result)) + return NULL; + return $result[0]; } - - function query($table, $values=array(), $extra='') { + + function query($table, $values=array(), $extra='', $index = false, $result_type = MYSQLI_BOTH) { $sql = $this->sqlSelect($table, $this->getDefs($table), $values, $extra); - $result = $this->db->query($sql); - $ret = array(); - while ($row = $this->db->fetch_row($result)) { - $ret[] = $row; - } - return $ret; + return $this->sqlQuery($sql, $index, $result_type); } - - function queryAssoc($table, $values=array(), $extra='') { - $sql = $this->sqlSelect($table, $this->getDefs($table), $values, $extra); - $result = $this->db->query($sql); - $ret = array(); - while ($row = $this->db->fetch_row($result, MYSQL_ASSOC)) { - $ret[] = $row; - } - return $ret; + + function queryAssoc($table, $values=array(), $extra='', $index = false) { + return $this->query($table, $values, $extra, $index, MYSQLI_ASSOC); + } + + function queryIndex($table, $index, $values=array(), $extra='') { + return $this->query($table, $values, $extra, $index, MYSQLI_ASSOC); } + /// INSERT /// function sqlInsert($table, $props, $vals) { $sql = 'INSERT INTO '.$table.' '; @@ -250,7 +299,7 @@ class ryDB { foreach($props as $name => $type) { if (!isset($vals[$name])) continue; - $params[] = $name; + $params[] = '`'.$name.'`'; switch ($type) { case SQL_DEF_BOOLEAN: $values[] = $vals[$name]?1:0; @@ -260,12 +309,12 @@ class ryDB { break; case SQL_DEF_DATE: // date if (is_string($vals[$name])) - $values[] = "'".addslashes($vals[$name])."'"; + $values[] = "'".$this->sqlEscape($vals[$name])."'"; else $values[] = "'".$this->toDate($vals[$name])."'"; break; default: - $values[] = "'".addslashes($vals[$name])."'"; + $values[] = "'".$this->sqlEscape($vals[$name])."'"; break; } } @@ -284,8 +333,8 @@ class ryDB { $sql = "DELETE FROM\n\t".$table."\n"; $test = array(); foreach($values as $name => $value) - $test[] = '('.addslashes($name).' = '.var_export($value, true).')'; - + $test[] = '('.$this->sqlEscape($name).' = '.var_export($value, true).')'; + if ($test or $where) $sql .= "WHERE\n\t"; if ($test) @@ -294,7 +343,7 @@ class ryDB { $sql .= "\n".$where; return $sql.';'; } - + function delete($table, $values=array(), $where='') { $sql = $this->sqlDelete($table, $values, $where); $result = $this->db->query($sql); @@ -316,23 +365,23 @@ class ryDB { break; case SQL_DEF_DATE: if (is_string($vals[$name])) - $values[] = '`'.$name.'` = \''.addslashes($vals[$name]).'\''; + $values[] = '`'.$name.'` = \''.$this->sqlEscape($vals[$name]).'\''; else $values[] = '`'.$name.'` = \''.$this->toDate($vals[$name]).'\''; break; default: - $values[] = '`'.$name.'` = \''.addslashes($vals[$name]).'\''; + $values[] = '`'.$name.'` = \''.$this->sqlEscape($vals[$name]).'\''; break; } } $sql .= "\n\t".implode(",\n\t", $values)."\n"; foreach($tests as $name => $value) { - $test[] = '('.addslashes($name).' = '.var_export($value, true).')'; + $test[] = '('.$this->sqlEscape($name).' = '.var_export($value, true).')'; } if ($test) $sql .= "WHERE\n\t".implode("\nAND\n\t", $test); - + $sql .= "\n".$extra; return $sql; @@ -363,17 +412,17 @@ class ryDB { continue; switch ($type) { case 'trad': - $values[] = '`'.$name."` = '".addslashes($vals[$name])."'"; + $values[] = '`'.$name."` = '".$this->sqlEscape($vals[$name])."'"; break; case 'textarea': case 'string': case 'option': - $values[] = '`'.$name."` = '".addslashes($vals[$name])."'"; + $values[] = '`'.$name."` = '".$this->sqlEscape($vals[$name])."'"; break; case 'id': case 'int': case 'float': - $values[] = '`'.$name.'` = '.addslashes($vals[$name]); + $values[] = '`'.$name.'` = '.$this->sqlEscape($vals[$name]); break; case 'bool': $values[] = '`'.$name.'` = '.($vals[$name]?'1':'0'); @@ -389,7 +438,7 @@ class ryDB { return $result; } - + /// Display function getTableHtml($name, $params, $values, $order_by='') { @@ -417,6 +466,55 @@ class ryDB { return $ret; } + /// Update Database Structure + + static function updateDatabaseStruct($defs) + { + if (file_exists(RYAPP_PATH.'database.versions')) + $versions = unserialize(file_get_contents(RYAPP_PATH.'database.versions')); + else + $versions = array(); + + $c = "Updating DB Structure...\n"; + foreach ($defs as $dbname => $tables) { + $db = new ServerDatabase(RYAPI_WEBDB_HOST, RYAPI_WEBDB_LOGIN, RYAPI_WEBDB_PASS, $dbname); + $db->query("SET NAMES utf8"); + $c .= "\n Selected DB '$dbname'\n"; + foreach ($tables as $table => $sql) + { + $version = count($sql); + if (array_key_exists($table, $versions)) + $diff = $version - $versions[$table]; + else { + $versions[$table] = 0; + $diff = $version; + } + + $c .= " Table '$table' need v$version (current v".strval($versions[$table].') => '); + + if ($diff > 0) { + $sql_to_run = array_slice($sql, $versions[$table], $diff); + foreach($sql_to_run as $sql_run) { + if ($sql_run) { + $c .= "Run sql... "; + $result = $db->query($sql_run); + } else + $c .= "KO!!!"; + } + if ($result) { + $c .= "OK"; + $versions[$table] = $version; + } + } else + $c .= "OK"; + $c .= "\n"; + } + $c .= "\n"; + $db->close(); + } + file_put_contents(RYAPP_PATH.'database.versions', serialize($versions)); + return '
      '.$c.'
      ';
      +	}
       }
       
       ?>
      diff --git a/code/web/api/common/dfm.php b/code/web/api/common/dfm.php
      new file mode 100644
      index 000000000..57bbe70d3
      --- /dev/null
      +++ b/code/web/api/common/dfm.php
      @@ -0,0 +1,151 @@
      +.
      + */
      +
      + function getDirLinks($url_params, $path, $getvar, $home) {
      +	$ret = '';
      +	$dirs = explode('/', $path);
      +	$dirpath = '';
      +	$ret .= _l($home, $url_params, array($getvar => ''));
      +	foreach($dirs as $dirname) {
      +		if ($dirname)  {
      +			$ret .= ' » '._l($dirname, $url_params, array($getvar => '/'.$dirpath.$dirname));
      +			$dirpath .= $dirname.'/';
      +		}
      +	}
      +	return $ret;
      +}
      +
      +function isEmptyDir($dir)
      +{
      +	if (($files = scandir($dir)) && count($files) <= 2) {
      +		return true;
      +	}
      +	return false;
      +}
      + 
      +class ryDataFileManager {
      +
      +	public $id;
      +	public $log_dir;
      +	public $data_dir;
      +	public $user_dir;
      +	public $app_name;
      +	
      +	function __construct($id, $app_name=APP_NAME) {
      +		$this->app_name = $app_name;
      +		$id = (strlen($id) == 0?'0':'').$id;
      +		$id = (strlen($id) == 1?'0':'').$id;
      +		$this->id = $id;
      +		$this->log_dir = RYAPP_PATH.$app_name.'/data/logs/';
      +		$this->data_dir = RYAPP_PATH.$app_name.'/data/app/';
      +		$this->user_dir =  RYAPP_PATH.$app_name.'/data/chars/'.$id[0].'/'.$id[1].'/'.$id.'/';
      +		
      +		if (!is_dir($this->user_dir))
      +			@mkdir($this->user_dir, 0777, true);
      +
      +		if (!is_dir($this->log_dir))  {
      +			@mkdir($this->log_dir, 0777, true);
      +			@mkdir($this->data_dir, 0777, true);
      +		}
      +	}	
      +	
      +	/*** Generic datafiles access methods ***/
      +
      +	function getData($name, $default=null) {
      +		if (file_exists($name))
      +			return unserialize(file_get_contents($name));
      +		if ($default !== NULL) {
      +			@file_put_contents($name, serialize($default));
      +			return $default;
      +		}
      +		return NULL;
      +	}
      +
      +	function saveData($name, $datas, $create_folders=true) {
      +		if ($create_folders) {
      +			if (!is_dir(dirname($name)))
      +				@mkdir(dirname($name), 0777, true);
      +		}
      +		if ($datas !== NULL)
      +			@file_put_contents($name, serialize($datas));
      +		else
      +			@unlink($name);
      +	}
      +	
      +	function listDataFiles($dir) {
      +		$ret = array();
      +		if ($handle = @opendir($dir)) {
      +			while (false !== ($file = readdir($handle))) {
      +				if ($file != '.' && $file != '..' && $file[0] != '.')
      +					$ret[] = $file;
      +			}
      +		}
      +		return $ret;
      +	}
      +
      +	/*** App Datas ***/
      +
      +	function loadAppData($name, $default=null) {
      +		return $this->getData($this->data_dir.$name, $default);
      +	}
      +
      +	function saveAppData($name, $datas, $create_folders=true) {
      +		return $this->saveData($this->data_dir.$name, $datas, $create_folders);
      +	}
      +
      +	function listAppDataFiles($basedir='') {
      +		return $this->listDataFiles($this->data_dir.$basedir);
      +	}
      +
      +
      +	/*** User Datas ***/
      +	
      +	function loadUserData($name, $default=null) {
      +		return $this->getData($this->user_dir.$name, $default);
      +	}
      +
      +	function saveUserData($name, $datas, $create_folders=true) {
      +		return $this->saveData($this->user_dir.$name, $datas, $create_folders);
      +	}
      +
      +	function listUserDataFiles($basedir='') {
      +		return $this->listDataFiles($this->user_dir.$basedir);
      +	}
      +
      +	function loadUserDataFromApp($name, $app, $default=null) {
      +		$id = $this->id;
      +		$file = RYAPP_PATH.$app.'/data/chars/'.$id[0].'/'.$id[1].'/'.$id.'/'.$name;
      +		if (file_exists($file))
      +			return unserialize(file_get_contents($file));
      +		if ($default !== null)
      +			return $default;
      +		return null;
      +	}
      +
      +	function saveUserDataFromApp($name, $app, $datas) {
      +		$id = $this->id;
      +		$dir = RYAPP_PATH.$app.'/data/chars/'.$id[0].'/'.$id[1].'/'.$id.'/';
      +		if (!is_dir($dir))
      +			@mkdir($dir, 0777, true);
      +		file_put_contents($dir.$name, serialize($datas));
      +	}
      +}
      +
      +
      +?>
      diff --git a/code/web/api/common/logger.php b/code/web/api/common/logger.php
      index 1e5106b54..7599c62c9 100644
      --- a/code/web/api/common/logger.php
      +++ b/code/web/api/common/logger.php
      @@ -1,9 +1,26 @@
       .
      + */
      +
       class ryLogger {
       
       	public $enable = false;
      -	private $logs;
      +	private $logs = array();
       	private static $_instance = NULL;
       	
       	public static function getInstance() {
      @@ -32,12 +49,16 @@ class ryLogger {
       
       	function getLogs() {
       		$ret = '';
      -		if ($this->logs && $this->enable)
      -			$ret = "Debug\n\n".implode("\n", $this->logs);
      -		$this->logs = array();
      +		if ($this->logs && $this->enable) {
      +			$ret = 'Debug

      '. implode('
      ', $this->logs).'
      '; + $this->logs = array(); + } return $ret; } } +function _log() { + return ryLogger::getInstance(); +} ?> diff --git a/code/web/api/common/render.php b/code/web/api/common/render.php index 60b101d38..30a68a266 100644 --- a/code/web/api/common/render.php +++ b/code/web/api/common/render.php @@ -1,4 +1,5 @@ . */ -function ryzom_app_render($title, $content, $ig=false, $bgcolor='', $javascript=array(), $homeLink=false) { +function ryzom_app_render($title, $content, $style='', $javascript=array(), $homeLink=false) { $c = ''; + + // get Lua code + $c .= ryLua::get(RYZOM_IG); + $at_end = ryLua::getEnd(RYZOM_IG); + // Render header $title_prefix = ''; if (ON_IPHONE) { $title_prefix = 'Ryzom - '; } - if (!$bgcolor) - $bgcolor = '#000000'.($ig?'00':''); - - if (!$ig) { + if (!RYZOM_IG) $c .= ''."\n"; - $c .= ' - '."\n"; - $c .= ' '.$title_prefix.(translation_exists($title)?_t($title):$title).''."\n"; + $c .= ''."\n"; + $c .= ' '.$title_prefix.(translation_exists($title)?_t($title):$title).''."\n"; + if (!RYZOM_IG) $c .= ' '."\n"; + + $events = ''; + if (!RYZOM_IG) { $c .= ryzom_render_header(); $c .= ryzom_render_header_www(); - $events = ON_IPHONE ? 'onorientationchange="updateOrientation();" ' : ''; - $c .= ' '."\n"; - $c .= ' '."\n"; + if (function_exists('newrelic_get_browser_timing_header')) + $c .= newrelic_get_browser_timing_header(); + if(ON_IPHONE) $events = 'onorientationchange="updateOrientation();" '; + } else { + #if (!$style) + $style='bgcolor="#00000000"'; + } + + if (!RYZOM_IG) { // Javascript $js_code = ''; + if (is_string($javascript)) + $javascript = array($javascript); foreach ($javascript as $js) - $js_code .= ''; + $js_code .= ' '."\n"; $c .= $js_code; + } + $c .= ' '."\n"; + $c .= ' '."\n"; + + if (!RYZOM_IG) { $c .= ryzom_render_www(ryzom_render_window($title, $content, $homeLink)); - $c .= ''; + $c .= ''; + if (function_exists('newrelic_get_browser_timing_header')) + $c .= newrelic_get_browser_timing_footer(); } else { - $c .= ''; - $c .= $content; - $debug = ryLogger::getInstance()->getLogs(); - if ($debug) - $c .= '
      '.$debug.'
      '; - $c .= ''; + $c .= $content.'
      '.ryLogger::getInstance()->getLogs().'
      '; } + + $c .= ''.$at_end; + return $c; } @@ -146,7 +165,9 @@ function ryzom_render_window_begin($title, $homeLink=false) { } function ryzom_render_window_end() { + global $user; return ' +
      '.(isset( $user['groups'])?implode(':', $user['groups']):'').'
      '.ryLogger::getInstance()->getLogs().'

      powered by ryzom-api

      @@ -191,25 +212,161 @@ function ryzom_render_www_end() { return ''; } -function ryzom_render_login_form($char, $aligned=true) { + +function _s($tag, $text) { + global $ryzom_render_styles, $ryzom_render_tmpls; + if (!array_key_exists($tag, $ryzom_render_tmpls)) + return $text; + if (is_array($text)) + return $p = $text; + else + $p[0] = $text; + $p['color1'] = $ryzom_render_styles[$tag][0]; + $p['color2'] = $ryzom_render_styles[$tag][1]; + $code = '$c = "'.str_replace('"', '\"', $ryzom_render_tmpls[$tag]).'";'; + eval($code); + return $c; +} + +function ryzom_get_color_style($tag, $color=0) { + global $ryzom_render_styles; + if (!array_key_exists($tag, $ryzom_render_styles)) + return '000000'; + return $ryzom_render_styles[$tag][$color]; +} + +function ryzom_set_title($title) { + $GLOBALS['ryzom_render_title'] = $title; +} + +function ryzom_get_title() { + return $GLOBALS['ryzom_render_title']; +} + +function ryzom_font($text, $color="", $size="") { + if (RYZOM_IG) { + $color = $color?'color="'.$color.'"':''; + $size = $size?'size="'.$size.'"':''; + } else { + $color = $color?'color:'.$color.';':''; + $size = $size?'font-size:'.$size.'pt':''; + } + return (RYZOM_IG?"":"").$text.''; +} + +function ryzom_render_login_form($char, $aligned=true, $action="") { $c = ''; if ($aligned) { - $c .= '
      '; + $c .= '
      '; $c .= ''; - $c .= ''; + $c .= ''; $c .= ''; - $c .= ''; + if (RYZOM_IG) + $c .= ''; + else + $c .= ''; $c .= ''; } else { - $c .= '
      '._t('enter_char').'
      '._t('enter_password').'
      '; + $c .= '
      '; $c .= ''; - $c .= ''; + $c .= ''; $c .= ''; - $c .= ''; + if (RYZOM_IG) + $c .= ''; + else + $c .= ''; $c .= ''; } $c .= '
      '._t('login').'
      '._t('password').'
      '; return $c; } +function ryzom_dialog_yes_no($desc, $action, $name) { // will append ryzom_dialog=yes|no to url + + return '
      '.(RYZOM_IG?'':''). + $desc.'
      + + + +
      +
      '; +} + +$GLOBALS['ryzom_render_title'] = defined('APP_NAME')?APP_NAME:'Ryzom'; + +$ig = (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'Ryzom')) || ryzom_get_param('ig'); // need be set using url param because auth is not done +$transparency = $ig?'':''; +$ryzom_render_styles = array(); +$ryzom_render_tmpls = array(); + +$ryzom_render_styles['main title'] = array('#222222'.$transparency, '#FFFFFF'); +$ryzom_render_tmpls['main title'] = '

       ${p[0]}

      '."\n"; + +$ryzom_render_styles['section'] = array('#555555'.$transparency, '#FFFFFF'); +$ryzom_render_tmpls['section'] = '
       ${p[0]}
      '."\n"; + +$ryzom_render_styles['color'] = array('', ''); +$ryzom_render_tmpls['color'] = ($ig?'':'').'${p[0]}'; + +$ryzom_render_styles['link'] = array('#111111', ''); +$ryzom_render_tmpls['link'] = '
       ${p[0]}
      '."\n"; + +$ryzom_render_styles['button'] = array('#000000', ''); +$ryzom_render_tmpls['button'] = '
       ${p[0]}
      '."\n"; + +$ryzom_render_styles['links'] = array('#111111'.$transparency, ''); +$ryzom_render_tmpls['links'] = '
       ${p[0]}
      '."\n"; + +$ryzom_render_styles['back'] = array('#000000'.$transparency, ''); +$ryzom_render_tmpls['back'] = '
       «'.'main'.'
       
      '; + +$ryzom_render_styles['highlight'] = array('#55ff55'.$transparency, ''); +$ryzom_render_tmpls['highlight'] = '${p[0]}'; + +$ryzom_render_styles['backlight'] = array('#272727'.$transparency, ''); +$ryzom_render_tmpls['backlight'] = '
      ${p[0]}
      '."\n"; + +$ryzom_render_styles['actionbar'] = array('#555555'.$transparency, ''); +$ryzom_render_tmpls['actionbar'] = '${p[0]}'."\n"; + +$ryzom_render_styles['table'] = array('#050505'.$transparency, '#FFFFFF'); +$ryzom_render_tmpls['table'] = '${p[0]}
      '."\n"; + +$ryzom_render_styles['t header'] = array('#111111'.$transparency, '#FFFFFF'); +$ryzom_render_tmpls['t header'] = '${p[0]}'."\n"; + +$ryzom_render_styles['t row 0'] = array('#353535'.$transparency, ''); +$ryzom_render_tmpls['t row 0'] = '${p[0]}'."\n"; + +$ryzom_render_styles['t row 1'] = array('#252525'.$transparency, ''); +$ryzom_render_tmpls['t row 1'] = '${p[0]}'."\n"; + +$ryzom_render_styles['t element'] = array('#FFFFFF'.$transparency, ''); +$ryzom_render_tmpls['t element'] = '${p[0]}'; + +$ryzom_render_styles['log'] = array('#001100'.$transparency, ''); +$ryzom_render_tmpls['log'] = '
      ${p[0]}
      '."\n"; + +$ryzom_render_styles['message'] = array('#445566'.$transparency, ''); +$ryzom_render_tmpls['message'] = '

       ${p[0]}

      '."\n"; + +$ryzom_render_styles['message warning'] = array('#AA3300'.$transparency, ''); +$ryzom_render_tmpls['message warning'] = '

       ${p[0]}

      '."\n"; + +$ryzom_render_styles['message window'] = array('#5555ff'.$transparency, '#7799ff'); +$ryzom_render_tmpls['message window'] = ''.''. + '
      ${p[0]}${p[0]}
      '."\n"; + +$ryzom_render_styles['message ask'] = array('#333333'.$transparency, ''); +$ryzom_render_tmpls['message ask'] = '
      '.($ig?'':'').'${p[0]}
      '."\n"; + +$ryzom_render_styles['message error'] = array('#AA2222'.$transparency, ''); +$ryzom_render_tmpls['message error'] = '

       ${p[0]}

      '."\n"; + +$ryzom_render_styles['message debug'] = array('#FFAA22'.$transparency, ''); +$ryzom_render_tmpls['message debug'] = '
      ${p[0]}
      '."\n"; + +$ryzom_render_styles['progress bar'] = array('#FF0000'.$transparency, '#000000'); +$ryzom_render_tmpls['progress bar'] = '${p[0]}
       ${p[0]} 
      '."\n"; + ?> diff --git a/code/web/api/common/ryform.php b/code/web/api/common/ryform.php new file mode 100644 index 000000000..9f674a8a9 --- /dev/null +++ b/code/web/api/common/ryform.php @@ -0,0 +1,678 @@ +. + */ + +include_once (RYAPI_PATH.'/common/ryformBases.php'); + +class ryVar extends basicRyForm { + public $formName = ''; + public $varName = ''; + public $varValue = ''; + + function getFormDefs() { + return array( + new ryFormDef('varName', DEF_TYPE_TEXT), + new ryFormDef('varValue', DEF_TYPE_TEXT), + ); + } + + function getHtmlRepr() { + return $this->varName.' => '.$this->varValue; + } +} + +class ryForm { + + private $name = ''; + private $defines = array(); + private $template = ''; + + static private $forms; + static private $ryformsIcons = array(); + + function __construct($dir, $name) { + $this->name = $name; + self::$forms[$dir.'/'.$name] = $this; + } + + static function addRyFormIcon($ryform_name, $icon) { + self::$ryformsIcons[$ryform_name] = $icon; + } + + function addDefine($def) { + $this->defines[$def->name] = $def; + } + + function setTemplate($template) { + $this->template = $template; + } + + function getTemplate() { + return $this->template; + } + + function addValue($name, $value) { + if (array_key_exists($name, $this->defines)) + $this->defines[$name]->value = $value; + else + return false; + return true; + } + + function addExtraValues($name, $value) { + if (array_key_exists($name, $this->defines)) + $this->defines[$name]->extraValues = $value; + else + return false; + return true; + } + + function getForm($params) { + + if (isset($params['ryform_action']) && $params['ryform_action']) { + $res = $this->doAction($params); + return $res; + } + + if (@$params['validate'] == $this->name) + return array(DATA_FORM_VALUES, $_POST); + + if (isset($params['ryform_parent'])) + $parent_ryform_name = $params['ryform_parent'].'/'; + else + $parent_ryform_name = ''; + + $action =_url(ryzom_get_params(), array('validate' => $this->name)); + $ret = ''; + $ret .= '
      '."\n"; + + if (!$this->getTemplate()) { + $ret .= ' '."\n"; + $ret .= ' '._s('t header', '')."\n"; + $tmpl = ''; + } else { + $tmpl = $this->getTemplate(); + } + + $i = 0; + + foreach ($this->defines as $def_id => $def) { + if ($def->name == 'name') + $def->name = '_name'; + + $deffullname = $def->name; + $url_params = ryzom_get_params(); + $type = $def->type; + $infos = $def->infos; + $value = ($def->value !== NULL)?$def->value:$def->defaultValue; + + if (!is_object($value) && !is_array($value)) + $str_value = _h(strval($value)); + else + $str_value = ''; + + if ($def->hidden) + $type = DEF_TYPE_HIDDEN; + + $hidden = false; + $input = ''; + switch ($type) { + + case DEF_TYPE_HIDDEN: + $input = ''."\n"; + $hidden = true; + break; + + case DEF_TYPE_TEXT: + $input = ''; + break; + case DEF_TYPE_NAMEID: + $input = ''; + break; + + case DEF_TYPE_ID: + case DEF_TYPE_INT: + case DEF_TYPE_FLOAT: + $input = ''; + break; + + case DEF_TYPE_BOOL: + $input = ''; + break; + + case DEF_TYPE_OPTION_FUNCTION: + case DEF_TYPE_OPTION: + if ($type == DEF_TYPE_OPTION) + $options = $def->params; + else { + if (is_array($def->defaultValue)) + $options = call_user_func_array($def->params, $def->defaultValue); + else + $options = call_user_func($def->params); + } + $input = ''; + break; + + case DEF_TYPE_COMBO_FUNCTION: + case DEF_TYPE_COMBO: + if ($type == DEF_TYPE_COMBO) + $options = $def->params; + else { + if (is_array($def->defaultValue)) + $options = call_user_func_array($def->params, $def->defaultValue); + else + $options = call_user_func($def->params); + } + if (_user()->ig) { + // TODO : try to do it with lua + } else { // HTML 4 + $input .= ' + '; + } + break; + + case DEF_TYPE_TEXTAREA: + if (!$value) + $value = ""; + $input = '
      '.($type == DEF_TYPE_BBCODE?'- BBCode -
      ':'').'
      '; + break; + + case DEF_TYPE_TRAD: + $base = ''; + $param = $def->name; + $value = array_merge(array('en' => '', 'fr' => '', 'de' => '', 'ru' => '', 'es' => ''), $value); + $base = ryzom_get_param('select_base', ''); + $edit = $display = $input_header = ''; + foreach (array('en', 'fr', 'de', 'ru', 'es') as $lang) { + if (_user()->lang == $lang) + $edit = _i($lang == 'en'?API_URL.'data/img/lang/us.png':API_URL.'data/img/lang/'.$lang.'.png').' '; + if ((!$base && $value[$lang]) || $base == $lang) { + $base = $lang; + $display = strtoupper($lang).' = '.str_replace("\n", '
      ', _h($value[$lang])).'
      '; + } + $input .= ''; + $input_header .= _l(_i($lang == 'en'?API_URL.'data/img/lang/us.png':API_URL.'data/img/lang/'.$lang.'.png'), $url_params, array('select_base' => $lang)).'  '; + } + + $input = $input_header.$input.'   '.$display.'
      '.$edit; + break; + + case DEF_TYPE_RYFORM: + case DEF_TYPE_RYFORMS_ARRAY: + $savedRyform = $value; + if (is_array($savedRyform)) { + $to_clean = array(); + foreach ($savedRyform as $id => $ryform) { + if (!is_object($ryform)) + $to_clean[] = $id; + } + foreach ($to_clean as $id) + unset($savedRyform[$id]); + $savedRyform = array_values($savedRyform); + } else if (is_object($savedRyform)) { + $savedRyform = array($savedRyform); + } else + $savedRyform = array(); + + $input .= '
      '._t('parameter').''._t('value').'
      '; + if ($savedRyform) { + foreach ($savedRyform as $id => $ryform) { + if (!is_object($ryform)) { + p('!!! ERROR !!!', $ryform); + continue; + } + $ryform->id = $id+1; + if (!isset($ryform->formName) || !$ryform->formName) + $ryform->formName = 'Element '.$id; + if (count($savedRyform) > 1) + $display_id = ''.strval(intval($id)+1).''; + else + $display_id = ''; + + $script_up = ($id != 0)?_l(_i('16/arrow_up', _t('up')), $url_params, array('ryform_name' => $parent_ryform_name.$deffullname.':'.$id, 'ryform_action' => 'up')).' ':''; + $script_down = ($id != count($savedRyform)-1)?_l(_i('16/arrow_down', _t('down')), $url_params, array('ryform_name' => $parent_ryform_name.$deffullname.':'.$id, 'ryform_action' => 'down')).' ':''; + + $icon = (isset(self::$ryformsIcons[get_class($ryform)]))?self::$ryformsIcons[get_class($ryform)]:_i('32/brick'); + $input .= _s('t row '.($id%2), + ''. + ''. + ''); + } + } + $input .= '
      '._l(($def->type == DEF_TYPE_RYFORM?_i('16/arrow_redo', _t('change')):_i('16/add', _t('add'))), $url_params, array('ryform_name' => $parent_ryform_name.$deffullname.':'.strval(intval($id)+1), 'ryform_action' => 'list')).' '.$display_id.''.$script_up.$script_down.' + + + +
      '.$icon.''. + _l($ryform->formName, $url_params, array('ryform_name' => $parent_ryform_name.$deffullname.':'.$id, 'ryform_action' => 'edit')).' '. + '
      '._t(get_class($ryform).'_short_description').'
      '.$ryform->getHtmlRepr().'
      '. + _l(_i('16/script_edit', _t('edit')), $url_params, array('ryform_name' => $parent_ryform_name.$deffullname.':'.$id, 'ryform_action' => 'edit')).' '. + _l(_i('16/script_code', _t('edit_source')), $url_params, array('ryform_name' => $parent_ryform_name.$deffullname.':'.$id, 'ryform_action' => 'source')).'      '. + _l(_i('16/script_delete', _t('del')), $url_params, array('ryform_name' => $parent_ryform_name.$deffullname.':'.$id, 'ryform_action' => 'del')).' 
      '; + if (count($savedRyform) == 0 || $def->type != DEF_TYPE_RYFORM) { + if (is_string($def->params)) + $infos = _l(_i('16/add', _t('add')), $url_params, array('new_ryform' => $def->params, 'ryform_name' => $parent_ryform_name.$deffullname.':0', 'ryform_action' => 'add')); + else + $infos = _l(_i('16/add', _t('add')), $url_params, array('ryform_name' => $parent_ryform_name.$deffullname.':0', 'ryform_action' => 'list')); + + if ($type == DEF_TYPE_RYFORMS_ARRAY) + $infos .= '   '._l(_i('16/application_form_add', _t('multiadd')), $url_params, array('ryform_name' => $deffullname, 'ryform_action' => 'list_multiadd')); + } + break; + + case DEF_TYPE_FUNCTION: + if (is_array($def->defaultValue)) + list($result_type, $value) = call_user_func_array($def->params, $def->defaultValue); + else + list($result_type, $value) = call_user_func($def->params); + if ($result_type == DATA_HTML_FORM) { + return array(DATA_HTML_FORM, $value); + } else { + unset($url_params[$deffullname.'_action']); + $input = $value; + } + break; + + default: + $input = ''.$value."\n"; + $hidden = true; + + } + + if ($hidden) + $ret .= $input; + else + { + if ($tmpl) { + $tmpl = str_replace('{'.$def->name.'}', 'ig?'color="orange" size="11"':'style="color:orange;"').'>'._t($def->prefixTrad.$def->name).'', $tmpl); + $tmpl = str_replace('{'.$def->name.'.input}', $input, $tmpl); + $tmpl = str_replace('{'.$def->name.'.infos}', $infos, $tmpl); + } else + $ret .= _s('t row '.strval($i % 2), ' '.(!$def->optional?'*':'').($def->superAdmin?'##':'').($def->admin?'#':'')._t($def->prefixTrad.$def->name).''.$input.''.$infos.'')."\n"; + $i++; + } + } + + if ($tmpl) { + $tmpl = str_replace('{submit.input}', '', $tmpl); + $ret .= $tmpl; + $ret .= ''._s('t row '.strval($i % 2), '').'
           '._t('required_fields').'
      '; + } else { + $ret .= _s('t row '.strval($i % 2), '     '._t('required_fields').''); + $ret .= ''; + } + $ret .= '

      '; + return array(DATA_HTML_FORM, $ret."\n"); + } + + + function doAction($url_params) { + if (!$url_params['ryform_name']) + return array(DATA_RYFORM_VALUE, array()); + $ret = ''; + $ryforms = explode('/', $url_params['ryform_name']); + $this_ryform_name = array_shift($ryforms); + list($ryform_name,$ryform_pos) = explode(':', $this_ryform_name); + if (!isset($this->defines[$ryform_name])) + return 'Bad ryform name'; + $def = $this->defines[$ryform_name]; + + if ($ryforms) { + $action = 'edit'; + $next_action = $url_params['ryform_action']; + } else { + $action = $url_params['ryform_action']; + $next_action = ''; + } + + switch ($action) { + case 'list': + if (isset($url_params['ryform_parent']) && $url_params['ryform_parent']) + $ryform_parent = $url_params['ryform_parent'].'/'; + else + $ryform_parent = ''; + $ret .= ''; + foreach ($def->params as $id => $ryform) { + if (is_array($ryform)) { + $ret .= _s('t row 1', ''); + foreach ($ryform as $subid => $subryform) { + $ret .= _s('t row '.($subid%2), ''); + } + } else + $ret .= _s('t row '.($id%2), ''); + } + $ret .= '
      '.ryzom_font(_t('ryform_cat_'.$id), '', '12').''.self::$ryformsIcons[$subryform].'  '. + _l(_t($subryform.'_short_description'), $url_params, array('ryform_name' => $ryform_parent.$url_params['ryform_name'], 'ryform_action' => 'add', 'new_ryform' => $subryform)).''.$subryform.''.self::$ryformsIcons[$ryform].'  '. + _l(_t($ryform.'_short_description'), $url_params, array('ryform_name' => $ryform_parent.$url_params['ryform_name'], 'ryform_action' => 'add', 'new_ryform' => $ryform)).''.$ryform.'
      '; + return array(DATA_HTML_FORM, $ret); + break; + + case 'list_multiadd': + // TODO + /* + unset($url_params[$deffullname.'_action']); + $ret .= ''; + foreach ($def->params as $ryform) { + $ret .= ''; + } + $ret .= '
      '._l($ryform, $url_params, array('ryform_action' => 'multiadd', 'new_ryform' => $ryform)).'
      '; + return array(DATA_HTML_FORM, $ret);*/ + break; + + case 'add': + $new_ryform = ryzom_get_param('new_ryform'); + $valid_ryform = false; + if ($new_ryform) { + + if ((is_string($def->params) && $new_ryform == $def->params) || in_array($new_ryform, $def->params)) + $valid_ryform = true; + else { + foreach ($def->params as $param) { + if (is_array($param) && in_array($new_ryform, $param)) + $valid_ryform = true; + } + } + if (!$valid_ryform) + return array(DATA_HTML_FORM, 'Bad ryform'); + + } else { + $new_ryform = $def->params; + } + $ryform = new $new_ryform($new_ryform, ''); + $ryform->preSerialization(); + if ($def->type != DEF_TYPE_RYFORM) { + p($def->value); + if (!is_array($def->value)) + $savedRyform = array($def->value); + else + $savedRyform = $def->value; + if ($ryform_pos === 0) { + $value = array_values(array_merge(array($ryform), $savedRyform)); + } else if ($ryform_pos !== NULL) { + $begin = array_slice($savedRyform, 0, $ryform_pos); + $end = array_slice($savedRyform, $ryform_pos, count($savedRyform)-$ryform_pos); + $value = array_values(array_merge($begin, array($ryform), $end)); + } else + $value[] = $ryform; + p($ryform_name, $value); + //return array(DATA_RYFORM_VALUE, array('stages' => array())); + return array(DATA_RYFORM_VALUE, array($ryform_name => $value)); + } else { + p($ryform_name, $ryform); + return array(DATA_RYFORM_VALUE, array($ryform_name => $ryform)); + } + break; + + case 'edit': + $a_ryforms = $def->value; + if (is_array($a_ryforms)) + $ryform = $a_ryforms[$ryform_pos]; + else + $ryform = $a_ryforms; + $ryform->postSerialization(); + $validate = isset($url_params['validate']) && $url_params['validate']; + + $form = new ryForm('', $def->name); + foreach ($ryform->getFormDefs() as $form_def) { + $form->addDefine($form_def); + $name = $form_def->name; + // Init form with ryfom values + if (property_exists($ryform, $name)) { + $form->addValue($form_def->name, $ryform->$name); + } + } + foreach ($ryform->getFormDefsExtraValues() as $def_name => $extra_values) + $form->addExtraValues($def_name, $extra_values); + $form->setTemplate($ryform->getTemplate()); + + list($result_type, $value) = $form->getForm(array('action' => $url_params['action'], 'script' => $url_params['script'], 'ryform_action' => $next_action, 'ryform_parent' => $this_ryform_name, 'ryform_name' => implode('/', $ryforms), 'validate' => $validate)); + if ($result_type == DATA_HTML_FORM) { + return array(DATA_HTML_FORM, $value); + } else { + if ($result_type == DATA_FORM_VALUES) + $value = $form->validateFormPost($value); + $ryform->setFormParams($value); + $ryform->preSerialization(); + + } + if (is_array($a_ryforms)) + $a_ryforms[$ryform_pos] = $ryform; + else + $a_ryforms = $ryform; + + $value = array($ryform_name => $a_ryforms); + return array(DATA_RYFORM_VALUE, $value); + break; + + + case 'del': + $id = $ryform_pos; + p($def->value); + if (!is_array($def->value)) + $def->value = array(); + else + unset($def->value[$id]); + $value = array_values($def->value); + return array(DATA_RYFORM_VALUE, array($ryform_name => $value)); + break; + + case 'up': + $a_ryforms = $def->value; + if (!is_array($a_ryforms)) + ryzom_redirect(_url($url_params, array('ryform_action' => ''))); + + $temp_ryform = $a_ryforms[$ryform_pos-1]; + $a_ryforms[$ryform_pos-1] = $a_ryforms[$ryform_pos]; + $a_ryforms[$ryform_pos] = $temp_ryform; + $a_ryforms = array_values($a_ryforms); + p($ryform_name, $a_ryforms); + return array(DATA_RYFORM_VALUE, array($ryform_name => $a_ryforms)); + break; + + case 'down': + $a_ryforms = $def->value; + if (!is_array($a_ryforms)) + ryzom_redirect(_url($url_params, array('ryform_action' => ''))); + + $temp_ryform = $a_ryforms[$ryform_pos+1]; + $a_ryforms[$ryform_pos+1] = $a_ryforms[$ryform_pos]; + $a_ryforms[$ryform_pos] = $temp_ryform; + $a_ryforms = array_values($a_ryforms); + return array(DATA_RYFORM_VALUE, array($ryform_name => $a_ryforms)); + break; + + case 'source': + $a_ryforms = $def->value; + if (is_array($a_ryforms)) + $ryform = $a_ryforms[$ryform_pos]; + else + $ryform = $a_ryforms; + $ryform->postSerialization(); + + $form = new ryForm('', $def->name); + $form->addDefine(new ryFormDef('ryform_source', DEF_TYPE_TEXTAREA, '', base64_encode(serialize($ryform)))); + $validate = isset($url_params['validate']) && $url_params['validate']; + list($result_type, $value) = $form->getForm(array('ryform_action' => $next_action, 'ryform_parent' => $this_ryform_name, 'ryform_name' => implode('/', $ryforms), 'validate' => $validate)); + if ($result_type == DATA_HTML_FORM) { + return array(DATA_HTML_FORM, $value); + } else { + if ($result_type == DATA_FORM_VALUES) + $params = $form->validateFormPost($value); + else + $params = $value; + $ryform = unserialize(base64_decode($params['ryform_source'])); + if (!is_object($ryform)) { + unset($url_params['validate']); + ryzom_redirect(_url($url_params, array('ryform_action' => '', 'message' => 'bad_paste'))); + } + + $is_valid = false; + p($def->params); + foreach ($def->params as $id => $ryform_class) { + if (is_array($ryform_class)) { + if (in_array(get_class($ryform), array_values($ryform_class))) + $is_valid = true; + } else if (get_class($ryform) == $ryform_class) + $is_valid = true; + } + if (!$is_valid) { + p(get_class($ryform), $def->params); + ryzom_redirect(_url($url_params, array($deffullname.'_action' => '', 'message' => 'not_valid_stage'))); + return; + } + if (is_array($a_ryforms)) + $a_ryforms[$ryform_pos] = $ryform; + else + $a_ryforms = $ryform; + $value = array($ryform_name => $a_ryforms); + return array(DATA_RYFORM_VALUE, $value); + } + return; + break; + } + + return $ret; + } + + function validateFormPost($params, $use_default=true) { + $final = array(); + foreach ($this->defines as $def) { + $name = $def->name; + if ($def->name == 'name') + $def->name = '_name'; + + $type = $def->type; + if ($def->hidden) + $type = DEF_TYPE_HIDDEN; + + if (isset($params[$def->name])) { + $value = $params[$def->name]; + } else if (!$use_default) { + continue; + } else { + $value = ''; + } + + + switch ($type) { + + case DEF_TYPE_HIDDEN: + case DEF_TYPE_TEXT: + case DEF_TYPE_OPTION: + case DEF_TYPE_TEXTAREA: + $final[$name] = $value; + break; + + case DEF_TYPE_TRAD: + if (!$value[_user()->lang] && $value['europeanunion']) + $value[_user()->lang] = $value['europeanunion']; + $final[$name] = $value; + break; + + case DEF_TYPE_NAMEID: + $final[$name] = cleanNameID($value); + break; + + case DEF_TYPE_COMBO: + $final[$name] = $value; + break; + + case DEF_TYPE_ID: + case DEF_TYPE_INT: // TODO + $final[$name] = intval($value); + break; + case DEF_TYPE_FLOAT: // TODO + $final[$name] = floatval($value); + break; + + case DEF_TYPE_BOOL: + $final[$name] = $value == 'on'; + break; + + case DEF_TYPE_RYFORM: + if (is_array($value)) + $final[$name] = $value[0]; + break; + case DEF_TYPE_RYFORMS_ARRAY: + break; + + default: + $final[$name] = $value; + + } + } + return $final; + } + +/* + function reset() { + + // Clean all temp files + $userDatas = _tools()->listAppDataFiles($this->dir); + foreach ($userDatas as $userData) { + if (substr($userData, 0, strlen($this->name)) == $this->name) + _tools()->saveAppData($this->dir.'/'.$userData, NULL); + } + }*/ +} + + +?> diff --git a/code/web/api/common/ryformBases.php b/code/web/api/common/ryformBases.php new file mode 100644 index 000000000..7592af511 --- /dev/null +++ b/code/web/api/common/ryformBases.php @@ -0,0 +1,177 @@ +. + */ + +define('DEF_TYPE_UNKNOWN', 0); +define('DEF_TYPE_HIDDEN', 1); +define('DEF_TYPE_TEXT', 2); +define('DEF_TYPE_ID', 3); +define('DEF_TYPE_INT', 4); +define('DEF_TYPE_FLOAT', 5); +define('DEF_TYPE_BOOL', 6); +define('DEF_TYPE_OPTION', 7); +define('DEF_TYPE_TEXTAREA', 8); +define('DEF_TYPE_TRAD', 9); +define('DEF_TYPE_FORM', 10); +define('DEF_TYPE_ICON', 11); +define('DEF_TYPE_RYFORM', 12); +define('DEF_TYPE_RYFORMS_ARRAY', 13); +define('DEF_TYPE_BBCODE', 14); +define('DEF_TYPE_FUNCTION', 15); +define('DEF_TYPE_COMBO', 16); +define('DEF_TYPE_OPTION_FUNCTION', 17); +define('DEF_TYPE_NAMEID', 18); +define('DEF_TYPE_COMBO_FUNCTION', 19); + +define('DEF_TYPE_ICON_UNKNOWN', 0); +define('DEF_TYPE_ICON_SHARED', 1); +define('DEF_TYPE_ICON_RYZITEM', 2); +define('DEF_TYPE_ICON_URL', 3); + +define('DATA_HTML_FORM', 0); +define('DATA_FORM_VALUES', 1); +define('DATA_FORM_VALID_VALUES', 2); +define('DATA_RYFORM_VALUE', 3); + +function cleanFormName($name) { + $final_name = ''; + for ($i=0; $i= ord('a')) && (ord(strtolower($c)) <= ord('z'))) || + (in_array($c, array('-', '.', '_'))) || + (ord(strtolower($c)) >= ord('0')) && (ord(strtolower($c)) <= ord('9')) ) + $final_name .= $c; + } + return $final_name; +} + +function cleanNameID($name) { + $final_name = ''; + for ($i=0; $i= ord('a')) && (ord(strtolower($c)) <= ord('z'))) || + (ord($c) >= ord('0')) && (ord($c) <= ord('9')) ) + $final_name .= $c; + } + return $final_name; +} + +function getNameId($name) { + return str_replace('_', ' ', $name); +} + +function getTrad($value) { + if ($value[_user()->lang]) + $trad = $value[_user()->lang]; + foreach (array('en', 'fr', 'de', 'ru', 'es') as $lang) { + if ($value[$lang]) { + $trad = $value[$lang]; + break; + } + } + if (substr($trad, 0, 2) == '//') + $trad = strstr(str_replace("\r", '', $trad), "\n"); + return substr($trad, 1); +} + +interface iRyForm { + function getForm($url_params); + function setFormParams($params); + function getHtmlRepr(); + function getFormDefs(); + function getFormDefsExtraValues(); + function preSerialization(); + function postSerialization($vars=array()); + function getTemplate(); +} + +class ryFormDef { + + public $name = ''; + public $type = DEF_TYPE_UNKNOWN; + public $params = array(); + public $infos = ''; + public $defaultValue = NULL; + public $value = NULL; + public $extraValues = array(); + public $hidden = false; + public $optional = false; + public $admin = false; + public $superAdmin = false; + public $prefixTrad = ''; + + function __construct($name, $type, $params=array(), $defaultValue=NULL, $optional=false, $infos='') { + $this->name = $name; + $this->type = $type; + $this->params = $params; + $this->defaultValue = $defaultValue; + $this->optional = $optional; + $this->infos = $infos; + } + +} + +class basicRyForm implements iRyForm { + public $formName = ''; // Used by Form + public $id = 0; + + function __construct($name, $title) { + } + + function getForm($url_params) { + $form = new ryForm($this->formName, $this->tools); + $form_defs = $this->getFormDefs(); + foreach ($form_defs as $def) + $form->addDefine($def); + return $form->getForm(_s('section', $this->formName.' ('.get_class($this).')')); + } + + function setFormParams($params) { + foreach ($params as $name => $value) { + if (property_exists($this, $name)) + $this->$name = $value; + } + } + + function getHtmlRepr() { + return $this->formName.' ('.get_class($this).')'; + } + + function getFormDefs() { + return array(); + } + + function getFormDefsExtraValues() { + return array(); + } + + function preSerialization() { + unset($this->tools); + } + + function postSerialization($vars=array()) { + } + + function getTemplate() { + return ''; + } +} + +?> diff --git a/code/web/api/common/time.php b/code/web/api/common/time.php new file mode 100644 index 000000000..9d2020efe --- /dev/null +++ b/code/web/api/common/time.php @@ -0,0 +1,130 @@ +. + */ + +/* Basic constants */ +/* 1 IG hour = 3 IRL minutes = 1800 ticks */ +define('RYTIME_HOUR_TICKS', 1800); +define('RYTIME_DAY_HOURS', 24); +define('RYTIME_SEASON_DAYS', 90); +define('RYTIME_MONTH_DAYS', 30); +define('RYTIME_CYCLE_MONTHS', 12); +define('RYTIME_JY_CYCLES', 4); +define('RYTIME_WEEK_DAYS', 6); +/* 0 = spring, 1 = summer, 2 = automn, 3 = winter */ +define('RYTIME_CYCLE_SEASONS', 4); +/* Tick is offset on server of 61 days. */ +define('RYTIME_TICK_OFFSET', 61 * RYTIME_DAY_HOURS * RYTIME_HOUR_TICKS); + +define('RYTIME_START_JY', 2568); + +/* Helpers */ +define('RYTIME_CYCLE_DAYS',RYTIME_CYCLE_MONTHS * RYTIME_MONTH_DAYS); +define('RYTIME_JY_DAYS', RYTIME_CYCLE_DAYS * RYTIME_JY_CYCLES); +define('RYTIME_JY_MONTHS', RYTIME_CYCLE_MONTHS * RYTIME_JY_CYCLES); + +// Takes a server tick and returns a computed array +function ryzom_time_array($tick) { + $out = array(); + $out["server_tick"] = $tick; + + $time_in_hours = ($tick-RYTIME_TICK_OFFSET) / RYTIME_HOUR_TICKS; + $day = $time_in_hours / RYTIME_DAY_HOURS; + + $out["jena_year"] = floor($day / RYTIME_JY_DAYS) + RYTIME_START_JY; + if ($day < 0) $day = RYTIME_JY_DAYS - abs($day) % RYTIME_JY_DAYS; + $out["day_of_jy"] = $day % RYTIME_JY_DAYS; + $out["month_of_jy"] = floor($out["day_of_jy"] / RYTIME_MONTH_DAYS); + + $out["cycle"] = floor($out["day_of_jy"] / RYTIME_CYCLE_DAYS); + $out["day_of_cycle"] = $day % RYTIME_CYCLE_DAYS; + $out["month_of_cycle"] = $out["month_of_jy"] % RYTIME_CYCLE_MONTHS; + + $out["day_of_month"] = $out["day_of_jy"] % RYTIME_MONTH_DAYS; + $out["day_of_week"] = $day % RYTIME_WEEK_DAYS; + + $out["season"] = ($day / RYTIME_SEASON_DAYS) % RYTIME_CYCLE_SEASONS; + $out["day_of_season"] = $day % RYTIME_SEASON_DAYS; + + $out["time_of_day"] = abs($time_in_hours) % RYTIME_DAY_HOURS; + if ($time_in_hours < 0 && $out["time_of_day"]) $out["time_of_day"] = RYTIME_DAY_HOURS - $out["time_of_day"]; + + return $out; +} + +function ryzom_time_xml_without_cache($rytime) { + $out = new SimpleXMLElement(''); + foreach($rytime as $key => $value) { + $out->addChild($key, $value); + } + return $out; +} + +/** + * Take number of the month (0-11) and returns its name + */ +function ryzom_month_name($month_number) { + if ($month_number < 0 || $month_number > 11) return "bad month"; + + $RYTIME_MONTHS = array( + 'Winderly', 'Germinally', 'Folially', 'Floris', + 'Medis', 'Thermis', 'Harvestor', 'Frutor', + 'Fallenor', 'Pluvia', 'Mystia', 'Nivia' + ); + + return $RYTIME_MONTHS[(int)$month_number]; +} + + +/** + * Take number of the day of week (0-5) and returns its name + */ +function ryzom_day_name($day_number) { + if ($day_number < 0 || $day_number > 5) return "bad day of week"; + + $RYTIME_DAYS = array( + 'Prima', 'Dua', 'Tria', + 'Quarta', 'Quinteth', 'Holeth' + ); + + return $RYTIME_DAYS[(int)$day_number]; +} + +/** + * Take a computed ryzom time array and returns the formatted date + * (Official 2004 Format without trailing JY) + */ +function ryzom_time_txt($rytime, $lang = "en") { + if ($lang != "en" && $lang != "fr" && $lang != "de") $lang = "en"; + + $RYTIME_AC = array( + "de" => array("1. AZ", "2. AZ", "3. AZ", "4. AZ"), + "en" => array("1st AC", "2nd AC", "3rd AC", "4th AC"), + "fr" => array("1er CA", "2e CA", "3e CA", "4e CA") + ); + + # Day, Month DayOfMonth, CycleNth AC JY + return sprintf("%sh - %s, %s %d, %s %d", + $rytime["time_of_day"], + ryzom_day_name($rytime["day_of_week"]), + ryzom_month_name($rytime["month_of_cycle"]), + $rytime["day_of_month"] + 1, + $RYTIME_AC[$lang][$rytime["cycle"]], + $rytime["jena_year"]); +} + +?> \ No newline at end of file diff --git a/code/web/api/common/user.php b/code/web/api/common/user.php index 62a2de0c8..ea6359454 100644 --- a/code/web/api/common/user.php +++ b/code/web/api/common/user.php @@ -1,3 +1,61 @@ . + */ + + +class ryUser { + private $infos; + + function __construct($infos) { + $this->infos = $infos; + } + + function __get($name) + { + if (array_key_exists($name, $this->infos)) { + return $this->infos[$name]; + } else { + /** TODO **/ + return NULL; + } + } + + function inGroup($groups) { + $groups = explode(':', $groups); + foreach ($groups as $group) { + if (in_array($group, $this->groups)) + return true; + } + return false; + } +} + +function ryzom_auth_user($ask_login=true, $welcome_message='') { + global $user, $_USER; + + $result = ryzom_app_authenticate($user, $ask_login, $welcome_message, true); + $_USER = new RyUser($user); + return $result; +} + +function _user() { + global $_USER; + return $_USER; +} + ?> diff --git a/code/web/api/common/utils.php b/code/web/api/common/utils.php index 9f12fdfc1..093a63ec0 100644 --- a/code/web/api/common/utils.php +++ b/code/web/api/common/utils.php @@ -1,6 +1,31 @@ . + */ + include_once('logger.php'); +include_once('dfm.php'); + +define('SERVER', 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']); + +if (ini_get('magic_quotes_gpc') == 1) { + $_POST = stripslashes_deep($_POST); + $_GET = stripslashes_deep($_GET); +} // Always use this function to get param because in game, the param can be pass by _GET or by _POST function ryzom_get_param($var, $default='') @@ -24,13 +49,30 @@ function parse_query($var) foreach($var as $val) { $x = explode('=', $val); - $arr[$x[0]] = urldecode($x[1]); + if (count($x) > 1) + $arr[$x[0]] = urldecode($x[1]); + else + $arr[$x[0]] = ''; } unset($val, $x, $var); } return $arr; } +function ryzom_get_params() +{ + if (!isset($GLOBALS['URL_PARAMS'])) + $GLOBALS['URL_PARAMS'] = parse_query($_SERVER['REQUEST_URI']); + return $GLOBALS['URL_PARAMS']; +} + +function ryzom_unset_url_param($name) { + if (!isset($GLOBALS['URL_PARAMS'])) + $GLOBALS['URL_PARAMS'] = parse_query($_SERVER['REQUEST_URI']); + unset($GLOBALS['URL_PARAMS'][$name]); + return $GLOBALS['URL_PARAMS']; +} + if (!function_exists('http_build_query')) { function http_build_query($data, $prefix='', $sep='', $key='') { $ret = array(); @@ -50,6 +92,55 @@ if (!function_exists('http_build_query')) { } } +if(!function_exists('_url')){ + function _url($base_params=null, $add_params=array()){ + if ($base_params !== null) + return SERVER.'?'.http_build_query(array_merge($base_params, $add_params)); + else + return SERVER; + } +} + + +if(!function_exists('_h')){ + function _h($s){ + return htmlspecialchars($s, ENT_QUOTES, 'UTF-8'); + } +} + +if(!function_exists('_i')){ + function _i($img, $alt=''){ + if (substr($img, strlen($img)-4) == '.tga') // img from client texture : ig only + return $img; + + if (is_file(RYAPI_PATH.'/data/icons/'.$img.'.png')) + $img = RYAPI_URL.'/data/icons/'.$img.'.png'; + else if (is_file(RYAPP_PATH.'/data/icons/'.$img.'.png')) + $img = RYAPP_URL.'/data/icons/'.$img.'.png'; + else + $img = 'view_remove'; + + if ($alt) + return ''.utf8_decode($alt).''; + else + return ''; + + } +} + +if(!function_exists('_l')){ + function _l($text, $base_params=array(), $add_params=array()) + { + return ''.$text.''; + } +} + +if(!function_exists('_b')){ + function _b($text, $base_params=array(), $add_params=array()) + { + return ''.$text.''; + } +} /*** * @@ -66,8 +157,10 @@ function translation_exists($id) { function get_translation($id, $lang, $args=array()) { global $ryzom_texts, $user; if(!isset($ryzom_texts[$id])) return '{'.$id.'}'; - if(!isset($ryzom_texts[$id][$lang])) return '{'.$id.'['.$lang.']}'; - if($ryzom_texts[$id][$lang] == '' && isset($ryzom_texts[$id]['en'])) return @vsprintf($ryzom_texts[$id]['en'], $args); + if(empty($ryzom_texts[$id][$lang])){ + if(isset($ryzom_texts[$id]['en'])) return @vsprintf($ryzom_texts[$id]['en'], $args); + return '{'.$id.'['.$lang.']}'; + } return @vsprintf($ryzom_texts[$id][$lang], $args); } @@ -87,10 +180,12 @@ function _t($id, $args=array()) { $a = ' '.strval($args); } if(!isset($ryzom_texts[$id])) return '{'.$id.$a.'}'; - if(!isset($ryzom_texts[$id][$user['lang']])) return '{'.$id.'['.$user['lang'].']'.$a.'}'; - if($ryzom_texts[$id][$user['lang']] == '' && isset($ryzom_texts[$id]['en']) && $ryzom_texts[$id]['en'] != '') return @vsprintf($ryzom_texts[$id]['en'], $args); - if($ryzom_texts[$id][$user['lang']] == '' && isset($ryzom_texts[$id]['fr']) && $ryzom_texts[$id]['fr'] != '') return '{'.$id.$a.'}'; - if($ryzom_texts[$id][$user['lang']] == '' && isset($ryzom_texts[$id]['de']) && $ryzom_texts[$id]['de'] != '') return '{'.$id.$a.'}'; + if(empty($ryzom_texts[$id][$user['lang']])){ + if(!empty($ryzom_texts[$id]['en'])) return @vsprintf($ryzom_texts[$id]['en'], $args); + if(!empty($ryzom_texts[$id]['fr'])) return '{'.$id.$a.'}'; + if(!empty($ryzom_texts[$id]['de'])) return '{'.$id.$a.'}'; + return '{'.$id.'['.$user['lang'].']'.$a.'}'; + } return @vsprintf($ryzom_texts[$id][$user['lang']], $args); } @@ -100,7 +195,20 @@ function _t($id, $args=array()) { * * ***/ - +function ryzom_timer($timestamp) { + $d = intval($timestamp / 86400); + $timestamp = $timestamp % 86400; + $h = intval($timestamp / 3600); + $timestamp = $timestamp % 3600; + $m = intval($timestamp / 60); + $s = $timestamp % 60; + if ($d>1) + return sprintf('%d'._t('days').' %02d:%02d:%02d', $d, $h, $m, $s); + else if ($d) + return sprintf('%d'._t('day').' %02d:%02d:%02d', $d, $h, $m, $s); + else + return sprintf("%02d:%02d:%02d", $h, $m, $s); +} // Get a human and translated readable time, for example "3 days ago" function ryzom_relative_time($timestamp) { @@ -133,7 +241,10 @@ function ryzom_relative_time($timestamp) { } } - $final = $ryzom_periods[$user['lang']][$form][$j]; + if(!empty($ryzom_periods[$user['lang']][$form][$j])) + $final = $ryzom_periods[$user['lang']][$form][$j]; + else + $final = $ryzom_periods['en'][$form][$j]; $text = _t('date_format', array($difference, $final, $ending)); return $text; } @@ -150,33 +261,193 @@ function ryzom_absolute_time($timestamp) { return $text; } + +/*** + * + * Ryzom utilities + * + * + * ***/ + +function ryzom_generate_password($length=8, $level=2, $oneofeach=false) { + $validchars[1] = "0123456789abcdfghjkmnpqrstvwxyz"; + $validchars[2] = "0123456789abcdfghjkmnpqrstvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + $validchars[3] = "0123456789_!@#$%&*()-=+/abcdfghjkmnpqrstvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_!@#$%&*()-=+/"; + + $password = ""; + $counter = 0; + + while ($counter < $length) { + $actChar = substr($validchars[$level], rand(0, strlen($validchars[$level])-1), 1); + + // if $oneofeach then All character must be different (slower) + if (!$oneofeach || !strstr($password, $actChar)) { + $password .= $actChar; + $counter++; + } + } + + return $password; +} + + +function file_get_contents_cached($fn, $cache_time=300) { + global $ryzom_bench_text; + + $lfn = 'tmp/'.strtr($fn, ':/.?&=', '____________'); + + // get the new file from internet every $cache_time (default=5min) + if (file_exists($lfn) && filesize($lfn) > 0 && time() < filemtime($lfn) + $cache_time) { + $content = file_get_contents($lfn); + } else { + $content = file_get_contents($fn); + if ($content != '') file_put_contents($lfn, $content); + } + return $content; +} + +function ryzom_redirect($url, $group='webig', $extra_lua='') { + global $user; + $lua = $extra_lua."\n"; + if ($user['ig']) { + if (!$group) + $lua .= 'getUI(__CURRENT_WINDOW__):browse("'.str_replace('&', '&', $url).'")'; + else + $lua .= 'getUI("ui:interface:'.$group.':content:html"):browse("'.str_replace('&', '&', $url).'")'; + echo ''.$lua.''; + exit(); + } else { + header('Location: '.$url); + exit(); + } +} + /*** * * Debug tools * * ***/ -function p($var, $value=NULL) { +function alert($var, $value=NULL, $level=1) { + p($var, $value, '#FF7777', $level); +} + +define('pNULL', '§$£¤*µ%ù²&#!;,;:.?/?.<>'); + +function p($var, $value=pNULL, $color='#FFFF00', $level=0) { ob_start(); debug_print_backtrace(); $bt = ob_get_contents(); ob_end_clean(); - $bt = explode("\n",$bt); - $bt = explode('[', $bt[1]); - ob_start(); - echo ''.substr($bt[count($bt)-1], 0, -1)."\n"; - if ($value !== NULL) { - echo ''.$var.' : '; + $bt = explode("\n#",$bt); + if (isset($bt[$level])) + $bt1 = explode('[', $bt[$level]); + else + $bt1 = array(''); + + if (isset($bt[$level+1])) + $bt2 = explode('[', $bt[$level+1]); + else + $bt2 = array(''); + + $c = ''; + if ($value !== pNULL) { + $c .= ''.$var.' : '; $var = $value; } - //if (is_array($var)) - echo '
      ';
      -	print_r($var);
      -	echo '
      '; -// else - // var_dump($var); - ryLogger::getInstance()->addPrint(ob_get_contents()); + $c .= ''.substr(str_replace("\n", "", $bt2[count($bt2)-1]), 0, -1).' => '.substr(str_replace("\n", "", $bt1[count($bt1)-1]), 0, -1)." "; + ryLogger::getInstance()->addPrint($c); + ob_start(); + var_dump($var); + ryLogger::getInstance()->addPrint(_h(ob_get_contents()), $color); ob_end_clean(); } + +/*** + * + * Lua tools + * + * ***/ + + class ryLua { + + static private $lua = array(); + static private $luaend = array(); + static private $indent; + static private $indentend; + static private $linkTargetId = 0; + + static function add($code, $indent=NULL) { + if ($indent !== NULL) + self::$indent += $indent; + $tabs = str_repeat(" ", self::$indent); + $a = $tabs.str_replace("\n", "\n ".$tabs, $code); + self::$lua[] = $a; + } + + static function addEnd($code, $indent=NULL) { + if ($indent !== NULL) + self::$indentend += $indent; + $tabs = str_repeat(" ", self::$indentend); + $a = $tabs.str_replace("\n", "\n ".$tabs, $code); + self::$luaend[] = $a; + } + + + static function get($ig) { + ryLogger::getInstance()->addPrint(implode("\n", self::$lua), '#FF00FF'); + $ret = ($ig)?"\n".implode("\n", self::$lua)."\n":''; + self::$lua = array(); + return $ret; + } + + static function getEnd($ig) { + ryLogger::getInstance()->addPrint(implode("\n", self::$luaend), '#FF55FF'); + $ret = ($ig)?"\n".implode("\n", self::$luaend)."\n":''; + self::$luaend = array(); + return $ret; + } + + static function url($base_params=null, $add_params=array()) { + return str_replace('&', '&', _url($base_params, $add_params)); + } + + + function openLink($text, $target='webig', $base_params=array(), $add_params=array(), $urllua='', $runlua='') + { + $url = self::url($base_params, $add_params); + if ($target == "help_browser") + $url .= "&ignore="; + $id = ryzom_generate_password(8).strval(time()).strval(self::$linkTargetId++); + $lua = <<< END +function openLink{$id}() + runAH(nil, "browse", "name=ui:interface:{$target}:content:html|url={$url}"{$urllua}) + {$runlua} +end +END; + self::add($lua); + if (RYZOM_IG) + return ''.$text.''; + return $text; + } + + static function link($id, $luacode, $text) { + $lua = <<'.$text.''; + return $text; + } + +} + + + + + ?> diff --git a/code/web/api/common/xml_utils.php b/code/web/api/common/xml_utils.php new file mode 100644 index 000000000..28d166866 --- /dev/null +++ b/code/web/api/common/xml_utils.php @@ -0,0 +1,23 @@ +. + */ + +function ryzom_display_xml_header() { + header('Content-Type: application/xml; charset=UTF-8'); +} + +?> \ No newline at end of file diff --git a/code/web/api/data/css/ryzom_ui.css b/code/web/api/data/css/ryzom_ui.css index 8342b77f8..8b8e9ed37 100644 --- a/code/web/api/data/css/ryzom_ui.css +++ b/code/web/api/data/css/ryzom_ui.css @@ -33,14 +33,18 @@ color: white; } .ryzom-ui input, .ryzom-ui select { - border-top: 1px solid #030403; - border-right: 1px solid #6e7f57; - border-bottom: 1px solid #889e6c; - border-left: 1px solid #272d1f; - background-color: #37402b; - color: #ddd; + border-bottom: 1px solid #7B7E80; + border-left: 1px solid #7B7E80; + border-top: 1px solid #101010; + border-right: 1px solid #101010; + background-color: #1D1D1D; + border-radius: 3px; + color: #BBB; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; font-size: 12px; margin: 2px 0 5px 0; + padding: 1px; } .ryzom-ui input[type=text] { width: 100%; @@ -52,27 +56,43 @@ /* input[type=submit] will make IE6 to ignore whole CSS rule, so cant combine this with .ryzom-ui-button below */ input[type=submit] { - border-bottom: 1px solid #030403; - border-left: 1px solid #6e7f57; - border-top: 1px solid #889e6c; - border-right: 1px solid #272d1f; - background-color: #435120; + border-bottom: 1px solid #7B7E80; + border-left: 1px solid #7B7E80; + border-top: 1px solid #7B7E80; + border-right: 1px solid #7B7E80; + background-color: #232323; + border-radius: 3px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + color: #BBB; +} +input[type=submit]:hover { + border-bottom: 1px solid #FFFFFF; + border-left: 1px solid #FFFFFF; + border-top: 1px solid #FFFFFF; + border-right: 1px solid #FFFFFF; + color: #FFF; } input.ryzom-ui-button, .ryzom-ui-button { - border-bottom: 1px solid #030403; - border-left: 1px solid #6e7f57; - border-top: 1px solid #889e6c; - border-right: 1px solid #272d1f; - background-color: #435120; + border-bottom: 1px solid #7B7E80; + border-left: 1px solid #7B7E80; + border-top: 1px solid #7B7E80; + border-right: 1px solid #7B7E80; + background-color: #232323; + border-radius: 3px; + color: #BBB; } a.ryzom-ui-button, a.ryzom-ui-button:visited { - color: white; - padding: 0 .5em; + color: #DDD; + padding: .2em .5em; text-decoration: none; } a.ryzom-ui-button:hover { - background: #536130; - color: #ddd; + border-bottom: 1px solid #FFFFFF; + border-left: 1px solid #FFFFFF; + border-top: 1px solid #FFFFFF; + border-right: 1px solid #FFFFFF; + color: #FFF; } /* window without title - just borders */ .ryzom-ui-tl { diff --git a/code/web/api/data/icons/add_app.png b/code/web/api/data/icons/add_app.png new file mode 100755 index 000000000..12cfb5546 Binary files /dev/null and b/code/web/api/data/icons/add_app.png differ diff --git a/code/web/api/data/icons/edit.png b/code/web/api/data/icons/edit.png new file mode 100644 index 000000000..315b5d8b4 Binary files /dev/null and b/code/web/api/data/icons/edit.png differ diff --git a/code/web/api/data/icons/edit_16.png b/code/web/api/data/icons/edit_16.png new file mode 100644 index 000000000..9a0dd7a37 Binary files /dev/null and b/code/web/api/data/icons/edit_16.png differ diff --git a/code/web/api/data/icons/no_action.png b/code/web/api/data/icons/no_action.png new file mode 100755 index 000000000..93aef43b3 Binary files /dev/null and b/code/web/api/data/icons/no_action.png differ diff --git a/code/web/api/data/icons/spe_com.png b/code/web/api/data/icons/spe_com.png new file mode 100644 index 000000000..9e3f48ecc Binary files /dev/null and b/code/web/api/data/icons/spe_com.png differ diff --git a/code/web/api/data/img/bordure.png b/code/web/api/data/img/bordure.png new file mode 100644 index 000000000..6c8da76f6 Binary files /dev/null and b/code/web/api/data/img/bordure.png differ diff --git a/code/web/api/data/img/lang/de.png b/code/web/api/data/img/lang/de.png index 767abe088..787c68830 100644 Binary files a/code/web/api/data/img/lang/de.png and b/code/web/api/data/img/lang/de.png differ diff --git a/code/web/api/data/img/lang/en.png b/code/web/api/data/img/lang/en.png index 2673310cc..6505dc41b 100644 Binary files a/code/web/api/data/img/lang/en.png and b/code/web/api/data/img/lang/en.png differ diff --git a/code/web/api/data/img/lang/es.png b/code/web/api/data/img/lang/es.png new file mode 100644 index 000000000..a2e450fbc Binary files /dev/null and b/code/web/api/data/img/lang/es.png differ diff --git a/code/web/api/data/img/lang/fr.png b/code/web/api/data/img/lang/fr.png index 420474693..60ed561d4 100644 Binary files a/code/web/api/data/img/lang/fr.png and b/code/web/api/data/img/lang/fr.png differ diff --git a/code/web/api/data/img/lang/ru.png b/code/web/api/data/img/lang/ru.png index 53aaf57be..281cf66f2 100644 Binary files a/code/web/api/data/img/lang/ru.png and b/code/web/api/data/img/lang/ru.png differ diff --git a/code/web/api/data/js/combobox.js b/code/web/api/data/js/combobox.js new file mode 100644 index 000000000..0a9440909 --- /dev/null +++ b/code/web/api/data/js/combobox.js @@ -0,0 +1,17 @@ + +function comboInit(thelist) +{ + theinput = document.getElementById(theinput); + var idx = thelist.selectedIndex; + var content = thelist.options[idx].value; + if(theinput.value == "") + theinput.value = content; +} + +function combo(thelist, theinput) +{ + theinput = document.getElementById(theinput); + var idx = thelist.selectedIndex; + var content = thelist.options[idx].value; + theinput.value = content; +} diff --git a/code/web/api/data/js/jquery-1.7.1.js b/code/web/api/data/js/jquery-1.7.1.js new file mode 100644 index 000000000..8ccd0ea78 --- /dev/null +++ b/code/web/api/data/js/jquery-1.7.1.js @@ -0,0 +1,9266 @@ +/*! + * jQuery JavaScript Library v1.7.1 + * http://jquery.com/ + * + * Copyright 2011, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Mon Nov 21 21:11:03 2011 -0500 + */ +(function( window, undefined ) { + +// Use the correct document accordingly with window argument (sandbox) +var document = window.document, + navigator = window.navigator, + location = window.location; +var jQuery = (function() { + +// Define a local copy of jQuery +var jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context, rootjQuery ); + }, + + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + + // Map over the $ in case of overwrite + _$ = window.$, + + // A central reference to the root jQuery(document) + rootjQuery, + + // A simple way to check for HTML strings or ID strings + // Prioritize #id over to avoid XSS via location.hash (#9521) + quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, + + // Check if a string has a non-whitespace character in it + rnotwhite = /\S/, + + // Used for trimming whitespace + trimLeft = /^\s+/, + trimRight = /\s+$/, + + // Match a standalone tag + rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, + + // JSON RegExp + rvalidchars = /^[\],:{}\s]*$/, + rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, + rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, + rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, + + // Useragent RegExp + rwebkit = /(webkit)[ \/]([\w.]+)/, + ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, + rmsie = /(msie) ([\w.]+)/, + rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, + + // Matches dashed string for camelizing + rdashAlpha = /-([a-z]|[0-9])/ig, + rmsPrefix = /^-ms-/, + + // Used by jQuery.camelCase as callback to replace() + fcamelCase = function( all, letter ) { + return ( letter + "" ).toUpperCase(); + }, + + // Keep a UserAgent string for use with jQuery.browser + userAgent = navigator.userAgent, + + // For matching the engine and version of the browser + browserMatch, + + // The deferred used on DOM ready + readyList, + + // The ready event handler + DOMContentLoaded, + + // Save a reference to some core methods + toString = Object.prototype.toString, + hasOwn = Object.prototype.hasOwnProperty, + push = Array.prototype.push, + slice = Array.prototype.slice, + trim = String.prototype.trim, + indexOf = Array.prototype.indexOf, + + // [[Class]] -> type pairs + class2type = {}; + +jQuery.fn = jQuery.prototype = { + constructor: jQuery, + init: function( selector, context, rootjQuery ) { + var match, elem, ret, doc; + + // Handle $(""), $(null), or $(undefined) + if ( !selector ) { + return this; + } + + // Handle $(DOMElement) + if ( selector.nodeType ) { + this.context = this[0] = selector; + this.length = 1; + return this; + } + + // The body element only exists once, optimize finding it + if ( selector === "body" && !context && document.body ) { + this.context = document; + this[0] = document.body; + this.selector = selector; + this.length = 1; + return this; + } + + // Handle HTML strings + if ( typeof selector === "string" ) { + // Are we dealing with HTML string or an ID? + if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = quickExpr.exec( selector ); + } + + // Verify a match, and that no context was specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) { + context = context instanceof jQuery ? context[0] : context; + doc = ( context ? context.ownerDocument || context : document ); + + // If a single string is passed in and it's a single tag + // just do a createElement and skip the rest + ret = rsingleTag.exec( selector ); + + if ( ret ) { + if ( jQuery.isPlainObject( context ) ) { + selector = [ document.createElement( ret[1] ) ]; + jQuery.fn.attr.call( selector, context, true ); + + } else { + selector = [ doc.createElement( ret[1] ) ]; + } + + } else { + ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); + selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes; + } + + return jQuery.merge( this, selector ); + + // HANDLE: $("#id") + } else { + elem = document.getElementById( match[2] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id !== match[2] ) { + return rootjQuery.find( selector ); + } + + // Otherwise, we inject the element directly into the jQuery object + this.length = 1; + this[0] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || rootjQuery ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return rootjQuery.ready( selector ); + } + + if ( selector.selector !== undefined ) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }, + + // Start with an empty selector + selector: "", + + // The current version of jQuery being used + jquery: "1.7.1", + + // The default length of a jQuery object is 0 + length: 0, + + // The number of elements contained in the matched element set + size: function() { + return this.length; + }, + + toArray: function() { + return slice.call( this, 0 ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num == null ? + + // Return a 'clean' array + this.toArray() : + + // Return just the object + ( num < 0 ? this[ this.length + num ] : this[ num ] ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems, name, selector ) { + // Build a new jQuery matched element set + var ret = this.constructor(); + + if ( jQuery.isArray( elems ) ) { + push.apply( ret, elems ); + + } else { + jQuery.merge( ret, elems ); + } + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + ret.context = this.context; + + if ( name === "find" ) { + ret.selector = this.selector + ( this.selector ? " " : "" ) + selector; + } else if ( name ) { + ret.selector = this.selector + "." + name + "(" + selector + ")"; + } + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + ready: function( fn ) { + // Attach the listeners + jQuery.bindReady(); + + // Add the callback + readyList.add( fn ); + + return this; + }, + + eq: function( i ) { + i = +i; + return i === -1 ? + this.slice( i ) : + this.slice( i, i + 1 ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ), + "slice", slice.call(arguments).join(",") ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function( elem, i ) { + return callback.call( elem, i, elem ); + })); + }, + + end: function() { + return this.prevObject || this.constructor(null); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: [].sort, + splice: [].splice +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + target = {}; + } + + // extend jQuery itself if only one argument is passed + if ( length === i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) { + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { + if ( copyIsArray ) { + copyIsArray = false; + clone = src && jQuery.isArray(src) ? src : []; + + } else { + clone = src && jQuery.isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend({ + noConflict: function( deep ) { + if ( window.$ === jQuery ) { + window.$ = _$; + } + + if ( deep && window.jQuery === jQuery ) { + window.jQuery = _jQuery; + } + + return jQuery; + }, + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Hold (or release) the ready event + holdReady: function( hold ) { + if ( hold ) { + jQuery.readyWait++; + } else { + jQuery.ready( true ); + } + }, + + // Handle when the DOM is ready + ready: function( wait ) { + // Either a released hold or an DOMready/load event and not yet ready + if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( !document.body ) { + return setTimeout( jQuery.ready, 1 ); + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.fireWith( document, [ jQuery ] ); + + // Trigger any bound ready events + if ( jQuery.fn.trigger ) { + jQuery( document ).trigger( "ready" ).off( "ready" ); + } + } + }, + + bindReady: function() { + if ( readyList ) { + return; + } + + readyList = jQuery.Callbacks( "once memory" ); + + // Catch cases where $(document).ready() is called after the + // browser event has already occurred. + if ( document.readyState === "complete" ) { + // Handle it asynchronously to allow scripts the opportunity to delay ready + return setTimeout( jQuery.ready, 1 ); + } + + // Mozilla, Opera and webkit nightlies currently support this event + if ( document.addEventListener ) { + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", jQuery.ready, false ); + + // If IE event model is used + } else if ( document.attachEvent ) { + // ensure firing before onload, + // maybe late but safe also for iframes + document.attachEvent( "onreadystatechange", DOMContentLoaded ); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", jQuery.ready ); + + // If IE and not a frame + // continually check to see if the document is ready + var toplevel = false; + + try { + toplevel = window.frameElement == null; + } catch(e) {} + + if ( document.documentElement.doScroll && toplevel ) { + doScrollCheck(); + } + } + }, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return jQuery.type(obj) === "function"; + }, + + isArray: Array.isArray || function( obj ) { + return jQuery.type(obj) === "array"; + }, + + // A crude way of determining if an object is a window + isWindow: function( obj ) { + return obj && typeof obj === "object" && "setInterval" in obj; + }, + + isNumeric: function( obj ) { + return !isNaN( parseFloat(obj) ) && isFinite( obj ); + }, + + type: function( obj ) { + return obj == null ? + String( obj ) : + class2type[ toString.call(obj) ] || "object"; + }, + + isPlainObject: function( obj ) { + // Must be an Object. + // Because of IE, we also have to check the presence of the constructor property. + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + return false; + } + + try { + // Not own constructor property must be Object + if ( obj.constructor && + !hasOwn.call(obj, "constructor") && + !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { + return false; + } + } catch ( e ) { + // IE8,9 Will throw exceptions on certain host objects #9897 + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + + var key; + for ( key in obj ) {} + + return key === undefined || hasOwn.call( obj, key ); + }, + + isEmptyObject: function( obj ) { + for ( var name in obj ) { + return false; + } + return true; + }, + + error: function( msg ) { + throw new Error( msg ); + }, + + parseJSON: function( data ) { + if ( typeof data !== "string" || !data ) { + return null; + } + + // Make sure leading/trailing whitespace is removed (IE can't handle it) + data = jQuery.trim( data ); + + // Attempt to parse using the native JSON parser first + if ( window.JSON && window.JSON.parse ) { + return window.JSON.parse( data ); + } + + // Make sure the incoming data is actual JSON + // Logic borrowed from http://json.org/json2.js + if ( rvalidchars.test( data.replace( rvalidescape, "@" ) + .replace( rvalidtokens, "]" ) + .replace( rvalidbraces, "")) ) { + + return ( new Function( "return " + data ) )(); + + } + jQuery.error( "Invalid JSON: " + data ); + }, + + // Cross-browser xml parsing + parseXML: function( data ) { + var xml, tmp; + try { + if ( window.DOMParser ) { // Standard + tmp = new DOMParser(); + xml = tmp.parseFromString( data , "text/xml" ); + } else { // IE + xml = new ActiveXObject( "Microsoft.XMLDOM" ); + xml.async = "false"; + xml.loadXML( data ); + } + } catch( e ) { + xml = undefined; + } + if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { + jQuery.error( "Invalid XML: " + data ); + } + return xml; + }, + + noop: function() {}, + + // Evaluates a script in a global context + // Workarounds based on findings by Jim Driscoll + // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context + globalEval: function( data ) { + if ( data && rnotwhite.test( data ) ) { + // We use execScript on Internet Explorer + // We use an anonymous function so that context is window + // rather than jQuery in Firefox + ( window.execScript || function( data ) { + window[ "eval" ].call( window, data ); + } )( data ); + } + }, + + // Convert dashed to camelCase; used by the css and data modules + // Microsoft forgot to hump their vendor prefix (#9572) + camelCase: function( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); + }, + + // args is for internal usage only + each: function( object, callback, args ) { + var name, i = 0, + length = object.length, + isObj = length === undefined || jQuery.isFunction( object ); + + if ( args ) { + if ( isObj ) { + for ( name in object ) { + if ( callback.apply( object[ name ], args ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.apply( object[ i++ ], args ) === false ) { + break; + } + } + } + + // A special, fast, case for the most common use of each + } else { + if ( isObj ) { + for ( name in object ) { + if ( callback.call( object[ name ], name, object[ name ] ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) { + break; + } + } + } + } + + return object; + }, + + // Use native String.trim function wherever possible + trim: trim ? + function( text ) { + return text == null ? + "" : + trim.call( text ); + } : + + // Otherwise use our own trimming functionality + function( text ) { + return text == null ? + "" : + text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); + }, + + // results is for internal usage only + makeArray: function( array, results ) { + var ret = results || []; + + if ( array != null ) { + // The window, strings (and functions) also have 'length' + // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 + var type = jQuery.type( array ); + + if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { + push.call( ret, array ); + } else { + jQuery.merge( ret, array ); + } + } + + return ret; + }, + + inArray: function( elem, array, i ) { + var len; + + if ( array ) { + if ( indexOf ) { + return indexOf.call( array, elem, i ); + } + + len = array.length; + i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; + + for ( ; i < len; i++ ) { + // Skip accessing in sparse arrays + if ( i in array && array[ i ] === elem ) { + return i; + } + } + } + + return -1; + }, + + merge: function( first, second ) { + var i = first.length, + j = 0; + + if ( typeof second.length === "number" ) { + for ( var l = second.length; j < l; j++ ) { + first[ i++ ] = second[ j ]; + } + + } else { + while ( second[j] !== undefined ) { + first[ i++ ] = second[ j++ ]; + } + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, inv ) { + var ret = [], retVal; + inv = !!inv; + + // Go through the array, only saving the items + // that pass the validator function + for ( var i = 0, length = elems.length; i < length; i++ ) { + retVal = !!callback( elems[ i ], i ); + if ( inv !== retVal ) { + ret.push( elems[ i ] ); + } + } + + return ret; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var value, key, ret = [], + i = 0, + length = elems.length, + // jquery objects are treated as arrays + isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ; + + // Go through the array, translating each of the items to their + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + + // Go through every key on the object, + } else { + for ( key in elems ) { + value = callback( elems[ key ], key, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + } + + // Flatten any nested arrays + return ret.concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // Bind a function to a context, optionally partially applying any + // arguments. + proxy: function( fn, context ) { + if ( typeof context === "string" ) { + var tmp = fn[ context ]; + context = fn; + fn = tmp; + } + + // Quick check to determine if target is callable, in the spec + // this throws a TypeError, but we will just return undefined. + if ( !jQuery.isFunction( fn ) ) { + return undefined; + } + + // Simulated bind + var args = slice.call( arguments, 2 ), + proxy = function() { + return fn.apply( context, args.concat( slice.call( arguments ) ) ); + }; + + // Set the guid of unique handler to the same of original handler, so it can be removed + proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; + + return proxy; + }, + + // Mutifunctional method to get and set values to a collection + // The value/s can optionally be executed if it's a function + access: function( elems, key, value, exec, fn, pass ) { + var length = elems.length; + + // Setting many attributes + if ( typeof key === "object" ) { + for ( var k in key ) { + jQuery.access( elems, k, key[k], exec, fn, value ); + } + return elems; + } + + // Setting one attribute + if ( value !== undefined ) { + // Optionally, function values get executed if exec is true + exec = !pass && exec && jQuery.isFunction(value); + + for ( var i = 0; i < length; i++ ) { + fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); + } + + return elems; + } + + // Getting an attribute + return length ? fn( elems[0], key ) : undefined; + }, + + now: function() { + return ( new Date() ).getTime(); + }, + + // Use of jQuery.browser is frowned upon. + // More details: http://docs.jquery.com/Utilities/jQuery.browser + uaMatch: function( ua ) { + ua = ua.toLowerCase(); + + var match = rwebkit.exec( ua ) || + ropera.exec( ua ) || + rmsie.exec( ua ) || + ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || + []; + + return { browser: match[1] || "", version: match[2] || "0" }; + }, + + sub: function() { + function jQuerySub( selector, context ) { + return new jQuerySub.fn.init( selector, context ); + } + jQuery.extend( true, jQuerySub, this ); + jQuerySub.superclass = this; + jQuerySub.fn = jQuerySub.prototype = this(); + jQuerySub.fn.constructor = jQuerySub; + jQuerySub.sub = this.sub; + jQuerySub.fn.init = function init( selector, context ) { + if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { + context = jQuerySub( context ); + } + + return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); + }; + jQuerySub.fn.init.prototype = jQuerySub.fn; + var rootjQuerySub = jQuerySub(document); + return jQuerySub; + }, + + browser: {} +}); + +// Populate the class2type map +jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +}); + +browserMatch = jQuery.uaMatch( userAgent ); +if ( browserMatch.browser ) { + jQuery.browser[ browserMatch.browser ] = true; + jQuery.browser.version = browserMatch.version; +} + +// Deprecated, use jQuery.browser.webkit instead +if ( jQuery.browser.webkit ) { + jQuery.browser.safari = true; +} + +// IE doesn't match non-breaking spaces with \s +if ( rnotwhite.test( "\xA0" ) ) { + trimLeft = /^[\s\xA0]+/; + trimRight = /[\s\xA0]+$/; +} + +// All jQuery objects should point back to these +rootjQuery = jQuery(document); + +// Cleanup functions for the document ready method +if ( document.addEventListener ) { + DOMContentLoaded = function() { + document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + jQuery.ready(); + }; + +} else if ( document.attachEvent ) { + DOMContentLoaded = function() { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( document.readyState === "complete" ) { + document.detachEvent( "onreadystatechange", DOMContentLoaded ); + jQuery.ready(); + } + }; +} + +// The DOM ready check for Internet Explorer +function doScrollCheck() { + if ( jQuery.isReady ) { + return; + } + + try { + // If IE is used, use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + document.documentElement.doScroll("left"); + } catch(e) { + setTimeout( doScrollCheck, 1 ); + return; + } + + // and execute any waiting functions + jQuery.ready(); +} + +return jQuery; + +})(); + + +// String to Object flags format cache +var flagsCache = {}; + +// Convert String-formatted flags into Object-formatted ones and store in cache +function createFlags( flags ) { + var object = flagsCache[ flags ] = {}, + i, length; + flags = flags.split( /\s+/ ); + for ( i = 0, length = flags.length; i < length; i++ ) { + object[ flags[i] ] = true; + } + return object; +} + +/* + * Create a callback list using the following parameters: + * + * flags: an optional list of space-separated flags that will change how + * the callback list behaves + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible flags: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( flags ) { + + // Convert flags from String-formatted to Object-formatted + // (we check in cache first) + flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {}; + + var // Actual callback list + list = [], + // Stack of fire calls for repeatable lists + stack = [], + // Last fire value (for non-forgettable lists) + memory, + // Flag to know if list is currently firing + firing, + // First callback to fire (used internally by add and fireWith) + firingStart, + // End of the loop when firing + firingLength, + // Index of currently firing callback (modified by remove if needed) + firingIndex, + // Add one or several callbacks to the list + add = function( args ) { + var i, + length, + elem, + type, + actual; + for ( i = 0, length = args.length; i < length; i++ ) { + elem = args[ i ]; + type = jQuery.type( elem ); + if ( type === "array" ) { + // Inspect recursively + add( elem ); + } else if ( type === "function" ) { + // Add if not in unique mode and callback is not in + if ( !flags.unique || !self.has( elem ) ) { + list.push( elem ); + } + } + } + }, + // Fire callbacks + fire = function( context, args ) { + args = args || []; + memory = !flags.memory || [ context, args ]; + firing = true; + firingIndex = firingStart || 0; + firingStart = 0; + firingLength = list.length; + for ( ; list && firingIndex < firingLength; firingIndex++ ) { + if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) { + memory = true; // Mark as halted + break; + } + } + firing = false; + if ( list ) { + if ( !flags.once ) { + if ( stack && stack.length ) { + memory = stack.shift(); + self.fireWith( memory[ 0 ], memory[ 1 ] ); + } + } else if ( memory === true ) { + self.disable(); + } else { + list = []; + } + } + }, + // Actual Callbacks object + self = { + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + var length = list.length; + add( arguments ); + // Do we need to add the callbacks to the + // current firing batch? + if ( firing ) { + firingLength = list.length; + // With memory, if we're not firing then + // we should call right away, unless previous + // firing was halted (stopOnFalse) + } else if ( memory && memory !== true ) { + firingStart = length; + fire( memory[ 0 ], memory[ 1 ] ); + } + } + return this; + }, + // Remove a callback from the list + remove: function() { + if ( list ) { + var args = arguments, + argIndex = 0, + argLength = args.length; + for ( ; argIndex < argLength ; argIndex++ ) { + for ( var i = 0; i < list.length; i++ ) { + if ( args[ argIndex ] === list[ i ] ) { + // Handle firingIndex and firingLength + if ( firing ) { + if ( i <= firingLength ) { + firingLength--; + if ( i <= firingIndex ) { + firingIndex--; + } + } + } + // Remove the element + list.splice( i--, 1 ); + // If we have some unicity property then + // we only need to do this once + if ( flags.unique ) { + break; + } + } + } + } + } + return this; + }, + // Control if a given callback is in the list + has: function( fn ) { + if ( list ) { + var i = 0, + length = list.length; + for ( ; i < length; i++ ) { + if ( fn === list[ i ] ) { + return true; + } + } + } + return false; + }, + // Remove all callbacks from the list + empty: function() { + list = []; + return this; + }, + // Have the list do nothing anymore + disable: function() { + list = stack = memory = undefined; + return this; + }, + // Is it disabled? + disabled: function() { + return !list; + }, + // Lock the list in its current state + lock: function() { + stack = undefined; + if ( !memory || memory === true ) { + self.disable(); + } + return this; + }, + // Is it locked? + locked: function() { + return !stack; + }, + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + if ( stack ) { + if ( firing ) { + if ( !flags.once ) { + stack.push( [ context, args ] ); + } + } else if ( !( flags.once && memory ) ) { + fire( context, args ); + } + } + return this; + }, + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + // To know if the callbacks have already been called at least once + fired: function() { + return !!memory; + } + }; + + return self; +}; + + + + +var // Static reference to slice + sliceDeferred = [].slice; + +jQuery.extend({ + + Deferred: function( func ) { + var doneList = jQuery.Callbacks( "once memory" ), + failList = jQuery.Callbacks( "once memory" ), + progressList = jQuery.Callbacks( "memory" ), + state = "pending", + lists = { + resolve: doneList, + reject: failList, + notify: progressList + }, + promise = { + done: doneList.add, + fail: failList.add, + progress: progressList.add, + + state: function() { + return state; + }, + + // Deprecated + isResolved: doneList.fired, + isRejected: failList.fired, + + then: function( doneCallbacks, failCallbacks, progressCallbacks ) { + deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks ); + return this; + }, + always: function() { + deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments ); + return this; + }, + pipe: function( fnDone, fnFail, fnProgress ) { + return jQuery.Deferred(function( newDefer ) { + jQuery.each( { + done: [ fnDone, "resolve" ], + fail: [ fnFail, "reject" ], + progress: [ fnProgress, "notify" ] + }, function( handler, data ) { + var fn = data[ 0 ], + action = data[ 1 ], + returned; + if ( jQuery.isFunction( fn ) ) { + deferred[ handler ](function() { + returned = fn.apply( this, arguments ); + if ( returned && jQuery.isFunction( returned.promise ) ) { + returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify ); + } else { + newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] ); + } + }); + } else { + deferred[ handler ]( newDefer[ action ] ); + } + }); + }).promise(); + }, + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + if ( obj == null ) { + obj = promise; + } else { + for ( var key in promise ) { + obj[ key ] = promise[ key ]; + } + } + return obj; + } + }, + deferred = promise.promise({}), + key; + + for ( key in lists ) { + deferred[ key ] = lists[ key ].fire; + deferred[ key + "With" ] = lists[ key ].fireWith; + } + + // Handle state + deferred.done( function() { + state = "resolved"; + }, failList.disable, progressList.lock ).fail( function() { + state = "rejected"; + }, doneList.disable, progressList.lock ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( firstParam ) { + var args = sliceDeferred.call( arguments, 0 ), + i = 0, + length = args.length, + pValues = new Array( length ), + count = length, + pCount = length, + deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ? + firstParam : + jQuery.Deferred(), + promise = deferred.promise(); + function resolveFunc( i ) { + return function( value ) { + args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; + if ( !( --count ) ) { + deferred.resolveWith( deferred, args ); + } + }; + } + function progressFunc( i ) { + return function( value ) { + pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; + deferred.notifyWith( promise, pValues ); + }; + } + if ( length > 1 ) { + for ( ; i < length; i++ ) { + if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) { + args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) ); + } else { + --count; + } + } + if ( !count ) { + deferred.resolveWith( deferred, args ); + } + } else if ( deferred !== firstParam ) { + deferred.resolveWith( deferred, length ? [ firstParam ] : [] ); + } + return promise; + } +}); + + + + +jQuery.support = (function() { + + var support, + all, + a, + select, + opt, + input, + marginDiv, + fragment, + tds, + events, + eventName, + i, + isSupported, + div = document.createElement( "div" ), + documentElement = document.documentElement; + + // Preliminary tests + div.setAttribute("className", "t"); + div.innerHTML = "
      a"; + + all = div.getElementsByTagName( "*" ); + a = div.getElementsByTagName( "a" )[ 0 ]; + + // Can't get basic test support + if ( !all || !all.length || !a ) { + return {}; + } + + // First batch of supports tests + select = document.createElement( "select" ); + opt = select.appendChild( document.createElement("option") ); + input = div.getElementsByTagName( "input" )[ 0 ]; + + support = { + // IE strips leading whitespace when .innerHTML is used + leadingWhitespace: ( div.firstChild.nodeType === 3 ), + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + tbody: !div.getElementsByTagName("tbody").length, + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + htmlSerialize: !!div.getElementsByTagName("link").length, + + // Get the style information from getAttribute + // (IE uses .cssText instead) + style: /top/.test( a.getAttribute("style") ), + + // Make sure that URLs aren't manipulated + // (IE normalizes it by default) + hrefNormalized: ( a.getAttribute("href") === "/a" ), + + // Make sure that element opacity exists + // (IE uses filter instead) + // Use a regex to work around a WebKit issue. See #5145 + opacity: /^0.55/.test( a.style.opacity ), + + // Verify style float existence + // (IE uses styleFloat instead of cssFloat) + cssFloat: !!a.style.cssFloat, + + // Make sure that if no value is specified for a checkbox + // that it defaults to "on". + // (WebKit defaults to "" instead) + checkOn: ( input.value === "on" ), + + // Make sure that a selected-by-default option has a working selected property. + // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) + optSelected: opt.selected, + + // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) + getSetAttribute: div.className !== "t", + + // Tests for enctype support on a form(#6743) + enctype: !!document.createElement("form").enctype, + + // Makes sure cloning an html5 element does not cause problems + // Where outerHTML is undefined, this still works + html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav>", + + // Will be defined later + submitBubbles: true, + changeBubbles: true, + focusinBubbles: false, + deleteExpando: true, + noCloneEvent: true, + inlineBlockNeedsLayout: false, + shrinkWrapBlocks: false, + reliableMarginRight: true + }; + + // Make sure checked status is properly cloned + input.checked = true; + support.noCloneChecked = input.cloneNode( true ).checked; + + // Make sure that the options inside disabled selects aren't marked as disabled + // (WebKit marks them as disabled) + select.disabled = true; + support.optDisabled = !opt.disabled; + + // Test to see if it's possible to delete an expando from an element + // Fails in Internet Explorer + try { + delete div.test; + } catch( e ) { + support.deleteExpando = false; + } + + if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { + div.attachEvent( "onclick", function() { + // Cloning a node shouldn't copy over any + // bound event handlers (IE does this) + support.noCloneEvent = false; + }); + div.cloneNode( true ).fireEvent( "onclick" ); + } + + // Check if a radio maintains its value + // after being appended to the DOM + input = document.createElement("input"); + input.value = "t"; + input.setAttribute("type", "radio"); + support.radioValue = input.value === "t"; + + input.setAttribute("checked", "checked"); + div.appendChild( input ); + fragment = document.createDocumentFragment(); + fragment.appendChild( div.lastChild ); + + // WebKit doesn't clone checked state correctly in fragments + support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Check if a disconnected checkbox will retain its checked + // value of true after appended to the DOM (IE6/7) + support.appendChecked = input.checked; + + fragment.removeChild( input ); + fragment.appendChild( div ); + + div.innerHTML = ""; + + // Check if div with explicit width and no margin-right incorrectly + // gets computed margin-right based on width of container. For more + // info see bug #3333 + // Fails in WebKit before Feb 2011 nightlies + // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right + if ( window.getComputedStyle ) { + marginDiv = document.createElement( "div" ); + marginDiv.style.width = "0"; + marginDiv.style.marginRight = "0"; + div.style.width = "2px"; + div.appendChild( marginDiv ); + support.reliableMarginRight = + ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0; + } + + // Technique from Juriy Zaytsev + // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/ + // We only care about the case where non-standard event systems + // are used, namely in IE. Short-circuiting here helps us to + // avoid an eval call (in setAttribute) which can cause CSP + // to go haywire. See: https://developer.mozilla.org/en/Security/CSP + if ( div.attachEvent ) { + for( i in { + submit: 1, + change: 1, + focusin: 1 + }) { + eventName = "on" + i; + isSupported = ( eventName in div ); + if ( !isSupported ) { + div.setAttribute( eventName, "return;" ); + isSupported = ( typeof div[ eventName ] === "function" ); + } + support[ i + "Bubbles" ] = isSupported; + } + } + + fragment.removeChild( div ); + + // Null elements to avoid leaks in IE + fragment = select = opt = marginDiv = div = input = null; + + // Run tests that need a body at doc ready + jQuery(function() { + var container, outer, inner, table, td, offsetSupport, + conMarginTop, ptlm, vb, style, html, + body = document.getElementsByTagName("body")[0]; + + if ( !body ) { + // Return for frameset docs that don't have a body + return; + } + + conMarginTop = 1; + ptlm = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;"; + vb = "visibility:hidden;border:0;"; + style = "style='" + ptlm + "border:5px solid #000;padding:0;'"; + html = "
      " + + "" + + "
      "; + + container = document.createElement("div"); + container.style.cssText = vb + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px"; + body.insertBefore( container, body.firstChild ); + + // Construct the test element + div = document.createElement("div"); + container.appendChild( div ); + + // Check if table cells still have offsetWidth/Height when they are set + // to display:none and there are still other visible table cells in a + // table row; if so, offsetWidth/Height are not reliable for use when + // determining if an element has been hidden directly using + // display:none (it is still safe to use offsets if a parent element is + // hidden; don safety goggles and see bug #4512 for more information). + // (only IE 8 fails this test) + div.innerHTML = "
      t
      "; + tds = div.getElementsByTagName( "td" ); + isSupported = ( tds[ 0 ].offsetHeight === 0 ); + + tds[ 0 ].style.display = ""; + tds[ 1 ].style.display = "none"; + + // Check if empty table cells still have offsetWidth/Height + // (IE <= 8 fail this test) + support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); + + // Figure out if the W3C box model works as expected + div.innerHTML = ""; + div.style.width = div.style.paddingLeft = "1px"; + jQuery.boxModel = support.boxModel = div.offsetWidth === 2; + + if ( typeof div.style.zoom !== "undefined" ) { + // Check if natively block-level elements act like inline-block + // elements when setting their display to 'inline' and giving + // them layout + // (IE < 8 does this) + div.style.display = "inline"; + div.style.zoom = 1; + support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 ); + + // Check if elements with layout shrink-wrap their children + // (IE 6 does this) + div.style.display = ""; + div.innerHTML = "
      "; + support.shrinkWrapBlocks = ( div.offsetWidth !== 2 ); + } + + div.style.cssText = ptlm + vb; + div.innerHTML = html; + + outer = div.firstChild; + inner = outer.firstChild; + td = outer.nextSibling.firstChild.firstChild; + + offsetSupport = { + doesNotAddBorder: ( inner.offsetTop !== 5 ), + doesAddBorderForTableAndCells: ( td.offsetTop === 5 ) + }; + + inner.style.position = "fixed"; + inner.style.top = "20px"; + + // safari subtracts parent border width here which is 5px + offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 ); + inner.style.position = inner.style.top = ""; + + outer.style.overflow = "hidden"; + outer.style.position = "relative"; + + offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 ); + offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop ); + + body.removeChild( container ); + div = container = null; + + jQuery.extend( support, offsetSupport ); + }); + + return support; +})(); + + + + +var rbrace = /^(?:\{.*\}|\[.*\])$/, + rmultiDash = /([A-Z])/g; + +jQuery.extend({ + cache: {}, + + // Please use with caution + uuid: 0, + + // Unique for each copy of jQuery on the page + // Non-digits removed to match rinlinejQuery + expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ), + + // The following elements throw uncatchable exceptions if you + // attempt to add expando properties to them. + noData: { + "embed": true, + // Ban all objects except for Flash (which handle expandos) + "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", + "applet": true + }, + + hasData: function( elem ) { + elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; + return !!elem && !isEmptyDataObject( elem ); + }, + + data: function( elem, name, data, pvt /* Internal Use Only */ ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var privateCache, thisCache, ret, + internalKey = jQuery.expando, + getByName = typeof name === "string", + + // We have to handle DOM nodes and JS objects differently because IE6-7 + // can't GC object references properly across the DOM-JS boundary + isNode = elem.nodeType, + + // Only DOM nodes need the global jQuery cache; JS object data is + // attached directly to the object so GC can occur automatically + cache = isNode ? jQuery.cache : elem, + + // Only defining an ID for JS objects if its cache already exists allows + // the code to shortcut on the same path as a DOM node with no cache + id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey, + isEvents = name === "events"; + + // Avoid doing any more work than we need to when trying to get data on an + // object that has no data at all + if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) { + return; + } + + if ( !id ) { + // Only DOM nodes need a new unique ID for each element since their data + // ends up in the global cache + if ( isNode ) { + elem[ internalKey ] = id = ++jQuery.uuid; + } else { + id = internalKey; + } + } + + if ( !cache[ id ] ) { + cache[ id ] = {}; + + // Avoids exposing jQuery metadata on plain JS objects when the object + // is serialized using JSON.stringify + if ( !isNode ) { + cache[ id ].toJSON = jQuery.noop; + } + } + + // An object can be passed to jQuery.data instead of a key/value pair; this gets + // shallow copied over onto the existing cache + if ( typeof name === "object" || typeof name === "function" ) { + if ( pvt ) { + cache[ id ] = jQuery.extend( cache[ id ], name ); + } else { + cache[ id ].data = jQuery.extend( cache[ id ].data, name ); + } + } + + privateCache = thisCache = cache[ id ]; + + // jQuery data() is stored in a separate object inside the object's internal data + // cache in order to avoid key collisions between internal data and user-defined + // data. + if ( !pvt ) { + if ( !thisCache.data ) { + thisCache.data = {}; + } + + thisCache = thisCache.data; + } + + if ( data !== undefined ) { + thisCache[ jQuery.camelCase( name ) ] = data; + } + + // Users should not attempt to inspect the internal events object using jQuery.data, + // it is undocumented and subject to change. But does anyone listen? No. + if ( isEvents && !thisCache[ name ] ) { + return privateCache.events; + } + + // Check for both converted-to-camel and non-converted data property names + // If a data property was specified + if ( getByName ) { + + // First Try to find as-is property data + ret = thisCache[ name ]; + + // Test for null|undefined property data + if ( ret == null ) { + + // Try to find the camelCased property + ret = thisCache[ jQuery.camelCase( name ) ]; + } + } else { + ret = thisCache; + } + + return ret; + }, + + removeData: function( elem, name, pvt /* Internal Use Only */ ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var thisCache, i, l, + + // Reference to internal data cache key + internalKey = jQuery.expando, + + isNode = elem.nodeType, + + // See jQuery.data for more information + cache = isNode ? jQuery.cache : elem, + + // See jQuery.data for more information + id = isNode ? elem[ internalKey ] : internalKey; + + // If there is already no cache entry for this object, there is no + // purpose in continuing + if ( !cache[ id ] ) { + return; + } + + if ( name ) { + + thisCache = pvt ? cache[ id ] : cache[ id ].data; + + if ( thisCache ) { + + // Support array or space separated string names for data keys + if ( !jQuery.isArray( name ) ) { + + // try the string as a key before any manipulation + if ( name in thisCache ) { + name = [ name ]; + } else { + + // split the camel cased version by spaces unless a key with the spaces exists + name = jQuery.camelCase( name ); + if ( name in thisCache ) { + name = [ name ]; + } else { + name = name.split( " " ); + } + } + } + + for ( i = 0, l = name.length; i < l; i++ ) { + delete thisCache[ name[i] ]; + } + + // If there is no data left in the cache, we want to continue + // and let the cache object itself get destroyed + if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) { + return; + } + } + } + + // See jQuery.data for more information + if ( !pvt ) { + delete cache[ id ].data; + + // Don't destroy the parent cache unless the internal data object + // had been the only thing left in it + if ( !isEmptyDataObject(cache[ id ]) ) { + return; + } + } + + // Browsers that fail expando deletion also refuse to delete expandos on + // the window, but it will allow it on all other JS objects; other browsers + // don't care + // Ensure that `cache` is not a window object #10080 + if ( jQuery.support.deleteExpando || !cache.setInterval ) { + delete cache[ id ]; + } else { + cache[ id ] = null; + } + + // We destroyed the cache and need to eliminate the expando on the node to avoid + // false lookups in the cache for entries that no longer exist + if ( isNode ) { + // IE does not allow us to delete expando properties from nodes, + // nor does it have a removeAttribute function on Document nodes; + // we must handle all of these cases + if ( jQuery.support.deleteExpando ) { + delete elem[ internalKey ]; + } else if ( elem.removeAttribute ) { + elem.removeAttribute( internalKey ); + } else { + elem[ internalKey ] = null; + } + } + }, + + // For internal use only. + _data: function( elem, name, data ) { + return jQuery.data( elem, name, data, true ); + }, + + // A method for determining if a DOM node can handle the data expando + acceptData: function( elem ) { + if ( elem.nodeName ) { + var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; + + if ( match ) { + return !(match === true || elem.getAttribute("classid") !== match); + } + } + + return true; + } +}); + +jQuery.fn.extend({ + data: function( key, value ) { + var parts, attr, name, + data = null; + + if ( typeof key === "undefined" ) { + if ( this.length ) { + data = jQuery.data( this[0] ); + + if ( this[0].nodeType === 1 && !jQuery._data( this[0], "parsedAttrs" ) ) { + attr = this[0].attributes; + for ( var i = 0, l = attr.length; i < l; i++ ) { + name = attr[i].name; + + if ( name.indexOf( "data-" ) === 0 ) { + name = jQuery.camelCase( name.substring(5) ); + + dataAttr( this[0], name, data[ name ] ); + } + } + jQuery._data( this[0], "parsedAttrs", true ); + } + } + + return data; + + } else if ( typeof key === "object" ) { + return this.each(function() { + jQuery.data( this, key ); + }); + } + + parts = key.split("."); + parts[1] = parts[1] ? "." + parts[1] : ""; + + if ( value === undefined ) { + data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); + + // Try to fetch any internally stored data first + if ( data === undefined && this.length ) { + data = jQuery.data( this[0], key ); + data = dataAttr( this[0], key, data ); + } + + return data === undefined && parts[1] ? + this.data( parts[0] ) : + data; + + } else { + return this.each(function() { + var self = jQuery( this ), + args = [ parts[0], value ]; + + self.triggerHandler( "setData" + parts[1] + "!", args ); + jQuery.data( this, key, value ); + self.triggerHandler( "changeData" + parts[1] + "!", args ); + }); + } + }, + + removeData: function( key ) { + return this.each(function() { + jQuery.removeData( this, key ); + }); + } +}); + +function dataAttr( elem, key, data ) { + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + + var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); + + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : + jQuery.isNumeric( data ) ? parseFloat( data ) : + rbrace.test( data ) ? jQuery.parseJSON( data ) : + data; + } catch( e ) {} + + // Make sure we set the data so it isn't changed later + jQuery.data( elem, key, data ); + + } else { + data = undefined; + } + } + + return data; +} + +// checks a cache object for emptiness +function isEmptyDataObject( obj ) { + for ( var name in obj ) { + + // if the public data object is empty, the private is still empty + if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { + continue; + } + if ( name !== "toJSON" ) { + return false; + } + } + + return true; +} + + + + +function handleQueueMarkDefer( elem, type, src ) { + var deferDataKey = type + "defer", + queueDataKey = type + "queue", + markDataKey = type + "mark", + defer = jQuery._data( elem, deferDataKey ); + if ( defer && + ( src === "queue" || !jQuery._data(elem, queueDataKey) ) && + ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) { + // Give room for hard-coded callbacks to fire first + // and eventually mark/queue something else on the element + setTimeout( function() { + if ( !jQuery._data( elem, queueDataKey ) && + !jQuery._data( elem, markDataKey ) ) { + jQuery.removeData( elem, deferDataKey, true ); + defer.fire(); + } + }, 0 ); + } +} + +jQuery.extend({ + + _mark: function( elem, type ) { + if ( elem ) { + type = ( type || "fx" ) + "mark"; + jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 ); + } + }, + + _unmark: function( force, elem, type ) { + if ( force !== true ) { + type = elem; + elem = force; + force = false; + } + if ( elem ) { + type = type || "fx"; + var key = type + "mark", + count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 ); + if ( count ) { + jQuery._data( elem, key, count ); + } else { + jQuery.removeData( elem, key, true ); + handleQueueMarkDefer( elem, type, "mark" ); + } + } + }, + + queue: function( elem, type, data ) { + var q; + if ( elem ) { + type = ( type || "fx" ) + "queue"; + q = jQuery._data( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !q || jQuery.isArray(data) ) { + q = jQuery._data( elem, type, jQuery.makeArray(data) ); + } else { + q.push( data ); + } + } + return q || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + fn = queue.shift(), + hooks = {}; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + } + + if ( fn ) { + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + jQuery._data( elem, type + ".run", hooks ); + fn.call( elem, function() { + jQuery.dequeue( elem, type ); + }, hooks ); + } + + if ( !queue.length ) { + jQuery.removeData( elem, type + "queue " + type + ".run", true ); + handleQueueMarkDefer( elem, type, "queue" ); + } + } +}); + +jQuery.fn.extend({ + queue: function( type, data ) { + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + } + + if ( data === undefined ) { + return jQuery.queue( this[0], type ); + } + return this.each(function() { + var queue = jQuery.queue( this, type, data ); + + if ( type === "fx" && queue[0] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + }); + }, + dequeue: function( type ) { + return this.each(function() { + jQuery.dequeue( this, type ); + }); + }, + // Based off of the plugin by Clint Helfers, with permission. + // http://blindsignals.com/index.php/2009/07/jquery-delay/ + delay: function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; + type = type || "fx"; + + return this.queue( type, function( next, hooks ) { + var timeout = setTimeout( next, time ); + hooks.stop = function() { + clearTimeout( timeout ); + }; + }); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, object ) { + if ( typeof type !== "string" ) { + object = type; + type = undefined; + } + type = type || "fx"; + var defer = jQuery.Deferred(), + elements = this, + i = elements.length, + count = 1, + deferDataKey = type + "defer", + queueDataKey = type + "queue", + markDataKey = type + "mark", + tmp; + function resolve() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + } + while( i-- ) { + if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) || + ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) || + jQuery.data( elements[ i ], markDataKey, undefined, true ) ) && + jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) { + count++; + tmp.add( resolve ); + } + } + resolve(); + return defer.promise(); + } +}); + + + + +var rclass = /[\n\t\r]/g, + rspace = /\s+/, + rreturn = /\r/g, + rtype = /^(?:button|input)$/i, + rfocusable = /^(?:button|input|object|select|textarea)$/i, + rclickable = /^a(?:rea)?$/i, + rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, + getSetAttribute = jQuery.support.getSetAttribute, + nodeHook, boolHook, fixSpecified; + +jQuery.fn.extend({ + attr: function( name, value ) { + return jQuery.access( this, name, value, true, jQuery.attr ); + }, + + removeAttr: function( name ) { + return this.each(function() { + jQuery.removeAttr( this, name ); + }); + }, + + prop: function( name, value ) { + return jQuery.access( this, name, value, true, jQuery.prop ); + }, + + removeProp: function( name ) { + name = jQuery.propFix[ name ] || name; + return this.each(function() { + // try/catch handles cases where IE balks (such as removing a property on window) + try { + this[ name ] = undefined; + delete this[ name ]; + } catch( e ) {} + }); + }, + + addClass: function( value ) { + var classNames, i, l, elem, + setClass, c, cl; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( j ) { + jQuery( this ).addClass( value.call(this, j, this.className) ); + }); + } + + if ( value && typeof value === "string" ) { + classNames = value.split( rspace ); + + for ( i = 0, l = this.length; i < l; i++ ) { + elem = this[ i ]; + + if ( elem.nodeType === 1 ) { + if ( !elem.className && classNames.length === 1 ) { + elem.className = value; + + } else { + setClass = " " + elem.className + " "; + + for ( c = 0, cl = classNames.length; c < cl; c++ ) { + if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) { + setClass += classNames[ c ] + " "; + } + } + elem.className = jQuery.trim( setClass ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + var classNames, i, l, elem, className, c, cl; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( j ) { + jQuery( this ).removeClass( value.call(this, j, this.className) ); + }); + } + + if ( (value && typeof value === "string") || value === undefined ) { + classNames = ( value || "" ).split( rspace ); + + for ( i = 0, l = this.length; i < l; i++ ) { + elem = this[ i ]; + + if ( elem.nodeType === 1 && elem.className ) { + if ( value ) { + className = (" " + elem.className + " ").replace( rclass, " " ); + for ( c = 0, cl = classNames.length; c < cl; c++ ) { + className = className.replace(" " + classNames[ c ] + " ", " "); + } + elem.className = jQuery.trim( className ); + + } else { + elem.className = ""; + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, + isBool = typeof stateVal === "boolean"; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( i ) { + jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); + }); + } + + return this.each(function() { + if ( type === "string" ) { + // toggle individual class names + var className, + i = 0, + self = jQuery( this ), + state = stateVal, + classNames = value.split( rspace ); + + while ( (className = classNames[ i++ ]) ) { + // check each className given, space seperated list + state = isBool ? state : !self.hasClass( className ); + self[ state ? "addClass" : "removeClass" ]( className ); + } + + } else if ( type === "undefined" || type === "boolean" ) { + if ( this.className ) { + // store className if set + jQuery._data( this, "__className__", this.className ); + } + + // toggle whole className + this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; + } + }); + }, + + hasClass: function( selector ) { + var className = " " + selector + " ", + i = 0, + l = this.length; + for ( ; i < l; i++ ) { + if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { + return true; + } + } + + return false; + }, + + val: function( value ) { + var hooks, ret, isFunction, + elem = this[0]; + + if ( !arguments.length ) { + if ( elem ) { + hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ]; + + if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { + return ret; + } + + ret = elem.value; + + return typeof ret === "string" ? + // handle most common string cases + ret.replace(rreturn, "") : + // handle cases where value is null/undef or number + ret == null ? "" : ret; + } + + return; + } + + isFunction = jQuery.isFunction( value ); + + return this.each(function( i ) { + var self = jQuery(this), val; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( isFunction ) { + val = value.call( this, i, self.val() ); + } else { + val = value; + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + } else if ( typeof val === "number" ) { + val += ""; + } else if ( jQuery.isArray( val ) ) { + val = jQuery.map(val, function ( value ) { + return value == null ? "" : value + ""; + }); + } + + hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ]; + + // If set returns undefined, fall back to normal setting + if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { + this.value = val; + } + }); + } +}); + +jQuery.extend({ + valHooks: { + option: { + get: function( elem ) { + // attributes.value is undefined in Blackberry 4.7 but + // uses .value. See #6932 + var val = elem.attributes.value; + return !val || val.specified ? elem.value : elem.text; + } + }, + select: { + get: function( elem ) { + var value, i, max, option, + index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type === "select-one"; + + // Nothing was selected + if ( index < 0 ) { + return null; + } + + // Loop through all the selected options + i = one ? index : 0; + max = one ? index + 1 : options.length; + for ( ; i < max; i++ ) { + option = options[ i ]; + + // Don't return options that are disabled or in a disabled optgroup + if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && + (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { + + // Get the specific value for the option + value = jQuery( option ).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + // Fixes Bug #2551 -- select.val() broken in IE after form.reset() + if ( one && !values.length && options.length ) { + return jQuery( options[ index ] ).val(); + } + + return values; + }, + + set: function( elem, value ) { + var values = jQuery.makeArray( value ); + + jQuery(elem).find("option").each(function() { + this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; + }); + + if ( !values.length ) { + elem.selectedIndex = -1; + } + return values; + } + } + }, + + attrFn: { + val: true, + css: true, + html: true, + text: true, + data: true, + width: true, + height: true, + offset: true + }, + + attr: function( elem, name, value, pass ) { + var ret, hooks, notxml, + nType = elem.nodeType; + + // don't get/set attributes on text, comment and attribute nodes + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + if ( pass && name in jQuery.attrFn ) { + return jQuery( elem )[ name ]( value ); + } + + // Fallback to prop when attributes are not supported + if ( typeof elem.getAttribute === "undefined" ) { + return jQuery.prop( elem, name, value ); + } + + notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); + + // All attributes are lowercase + // Grab necessary hook if one is defined + if ( notxml ) { + name = name.toLowerCase(); + hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook ); + } + + if ( value !== undefined ) { + + if ( value === null ) { + jQuery.removeAttr( elem, name ); + return; + + } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) { + return ret; + + } else { + elem.setAttribute( name, "" + value ); + return value; + } + + } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) { + return ret; + + } else { + + ret = elem.getAttribute( name ); + + // Non-existent attributes return null, we normalize to undefined + return ret === null ? + undefined : + ret; + } + }, + + removeAttr: function( elem, value ) { + var propName, attrNames, name, l, + i = 0; + + if ( value && elem.nodeType === 1 ) { + attrNames = value.toLowerCase().split( rspace ); + l = attrNames.length; + + for ( ; i < l; i++ ) { + name = attrNames[ i ]; + + if ( name ) { + propName = jQuery.propFix[ name ] || name; + + // See #9699 for explanation of this approach (setting first, then removal) + jQuery.attr( elem, name, "" ); + elem.removeAttribute( getSetAttribute ? name : propName ); + + // Set corresponding property to false for boolean attributes + if ( rboolean.test( name ) && propName in elem ) { + elem[ propName ] = false; + } + } + } + } + }, + + attrHooks: { + type: { + set: function( elem, value ) { + // We can't allow the type property to be changed (since it causes problems in IE) + if ( rtype.test( elem.nodeName ) && elem.parentNode ) { + jQuery.error( "type property can't be changed" ); + } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { + // Setting the type on a radio button after the value resets the value in IE6-9 + // Reset value to it's default in case type is set after value + // This is for element creation + var val = elem.value; + elem.setAttribute( "type", value ); + if ( val ) { + elem.value = val; + } + return value; + } + } + }, + // Use the value property for back compat + // Use the nodeHook for button elements in IE6/7 (#1954) + value: { + get: function( elem, name ) { + if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { + return nodeHook.get( elem, name ); + } + return name in elem ? + elem.value : + null; + }, + set: function( elem, value, name ) { + if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { + return nodeHook.set( elem, value, name ); + } + // Does not return so that setAttribute is also used + elem.value = value; + } + } + }, + + propFix: { + tabindex: "tabIndex", + readonly: "readOnly", + "for": "htmlFor", + "class": "className", + maxlength: "maxLength", + cellspacing: "cellSpacing", + cellpadding: "cellPadding", + rowspan: "rowSpan", + colspan: "colSpan", + usemap: "useMap", + frameborder: "frameBorder", + contenteditable: "contentEditable" + }, + + prop: function( elem, name, value ) { + var ret, hooks, notxml, + nType = elem.nodeType; + + // don't get/set properties on text, comment and attribute nodes + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); + + if ( notxml ) { + // Fix name and attach hooks + name = jQuery.propFix[ name ] || name; + hooks = jQuery.propHooks[ name ]; + } + + if ( value !== undefined ) { + if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { + return ret; + + } else { + return ( elem[ name ] = value ); + } + + } else { + if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { + return ret; + + } else { + return elem[ name ]; + } + } + }, + + propHooks: { + tabIndex: { + get: function( elem ) { + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + var attributeNode = elem.getAttributeNode("tabindex"); + + return attributeNode && attributeNode.specified ? + parseInt( attributeNode.value, 10 ) : + rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? + 0 : + undefined; + } + } + } +}); + +// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional) +jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex; + +// Hook for boolean attributes +boolHook = { + get: function( elem, name ) { + // Align boolean attributes with corresponding properties + // Fall back to attribute presence where some booleans are not supported + var attrNode, + property = jQuery.prop( elem, name ); + return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ? + name.toLowerCase() : + undefined; + }, + set: function( elem, value, name ) { + var propName; + if ( value === false ) { + // Remove boolean attributes when set to false + jQuery.removeAttr( elem, name ); + } else { + // value is true since we know at this point it's type boolean and not false + // Set boolean attributes to the same name and set the DOM property + propName = jQuery.propFix[ name ] || name; + if ( propName in elem ) { + // Only set the IDL specifically if it already exists on the element + elem[ propName ] = true; + } + + elem.setAttribute( name, name.toLowerCase() ); + } + return name; + } +}; + +// IE6/7 do not support getting/setting some attributes with get/setAttribute +if ( !getSetAttribute ) { + + fixSpecified = { + name: true, + id: true + }; + + // Use this for any attribute in IE6/7 + // This fixes almost every IE6/7 issue + nodeHook = jQuery.valHooks.button = { + get: function( elem, name ) { + var ret; + ret = elem.getAttributeNode( name ); + return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ? + ret.nodeValue : + undefined; + }, + set: function( elem, value, name ) { + // Set the existing or create a new attribute node + var ret = elem.getAttributeNode( name ); + if ( !ret ) { + ret = document.createAttribute( name ); + elem.setAttributeNode( ret ); + } + return ( ret.nodeValue = value + "" ); + } + }; + + // Apply the nodeHook to tabindex + jQuery.attrHooks.tabindex.set = nodeHook.set; + + // Set width and height to auto instead of 0 on empty string( Bug #8150 ) + // This is for removals + jQuery.each([ "width", "height" ], function( i, name ) { + jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { + set: function( elem, value ) { + if ( value === "" ) { + elem.setAttribute( name, "auto" ); + return value; + } + } + }); + }); + + // Set contenteditable to false on removals(#10429) + // Setting to empty string throws an error as an invalid value + jQuery.attrHooks.contenteditable = { + get: nodeHook.get, + set: function( elem, value, name ) { + if ( value === "" ) { + value = "false"; + } + nodeHook.set( elem, value, name ); + } + }; +} + + +// Some attributes require a special call on IE +if ( !jQuery.support.hrefNormalized ) { + jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { + jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { + get: function( elem ) { + var ret = elem.getAttribute( name, 2 ); + return ret === null ? undefined : ret; + } + }); + }); +} + +if ( !jQuery.support.style ) { + jQuery.attrHooks.style = { + get: function( elem ) { + // Return undefined in the case of empty string + // Normalize to lowercase since IE uppercases css property names + return elem.style.cssText.toLowerCase() || undefined; + }, + set: function( elem, value ) { + return ( elem.style.cssText = "" + value ); + } + }; +} + +// Safari mis-reports the default selected property of an option +// Accessing the parent's selectedIndex property fixes it +if ( !jQuery.support.optSelected ) { + jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { + get: function( elem ) { + var parent = elem.parentNode; + + if ( parent ) { + parent.selectedIndex; + + // Make sure that it also works with optgroups, see #5701 + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + return null; + } + }); +} + +// IE6/7 call enctype encoding +if ( !jQuery.support.enctype ) { + jQuery.propFix.enctype = "encoding"; +} + +// Radios and checkboxes getter/setter +if ( !jQuery.support.checkOn ) { + jQuery.each([ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = { + get: function( elem ) { + // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified + return elem.getAttribute("value") === null ? "on" : elem.value; + } + }; + }); +} +jQuery.each([ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { + set: function( elem, value ) { + if ( jQuery.isArray( value ) ) { + return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); + } + } + }); +}); + + + + +var rformElems = /^(?:textarea|input|select)$/i, + rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/, + rhoverHack = /\bhover(\.\S+)?\b/, + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|contextmenu)|click/, + rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, + rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/, + quickParse = function( selector ) { + var quick = rquickIs.exec( selector ); + if ( quick ) { + // 0 1 2 3 + // [ _, tag, id, class ] + quick[1] = ( quick[1] || "" ).toLowerCase(); + quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" ); + } + return quick; + }, + quickIs = function( elem, m ) { + var attrs = elem.attributes || {}; + return ( + (!m[1] || elem.nodeName.toLowerCase() === m[1]) && + (!m[2] || (attrs.id || {}).value === m[2]) && + (!m[3] || m[3].test( (attrs[ "class" ] || {}).value )) + ); + }, + hoverHack = function( events ) { + return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" ); + }; + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + add: function( elem, types, handler, data, selector ) { + + var elemData, eventHandle, events, + t, tns, type, namespaces, handleObj, + handleObjIn, quick, handlers, special; + + // Don't attach events to noData or text/comment nodes (allow plain objects tho) + if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + events = elemData.events; + if ( !events ) { + elemData.events = events = {}; + } + eventHandle = elemData.handle; + if ( !eventHandle ) { + elemData.handle = eventHandle = function( e ) { + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? + jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : + undefined; + }; + // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events + eventHandle.elem = elem; + } + + // Handle multiple events separated by a space + // jQuery(...).bind("mouseover mouseout", fn); + types = jQuery.trim( hoverHack(types) ).split( " " ); + for ( t = 0; t < types.length; t++ ) { + + tns = rtypenamespace.exec( types[t] ) || []; + type = tns[1]; + namespaces = ( tns[2] || "" ).split( "." ).sort(); + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend({ + type: type, + origType: tns[1], + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + quick: quickParse( selector ), + namespace: namespaces.join(".") + }, handleObjIn ); + + // Init the event handler queue if we're the first + handlers = events[ type ]; + if ( !handlers ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener/attachEvent if the special events handler returns false + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + // Bind the global event handler to the element + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + // Nullify elem to prevent memory leaks in IE + elem = null; + }, + + global: {}, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + + var elemData = jQuery.hasData( elem ) && jQuery._data( elem ), + t, tns, type, origType, namespaces, origCount, + j, events, special, handle, eventType, handleObj; + + if ( !elemData || !(events = elemData.events) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = jQuery.trim( hoverHack( types || "" ) ).split(" "); + for ( t = 0; t < types.length; t++ ) { + tns = rtypenamespace.exec( types[t] ) || []; + type = origType = tns[1]; + namespaces = tns[2]; + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector? special.delegateType : special.bindType ) || type; + eventType = events[ type ] || []; + origCount = eventType.length; + namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null; + + // Remove matching events + for ( j = 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !namespaces || namespaces.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { + eventType.splice( j--, 1 ); + + if ( handleObj.selector ) { + eventType.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( eventType.length === 0 && origCount !== eventType.length ) { + if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + handle = elemData.handle; + if ( handle ) { + handle.elem = null; + } + + // removeData also checks for emptiness and clears the expando if empty + // so use it instead of delete + jQuery.removeData( elem, [ "events", "handle" ], true ); + } + }, + + // Events that are safe to short-circuit if no handlers are attached. + // Native DOM events should not be added, they may have inline handlers. + customEvent: { + "getData": true, + "setData": true, + "changeData": true + }, + + trigger: function( event, data, elem, onlyHandlers ) { + // Don't do events on text and comment nodes + if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) { + return; + } + + // Event object or event type + var type = event.type || event, + namespaces = [], + cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType; + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf( "!" ) >= 0 ) { + // Exclusive events trigger only for the exact event (no namespaces) + type = type.slice(0, -1); + exclusive = true; + } + + if ( type.indexOf( "." ) >= 0 ) { + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split("."); + type = namespaces.shift(); + namespaces.sort(); + } + + if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) { + // No jQuery handlers for this event type, and it can't have inline handlers + return; + } + + // Caller can pass in an Event, Object, or just an event type string + event = typeof event === "object" ? + // jQuery.Event object + event[ jQuery.expando ] ? event : + // Object literal + new jQuery.Event( type, event ) : + // Just the event type (string) + new jQuery.Event( type ); + + event.type = type; + event.isTrigger = true; + event.exclusive = exclusive; + event.namespace = namespaces.join( "." ); + event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null; + ontype = type.indexOf( ":" ) < 0 ? "on" + type : ""; + + // Handle a global trigger + if ( !elem ) { + + // TODO: Stop taunting the data cache; remove global events and always attach to document + cache = jQuery.cache; + for ( i in cache ) { + if ( cache[ i ].events && cache[ i ].events[ type ] ) { + jQuery.event.trigger( event, data, cache[ i ].handle.elem, true ); + } + } + return; + } + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data != null ? jQuery.makeArray( data ) : []; + data.unshift( event ); + + // Allow special events to draw outside the lines + special = jQuery.event.special[ type ] || {}; + if ( special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + eventPath = [[ elem, special.bindType || type ]]; + if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode; + old = null; + for ( ; cur; cur = cur.parentNode ) { + eventPath.push([ cur, bubbleType ]); + old = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( old && old === elem.ownerDocument ) { + eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]); + } + } + + // Fire handlers on the event path + for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) { + + cur = eventPath[i][0]; + event.type = eventPath[i][1]; + + handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); + if ( handle ) { + handle.apply( cur, data ); + } + // Note that this is a bare JS function and not a jQuery handler + handle = ontype && cur[ ontype ]; + if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) { + event.preventDefault(); + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) && + !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name name as the event. + // Can't use an .isFunction() check here because IE6/7 fails that test. + // Don't do default actions on window, that's where global variables be (#6170) + // IE<9 dies on focus/blur to hidden element (#1486) + if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + old = elem[ ontype ]; + + if ( old ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + jQuery.event.triggered = type; + elem[ type ](); + jQuery.event.triggered = undefined; + + if ( old ) { + elem[ ontype ] = old; + } + } + } + } + + return event.result; + }, + + dispatch: function( event ) { + + // Make a writable jQuery.Event from the native event object + event = jQuery.event.fix( event || window.event ); + + var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []), + delegateCount = handlers.delegateCount, + args = [].slice.call( arguments, 0 ), + run_all = !event.exclusive && !event.namespace, + handlerQueue = [], + i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[0] = event; + event.delegateTarget = this; + + // Determine handlers that should run if there are delegated events + // Avoid disabled elements in IE (#6911) and non-left-click bubbling in Firefox (#3861) + if ( delegateCount && !event.target.disabled && !(event.button && event.type === "click") ) { + + // Pregenerate a single jQuery object for reuse with .is() + jqcur = jQuery(this); + jqcur.context = this.ownerDocument || this; + + for ( cur = event.target; cur != this; cur = cur.parentNode || this ) { + selMatch = {}; + matches = []; + jqcur[0] = cur; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + sel = handleObj.selector; + + if ( selMatch[ sel ] === undefined ) { + selMatch[ sel ] = ( + handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel ) + ); + } + if ( selMatch[ sel ] ) { + matches.push( handleObj ); + } + } + if ( matches.length ) { + handlerQueue.push({ elem: cur, matches: matches }); + } + } + } + + // Add the remaining (directly-bound) handlers + if ( handlers.length > delegateCount ) { + handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) }); + } + + // Run delegates first; they may want to stop propagation beneath us + for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) { + matched = handlerQueue[ i ]; + event.currentTarget = matched.elem; + + for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) { + handleObj = matched.matches[ j ]; + + // Triggered event must either 1) be non-exclusive and have no namespace, or + // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). + if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) { + + event.data = handleObj.data; + event.handleObj = handleObj; + + ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) + .apply( matched.elem, args ); + + if ( ret !== undefined ) { + event.result = ret; + if ( ret === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + return event.result; + }, + + // Includes some event props shared by KeyEvent and MouseEvent + // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 *** + props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), + + fixHooks: {}, + + keyHooks: { + props: "char charCode key keyCode".split(" "), + filter: function( event, original ) { + + // Add which for key events + if ( event.which == null ) { + event.which = original.charCode != null ? original.charCode : original.keyCode; + } + + return event; + } + }, + + mouseHooks: { + props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), + filter: function( event, original ) { + var eventDoc, doc, body, + button = original.button, + fromElement = original.fromElement; + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && original.clientX != null ) { + eventDoc = event.target.ownerDocument || document; + doc = eventDoc.documentElement; + body = eventDoc.body; + + event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); + event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); + } + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && fromElement ) { + event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && button !== undefined ) { + event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); + } + + return event; + } + }, + + fix: function( event ) { + if ( event[ jQuery.expando ] ) { + return event; + } + + // Create a writable copy of the event object and normalize some properties + var i, prop, + originalEvent = event, + fixHook = jQuery.event.fixHooks[ event.type ] || {}, + copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; + + event = jQuery.Event( originalEvent ); + + for ( i = copy.length; i; ) { + prop = copy[ --i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2) + if ( !event.target ) { + event.target = originalEvent.srcElement || document; + } + + // Target should not be a text node (#504, Safari) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8) + if ( event.metaKey === undefined ) { + event.metaKey = event.ctrlKey; + } + + return fixHook.filter? fixHook.filter( event, originalEvent ) : event; + }, + + special: { + ready: { + // Make sure the ready event is setup + setup: jQuery.bindReady + }, + + load: { + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + + focus: { + delegateType: "focusin" + }, + blur: { + delegateType: "focusout" + }, + + beforeunload: { + setup: function( data, namespaces, eventHandle ) { + // We only want to do this special case on windows + if ( jQuery.isWindow( this ) ) { + this.onbeforeunload = eventHandle; + } + }, + + teardown: function( namespaces, eventHandle ) { + if ( this.onbeforeunload === eventHandle ) { + this.onbeforeunload = null; + } + } + } + }, + + simulate: function( type, elem, event, bubble ) { + // Piggyback on a donor event to simulate a different one. + // Fake originalEvent to avoid donor's stopPropagation, but if the + // simulated event prevents default then we do the same on the donor. + var e = jQuery.extend( + new jQuery.Event(), + event, + { type: type, + isSimulated: true, + originalEvent: {} + } + ); + if ( bubble ) { + jQuery.event.trigger( e, null, elem ); + } else { + jQuery.event.dispatch.call( elem, e ); + } + if ( e.isDefaultPrevented() ) { + event.preventDefault(); + } + } +}; + +// Some plugins are using, but it's undocumented/deprecated and will be removed. +// The 1.7 special event interface should provide all the hooks needed now. +jQuery.event.handle = jQuery.event.dispatch; + +jQuery.removeEvent = document.removeEventListener ? + function( elem, type, handle ) { + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle, false ); + } + } : + function( elem, type, handle ) { + if ( elem.detachEvent ) { + elem.detachEvent( "on" + type, handle ); + } + }; + +jQuery.Event = function( src, props ) { + // Allow instantiation without the 'new' keyword + if ( !(this instanceof jQuery.Event) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || + src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +function returnFalse() { + return false; +} +function returnTrue() { + return true; +} + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + preventDefault: function() { + this.isDefaultPrevented = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + + // if preventDefault exists run it on the original event + if ( e.preventDefault ) { + e.preventDefault(); + + // otherwise set the returnValue property of the original event to false (IE) + } else { + e.returnValue = false; + } + }, + stopPropagation: function() { + this.isPropagationStopped = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + // if stopPropagation exists run it on the original event + if ( e.stopPropagation ) { + e.stopPropagation(); + } + // otherwise set the cancelBubble property of the original event to true (IE) + e.cancelBubble = true; + }, + stopImmediatePropagation: function() { + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + }, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse +}; + +// Create mouseenter/leave events using mouseover/out and event-time checks +jQuery.each({ + mouseenter: "mouseover", + mouseleave: "mouseout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var target = this, + related = event.relatedTarget, + handleObj = event.handleObj, + selector = handleObj.selector, + ret; + + // For mousenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || (related !== target && !jQuery.contains( target, related )) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +}); + +// IE submit delegation +if ( !jQuery.support.submitBubbles ) { + + jQuery.event.special.submit = { + setup: function() { + // Only need this for delegated form submit events + if ( jQuery.nodeName( this, "form" ) ) { + return false; + } + + // Lazy-add a submit handler when a descendant form may potentially be submitted + jQuery.event.add( this, "click._submit keypress._submit", function( e ) { + // Node name check avoids a VML-related crash in IE (#9807) + var elem = e.target, + form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; + if ( form && !form._submit_attached ) { + jQuery.event.add( form, "submit._submit", function( event ) { + // If form was submitted by the user, bubble the event up the tree + if ( this.parentNode && !event.isTrigger ) { + jQuery.event.simulate( "submit", this.parentNode, event, true ); + } + }); + form._submit_attached = true; + } + }); + // return undefined since we don't need an event listener + }, + + teardown: function() { + // Only need this for delegated form submit events + if ( jQuery.nodeName( this, "form" ) ) { + return false; + } + + // Remove delegated handlers; cleanData eventually reaps submit handlers attached above + jQuery.event.remove( this, "._submit" ); + } + }; +} + +// IE change delegation and checkbox/radio fix +if ( !jQuery.support.changeBubbles ) { + + jQuery.event.special.change = { + + setup: function() { + + if ( rformElems.test( this.nodeName ) ) { + // IE doesn't fire change on a check/radio until blur; trigger it on click + // after a propertychange. Eat the blur-change in special.change.handle. + // This still fires onchange a second time for check/radio after blur. + if ( this.type === "checkbox" || this.type === "radio" ) { + jQuery.event.add( this, "propertychange._change", function( event ) { + if ( event.originalEvent.propertyName === "checked" ) { + this._just_changed = true; + } + }); + jQuery.event.add( this, "click._change", function( event ) { + if ( this._just_changed && !event.isTrigger ) { + this._just_changed = false; + jQuery.event.simulate( "change", this, event, true ); + } + }); + } + return false; + } + // Delegated event; lazy-add a change handler on descendant inputs + jQuery.event.add( this, "beforeactivate._change", function( e ) { + var elem = e.target; + + if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) { + jQuery.event.add( elem, "change._change", function( event ) { + if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { + jQuery.event.simulate( "change", this.parentNode, event, true ); + } + }); + elem._change_attached = true; + } + }); + }, + + handle: function( event ) { + var elem = event.target; + + // Swallow native change events from checkbox/radio, we already triggered them above + if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { + return event.handleObj.handler.apply( this, arguments ); + } + }, + + teardown: function() { + jQuery.event.remove( this, "._change" ); + + return rformElems.test( this.nodeName ); + } + }; +} + +// Create "bubbling" focus and blur events +if ( !jQuery.support.focusinBubbles ) { + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler while someone wants focusin/focusout + var attaches = 0, + handler = function( event ) { + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); + }; + + jQuery.event.special[ fix ] = { + setup: function() { + if ( attaches++ === 0 ) { + document.addEventListener( orig, handler, true ); + } + }, + teardown: function() { + if ( --attaches === 0 ) { + document.removeEventListener( orig, handler, true ); + } + } + }; + }); +} + +jQuery.fn.extend({ + + on: function( types, selector, data, fn, /*INTERNAL*/ one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + // ( types-Object, data ) + data = selector; + selector = undefined; + } + for ( type in types ) { + this.on( type, selector, data, types[ type ], one ); + } + return this; + } + + if ( data == null && fn == null ) { + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return this; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return this.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + }); + }, + one: function( types, selector, data, fn ) { + return this.on.call( this, types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + if ( types && types.preventDefault && types.handleObj ) { + // ( event ) dispatched jQuery.Event + var handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace? handleObj.type + "." + handleObj.namespace : handleObj.type, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + // ( types-object [, selector] ) + for ( var type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each(function() { + jQuery.event.remove( this, types, fn, selector ); + }); + }, + + bind: function( types, data, fn ) { + return this.on( types, null, data, fn ); + }, + unbind: function( types, fn ) { + return this.off( types, null, fn ); + }, + + live: function( types, data, fn ) { + jQuery( this.context ).on( types, this.selector, data, fn ); + return this; + }, + die: function( types, fn ) { + jQuery( this.context ).off( types, this.selector || "**", fn ); + return this; + }, + + delegate: function( selector, types, data, fn ) { + return this.on( types, selector, data, fn ); + }, + undelegate: function( selector, types, fn ) { + // ( namespace ) or ( selector, types [, fn] ) + return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn ); + }, + + trigger: function( type, data ) { + return this.each(function() { + jQuery.event.trigger( type, data, this ); + }); + }, + triggerHandler: function( type, data ) { + if ( this[0] ) { + return jQuery.event.trigger( type, data, this[0], true ); + } + }, + + toggle: function( fn ) { + // Save reference to arguments for access in closure + var args = arguments, + guid = fn.guid || jQuery.guid++, + i = 0, + toggler = function( event ) { + // Figure out which function to execute + var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i; + jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 ); + + // Make sure that clicks stop + event.preventDefault(); + + // and execute the function + return args[ lastToggle ].apply( this, arguments ) || false; + }; + + // link all the functions, so any of them can unbind this click handler + toggler.guid = guid; + while ( i < args.length ) { + args[ i++ ].guid = guid; + } + + return this.click( toggler ); + }, + + hover: function( fnOver, fnOut ) { + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); + } +}); + +jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + + "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { + + // Handle event binding + jQuery.fn[ name ] = function( data, fn ) { + if ( fn == null ) { + fn = data; + data = null; + } + + return arguments.length > 0 ? + this.on( name, null, data, fn ) : + this.trigger( name ); + }; + + if ( jQuery.attrFn ) { + jQuery.attrFn[ name ] = true; + } + + if ( rkeyEvent.test( name ) ) { + jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks; + } + + if ( rmouseEvent.test( name ) ) { + jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks; + } +}); + + + +/*! + * Sizzle CSS Selector Engine + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){ + +var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, + expando = "sizcache" + (Math.random() + '').replace('.', ''), + done = 0, + toString = Object.prototype.toString, + hasDuplicate = false, + baseHasDuplicate = true, + rBackslash = /\\/g, + rReturn = /\r\n/g, + rNonWord = /\W/; + +// Here we check if the JavaScript engine is using some sort of +// optimization where it does not always call our comparision +// function. If that is the case, discard the hasDuplicate value. +// Thus far that includes Google Chrome. +[0, 0].sort(function() { + baseHasDuplicate = false; + return 0; +}); + +var Sizzle = function( selector, context, results, seed ) { + results = results || []; + context = context || document; + + var origContext = context; + + if ( context.nodeType !== 1 && context.nodeType !== 9 ) { + return []; + } + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + var m, set, checkSet, extra, ret, cur, pop, i, + prune = true, + contextXML = Sizzle.isXML( context ), + parts = [], + soFar = selector; + + // Reset the position of the chunker regexp (start from head) + do { + chunker.exec( "" ); + m = chunker.exec( soFar ); + + if ( m ) { + soFar = m[3]; + + parts.push( m[1] ); + + if ( m[2] ) { + extra = m[3]; + break; + } + } + } while ( m ); + + if ( parts.length > 1 && origPOS.exec( selector ) ) { + + if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { + set = posProcess( parts[0] + parts[1], context, seed ); + + } else { + set = Expr.relative[ parts[0] ] ? + [ context ] : + Sizzle( parts.shift(), context ); + + while ( parts.length ) { + selector = parts.shift(); + + if ( Expr.relative[ selector ] ) { + selector += parts.shift(); + } + + set = posProcess( selector, set, seed ); + } + } + + } else { + // Take a shortcut and set the context if the root selector is an ID + // (but not if it'll be faster if the inner selector is an ID) + if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && + Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { + + ret = Sizzle.find( parts.shift(), context, contextXML ); + context = ret.expr ? + Sizzle.filter( ret.expr, ret.set )[0] : + ret.set[0]; + } + + if ( context ) { + ret = seed ? + { expr: parts.pop(), set: makeArray(seed) } : + Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); + + set = ret.expr ? + Sizzle.filter( ret.expr, ret.set ) : + ret.set; + + if ( parts.length > 0 ) { + checkSet = makeArray( set ); + + } else { + prune = false; + } + + while ( parts.length ) { + cur = parts.pop(); + pop = cur; + + if ( !Expr.relative[ cur ] ) { + cur = ""; + } else { + pop = parts.pop(); + } + + if ( pop == null ) { + pop = context; + } + + Expr.relative[ cur ]( checkSet, pop, contextXML ); + } + + } else { + checkSet = parts = []; + } + } + + if ( !checkSet ) { + checkSet = set; + } + + if ( !checkSet ) { + Sizzle.error( cur || selector ); + } + + if ( toString.call(checkSet) === "[object Array]" ) { + if ( !prune ) { + results.push.apply( results, checkSet ); + + } else if ( context && context.nodeType === 1 ) { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { + results.push( set[i] ); + } + } + + } else { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && checkSet[i].nodeType === 1 ) { + results.push( set[i] ); + } + } + } + + } else { + makeArray( checkSet, results ); + } + + if ( extra ) { + Sizzle( extra, origContext, results, seed ); + Sizzle.uniqueSort( results ); + } + + return results; +}; + +Sizzle.uniqueSort = function( results ) { + if ( sortOrder ) { + hasDuplicate = baseHasDuplicate; + results.sort( sortOrder ); + + if ( hasDuplicate ) { + for ( var i = 1; i < results.length; i++ ) { + if ( results[i] === results[ i - 1 ] ) { + results.splice( i--, 1 ); + } + } + } + } + + return results; +}; + +Sizzle.matches = function( expr, set ) { + return Sizzle( expr, null, null, set ); +}; + +Sizzle.matchesSelector = function( node, expr ) { + return Sizzle( expr, null, null, [node] ).length > 0; +}; + +Sizzle.find = function( expr, context, isXML ) { + var set, i, len, match, type, left; + + if ( !expr ) { + return []; + } + + for ( i = 0, len = Expr.order.length; i < len; i++ ) { + type = Expr.order[i]; + + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { + left = match[1]; + match.splice( 1, 1 ); + + if ( left.substr( left.length - 1 ) !== "\\" ) { + match[1] = (match[1] || "").replace( rBackslash, "" ); + set = Expr.find[ type ]( match, context, isXML ); + + if ( set != null ) { + expr = expr.replace( Expr.match[ type ], "" ); + break; + } + } + } + } + + if ( !set ) { + set = typeof context.getElementsByTagName !== "undefined" ? + context.getElementsByTagName( "*" ) : + []; + } + + return { set: set, expr: expr }; +}; + +Sizzle.filter = function( expr, set, inplace, not ) { + var match, anyFound, + type, found, item, filter, left, + i, pass, + old = expr, + result = [], + curLoop = set, + isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); + + while ( expr && set.length ) { + for ( type in Expr.filter ) { + if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { + filter = Expr.filter[ type ]; + left = match[1]; + + anyFound = false; + + match.splice(1,1); + + if ( left.substr( left.length - 1 ) === "\\" ) { + continue; + } + + if ( curLoop === result ) { + result = []; + } + + if ( Expr.preFilter[ type ] ) { + match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); + + if ( !match ) { + anyFound = found = true; + + } else if ( match === true ) { + continue; + } + } + + if ( match ) { + for ( i = 0; (item = curLoop[i]) != null; i++ ) { + if ( item ) { + found = filter( item, match, i, curLoop ); + pass = not ^ found; + + if ( inplace && found != null ) { + if ( pass ) { + anyFound = true; + + } else { + curLoop[i] = false; + } + + } else if ( pass ) { + result.push( item ); + anyFound = true; + } + } + } + } + + if ( found !== undefined ) { + if ( !inplace ) { + curLoop = result; + } + + expr = expr.replace( Expr.match[ type ], "" ); + + if ( !anyFound ) { + return []; + } + + break; + } + } + } + + // Improper expression + if ( expr === old ) { + if ( anyFound == null ) { + Sizzle.error( expr ); + + } else { + break; + } + } + + old = expr; + } + + return curLoop; +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +/** + * Utility function for retreiving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +var getText = Sizzle.getText = function( elem ) { + var i, node, + nodeType = elem.nodeType, + ret = ""; + + if ( nodeType ) { + if ( nodeType === 1 || nodeType === 9 ) { + // Use textContent || innerText for elements + if ( typeof elem.textContent === 'string' ) { + return elem.textContent; + } else if ( typeof elem.innerText === 'string' ) { + // Replace IE's carriage returns + return elem.innerText.replace( rReturn, '' ); + } else { + // Traverse it's children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + } else { + + // If no nodeType, this is expected to be an array + for ( i = 0; (node = elem[i]); i++ ) { + // Do not traverse comment nodes + if ( node.nodeType !== 8 ) { + ret += getText( node ); + } + } + } + return ret; +}; + +var Expr = Sizzle.selectors = { + order: [ "ID", "NAME", "TAG" ], + + match: { + ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, + ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, + TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, + CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, + POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, + PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ + }, + + leftMatch: {}, + + attrMap: { + "class": "className", + "for": "htmlFor" + }, + + attrHandle: { + href: function( elem ) { + return elem.getAttribute( "href" ); + }, + type: function( elem ) { + return elem.getAttribute( "type" ); + } + }, + + relative: { + "+": function(checkSet, part){ + var isPartStr = typeof part === "string", + isTag = isPartStr && !rNonWord.test( part ), + isPartStrNotTag = isPartStr && !isTag; + + if ( isTag ) { + part = part.toLowerCase(); + } + + for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { + if ( (elem = checkSet[i]) ) { + while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} + + checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? + elem || false : + elem === part; + } + } + + if ( isPartStrNotTag ) { + Sizzle.filter( part, checkSet, true ); + } + }, + + ">": function( checkSet, part ) { + var elem, + isPartStr = typeof part === "string", + i = 0, + l = checkSet.length; + + if ( isPartStr && !rNonWord.test( part ) ) { + part = part.toLowerCase(); + + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + var parent = elem.parentNode; + checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; + } + } + + } else { + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + checkSet[i] = isPartStr ? + elem.parentNode : + elem.parentNode === part; + } + } + + if ( isPartStr ) { + Sizzle.filter( part, checkSet, true ); + } + } + }, + + "": function(checkSet, part, isXML){ + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !rNonWord.test( part ) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); + }, + + "~": function( checkSet, part, isXML ) { + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !rNonWord.test( part ) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); + } + }, + + find: { + ID: function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + return m && m.parentNode ? [m] : []; + } + }, + + NAME: function( match, context ) { + if ( typeof context.getElementsByName !== "undefined" ) { + var ret = [], + results = context.getElementsByName( match[1] ); + + for ( var i = 0, l = results.length; i < l; i++ ) { + if ( results[i].getAttribute("name") === match[1] ) { + ret.push( results[i] ); + } + } + + return ret.length === 0 ? null : ret; + } + }, + + TAG: function( match, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( match[1] ); + } + } + }, + preFilter: { + CLASS: function( match, curLoop, inplace, result, not, isXML ) { + match = " " + match[1].replace( rBackslash, "" ) + " "; + + if ( isXML ) { + return match; + } + + for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { + if ( elem ) { + if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) { + if ( !inplace ) { + result.push( elem ); + } + + } else if ( inplace ) { + curLoop[i] = false; + } + } + } + + return false; + }, + + ID: function( match ) { + return match[1].replace( rBackslash, "" ); + }, + + TAG: function( match, curLoop ) { + return match[1].replace( rBackslash, "" ).toLowerCase(); + }, + + CHILD: function( match ) { + if ( match[1] === "nth" ) { + if ( !match[2] ) { + Sizzle.error( match[0] ); + } + + match[2] = match[2].replace(/^\+|\s*/g, ''); + + // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' + var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec( + match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || + !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); + + // calculate the numbers (first)n+(last) including if they are negative + match[2] = (test[1] + (test[2] || 1)) - 0; + match[3] = test[3] - 0; + } + else if ( match[2] ) { + Sizzle.error( match[0] ); + } + + // TODO: Move to normal caching system + match[0] = done++; + + return match; + }, + + ATTR: function( match, curLoop, inplace, result, not, isXML ) { + var name = match[1] = match[1].replace( rBackslash, "" ); + + if ( !isXML && Expr.attrMap[name] ) { + match[1] = Expr.attrMap[name]; + } + + // Handle if an un-quoted value was used + match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" ); + + if ( match[2] === "~=" ) { + match[4] = " " + match[4] + " "; + } + + return match; + }, + + PSEUDO: function( match, curLoop, inplace, result, not ) { + if ( match[1] === "not" ) { + // If we're dealing with a complex expression, or a simple one + if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { + match[3] = Sizzle(match[3], null, null, curLoop); + + } else { + var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); + + if ( !inplace ) { + result.push.apply( result, ret ); + } + + return false; + } + + } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { + return true; + } + + return match; + }, + + POS: function( match ) { + match.unshift( true ); + + return match; + } + }, + + filters: { + enabled: function( elem ) { + return elem.disabled === false && elem.type !== "hidden"; + }, + + disabled: function( elem ) { + return elem.disabled === true; + }, + + checked: function( elem ) { + return elem.checked === true; + }, + + selected: function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + parent: function( elem ) { + return !!elem.firstChild; + }, + + empty: function( elem ) { + return !elem.firstChild; + }, + + has: function( elem, i, match ) { + return !!Sizzle( match[3], elem ).length; + }, + + header: function( elem ) { + return (/h\d/i).test( elem.nodeName ); + }, + + text: function( elem ) { + var attr = elem.getAttribute( "type" ), type = elem.type; + // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) + // use getAttribute instead to test this case + return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); + }, + + radio: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type; + }, + + checkbox: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type; + }, + + file: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "file" === elem.type; + }, + + password: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "password" === elem.type; + }, + + submit: function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && "submit" === elem.type; + }, + + image: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "image" === elem.type; + }, + + reset: function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && "reset" === elem.type; + }, + + button: function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && "button" === elem.type || name === "button"; + }, + + input: function( elem ) { + return (/input|select|textarea|button/i).test( elem.nodeName ); + }, + + focus: function( elem ) { + return elem === elem.ownerDocument.activeElement; + } + }, + setFilters: { + first: function( elem, i ) { + return i === 0; + }, + + last: function( elem, i, match, array ) { + return i === array.length - 1; + }, + + even: function( elem, i ) { + return i % 2 === 0; + }, + + odd: function( elem, i ) { + return i % 2 === 1; + }, + + lt: function( elem, i, match ) { + return i < match[3] - 0; + }, + + gt: function( elem, i, match ) { + return i > match[3] - 0; + }, + + nth: function( elem, i, match ) { + return match[3] - 0 === i; + }, + + eq: function( elem, i, match ) { + return match[3] - 0 === i; + } + }, + filter: { + PSEUDO: function( elem, match, i, array ) { + var name = match[1], + filter = Expr.filters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + + } else if ( name === "contains" ) { + return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0; + + } else if ( name === "not" ) { + var not = match[3]; + + for ( var j = 0, l = not.length; j < l; j++ ) { + if ( not[j] === elem ) { + return false; + } + } + + return true; + + } else { + Sizzle.error( name ); + } + }, + + CHILD: function( elem, match ) { + var first, last, + doneName, parent, cache, + count, diff, + type = match[1], + node = elem; + + switch ( type ) { + case "only": + case "first": + while ( (node = node.previousSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + if ( type === "first" ) { + return true; + } + + node = elem; + + case "last": + while ( (node = node.nextSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + return true; + + case "nth": + first = match[2]; + last = match[3]; + + if ( first === 1 && last === 0 ) { + return true; + } + + doneName = match[0]; + parent = elem.parentNode; + + if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) { + count = 0; + + for ( node = parent.firstChild; node; node = node.nextSibling ) { + if ( node.nodeType === 1 ) { + node.nodeIndex = ++count; + } + } + + parent[ expando ] = doneName; + } + + diff = elem.nodeIndex - last; + + if ( first === 0 ) { + return diff === 0; + + } else { + return ( diff % first === 0 && diff / first >= 0 ); + } + } + }, + + ID: function( elem, match ) { + return elem.nodeType === 1 && elem.getAttribute("id") === match; + }, + + TAG: function( elem, match ) { + return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match; + }, + + CLASS: function( elem, match ) { + return (" " + (elem.className || elem.getAttribute("class")) + " ") + .indexOf( match ) > -1; + }, + + ATTR: function( elem, match ) { + var name = match[1], + result = Sizzle.attr ? + Sizzle.attr( elem, name ) : + Expr.attrHandle[ name ] ? + Expr.attrHandle[ name ]( elem ) : + elem[ name ] != null ? + elem[ name ] : + elem.getAttribute( name ), + value = result + "", + type = match[2], + check = match[4]; + + return result == null ? + type === "!=" : + !type && Sizzle.attr ? + result != null : + type === "=" ? + value === check : + type === "*=" ? + value.indexOf(check) >= 0 : + type === "~=" ? + (" " + value + " ").indexOf(check) >= 0 : + !check ? + value && result !== false : + type === "!=" ? + value !== check : + type === "^=" ? + value.indexOf(check) === 0 : + type === "$=" ? + value.substr(value.length - check.length) === check : + type === "|=" ? + value === check || value.substr(0, check.length + 1) === check + "-" : + false; + }, + + POS: function( elem, match, i, array ) { + var name = match[2], + filter = Expr.setFilters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + } + } + } +}; + +var origPOS = Expr.match.POS, + fescape = function(all, num){ + return "\\" + (num - 0 + 1); + }; + +for ( var type in Expr.match ) { + Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); + Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); +} + +var makeArray = function( array, results ) { + array = Array.prototype.slice.call( array, 0 ); + + if ( results ) { + results.push.apply( results, array ); + return results; + } + + return array; +}; + +// Perform a simple check to determine if the browser is capable of +// converting a NodeList to an array using builtin methods. +// Also verifies that the returned array holds DOM nodes +// (which is not the case in the Blackberry browser) +try { + Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; + +// Provide a fallback method if it does not work +} catch( e ) { + makeArray = function( array, results ) { + var i = 0, + ret = results || []; + + if ( toString.call(array) === "[object Array]" ) { + Array.prototype.push.apply( ret, array ); + + } else { + if ( typeof array.length === "number" ) { + for ( var l = array.length; i < l; i++ ) { + ret.push( array[i] ); + } + + } else { + for ( ; array[i]; i++ ) { + ret.push( array[i] ); + } + } + } + + return ret; + }; +} + +var sortOrder, siblingCheck; + +if ( document.documentElement.compareDocumentPosition ) { + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { + return a.compareDocumentPosition ? -1 : 1; + } + + return a.compareDocumentPosition(b) & 4 ? -1 : 1; + }; + +} else { + sortOrder = function( a, b ) { + // The nodes are identical, we can exit early + if ( a === b ) { + hasDuplicate = true; + return 0; + + // Fallback to using sourceIndex (in IE) if it's available on both nodes + } else if ( a.sourceIndex && b.sourceIndex ) { + return a.sourceIndex - b.sourceIndex; + } + + var al, bl, + ap = [], + bp = [], + aup = a.parentNode, + bup = b.parentNode, + cur = aup; + + // If the nodes are siblings (or identical) we can do a quick check + if ( aup === bup ) { + return siblingCheck( a, b ); + + // If no parents were found then the nodes are disconnected + } else if ( !aup ) { + return -1; + + } else if ( !bup ) { + return 1; + } + + // Otherwise they're somewhere else in the tree so we need + // to build up a full list of the parentNodes for comparison + while ( cur ) { + ap.unshift( cur ); + cur = cur.parentNode; + } + + cur = bup; + + while ( cur ) { + bp.unshift( cur ); + cur = cur.parentNode; + } + + al = ap.length; + bl = bp.length; + + // Start walking down the tree looking for a discrepancy + for ( var i = 0; i < al && i < bl; i++ ) { + if ( ap[i] !== bp[i] ) { + return siblingCheck( ap[i], bp[i] ); + } + } + + // We ended someplace up the tree so do a sibling check + return i === al ? + siblingCheck( a, bp[i], -1 ) : + siblingCheck( ap[i], b, 1 ); + }; + + siblingCheck = function( a, b, ret ) { + if ( a === b ) { + return ret; + } + + var cur = a.nextSibling; + + while ( cur ) { + if ( cur === b ) { + return -1; + } + + cur = cur.nextSibling; + } + + return 1; + }; +} + +// Check to see if the browser returns elements by name when +// querying by getElementById (and provide a workaround) +(function(){ + // We're going to inject a fake input element with a specified name + var form = document.createElement("div"), + id = "script" + (new Date()).getTime(), + root = document.documentElement; + + form.innerHTML = ""; + + // Inject it into the root element, check its status, and remove it quickly + root.insertBefore( form, root.firstChild ); + + // The workaround has to do additional checks after a getElementById + // Which slows things down for other browsers (hence the branching) + if ( document.getElementById( id ) ) { + Expr.find.ID = function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + + return m ? + m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? + [m] : + undefined : + []; + } + }; + + Expr.filter.ID = function( elem, match ) { + var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); + + return elem.nodeType === 1 && node && node.nodeValue === match; + }; + } + + root.removeChild( form ); + + // release memory in IE + root = form = null; +})(); + +(function(){ + // Check to see if the browser returns only elements + // when doing getElementsByTagName("*") + + // Create a fake element + var div = document.createElement("div"); + div.appendChild( document.createComment("") ); + + // Make sure no comments are found + if ( div.getElementsByTagName("*").length > 0 ) { + Expr.find.TAG = function( match, context ) { + var results = context.getElementsByTagName( match[1] ); + + // Filter out possible comments + if ( match[1] === "*" ) { + var tmp = []; + + for ( var i = 0; results[i]; i++ ) { + if ( results[i].nodeType === 1 ) { + tmp.push( results[i] ); + } + } + + results = tmp; + } + + return results; + }; + } + + // Check to see if an attribute returns normalized href attributes + div.innerHTML = ""; + + if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && + div.firstChild.getAttribute("href") !== "#" ) { + + Expr.attrHandle.href = function( elem ) { + return elem.getAttribute( "href", 2 ); + }; + } + + // release memory in IE + div = null; +})(); + +if ( document.querySelectorAll ) { + (function(){ + var oldSizzle = Sizzle, + div = document.createElement("div"), + id = "__sizzle__"; + + div.innerHTML = "

      "; + + // Safari can't handle uppercase or unicode characters when + // in quirks mode. + if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { + return; + } + + Sizzle = function( query, context, extra, seed ) { + context = context || document; + + // Only use querySelectorAll on non-XML documents + // (ID selectors don't work in non-HTML documents) + if ( !seed && !Sizzle.isXML(context) ) { + // See if we find a selector to speed up + var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); + + if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { + // Speed-up: Sizzle("TAG") + if ( match[1] ) { + return makeArray( context.getElementsByTagName( query ), extra ); + + // Speed-up: Sizzle(".CLASS") + } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { + return makeArray( context.getElementsByClassName( match[2] ), extra ); + } + } + + if ( context.nodeType === 9 ) { + // Speed-up: Sizzle("body") + // The body element only exists once, optimize finding it + if ( query === "body" && context.body ) { + return makeArray( [ context.body ], extra ); + + // Speed-up: Sizzle("#ID") + } else if ( match && match[3] ) { + var elem = context.getElementById( match[3] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id === match[3] ) { + return makeArray( [ elem ], extra ); + } + + } else { + return makeArray( [], extra ); + } + } + + try { + return makeArray( context.querySelectorAll(query), extra ); + } catch(qsaError) {} + + // qSA works strangely on Element-rooted queries + // We can work around this by specifying an extra ID on the root + // and working up from there (Thanks to Andrew Dupont for the technique) + // IE 8 doesn't work on object elements + } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { + var oldContext = context, + old = context.getAttribute( "id" ), + nid = old || id, + hasParent = context.parentNode, + relativeHierarchySelector = /^\s*[+~]/.test( query ); + + if ( !old ) { + context.setAttribute( "id", nid ); + } else { + nid = nid.replace( /'/g, "\\$&" ); + } + if ( relativeHierarchySelector && hasParent ) { + context = context.parentNode; + } + + try { + if ( !relativeHierarchySelector || hasParent ) { + return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra ); + } + + } catch(pseudoError) { + } finally { + if ( !old ) { + oldContext.removeAttribute( "id" ); + } + } + } + } + + return oldSizzle(query, context, extra, seed); + }; + + for ( var prop in oldSizzle ) { + Sizzle[ prop ] = oldSizzle[ prop ]; + } + + // release memory in IE + div = null; + })(); +} + +(function(){ + var html = document.documentElement, + matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector; + + if ( matches ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9 fails this) + var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ), + pseudoWorks = false; + + try { + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( document.documentElement, "[test!='']:sizzle" ); + + } catch( pseudoError ) { + pseudoWorks = true; + } + + Sizzle.matchesSelector = function( node, expr ) { + // Make sure that attribute selectors are quoted + expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); + + if ( !Sizzle.isXML( node ) ) { + try { + if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { + var ret = matches.call( node, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || !disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9, so check for that + node.document && node.document.nodeType !== 11 ) { + return ret; + } + } + } catch(e) {} + } + + return Sizzle(expr, null, null, [node]).length > 0; + }; + } +})(); + +(function(){ + var div = document.createElement("div"); + + div.innerHTML = "
      "; + + // Opera can't find a second classname (in 9.6) + // Also, make sure that getElementsByClassName actually exists + if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { + return; + } + + // Safari caches class attributes, doesn't catch changes (in 3.2) + div.lastChild.className = "e"; + + if ( div.getElementsByClassName("e").length === 1 ) { + return; + } + + Expr.order.splice(1, 0, "CLASS"); + Expr.find.CLASS = function( match, context, isXML ) { + if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { + return context.getElementsByClassName(match[1]); + } + }; + + // release memory in IE + div = null; +})(); + +function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem[ expando ] === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 && !isXML ){ + elem[ expando ] = doneName; + elem.sizset = i; + } + + if ( elem.nodeName.toLowerCase() === cur ) { + match = elem; + break; + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem[ expando ] === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 ) { + if ( !isXML ) { + elem[ expando ] = doneName; + elem.sizset = i; + } + + if ( typeof cur !== "string" ) { + if ( elem === cur ) { + match = true; + break; + } + + } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { + match = elem; + break; + } + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +if ( document.documentElement.contains ) { + Sizzle.contains = function( a, b ) { + return a !== b && (a.contains ? a.contains(b) : true); + }; + +} else if ( document.documentElement.compareDocumentPosition ) { + Sizzle.contains = function( a, b ) { + return !!(a.compareDocumentPosition(b) & 16); + }; + +} else { + Sizzle.contains = function() { + return false; + }; +} + +Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; + + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +var posProcess = function( selector, context, seed ) { + var match, + tmpSet = [], + later = "", + root = context.nodeType ? [context] : context; + + // Position selectors must be done after the filter + // And so must :not(positional) so we move all PSEUDOs to the end + while ( (match = Expr.match.PSEUDO.exec( selector )) ) { + later += match[0]; + selector = selector.replace( Expr.match.PSEUDO, "" ); + } + + selector = Expr.relative[selector] ? selector + "*" : selector; + + for ( var i = 0, l = root.length; i < l; i++ ) { + Sizzle( selector, root[i], tmpSet, seed ); + } + + return Sizzle.filter( later, tmpSet ); +}; + +// EXPOSE +// Override sizzle attribute retrieval +Sizzle.attr = jQuery.attr; +Sizzle.selectors.attrMap = {}; +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[":"] = jQuery.expr.filters; +jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; + + +})(); + + +var runtil = /Until$/, + rparentsprev = /^(?:parents|prevUntil|prevAll)/, + // Note: This RegExp should be improved, or likely pulled from Sizzle + rmultiselector = /,/, + isSimple = /^.[^:#\[\.,]*$/, + slice = Array.prototype.slice, + POS = jQuery.expr.match.POS, + // methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend({ + find: function( selector ) { + var self = this, + i, l; + + if ( typeof selector !== "string" ) { + return jQuery( selector ).filter(function() { + for ( i = 0, l = self.length; i < l; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + }); + } + + var ret = this.pushStack( "", "find", selector ), + length, n, r; + + for ( i = 0, l = this.length; i < l; i++ ) { + length = ret.length; + jQuery.find( selector, this[i], ret ); + + if ( i > 0 ) { + // Make sure that the results are unique + for ( n = length; n < ret.length; n++ ) { + for ( r = 0; r < length; r++ ) { + if ( ret[r] === ret[n] ) { + ret.splice(n--, 1); + break; + } + } + } + } + } + + return ret; + }, + + has: function( target ) { + var targets = jQuery( target ); + return this.filter(function() { + for ( var i = 0, l = targets.length; i < l; i++ ) { + if ( jQuery.contains( this, targets[i] ) ) { + return true; + } + } + }); + }, + + not: function( selector ) { + return this.pushStack( winnow(this, selector, false), "not", selector); + }, + + filter: function( selector ) { + return this.pushStack( winnow(this, selector, true), "filter", selector ); + }, + + is: function( selector ) { + return !!selector && ( + typeof selector === "string" ? + // If this is a positional selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + POS.test( selector ) ? + jQuery( selector, this.context ).index( this[0] ) >= 0 : + jQuery.filter( selector, this ).length > 0 : + this.filter( selector ).length > 0 ); + }, + + closest: function( selectors, context ) { + var ret = [], i, l, cur = this[0]; + + // Array (deprecated as of jQuery 1.7) + if ( jQuery.isArray( selectors ) ) { + var level = 1; + + while ( cur && cur.ownerDocument && cur !== context ) { + for ( i = 0; i < selectors.length; i++ ) { + + if ( jQuery( cur ).is( selectors[ i ] ) ) { + ret.push({ selector: selectors[ i ], elem: cur, level: level }); + } + } + + cur = cur.parentNode; + level++; + } + + return ret; + } + + // String + var pos = POS.test( selectors ) || typeof selectors !== "string" ? + jQuery( selectors, context || this.context ) : + 0; + + for ( i = 0, l = this.length; i < l; i++ ) { + cur = this[i]; + + while ( cur ) { + if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { + ret.push( cur ); + break; + + } else { + cur = cur.parentNode; + if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) { + break; + } + } + } + } + + ret = ret.length > 1 ? jQuery.unique( ret ) : ret; + + return this.pushStack( ret, "closest", selectors ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1; + } + + // index in selector + if ( typeof elem === "string" ) { + return jQuery.inArray( this[0], jQuery( elem ) ); + } + + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[0] : elem, this ); + }, + + add: function( selector, context ) { + var set = typeof selector === "string" ? + jQuery( selector, context ) : + jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), + all = jQuery.merge( this.get(), set ); + + return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? + all : + jQuery.unique( all ) ); + }, + + andSelf: function() { + return this.add( this.prevObject ); + } +}); + +// A painfully simple check to see if an element is disconnected +// from a document (should be improved, where feasible). +function isDisconnected( node ) { + return !node || !node.parentNode || node.parentNode.nodeType === 11; +} + +jQuery.each({ + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return jQuery.dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return jQuery.dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return jQuery.nth( elem, 2, "nextSibling" ); + }, + prev: function( elem ) { + return jQuery.nth( elem, 2, "previousSibling" ); + }, + nextAll: function( elem ) { + return jQuery.dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return jQuery.dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return jQuery.dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return jQuery.dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return jQuery.sibling( elem.parentNode.firstChild, elem ); + }, + children: function( elem ) { + return jQuery.sibling( elem.firstChild ); + }, + contents: function( elem ) { + return jQuery.nodeName( elem, "iframe" ) ? + elem.contentDocument || elem.contentWindow.document : + jQuery.makeArray( elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var ret = jQuery.map( this, fn, until ); + + if ( !runtil.test( name ) ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + ret = jQuery.filter( selector, ret ); + } + + ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; + + if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { + ret = ret.reverse(); + } + + return this.pushStack( ret, name, slice.call( arguments ).join(",") ); + }; +}); + +jQuery.extend({ + filter: function( expr, elems, not ) { + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return elems.length === 1 ? + jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : + jQuery.find.matches(expr, elems); + }, + + dir: function( elem, dir, until ) { + var matched = [], + cur = elem[ dir ]; + + while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { + if ( cur.nodeType === 1 ) { + matched.push( cur ); + } + cur = cur[dir]; + } + return matched; + }, + + nth: function( cur, result, dir, elem ) { + result = result || 1; + var num = 0; + + for ( ; cur; cur = cur[dir] ) { + if ( cur.nodeType === 1 && ++num === result ) { + break; + } + } + + return cur; + }, + + sibling: function( n, elem ) { + var r = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + r.push( n ); + } + } + + return r; + } +}); + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, keep ) { + + // Can't pass null or undefined to indexOf in Firefox 4 + // Set to 0 to skip string check + qualifier = qualifier || 0; + + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep(elements, function( elem, i ) { + var retVal = !!qualifier.call( elem, i, elem ); + return retVal === keep; + }); + + } else if ( qualifier.nodeType ) { + return jQuery.grep(elements, function( elem, i ) { + return ( elem === qualifier ) === keep; + }); + + } else if ( typeof qualifier === "string" ) { + var filtered = jQuery.grep(elements, function( elem ) { + return elem.nodeType === 1; + }); + + if ( isSimple.test( qualifier ) ) { + return jQuery.filter(qualifier, filtered, !keep); + } else { + qualifier = jQuery.filter( qualifier, filtered ); + } + } + + return jQuery.grep(elements, function( elem, i ) { + return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; + }); +} + + + + +function createSafeFragment( document ) { + var list = nodeNames.split( "|" ), + safeFrag = document.createDocumentFragment(); + + if ( safeFrag.createElement ) { + while ( list.length ) { + safeFrag.createElement( + list.pop() + ); + } + } + return safeFrag; +} + +var nodeNames = "abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|" + + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", + rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, + rleadingWhitespace = /^\s+/, + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, + rtagName = /<([\w:]+)/, + rtbody = /", "" ], + legend: [ 1, "
      ", "
      " ], + thead: [ 1, "", "
      " ], + tr: [ 2, "", "
      " ], + td: [ 3, "", "
      " ], + col: [ 2, "", "
      " ], + area: [ 1, "", "" ], + _default: [ 0, "", "" ] + }, + safeFragment = createSafeFragment( document ); + +wrapMap.optgroup = wrapMap.option; +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// IE can't serialize and